REMORA
Regional Modeling of Oceans Refined Adaptively
|
A class to hold and interpolate time series data read from a NetCDF file. More...
#include <REMORA_NCTimeSeries.H>
Public Member Functions | |
NCTimeSeries (const std::string a_file_name, const std::string a_field_name, const std::string a_time_name, const amrex::Box &a_domain, amrex::MultiFab *a_mf_var, bool a_is2d, bool a_save_interpolated) | |
Constructor. | |
void | Initialize () |
Read in time array from file and allocate data arrays. | |
void | update_interpolated_to_time (amrex::Real time) |
Calculate interpolated values at time, reading in data as necessary. | |
Public Attributes | |
amrex::MultiFab * | mf_interpolated |
Private Member Functions | |
void | read_in_at_time (amrex::MultiFab *mf, int itime) |
Read in data from file at time index itime and fill into mf. | |
Private Attributes | |
std::string | file_name |
File name to read from. | |
std::string | field_name |
Field name in netcdf file. | |
std::string | time_name |
Field name for time series in netcdf file. | |
amrex::Box | domain |
Domain. | |
bool | is2d |
Whether the field we're reading in is 2d. | |
bool | save_interpolated |
amrex::Vector< amrex::Real > | ocean_times |
Time points in netcdf file. | |
int | i_time_before |
Time index immediately before the last time interpolated to. | |
amrex::Real | time_before |
Time in ocean_times immediately before the last time interpolated to. | |
amrex::Real | time_after |
Time in ocean_times immediately after the last time interpolated to. | |
amrex::MultiFab * | mf_before |
Multifab to store data at time_before. | |
amrex::MultiFab * | mf_after |
Multifab to store data at time_after. | |
amrex::MultiFab * | mf_var |
A class to hold and interpolate time series data read from a NetCDF file.
The class only ever holds the two time steps necessary to interpoplate to the current simulation time.
Definition at line 17 of file REMORA_NCTimeSeries.H.
NCTimeSeries::NCTimeSeries | ( | const std::string | a_file_name, |
const std::string | a_field_name, | ||
const std::string | a_time_name, | ||
const amrex::Box & | a_domain, | ||
amrex::MultiFab * | a_mf_var, | ||
bool | a_is2d, | ||
bool | a_save_interpolated | ||
) |
Constructor.
[in] | a_file_name | file name to read from |
[in] | a_field_name | name of field to read in |
[in] | a_time_name | name of time variable in NetCDF file |
[in] | a_domain | simulation domain |
[in,out] | a_mf_var | MultiFab of data to either store into or reference for dimensions |
[in] | a_is2d | Whether the variable we're working with is 2D |
[in] | a_save_interpolated | Whether the interpolated value should be saved internally |
Definition at line 18 of file REMORA_NCTimeSeries.cpp.
void NCTimeSeries::Initialize | ( | ) |
Read in time array from file and allocate data arrays.
Definition at line 31 of file REMORA_NCTimeSeries.cpp.
Referenced by REMORA::init_only().
|
private |
Read in data from file at time index itime and fill into mf.
[in,out] | mf | multifab to store time step data into |
[in] | itime | index of time step to read from file |
Definition at line 150 of file REMORA_NCTimeSeries.cpp.
Referenced by update_interpolated_to_time().
void NCTimeSeries::update_interpolated_to_time | ( | amrex::Real | time | ) |
Calculate interpolated values at time, reading in data as necessary.
time | time to interpolate to |
Definition at line 96 of file REMORA_NCTimeSeries.cpp.
Referenced by REMORA::advance_2d(), REMORA::advance_3d(), REMORA::set_smflux(), REMORA::set_wind(), and REMORA::setup_step().
|
private |
Domain.
Definition at line 47 of file REMORA_NCTimeSeries.H.
Referenced by NCTimeSeries(), and read_in_at_time().
|
private |
Field name in netcdf file.
Definition at line 43 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), NCTimeSeries(), and read_in_at_time().
|
private |
File name to read from.
Definition at line 41 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), NCTimeSeries(), and read_in_at_time().
|
private |
Time index immediately before the last time interpolated to.
Definition at line 58 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
Whether the field we're reading in is 2d.
Definition at line 50 of file REMORA_NCTimeSeries.H.
Referenced by NCTimeSeries(), and read_in_at_time().
|
private |
Multifab to store data at time_after.
Definition at line 67 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
Multifab to store data at time_before.
Definition at line 65 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and update_interpolated_to_time().
amrex::MultiFab* NCTimeSeries::mf_interpolated |
Container for interpolated data; Only used if save_interpolated == true
Definition at line 35 of file REMORA_NCTimeSeries.H.
Referenced by REMORA::advance_2d(), REMORA::advance_3d(), Initialize(), REMORA::setup_step(), and update_interpolated_to_time().
|
private |
Pointer to REMORA data that corresponds to the variable being interpolated. Filled by update_interpolated_to_time if save_interpolated==false. Otherwise, just used for getting box array, nodality, and distribution mapping
Definition at line 71 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), NCTimeSeries(), and update_interpolated_to_time().
|
private |
Time points in netcdf file.
Definition at line 56 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
Whether to save interpolated results in mf_interpolated. If false, data will be calculated to mf_var
Definition at line 53 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), NCTimeSeries(), and update_interpolated_to_time().
|
private |
Time in ocean_times immediately after the last time interpolated to.
Definition at line 62 of file REMORA_NCTimeSeries.H.
Referenced by update_interpolated_to_time().
|
private |
Time in ocean_times immediately before the last time interpolated to.
Definition at line 60 of file REMORA_NCTimeSeries.H.
Referenced by update_interpolated_to_time().
|
private |
Field name for time series in netcdf file.
Definition at line 45 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and NCTimeSeries().