
        
         integer itime(6)
         character*100 model,filepath,variables(3)
         parameter   (nlat = 22, nmlt = 21)
C         parameter   (nlat = 181, nmlt = 25)
C         parameter   (nlat = 37, nmlt = 25)
         real*8 mlts(nlat,nmlt),mlats(nlat,nmlt),value_out(3,nlat,nmlt)
         character*80 ccomm1
         character*80 ccomm2
          
         model='swmf'  
C         model='amie'  
         
         itime(1)= 2006      ! year
         itime(2)= 12        ! month
         itime(3)= 13        ! day
         itime(4)= 0         ! hour
         itime(5)= 10        ! min
         itime(6)= 0        ! sec
 
         variables(1)='ep'    ! electric potential in kV
         variables(2)='eave'  ! electron average energy in keV
         variables(3)='eflux' ! electron energy flux in W/m^2
    
          
        do i = 1,nlat  ! lat_loop
         do j = 1, nmlt  !   mlt_loop 
             mlts(i,j) = real(mod((j-1)*(24./(nmlt-1)), 24.))
             mlats(i,j)  = 90 - (i-1)*180./(nlat-1)
         enddo
        enddo

       call kameleon_test(model,itime,mlts,mlats,variables,value_out)

        end
         
CCCCCCC
      INTEGER FUNCTION NSTRNG( STRING )
C
C     Function returns number of characters in a string up to trailing blanks.
C     For example:   " idk ehj     " would return a value of 8, one leading
C       blank, one embedded blank, and 6 non-blank characters.
C
      CHARACTER*(*)      STRING

      N=LEN( STRING )
      DO 10 I=N,1,-1
         IF( STRING(I:I).NE.' ' .AND. STRING(I:I).NE.CHAR(0) ) GO TO 20
   10 CONTINUE
      I=0

   20 NSTRNG=I
      RETURN
      END
