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 (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.
 

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 ( 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.

Parameters
[in]a_file_namefile name to read from
[in]a_field_namename of field to read in
[in]a_time_namename of time variable in NetCDF file
[in]a_domainsimulation domain
[in]a_is2dWhether the variable we're working with is 2D

Definition at line 16 of file REMORA_NCTimeSeriesBoundary.cpp.

Member Function Documentation

◆ Initialize()

void NCTimeSeriesBoundary::Initialize ( )

Read in time array from file and allocate data arrays.

Definition at line 31 of file REMORA_NCTimeSeriesBoundary.cpp.

Here is the call 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 219 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 ( amrex::Real  time)

Calculate interpolated values at time, reading in data as necessary.

Parameters
timetime to interpolate to

Definition at line 145 of file REMORA_NCTimeSeriesBoundary.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ bry_times

amrex::Vector<amrex::Real> NCTimeSeriesBoundary::bry_times
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().

◆ domain

amrex::Box NCTimeSeriesBoundary::domain
private

Domain.

Definition at line 64 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 58 of file REMORA_NCTimeSeriesBoundary.H.

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

◆ file_for_time

amrex::Vector<int> NCTimeSeriesBoundary::file_for_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().

◆ file_itime_offset

amrex::Vector<int> NCTimeSeriesBoundary::file_itime_offset
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().

◆ file_names

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

File name to read from.

Definition at line 56 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 78 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 66 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and NCTimeSeriesBoundary().

◆ is2d

bool NCTimeSeriesBoundary::is2d
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().

◆ nc_var_names

amrex::Vector<std::string> NCTimeSeriesBoundary::nc_var_names
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().

◆ time_after

amrex::Real NCTimeSeriesBoundary::time_after
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().

◆ time_before

amrex::Real NCTimeSeriesBoundary::time_before
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().

◆ time_name

std::string NCTimeSeriesBoundary::time_name
private

Field name for time series in netcdf file.

Definition at line 62 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 105 of file REMORA_NCTimeSeriesBoundary.H.

Referenced by Initialize(), and NCTimeSeriesBoundary().

◆ xhi_dat_after

amrex::FArrayBox NCTimeSeriesBoundary::xhi_dat_after
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().

◆ xhi_dat_before

amrex::FArrayBox NCTimeSeriesBoundary::xhi_dat_before
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().

◆ xhi_dat_interp

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().

◆ xlo_dat_after

amrex::FArrayBox NCTimeSeriesBoundary::xlo_dat_after
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().

◆ xlo_dat_before

amrex::FArrayBox NCTimeSeriesBoundary::xlo_dat_before
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().

◆ xlo_dat_interp

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().

◆ yhi_dat_after

amrex::FArrayBox NCTimeSeriesBoundary::yhi_dat_after
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().

◆ yhi_dat_before

amrex::FArrayBox NCTimeSeriesBoundary::yhi_dat_before
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().

◆ yhi_dat_interp

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().

◆ ylo_dat_after

amrex::FArrayBox NCTimeSeriesBoundary::ylo_dat_after
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().

◆ ylo_dat_before

amrex::FArrayBox NCTimeSeriesBoundary::ylo_dat_before
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().

◆ ylo_dat_interp

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().


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