REMORA
Regional Modeling of Oceans Refined Adaptively
|
A class to hold and interpolate time series data read from a NetCDF file. More...
#include <REMORA_NCTimeSeriesBoundary.H>
Public Member Functions | |
NCTimeSeriesBoundary (const amrex::Vector< std::string > &a_file_name, const std::string a_field_name, const std::string a_time_name, const amrex::Box &a_domain, const amrex::IntVect a_index_type, const amrex::GpuArray< bool, AMREX_SPACEDIM *2 > *a_var_need_data, bool a_is2d) | |
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::FArrayBox | xlo_dat_interp |
FArrayBox to store data at inteprolated time at xlo boundary */. | |
amrex::FArrayBox | ylo_dat_interp |
FArrayBox to store data at inteprolated time at ylo boundary */. | |
amrex::FArrayBox | xhi_dat_interp |
FArrayBox to store data at inteprolated time at xhi boundary */. | |
amrex::FArrayBox | yhi_dat_interp |
FArrayBox to store data at inteprolated time at yhi boundary */. | |
Private Member Functions | |
void | read_in_at_time (amrex::FArrayBox &fab_xlo, amrex::FArrayBox &fab_xhi, amrex::FArrayBox &fab_ylo, amrex::FArrayBox &fab_yhi, int itime) |
Read in data from file at time index itime and fill into mf. | |
Private Attributes | |
amrex::Vector< std::string > | file_names |
File name to read from. | |
std::string | field_name |
Field name in netcdf file. | |
amrex::Vector< std::string > | nc_var_names |
Variable names that will be read from file. | |
std::string | time_name |
Field name for time series in netcdf file. | |
amrex::Box | domain |
Domain. | |
amrex::IntVect | index_type |
Index type for field to fill. | |
bool | is2d |
Whether the field we're reading in is 2d. | |
amrex::Vector< amrex::Real > | bry_times |
Time points in netcdf file. | |
amrex::Vector< int > | file_for_time |
File index to access a particular time. | |
amrex::Vector< int > | file_itime_offset |
Offset to access a particular time within its 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::FArrayBox | xlo_dat_before |
FArrayBox to store data at time_before at xlo boundary. | |
amrex::FArrayBox | xlo_dat_after |
FArrayBox to store data at time_after at xlo boundary. | |
amrex::FArrayBox | ylo_dat_before |
FArrayBox to store data at time_before at ylo boundary. | |
amrex::FArrayBox | ylo_dat_after |
FArrayBox to store data at time_after at ylo boundary. | |
amrex::FArrayBox | xhi_dat_before |
FArrayBox to store data at time_before at xhi boundary. | |
amrex::FArrayBox | xhi_dat_after |
FArrayBox to store data at time_after at xhi boundary. | |
amrex::FArrayBox | yhi_dat_before |
FArrayBox to store data at time_before at yhi boundary. | |
amrex::FArrayBox | yhi_dat_after |
FArrayBox to store data at time_after at yhi boundary. | |
amrex::GpuArray< bool, AMREX_SPACEDIM *2 > | var_need_data |
Array over boundaries indicating whether we need physical data for this variable. | |
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_NCTimeSeriesBoundary.H.
NCTimeSeriesBoundary::NCTimeSeriesBoundary | ( | const amrex::Vector< std::string > & | a_file_names, |
const std::string | a_field_name, | ||
const std::string | a_time_name, | ||
const amrex::Box & | a_domain, | ||
const amrex::IntVect | a_index_type, | ||
const amrex::GpuArray< bool, AMREX_SPACEDIM *2 > * | a_var_need_data, | ||
bool | a_is2d | ||
) |
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] | a_is2d | Whether the variable we're working with is 2D |
Definition at line 16 of file REMORA_NCTimeSeriesBoundary.cpp.
void NCTimeSeriesBoundary::Initialize | ( | ) |
Read in time array from file and allocate data arrays.
Definition at line 31 of file REMORA_NCTimeSeriesBoundary.cpp.
|
private |
Read in data from file at time index itime and fill into mf.
[in,out] | fab_xlo | fab to store xlo boundary data into |
[in,out] | fab_xhi | fab to store xhi boundary data into |
[in,out] | fab_ylo | fab to store ylo boundary data into |
[in,out] | fab_yhi | fab to store yhi boundary data into |
[in] | itime | index of time step to read from file |
Definition at line 219 of file REMORA_NCTimeSeriesBoundary.cpp.
Referenced by update_interpolated_to_time().
void NCTimeSeriesBoundary::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 145 of file REMORA_NCTimeSeriesBoundary.cpp.
|
private |
Time points in netcdf file.
Definition at line 72 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), read_in_at_time(), and update_interpolated_to_time().
|
private |
Domain.
Definition at line 64 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and NCTimeSeriesBoundary().
|
private |
Field name in netcdf file.
Definition at line 58 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), NCTimeSeriesBoundary(), and read_in_at_time().
|
private |
File index to access a particular time.
Definition at line 74 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and read_in_at_time().
|
private |
Offset to access a particular time within its file.
Definition at line 76 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and read_in_at_time().
|
private |
File name to read from.
Definition at line 56 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), NCTimeSeriesBoundary(), and read_in_at_time().
|
private |
Time index immediately before the last time interpolated to.
Definition at line 78 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
Index type for field to fill.
Definition at line 66 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and NCTimeSeriesBoundary().
|
private |
Whether the field we're reading in is 2d.
Definition at line 69 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), NCTimeSeriesBoundary(), and read_in_at_time().
|
private |
Variable names that will be read from file.
Definition at line 60 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and read_in_at_time().
|
private |
Time in ocean_times immediately after the last time interpolated to.
Definition at line 82 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by update_interpolated_to_time().
|
private |
Time in ocean_times immediately before the last time interpolated to.
Definition at line 80 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by update_interpolated_to_time().
|
private |
Field name for time series in netcdf file.
Definition at line 62 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and NCTimeSeriesBoundary().
|
private |
Array over boundaries indicating whether we need physical data for this variable.
Definition at line 105 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and NCTimeSeriesBoundary().
|
private |
FArrayBox to store data at time_after at xhi boundary.
Definition at line 97 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
FArrayBox to store data at time_before at xhi boundary.
Definition at line 95 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and update_interpolated_to_time().
amrex::FArrayBox NCTimeSeriesBoundary::xhi_dat_interp |
FArrayBox to store data at inteprolated time at xhi boundary */.
Definition at line 42 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
FArrayBox to store data at time_after at xlo boundary.
Definition at line 87 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
FArrayBox to store data at time_before at xlo boundary.
Definition at line 85 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and update_interpolated_to_time().
amrex::FArrayBox NCTimeSeriesBoundary::xlo_dat_interp |
FArrayBox to store data at inteprolated time at xlo boundary */.
Definition at line 36 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
FArrayBox to store data at time_after at yhi boundary.
Definition at line 102 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
FArrayBox to store data at time_before at yhi boundary.
Definition at line 100 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and update_interpolated_to_time().
amrex::FArrayBox NCTimeSeriesBoundary::yhi_dat_interp |
FArrayBox to store data at inteprolated time at yhi boundary */.
Definition at line 45 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
FArrayBox to store data at time_after at ylo boundary.
Definition at line 92 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
FArrayBox to store data at time_before at ylo boundary.
Definition at line 90 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and update_interpolated_to_time().
amrex::FArrayBox NCTimeSeriesBoundary::ylo_dat_interp |
FArrayBox to store data at inteprolated time at ylo boundary */.
Definition at line 39 of file REMORA_NCTimeSeriesBoundary.H.
Referenced by Initialize(), and update_interpolated_to_time().