Next: , Previous: NF__CREATE, Up: Datasets


2.7 NF_CREATE_PAR

This function is a variant of nf_create, nf_create_par allows users to open a file on a MPI/IO or MPI/Posix parallel file system.

The parallel parameters are not written to the data file, they are only used for so long as the file remains open after an nf_create_par.

This function is only available if the netCDF library was built with parallel I/O.

This function creates a new netCDF dataset, returning a netCDF ID that can subsequently be used to refer to the netCDF dataset in other netCDF function calls. The new netCDF dataset opened for write access and placed in define mode, ready for you to add dimensions, variables, and attributes.

When a netCDF-4 file is created for parallel access, independent operations are the default. To use collective access on a variable, See NF_VAR_PAR_ACCESS.

Usage

     INTEGER FUNCTION NF_CREATE_PAR(CHARACTER*(*) PATH, INTEGER CMODE,
                                    INTEGER MPI_COMM, INTEGER MPI_INFO,
                                    INTEGER ncid)
PATH
The file name of the new netCDF dataset.
CMODE
The creation mode flag. The following flags are available: NF_NOCLOBBER, NF_NETCDF4 and NF_CLASSIC_MODEL. You can combine the affect of multiple flags in a single argument by using the bitwise OR operator. For example, to specify both NF_NOCLOBBER and NF_NETCDF4, you could provide the argument OR(NF_NOCLOBBER, NF_NETCDF4).

Setting NF_NETCDF4 causes netCDF to create a netCDF-4/HDF5 format file. Oring NF_CLASSIC_MODEL with NF_NETCDF4 causes the netCDF library to create a netCDF-4/HDF5 data file, with the netCDF classic model enforced - none of the new features of the netCDF-4 data model may be usedin such a file, for example groups and user-defined types.

Only netCDF-4/HDF5 files may be used with parallel I/O.

MPI_COMM
The MPI communicator.
MPI_INFO
The MPI info.
ncid
Returned netCDF ID.

Errors

NF_CREATE returns the value NF_NOERR if no errors occurred. Possible causes of errors include:

Example

This example is from test program nf_test/ftst_parallel.F.

     !     Create the netCDF file.
           mode_flag = IOR(nf_netcdf4, nf_classic_model)
           retval = nf_create_par(FILE_NAME, mode_flag, MPI_COMM_WORLD,
          $     MPI_INFO_NULL, ncid)
           if (retval .ne. nf_noerr) stop 2