Next: , Previous: NF__OPEN, Up: Datasets


2.9 NF_REDEF

The function NF_REDEF puts an open netCDF dataset into define mode, so dimensions, variables, and attributes can be added or renamed and attributes can be deleted.

Usage

     INTEGER FUNCTION NF_REDEF(INTEGER NCID)
NCID
netCDF ID, from a previous call to NF_OPEN or NF_CREATE.

Errors

NF_REDEF returns the value NF_NOERR if no errors occurred. Otherwise, the returned status indicates an error. Possible causes of errors include:

Example

Here is an example using NF_REDEF to open an existing netCDF dataset named foo.nc and put it into define mode:

     INCLUDE 'netcdf.inc'
        ...
     INTEGER NCID, STATUS
        ...
     STATUS = NF_OPEN('foo.nc', NF_WRITE, NCID)   ! open dataset
     IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
        ...
     STATUS = NF_REDEF(NCID)                      ! put in define mode
     IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)