Go to the previous, next section.
The function ncredef
(or NCREDF
for FORTRAN)
puts an open netCDF file into define mode, so dimensions, variables,
and attributes can be added or renamed and attributes can be deleted.
In case of an error, ncredef
returns -1; NCREDF
returns a
nonzero value in rcode
. Possible causes of errors include::
int ncredef(int ncid);
ncid
ncopen
or nccreate
.
Here is an example using ncredef
to open an existing NetCDF file
named `foo.nc' and put it into define mode:
#include "netcdf.h" ... int ncid; ... ncid = ncopen("foo.nc", NC_WRITE); /* open file */ ... ncredef(ncid); /* put in define mode */
SUBROUTINE NCREDF(INTEGER NCID, INTEGER RCODE)
NCID
NCOPN
or NCCRE
.
RCODE
Here is an example of using NCREDF
to open an existing netCDF file
named `foo.nc' and put it into define mode:
INCLUDE 'netcdf.inc' ... INTEGER NCID ... NCID = NCOPN('foo.nc', NCWRITE, RCODE) ... CALL NCREDF(NCID, RCODE)
Go to the previous, next section.