|
NEP 4.3.0
NetCDF Expansion Pack
|
Empty-file creation for the nxCDF backend. More...
#include "nxcdf/nxcdf.h"#include "config.h"#include <unistd.h>#include <string.h>#include <errno.h>#include "nxcdf_internal.h"Functions | |
| static int | valid_create_mode (int mode) |
| Reject create-mode flag combinations nxCDF cannot honor. | |
| int | NXCDF_create (const char *path, int cmode, size_t initialsz, int basepe, size_t *chunksizehintp, void *parameters, const NC_Dispatch *dispatch, int ncid) |
| Create an empty nxCDF file. | |
Empty-file creation for the nxCDF backend.
| int NXCDF_create | ( | const char * | path, |
| int | cmode, | ||
| size_t | initialsz, | ||
| int | basepe, | ||
| size_t * | chunksizehintp, | ||
| void * | parameters, | ||
| const NC_Dispatch * | dispatch, | ||
| int | ncid ) |
Create an empty nxCDF file.
Dispatch-table entry behind nc_create() with NC_NXCDF: creates the HDF5 file and writes the backend marker attributes.
This is the dispatch-table entry netcdf-c calls when a user calls nc_create() with NC_NXCDF in the mode flags. It validates the mode, requires HDF5 2.1.1 or newer at run time (the build enforces the same minimum), registers the file's in-memory state, and creates the HDF5 file with a superblock bound matching the requested model: H5F_LIBVER_LATEST (superblock v3) for native and classic-model files, H5F_LIBVER_V110 for NC_NETCDF4_MODEL files so upstream netcdf-c linked against HDF5 1.10 can read them.
Only the hidden marker attributes are written here — dimensions, variables and attributes are materialized later by _enddef (see NXCDF__enddef() and nxCDF Architecture).
| path | File-system path to create. |
| cmode | NetCDF create-mode flags. |
| initialsz | Requested initial file size; currently ignored. |
| basepe | Base processing element; currently ignored. |
| chunksizehintp | Chunk-size hint; currently ignored. |
| parameters | Non-NULL when the user called nc_create_par(): points at an NXCDF_MPI_INFO carrying the MPI communicator and info handle. nc_create_par() also requires NC_NETCDF4 in the mode flags (upstream rejects other creates without PnetCDF), so parallel creates pass NC_NXCDF|NC_NETCDF4. |
| dispatch | Dispatch table selected by netcdf-c. |
| ncid | NetCDF file identifier allocated by netcdf-c. |
|
static |
Reject create-mode flag combinations nxCDF cannot honor.
nxCDF always writes HDF5 files, so the NetCDF-3 format-variant flags NC_64BIT_OFFSET and NC_64BIT_DATA have no meaning here. NC_CLASSIC_MODEL and NC_NETCDF4_MODEL select different data models and different HDF5 superblock bounds, so they are mutually exclusive. See nxCDF Architecture for the mode table.
| mode | NetCDF mode flags. |