FV3 Bundle
|
File access class for IODA. More...
#include <IodaIO.h>
Public Member Functions | |
virtual | ~IodaIO ()=0 |
virtual void | ReadVar (const std::string &VarName, int *VarData)=0 |
virtual void | ReadVar (const std::string &VarName, float *VarData)=0 |
virtual void | ReadVar (const std::string &VarName, double *VarData)=0 |
virtual void | WriteVar (const std::string &VarName, int *VarData)=0 |
virtual void | WriteVar (const std::string &VarName, float *VarData)=0 |
virtual void | WriteVar (const std::string &VarName, double *VarData)=0 |
virtual void | ReadDateTime (int *VarDate, int *VarTime)=0 |
std::string | fname () const |
std::string | fmode () const |
std::size_t | nlocs () |
std::size_t | nobs () |
std::size_t | nrecs () |
std::size_t | nvars () |
Protected Attributes | |
std::string | fname_ |
file name More... | |
std::string | fmode_ |
file mode ("r" -> read, "w" -> overwrite, "W" -> create and write) More... | |
std::size_t | nlocs_ |
number of unique locations More... | |
std::size_t | nobs_ |
number of unique observations More... | |
std::size_t | nrecs_ |
number of unique records More... | |
std::size_t | nvars_ |
number of unique variables More... | |
File access class for IODA.
The IodaIO class provides the interface for file access. Note that IodaIO is an abstract base class.
Eventually, we want to get to the same file format for every obs type. Currently we are defining this as follows. A file can contain any number of variables. Each variable is a 1D vector that is nlocs long. Variables can contain missing values.
There are four dimensions defined in the file:
nlocs: number of locations (length of each variable) nvars: number of variables nobs: number of observations (equal to nlocs * nvars) nrecs: number of records
A record is an atomic unit that is to stay intact when distributing observations across multiple processes.
Older netcdf files have either a single variable, or have multiple variables (satellite channels, eg) flattened out into a single variable. These vectors are nobs long. Locations will be repeated in the case of multiple variables so the ObsSpace constructor (client of this class) needs to reshape these vectors into a set of variables that correspond to the new file format above.
For now, limit the write interface to writing 1D vectors that are nlocs in length. This may be too restrictive, so we should revisit this in the future.
The constructor that you fill in a subclass is responsible for:
The following data members are set according to the file mode
If in read mode, metadata from the input file are used to set the data members If in write mode, the data members are set from the constructor arguments
Definition at line 69 of file src/fileio/IodaIO.h.
std::string ioda::IodaIO::fmode | ( | ) | const |
std::string ioda::IodaIO::fname | ( | ) | const |
std::size_t ioda::IodaIO::nlocs | ( | ) |
std::size_t ioda::IodaIO::nobs | ( | ) |
std::size_t ioda::IodaIO::nrecs | ( | ) |
std::size_t ioda::IodaIO::nvars | ( | ) |
|
pure virtual |
Implemented in ioda::OdbApiIO, and ioda::NetcdfIO.
|
pure virtual |
Implemented in ioda::OdbApiIO, and ioda::NetcdfIO.
|
pure virtual |
Implemented in ioda::OdbApiIO, and ioda::NetcdfIO.
|
pure virtual |
Implemented in ioda::OdbApiIO, and ioda::NetcdfIO.
|
pure virtual |
Implemented in ioda::OdbApiIO, and ioda::NetcdfIO.
|
pure virtual |
Implemented in ioda::OdbApiIO, and ioda::NetcdfIO.
|
pure virtual |
Implemented in ioda::OdbApiIO, and ioda::NetcdfIO.
|
protected |
file mode ("r" -> read, "w" -> overwrite, "W" -> create and write)
Definition at line 104 of file src/fileio/IodaIO.h.
|
protected |
file name
Definition at line 101 of file src/fileio/IodaIO.h.
|
protected |
number of unique locations
Definition at line 107 of file src/fileio/IodaIO.h.
|
protected |
number of unique observations
Definition at line 110 of file src/fileio/IodaIO.h.
|
protected |
number of unique records
Definition at line 113 of file src/fileio/IodaIO.h.
|
protected |
number of unique variables
Definition at line 116 of file src/fileio/IodaIO.h.