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.
INTEGER FUNCTION NF_REDEF(INTEGER NCID)
NCIDNF_REDEF returns the value NF_NOERR if no errors occurred. Otherwise, the returned status indicates an error. Possible causes of errors include:
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)