[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #OCE-469376]: netcdf
- Subject: [netCDF #OCE-469376]: netcdf
- Date: Tue, 03 Jul 2007 15:05:18 -0600
Ben,
> I had tried that already. I just tried it again after reading your
> email and the output file sizes are exactly what they were before I
> uncommented the line you specified below.
Nevertheless, the code you provided just read the same data corresponding to
the first record repeatedly (20 times) instead of reading data for a different
time each time through the loop. NetCDF implements direct access I/O rather
than sequential I/O, which means the arguments you provide specify want data to
read, rather than the context of what was previously read. That's why it
permits reading a small subset of a large dataset efficiently. If you provide
the same arguments to nf90_get_var() for every loop iteration, it will return
the same data for every loop iteration. You have to specify which record you
want to read with the "start" argument, that specifies where (in index space)
to start reading data for each variable. In your cam_4D_rd_ncdf program, you
must update the record index of the start vector to the next record number each
time through the loop, with something equivalent to:
start(4) = rec
If you want more information about this, please see the documentation on
nf90_get_var, and especially the meaning of the "start" and "count" arguments at
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-f90.html#NF90_005fGET_005fVAR
> I sent you the compile command and the modules needed in a later
> email (maybe on July 1). I am attaching the c code that is also
> needed. I am not sure I sent that to you earlier.
You didn't, or the code for the write_met_module, but I can just comment those
out, since they aren't relevant to a netCDF problem. With that, the code
compiles OK, but you have to determine if it works as intended. I was just
pointing out that it looks like you want to read all the data for each variable
in the 4D code, but your program was only reading data in the first record
repeatedly.
--Russ
Russ Rew UCAR Unidata Program
address@hidden http://www.unidata.ucar.edu
Ticket Details
===================
Ticket ID: OCE-469376
Department: Support netCDF
Priority: Normal
Status: Closed