|
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 amrex::Vector< std::string > &a_file_names, 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, double a_time_ref) | |
| Constructor. | |
| void | Initialize () |
| Read in time array from file and allocate data arrays. | |
| void | update_interpolated_to_time (double time, int lev, amrex::MultiFab *mf_lev, const amrex::Vector< amrex::Geometry > &geom, const amrex::Vector< amrex::IntVect > &ref_ratio) |
| Calculate interpolated values at time, in seconds on the model clock, and fill data for level lev. | |
| const amrex::MultiFab * | get_interpolated_mf (int lev) const |
| Access interpolated data saved for a specific level. | |
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. | |
| amrex::IntVect | cumulative_ref_ratio (int lev, const amrex::Vector< amrex::IntVect > &ref_ratio) const |
| Build cumulative refinement ratio from level 0 to lev. | |
Private Attributes | |
| amrex::Vector< std::string > | file_names |
| File names to read from. | |
| amrex::Vector< int > | file_is_spatially_uniform |
| Whether each file stores this field as one value per time record. | |
| 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 |
| double | time_ref |
| amrex::Vector< double > | ocean_times |
| 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. | |
| double | time_before |
| Time in ocean_times immediately before the last time interpolated to. | |
| double | time_after |
| Time in ocean_times immediately after the last time interpolated to. | |
| bool | is_cycle |
| Whether the time series is a cycle. | |
| double | cycle_length |
| If a cycle, what is the cycle length? | |
| 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_interp_lev0 |
| Multifab storing temporally interpolated data on level 0. | |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | mf_interpolated_lev |
| Interpolated data on each requested AMR level if save_interpolated=true. | |
| int | last_updated_lev = -1 |
| 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 16 of file REMORA_NCTimeSeries.H.
| NCTimeSeries::NCTimeSeries | ( | 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, | ||
| amrex::MultiFab * | a_mf_var, | ||
| bool | a_is2d, | ||
| bool | a_save_interpolated, | ||
| double | a_time_ref | ||
| ) |
Constructor.
| [in] | a_file_names | vector of file name(s) 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 |
| [in] | a_time_ref | remora.time_ref, the reference date of the model clock |
Definition at line 25 of file REMORA_NCTimeSeries.cpp.

|
private |
Build cumulative refinement ratio from level 0 to lev.
Definition at line 326 of file REMORA_NCTimeSeries.cpp.
Referenced by update_interpolated_to_time().


| const amrex::MultiFab * NCTimeSeries::get_interpolated_mf | ( | int | lev | ) | const |
Access interpolated data saved for a specific level.
Definition at line 338 of file REMORA_NCTimeSeries.cpp.

| void NCTimeSeries::Initialize | ( | ) |
Read in time array from file and allocate data arrays.
Definition at line 40 of file REMORA_NCTimeSeries.cpp.

|
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 355 of file REMORA_NCTimeSeries.cpp.
Referenced by update_interpolated_to_time().


| void NCTimeSeries::update_interpolated_to_time | ( | double | time, |
| int | lev, | ||
| amrex::MultiFab * | mf_lev, | ||
| const amrex::Vector< amrex::Geometry > & | geom, | ||
| const amrex::Vector< amrex::IntVect > & | ref_ratio | ||
| ) |
Calculate interpolated values at time, in seconds on the model clock, and fill data for level lev.
| time | time to interpolate to |
Definition at line 201 of file REMORA_NCTimeSeries.cpp.

|
private |
If a cycle, what is the cycle length?
Definition at line 85 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
Domain.
Definition at line 57 of file REMORA_NCTimeSeries.H.
Referenced by NCTimeSeries(), and read_in_at_time().
|
private |
Field name in netcdf file.
Definition at line 53 of file REMORA_NCTimeSeries.H.
Referenced by get_interpolated_mf(), Initialize(), NCTimeSeries(), read_in_at_time(), and update_interpolated_to_time().
|
private |
File index to access a particular time.
Definition at line 73 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and read_in_at_time().
|
private |
Whether each file stores this field as one value per time record.
Definition at line 51 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and read_in_at_time().
|
private |
Offset to access a particular time within its file.
Definition at line 75 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and read_in_at_time().
|
private |
File names to read from.
Definition at line 49 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 77 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 60 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), NCTimeSeries(), and read_in_at_time().
|
private |
Whether the time series is a cycle.
Definition at line 83 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
Level of the most recent update. One series serves every level, and under subcycling the levels ask for different times, so a saved buffer is only current for the level that last updated it. Callers update immediately before reading; this records enough to catch a caller that stops doing so.
Definition at line 100 of file REMORA_NCTimeSeries.H.
Referenced by get_interpolated_mf(), and update_interpolated_to_time().
|
private |
Multifab to store data at time_after.
Definition at line 90 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
Multifab to store data at time_before.
Definition at line 88 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
Multifab storing temporally interpolated data on level 0.
Definition at line 92 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and update_interpolated_to_time().
|
private |
Interpolated data on each requested AMR level if save_interpolated=true.
Definition at line 94 of file REMORA_NCTimeSeries.H.
Referenced by get_interpolated_mf(), 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 104 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and NCTimeSeries().
|
private |
Time points in netcdf file, in seconds on the model clock. Double, like every time on the model clock: see REMORA::t_new.
Definition at line 71 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 63 of file REMORA_NCTimeSeries.H.
Referenced by get_interpolated_mf(), NCTimeSeries(), and update_interpolated_to_time().
|
private |
Time in ocean_times immediately after the last time interpolated to.
Definition at line 81 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 79 of file REMORA_NCTimeSeries.H.
Referenced by update_interpolated_to_time().
|
private |
Field name for time series in netcdf file.
Definition at line 55 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and NCTimeSeries().
|
private |
remora.time_ref: the reference date the model clock counts from. The file's times are placed on that clock from the reference date in their units attribute. Double, like every reference date.
Definition at line 67 of file REMORA_NCTimeSeries.H.
Referenced by Initialize(), and NCTimeSeries().