program GANMAIN
   use GANLIB
   implicit none
   character(len=131) :: hsmg
!
! local storage
   integer       :: iprint,ier
!
! gan-2000 external functions
   integer, external :: KERNEL
   interface
      integer(c_int) function ganmod(cmodul, nentry, hentry, ientry, jentry, &
                     kentry, hparam_c) bind(c)
         use, intrinsic :: iso_c_binding
         character(kind=c_char), dimension(*) :: cmodul
         integer(c_int), value :: nentry 
         character(kind=c_char), dimension(13,*) :: hentry
         integer(c_int), dimension(nentry) :: ientry, jentry
         type(c_ptr), dimension(nentry) :: kentry
         character(kind=c_char), dimension(73,*) :: hparam_c
       end function ganmod
    end interface
!----
!  execute the cle-2000 driver
!----
   iprint=0
   ier=KERNEL(ganmod,iprint)
   if( ier /= 0 )then
      write(hsmg,'(28hGANMAIN: kernel error (code=,I5,2h).)') ier
      call XABORT(hsmg)
   endif
   stop
end program GANMAIN
