Next: NF90_REDEF, Previous: NF90_OPEN, Up: Datasets
This function opens a netCDF-4 dataset for parallel access.
This function is only available if the netCDF library was built with a HDF5 library for which –enable-parallel was used, and which was linked (like HDF5) to MPI libraries.
This opens the file using either MPI-IO or MPI-POSIX. The file must be a netCDF-4 file. (That is, it must have been created using NF90_NETCDF4 in the creation mode).
This function is only available if netCDF-4 was build with a version of the HDF5 library which was built with –enable-parallel.
Before either HDF5 or netCDF-4 can be installed with support for parallel programming, and MPI layer must also be installed on the machine, and usually a parallel file system.
NetCDF-4 exposes the parallel access functionality of HDF5. For more information about what is required to install and use the parallel access functions, see the HDF5 web site.
When a netCDF-4 file is opened for parallel access, collective operations are the default. To use independent access on a variable, See NF90_VAR_PAR_ACCESS.
function nf90_open_par(path, cmode, comm, info, ncid)
character (len = *), intent(in) :: path
integer, intent(in) :: cmode
integer, intent(in) :: comm
integer, intent(in) :: info
integer, intent(out) :: ncid
integer :: nf90_open_par
end function nf90_open_par
PATHOMODEOtherwise, the mode may be NF90_WRITE. Setting the NF90_WRITE flag opens the dataset with read-write access. ("Writing" means any kind of change to the dataset, including appending or changing data, adding or renaming dimensions, variables, and attributes, or deleting attributes.)
Setting NF90_NETCDF4 is not necessary (or allowed). The file type is
detected automatically.
MPI_COMMMPI_INFOncidNF90_OPEN returns the value NF90_NOERR if no errors occurred. Otherwise, the returned status indicates an error. Possible causes of errors include:
This example is from test program nf_test/f90tst_parallel.c.
! Reopen the file.
retval = nf90_open_par(FILE_NAME, nf90_nowrite, MPI_COMM_WORLD, &
MPI_INFO_NULL, ncid)
if (retval /= nf90_noerr) call handle_err(retval)