[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Netcdf question



"Renaud, William A." <address@hidden> writes:

> At first the user was using ncdump to get the variable in question, then
> editing it and running ncgen.  Upon running ncgen with the new value, all
> other variables were set to "_, _, ...".  I guess this is because they were
> specified in the CDL file variables section but were not in the data
> section.  As I understand it, ncgen is not 'aware' of a pre-existing file.
> Thus, it creates the netCDF file based only on what it is given in the ascii
> file.  Is that an accurate statement?

Yes, that is absolutely correct.

>
> At any rate, I'm in the process of writing a short code to open the old file
> and write the new values to it.  I don't know why that didn't occur to me
> earlier, but I think this will be much easier for the user.

Also it will be a lot faster because if you are dumping and then
re-reading the file, you are doing a lot of extra I/O and conversions.

You can just open the file, and use nc_put_vara_<type> if you are
writing an array of numbers, or nc_put_var1_<type> to change
individual data points.

Ed
-- 
Ed Hartnett  -- address@hidden