!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Routines to manage the GTEMPLATE package
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
module gtemplate_package
  use gtemplate_messaging
  use gtemplate_language
  !
  public :: gtemplate_pack_init,gtemplate_pack_clean
  private
  !
contains
  !
  subroutine gtemplate_pack_init(gpack_id,error)
    use gkernel_interfaces
    !----------------------------------------------------------------------
    ! 
    !----------------------------------------------------------------------
    integer(kind=4), intent(in)    :: gpack_id
    logical,         intent(inout) :: error
    ! Local
    integer(kind=4) :: ier
    !
    call gtemplate_message_set_id(gpack_id)
    !
    ! Specific variables
    ier = sic_setlog('gag_help_gtemplate','gag_doc:hlp/gtemplate-help-template.hlp')
    if (ier.eq.0) then
      error=.true.
      return
    endif
    !
    ! Load local language
    call gtemplate_load
    !
    ! Specific initializations
  end subroutine gtemplate_pack_init
  !
  subroutine gtemplate_pack_clean(error)
    !----------------------------------------------------------------------
    ! Called at end of session. Might clean here for example global buffers
    ! allocated during the session
    !----------------------------------------------------------------------
    logical :: error
    !
    print *,"Called gtemplate_pack_clean"
  end subroutine gtemplate_pack_clean
end module gtemplate_package
!
subroutine gtemplate_pack_set(pack)
  use gpack_def
  use gkernel_interfaces
  use gtemplate_package
  !
  type(gpack_info_t), intent(out) :: pack
  !
  pack%name='template'
  pack%ext='.gtemplate'
  pack%depend(1:1) = (/ locwrd(sic_pack_set) /) ! List here dependencies
  pack%init=locwrd(gtemplate_pack_init)
  pack%clean=locwrd(gtemplate_pack_clean)
end subroutine gtemplate_pack_set
!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
