Next: , Previous: NF_SET_FILL, Up: Datasets


2.19 NF_SET_DEFAULT_FORMAT

This function is intended for advanced users.

In version 3.6, netCDF introduced a new data format, the first change in the underlying binary data format since the netCDF interface was released. The new format, 64-bit offset format, was introduced to greatly relax the limitations on creating very large files.

In version 4.0, another new binary format was introduced: netCDF-4/HDF5.

Users are warned that creating files in the 64-bit offset format makes them unreadable by the netCDF library prior to version 3.6.0, and creating files in netcdf-4/HDF5 format makes them unreadable by the netCDF library prior to version 4.0. For reasons of compatibility, users should continue to create files in netCDF classic format.

Users who do want to use 64-bit offset or netCDF-4/HDF5 format files can create them directory from NF_CREATE, using the proper cmode flag. (see NF_CREATE).

The function NF_SET_DEFAULT_FORMAT allows the user to change the format of the netCDF file to be created by future calls to NF_CREATE without changing the cmode flag.

This allows the user to convert a program to use the new formats without changing all calls the NF_CREATE.

Once the default format is set, all future created files will be in the desired format.

Constants are provided in the netcdf.inc file to be used with this function: nf_format_classic, nf_format_64bit, nf_format_netcdf4 and nf_format_netcdf4_classic.

Usage

     INTEGER FUNCTION NF_SET_DEFAULT_FORMAT(INTEGER FORMAT, INTEGER OLD_FORMT)
FORMAT
Either nf_format_classic, nf_format_64bit, nf_format_netcdf4 or nf_format_netcdf4_classic.
OLD_FORMAT
The default format at the time the function is called is returned here.

Errors

The following error codes may be returned by this function:

Example

     INCLUDE 'netcdf.inc'
        ...
     INTEGER STATUS, OLD_FORMAT
        ...
     STATUS = NF_SET_DEFAULT_FORMAT(nf_format_64bit, OLD_FORMAT)
     IF (STATUS .NE. NF_NOERR) CALL HANDLE_ERR(STATUS)
        ...