|
REMORA
Regional Modeling of Oceans Refined Adaptively
|
#include <REMORA_NCInterface.H>

Public Member Functions | |
| ~NCFile () | |
| void | close () |
| Close file object. | |
| int | num_dimensions () const |
| Number of dimensions. | |
| int | num_variables () const |
| Number of variables. | |
| int | num_attributes () const |
| Number of attributes. | |
| bool | has_dim (const std::string &) const |
| Check if a dimension exists by name. | |
| bool | has_var (const std::string &) const |
| Check if a variable exists by name. | |
| bool | has_attr (const std::string &) const |
| Check if an attribute exists. | |
| NCDim | dim (const std::string &) const |
| Get the dimension instance by name. | |
| NCVar | var (const std::string &) const |
| Get the variable instance by name. | |
| NCDim | def_dim (const std::string &, const size_t len) const |
| Define new dimension. | |
| NCVar | def_scalar (const std::string &name, const nc_type dtype) const |
| Define a scalar variable, i.e., 0-dimensional array. | |
| NCVar | def_array (const std::string &name, const nc_type dtype, const std::vector< std::string > &) const |
| Define an array. | |
| NCVar | def_array_fill (const std::string &name, const nc_type dtype, const std::vector< std::string > &dnames, const void *fill_val) const |
| Define an array with a fill value. | |
| 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) | |
| NCVar | def_var_fill (const std::string &name, const nc_type dtype, const std::vector< std::string > &dnames, const void *fill_val) const |
| Define a variable (wrapper for def_array) | |
| void | put_attr (const std::string &name, const std::string &value) const |
| Set file attribute to value. | |
| void | put_attr (const std::string &name, const std::vector< double > &value) const |
| Set file attribute to value. | |
| void | put_attr (const std::string &name, const std::vector< float > &value) const |
| Set file attribute to value. | |
| void | put_attr (const std::string &name, const std::vector< int > &value) const |
| Set file attribute to value. | |
| std::string | get_attr (const std::string &name) const |
| Read file attribute from file. | |
| void | get_attr (const std::string &name, std::vector< double > &value) const |
| Read file attribute from file. | |
| void | get_attr (const std::string &name, std::vector< float > &value) const |
| Read file attribute from file. | |
| void | get_attr (const std::string &name, std::vector< int > &value) const |
| Read file attribute from file. | |
| void | wait_all (int num_requests, int *requests) |
| wait for non-blocking calls to finish | |
| std::vector< NCDim > | all_dims () const |
| Return a list of all dimensions defined in this group. | |
| std::vector< NCVar > | all_vars () const |
| Return a list of all variables defined in this group. | |
| void | enter_def_mode () const |
| Enter definition mode (not needed for NetCDF4 format) | |
| void | exit_def_mode () const |
| Exit definition mode. | |
| NCFile (const int id) | |
Static Public Member Functions | |
| static NCFile | create (const std::string &name, const int cmode=NC_CLOBBER|NC_64BIT_DATA, MPI_Comm comm=MPI_COMM_WORLD, MPI_Info info=MPI_INFO_NULL) |
| Create a file. Defaults to CDF-5; classic CDF-1 has a 2GB limit. | |
| static NCFile | open (const std::string &name, const int cmode=NC_NOWRITE, MPI_Comm comm=MPI_COMM_WORLD, MPI_Info info=MPI_INFO_NULL) |
| Open an existing file. | |
Public Attributes | |
| const int | ncid {-1} |
| bool | is_open {false} |
Representation of a NetCDF file
Provide wrappers to create and open file
Definition at line 284 of file REMORA_NCInterface.H.
| ncutils::NCFile::~NCFile | ( | ) |
|
inline |
Definition at line 402 of file REMORA_NCInterface.H.
| std::vector< NCDim > ncutils::NCFile::all_dims | ( | ) | const |
Return a list of all dimensions defined in this group.
Definition at line 450 of file REMORA_NCInterface.cpp.

| std::vector< NCVar > ncutils::NCFile::all_vars | ( | ) | const |
Return a list of all variables defined in this group.
Definition at line 460 of file REMORA_NCInterface.cpp.

| void ncutils::NCFile::close | ( | ) |
Close file object.
Definition at line 512 of file REMORA_NCInterface.cpp.

|
static |
Create a file. Defaults to CDF-5; classic CDF-1 has a 2GB limit.
Definition at line 485 of file REMORA_NCInterface.cpp.
Referenced by REMORA::WriteNCPlotFile().


| NCVar ncutils::NCFile::def_array | ( | const std::string & | name, |
| const nc_type | dtype, | ||
| const std::vector< std::string > & | dnames | ||
| ) | const |
Define an array.
Definition at line 336 of file REMORA_NCInterface.cpp.
Referenced by def_var().


| NCVar ncutils::NCFile::def_array_fill | ( | const std::string & | name, |
| const nc_type | dtype, | ||
| const std::vector< std::string > & | dnames, | ||
| const void * | fill_val | ||
| ) | const |
Define an array with a fill value.
Definition at line 348 of file REMORA_NCInterface.cpp.
Referenced by def_var_fill().


Define new dimension.
Definition at line 324 of file REMORA_NCInterface.cpp.

Define a scalar variable, i.e., 0-dimensional array.
Definition at line 330 of file REMORA_NCInterface.cpp.

|
inline |
Define a variable (wrapper for def_array)
Definition at line 351 of file REMORA_NCInterface.H.

|
inline |
Define a variable (wrapper for def_array)
Definition at line 360 of file REMORA_NCInterface.H.

Get the dimension instance by name.
Definition at line 318 of file REMORA_NCInterface.cpp.
Referenced by def_array(), and def_array_fill().


| void ncutils::NCFile::enter_def_mode | ( | ) | const |
Enter definition mode (not needed for NetCDF4 format)
Definition at line 470 of file REMORA_NCInterface.cpp.

| void ncutils::NCFile::exit_def_mode | ( | ) | const |
Exit definition mode.
Definition at line 481 of file REMORA_NCInterface.cpp.

| std::string ncutils::NCFile::get_attr | ( | const std::string & | name | ) | const |
Read file attribute from file.
Definition at line 420 of file REMORA_NCInterface.cpp.

Read file attribute from file.
Definition at line 429 of file REMORA_NCInterface.cpp.

Read file attribute from file.
Definition at line 436 of file REMORA_NCInterface.cpp.

Read file attribute from file.
Definition at line 443 of file REMORA_NCInterface.cpp.

| bool ncutils::NCFile::has_attr | ( | const std::string & | name | ) | const |
Check if an attribute exists.
Definition at line 397 of file REMORA_NCInterface.cpp.

| bool ncutils::NCFile::has_dim | ( | const std::string & | name | ) | const |
Check if a dimension exists by name.
Definition at line 386 of file REMORA_NCInterface.cpp.

| bool ncutils::NCFile::has_var | ( | const std::string & | name | ) | const |
Check if a variable exists by name.
Definition at line 391 of file REMORA_NCInterface.cpp.

| int ncutils::NCFile::num_attributes | ( | ) | const |
Number of attributes.
Definition at line 374 of file REMORA_NCInterface.cpp.

| int ncutils::NCFile::num_dimensions | ( | ) | const |
Number of dimensions.
Definition at line 368 of file REMORA_NCInterface.cpp.
Referenced by all_dims().


| int ncutils::NCFile::num_variables | ( | ) | const |
Number of variables.
Definition at line 380 of file REMORA_NCInterface.cpp.
Referenced by all_vars().


|
static |
Open an existing file.
Definition at line 491 of file REMORA_NCInterface.cpp.
Referenced by check_hires_dims_from_netcdf(), NCTimeSeries::Initialize(), NCTimeSeriesRiver::Initialize(), QueryNetCDFHasVars(), QueryNetCDFVarAttrStr(), ReadNetCDFFile(), ReadNetCDFVarAttrStr(), and REMORA::WriteNCPlotFile().


Set file attribute to value.
Definition at line 404 of file REMORA_NCInterface.cpp.

| void ncutils::NCFile::put_attr | ( | const std::string & | name, |
| const std::vector< double > & | value | ||
| ) | const |
Set file attribute to value.
Definition at line 408 of file REMORA_NCInterface.cpp.

| void ncutils::NCFile::put_attr | ( | const std::string & | name, |
| const std::vector< float > & | value | ||
| ) | const |
Set file attribute to value.
Definition at line 412 of file REMORA_NCInterface.cpp.

Set file attribute to value.
Definition at line 416 of file REMORA_NCInterface.cpp.

Get the variable instance by name.
Definition at line 362 of file REMORA_NCInterface.cpp.

| void ncutils::NCFile::wait_all | ( | int | num_requests, |
| int * | requests | ||
| ) |
wait for non-blocking calls to finish
Definition at line 497 of file REMORA_NCInterface.cpp.

| bool ncutils::NCFile::is_open {false} |
Definition at line 405 of file REMORA_NCInterface.H.
| const int ncutils::NCFile::ncid {-1} |
Definition at line 404 of file REMORA_NCInterface.H.
Referenced by all_dims(), all_vars(), close(), create(), def_array(), def_array_fill(), def_dim(), def_scalar(), dim(), enter_def_mode(), exit_def_mode(), get_attr(), get_attr(), get_attr(), get_attr(), has_attr(), has_dim(), has_var(), num_attributes(), num_dimensions(), num_variables(), open(), put_attr(), put_attr(), put_attr(), put_attr(), var(), wait_all(), and ~NCFile().