REMORA
Regional Modeling of Oceans Refined Adaptively
|
#include <sstream>
#include <string>
#include <ctime>
#include <atomic>
#include "AMReX_FArrayBox.H"
#include "AMReX_IArrayBox.H"
#include "REMORA_NCInterface.H"
Go to the source code of this file.
Classes | |
struct | NDArray< DataType > |
NDArray is the datatype designed to hold any data, including scalars, multidimensional arrays, that read from the NetCDF file. More... | |
Typedefs | |
using | PlaneVector = amrex::Vector< amrex::FArrayBox > |
Enumerations | |
enum class | NC_Data_Dims_Type { Time_BT_SN_WE , Time_SN_WE , BT_SN_WE , SN_WE , Time_BT_Riv , Time_Riv , BT_Riv } |
Functions | |
template<typename DType > | |
void | ReadNetCDFFile (const std::string &fname, amrex::Vector< std::string > names, amrex::Vector< NDArray< DType > > &arrays, bool one_time=false, int fill_time=0) |
Read in data from netcdf file and save to data arrays. | |
std::string | ReadNetCDFVarAttrStr (const std::string &fname, const std::string &var_name, const std::string &attr_name) |
Helper function for reading a single variable attribute. | |
template<class FAB , typename DType > | |
void | fill_fab_from_arrays (int iv, amrex::Vector< NDArray< amrex::Real > > &nc_arrays, const std::string &var_name, NC_Data_Dims_Type &NC_dim_type, FAB &temp) |
Helper function for reading data from NetCDF file into a provided FAB. | |
template<class FAB , typename DType > | |
void | BuildFABsFromNetCDFFile (const amrex::Box &domain, const std::string &fname, amrex::Vector< std::string > nc_var_names, amrex::Vector< enum NC_Data_Dims_Type > NC_dim_types, amrex::Vector< FAB * > fab_vars, bool one_time=false, int fill_time=0) |
Function to read NetCDF variables and fill the corresponding Array4's. | |
using PlaneVector = amrex::Vector<amrex::FArrayBox> |
Definition at line 14 of file REMORA_NCFile.H.
|
strong |
Enumerator | |
---|---|
Time_BT_SN_WE | |
Time_SN_WE | |
BT_SN_WE | |
SN_WE | |
Time_BT_Riv | |
Time_Riv | |
BT_Riv |
Definition at line 16 of file REMORA_NCFile.H.
void BuildFABsFromNetCDFFile | ( | const amrex::Box & | domain, |
const std::string & | fname, | ||
amrex::Vector< std::string > | nc_var_names, | ||
amrex::Vector< enum NC_Data_Dims_Type > | NC_dim_types, | ||
amrex::Vector< FAB * > | fab_vars, | ||
bool | one_time = false , |
||
int | fill_time = 0 |
||
) |
Function to read NetCDF variables and fill the corresponding Array4's.
fname | Name of the NetCDF file to be read |
nc_var_names | Variable names in the NetCDF file |
NC_dim_types | NetCDF data dimension types |
fab_vars | Fab data we are to fill |
one_time | Whether to read in a single time step from file |
fill_time | What time step to read from file, if only reading one step |
Definition at line 312 of file REMORA_NCFile.H.
void fill_fab_from_arrays | ( | int | iv, |
amrex::Vector< NDArray< amrex::Real > > & | nc_arrays, | ||
const std::string & | var_name, | ||
NC_Data_Dims_Type & | NC_dim_type, | ||
FAB & | temp | ||
) |
Helper function for reading data from NetCDF file into a provided FAB.
iv | Index for which variable we are going to fill |
nc_arrays | Arrays of data from NetCDF file |
var_name | Variable name |
NC_dim_type | Dimension type for the variable as stored in the NetCDF file |
temp | FAB where we store the variable data from the NetCDF Arrays |
Definition at line 195 of file REMORA_NCFile.H.
void ReadNetCDFFile | ( | const std::string & | fname, |
amrex::Vector< std::string > | names, | ||
amrex::Vector< NDArray< DType > > & | arrays, | ||
bool | one_time = false , |
||
int | fill_time = 0 |
||
) |
Read in data from netcdf file and save to data arrays.
[in] | fname | file name to read from |
[in] | names | field names to read |
[in,out] | arrays | vector of data arrays to fill |
[in] | one_time | whether to read in a single time step of data |
[in] | fill_time | if reading a single time, what time step to read from the file? |
Definition at line 119 of file REMORA_NCFile.H.
Referenced by BuildFABsFromNetCDFFile(), NCTimeSeries::Initialize(), NCTimeSeriesRiver::Initialize(), read_bdry_from_netcdf(), and read_vec_from_netcdf().
std::string ReadNetCDFVarAttrStr | ( | const std::string & | fname, |
const std::string & | var_name, | ||
const std::string & | attr_name | ||
) |
Helper function for reading a single variable attribute.
fname | Name of NetCDF file |
var_name | Name of variable |
attr_name | Name of attribute to read |
Definition at line 13 of file REMORA_NCFile.cpp.
Referenced by NCTimeSeries::Initialize(), NCTimeSeriesRiver::Initialize(), and read_bdry_from_netcdf().