[Thread Prev][Thread Next][Index]

[ferret_users] fortran and ferret



Dear ferret users.
I wrote this small program in fortran and I was wondering if it is possible to write/to do something similar
in ferret  to do the operation on a spatial data (e.g. from netcdf files).

Thanks in advance for any help


Program sum7consecutivedays
       parameter (ni=366)
       dimension year(ni),month(ni),day(ni),tmin(ni),tmax(ni),tmean(ni),pre(ni)
       integer:: cnt,cdays,ncdays
       real:: tot,bigtot

    open(30,file='pre.txt')
     open(22,file='total.txt')

  cdays=7  !consecutive days
  cnt=0         ! count
  do j=1,ni  
     read(30,*) pre(j)
    cnt=cnt+1
  enddo
    bigtot=0
    do i=1,cnt-cdays+1
            tot=0
        do k=1,cdays
                  if(pre(i+k-1).ge.0.0) tot=tot+pre(i+k-1)
        enddo
        if(tot.gt.bigtot)bigtot=tot
    enddo
 write(22,10) bigtot
  close(22)
  close(30)
10      format (f10.1,1x)
    end




--
I.Pinto
:-)



[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement