Next: NF90_ENDDEF, Previous: NF90_OPEN, Up: Datasets
The function NF90_REDEF puts an open netCDF dataset into define mode, so dimensions, variables, and attributes can be added or renamed and attributes can be deleted.
function nf90_redef(ncid) integer, intent( in) :: ncid integer :: nf90_redef
ncid
NF90_REDEF returns the value NF90_NOERR if no errors occurred. Otherwise, the returned status indicates an error. Possible causes of errors include:
Here is an example using NF90_REDEF to open an existing netCDF dataset named foo.nc and put it into define mode:
use netcdf implicit none integer :: ncid, status ... status = nf90_open("foo.nc", nf90_write, ncid) ! Open dataset if (status /= nf90_noerr) call handle_err(status) ... status = nf90_redef(ncid) ! Put the file in define mode if (status /= nf90_noerr) call handle_err(status)