subroutine kameleon_test(model,itime,mlt,mlat,variable_in,value_ou &t) c My attempt at a fortran program. This is an example program c mainly to test the time interpolator external f_timeinterp_create external f_timeinterp_addtimestep external f_timeinterp_managemem,f_timeinterp_interpolate external f_timeinterp_timetoepoch external f_timeinterp_timestrtoepoch external f_timeinterp_closeandcleanupmemory c Variables to be used for interpolation and data extraction character*300 cdf_file_path1 character*300 cdf_file_path2 character*100 file_path,model character*25 time character*100 variable,variable_in(3) c real*8 time_epoch integer tid integer itime(6) parameter (nlat = 22, nmlt = 21) C parameter (nlat = 181, nmlt = 25) C parameter (nlat = 37, nmlt = 25) real*8 value_out(3,nlat,nmlt),mlat(nlat,nmlt),mlt(nlat,nmlt) zero = 0 time_epoch = 0. file_path='/droboraid5/ionosphere/GEM-CEDAR/MI-coupling/fortran_te &st/swmf_out/E.2006.347' iyear=itime(1) imon=itime(2) iday=itime(3) ihh=itime(4) imm=itime(5) iss=itime(6) imm1=imm/5*5 imm2=imm1+5 if(imm2.eq.60) then imm2=0 ihh1=ihh ihh2=ihh1+1 else ihh1=ihh ihh2=ihh1 endif if(ihh2.eq.24) then ihh2=0 iday1=iday iday2=iday1+1 else iday1=iday iday2=iday1 endif imon1=imon imon2=imon1 iyear1=iyear iyear2=iyear1 write(cdf_file_path1,'(".i_e",i4.4,2i2.2,"-",2i2.2,"00-000.cdf")') & iyear1,imon1,iday1,ihh1,imm1 cdf_file_path1=file_path(1:nstrng(file_path))//'/'//model(1:nstrng &(model))//cdf_file_path1 write(cdf_file_path2,'(".i_e",i4.4,2i2.2,"-",2i2.2,"00-000.cdf")') & iyear2,imon2,iday2,ihh2,imm2 cdf_file_path2=file_path(1:nstrng(file_path))//'/'//model(1:nstrng &(model))//cdf_file_path2 C write(6,*) "need time info e.g: 2006-12-15T23:59:00.000Z" write(time,'(i4.4,2("-",i2.2),"T",2(i2.2,":"),i2.2,".000Z")') & iyear,imon,iday,ihh,imm,iss tid=0 call f_timeinterp_create(tid) call f_timeinterp_timestrtoepoch(time, time_epoch) call f_timeinterp_addtimestep(tid, cdf_file_path1) call f_timeinterp_addtimestep(tid, cdf_file_path2) do i = 1,3 ! variable call f_timeinterp_managemem(tid, time_epoch, variable_in(i)) do j = 1,nlat ! mlat_loop do k = 1,nmlt ! mlt_loop call f_timeinterp_interpolate(tid,time_epoch,variable_in(i), 0.0, &mlat(j,k), mlt(j,k), value_out(i,j,k)) enddo enddo enddo call f_timeinterp_closeandcleanupmemory(tid) print *, 'finished' end subroutine