/home/runner/work/amr-wind/amr-wind/amr-wind/utilities/ncutils/nc_interface.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
|
Loading...
Searching...
No Matches
nc_interface.H
Go to the documentation of this file.
Definition nc_interface.H:288
static NCFile open(const std::string &name, const int cmode=NC_NOWRITE)
Definition nc_interface.cpp:548
static NCFile create(const std::string &name, const int cmode=NC_CLOBBER|NC_NETCDF4)
Definition nc_interface.cpp:541
static NCFile open_par(const std::string &name, const int cmode=NC_NOWRITE, MPI_Comm comm=MPI_COMM_WORLD, MPI_Info info=MPI_INFO_NULL)
Definition nc_interface.cpp:563
static NCFile create_par(const std::string &name, const int cmode=NC_CLOBBER|NC_NETCDF4|NC_MPIIO, MPI_Comm comm=MPI_COMM_WORLD, MPI_Info info=MPI_INFO_NULL)
Definition nc_interface.cpp:555
bool has_group(const std::string &) const
Check if a group exists.
Definition nc_interface.cpp:393
const NCGroup & root() const
Return the root (file instance)
Definition nc_interface.H:178
bool has_attr(const std::string &) const
Check if an attribute exists.
Definition nc_interface.cpp:412
std::string get_attr(const std::string &name) const
Definition nc_interface.cpp:447
void exit_def_mode() const
Exit definition mode.
Definition nc_interface.cpp:539
NCVar def_scalar(const std::string &name, const nc_type dtype) const
Define a scalar variable, i.e., 0-dimensional array.
Definition nc_interface.cpp:333
int num_dimensions() const
Number of dimensions in this group.
Definition nc_interface.cpp:372
int num_variables() const
Number of variables within this group.
Definition nc_interface.cpp:386
int num_groups() const
Number of sub-groups within this group.
Definition nc_interface.cpp:365
std::string full_name() const
Full name for this group.
Definition nc_interface.cpp:295
NCVar var(const std::string &) const
Get the variable instance by name.
Definition nc_interface.cpp:358
const NCGroup & parent() const
Return parent group, for root it just returns itself.
Definition nc_interface.H:175
std::vector< NCGroup > all_groups() const
Return a list of all groups defined in this group.
Definition nc_interface.cpp:485
const int ncid
Identifier used with NetCDF API calls.
Definition nc_interface.H:169
std::vector< NCDim > all_dims() const
Return a list of all dimensions defined in this group.
Definition nc_interface.cpp:504
NCVar def_var(const std::string &name, const nc_type dtype, const std::vector< std::string > &dnames) const
Define a variable (wrapper for def_array)
Definition nc_interface.H:241
bool has_var(const std::string &) const
Check if a variable exists by name.
Definition nc_interface.cpp:405
bool has_dim(const std::string &) const
Check if a dimension exists by name.
Definition nc_interface.cpp:399
NCGroup def_group(const std::string &) const
Define new group.
Definition nc_interface.cpp:305
NCVar def_array(const std::string &name, const nc_type dtype, const std::vector< std::string > &) const
Define an array.
Definition nc_interface.cpp:340
void put_attr(const std::string &name, const std::string &value) const
Definition nc_interface.cpp:420
NCDim dim(const std::string &) const
Get the dimension instance by name.
Definition nc_interface.cpp:319
NCDim def_dim(const std::string &, const size_t len) const
Define new dimension.
Definition nc_interface.cpp:326
bool is_root() const
Is this the NetCDF file (root group)?
Definition nc_interface.H:172
void enter_def_mode() const
Enter definition mode (not needed for NetCDF4 format)
Definition nc_interface.cpp:526
int num_attributes() const
Number of attributes within this group.
Definition nc_interface.cpp:379
std::vector< NCVar > all_vars() const
Return a list of all variables defined in this group.
Definition nc_interface.cpp:515
Definition nc_interface.cpp:9
std::string get_attr(const std::string &name) const
Definition nc_interface.cpp:246
void put(const double *) const
Write out the entire variable.
Definition nc_interface.cpp:67
void put_attr(const std::string &name, const std::string &value) const
Definition nc_interface.cpp:219
void get(double *) const
Read the entire variable from file.
Definition nc_interface.cpp:139
std::vector< size_t > shape() const
Shape of the array (size in each array dimension)
Definition nc_interface.cpp:50
int ndim() const
Number of array dimensions for this variable.
Definition nc_interface.cpp:43
Generated by 1.12.0