This function is a variant of nc_create, nc_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 nc_create_par.
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.
This function is only available for netCDF-4 files. The creation mode flag must include NC_NETCDF4.
When a netCDF-4 file is created for parallel access, collective operations are the default. To use independent access on a variable, See nc_var_par_access.
int nc_create_par(const char *path, int cmode, MPI_Comm comm,
MPI_Info info, int ncidp);
pathcmodeSetting NC_NOCLOBBER means you do not want to clobber (overwrite) an existing dataset; an error (NC_EEXIST) is returned if the specified dataset already exists.
The NC_SHARE flag is ignored.
comminfoncidpNC_NOERR #include <netcdf.h>
...
int status;
int ncid;
...
*chunksize = 1024;
status = nc__create("foo.nc", NC_NOCLOBBER, initialsz, chunksize, &ncid);
if (status != NC_NOERR) handle_error(status);