Fixed nofill bug, cosmetic updates to tutrial

This commit is contained in:
Russ Rew 2011-04-28 15:08:03 +00:00
parent d8a85aef35
commit 0f4a94518d
3 changed files with 27 additions and 7 deletions

View File

@ -504,6 +504,23 @@ px_get(ncio *const nciop, ncio_px *const pxp,
pxp->bf_cnt -= pxp->blksz;
/* copy upper half into lower half */
(void) memcpy(pxp->bf_base, middle, pxp->bf_cnt);
} else { /* added to fix nofill bug */
void *const middle =
(void *)((char *)pxp->bf_base + pxp->blksz);
assert(pxp->bf_extent == 2 * pxp->blksz);
if(fIsSet(pxp->bf_rflags, RGN_MODIFIED))
{
/* still have to page out lower half, if modifies */
assert(pxp->bf_refcount <= 0);
status = px_pgout(nciop,
pxp->bf_offset,
pxp->blksz,
pxp->bf_base,
&pxp->pos);
if(status != ENOERR)
return status;
}
pxp->bf_cnt -= 0;;
}
pxp->bf_offset = blkoffset;
/* pxp->bf_extent = pxp->blksz; */

View File

@ -372,7 +372,7 @@ netCDF variables. Variables are N-dimensional arrays of data, with a
name and an associated set of netCDF dimensions.
It is also customary to add one variable for each dimension, to hold
the values along that axis. These variables are call ``coordinate
the values along that axis. These variables are called ``coordinate
variables.'' The latitude coordinate variable would be a
one-dimensional variable (with latitude as its dimension), and it
would hold the latitude values at each point along the axis.
@ -432,7 +432,7 @@ Since each group functions as a complete netCDF classic dataset, it is
possible to have variables with the same name in two or more different
groups, within the same netCDF-4/HDF5 data file.
Dimensions have a special scope: they may me seen my all variables in
Dimensions have a special scope: they may be seen by all variables in
their group, and all descendant groups. This allows the user to define
dimensions in a top-level group, and use them in many sub-groups.
@ -534,8 +534,11 @@ Using attributes it is possible to capture metadata that would
otherwise be separated from the data. Various conventions have been
established. By using a set of conventions, a data producer is more
likely to produce files that can be easily shared within the research
community, and that contain enough details to be useful as a
long-term archive.
community, and that contain enough details to be useful as a long-term
archive. Conventions also make it easier to develop software that
interprets information represented in data, because a convention
selects one conventional way to represent information when multiple
equivalent representations are possible.
For more information on _FillValue and other attribute conventions,
see @ref{Attribute Conventions,,, netcdf, @value{n-man}}.
@ -558,8 +561,8 @@ files. Before writing your own program, check to see if any existing
programs meet your needs.
Two utilities come with the netCDF distribution: ncdump and
ncgen. The ncdump command reads a netCDF file and outputs ASCII in
a format called CDL. The ncgen command reads an ASCII file in CDL
ncgen. The ncdump command reads a netCDF file and outputs text in
a format called CDL. The ncgen command reads a text file in CDL
format, and generates a netCDF data file.
One common use for ncdump is to examine the metadata of a netCDF file,

View File

@ -84,7 +84,7 @@ main(int argc, char **argv)
printf("\n*** Testing nofill mode.\n");
printf("*** Create file in nofill mode, writing all values...");
{
#define NUM_TRIES 4000
#define NUM_TRIES 1
int ncid;
size_t idx[1] = {0};
double data;