REMORA
Regional Modeling of Oceans Refined Adaptively
Loading...
Searching...
No Matches
NCTimeSeriesBoundary Class Reference

A class to hold and interpolate time series data read from a NetCDF file. More...

#include <REMORA_NCTimeSeriesBoundary.H>

Collaboration diagram for NCTimeSeriesBoundary:

Public Member Functions

 NCTimeSeriesBoundary (int a_lev, const amrex::Vector< amrex::Geometry > a_geom, const amrex::Vector< std::string > &a_file_name, const std::string a_field_name, const std::string a_time_name, const amrex::IntVect a_index_type, const amrex::GpuArray< bool, AMREX_SPACEDIM *2 > &a_var_need_data, bool a_is2d, int rx, int ry, double a_time_ref)
 Constructor.
 
void Initialize ()
 Read in time array from file and allocate data arrays.
 
void update_interpolated_to_time (double time)
 Calculate interpolated values at time, in seconds on the model clock, reading in data as necessary.
 
void interp_fab (amrex::FArrayBox &dat_crse, amrex::FArrayBox &dat_fine)
 spatially interpolate boundary fabs from level 0 data (read in) to current level
 

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 *‍/.
 
int m_rx
 Refinement ratios relative to level 0.
 
int m_ry
 

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.
 
int m_lev
 Level at which we are holding the boundary data.
 
amrex::Vector< amrex::Geometry > m_geom
 Geometry at all levels.
 
bool is2d
 Whether the field we're reading in is 2d.
 
double time_ref
 
amrex::Vector< double > bry_times
 Time points in netcdf file, in seconds on the model clock.
 
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.
 
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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ NCTimeSeriesBoundary()

NCTimeSeriesBoundary::NCTimeSeriesBoundary ( int  a_lev,
const amrex::Vector< amrex::Geometry >  a_geom,
const amrex::Vector< std::string > &  a_file_names,
const std::string  a_field_name,
const std::string  a_time_name,
const amrex::IntVect  a_index_type,
const amrex::GpuArray< bool, AMREX_SPACEDIM *2 > &  a_var_need_data,
bool  a_is2d,
int  a_rx,
int  a_ry,
double  a_time_ref 
)

Constructor.

Parameters
[in]a_levlevel at which we will store the data
[in]a_geomVector of Geometry objects at all levels
[in]a_file_namevector of file name(s) to read from
[in]a_field_namename of field to read in
[in]a_time_namename of time variable in NetCDF file
[in]a_index_typenodality of data field
[in]a_var_need_dataarray over boundaries of flags that indicate whether we need data for the variable
[in]a_is2dWhether the variable we're working with is 2D
[in]a_rxrefinement ratio in x relative to level 0
[in]a_ryrefinement ratio in y relative to level 0
[in]a_time_refremora.time_ref, the reference date of the model clock

Definition at line 22 of file REMORA_NCTimeSeriesBoundary.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ Initialize()

void NCTimeSeriesBoundary::Initialize ( )

Read in time array from file and allocate data arrays.

Definition at line 45 of file REMORA_NCTimeSeriesBoundary.cpp.

Here is the call graph for this function:

◆ interp_fab()

void NCTimeSeriesBoundary::interp_fab ( amrex::FArrayBox &  dat_crse,
amrex::FArrayBox &  dat_fine 
)

spatially interpolate boundary fabs from level 0 data (read in) to current level

Parameters
[in]dat_crsefab of coarse data to interpolate from
[out]dat_finefab of fine data to interpoalte to

Definition at line 513 of file REMORA_NCTimeSeriesBoundary.cpp.

Referenced by update_interpolated_to_time().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ read_in_at_time()

void NCTimeSeriesBoundary::read_in_at_time ( amrex::FArrayBox &  fab_xlo,
amrex::FArrayBox &  fab_xhi,
amrex::FArrayBox &  fab_ylo,
amrex::FArrayBox &  fab_yhi,
int  itime 
)
private

Read in data from file at time index itime and fill into mf.

Parameters
[in,out]fab_xlofab to store xlo boundary data into
[in,out]fab_xhifab to store xhi boundary data into
[in,out]fab_ylofab to store ylo boundary data into
[in,out]fab_yhifab to store yhi boundary data into
[in]itimeindex of time step to read from file

Definition at line 382 of file REMORA_NCTimeSeriesBoundary.cpp.

Referenced by update_interpolated_to_time().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_interpolated_to_time()

void NCTimeSeriesBoundary::update_interpolated_to_time ( double  time)

Calculate interpolated values at time, in seconds on the model clock, reading in data as necessary.

Parameters
timetime to interpolate to

Definition at line 193 of file REMORA_NCTimeSeriesBoundary.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ bry_times

amrex::Vector<double> NCTimeSeriesBoundary::bry_times
private

Time points in netcdf file, in seconds on the model clock.

Definition at line 92 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), read_in_at_time(), and update_interpolated_to_time().

◆ domain

amrex::Box NCTimeSeriesBoundary::domain
private

Domain.

Definition at line 73 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and NCTimeSeriesBoundary().

◆ field_name

std::string NCTimeSeriesBoundary::field_name
private

Field name in netcdf file.

Definition at line 67 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), NCTimeSeriesBoundary(), read_in_at_time(), and update_interpolated_to_time().

◆ file_for_time

amrex::Vector<int> NCTimeSeriesBoundary::file_for_time
private

File index to access a particular time.

Definition at line 94 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and read_in_at_time().

◆ file_itime_offset

amrex::Vector<int> NCTimeSeriesBoundary::file_itime_offset
private

Offset to access a particular time within its file.

Definition at line 96 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and read_in_at_time().

◆ file_names

amrex::Vector<std::string> NCTimeSeriesBoundary::file_names
private

File name to read from.

Definition at line 65 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), NCTimeSeriesBoundary(), and read_in_at_time().

◆ i_time_before

int NCTimeSeriesBoundary::i_time_before
private

Time index immediately before the last time interpolated to.

Definition at line 98 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and update_interpolated_to_time().

◆ index_type

amrex::IntVect NCTimeSeriesBoundary::index_type
private

Index type for field to fill.

Definition at line 75 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), NCTimeSeriesBoundary(), and update_interpolated_to_time().

◆ is2d

bool NCTimeSeriesBoundary::is2d
private

Whether the field we're reading in is 2d.

Definition at line 84 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), NCTimeSeriesBoundary(), read_in_at_time(), and update_interpolated_to_time().

◆ m_geom

amrex::Vector<amrex::Geometry> NCTimeSeriesBoundary::m_geom
private

Geometry at all levels.

Definition at line 81 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by NCTimeSeriesBoundary(), and update_interpolated_to_time().

◆ m_lev

int NCTimeSeriesBoundary::m_lev
private

Level at which we are holding the boundary data.

Definition at line 78 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by NCTimeSeriesBoundary(), and update_interpolated_to_time().

◆ m_rx

int NCTimeSeriesBoundary::m_rx

Refinement ratios relative to level 0.

Definition at line 50 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by interp_fab(), and NCTimeSeriesBoundary().

◆ m_ry

int NCTimeSeriesBoundary::m_ry

Definition at line 50 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by interp_fab(), and NCTimeSeriesBoundary().

◆ nc_var_names

amrex::Vector<std::string> NCTimeSeriesBoundary::nc_var_names
private

Variable names that will be read from file.

Definition at line 69 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), read_in_at_time(), and update_interpolated_to_time().

◆ time_after

double NCTimeSeriesBoundary::time_after
private

Time in ocean_times immediately after the last time interpolated to.

Definition at line 102 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by update_interpolated_to_time().

◆ time_before

double NCTimeSeriesBoundary::time_before
private

Time in ocean_times immediately before the last time interpolated to.

Definition at line 100 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by update_interpolated_to_time().

◆ time_name

std::string NCTimeSeriesBoundary::time_name
private

Field name for time series in netcdf file.

Definition at line 71 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and NCTimeSeriesBoundary().

◆ time_ref

double NCTimeSeriesBoundary::time_ref
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 89 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and NCTimeSeriesBoundary().

◆ var_need_data

amrex::GpuArray<bool, AMREX_SPACEDIM*2> NCTimeSeriesBoundary::var_need_data
private

Array over boundaries indicating whether we need physical data for this variable.

Definition at line 125 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), NCTimeSeriesBoundary(), and update_interpolated_to_time().

◆ xhi_dat_after

amrex::FArrayBox NCTimeSeriesBoundary::xhi_dat_after
private

FArrayBox to store data at time_after at xhi boundary.

Definition at line 117 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and update_interpolated_to_time().

◆ xhi_dat_before

amrex::FArrayBox NCTimeSeriesBoundary::xhi_dat_before
private

FArrayBox to store data at time_before at xhi boundary.

Definition at line 115 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and update_interpolated_to_time().

◆ xhi_dat_interp

amrex::FArrayBox NCTimeSeriesBoundary::xhi_dat_interp

FArrayBox to store data at inteprolated time at xhi boundary *‍/.

Definition at line 44 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and update_interpolated_to_time().

◆ xlo_dat_after

amrex::FArrayBox NCTimeSeriesBoundary::xlo_dat_after
private

FArrayBox to store data at time_after at xlo boundary.

Definition at line 107 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and update_interpolated_to_time().

◆ xlo_dat_before

amrex::FArrayBox NCTimeSeriesBoundary::xlo_dat_before
private

FArrayBox to store data at time_before at xlo boundary.

Definition at line 105 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and update_interpolated_to_time().

◆ xlo_dat_interp

amrex::FArrayBox NCTimeSeriesBoundary::xlo_dat_interp

FArrayBox to store data at inteprolated time at xlo boundary *‍/.

Definition at line 38 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and update_interpolated_to_time().

◆ yhi_dat_after

amrex::FArrayBox NCTimeSeriesBoundary::yhi_dat_after
private

FArrayBox to store data at time_after at yhi boundary.

Definition at line 122 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and update_interpolated_to_time().

◆ yhi_dat_before

amrex::FArrayBox NCTimeSeriesBoundary::yhi_dat_before
private

FArrayBox to store data at time_before at yhi boundary.

Definition at line 120 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and update_interpolated_to_time().

◆ yhi_dat_interp

amrex::FArrayBox NCTimeSeriesBoundary::yhi_dat_interp

FArrayBox to store data at inteprolated time at yhi boundary *‍/.

Definition at line 47 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and update_interpolated_to_time().

◆ ylo_dat_after

amrex::FArrayBox NCTimeSeriesBoundary::ylo_dat_after
private

FArrayBox to store data at time_after at ylo boundary.

Definition at line 112 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and update_interpolated_to_time().

◆ ylo_dat_before

amrex::FArrayBox NCTimeSeriesBoundary::ylo_dat_before
private

FArrayBox to store data at time_before at ylo boundary.

Definition at line 110 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and update_interpolated_to_time().

◆ ylo_dat_interp

amrex::FArrayBox NCTimeSeriesBoundary::ylo_dat_interp

FArrayBox to store data at inteprolated time at ylo boundary *‍/.

Definition at line 41 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and update_interpolated_to_time().


The documentation for this class was generated from the following files: