writing x,y,z,t grids using fortran

Jamie Scott James.D.Scott at NOAA.GOV
Fri Oct 28 16:27:37 EDT 2005


I don't usually do my write statements with that notation, although it
may be equivalent.
Try this instead:
        open(15,file='myfile',
      *   form='unformatted',access='direct',action='write',
      *   recl=4*nlon*nlat*nlev*nt)

          write(15,rec=1) data

  Could it otherwise be a glitch in your data descriptor file?

On Oct 28, 2005, at 2:18 PM, Joy Romanski wrote:

> Hi GrADS users,
>
> I need to write (x,y,z,t) grids using Fortran 77 such that GrADS can
> read them.  When I use the code below,
>
>        open(15,file='myfile',
>      *   form='unformatted',access='direct',action='write',
>      *   recl=4*nlon*nlat*nlev)
>
>        do it=1,nt
>          write(15,rec=it) (((data(ilon,ilat,ilev,it),ilon=1,nlon),
>      *     ilat=1,nlat),ilev=1,nlev)
>        enddo
>
> the first grid (x, y varying, z=1,t=1) is correct but all of the
> other grids are wrong.  What am I doing wrong?
>
> Thanks!
>
> Joy Romanski



More information about the gradsusr mailing list