![]() |
NetCDF
4.8.0
|
#include "config.h"
#include <stdlib.h>
#include "ncdispatch.h"
#include "netcdf_mem.h"
#include "ncpathmgr.h"
#include "fbits.h"
Go to the source code of this file.
Functions | |
static int | check_create_mode (int mode) |
Check the create mode parameter for sanity. More... | |
int | nc__create (const char *path, int cmode, size_t initialsz, size_t *chunksizehintp, int *ncidp) |
Create a netCDF file with some extra parameters controlling classic file caching. More... | |
int | nc__create_mp (const char *path, int cmode, size_t initialsz, int basepe, size_t *chunksizehintp, int *ncidp) |
int | nc__enddef (int ncid, size_t h_minfree, size_t v_align, size_t v_minfree, size_t r_align) |
int | nc__open (const char *path, int omode, size_t *chunksizehintp, int *ncidp) |
int | nc__open_mp (const char *path, int omode, int basepe, size_t *chunksizehintp, int *ncidp) |
int | nc__pseudofd (void) |
int | nc_abort (int ncid) |
int | nc_close (int ncid) |
int | nc_close_memio (int ncid, NC_memio *memio) |
int | nc_create (const char *path, int cmode, int *ncidp) |
int | NC_create (const char *path0, int cmode, size_t initialsz, int basepe, size_t *chunksizehintp, int useparallel, void *parameters, int *ncidp) |
int | nc_create_mem (const char *path, int mode, size_t initialsize, int *ncidp) |
int | nc_def_user_format (int mode_flag, NC_Dispatch *dispatch_table, char *magic_number) |
Add handling of user-defined format. More... | |
int | nc_enddef (int ncid) |
int | nc_inq (int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp) |
int | nc_inq_base_pe (int ncid, int *pe) |
int | nc_inq_format (int ncid, int *formatp) |
int | nc_inq_format_extended (int ncid, int *formatp, int *modep) |
int | nc_inq_nvars (int ncid, int *nvarsp) |
Learn the number of variables in a file or group. More... | |
int | nc_inq_path (int ncid, size_t *pathlen, char *path) |
int | nc_inq_type (int ncid, nc_type xtype, char *name, size_t *size) |
int | nc_inq_user_format (int mode_flag, NC_Dispatch **dispatch_table, char *magic_number) |
Inquire about user-defined format. More... | |
int | nc_open (const char *path, int omode, int *ncidp) |
Open an existing netCDF file. More... | |
int | NC_open (const char *path0, int omode, int basepe, size_t *chunksizehintp, int useparallel, void *parameters, int *ncidp) |
int | nc_open_mem (const char *path, int omode, size_t size, void *memory, int *ncidp) |
int | nc_open_memio (const char *path, int omode, NC_memio *params, int *ncidp) |
int | nc_redef (int ncid) |
int | nc_set_base_pe (int ncid, int pe) |
int | nc_set_fill (int ncid, int fillmode, int *old_modep) |
int | nc_sync (int ncid) |
Variables | |
int | NC_initialized |
True when dispatch table is initialized. More... | |
static int | pseudofd = 0 |
NC_Dispatch * | UDF0_dispatch_table = NULL |
char | UDF0_magic_number [NC_MAX_MAGIC_NUMBER_LEN+1] = "" |
NC_Dispatch * | UDF1_dispatch_table = NULL |
char | UDF1_magic_number [NC_MAX_MAGIC_NUMBER_LEN+1] = "" |
File create and open functions
These functions end up calling functions in one of the dispatch layers (netCDF-4, dap server, etc).
Copyright 2018 University Corporation for Atmospheric Research/Unidata. See COPYRIGHT file for more info.
Definition in file dfile.c.
|
static |
Check the create mode parameter for sanity.
Some create flags cannot be used if corresponding library features are enabled during the build. This function does a pre-check of the mode flag before calling the dispatch layer nc_create functions.
mode | The creation mode flag. |
int nc__create_mp | ( | const char * | path, |
int | cmode, | ||
size_t | initialsz, | ||
int | basepe, | ||
size_t * | chunksizehintp, | ||
int * | ncidp | ||
) |
Create a file with special (deprecated) Cray settings.
path | File name. |
cmode | Create mode. |
initialsz | Initial size of metadata region for classic files, ignored for other files. |
basepe | Deprecated parameter from the Cray days. |
chunksizehintp | A pointer to the chunk size hint. This only applies to classic files. |
ncidp | Pointer that gets ncid. |
int nc__open_mp | ( | const char * | path, |
int | omode, | ||
int | basepe, | ||
size_t * | chunksizehintp, | ||
int * | ncidp | ||
) |
Open a netCDF file with extra parameters for Cray.
path | The file name of the new netCDF dataset. |
omode | Open mode. |
basepe | Deprecated parameter from the Cray days. |
chunksizehintp | A pointer to the chunk size hint. This only applies to classic files. |
ncidp | Pointer to location where returned netCDF ID is to be stored. |
int nc__pseudofd | ( | void | ) |
int NC_create | ( | const char * | path0, |
int | cmode, | ||
size_t | initialsz, | ||
int | basepe, | ||
size_t * | chunksizehintp, | ||
int | useparallel, | ||
void * | parameters, | ||
int * | ncidp | ||
) |
Create a file, calling the appropriate dispatch create call.
For create, we have the following pieces of information to use to determine the dispatch table:
path0 | The file name of the new netCDF dataset. |
cmode | The creation mode flag, the same as in nc_create(). |
initialsz | This parameter sets the initial size of the file at creation time. This only applies to classic files. |
basepe | Deprecated parameter from the Cray days. |
chunksizehintp | A pointer to the chunk size hint. This only applies to classic files. |
useparallel | Non-zero if parallel I/O is to be used on this file. |
parameters | Pointer to MPI comm and info. |
ncidp | Pointer to location where returned netCDF ID is to be stored. |
int nc_inq_base_pe | ( | int | ncid, |
int * | pe | ||
) |
Learn base PE.
ncid | File and group ID. |
pe | Pointer for base PE. |
int nc_inq_nvars | ( | int | ncid, |
int * | nvarsp | ||
) |
int NC_open | ( | const char * | path0, |
int | omode, | ||
int | basepe, | ||
size_t * | chunksizehintp, | ||
int | useparallel, | ||
void * | parameters, | ||
int * | ncidp | ||
) |
Open a netCDF file (or remote dataset) calling the appropriate dispatch function.
For open, we have the following pieces of information to use to determine the dispatch table.
path0 | Path to the file to open. |
omode | Open mode. |
basepe | Base processing element (ignored). |
chunksizehintp | Size hint for classic files. |
useparallel | If true use parallel I/O. |
parameters | Extra parameters for the open. |
ncidp | Pointer that gets ncid. |
int nc_set_base_pe | ( | int | ncid, |
int | pe | ||
) |
Sets base processing element (ignored).
ncid | File ID. |
pe | Base PE. |
int NC_initialized |
True when dispatch table is initialized.