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.
INTEGER FUNCTION NF_CREATE_PAR(CHARACTER*(*) PATH, INTEGER CMODE, INTEGER MPI_COMM, INTEGER MPI_INFO, INTEGER ncid)
PATH
CMODE
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
MPI_INFO
ncid
NF_CREATE returns the value NF_NOERR if no errors occurred. Possible causes of errors include:
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