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

Re: Query re copying of netCDF files



On Sep 20,  2:27pm, Harvey DAVIES wrote:
> Subject: Query re copying of netCDF files
> Hi Glenn,
>
> Can you please clarify the conditions under which the whole file is copied
(to
> a tmp copy)? Section 9.1 of User Guide seems to imply that this happens
> whenever ncendef is called.  Is this correct (in both versions 2.4 & 3)?

In version 3, any copying which might occur takes place "in place", as
opposed to from one file to another. Moving of data only takes place if
the header changes size. (We could relax this so that it only takes place
if the header grows. For now, we move it when it shrinks so that files from
version 3 will compare "bit for bit" with files from version 2.)

Prior to version 3, a copy occurs whenever endef is called after a redef.

> The issue arose from users of FAN here & at GFDL who are accessing 500MB
> NCEP files with wrong valid_range attribute values (defined as scaled rather
> than unscaled values!)  I advised them to use text2nc to correct these values
> & assumed (since header does not increase in size) it would be done in place.
> But they both reported that this was not the case.

With netcdf 2, you can change the value of an attribute without entering
define mode, so no copy would take place.
If you enter define mode, a copy will take place on endef whether or not
you change anything.

> I am in the process of converting FAN to use netCDF 3.0.  Will this solve the
> problem?

Seems like the utility needs to be smarter about entering define mode
(== calling redef).  Modulo sizing text attributes, you almost never need
to call redef.

-glenn