fortran programs reading NetCDF

Jason Snyder jmssnyder at UCDAVIS.EDU
Thu Apr 2 02:11:54 EDT 2009


I have a program of global zonal wind data, with dimensions time,
latitude, longitude, pressure levels.  I was under the impression and this
is how I have done programs reading NetCDF in the past, that you use ncopn
to open NetCDF files.  I have the netcdf.inc file and ngen.h in the
current directory where my program is.  Here is a copy of the program as
it stands right now.  Can anyone help me with isolating out the problems
with this program because it has been a while since I have used programs
of reading and writing NetCDF files and I am a little rusty on it now.

c latitude, longitude, time
parameter(nlat=37,nlon=144,nyr=3288)
c number of dimensions
parameter(nvar=10)
parameter(ndims=3)
integer nci(nvar),ncid,iselvar(nvar)
integer input(nvar)
integer i,j,k
include 'netcdf.inc'
c data variables
real data(nlon,nlat), count(nlon,nlat,nyr)
real wnd(nlon,nlat,nyr)
c grads output files
parameter (undef=-9999.)
c open all netcdf files
nci(1)=ncopn('uwnd.2002.nc',ncnowrit,rcode)
data start/1,1,1/
count(1)=nlon
count(2)=nlat
count(3)=1
count(3)=nyr
call ncagt(ncid,id,start,count,i2dat,rcode)
call ncvgt(ncid,id,start,count,i2dat,rcode)
stop
end

Thanks,

Jason



More information about the gradsusr mailing list