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

Class that stores all relevant simulation state data with methods for time stepping. More...

#include <REMORA.H>

Inheritance diagram for REMORA:

Classes

struct  CF2DCache
 one cached two-level fill: the values it leaves in the ghost cells it writes (mask), per component, with the fill time and coarse generation of each More...
 
struct  NCHistoryFile
 The NetCDF history file a level is writing to. More...
 

Public Types

enum class  DriverAtmosForcingMode : int { State = 0 , Flux }
 
enum class  LoadBalance { amrex , sfc , knapsack , roundrobin }
 How MakeDistributionMap assigns boxes to ranks (remora.load_balance) More...
 

Public Member Functions

 REMORA ()
 
 REMORA (const amrex::RealBox &rb, int max_level_in, const amrex::Vector< int > &n_cell_in, int coord, const amrex::Vector< amrex::IntVect > &ref_ratio, const amrex::Array< int, AMREX_SPACEDIM > &is_per, std::string prefix)
 
virtual ~REMORA ()
 
void Evolve ()
 Advance solution to final time.
 
void WriteAtFinalTime ()
 Write checkpoint and plotfiles at end of simulation.
 
void WriteAtIntermediateTime (int step, amrex::Real cur_time)
 Write checkpoint and plotfiles at intermediate point of simulation, if needed.
 
virtual void ErrorEst (int lev, amrex::TagBoxArray &tags, amrex::Real time, int ngrow) override
 Tag cells for refinement.
 
void InitData ()
 Initialize multilevel data.
 
amrex::Real EvolveOneStep (amrex::Real time, amrex::Real dt_request)
 
void SetStartTime (double time) noexcept
 Set remora.start_time. Call before InitData, which starts the clock from it.
 
void ConfigureDriverAtmosToOceanCoupling (bool use_coupling_driver, bool use_two_way_coupling, DriverAtmosForcingMode active_mode)
 
void SetDriverAtmosToOceanForcingMode (DriverAtmosForcingMode mode)
 
void SetLongwaveFromDriver ()
 
void GetDeckConfiguredAtmosStateLanes (std::array< bool, AtmosState::NumTypes > &deck_configured) const
 
void GetAtmosToOceanRhoLayout (amrex::BoxArray &ba, amrex::DistributionMapping &dm) const
 
void GetAtmosToOceanUFaceLayout (amrex::BoxArray &ba, amrex::DistributionMapping &dm) const
 
void GetAtmosToOceanVFaceLayout (amrex::BoxArray &ba, amrex::DistributionMapping &dm) const
 
void GetAtmosToOceanPsiCoordinates (const amrex::MultiFab *&x_psi, const amrex::MultiFab *&y_psi) const
 
void GetAtmosToOceanPsiLonLat (const amrex::MultiFab *&lon_psi, const amrex::MultiFab *&lat_psi) const
 
void GetRhoLonLat (const amrex::MultiFab *&lon_rho, const amrex::MultiFab *&lat_rho) const
 
void GetLandSeaMasks (const amrex::MultiFab *&mskr, const amrex::MultiFab *&msku, const amrex::MultiFab *&mskv) const
 
void init_only (int lev, amrex::Real time)
 Init (NOT restart or regrid)
 
void restart ()
 
void post_timestep (int nstep, amrex::Real time, amrex::Real dt_lev)
 Called after every level 0 timestep.
 
void PackSurfaceState (amrex::Vector< amrex::MultiFab * > &state, amrex::Real time, const amrex::MultiFab *weight_o2a_mf, const amrex::iMultiFab *index_o2a_mf, int max_stencil_size, const amrex::iMultiFab *dst_land_mask=nullptr)
 Extracts SST from the 3D conservative state for the atmospheric driver.
 
void ApplyAtmosphericStates (const amrex::Vector< amrex::MultiFab * > &states, amrex::Real time)
 Receives atmospheric states from the driver and applies unit conversions.
 
void ApplyAtmosphericFluxes (const amrex::Vector< amrex::MultiFab * > &states, amrex::Real time)
 Receives atmospheric flux lanes from the driver and assembles REMORA flux inputs.
 
void sum_integrated_quantities (amrex::Real time)
 Integrate conserved quantities for diagnostics.
 
amrex::Real volWgtSumMF (int lev, const amrex::MultiFab &mf, int comp, bool local, bool finemask)
 Perform the volume-weighted sum.
 
bool is_it_time_for_action (int nstep, amrex::Real time, amrex::Real dt, int action_interval, amrex::Real action_per)
 Decide if it is time to take an action.
 
virtual void MakeNewLevelFromCoarse (int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override
 Make a new level using provided BoxArray and DistributionMapping and fill with interpolated coarse level data. Overrides the pure virtual function in AmrCore.
 
virtual void RemakeLevel (int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override
 Remake an existing level using provided BoxArray and DistributionMapping and fill with existing fine and coarse data. Overrides the pure virtual function in AmrCore.
 
virtual void ClearLevel (int lev) override
 Delete level data Overrides the pure virtual function in AmrCore.
 
virtual void MakeNewLevelFromScratch (int lev, amrex::Real time, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm) override
 Make a new level from scratch using provided BoxArray and DistributionMapping. Only used during initialization. Overrides the pure virtual function in AmrCore.
 
virtual amrex::DistributionMapping MakeDistributionMap (int lev, amrex::BoxArray const &ba) override
 Distribution mapping for a new BoxArray on level lev, by remora.load_balance: each box weighs its wet cells plus remora.load_balance_land_weight times its land cells (overrides AmrMesh)
 
bool probe_rho_mask (int lev, amrex::MultiFab &mskr)
 The rho-point mask a level lev on mskr's layout would get, before that level exists; false if it cannot be known yet.
 
bool wet_cells_per_box (int lev, const amrex::BoxArray &ba, amrex::Vector< amrex::Long > &wet)
 Wet cells in each box of a prospective layout of level lev; false if unknown.
 
std::string load_balance_name () const
 The remora.load_balance spelling of the current strategy.
 
virtual void regrid (int lbase, amrex::Real time, bool initial=false) override
 Regrid (overrides AmrCore), then check that level 1 stays clear of dropped level-0 boxes.
 
amrex::BoxArray drop_dry_level0_boxes (const amrex::BoxArray &ba)
 The kept boxes of a level-0 BoxArray under remora.drop_dry_boxes.
 
amrex::BoxList level0_refine_footprint (bool &unbounded) const
 Level-0 index region a finer level may need; unbounded if it can go anywhere.
 
bool level0_has_holes () const
 Whether level 0's BoxArray leaves part of the domain out.
 
void check_dry_box_nesting () const
 Abort if level 1 or its coarse stencil reaches a dropped level-0 box.
 
amrex::Vector< amrex::MultiFab * > level0_fields (bool all)
 The level-0 fields: the evolving ones, and with all the static ones too.
 
amrex::Long set_dry_ghost_cells (amrex::MultiFab &mf, amrex::Real val)
 Write val into the cells of a level-0 field inside the domain but in no box.
 
void zero_level0_dry_ghost_cells ()
 Zero those cells in every level-0 field (see set_dry_ghost_cells)
 
void check_dropped_level0_mask ()
 Check level 0's mask against the mask the dropping decision was made on.
 
void poison_dry_ghost_cells ()
 remora.dry_ghost_test: overwrite the ghost cells of kept level-0 boxes that lie in dropped boxes (1: signalling NaN, 2: a large finite value) after initialization
 
void set_grid_scale (int lev)
 Set pm and pn arrays and x/y coords on level lev.
 
void set_grid_coords_from_grid_scale (int lev)
 Set x/y coords on level lev based on pm and pn.
 
void set_curvilinear_terms_from_grid_scale (int lev)
 Set curvilinear derivative terms on level lev based on pm and pn.
 
void set_derived_metrics (int lev)
 fill vec_metric_r/u/v/p from the level's final pm and pn
 
void set_grid_vars_averaged_down (int lev)
 Set pm/pn by averaging down from higher-resolution grid.
 
void set_zeta_to_Ztavg (int lev, bool apply_eminusp=true)
 Set zeta components to be equal to time-averaged Zt_avg1.
 
void calculate_nodal_masks (int lev)
 Calculate u-, v-, and psi-point masks based on rho-point masks after analytic initialization.
 
void fill_3d_masks (int lev)
 Copy maskr to all z levels.
 
amrex::Real estTimeStep (int lev) const
 compute dt from CFL considerations
 
void remora_advance (int level, amrex::MultiFab &cons_old, amrex::MultiFab &cons_new, amrex::MultiFab &xvel_old, amrex::MultiFab &yvel_old, amrex::MultiFab &zvel_old, amrex::MultiFab &xvel_new, amrex::MultiFab &yvel_new, amrex::MultiFab &zvel_new, amrex::MultiFab &source, const amrex::Geometry fine_geom, const amrex::Real dt, const amrex::Real time)
 Interface for advancing the data at one level by one "slow" timestep.
 
amrex::MultiFab & build_fine_mask (int lev)
 Make mask to zero out covered cells (for mesh refinement)
 
void WritePlotFile (int istep)
 main driver for writing AMReX plotfiles
 
void WriteMultiLevelPlotfileWithBathymetry (const std::string &plotfilename, int nlevels, const amrex::Vector< const amrex::MultiFab * > &mf, const amrex::Vector< const amrex::MultiFab * > &mf_nd, const amrex::Vector< const amrex::MultiFab * > &mf_u, const amrex::Vector< const amrex::MultiFab * > &mf_v, const amrex::Vector< const amrex::MultiFab * > &mf_w, const amrex::Vector< const amrex::MultiFab * > &mf_2d_rho, const amrex::Vector< const amrex::MultiFab * > &mf_2d_u, const amrex::Vector< const amrex::MultiFab * > &mf_2d_v, const amrex::Vector< std::string > &varnames_3d, const amrex::Vector< std::string > &varnames_2d_rho, const amrex::Vector< std::string > &varnames_2d_u, const amrex::Vector< std::string > &varnames_2d_v, const amrex::Vector< amrex::Geometry > &my_geom, double time, const amrex::Vector< int > &level_steps, const amrex::Vector< amrex::IntVect > &rr, const std::string &versionName="HyperCLaw-V1.1", const std::string &levelPrefix="Level_", const std::string &mfPrefix="Cell", const amrex::Vector< std::string > &extra_dirs=amrex::Vector< std::string >()) const
 write out particular data to an AMReX plotfile
 
void WriteGenericPlotfileHeaderWithBathymetry (std::ostream &HeaderFile, int nlevels, const amrex::Vector< amrex::BoxArray > &bArray, const amrex::Vector< std::string > &varnames_3d, const amrex::Vector< std::string > &varnames_2d_rho, const amrex::Vector< std::string > &varnames_2d_u, const amrex::Vector< std::string > &varnames_2d_v, const amrex::Vector< amrex::Geometry > &my_geom, double time, const amrex::Vector< int > &level_steps, const amrex::Vector< amrex::IntVect > &rr, const std::string &versionName, const std::string &levelPrefix, const std::string &mfPrefix) const
 write out header data for an AMReX plotfile
 
void Advance (int lev, amrex::Real time, amrex::Real dt_lev, int iteration, int ncycle)
 advance a single level for a single time step
 
void register_coarse_data (int lev, amrex::Real time, amrex::Real dt_lev)
 register this level's completed step as the coarse bracket the next finer level interpolates within
 
void roll_2d_snapshot (amrex::Vector< std::unique_ptr< amrex::MultiFab > > &old_v, amrex::Vector< std::unique_ptr< amrex::MultiFab > > &new_v, int lev, const amrex::MultiFab &src, const amrex::MultiFab &like)
 roll a two-snapshot history of a level's end-of-step 2D state
 
void set_2d_cf_bcs (int lev, amrex::Real time, int know, int knew)
 set this level's barotropic contact points from its parent, mass-conservingly
 
void set_2d_cf_flux (int lev, amrex::Real time, amrex::MultiFab &mf_DUon, amrex::MultiFab &mf_DVom)
 impose the parent's barotropic mass flux on the coarse-fine interface faces
 
void store_2d_flux (int lev)
 store this level's barotropic mass flux per unit cell edge length
 
void reflux_to (int lev)
 apply the lev/lev+1 tracer flux correction onto lev
 
void check_cf_metrics (int crse_lev)
 check that fine cell edges sum to the coarse edge across an interface
 
void check_plot_nodal_z (const amrex::Vector< const amrex::MultiFab * > &nd, const amrex::Vector< amrex::Geometry > &g)
 
void plot_node_coords (amrex::Vector< amrex::MultiFab > &mf_xy)
 Physical (x, y) of the psi points on every level, for plotfile output.
 
void setup_step (int lev, amrex::Real time, amrex::Real dt_lev)
 Set everything up for a step on a level.
 
void advance_3d_ml (int lev, amrex::Real dt_lev)
 3D advance on a single level
 
void advance_2d_onestep (int lev, amrex::Real dt_lev, amrex::Real dtfast_lev, int my_iif, int nfast_counter)
 2D advance, one predictor/corrector step
 
void advance_2d (int lev, amrex::MultiFab const *mf_rhoS, amrex::MultiFab const *mf_rhoA, amrex::MultiFab *mf_ru2d, amrex::MultiFab *mf_rv2d, amrex::MultiFab *mf_rufrc, amrex::MultiFab *mf_rvfrc, amrex::MultiFab *mf_Zt_avg1, std::unique_ptr< amrex::MultiFab > &mf_DU_avg1, std::unique_ptr< amrex::MultiFab > &mf_DU_avg2, std::unique_ptr< amrex::MultiFab > &mf_DV_avg1, std::unique_ptr< amrex::MultiFab > &mf_DV_avg2, std::unique_ptr< amrex::MultiFab > &mf_rubar, std::unique_ptr< amrex::MultiFab > &mf_rvbar, std::unique_ptr< amrex::MultiFab > &mf_rzeta, std::unique_ptr< amrex::MultiFab > &mf_ubar, std::unique_ptr< amrex::MultiFab > &mf_vbar, amrex::MultiFab *mf_zeta, amrex::MultiFab const *mf_h, amrex::MultiFab const *mf_pm, amrex::MultiFab const *mf_pn, amrex::MultiFab const *mf_fcor, amrex::MultiFab const *mf_visc2_p, amrex::MultiFab const *mf_visc2_r, amrex::MultiFab const *mf_mskr, amrex::MultiFab const *mf_msku, amrex::MultiFab const *mf_mskv, amrex::MultiFab const *mf_mskp, amrex::Real dtfast_lev, bool predictor_2d_step, bool first_2d_step, int my_iif, int &next_indx1)
 Perform a 2D predictor (predictor_2d_step=True) or corrector (predictor_2d_step=False) step.
 
void advance_3d (int lev, amrex::MultiFab &mf_cons, amrex::MultiFab &mf_u, amrex::MultiFab &mf_v, amrex::MultiFab *mf_sstore, amrex::MultiFab *mf_ru, amrex::MultiFab *mf_rv, std::unique_ptr< amrex::MultiFab > &mf_DU_avg1, std::unique_ptr< amrex::MultiFab > &mf_DU_avg2, std::unique_ptr< amrex::MultiFab > &mf_DV_avg1, std::unique_ptr< amrex::MultiFab > &mf_DV_avg2, std::unique_ptr< amrex::MultiFab > &mf_ubar, std::unique_ptr< amrex::MultiFab > &mf_vbar, std::unique_ptr< amrex::MultiFab > &mf_Akv, std::unique_ptr< amrex::MultiFab > &mf_Akt, std::unique_ptr< amrex::MultiFab > &mf_Hz, std::unique_ptr< amrex::MultiFab > &mf_Huon, std::unique_ptr< amrex::MultiFab > &mf_Hvom, std::unique_ptr< amrex::MultiFab > &mf_z_w, amrex::MultiFab const *mf_h, amrex::MultiFab const *mf_pm, amrex::MultiFab const *mf_pn, amrex::MultiFab const *mf_mskr, amrex::MultiFab const *mf_msku, amrex::MultiFab const *mf_mskv, const int N, const amrex::Real dt_lev)
 Advance the 3D variables.
 
void advance_biology (int lev, amrex::MultiFab const &mf_cons_old, amrex::MultiFab &mf_cons_new, int N, amrex::Real dt_lev)
 Apply biological tracer source/sink terms.
 
void bulk_fluxes (int lev, amrex::MultiFab *mf_cons, amrex::MultiFab *mf_uwind, amrex::MultiFab *mf_vwind, amrex::MultiFab *mf_Tair, amrex::MultiFab *mf_qair, amrex::MultiFab *mf_Pair, amrex::MultiFab *mf_srflx, amrex::MultiFab *mf_longwave_down, amrex::MultiFab *mf_evap, amrex::MultiFab *mf_sustr, amrex::MultiFab *mf_svstr, amrex::MultiFab *mf_stflux, amrex::MultiFab *mf_lrflx, amrex::MultiFab *mf_lhflx, amrex::MultiFab *mf_shflx, const int N)
 Calculate bulk temperature, salinity, wind fluxes.
 
void prestep (int lev, amrex::MultiFab &mf_uold, amrex::MultiFab &mf_vold, amrex::MultiFab &mf_u, amrex::MultiFab &mf_v, amrex::MultiFab *mf_ru, amrex::MultiFab *mf_rv, amrex::MultiFab &S_old, amrex::MultiFab &S_new, amrex::MultiFab &mf_W, amrex::MultiFab &mf_DC, const amrex::MultiFab *mf_z_r, const amrex::MultiFab *mf_z_w, const amrex::MultiFab *mf_h, const amrex::MultiFab *mf_pm, const amrex::MultiFab *mf_pn, const amrex::MultiFab *mf_sustr, const amrex::MultiFab *mf_svstr, const amrex::MultiFab *mf_bustr, const amrex::MultiFab *mf_bvstr, const amrex::MultiFab *mf_msku, const amrex::MultiFab *mf_mskv, const int iic, const int nfirst, const int nnew, int nstp, int nrhs, int N, const amrex::Real dt_lev)
 Wrapper function for prestep.
 
void prestep_t_advection (int lev, const amrex::Box &tbx, const amrex::Box &gbx, const amrex::Array4< amrex::Real > &tempold, const amrex::Array4< amrex::Real > &tempcache, const amrex::Array4< amrex::Real > &Hz, const amrex::Array4< amrex::Real > &Huon, const amrex::Array4< amrex::Real > &Hvom, const amrex::Array4< amrex::Real > &W, const amrex::Array4< amrex::Real > &DC, const amrex::Array4< amrex::Real > &FC, const amrex::Array4< amrex::Real > &sstore, const amrex::Array4< amrex::Real const > &z_w, const amrex::Array4< amrex::Real const > &h, const amrex::Array4< amrex::Real const > &pm, const amrex::Array4< amrex::Real const > &pn, const amrex::Array4< amrex::Real const > &msku, const amrex::Array4< amrex::Real const > &mskv, const amrex::Array4< int const > &river_pos, const amrex::Array4< amrex::Real const > &river_source, int iic, int ntfirst, int nrhs, int N, const amrex::Real dt_lev)
 Prestep advection calculations for the tracers.
 
void rhs_t_3d (int lev, const amrex::Box &bx, const amrex::Array4< amrex::Real > &t, const amrex::Array4< amrex::Real const > &tempstore, const amrex::Array4< amrex::Real const > &Huon, const amrex::Array4< amrex::Real const > &Hvom, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &pn, const amrex::Array4< amrex::Real const > &pm, const amrex::Array4< amrex::Real const > &W, const amrex::Array4< amrex::Real > &FC, const amrex::Array4< amrex::Real const > &mskr, const amrex::Array4< amrex::Real const > &msku, const amrex::Array4< amrex::Real const > &mskv, const amrex::Array4< int const > &river_pos, const amrex::Array4< amrex::Real const > &river_source, int nrhs, int nnew, int N, const amrex::Real dt_lev, const amrex::Array4< amrex::Real > &fx_reg=amrex::Array4< amrex::Real >(), const amrex::Array4< amrex::Real > &fy_reg=amrex::Array4< amrex::Real >())
 RHS terms for tracer.
 
void rhs_uv_3d (int lev, const amrex::Box &xbx, const amrex::Box &ybx, const amrex::Array4< amrex::Real const > &uold, const amrex::Array4< amrex::Real const > &vold, const amrex::Array4< amrex::Real > &ru, const amrex::Array4< amrex::Real > &rv, const amrex::Array4< amrex::Real > &rufrc, const amrex::Array4< amrex::Real > &rvfrc, const amrex::Array4< amrex::Real const > &sustr, const amrex::Array4< amrex::Real const > &svstr, const amrex::Array4< amrex::Real const > &bustr, const amrex::Array4< amrex::Real const > &bvstr, const amrex::Array4< amrex::Real const > &Huon, const amrex::Array4< amrex::Real const > &Hvom, const amrex::Array4< amrex::Real const > &omn_u, const amrex::Array4< amrex::Real const > &omn_v, const amrex::Array4< amrex::Real const > &W, const amrex::Array4< amrex::Real > &FC, int nrhs, int N)
 RHS terms for 3D momentum.
 
void rho_eos (const amrex::Box &bx, const amrex::Array4< amrex::Real const > &state, const amrex::Array4< amrex::Real > &rho, const amrex::Array4< amrex::Real > &rhoA, const amrex::Array4< amrex::Real > &rhoS, const amrex::Array4< amrex::Real > &bvf, const amrex::Array4< amrex::Real > &alpha, const amrex::Array4< amrex::Real > &beta, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &z_w, const amrex::Array4< amrex::Real const > &z_r, const amrex::Array4< amrex::Real const > &h, const amrex::Array4< amrex::Real const > &mskr, const int N)
 Wrapper around equation of state calculation.
 
void lin_eos (const amrex::Box &bx, const amrex::Array4< amrex::Real const > &state, const amrex::Array4< amrex::Real > &rho, const amrex::Array4< amrex::Real > &rhoA, const amrex::Array4< amrex::Real > &rhoS, const amrex::Array4< amrex::Real > &bvf, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &z_w, const amrex::Array4< amrex::Real const > &z_r, const amrex::Array4< amrex::Real const > &h, const amrex::Array4< amrex::Real const > &mskr, const int N)
 Calculate density and related quantities from linear equation of state.
 
void nonlin_eos (const amrex::Box &bx, const amrex::Array4< amrex::Real const > &state, const amrex::Array4< amrex::Real > &rho, const amrex::Array4< amrex::Real > &rhoA, const amrex::Array4< amrex::Real > &rhoS, const amrex::Array4< amrex::Real > &bvf, const amrex::Array4< amrex::Real > &alpha, const amrex::Array4< amrex::Real > &beta, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &z_w, const amrex::Array4< amrex::Real const > &z_r, const amrex::Array4< amrex::Real const > &h, const amrex::Array4< amrex::Real const > &mskr, const int N)
 Calculate density and related quantities from nonlinear equation of state.
 
void prsgrd (const amrex::Box &bx, const amrex::Box &gbx, const amrex::Box &utbx, const amrex::Box &vtbx, const amrex::Array4< amrex::Real > &ru, const amrex::Array4< amrex::Real > &rv, const amrex::Array4< amrex::Real const > &on_u, const amrex::Array4< amrex::Real const > &om_v, const amrex::Array4< amrex::Real const > &rho, const amrex::Array4< amrex::Real > &FC, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &z_r, const amrex::Array4< amrex::Real const > &z_w, const amrex::Array4< amrex::Real const > &msku, const amrex::Array4< amrex::Real const > &mskv, const int nrhs, const int N)
 Calculate pressure gradient.
 
void prestep_diffusion (const amrex::Box &bx, const amrex::Box &gbx, const int ioff, const int joff, const amrex::Array4< amrex::Real > &vel, const amrex::Array4< amrex::Real const > &vel_old, const amrex::Array4< amrex::Real > &rvel, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &Akv, const amrex::Array4< amrex::Real > &FC, const amrex::Array4< amrex::Real const > &sstr, const amrex::Array4< amrex::Real const > &bstr, const amrex::Array4< amrex::Real const > &z_r, const amrex::Array4< amrex::Real const > &pm, const amrex::Array4< amrex::Real const > &pn, const int iic, const int ntfirst, const int nnew, int nstp, int nrhs, int N, const amrex::Real lambda, const amrex::Real dt_lev)
 Update velocities or tracers with diffusion/viscosity as the last part of the prestep.
 
void vert_visc_3d (const amrex::Box &bx, const int ioff, const int joff, const amrex::Array4< amrex::Real > &phi, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real > &Hzk, const amrex::Array4< amrex::Real > &AK, const amrex::Array4< amrex::Real const > &Akv, const amrex::Array4< amrex::Real > &BC, const amrex::Array4< amrex::Real > &DC, const amrex::Array4< amrex::Real > &FC, const amrex::Array4< amrex::Real > &CF, const int nnew, const int N, const amrex::Real dt_lev)
 Calculate effects of vertical viscosity or diffusivity.
 
void compute_omega (int lev, amrex::MultiFab &mf_omega, const amrex::MultiFab &mf_Huon, const amrex::MultiFab &mf_Hvom)
 Velocity across the w-levels (omega, m/s) from the given mass fluxes.
 
void compute_diagnostic_omega (int lev, amrex::MultiFab &mf_omega)
 omega (m/s) as ROMS writes it: from mass fluxes of the current velocities
 
void compute_wvel (int lev, amrex::MultiFab &mf_w)
 "True" vertical velocity w (m/s) at w-points, as ROMS wvelocity
 
void compute_wvel (int lev, amrex::MultiFab &mf_w, const amrex::MultiFab &mf_omega)
 As compute_wvel, from an omega already computed by compute_diagnostic_omega.
 
amrex::Box netcdf_subdomain (int lev) const
 Region of a level that its NetCDF output covers.
 
bool netcdf_subdomain_has_gaps (int lev) const
 Whether a level's grids leave cells of its NetCDF region uncovered.
 
void compute_omega_and_w (int lev, amrex::MultiFab *mf_omega, amrex::MultiFab *mf_wvel)
 omega and w on the s_w points of the NetCDF output, ghost columns filled and masked
 
void set_massflux_3d (int lev, amrex::MultiFab &mf_Huon, amrex::MultiFab &mf_Hvom)
 Horizontal mass fluxes Hz*u/n and Hz*v/m of the current velocities, as ROMS set_massflux.
 
void update_massflux_3d (int lev, const amrex::Box &bx, const int ioff, const int joff, const amrex::Array4< amrex::Real > &phi, const amrex::Array4< amrex::Real > &phibar, const amrex::Array4< amrex::Real > &Hphi, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &om_v_or_on_u, const amrex::Array4< amrex::Real const > &Dphi1, const amrex::Array4< amrex::Real const > &Dphi2, const amrex::Array4< amrex::Real > &DC, const amrex::Array4< amrex::Real > &FC, const amrex::Array4< amrex::Real const > &msk, const int nnew)
 Correct mass flux.
 
void vert_mean_3d (const amrex::Box &bx, const int ioff, const int joff, const amrex::Array4< amrex::Real > &phi, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &Dphi_avg1, const amrex::Array4< amrex::Real > &DC, const amrex::Array4< amrex::Real > &CF, const amrex::Array4< amrex::Real const > &on_u_or_om_v, const amrex::Array4< amrex::Real const > &msk, const int nnew, const int N)
 Adjust 3D momentum variables based on vertical mean momentum.
 
void uv3dmix (const amrex::Box &xbx, const amrex::Box &ybx, const amrex::Array4< amrex::Real > &u, const amrex::Array4< amrex::Real > &v, const amrex::Array4< amrex::Real const > &uold, const amrex::Array4< amrex::Real const > &vold, const amrex::Array4< amrex::Real > &rufrc, const amrex::Array4< amrex::Real > &rvfrc, const amrex::Array4< amrex::Real const > &visc2_p, const amrex::Array4< amrex::Real const > &visc2_r, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &pm, const amrex::Array4< amrex::Real const > &pn, const amrex::Array4< amrex::Real const > &metr, const amrex::Array4< amrex::Real const > &metp, const amrex::Array4< amrex::Real const > &mskp, int nrhs, int nnew, const amrex::Real dt_lev)
 Harmonic viscosity.
 
void t3dmix2 (const amrex::Box &bx, const amrex::Array4< amrex::Real > &state, const amrex::Array4< amrex::Real > &state_rhs, const amrex::Array4< amrex::Real const > &diff2, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &z_r, const amrex::Array4< amrex::Real const > &pm, const amrex::Array4< amrex::Real const > &pn, const amrex::Array4< amrex::Real const > &metu, const amrex::Array4< amrex::Real const > &metv, const amrex::Array4< amrex::Real const > &msku, const amrex::Array4< amrex::Real const > &mskv, const amrex::Real dt_lev, const int ncomp, const int N)
 Wrapper for harmonic diffusivity for tracers.
 
void t3dmix2_s (const amrex::Box &bx, const amrex::Array4< amrex::Real > &state, const amrex::Array4< amrex::Real > &state_rhs, const amrex::Array4< amrex::Real const > &diff2, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &pm, const amrex::Array4< amrex::Real const > &pn, const amrex::Array4< amrex::Real const > &metu, const amrex::Array4< amrex::Real const > &metv, const amrex::Array4< amrex::Real const > &msku, const amrex::Array4< amrex::Real const > &mskv, const amrex::Real dt_lev, const int ncomp)
 Harmonic diffusivity for tracers along S-coordinate level surfaces.
 
void t3dmix2_geo (const amrex::Box &bx, const amrex::Array4< amrex::Real > &state, const amrex::Array4< amrex::Real > &state_rhs, const amrex::Array4< amrex::Real const > &diff2, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &z_r, const amrex::Array4< amrex::Real const > &pm, const amrex::Array4< amrex::Real const > &pn, const amrex::Array4< amrex::Real const > &metu, const amrex::Array4< amrex::Real const > &metv, const amrex::Array4< amrex::Real const > &msku, const amrex::Array4< amrex::Real const > &mskv, const amrex::Real dt_lev, const int ncomp, const int N)
 Harmonic diffusivity for tracers along geopotential surfaces.
 
void coriolis (const amrex::Box &xbx, const amrex::Box &ybx, const amrex::Array4< amrex::Real const > &uold, const amrex::Array4< amrex::Real const > &vold, const amrex::Array4< amrex::Real > &ru, const amrex::Array4< amrex::Real > &rv, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &fomn, int nrhs, int nr)
 Calculate Coriolis terms.
 
void curvilinear (const amrex::Box &bx, const amrex::Box &xbx, const amrex::Box &ybx, const amrex::Array4< amrex::Real const > &uold, const amrex::Array4< amrex::Real const > &vold, const amrex::Array4< amrex::Real > &ru, const amrex::Array4< amrex::Real > &rv, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &dndx, const amrex::Array4< amrex::Real const > &dmde, int nrhs, int nr)
 Calculate curvilinear advection terms.
 
void apply_clim_nudg (const amrex::Box &bx, int ioff, int joff, const amrex::Array4< amrex::Real > &var, const amrex::Array4< amrex::Real const > &var_old, const amrex::Array4< amrex::Real const > &var_clim, const amrex::Array4< amrex::Real const > &clim_coeff, const amrex::Array4< amrex::Real const > &Hz, const amrex::Array4< amrex::Real const > &om_face, const amrex::Array4< amrex::Real const > &on_face, const amrex::Real dt_lev=zero)
 Apply climatology nudging.
 
void set_2darrays (int lev)
 Set 2D momentum arrays from 3D momentum.
 
void set_zeta_average (int lev)
 Set Zt_avg1 to zeta.
 
void set_zeta (int lev)
 Initialize zeta from file or analytic.
 
void set_zeta_averaged_down (int lev)
 Copy over zeta data that has been averaged down from high res.
 
void set_bathymetry (int lev)
 Initialize bathymetry from file or analytic.
 
void set_bathymetry_averaged_down (int lev)
 Copy over bathymetry data that has been averaged down from high resolution input netcdf file.
 
void set_coriolis (int lev)
 Initialize Coriolis factor from file or analytic.
 
void set_masks (int lev)
 Initialize land-sea masks from file or analytic.
 
void set_masks_averaged_down (int lev)
 Copy this level's land-sea mask out of the full-domain mask that was coarsened down from hires_grid_level.
 
void coarsen_masks_with_grow_cells (int crse_lev)
 Coarsen the full-domain rho-mask from crse_lev+1 onto crse_lev, grow cells included, by the rule that a coarse cell is land only if all its fine cells are land.
 
void coarsen_bathymetry_with_grow_cells (int crse_lev)
 Coarsen the full-domain bathymetry from crse_lev+1 onto crse_lev, grow cells included, weighted by the land/sea mask.
 
void refine_masks_with_grow_cells (int fine_lev)
 Inject the full-domain rho-mask from fine_lev-1 onto fine_lev, piecewise constant, grow cells included.
 
void ensure_full_domain_masks (int top_lev)
 Make sure the full-domain rho-mask exists on levels 0 through top_lev.
 
void update_nodal_masks (int lev)
 Rebuild the u-, v- and psi-point masks from vec_mskr and fill their ghosts.
 
void inject_mask_outside_domain (int lev)
 Give lev's rho-mask ghost cells beyond the domain the coarser level's values.
 
void update_avgdown_masks (int crse_lev)
 Make sure the coarse masks the average-down kernels read sit on the coarsened layout of level crse_lev+1, rebuilding them if a regrid has moved it.
 
void clear_avgdown_masks (int lev)
 Drop the cached average-down masks of every level pair that involves lev.
 
void check_mask_consistency ()
 Check every level pair's masks against each other, and every level's mask values, reporting according to remora.mask_consistency.
 
void stretch_transform (int lev)
 Calculate vertical stretched coordinates.
 
void stretch_transform_full_domain (int lev, const amrex::MultiFab &mf_h, const amrex::MultiFab &mf_zeta, amrex::MultiFab &mf_z_r, amrex::MultiFab &mf_z_w)
 Calculate z_r and z_w on full-domain arrays at a level not yet created.
 
void init_set_vmix (int lev)
 Initialize vertical mixing coefficients from file or analytic.
 
void set_analytic_vmix (int lev)
 Set vertical mixing coefficients from analytic.
 
void init_gls_vmix (int lev, SolverChoice solver_choice)
 Initialize GLS variables.
 
void gls_prestep (int lev, amrex::MultiFab *mf_gls, amrex::MultiFab *mf_tke, amrex::MultiFab &mf_W, amrex::MultiFab *mf_msku, amrex::MultiFab *mf_mskv, const int nstp, const int nnew, const int iic, const int ntfirst, const int N, const amrex::Real dt_lev)
 Prestep for GLS calculation.
 
void gls_corrector (int lev, amrex::MultiFab *mf_gls, amrex::MultiFab *mf_tke, amrex::MultiFab &mf_W, amrex::MultiFab *mf_Akv, amrex::MultiFab *mf_Akt, amrex::MultiFab *mf_Akk, amrex::MultiFab *mf_Akp, amrex::MultiFab *mf_mskr, amrex::MultiFab *mf_msku, amrex::MultiFab *mf_mskv, const int nstp, const int nnew, const int N, const amrex::Real dt_lev)
 Corrector step for GLS calculation.
 
void scale_rhs_vars (int lev)
 Scale RHS momentum variables by 1/cell area, needed before FillPatch to different levels.
 
void scale_rhs_vars_inv (int lev)
 Scale RHS momentum variables by cell area, needed after FillPatch to different levels.
 
void set_smflux (int lev)
 Initialize or calculate surface momentum flux from file or analytic.
 
void set_surface_state (int lev)
 Initialize or calculate wind speed and other surface state vars from file or analytic.
 
void ensure_stress_rho_arrays (int lev)
 Make or remake the rho-point stress arrays of a level.
 
void rotate_to_grid_axes (amrex::MultiFab &u_east, amrex::MultiFab &v_north, const amrex::MultiFab &angle)
 Rotate a vector given as east and north components on rho points onto the grid's xi and eta axes, in place, over the valid cells and first ghost cell.
 
bool winds_need_rotation () const
 Whether the winds come from a lat-lon file and are to be rotated; the other component then comes from one too, or is uniform (checked at startup)
 
void average_stress_to_faces (int lev, const amrex::MultiFab &tau_xi_rho, const amrex::MultiFab &tau_eta_rho)
 Average rho-point stress components to the u and v faces.
 
void set_hmixcoef (int lev)
 Initialize horizontal mixing coefficients.
 
void set_drag (int lev)
 Initialize or calculate bottom drag.
 
void set_weights (int lev)
 Set weights for averaging 3D variables to 2D.
 
void FillBdyCCVels (int lev, amrex::MultiFab &mf_cc_vel)
 Fill the physical boundary conditions for cell-centered velocity (diagnostic only)
 
void FillPatch (int lev, amrex::Real time, amrex::MultiFab &mf_to_be_filled, amrex::Vector< amrex::MultiFab * > const &mfs, const int bccomp, const int bdy_var_type=BdyVars::null, const int icomp=0, const bool fill_all=true, const bool fill_set=false, const int n_not_fill=0, const int icomp_calc=0, const amrex::Real dt=zero, const amrex::MultiFab &mf_calc=amrex::MultiFab(), amrex::Vector< amrex::MultiFab * > const &mfs_crse_old={}, amrex::Vector< amrex::MultiFab * > const &mfs_crse_new={}, const int cf_cache_slot=-1)
 Fill a new MultiFab by copying in phi from valid region and filling ghost cells.
 
void cf_2d_cache_entry (int lev, int slot, const amrex::MultiFab &mf, const amrex::MultiFab &crse, amrex::Real time, amrex::Interpolater *mapper, int bccomp)
 Make cf_2d_cache[lev][slot] fit mf's layout: on a layout change, find the ghost cells a two-level fill of mf from crse writes (by a probe fill) and drop the cached values.
 
amrex::MultiFab & coarse_for_interp (int crse_lev, amrex::MultiFab &crse, amrex::MultiFab &scratch)
 Coarse data ready for a coarse-to-fine interpolation: ghost cells exchanged, and those beyond a wall made to agree with their periodic images.
 
void FillPatchNoBC (int lev, amrex::Real time, amrex::MultiFab &mf_to_be_filled, amrex::Vector< amrex::MultiFab * > const &mfs, const int bdy_var_type=BdyVars::null, const int icomp=0, const bool fill_all=true, const bool fill_set=false, amrex::Vector< amrex::MultiFab * > const &mfs_crse_old={}, amrex::Vector< amrex::MultiFab * > const &mfs_crse_new={})
 Fill a new MultiFab by copying in phi from valid region and filling ghost cells without applying boundary conditions.
 
void FillPatchBCs (int lev, amrex::Real time, amrex::MultiFab &mf_to_fill, const int bccomp, const int bdy_var_type, const int icomp, const int ncomp, const int n_not_fill, const int icomp_calc, const amrex::Real dt_lev, const amrex::MultiFab &mf_calc)
 The boundary-condition half of FillPatch: physical and NetCDF boundary conditions, periodic corners and the free-slip top, for a MultiFab whose fine-fine ghost cells are already filled. Lets several fields share one exchange.
 
void fill_from_bdyfiles (int lev, amrex::MultiFab &mf_to_fill, const amrex::MultiFab &mf_mask, const amrex::Real time, const int bccomp, const int bdy_var_type, const int icomp_to_fill, const int icomp_calc=0, const amrex::MultiFab &mf_calc=amrex::MultiFab(), const amrex::Real=zero)
 Fill boundary data from netcdf file.
 
void FillCoarsePatchPC (int lev, amrex::Real time, amrex::MultiFab *mf_fine, amrex::MultiFab *mf_crse, const int bccomp, const int bdy_var_type=BdyVars::null, const int icomp=0, const bool fill_all=true, const int n_not_fill=0, const int icomp_calc=0, const amrex::Real dt=zero, const amrex::MultiFab &mf_calc=amrex::MultiFab())
 fill an entire multifab by interpolating from the coarser level using the piecewise constant interpolater
 
void FillCoarsePatch (int lev, amrex::Real time, amrex::MultiFab *mf_fine, amrex::MultiFab *mf_crse, const int bccomp, const int bdy_var_type=BdyVars::null, const int icomp=0, const bool fill_all=true, const int n_not_fill=0, const int icomp_calc=0, const amrex::Real dt=zero, const amrex::MultiFab &mf_calc=amrex::MultiFab())
 fill an entire multifab by interpolating from the coarser level
 
void FillCoarsePatchMap (int lev, amrex::Real time, amrex::MultiFab *mf_fine, amrex::MultiFab *mf_crse, const int bccomp, const int bdy_var_type=BdyVars::null, const int icomp=0, const bool fill_all=true, const int n_not_fill=0, const int icomp_calc=0, const amrex::Real dt=zero, const amrex::MultiFab &mf_calc=amrex::MultiFab(), amrex::Interpolater *mapper=nullptr)
 fill an entire multifab by interpolating from the coarser level, explicitly specifying interpolator to use
 
void init_stretch_coeffs ()
 initialize and calculate stretch coefficients
 
void calc_stretch_coeffs ()
 calculate vertical stretch coefficients
 
void init_beta_plane_coriolis (int lev)
 Calculate Coriolis parameters from beta plane parametrization.
 
void init_bathymetry_full_domain_from_analytic ()
 Full domain bathymetry data initialization from analytic.
 
void init_masks_full_domain_from_analytic ()
 Full domain land-sea mask initialization from analytic.
 
void set_init_data_averaged_down (int lev)
 Problem initialization from averaged-down high resolution data.
 
void init_data_from_netcdf (int lev)
 Problem initialization from NetCDF file.
 
void init_biology_from_netcdf (int lev)
 Biology initialization from NetCDF file.
 
void init_scalars_from_netcdf (int lev)
 Passive (dye) scalar initialization from NetCDF file. Called from init_data_from_netcdf: dye follows remora.ic_type rather than having a source flag of its own.
 
void init_biology_ic (int lev)
 Initialize biology tracers from whichever source remora.biology_ic_type selects. Call after the physical fields exist: the analytic profiles are functions of temperature.
 
void init_biology_ic_full_domain ()
 Full-domain counterpart of init_biology_ic, for the hires_init_level average-down path.
 
void init_data_full_domain_from_netcdf ()
 High resolution roblem initialization from NetCDF file.
 
void init_biology_full_domain_from_netcdf ()
 Full-domain high-res biology initialization from NetCDF file.
 
void init_scalars_full_domain_from_netcdf ()
 Full-domain high-res passive (dye) scalar initialization from NetCDF file.
 
void init_bdry_from_netcdf (int lev)
 Boundary data initialization from NetCDF file.
 
void init_masks_from_netcdf (int lev)
 Mask data initialization from NetCDF file.
 
void fill_rho_mask_from_netcdf (int lev, amrex::MultiFab &mskr)
 fill a rho-point mask on any layout of level lev from its NetCDF grid file(s)
 
void init_masks_full_domain_from_netcdf ()
 Full domain high-res mask data initialization from NetCDF file.
 
void init_bathymetry_from_netcdf (int lev)
 Bathymetry data initialization from NetCDF file.
 
void init_bathymetry_full_domain_from_netcdf ()
 Full domain high-res bathymetry data initialization from NetCDF file.
 
void init_grid_vars_from_netcdf (int lev)
 Grid variable initialization from NetCDF file.
 
void init_grid_vars_full_domain_from_netcdf ()
 Full domain high-res grid variable initialization from NetCDF file.
 
void extrapolate_metric_to_physical_boundaries (amrex::MultiFab &mf, const amrex::Geometry &geom, bool linear=false, amrex::Real wrap=amrex::Real(0.0))
 Extrapolate grid metrics to edge of MultiFab, copying the outermost in-domain ghost row outward or, with linear, extending it linearly (steps taken modulo wrap when wrap > 0, for a longitude)
 
void interp_grid_coords_from_coarse (int lev, amrex::MultiFab &fine, const amrex::MultiFab &crse)
 Fill a refined level's coordinate array (lon, lat, angle) from the coarser level, including the ghost cells outside the domain.
 
void init_zeta_from_netcdf (int lev)
 Sea-surface height data initialization from NetCDF file.
 
void init_zeta_full_domain_from_netcdf ()
 Full-domain high res sea-surface height data initialization from NetCDF file.
 
void init_coriolis_from_netcdf (int lev)
 Coriolis parameter data initialization from NetCDF file.
 
void init_clim_nudg_coeff_from_netcdf (int lev)
 Climatology nudging coefficient initialization from NetCDF file.
 
void init_clim_nudg_coeff (int lev)
 Wrapper to initialize climatology nudging coefficient.
 
void init_riv_pos_from_netcdf (int lev)
 
const amrex::DistributionMapping & full_domain_dmap ()
 The shared full-domain DistributionMapping, built on first use.
 
void allocate_bathymetry_grid_vars_full_domain ()
 Allocate multifabs for storing full-domain bathymetry and grid vars data.
 
void allocate_init_full_domain ()
 Allocate multifabs for storing full-domain high resolution initial data.
 
void convert_inv_days_to_inv_s (amrex::MultiFab *)
 Convert data in a multifab from inverse days to inverse seconds.
 
void mask_arrays_for_write (int lev, amrex::Real fill_value, amrex::Real fill_where)
 Mask data arrays before writing output.
 
void average_down_with_grow_cells (int lev, amrex::Vector< std::unique_ptr< amrex::MultiFab > > &mf, bool use_mask=false)
 Average down from level lev+1 to lev in mf, including grow cells.
 
void build_covered_mask (int crse_lev, amrex::MultiFab &covered)
 Average one field down a level, weighted by the land/sea mask.
 
void restore_perimeter_faces (const amrex::MultiFab &saved, amrex::MultiFab &mf, const amrex::MultiFab &covered, int dir, int ncomp)
 put back the coarse normal-velocity faces on the fine patch's perimeter
 
void average_down_masked (int crse_lev, const amrex::MultiFab &S_fine, amrex::MultiFab &S_crse, const amrex::MultiFab &msk_fine, const amrex::MultiFab &cmsk, int ncomp, int face_dir, bool volume_weighted=false)
 
void init_full_domain_from_analytic ()
 Initialize high-resolution initial data, zeta included, from analytic functions.
 
int xvel_bc () const noexcept
 
int yvel_bc () const noexcept
 
int zvel_bc () const noexcept
 
int ubar_bc () const noexcept
 
int vbar_bc () const noexcept
 
int zeta_bc () const noexcept
 
int tke_bc () const noexcept
 
int foextrap_periodic_bc () const noexcept
 
int foextrap_bc () const noexcept
 
int u2d_simple_bc () const noexcept
 
int v2d_simple_bc () const noexcept
 
int num_bc_vars () const noexcept
 
int num_passive_scalars () const noexcept
 Number of passive (dye) scalars in the state, not counting biology tracers.
 
void writeJobInfo (const std::string &dir) const
 Write job info to stdout.
 
amrex::Real get_t_old (int lev) const
 Accessor method for t_old to expose to outside classes.
 
double model_time (amrex::Real elapsed) const noexcept
 Time on the model clock, in seconds, of an elapsed time such as t_new.
 
amrex::Real elapsed_time (double time) const noexcept
 Elapsed time since start_time of a time on the model clock.
 
int bio_comp_start () const noexcept
 First cons component of the biology block. Problem setups need this to write biology initial conditions, since the passive scalars sit between salinity and the biology tracers.
 
int num_bio () const noexcept
 Number of biology tracers carried in the state.
 
int num_scalar () const noexcept
 Number of passive (dye) scalars carried in the state.
 
int bdy_cons (int icomp) const noexcept
 Accessors for the ncons-dependent entries of BdyVars.
 
int bdy_ubar () const noexcept
 
int bdy_vbar () const noexcept
 
int bdy_zeta () const noexcept
 
int num_bdy_vars () const noexcept
 

Static Public Member Functions

static constexpr bool DriverUsesStateForcing (DriverAtmosForcingMode mode) noexcept
 
static void compute_W (const amrex::Box &bx2d, const amrex::Array4< amrex::Real > &W, const amrex::Array4< amrex::Real const > &Huon, const amrex::Array4< amrex::Real const > &Hvom, const amrex::Array4< amrex::Real const > &z_w, const amrex::Array4< amrex::Real const > &h, const int N)
 Vertical volume flux W from the horizontal mass flux divergence.
 
static amrex::Box clim_nudg_momentum_box (const amrex::Box &nodal_bx, int dir, const amrex::Box &domain, bool is_periodic)
 Shrink an x- or y-nodal momentum tilebox to the faces ROMS nudges.
 
static void writeBuildInfo (std::ostream &os)
 Write build info to os.
 
static void print_banner (MPI_Comm, std::ostream &)
 
static void print_usage (MPI_Comm, std::ostream &)
 
static void print_error (MPI_Comm, const std::string &msg)
 
static void print_summary (std::ostream &)
 
static void print_tpls (std::ostream &)
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real bulk_psiu (amrex::Real ZoL)
 Evaluate stability function psi for wind speed.
 
AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real bulk_psit (amrex::Real ZoL)
 Evaluate stability function psi for moisture and heat.
 

Public Attributes

bool m_reported_atm_flux_validation = false
 Latch so the flux validation block prints once per run unless remora.v >= 1.
 
amrex::Real m_warned_surface_temp_min = amrex::Real(273.15 - 2.5)
 
amrex::Real m_warned_surface_temp_max = amrex::Real(273.15 + 40.0)
 
amrex::Long m_warned_surface_temp_nan = 0
 
bool drop_dry_boxes = true
 Leave out level-0 boxes that are land over their whole footprint (remora.drop_dry_boxes)
 
int dry_ghost_test = 0
 Debug: see poison_dry_ghost_cells.
 
amrex::Vector< amrex::RealBox > refine_regions
 Physical-space region of each refinement indicator, for level0_refine_footprint.
 
bool refine_region_unbounded = false
 Whether some refinement indicator has no region, so it may refine anywhere.
 
LoadBalance load_balance = LoadBalance::sfc
 
amrex::Real load_balance_land_weight = amrex::Real(1.0)
 cost of a land cell relative to a wet one in the load-balance weights (remora.load_balance_land_weight); 1 weighs boxes by cell count
 
std::string pp_prefix {"remora"}
 default prefix for input file parameters
 
amrex::Vector< amrex::MultiFab * > cons_old
 multilevel data container for last step's scalar data: temperature, salinity, passive tracer

 
amrex::Vector< amrex::MultiFab * > xvel_old
 multilevel data container for last step's x velocities (u in ROMS)
 
amrex::Vector< amrex::MultiFab * > yvel_old
 multilevel data container for last step's y velocities (v in ROMS)
 
amrex::Vector< amrex::MultiFab * > zvel_old
 multilevel data container for last step's z velocities (largely unused; W stored separately)
 
amrex::Vector< amrex::MultiFab * > cons_new
 multilevel data container for current step's scalar data: temperature, salinity, passive tracer

 
amrex::Vector< amrex::MultiFab * > xvel_new
 multilevel data container for current step's x velocities (u in ROMS)
 
amrex::Vector< amrex::MultiFab * > yvel_new
 multilevel data container for current step's y velocities (v in ROMS)
 
amrex::Vector< amrex::MultiFab * > zvel_new
 multilevel data container for current step's z velocities (largely unused; W stored separately)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_cons_full_domain
 multilevel data container for high res initial data: temperature, salinity, passive tracer

 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xvel_full_domain
 multilevel data container for high res initial x velocities (u in ROMS)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yvel_full_domain
 multilevel data container for high res initial y velocities (v in ROMS)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_h
 multilevel data container for current step's z velocities (largely unused; W stored separately)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_h_full_domain
 Bathymetry data on the whole domain at each potential level.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskr_full_domain
 Land/sea mask at cell centers on the whole domain at each potential level. Specified at hires_grid_level and coarsened down from there, so that a refined coastline and the bathymetry it goes with come from the same grid.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Hz
 Width of cells in the vertical (z-) direction (3D, Hz in ROMS)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Huon
 u-volume flux (3D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Hvom
 v-volume flux (3D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_ru
 u velocity RHS (3D, includes horizontal and vertical advection)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rv
 v velocity RHS (3D, includes horizontal and vertical advection)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_ru2d
 u velocity RHS (2D, includes horizontal and vertical advection)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rv2d
 v velocity RHS (2D, includes horizontal and vertical advection)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rufrc
 u velocity RHS, integrated, including advection and bottom/surface stresses (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rvfrc
 v velocity RHS, integrated, including advection and bottom/surface stresses (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akv
 Vertical viscosity coefficient (3D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akt
 Vertical diffusion coefficient (3D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_visc2_p
 Harmonic viscosity defined on the psi points (corners of horizontal grid cells)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_visc2_r
 Harmonic viscosity defined on the rho points (centers)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_diff2
 Harmonic diffusivity for temperature / salinity.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_z_r
 z coordinates at rho points (cell centers)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_z_w
 z coordinates at w points (faces between z-cells)
 
amrex::Gpu::DeviceVector< amrex::Real > s_r
 Scaled vertical coordinate (range [0,1]) that transforms to z, defined at rho points (cell centers)
 
amrex::Gpu::DeviceVector< amrex::Real > s_w
 Scaled vertical coordinate (range [0,1]) that transforms to z, defined at w-points (cell faces)
 
amrex::Gpu::DeviceVector< amrex::Real > Cs_r
 Stretching coefficients at rho points.
 
amrex::Gpu::DeviceVector< amrex::Real > Cs_w
 Stretching coefficients at w points.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_z_phys_nd
 z coordinates at psi points (cell nodes)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Zt_avg1
 Average of the free surface, zeta (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_sustr
 Surface stress in the u direction.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_svstr
 Surface stress in the v direction.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_uwind
 Wind in the u direction, defined at rho-points.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_vwind
 Wind in the v direction, defined at rho-points.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Tair
 Air temperature [°C], defined at rho-points.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_qair
 Specific humidity [kg/kg], defined at rho-points.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Pair
 Air pressure [mb], defined at rho-points.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_srflx
 Shortwave radiation flux [W/m²], defined at rho-points.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_lrflx
 longwave radiation
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_longwave_down
 Downward longwave radiation.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_lhflx
 latent heat flux
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_shflx
 sensible heat flux
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_stflx
 Surface tracer flux; working arrays.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_stflux
 Surface tracer flux; input arrays.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_btflx
 Bottom tracer flux; working arrays.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_btflux
 Bottom tracer flux; input arrays.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rain
 precipitation rate [kg/m^2/s]
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_evap
 evaporation rate [kg/m^2/s]
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_cloud
 cloud cover fraction [0-1], defined at rho-points
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_EminusP
 evaporation minus precipitation [kg/m^2/s], defined at rho-points
 
std::array< bool, AtmosState::NumTypes > driver_atmos_state_from_driver {}
 provenance flags for driver-supplied atmospheric forcing lanes
 
bool running_with_coupling_driver = false
 True once REMORA has received forcing through the coupling driver.
 
bool driver_uses_two_way_coupling = false
 Driver-level direction flag copied in before InitData.
 
DriverAtmosForcingMode driver_atmos_forcing_mode = DriverAtmosForcingMode::State
 Active atmosphere-to-ocean forcing contract on the most recent driver apply.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rdrag
 Linear drag coefficient [m/s], defined at rho points.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rdrag2
 Quadratic drag coefficient [unitless], defined at rho points.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_ZoBot
 Bottom roughness length [m], defined at rho points.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_bustr
 Bottom stress in the u direction.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_bvstr
 Bottom stress in the v direction.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_DUon
 Scratch for the barotropic step, kept per level rather than allocated on every fast step: the x and y mass fluxes of the current fast step.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_DVom
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_scratch_2d
 Scratch for the barotropic step: the n_scratch_2d fields one pass of advance_2d hands the next (new depth, free-surface pressure-gradient terms, and the momentum right-hand sides stored at their face index), cell-centered 2D.
 
amrex::Vector< amrex::Array< amrex::MultiFab, AMREX_SPACEDIM > > vec_reflux_flux
 A fine level's advective tracer fluxes on its faces, kept only when OpenMP threads defer the flux-register FineAdd to a fixed-order pass (see advance_3d)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_DU_avg1
 time average of barotropic x velocity flux (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_DU_avg2
 correct time average of barotropic x velocity flux for coupling (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_DV_avg1
 time average of barotropic y velocity flux
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_DV_avg2
 correct time average of barotropic y velocity flux for coupling (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Dubar_old
 DU_avg2 per unit cell edge length, at the start and end of this level's step. What a subcycled finer level interpolates to get a mass-conserving ubar (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Dubar_new
 see vec_Dubar_old (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Dvbar_old
 DV_avg2 per unit cell edge length, see vec_Dubar_old (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Dvbar_new
 see vec_Dvbar_old (2D)
 
amrex::Vector< int > Dubar_fresh
 per level, whether vec_Dubar_new and vec_Dvbar_new hold no previous step's flux (just allocated, or a restart from a checkpoint without them), so the next store_2d_flux sets the old snapshot to the new one instead of to that zero
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_zeta_crse_old
 free surface at the start and end of this level's step, every leapfrog component holding the same value. What a subcycled finer level interpolates in time to get its contact points, as ROMS's put_refine2d does (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_zeta_crse_new
 see vec_zeta_crse_old (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rubar
 barotropic x velocity for the RHS (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rvbar
 barotropic y velocity for the RHS (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rzeta
 free surface height for the RHS (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_ubar
 barotropic x velocity (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_vbar
 barotropic y velocity (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_zeta
 free surface height (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_zeta_full_domain
 high resolution initial free surface height (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskr
 land/sea mask at cell centers (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_msku
 land/sea mask at x-faces (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskv
 land/sea mask at y-faces (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskp
 land/sea mask at cell corners (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskr3d
 land/sea mask at cell centers, copied to all z levels (3D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskr_crse_on_fine
 the level's rho-, u- and v-masks copied onto the layout of the level above it coarsened, which is the layout the two-way average-down computes on. Indexed by the coarse level of the pair. Built on demand and reused until a regrid, since the masks are a function of position alone and so do not change between them.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_msku_crse_on_fine
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_mskv_crse_on_fine
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pm
 horizontal scaling factor: 1 / dx (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pn
 horizontal scaling factor: 1 / dy (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pm_full_domain
 horizontal scaling factor: 1 / dx (2D) on whole domain
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_pn_full_domain
 horizontal scaling factor: 1 / dy (2D) on whole domain
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_metric_r
 metric products of pm and pn at rho points, components MetricR (2D). Recomputed by set_derived_metrics whenever set_grid_scale sets pm and pn
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_metric_u
 metric products at u points, components MetricU (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_metric_v
 metric products at v points, components MetricV (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_metric_p
 metric products at psi points, components MetricP (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_fcor
 coriolis factor (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xr
 x_grid on rho points (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yr
 y_grid on rho points (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xu
 x_grid on u-points (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yu
 y_grid on u-points (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xv
 x_grid on v-points (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yv
 y_grid on v-points (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_xp
 x_grid on psi-points (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_yp
 y_grid on psi-points (2D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_lonp
 longitude on psi-points (2D, degrees east); only filled when the grid NetCDF file carries lon_psi
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_latp
 latitude on psi-points (2D, degrees north); only filled when the grid NetCDF file carries lat_psi
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_lonr
 longitude on rho-points (2D, degrees east); only filled when the grid NetCDF file carries lon_rho
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_latr
 latitude on rho-points (2D, degrees north); only filled when the grid NetCDF file carries lat_rho
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_angler
 angle from east to the local xi axis on rho-points (2D, radians, positive counterclockwise: ROMS's angle); only filled when the grid NetCDF file carries angle
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_lonr_full_domain
 lon_rho on the whole domain, levels up to hires_grid_level; only filled when remora.nc_grid_file_hires carries it
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_latr_full_domain
 lat_rho on the whole domain, as vec_lonr_full_domain
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_angler_full_domain
 angle on the whole domain, as vec_lonr_full_domain
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_dndx
 d(1/n)/d(xi)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_dmde
 d(1/m)/d(eta)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_sstore
 additional scratch space for calculations on temp, salt, etc
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rhoS
 density perturbation
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_rhoA
 vertically-averaged density
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_bvf
 Brunt-Vaisala frequency (3D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_alpha
 Thermal expansion coefficient (3D)
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_beta
 Saline contraction coefficient (3D)
 
amrex::Vector< amrex::Real > vec_weight1
 Weights for calculating avg1 in 2D advance.
 
amrex::Vector< amrex::Real > vec_weight2
 Weights for calculating avg2 in 2D advance.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_tke
 Turbulent kinetic energy.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_gls
 Turbulent generic length scale.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Lscale
 Vertical mixing turbulent length scale.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akk
 Turbulent kinetic energy vertical diffusion coefficient.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_Akp
 Turbulent length scale vertical diffusion coefficient.
 
amrex::Vector< amrex::Vector< std::unique_ptr< amrex::MultiFab > > > vec_nudg_coeff
 Climatology nudging coefficients.
 
amrex::DistributionMapping dm_full_domain
 the DistributionMapping every full-domain multifab is built on. Each of those covers the domain in a single box, so the map holds one entry, and which rank it names is whichever holds the least fab memory when it is built. Building one per allocator therefore put the mask and the data it weights on different ranks under MPI. Empty until full_domain_dmap first needs it.
 

Static Public Attributes

static constexpr int n_scratch_2d = 7
 
static int total_nc_plot_file_step = 1
 

Private Member Functions

void ReadParameters ()
 read in some parameters from inputs file
 
void init_scalar_metadata ()
 Build runtime scalar names after nscalar is known.
 
void AverageDown ()
 set covered coarse cells to be the average of overlying fine cells
 
void init_bcs ()
 Read in boundary parameters from input file and set up data structures.
 
void init_analytic (int lev)
 Initialize initial problem data from analytic functions.
 
ProbCoords prob_coords (int lev) const
 Coordinate arrays of level lev, for the prob functions.
 
void init_stuff (int lev, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm)
 Allocate MultiFabs for state and evolution variables.
 
void init_masks (int lev, const amrex::BoxArray &ba, const amrex::DistributionMapping &dm)
 Allocate MultiFabs for masks.
 
void resize_stuff (int lev)
 Resize variable containers to accommodate data on levels 0 to max_lev.
 
void AverageDownTo (int crse_lev)
 more flexible version of AverageDown() that lets you average down across multiple levels
 
void Construct_REMORAFillPatchers (int lev)
 Construct FillPatchers.
 
void Define_REMORAFillPatchers (int lev)
 Define FillPatchers.
 
TimeInterpolatedData GetDataAtTime (int lev, amrex::Real time)
 utility to copy in data from old and/or new state into another multifab
 
void timeStep (int lev, amrex::Real time, int iteration)
 advance a level by dt, includes a recursive call for finer levels
 
void timeStepML (amrex::Real time, int iteration)
 advance all levels by dt, loops over finer levels
 
void ComputeDt ()
 a wrapper for estTimeStep()
 
void print_timestep_hierarchy () const
 report the per-level slow/fast timestep hierarchy; call after ComputeDt
 
void set_nsubsteps (int nlevs_max)
 size nsubsteps and set how many steps each level takes per parent step
 
std::string PlotFileName (int lev) const
 get plotfile name
 
void set2DPlotVariables (const std::string &pp_plot_var_names_2d)
 
void set3DPlotVariables (const std::string &pp_plot_var_names_3d)
 
void append2DPlotVariables (const std::string &pp_plot_var_names_2d)
 
void append3DPlotVariables (const std::string &pp_plot_var_names_3d)
 
void WriteNCPlotFile (int istep, amrex::MultiFab const *plotMF, int lev=0, amrex::MultiFab const *mf_omega=nullptr, amrex::MultiFab const *mf_wvel=nullptr)
 Write plotfile using NetCDF (wrapper)
 
void WriteNCPlotFile_which (int lev, amrex::MultiFab const *plotMF, amrex::MultiFab const *mf_omega, amrex::MultiFab const *mf_wvel, bool write_header, bool write_grid, ncutils::NCFile &ncf, bool is_history, long long history_record=0)
 Write a particular NetCDF plotfile.
 
std::string netcdf_plot_path (int which_step, int lev) const
 NetCDF file a level's output goes to at this output step.
 
long long history_restart_record (int lev, const std::string &path)
 Record at which a restarted run continues a history file.
 
void WriteNCMultiFab (const amrex::FabArray< amrex::FArrayBox > &fab, const std::string &name, bool set_ghost=false) const
 Write MultiFab in NetCDF format.
 
void ReadNCMultiFab (amrex::FabArray< amrex::FArrayBox > &fab, const std::string &name, int coordinatorProc=amrex::ParallelDescriptor::IOProcessorNumber(), int allow_empty_mf=0)
 Read MultiFab in NetCDF format.
 
void WriteCheckpointFile ()
 write checkpoint file to disk
 
void ReadCheckpointFile ()
 read checkpoint file from disk
 
void InitializeFromFile ()
 Read the file passed to remora.restart and use it as an initial condition for the current simulation.
 
void InitializeLevelFromData (int lev, const amrex::MultiFab &initial_data)
 Initialize the new-time data at a level from the initial_data MultiFab.
 
amrex::YAFluxRegister * getAdvFluxReg (int lev)
 flux register between lev and lev-1
 
void define_flux_register (int lev)
 build or rebuild the flux register between lev and lev-1
 
void readTracersParams ()
 Read tracer and hydro particles parameters.
 
void initializeTracers (amrex::ParGDBBase *, const amrex::Vector< std::unique_ptr< amrex::MultiFab > > &)
 Initialize tracer and hydro particles.
 
void evolveTracers (int lev, amrex::Real dt)
 Evolve tracers and hydro particles.
 
void store_particle_omega (int lev, const amrex::MultiFab &mf_W)
 Keep advance_3d's W, as omega, for the particles to advect with, if any species advects on this level.
 
void refinement_criteria_setup ()
 Set refinement criteria.
 
void init_ref_ratios ()
 Reject vertical refinement and accumulate the refinement ratios.
 
AMREX_FORCE_INLINE std::ostream & DataLog (int i)
 Helper function for IO stream.
 
AMREX_FORCE_INLINE int NumDataLogs () noexcept
 
amrex::Real getCPUTime () const
 Get CPU time used.
 
void setRecordDataInfo (int i, const std::string &filename)
 
const std::string DataLogName (int i) const noexcept
 The filename of the ith datalog file.
 

Static Private Member Functions

static void GotoNextLine (std::istream &is)
 utility to skip to next line in Header
 

Private Attributes

std::unique_ptr< NCTimeSeries > sustr_data_from_file
 Data container for u-component surface momentum flux read from file.
 
std::unique_ptr< NCTimeSeries > svstr_data_from_file
 Data container for v-component surface momentum flux read from file.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_sustr_rho
 Surface stress from a lat-lon file, east and north components on rho points before it is rotated onto the grid and averaged to the u and v faces; one per level, unallocated when the stress file is on the model grid.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > vec_svstr_rho
 
bool stress_on_rho = false
 Whether the surface stress is read on rho points, from a lat-lon grid.
 
std::unique_ptr< NCTimeSeries > Uwind_data_from_file
 Data container for u-direction wind read from file.
 
std::unique_ptr< NCTimeSeries > Vwind_data_from_file
 Data container for v-direction wind read from file.
 
std::unique_ptr< NCTimeSeries > Tair_data_from_file
 Data container for air temperature read from file.
 
std::unique_ptr< NCTimeSeries > qair_data_from_file
 Data container for specific humidity read from file.
 
std::unique_ptr< NCTimeSeries > Pair_data_from_file
 Data container for air pressure read from file.
 
std::unique_ptr< NCTimeSeries > srflx_data_from_file
 Data container for shortwave radiation flux read from file.
 
std::unique_ptr< NCTimeSeries > longwave_down_data_from_file
 Data container for downward longwave radiation flux read from file.
 
std::unique_ptr< NCTimeSeries > rain_data_from_file
 Data container for precipitation rate read from file.
 
std::unique_ptr< NCTimeSeries > cloud_data_from_file
 Data container for cloud cover fraction read from file.
 
std::unique_ptr< NCTimeSeries > EminusP_data_from_file
 Data container for evaporation minus precipitation read from file.
 
std::unique_ptr< NCTimeSeries > ubar_clim_data_from_file
 Data container for ubar climatology data read from file.
 
std::unique_ptr< NCTimeSeries > vbar_clim_data_from_file
 Data container for vbar climatology data read from file.
 
std::unique_ptr< NCTimeSeries > u_clim_data_from_file
 Data container for u-velocity climatology data read from file.
 
std::unique_ptr< NCTimeSeries > v_clim_data_from_file
 Data container for v-velocity climatology data read from file.
 
amrex::Vector< std::unique_ptr< NCTimeSeries > > cons_clim_data_from_file
 Vector over cons components of climatology data read from file.
 
amrex::Vector< std::unique_ptr< NCTimeSeriesRiver > > river_source_cons
 Vector of data containers for scalar data in rivers.
 
std::unique_ptr< NCTimeSeriesRiver > river_source_transport
 Data container for momentum transport in rivers.
 
std::unique_ptr< NCTimeSeriesRiver > river_source_transportbar
 Data container for vertically integrated momentum transport in rivers.
 
amrex::Vector< amrex::Vector< std::unique_ptr< NCTimeSeriesBoundary > > > boundary_series
 Vector over BdyVars of boundary series data containers.
 
amrex::Vector< std::unique_ptr< amrex::iMultiFab > > vec_river_position
 iMultiFab for river positions; contents are indices of rivers
 
amrex::Gpu::DeviceVector< int > river_direction
 Vector over rivers of river direction: 0: u-face; 1: v-face; 2: w-face.
 
int cf_width {0}
 Nudging width at coarse-fine interface.
 
int cf_set_width {0}
 Width for fixing values at coarse-fine interface.
 
amrex::Vector< REMORAFillPatcher > FPr_c
 Vector over levels of FillPatchers for scalars.
 
amrex::Vector< REMORAFillPatcher > FPr_u
 Vector over levels of FillPatchers for u (3D)
 
amrex::Vector< REMORAFillPatcher > FPr_v
 Vector over levels of FillPatchers for v (3D)
 
amrex::Vector< REMORAFillPatcher > FPr_w
 Vector over levels of FillPatchers for w.
 
amrex::Vector< REMORAFillPatcher > FPr_ubar
 Vector over levels of FillPatchers for ubar (2D)
 
amrex::Vector< REMORAFillPatcher > FPr_vbar
 Vector over levels of FillPatchers for vbar (2D)
 
amrex::Vector< REMORAFillPatcher > FPr_Dubar
 Vector over levels of FillPatchers for Dubar (2D)
 
amrex::Vector< REMORAFillPatcher > FPr_Dvbar
 Vector over levels of FillPatchers for Dvbar (2D)
 
std::unique_ptr< ProblemBase > prob = nullptr
 Pointer to container of analytical functions for problem definition.
 
amrex::Vector< int > num_boxes_at_level
 how many boxes specified at each level by tagging criteria
 
amrex::Vector< int > num_files_at_level
 how many netcdf input files specified at each level
 
amrex::Vector< amrex::Vector< amrex::Box > > boxes_at_level
 the boxes specified at each level by tagging criteria
 
amrex::Vector< int > istep
 which step?
 
amrex::Vector< int > nsubsteps
 How many substeps on each level?
 
amrex::Vector< amrex::Real > t_new
 new time at each level, in seconds since start_time
 
amrex::Vector< amrex::Real > t_old
 old time at each level, in seconds since start_time
 
amrex::Vector< amrex::Real > dt
 time step at each level
 
bool set_bcs_by_var
 whether to set boundary conditions by variable rather than just by side
 
amrex::Vector< std::unique_ptr< REMORAPhysBCFunct > > physbcs
 Vector (over level) of functors to apply physical boundary conditions.
 
amrex::Vector< std::unique_ptr< amrex::YAFluxRegister > > advflux_reg
 array of flux registers for refluxing in multilevel
 
amrex::Vector< amrex::BCRec > domain_bcs_type
 vector (over BCVars) of BCRecs
 
amrex::Gpu::DeviceVector< amrex::BCRec > domain_bcs_type_d
 GPU vector (over BCVars) of BCRecs.
 
amrex::Array< std::string, 2 *AMREX_SPACEDIM > domain_bc_type
 Array of strings describing domain boundary conditions.
 
amrex::Vector< amrex::GpuArray< amrex::Real, AMREX_SPACEDIM *2 > > m_bc_extdir_vals
 Array holding the Dirichlet values at walls which need them.
 
amrex::Vector< amrex::GpuArray< REMORA_BC, AMREX_SPACEDIM *2 > > phys_bc_type
 Array holding the "physical" boundary condition types (e.g. "inflow")
 
amrex::Vector< amrex::GpuArray< bool, AMREX_SPACEDIM *2 > > phys_bc_need_data
 These are flags that indicate whether we need to read in boundary data from file.
 
amrex::Vector< int > bdy_index
 Container to connect boundary data being read in boundary condition containers.
 
int last_plot_file_step
 Step when we last output a plotfile.
 
amrex::Real last_plot_file_time
 Simulation time when we last output a plotfile.
 
int last_check_file_step
 Step when we last output a checkpoint file.
 
amrex::Real last_check_file_time
 Simulation time when we last output a checkpoint file.
 
int plot_file_on_restart = 1
 Whether to output a plotfile on restart from checkpoint.
 
int max_step = std::numeric_limits<int>::max()
 maximum number of steps
 
double stop_time = std::numeric_limits<amrex::Real>::max()
 Time to stop, in seconds on the model clock (not since start_time)
 
double start_time = 0.0
 Time of the start of the simulation, in seconds on the model clock.
 
std::string restart_chkfile = ""
 If set, restart from this checkpoint file.
 
int nscalar = 0
 Number of passive (dye) scalars carried in the state, beyond temperature and salinity. Does not count biology tracers. Dye is opt-in: a run carries one only when remora.nscalar asks for it.
 
int nbio = 0
 Number of biology tracers, set by the active biology model. Zero when no biology model is active.
 
int Bio_comp = Tracer_comp
 First cons component of the biology block, i.e. Tracer_comp + nscalar. The state is laid out as temp, salt, the passive scalars, then biology.
 
int ncons = Tracer_comp + 1
 Number of conserved scalars in the state (temperature + salt + passive scalars + biology tracers)
 
std::unique_ptr< REMORABiology::Biology > m_biology = REMORABiology::make_biology("none")
 Selected ecosystem, owning its parameters and host-side kernels.
 
REMORABiology::BiologyICType biology_ic_type = REMORABiology::BiologyICType::follow_ic_type
 Biology IC source, independent of the physical IC source.
 
int nfast
 Number of fast steps to take.
 
int do_substep = 1
 Whether to substep fine levels in time.
 
bool time_interp_flux = false
 interpolate the parent's barotropic mass flux in time at the coarse-fine interface, rather than holding its step average. Off matches most ROMS configurations.
 
int cf_impose_flux = 0
 impose the parent's barotropic mass flux on DUon/DVom at the coarse-fine interface, rather than relying on the velocity written by set_2d_cf_bcs being turned back into the same flux. Off by default: it improves conservation but does not cure the two-level barotropic instability seen in Channel_Test.
 
int do_reflux = 1
 correct the coarse tracer with the finer level's accumulated advective flux at their interface. Only has an effect under remora.do_substep with two-way coupling.
 
int cf_avgdown_perimeter = 1
 exclude the coarse-fine perimeter's normal-velocity faces from the fine-to-coarse average, as ROMS does. 1 (default) matches ROMS; 0 includes the perimeter faces in the average.
 
int cf_fill_vel_after = 0
 re-fill the child's 3D velocity from the parent after the step, so the coarse-fine boundary carries the parent's shear profile rather than the one vert_mean_3d left there. Diagnostic; off, so it changes no answer unless set. Both drivers do it only under this knob – see the comment in Advance. On the ratio-3 Dogbone it moves level-1 x-velocity by 4.1e-3 relative and level 0 by 1.9e-4 after 20 steps.
 
int cf_set_2d_bcs = 1
 0 = never impose the 2D coarse-fine interface condition, 1 = every fast step, 2 = only the first fast step of each baroclinic step.
 
int cf_avgdown_bar = 1
 
int cf_fill_all_kcomp = 1
 write every leapfrog record of the coarse-fine ghost band, as put_refine2d does when it sets zeta(:,:,1:3) and Zt_avg1 to one value; without it those records go a whole parent step stale. On by default. Roundoff on the ROMS-matched deck, where the fine zeta halo is barely read, but the dominant cost to volume conservation on the subcycled dogbone: 2.0e-09 to 2.9e-08 of drift over 20 steps, volume being the integral of the free surface this writes. ROMS makes the same trade.
 
int cf_time_interp_zeta = 1
 interpolate the parent in time onto the child's own sub-time, as put_refine2d does, rather than freezing it at the end of the parent step. On by default, and non-conservative for the same reason as cf_fill_all_kcomp: 1.4e-08 of volume drift on its own.
 
int cf_2d_fill_cache = 1
 reuse the coarse-fine ghost values of a fine level's barotropic fills (ubar, vbar, zeta in advance_2d). 0: recompute on every fast step, where the two-level fill re-exchanges and re-interpolates the coarse level each time. 1 (default): compute once per (component, fill time) within a parent step and replay the result; bitwise identical, since the fill reads only the registered coarse data and, for faces, the interface faces FillSet rewrites before every fill, none of which changes inside the parent step. 2: as 1, but also recompute and abort on any difference in the replayed cells. Subcycled driver only.
 
amrex::Vector< amrex::Array< CF2DCache, 3 > > cf_2d_cache
 per level: the caches for ubar, vbar and zeta (slots 0, 1, 2)
 
amrex::Vector< long > cf_crse_gen
 per level: bumped whenever register_coarse_data hands the level's new state to the next finer level, which invalidates that level's cf_2d_cache
 
int cf_flux_pc = 1
 distribute the parent's interface mass flux piecewise-constantly over the fine faces under each parent face, as ROMS's get_persisted2d does, instead of with the linear tangential variation of AMReX's face interpolator. Both conserve the total; they differ in the profile along the interface. On by default: it removes the fine level's own excess divergence there.
 
int cf_avgdown_stencil = 1
 average the fine velocity onto the coarse over ROMS's nine-point stencil (fine2coarse2d, half-width (Rscale-1)/2 in both directions) instead of only the faces that tile the coarse face. On by default: with cf_flux_pc it takes the interface refinement perturbation from 1.29x ROMS's to 1.01x on the matched dogbone, the residual 1% closing only with cf_impose_flux, which stays off. Not conservative in principle – the nine-point mean does not preserve transport across the interface – but only about 3e-10 of volume drift in practice, well under the free-surface ghost band's cost.
 
int cf_avgdown_volume_weighted = 0
 average the fine tracers onto the coarse weighted by cell volume, Hz/(pm*pn), rather than by area as ROMS's fine2coarse3d does. Off by default. Where the fine layer thickness varies under a coarse cell, as interpolated bathymetry near land makes it, the area mean gains or loses tracer content. Volume weighting keeps it only where the coarse cell's volume matches the fine volumes under it, so not at a coast, and it is not applied to the initial high-resolution cascade (average_down_with_grow_cells).
 
int cf_print_iface = -1
 print the imposed coarse-fine interface velocity at this baroclinic step (-1 = off). Diagnostic only; the fine level is not in the NetCDF output.
 
int reflux_clamp = 1
 stop that correction driving a tracer negative, as ROMS does. On by default to match ROMS; costs exact conservation on any step that clamps.
 
int check_cf_metrics_flag = 0
 measure whether fine cell edges tile the coarse ones at a coarse-fine interface, which is what makes the imposed mass flux conservative
 
amrex::Real check_cf_tol = 1.e-12
 tolerance for the above
 
int check_plot_z = 0
 check the nodal z a viewer rebuilds from the plotfile's Nu_nd set against z_phys_nd on each level, and fine against coarse at coincident nodes
 
amrex::Real check_plot_z_tol = -1.0
 abort when the coarse-fine mismatch at interior nodes exceeds this; negative (the default) only reports it, since where a finer level carries finer bathymetry the two levels' bottoms legitimately differ
 
int regrid_int = 2
 how often each level regrids the higher levels of refinement (after a level advances that many time steps)
 
bool regrid_int_from_input = false
 Whether the input set amr.regrid_int (queryAdd makes it present afterwards)
 
std::string plot_file_name {"plt_"}
 Plotfile prefix.
 
int plot_int = -1
 Plotfile output interval in iterations.
 
amrex::Real plot_int_time = amrex::Real(-one)
 Plotfile output interval in seconds.
 
std::string check_file {"chk"}
 Checkpoint file prefix.
 
int check_int = -1
 Checkpoint output interval in iterations.
 
amrex::Real check_int_time = amrex::Real(-one)
 Checkpoint output interval in seconds.
 
bool chunk_history_file = false
 Whether to split the netcdf history file into fixed-length chunks.
 
int steps_per_history_file = -1
 Time steps per netcdf history file. Must be > 0 if chunk_history_file.
 
int history_count = 0
 Counter for which time index we are writing to in the netcdf history file.
 
amrex::Vector< NCHistoryFile > history_files
 Per level, the history file it is writing to.
 
amrex::Vector< std::string > plot_var_names_3d
 Names of 3D variables to output to AMReX plotfile.
 
amrex::Vector< std::string > plot_var_names_2d
 Names of 2D variables to output to AMReX plotfile.
 
bool plot_omega = false
 Whether to write omega, the S-coordinate vertical velocity, to NetCDF output.
 
bool plot_wvel = false
 Whether to write z_velocity, the true vertical velocity, to NetCDF output as w.
 
amrex::Vector< std::string > cons_names {"temp", "salt", "tracer"}
 Names of scalars for plotfile output.
 
const amrex::Vector< std::string > derived_names_3d {"vorticity", "omega"}
 Names of derived fields for 3d plotfile fields.
 
const amrex::Vector< std::string > derived_names_2d {}
 Names of derived fields for 2d plotfile fields.
 
bool expand_plotvars_to_unif_rr = false
 whether plotfile variables should be expanded to a uniform refinement ratio
 
amrex::Real plotfile_fill_value = zero
 fill value for masked arrays in amrex plotfiles
 
amrex::Real netcdf_fill_value = amrex::Real(1.0e37)
 fill value for masked arrays in netcdf output
 
ParticleData particleData
 Particle container with all particle species.
 
bool m_use_tracer_particles
 tracer particles that advect with flow
 
bool m_use_hydro_particles
 tracer particles that fall with gravity
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > particle_omega
 Per level, the omega and the boundary-filled u and v that particles advect with. Kept between steps, and redefined when the level's grids change.
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > particle_u
 
amrex::Vector< std::unique_ptr< amrex::MultiFab > > particle_v
 
amrex::Vector< int > particle_omega_stored
 Per level, whether store_particle_omega has run since the last evolveTracers, and so whether particle_omega and particle_advect hold this step's values.
 
amrex::Vector< amrex::Vector< int > > particle_advect
 Per level and species, whether the species advects on the level this step.
 
int hires_grid_level = -1
 Which level the high resolution bathymetry is at.
 
std::string nc_grid_file_hires
 Grid file for high resolution bathymetry.
 
amrex::Box nc_hires_grid_box
 Box for the full domain at nc_hires_grid_level.
 
int hires_init_level = -1
 Which level the high resolution initialization data is at.
 
std::string nc_init_file_hires
 Init file for high resolution.
 
amrex::Box nc_hires_init_box
 Box for the full domain at nc_hires_init_level.
 
amrex::Vector< amrex::IntVect > cum_ref_ratios
 Cumulative refinement ratio between level 0 and level i.
 
amrex::Vector< std::string > nc_frc_file
 NetCDF forcing file(s)
 
amrex::Vector< std::string > nc_riv_file
 NetCDF river file(s)
 
amrex::Vector< std::string > nc_clim_his_file
 NetCDF climatology history file(s)
 
std::string nc_clim_coeff_file
 NetCDF climatology coefficient file.
 
std::string bdry_time_varname = "ocean_time"
 Default name of time field for boundary data.
 
amrex::Vector< std::string > bdry_time_name_byvar
 Name of time fields for boundary data.
 
std::string clim_ubar_time_varname = "ocean_time"
 Name of time field for ubar climatology data.
 
std::string clim_vbar_time_varname = "ocean_time"
 Name of time field for vbar climatology data.
 
std::string clim_u_time_varname = "ocean_time"
 Name of time field for u climatology data.
 
std::string clim_v_time_varname = "ocean_time"
 Name of time field for v climatology data.
 
amrex::Vector< std::string > clim_cons_time_varname
 Vector over cons components of the name of the time field for that tracer's climatology data.
 
std::string riv_time_varname = "river_time"
 Name of time field for river time.
 
std::string frc_time_varname = ""
 Name of time field for forcing data.
 
LatLonRegridOptions frc_regrid_options
 How forcing on a lat-lon grid is interpolated (remora.frc_regrid and friends)
 
amrex::MultiFab fine_mask
 Mask that zeroes out values on a coarse level underlying grids on the next finest level.
 
amrex::Vector< std::unique_ptr< std::fstream > > datalog
 
amrex::Vector< std::string > datalogname
 

Static Private Attributes

static bool write_history_file = true
 Whether to output NetCDF files as a single history file with several time steps.
 
static amrex::Real cfl = Real(0.8)
 CFL condition.
 
static amrex::Real change_max = Real(1.1)
 Fraction maximum change in subsequent time steps.
 
static amrex::Real fixed_dt = -one
 User specified fixed baroclinic time step.
 
static int ndtfast = 0
 User specified, number of barotropic steps per baroclinic step.
 
static SolverChoice solverChoice
 Container for algorithmic choices.
 
static int verbose = 0
 Verbosity level of output.
 
static int sum_interval = -1
 Diagnostic sum output interval in number of steps.
 
static amrex::Real sum_per = -one
 Diagnostic sum output interval in time.
 
static int file_min_digits = 5
 Minimum number of digits in plotfile name or chunked history file.
 
static bool plot_staggered_vels = false
 Whether to write the staggered velocities (not averaged to cell centers)
 
static bool plot_nodal_data = true
 Whether to write nodal data (Nu_nd) to plotfiles.
 
static PlotfileType plotfile_type = PlotfileType::amrex
 Native or NetCDF plotfile output.
 
static amrex::Vector< amrex::Vector< std::string > > nc_init_file = {{""}}
 NetCDF initialization file.
 
static amrex::Vector< amrex::Vector< std::string > > nc_grid_file = {{""}}
 NetCDF grid file.
 
static amrex::Vector< std::string > nc_bdry_file = {""}
 NetCDF boundary data.
 
static amrex::Vector< REMORAErrorTag > ref_tags
 Holds info for dynamically generated tagging criteria.
 
static amrex::Real startCPUTime = zero
 Variable for CPU timing.
 
static amrex::Real previousCPUTimeUsed = zero
 Accumulator variable for CPU time used thusfar.
 

Detailed Description

Class that stores all relevant simulation state data with methods for time stepping.

Definition at line 91 of file REMORA.H.

Member Enumeration Documentation

◆ DriverAtmosForcingMode

enum class REMORA::DriverAtmosForcingMode : int
strong
Enumerator
State 
Flux 

Definition at line 95 of file REMORA.H.

◆ LoadBalance

enum class REMORA::LoadBalance
strong

How MakeDistributionMap assigns boxes to ranks (remora.load_balance)

Enumerator
amrex 
sfc 
knapsack 
roundrobin 

Definition at line 364 of file REMORA.H.

Constructor & Destructor Documentation

◆ REMORA() [1/2]

REMORA::REMORA ( )

constructor:

  • reads in parameters from inputs file
  • sizes multilevel arrays and data structures
  • initializes BCRec boundary condition object

Definition at line 70 of file REMORA.cpp.

Here is the call graph for this function:

◆ REMORA() [2/2]

REMORA::REMORA ( const amrex::RealBox &  rb,
int  max_level_in,
const amrex::Vector< int > &  n_cell_in,
int  coord,
const amrex::Vector< amrex::IntVect > &  ref_ratio,
const amrex::Array< int, AMREX_SPACEDIM > &  is_per,
std::string  prefix 
)

Definition at line 146 of file REMORA.cpp.

Here is the call graph for this function:

◆ ~REMORA()

REMORA::~REMORA ( )
virtual

Definition at line 206 of file REMORA.cpp.

Member Function Documentation

◆ Advance()

void REMORA::Advance ( int  lev,
amrex::Real  time,
amrex::Real  dt_lev,
int  iteration,
int  ncycle 
)

advance a single level for a single time step

Parameters
[in]levlevel of refinement
[in]timesimulation time at start of step
[in]dt_levbaroclinic time step at level
[in]iterationiteration in subcycling, if using
[in]ncycletotal number of subcycles, if using

Definition at line 17 of file REMORA_Advance.cpp.

Referenced by timeStep().

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

◆ advance_2d()

void REMORA::advance_2d ( int  lev,
amrex::MultiFab const *  mf_rhoS,
amrex::MultiFab const *  mf_rhoA,
amrex::MultiFab *  mf_ru2d,
amrex::MultiFab *  mf_rv2d,
amrex::MultiFab *  mf_rufrc,
amrex::MultiFab *  mf_rvfrc,
amrex::MultiFab *  mf_Zt_avg1,
std::unique_ptr< amrex::MultiFab > &  mf_DU_avg1,
std::unique_ptr< amrex::MultiFab > &  mf_DU_avg2,
std::unique_ptr< amrex::MultiFab > &  mf_DV_avg1,
std::unique_ptr< amrex::MultiFab > &  mf_DV_avg2,
std::unique_ptr< amrex::MultiFab > &  mf_rubar,
std::unique_ptr< amrex::MultiFab > &  mf_rvbar,
std::unique_ptr< amrex::MultiFab > &  mf_rzeta,
std::unique_ptr< amrex::MultiFab > &  mf_ubar,
std::unique_ptr< amrex::MultiFab > &  mf_vbar,
amrex::MultiFab *  mf_zeta,
amrex::MultiFab const *  mf_h,
amrex::MultiFab const *  mf_pm,
amrex::MultiFab const *  mf_pn,
amrex::MultiFab const *  mf_fcor,
amrex::MultiFab const *  mf_visc2_p,
amrex::MultiFab const *  mf_visc2_r,
amrex::MultiFab const *  mf_mskr,
amrex::MultiFab const *  mf_msku,
amrex::MultiFab const *  mf_mskv,
amrex::MultiFab const *  mf_mskp,
amrex::Real  dtfast_lev,
bool  predictor_2d_step,
bool  first_2d_step,
int  my_iif,
int &  next_indx1 
)

Perform a 2D predictor (predictor_2d_step=True) or corrector (predictor_2d_step=False) step.

Nonlinear shallow-water rpimitive equations predictor (Leap-frog) and corrector (Adams-Moulton) time-stepping engine. Corresponds to Nonlinear/step2d_LF_AM3.h in ROMS.

Parameters
[in]levlevel of refinement (coarsest level is 0)
[in]mf_rhoSdensity perturbation
[in]mf_rhoAvertically-averaged density
[in,out]mf_ru2dRHS contributions to 2D u-momentum
[in,out]mf_rv2dRHS contribtuions to 2D v-momentum
[in,out]mf_rufrcbefore first predictor, vertical integral of 3D RHS for uvel, converted to forcing terms
[in,out]mf_rvfrcbefore first predictor, vertical integral of 3D RHS for vvel, converted to forcing term
[in,out]mf_Zt_avg1average of sea surface height over all fast steps
[in,out]mf_DU_avg1time-averaged u-flux for 2D equations
[in,out]mf_DU_avg2time-averaged u-flux for 3D equation coupling
[in,out]mf_DV_avg1time-averaged v-flux for 2D equations
[in,out]mf_DV_avg2time-averaged v-flux for 3D equation coupling
[in,out]mf_rubarRHS of vertically integrated u-momentum
[in,out]mf_rvbarRHS of vertically integrated v-momentum
[in,out]mf_rzetaRHS of sea surface height
[in,out]mf_ubarvertically integrated u-momentum
[in,out]mf_vbarvertically integrated v-momentum
[in,out]mf_zetaSea-surface height
[in]mf_hBathymetry
[in]mf_pm1 / dx
[in]mf_pn1 / dy
[in]mf_fcorCoriolis factor
[in,out]mf_visc2_pHarmonic viscosity at psi points
[in,out]mf_visc2_rHarmoic viscosity at rho points
[in]mf_mskrLand-sea mask at rho-points
[in]mf_mskuLand-sea mask at u-points
[in]mf_mskvLand-sea mask at v-points
[in]mf_mskpLand-sea mask at psi-points
[in]dtfast_levLength of current barotropic step
[in]predictor_2d_stepIs this a predictor step?
[in]first_2d_stepIs this the first barotropic step?
[in]my_iifWhich barotropic predictor-corrector pair?
[in,out]next_indx1Cached index for

Definition at line 100 of file REMORA_advance_2d.cpp.

Referenced by advance_2d_onestep().

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

◆ advance_2d_onestep()

void REMORA::advance_2d_onestep ( int  lev,
amrex::Real  dt_lev,
amrex::Real  dtfast_lev,
int  my_iif,
int  nfast_counter 
)

2D advance, one predictor/corrector step

Parameters
[in]levlevel of refinement
[in]dt_levbaroclinic time step at level
[in]dtfast_levbarotropic time step at level
[in]my_iifcurrent barotropic time step
[in]nfast_counterhow many bartropicc time steps to do per baroclinic step

Definition at line 12 of file REMORA_advance_2d_onestep.cpp.

Referenced by Advance(), and timeStepML().

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

◆ advance_3d()

void REMORA::advance_3d ( int  lev,
amrex::MultiFab &  mf_cons,
amrex::MultiFab &  mf_u,
amrex::MultiFab &  mf_v,
amrex::MultiFab *  mf_sstore,
amrex::MultiFab *  mf_ru,
amrex::MultiFab *  mf_rv,
std::unique_ptr< amrex::MultiFab > &  mf_DU_avg1,
std::unique_ptr< amrex::MultiFab > &  mf_DU_avg2,
std::unique_ptr< amrex::MultiFab > &  mf_DV_avg1,
std::unique_ptr< amrex::MultiFab > &  mf_DV_avg2,
std::unique_ptr< amrex::MultiFab > &  mf_ubar,
std::unique_ptr< amrex::MultiFab > &  mf_vbar,
std::unique_ptr< amrex::MultiFab > &  mf_Akv,
std::unique_ptr< amrex::MultiFab > &  mf_Akt,
std::unique_ptr< amrex::MultiFab > &  mf_Hz,
std::unique_ptr< amrex::MultiFab > &  mf_Huon,
std::unique_ptr< amrex::MultiFab > &  mf_Hvom,
std::unique_ptr< amrex::MultiFab > &  mf_z_w,
amrex::MultiFab const *  mf_h,
amrex::MultiFab const *  mf_pm,
amrex::MultiFab const *  mf_pn,
amrex::MultiFab const *  mf_mskr,
amrex::MultiFab const *  mf_msku,
amrex::MultiFab const *  mf_mskv,
const int  N,
const amrex::Real  dt_lev 
)

Advance the 3D variables.

Corresponds to step3d_uv.F and step3d_t.F in ROMS

Parameters
[in]levlevel of refinement (coarsest level is 0)
[in,out]mf_consscalar variables (temp, salt, scalar, etc)
[in,out]mf_uu-velocity
[in,out]mf_vv-velocity
[in,out]mf_sstoreintermediate-step scalar variables
[in,out]mf_ruRHS of total u-velocity
[in,out]mf_rvRHS of total v-velocity
[in]mf_DU_avg1time-averaged u-flux for 2D equations
[in]mf_DU_avg2time-averaged u-flux for 3D equation coupling
[in]mf_DV_avg1time-averaged v-flux for 2D equations
[in]mf_DV_avg2time-averaged v-flux for 3D equation coupling
[in,out]mf_ubarvertically integrated u-momentum
[in,out]mf_vbarvertically integrated v-momentum
[in,out]mf_Akvvertical viscosity coefficient
[in,out]mf_Aktvertical diffusivity coefficient
[in,out]mf_Hzvertical height of cells
[in,out]mf_Huonu-volume flux
[in,out]mf_Huonv-volume flux
[in,out]mf_z_wvertical coordinates on w points
[in]mf_hbathymetry
[in]mf_pm1 / dx
[in]mf_pn1 / dy
[in]mf_mskuland-sea mask at u-points
[in]mf_mskvland-sea mask at v-points
[in]Nnumber of vertical levels
[in]dt_levtime step at this refinement level

Definition at line 36 of file REMORA_advance_3d.cpp.

Referenced by advance_3d_ml().

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

◆ advance_3d_ml()

void REMORA::advance_3d_ml ( int  lev,
amrex::Real  dt_lev 
)

3D advance on a single level

Parameters
[in]levrefinement level
[in]dt_levtime step at refinement level

Definition at line 9 of file REMORA_advance_3d_ml.cpp.

Referenced by Advance(), and timeStepML().

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

◆ advance_biology()

void REMORA::advance_biology ( int  lev,
amrex::MultiFab const &  mf_cons_old,
amrex::MultiFab &  mf_cons_new,
int  N,
amrex::Real  dt_lev 
)

Apply biological tracer source/sink terms.

Definition at line 3754 of file REMORA.cpp.

Referenced by advance_3d().

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

◆ allocate_bathymetry_grid_vars_full_domain()

void REMORA::allocate_bathymetry_grid_vars_full_domain ( )

Allocate multifabs for storing full-domain bathymetry and grid vars data.

Definition at line 355 of file REMORA_init.cpp.

Referenced by init_only().

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

◆ allocate_init_full_domain()

void REMORA::allocate_init_full_domain ( )

Allocate multifabs for storing full-domain high resolution initial data.

Definition at line 427 of file REMORA_init.cpp.

Referenced by init_only().

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

◆ append2DPlotVariables()

void REMORA::append2DPlotVariables ( const std::string &  pp_plot_var_names_2d)
private
Parameters
pp_plot_var_names_2dvariables to add to plot list

Definition at line 270 of file REMORA_SetPlotVars.cpp.

Referenced by InitData().

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

◆ append3DPlotVariables()

void REMORA::append3DPlotVariables ( const std::string &  pp_plot_var_names_3d)
private
Parameters
pp_plot_var_namesvariables to add to plot list

Definition at line 232 of file REMORA_SetPlotVars.cpp.

Referenced by InitData().

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

◆ apply_clim_nudg()

void REMORA::apply_clim_nudg ( const amrex::Box &  bx,
int  ioff,
int  joff,
const amrex::Array4< amrex::Real > &  var,
const amrex::Array4< amrex::Real const > &  var_old,
const amrex::Array4< amrex::Real const > &  var_clim,
const amrex::Array4< amrex::Real const > &  clim_coeff,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  om_face,
const amrex::Array4< amrex::Real const > &  on_face,
const amrex::Real  dt_lev = zero 
)

Apply climatology nudging.

Parameters
[in]bxbox to apply climatology on
[in]ioffoffset in x-direction
[in]joffoffset in y-direction
[in,out]varvariable to update
[in]var_oldvariable to compare against for nudging
[in]var_climclimatology value to nudge towards
[in]clim_coeffnudging time scale (1/s)
[in]Hzvertical cell height
[in]om_faceom_u or om_v at the nudged faces (unused for tracers)
[in]on_faceon_u or on_v at the nudged faces (unused for tracers)
[in]dt_levtime step

Definition at line 19 of file REMORA_apply_clim_nudg.cpp.

Referenced by advance_2d(), advance_3d(), and setup_step().

Here is the caller graph for this function:

◆ ApplyAtmosphericFluxes()

void REMORA::ApplyAtmosphericFluxes ( const amrex::Vector< amrex::MultiFab * > &  states,
amrex::Real  time 
)

Receives atmospheric flux lanes from the driver and assembles REMORA flux inputs.

Expected active-lane order matches the driver FluxPassing contract: tau_x, tau_y, SHflux, LHflux, SWrad, LWrad, rain, evap.

This routine copies imported forcing lanes into REMORA's existing flux arrays and assembles vec_stflux directly from those imported values. It intentionally leaves the downstream salt_old multiplication to setup_step().

Definition at line 685 of file REMORA_Coupling.cpp.

◆ ApplyAtmosphericStates()

void REMORA::ApplyAtmosphericStates ( const amrex::Vector< amrex::MultiFab * > &  states,
amrex::Real  time 
)

Receives atmospheric states from the driver and applies unit conversions.

Fills REMORA's internal forcing MultiFabs from states and records which lanes were successfully updated in driver_atmos_state_from_driver. Unit conversions applied: Pair Pa to mb; Tair K to Celsius.

Parameters
[in]statesATM2OCN forcing slab buffer from the driver (Warner et al. 2010, Block B state-passing contract), indexed by AtmosState. Expected units per lane: Uwind/Vwind: 10-m winds [m/s]; Pair: mean sea-level pressure [Pa, converted to mb]; Qair: near-surface specific humidity [kg/kg]; Tair: 2-m air temperature [K, converted to degC]; Cloud: cloud fraction [0-1]; Rain: precipitation rate [kg/m^2/s]; SWrad/LWrad: downwelling shortwave/longwave radiation [W/m^2]. Missing lanes (null pointer or index out of range) are skipped; driver_atmos_state_from_driver tracks populated lanes for the bulk-flux parameterization fallback logic.
[in]timeCurrent ocean model time (unused; retained for driver interface conformance).

Definition at line 600 of file REMORA_Coupling.cpp.

◆ average_down_masked()

void REMORA::average_down_masked ( int  crse_lev,
const amrex::MultiFab &  S_fine,
amrex::MultiFab &  S_crse,
const amrex::MultiFab &  msk_fine,
const amrex::MultiFab &  cmsk,
int  ncomp,
int  face_dir,
bool  volume_weighted = false 
)

Average one field from crse_lev+1 onto crse_lev, weighting by the land/sea mask.

Follows amrex::average_down's non-MFIter-safe branch, since coarsen(grids[flev]) does not match grids[crse_lev] in general: compute onto a temporary on the coarsened-fine layout, then ParallelCopy that onto the coarse level.

Parameters
[in]crse_levlevel to average down to
[in]S_finefine-level field
[out]S_crsecoarse-level field
[in]msk_finefine-level mask, on S_fine's layout and nodality
[in]cmskcoarse-level mask, already on the coarsened-fine layout
[in]ncompnumber of components to average
[in]face_dirface direction, or -1 for a cell-centered field
[in]volume_weightedalso weight a cell-centered field on grids[crse_lev+1] by fine cell volume, Hz/(pm*pn)

Definition at line 3476 of file REMORA.cpp.

Referenced by AverageDownTo().

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

◆ average_down_with_grow_cells()

void REMORA::average_down_with_grow_cells ( int  lev,
amrex::Vector< std::unique_ptr< amrex::MultiFab > > &  mf,
bool  use_mask = false 
)

Average down from level lev+1 to lev in mf, including grow cells.

Average a full-domain field from crse_lev+1 onto crse_lev, grow cells included.

With use_mask this takes REMORAMaskedAvgDown's mask-weighted mean instead of the plain one, so the initial state on a coarse cell only partly covered by water comes from that water. It is the formula AverageDownTo applies every step, so the initial and the running state agree on what a land point holds – unless cf_avgdown_volume_weighted is set, which this cascade ignores for want of a full-domain Hz. A two-way run then averages down once before its first step, so only the coarse cells outside the fine grids keep the area mean. Leave use_mask off for grid metrics: a cell size is well defined under land, and masking pm/pn would corrupt it.

Parameters
[in]crse_levlevel to average data down to
[in,out]vec_mfvector over levels of multifabs containing data to average
[in]use_maskweight by the land/sea mask rather than averaging every fine cell

Definition at line 3677 of file REMORA.cpp.

Referenced by init_biology_ic_full_domain(), init_data_full_domain_from_netcdf(), init_full_domain_from_analytic(), init_grid_vars_full_domain_from_netcdf(), and init_zeta_full_domain_from_netcdf().

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

◆ average_stress_to_faces()

void REMORA::average_stress_to_faces ( int  lev,
const amrex::MultiFab &  tau_xi_rho,
const amrex::MultiFab &  tau_eta_rho 
)

Average rho-point stress components to the u and v faces.

Each u face takes the mean of the rho points either side of it in x, each v face the mean of those either side in y. The faces on the domain edge use the boundary ring.

Parameters
[in]levlevel
[in]tau_xi_rhoxi stress on rho points, with at least one ghost cell filled
[in]tau_eta_rhoeta stress on rho points, likewise

Definition at line 1882 of file REMORA.cpp.

Referenced by set_smflux().

Here is the caller graph for this function:

◆ AverageDown()

void REMORA::AverageDown ( )
private

set covered coarse cells to be the average of overlying fine cells

Definition at line 2985 of file REMORA.cpp.

Referenced by InitData().

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

◆ AverageDownTo()

void REMORA::AverageDownTo ( int  crse_lev)
private

more flexible version of AverageDown() that lets you average down across multiple levels

Definition at line 3254 of file REMORA.cpp.

Referenced by AverageDown(), post_timestep(), timeStep(), and timeStepML().

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

◆ bdy_cons()

int REMORA::bdy_cons ( int  icomp) const
inlinenoexcept

Accessors for the ncons-dependent entries of BdyVars.

Definition at line 1672 of file REMORA.H.

Here is the call graph for this function:

◆ bdy_ubar()

int REMORA::bdy_ubar ( ) const
inlinenoexcept

Definition at line 1673 of file REMORA.H.

Referenced by advance_2d(), advance_3d_ml(), init_bcs(), init_bdry_from_netcdf(), init_clim_nudg_coeff(), init_clim_nudg_coeff_from_netcdf(), init_stuff(), MakeNewLevelFromCoarse(), RemakeLevel(), resize_stuff(), and set_2darrays().

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

◆ bdy_vbar()

int REMORA::bdy_vbar ( ) const
inlinenoexcept

Definition at line 1674 of file REMORA.H.

Referenced by advance_2d(), advance_3d_ml(), init_bcs(), init_bdry_from_netcdf(), init_clim_nudg_coeff(), init_clim_nudg_coeff_from_netcdf(), init_stuff(), MakeNewLevelFromCoarse(), RemakeLevel(), resize_stuff(), and set_2darrays().

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

◆ bdy_zeta()

int REMORA::bdy_zeta ( ) const
inlinenoexcept

Definition at line 1675 of file REMORA.H.

Referenced by advance_2d(), fill_from_bdyfiles(), init_bcs(), init_bdry_from_netcdf(), init_clim_nudg_coeff(), init_stuff(), init_zeta_from_netcdf(), resize_stuff(), and set_zeta_averaged_down().

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

◆ bio_comp_start()

int REMORA::bio_comp_start ( ) const
inlinenoexcept

First cons component of the biology block. Problem setups need this to write biology initial conditions, since the passive scalars sit between salinity and the biology tracers.

Definition at line 2441 of file REMORA.H.

◆ build_covered_mask()

void REMORA::build_covered_mask ( int  crse_lev,
amrex::MultiFab &  covered 
)

Average one field down a level, weighted by the land/sea mask.

coarse cell mask, 1 where covered by lev+1, with one grow cell

Coarse-level cell mask: 1 where level crse_lev+1 covers the cell, 0 elsewhere, with one grow cell so a face straddling the patch edge can see the cell outside it.

Parameters
[in]crse_levcoarse level
[out]coveredmask on the coarse layout

Definition at line 3400 of file REMORA.cpp.

Referenced by AverageDownTo().

Here is the caller graph for this function:

◆ build_fine_mask()

MultiFab & REMORA::build_fine_mask ( int  level)

Make mask to zero out covered cells (for mesh refinement)

Parameters
[in]levlevel to calculate on

Definition at line 250 of file REMORA_SumIQ.cpp.

Referenced by volWgtSumMF().

Here is the caller graph for this function:

◆ bulk_fluxes()

void REMORA::bulk_fluxes ( int  lev,
amrex::MultiFab *  mf_cons,
amrex::MultiFab *  mf_uwind,
amrex::MultiFab *  mf_vwind,
amrex::MultiFab *  mf_Tair,
amrex::MultiFab *  mf_qair,
amrex::MultiFab *  mf_Pair,
amrex::MultiFab *  mf_srflx,
amrex::MultiFab *  mf_longwave_down,
amrex::MultiFab *  mf_evap,
amrex::MultiFab *  mf_sustr,
amrex::MultiFab *  mf_svstr,
amrex::MultiFab *  mf_stflux,
amrex::MultiFab *  mf_lrflx,
amrex::MultiFab *  mf_lhflx,
amrex::MultiFab *  mf_shflx,
const int  N 
)

Calculate bulk temperature, salinity, wind fluxes.

Parameters
[in]levlevel to operate on
[in]mf_consscalar data: temperature, salinity, passsive scalar, etc
[in]mf_uwindu-direction wind dvelocity
[in]mf_vwindv-direction wind dvelocity
[in]mf_Tairair temperature [°C]
[in]mf_qairspecific humidity [kg/kg]
[in]mf_Pairair pressure [mb]
[in]mf_srflxshortwave radiation flux [W/m²]
[in]mf_longwave_downexternal longwave radiation flux [W/m²]
[in,out]mf_evapevaporation rate
[out]mf_sustru-direction surface momentum stress
[out]mf_svstrv-direction surface momentum stress
[out]mf_stfluxsurface scalar flux (temperature, salinity)
[out]mf_lrflxlongwave radiation flux
[in,out]mf_lhflxlatent heat flux
[in,out]mf_shflxsensible heat flux
[in]Nnumber of vertical levels

Spec Hum (kg/kg)

Definition at line 25 of file REMORA_bulk_flux.cpp.

Referenced by setup_step().

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

◆ bulk_psit()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real REMORA::bulk_psit ( amrex::Real  ZoL)
inlinestatic

Evaluate stability function psi for moisture and heat.

Definition at line 2481 of file REMORA.H.

Referenced by bulk_fluxes().

Here is the caller graph for this function:

◆ bulk_psiu()

AMREX_GPU_HOST_DEVICE static AMREX_FORCE_INLINE amrex::Real REMORA::bulk_psiu ( amrex::Real  ZoL)
inlinestatic

Evaluate stability function psi for wind speed.

Definition at line 2449 of file REMORA.H.

Referenced by bulk_fluxes().

Here is the caller graph for this function:

◆ calc_stretch_coeffs()

void REMORA::calc_stretch_coeffs ( )

calculate vertical stretch coefficients

Definition at line 50 of file REMORA_DepthStretchTransform.H.

Referenced by init_stretch_coeffs().

Here is the caller graph for this function:

◆ calculate_nodal_masks()

void REMORA::calculate_nodal_masks ( int  lev)

Calculate u-, v-, and psi-point masks based on rho-point masks after analytic initialization.

Parameters
[in]levlevel to operate on

Definition at line 1259 of file REMORA_make_new_level.cpp.

Referenced by update_nodal_masks().

Here is the caller graph for this function:

◆ cf_2d_cache_entry()

void REMORA::cf_2d_cache_entry ( int  lev,
int  slot,
const amrex::MultiFab &  mf,
const amrex::MultiFab &  crse,
amrex::Real  time,
amrex::Interpolater *  mapper,
int  bccomp 
)

Make cf_2d_cache[lev][slot] fit mf's layout: on a layout change, find the ghost cells a two-level fill of mf from crse writes (by a probe fill) and drop the cached values.

Fit cf_2d_cache[lev][slot] to mf's layout. When the layout changes, the cached values are dropped and the mask is rebuilt: the ghost cells a two-level fill of mf writes, which is the coarse-fine ghost region together with whatever the interpolater's patches overlap. Rather than restate AMReX's region logic, run the same fill on a probe whose ghost cells hold a sentinel no fill can produce (valid cells 0, parent 1) and mark what changed.

Parameters
[in]levfine level
[in]slotcache slot (0 ubar, 1 vbar, 2 zeta)
[in]mfthe MultiFab the fills write
[in]crsethe parent level's MultiFab of the same field, for its layout
[in]timea fill time (only the layout matters)
[in]mapperthe interpolater the fills use
[in]bccompindex into domain_bcs_type the fills use

Definition at line 394 of file REMORA_FillPatch.cpp.

Referenced by FillPatch().

Here is the caller graph for this function:

◆ check_cf_metrics()

void REMORA::check_cf_metrics ( int  crse_lev)

check that fine cell edges sum to the coarse edge across an interface

Measure whether the fine cell edges tile the coarse ones across a coarse-fine interface: the sum of on_u over the r covering fine faces against on_u on the coarse face.

Exact where pm and pn are uniform, and not guaranteed otherwise – on the NetCDF path a finer level interpolates its metrics from the parent's and rescales them, which need not preserve a sum. set_2d_cf_bcs cannot impose a conservative flux without this identity.

Parameters
[in]crse_levcoarse side of the interface

Definition at line 3028 of file REMORA.cpp.

Referenced by AverageDownTo().

Here is the caller graph for this function:

◆ check_dropped_level0_mask()

void REMORA::check_dropped_level0_mask ( )

Check level 0's mask against the mask the dropping decision was made on.

Level 0's mask, as set_masks built it on the kept boxes, has to be the mask the boxes were dropped on; otherwise the decision rested on a different coastline. Compared everywhere the mask is stored, ghost cells included.

Definition at line 453 of file REMORA_land_layout.cpp.

Referenced by MakeNewLevelFromScratch().

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

◆ check_dry_box_nesting()

void REMORA::check_dry_box_nesting ( ) const

Abort if level 1 or its coarse stencil reaches a dropped level-0 box.

Abort if level 1, or the coarse cells its fills and averaging use, reaches a dropped level-0 box. level0_refine_footprint keeps those boxes when the run starts; this catches a grid that outgrew that footprint at a regrid.

Definition at line 418 of file REMORA_land_layout.cpp.

Referenced by InitData(), and regrid().

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

◆ check_mask_consistency()

void REMORA::check_mask_consistency ( )

Check every level pair's masks against each other, and every level's mask values, reporting according to remora.mask_consistency.

Check the land-sea masks for what the rest of the code relies on. Only runs when remora.check_mask_consistency is set; remora.mask_consistency picks abort or warn.

Per level, that the masks hold only the values they are meant to and that no water cell has a non-positive depth. Per level pair, over the region the finer level covers, that no coarse water point sits over fine points that are all land.

Definition at line 1229 of file REMORA.cpp.

Referenced by InitData(), timeStep(), and timeStepML().

Here is the caller graph for this function:

◆ check_plot_nodal_z()

void REMORA::check_plot_nodal_z ( const amrex::Vector< const amrex::MultiFab * > &  nd,
const amrex::Vector< amrex::Geometry > &  g 
)

Check the nodal z a viewer rebuilds from what WritePlotFile is about to write.

nd[lev] is the nodal displacement on the grid g[lev] describes – the native geometry, or g2 on the expand_plotvars_to_unif_rr path – so a viewer's node is z = ProbLo(2) + k*dz + nu_z. Per level, the lowest and highest node layers must reproduce z_phys_nd's bottom and top to rounding. Per level pair, at every fine node that coincides with a coarse node, |z_f - z_c| is taken over the patch interior and its perimeter separately: a perimeter node averages fine ghost columns the parent interpolated, so it is reported, and only the interior is held to check_plot_z_tol.

Parameters
[in]ndnodal displacement per level, as passed to the writer
[in]ggeometry per level, as passed to the writer

Definition at line 1250 of file REMORA_Plotfile.cpp.

Referenced by WritePlotFile().

Here is the caller graph for this function:

◆ clear_avgdown_masks()

void REMORA::clear_avgdown_masks ( int  lev)

Drop the cached average-down masks of every level pair that involves lev.

Drop the cached average-down masks of every level pair that involves lev, so the next AverageDownTo rebuilds them.

Called from set_masks, which is the one place a level's mask is written, so a regrid cannot leave a cached copy of a mask that no longer exists behind.

Parameters
[in]levlevel whose mask has just been rebuilt

Definition at line 3004 of file REMORA.cpp.

Referenced by set_masks().

Here is the caller graph for this function:

◆ ClearLevel()

void REMORA::ClearLevel ( int  lev)
overridevirtual

Delete level data Overrides the pure virtual function in AmrCore.

Delete level data. Overrides the pure virtual function in AmrCore

Parameters
[in]levlevel to operate on

Definition at line 937 of file REMORA_make_new_level.cpp.

◆ clim_nudg_momentum_box()

Box REMORA::clim_nudg_momentum_box ( const amrex::Box &  nodal_bx,
int  dir,
const amrex::Box &  domain,
bool  is_periodic 
)
static

Shrink an x- or y-nodal momentum tilebox to the faces ROMS nudges.

ROMS nudges momentum toward climatology over i=IstrU..Iend (j=JstrV..Jend), which excludes the u-face on the western and eastern domain edges (v-face on the southern and northern edges). This returns the part of nodal_bx that survives that exclusion. Under EW_PERIODIC (NS_PERIODIC) ROMS sets IstrU=Istr (JstrV=Jstr) and nudges every face, so a periodic direction is left alone.

Parameters
[in]nodal_bxbox from MFIter::nodaltilebox(dir)
[in]dirdirection the box is nodal in (0 for u, 1 for v)
[in]domaincell-centered problem domain at this level
[in]is_periodicwhether dir is periodic
[in]nodal_bxbox from MFIter::nodaltilebox(dir)
[in]dirdirection the box is nodal in (0 for u, 1 for v)
[in]domaincell-centered problem domain at this level
[in]is_periodicwhether dir is periodic

Definition at line 50 of file REMORA_apply_clim_nudg.cpp.

Referenced by advance_2d(), and setup_step().

Here is the caller graph for this function:

◆ coarse_for_interp()

MultiFab & REMORA::coarse_for_interp ( int  crse_lev,
amrex::MultiFab &  crse,
amrex::MultiFab &  scratch 
)

Coarse data ready for a coarse-to-fine interpolation: ghost cells exchanged, and those beyond a wall made to agree with their periodic images.

Coarse data ready for a coarse-to-fine interpolation (FillPatchTwoLevels, InterpFromCoarseLevel), which copies the coarse cells, ghost cells included, with periodicity. The ghost cells are exchanged across grids and periodic edges, and those that also lie beyond a non-periodic domain face are made to agree with their periodic images (periodic_consistent_ghosts), so that no cell of the copy has two different sources (#768, #774, #776). Every coarse-to-fine fill goes through here.

The ghost cells beyond a wall are otherwise taken as the coarse level's own fill left them; they are not refilled from the boundary conditions here.

Parameters
[in]crse_levlevel of crse
[in,out]crsecoarse data; its ghost cells are exchanged in place
[in,out]scratchstorage for a consistent copy, used only when one is needed
Returns
crse itself, or scratch holding the consistent copy

Definition at line 205 of file REMORA_FillPatch.cpp.

Referenced by FillCoarsePatchMap(), FillPatch(), FillPatchNoBC(), and WritePlotFile().

Here is the caller graph for this function:

◆ coarsen_bathymetry_with_grow_cells()

void REMORA::coarsen_bathymetry_with_grow_cells ( int  crse_lev)

Coarsen the full-domain bathymetry from crse_lev+1 onto crse_lev, grow cells included, weighted by the land/sea mask.

Coarsen the full-domain bathymetry from crse_lev+1 onto crse_lev, grow cells included, weighted by the land/sea mask.

Averaging every fine cell would mix in whatever the grid file holds under land, which on a ROMS grid is a fill value with no physical meaning. A wet coarse cell should take the depth of the water under it. See REMORA_MaskedAverageDown.H for why the arithmetic is written the way it is.

Parameters
[in]crse_levlevel to coarsen onto

Definition at line 1454 of file REMORA.cpp.

Referenced by init_bathymetry_full_domain_from_analytic(), and init_bathymetry_full_domain_from_netcdf().

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

◆ coarsen_masks_with_grow_cells()

void REMORA::coarsen_masks_with_grow_cells ( int  crse_lev)

Coarsen the full-domain rho-mask from crse_lev+1 onto crse_lev, grow cells included, by the rule that a coarse cell is land only if all its fine cells are land.

Coarsen the full-domain rho-mask from crse_lev+1 onto crse_lev, grow cells included, so a coarse cell is land only if every one of its fine cells is land.

average_down_with_grow_cells cannot be used: an arithmetic mean over a partly wet group of fine cells gives a fractional value, and the mask has to stay exactly 0 or 1. Taking the cell as wet also means the coarse level never declares land where the fine grid found water.

Parameters
[in]crse_levlevel to coarsen onto

Definition at line 1196 of file REMORA.cpp.

Referenced by init_masks_full_domain_from_analytic(), and init_masks_full_domain_from_netcdf().

Here is the caller graph for this function:

◆ compute_diagnostic_omega()

void REMORA::compute_diagnostic_omega ( int  lev,
amrex::MultiFab &  mf_omega 
)

omega (m/s) as ROMS writes it: from mass fluxes of the current velocities

omega as ROMS writes it to its history file: main3d calls set_massflux on the current velocities and then omega, before output. The fluxes left in vec_Huon and vec_Hvom by update_massflux_3d are instead time-averaged over the step (the ones the tracers move with), so they are not used here.

Parameters
[in]levlevel
[out]mf_omegaz-nodal omega (m/s)

Definition at line 125 of file REMORA_compute_W.cpp.

Referenced by compute_omega_and_w(), and WritePlotFile().

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

◆ compute_omega()

void REMORA::compute_omega ( int  lev,
amrex::MultiFab &  mf_omega,
const amrex::MultiFab &  mf_Huon,
const amrex::MultiFab &  mf_Hvom 
)

Velocity across the w-levels (omega, m/s) from the given mass fluxes.

W converted from a volume flux to a velocity, as ROMS scale_omega. It is zero at the bed and the free surface.

If both mf_omega and the fluxes have ghost cells, the first ghost column is computed directly from the fluxes there, as advance_3d computes W, so it is right at domain and coarse/fine boundaries too. The rest of the ghost cells are then filled across grids and periodic boundaries, and are zero elsewhere outside the domain.

Parameters
[in]levlevel
[out]mf_omegaz-nodal omega (m/s)
[in]mf_Huonu-volume flux on the valid faces, and on the first ghost faces for the directly computed ghost column
[in]mf_Hvomv-volume flux, likewise

Definition at line 74 of file REMORA_compute_W.cpp.

Referenced by compute_diagnostic_omega(), and evolveTracers().

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

◆ compute_omega_and_w()

void REMORA::compute_omega_and_w ( int  lev,
amrex::MultiFab *  mf_omega,
amrex::MultiFab *  mf_wvel 
)

omega and w on the s_w points of the NetCDF output, ghost columns filled and masked

omega and w for the NetCDF writer, on the s_w points ROMS writes them at.

Both are diagnosed from the current velocities, as ROMS does just before it writes a history record: omega by compute_diagnostic_omega and w by compute_wvel (the same w that z_velocity holds after a step). Computing w here rather than reading zvel_new keeps it consistent with omega on a coarse level whose velocities have since been averaged down.

Both come out with one ghost column. A ghost column at a non-periodic edge copies its interior neighbor, as ROMS bc_w3d does, and masked columns hold the NetCDF fill value. Call this before mask_arrays_for_write puts fill values into the land faces of u and v.

Parameters
[in]levlevel to diagnose
[out]mf_omegaomega, or nullptr to skip it
[out]mf_wvelw, or nullptr to skip it

Definition at line 1490 of file REMORA_Plotfile.cpp.

Referenced by WritePlotFile().

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

◆ compute_W()

void REMORA::compute_W ( const amrex::Box &  bx2d,
const amrex::Array4< amrex::Real > &  W,
const amrex::Array4< amrex::Real const > &  Huon,
const amrex::Array4< amrex::Real const > &  Hvom,
const amrex::Array4< amrex::Real const > &  z_w,
const amrex::Array4< amrex::Real const > &  h,
const int  N 
)
static

Vertical volume flux W from the horizontal mass flux divergence.

Vertical volume flux across the w-levels (ROMS omega times the cell area), from the vertical integral of the horizontal mass flux divergence. W is zero at the bed and at the free surface.

Parameters
[in]bx2dk = 0 slab of the columns to compute
[out]Wvertical volume flux
[in]Huonu-volume flux
[in]Hvomv-volume flux
[in]z_wz coordinates at w points
[in]hbathymetry
[in]Nnumber of vertical levels minus one

Definition at line 19 of file REMORA_compute_W.cpp.

Referenced by advance_3d(), compute_omega(), and prestep_t_advection().

Here is the caller graph for this function:

◆ compute_wvel() [1/2]

void REMORA::compute_wvel ( int  lev,
amrex::MultiFab &  mf_w 
)

"True" vertical velocity w (m/s) at w-points, as ROMS wvelocity

Referenced by advance_3d_ml(), compute_omega_and_w(), and InitData().

Here is the caller graph for this function:

◆ compute_wvel() [2/2]

void REMORA::compute_wvel ( int  lev,
amrex::MultiFab &  mf_w,
const amrex::MultiFab &  mf_omega 
)

As compute_wvel, from an omega already computed by compute_diagnostic_omega.

◆ ComputeDt()

void REMORA::ComputeDt ( )
private

a wrapper for estTimeStep()

Definition at line 57 of file REMORA_ComputeTimestep.cpp.

Referenced by Evolve(), EvolveOneStep(), and InitData().

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

◆ ConfigureDriverAtmosToOceanCoupling()

void REMORA::ConfigureDriverAtmosToOceanCoupling ( bool  use_coupling_driver,
bool  use_two_way_coupling,
DriverAtmosForcingMode  active_mode 
)

Definition at line 339 of file REMORA_Coupling.cpp.

Here is the call graph for this function:

◆ Construct_REMORAFillPatchers()

void REMORA::Construct_REMORAFillPatchers ( int  lev)
private

Construct FillPatchers.

Parameters
[in]levlevel to operate on

Definition at line 586 of file REMORA.cpp.

Referenced by init_stuff(), InitData(), and MakeNewLevelFromCoarse().

Here is the caller graph for this function:

◆ convert_inv_days_to_inv_s()

void REMORA::convert_inv_days_to_inv_s ( amrex::MultiFab *  )

Convert data in a multifab from inverse days to inverse seconds.

Parameters
[in,out]mfmultifab of data to convert

Definition at line 1215 of file REMORA_init_from_netcdf.cpp.

Referenced by init_clim_nudg_coeff_from_netcdf().

Here is the caller graph for this function:

◆ coriolis()

void REMORA::coriolis ( const amrex::Box &  xbx,
const amrex::Box &  ybx,
const amrex::Array4< amrex::Real const > &  uold,
const amrex::Array4< amrex::Real const > &  vold,
const amrex::Array4< amrex::Real > &  ru,
const amrex::Array4< amrex::Real > &  rv,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  fomn,
int  nrhs,
int  nr 
)

Calculate Coriolis terms.

Parameters
[in]xbxnodal box in x-direction
[in]ybxnodal box in y-direction
[in]uoldu-direction velocity
[in]voldv-direction velocity
[in,out]ruu-direction velocity RHS
[in,out]rvv-direction velocity RHS
[in]Hzvertical cell height
[in]fomnscaled coriolis factor
[in]nrhswhich velocity component to use
[in]nrwhich RHS component to update

Definition at line 19 of file REMORA_coriolis.cpp.

Referenced by setup_step().

Here is the caller graph for this function:

◆ curvilinear()

void REMORA::curvilinear ( const amrex::Box &  bx,
const amrex::Box &  xbx,
const amrex::Box &  ybx,
const amrex::Array4< amrex::Real const > &  uold,
const amrex::Array4< amrex::Real const > &  vold,
const amrex::Array4< amrex::Real > &  ru,
const amrex::Array4< amrex::Real > &  rv,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  dndx,
const amrex::Array4< amrex::Real const > &  dmde,
int  nrhs,
int  nr 
)

Calculate curvilinear advection terms.

Parameters
[in]bxbox to update on
[in]xbxnodal-x box to update on
[in]ybxnodal-y box to update on
[in]uoldu-direction velocity
[in]voldv-direction velocity
[in,out]ruu-direction velocity RHS
[in,out]rvv-direction velocity RHS
[in]Hzvertical cell height
[in]dndxd(1/n)/d(xi)
[in]dmded(1/m)/d(eta)
[in]nrhswhich velocity component to use
[in]nrwhich RHS component to update

Definition at line 21 of file REMORA_curvilinear.cpp.

Referenced by setup_step().

Here is the caller graph for this function:

◆ DataLog()

AMREX_FORCE_INLINE std::ostream & REMORA::DataLog ( int  i)
inlineprivate

Helper function for IO stream.

Definition at line 2359 of file REMORA.H.

Referenced by sum_integrated_quantities().

Here is the caller graph for this function:

◆ DataLogName()

const std::string REMORA::DataLogName ( int  i) const
inlineprivatenoexcept

The filename of the ith datalog file.

Definition at line 2409 of file REMORA.H.

◆ define_flux_register()

void REMORA::define_flux_register ( int  lev)
private

build or rebuild the flux register between lev and lev-1

Build the flux register holding the tracer flux mismatch between lev and lev-1. Called whenever a level is created or its grids change, since one appearing mid-run through tagging would otherwise have no register.

Parameters
[in]levlevel of refinement, > 0

Definition at line 3113 of file REMORA.cpp.

Referenced by InitData(), MakeNewLevelFromCoarse(), and RemakeLevel().

Here is the caller graph for this function:

◆ Define_REMORAFillPatchers()

void REMORA::Define_REMORAFillPatchers ( int  lev)
private

Define FillPatchers.

Parameters
[in]levlevel to operate on

Definition at line 642 of file REMORA.cpp.

Referenced by init_stuff(), MakeNewLevelFromCoarse(), and RemakeLevel().

Here is the caller graph for this function:

◆ DriverUsesStateForcing()

static constexpr bool REMORA::DriverUsesStateForcing ( DriverAtmosForcingMode  mode)
inlinestaticconstexprnoexcept

Definition at line 100 of file REMORA.H.

Referenced by InitData(), and setup_step().

Here is the caller graph for this function:

◆ drop_dry_level0_boxes()

BoxArray REMORA::drop_dry_level0_boxes ( const amrex::BoxArray &  ba)

The kept boxes of a level-0 BoxArray under remora.drop_dry_boxes.

The boxes of a level-0 BoxArray that remora.drop_dry_boxes keeps: every box with a wet rho cell in its footprint – its valid cells and every ghost cell the mask carries, up to one cell beyond a non-periodic domain edge – and every box a finer level may need (level0_refine_footprint). The rest are land over all of that, so no wet cell's stencil reaches them; partly wet boxes are kept whole.

Parameters
[in]bacandidate level-0 BoxArray
Returns
the kept boxes, in the order of ba; ba itself when nothing is dropped

Definition at line 292 of file REMORA_land_layout.cpp.

Referenced by MakeNewLevelFromScratch().

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

◆ elapsed_time()

amrex::Real REMORA::elapsed_time ( double  time) const
inlinenoexcept

Elapsed time since start_time of a time on the model clock.

Definition at line 2433 of file REMORA.H.

Referenced by ComputeDt(), Evolve(), EvolveOneStep(), and ReadCheckpointFile().

Here is the caller graph for this function:

◆ ensure_full_domain_masks()

void REMORA::ensure_full_domain_masks ( int  top_lev)

Make sure the full-domain rho-mask exists on levels 0 through top_lev.

Make sure the full-domain rho-mask exists on levels 0 through top_lev.

Only fills what the hires_grid_level coarsening has not: levels above it, by injection, and level 0 itself when there is no high-resolution grid and the mask was given per level.

Parameters
[in]top_levhighest level that needs a mask

Definition at line 3598 of file REMORA.cpp.

Referenced by init_only().

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

◆ ensure_stress_rho_arrays()

void REMORA::ensure_stress_rho_arrays ( int  lev)

Make or remake the rho-point stress arrays of a level.

The rho-point stress arrays of a level, laid out like its rho points, which a regrid may have changed since they were last made.

Parameters
[in]levlevel

Definition at line 1827 of file REMORA.cpp.

Referenced by init_only(), and set_smflux().

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

◆ ErrorEst()

void REMORA::ErrorEst ( int  lev,
amrex::TagBoxArray &  tags,
amrex::Real  time,
int  ngrow 
)
overridevirtual

Tag cells for refinement.

Function to tag cells for refinement – this overrides the pure virtual function in AmrCore

Parameters
[in]levclevel of refinement (0 is coarsest level)
[out]tagsarray of tagged cells
[in]timecurrent time
[in]ngrownumber of grow cells

Definition at line 240 of file REMORA_Tagging.cpp.

Here is the call graph for this function:

◆ estTimeStep()

Real REMORA::estTimeStep ( int  level) const

compute dt from CFL considerations

Estimate the largest stable slow (baroclinic) timestep on a level.

The estimate is the smaller of an advective limit and an external gravity wave limit, each a maximum over the wet cells of the level:

dt_adv  = cfl / max( |u|*pm, |v|*pn, |w|/Hz )
dt_grav = cfl * ndtfast / max( sqrt(g*|h|) * sqrt(pm^2 + pn^2) )

The second is the Courant quantity ROMS forms as Cg_max in metrics.F. It is what keeps the estimate finite for a run started from rest, where every velocity is zero and the advective limit alone is undefined.

pm and pn are the per-cell 1/dx and 1/dy metric terms rather than the geometry's uniform cell size, so stretched and curvilinear grids give the right answer.

Parameters
[in]levellevel of refinement

Definition at line 118 of file REMORA_ComputeTimestep.cpp.

Referenced by ComputeDt().

Here is the caller graph for this function:

◆ Evolve()

void REMORA::Evolve ( )

Advance solution to final time.

Definition at line 270 of file REMORA.cpp.

Referenced by main().

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

◆ EvolveOneStep()

amrex::Real REMORA::EvolveOneStep ( amrex::Real  time,
amrex::Real  dt_request 
)

Definition at line 308 of file REMORA_Coupling.cpp.

Here is the call graph for this function:

◆ evolveTracers()

void REMORA::evolveTracers ( int  lev,
amrex::Real  dt 
)
private

Evolve tracers and hydro particles.

Evolve tracers and hydro particles for one time step

Definition at line 152 of file REMORA_Tracers.cpp.

Referenced by advance_3d_ml().

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

◆ extrapolate_metric_to_physical_boundaries()

void REMORA::extrapolate_metric_to_physical_boundaries ( amrex::MultiFab &  mf,
const amrex::Geometry &  geom,
bool  linear = false,
amrex::Real  wrap = amrex::Real(0.0) 
)

Extrapolate grid metrics to edge of MultiFab, copying the outermost in-domain ghost row outward or, with linear, extending it linearly (steps taken modulo wrap when wrap > 0, for a longitude)

Fill the ghost rows beyond the outermost in-domain ghost row of a cell-centred field at the physical boundaries: by copying that row outward (the default, right for grid metrics and bathymetry), or with linear by extending it from the row inside it (for coordinates, which keep growing past the edge). Used in every build, so it lives here rather than in the NetCDF-only initialisation.

The x passes run first; the y passes then cover every column, including the x strips just filled, which takes care of the corners. The linear mode leaves a periodic direction alone, where FillBoundary has already put the wrapped values in the ghost cells, and its x passes read two columns, so unless y is periodic they are limited to the rows those columns hold data in (the domain and its ring). The copy mode is what it always was: it reads only the ring and covers the full extent in every direction.

Parameters
[in,out]mfmultifab of data to extrapolate on
[in]geomgeometry
[in]linearextend linearly instead of copying
[in]wrapperiod to take the linear step modulo (360 for a longitude), 0 for none

Definition at line 927 of file REMORA.cpp.

Referenced by init_grid_vars_from_netcdf(), init_grid_vars_full_domain_from_netcdf(), set_bathymetry_averaged_down(), and set_grid_vars_averaged_down().

Here is the caller graph for this function:

◆ fill_3d_masks()

void REMORA::fill_3d_masks ( int  lev)

Copy maskr to all z levels.

Parameters
[in]levlevel to operate on

Definition at line 1322 of file REMORA_make_new_level.cpp.

Referenced by set_masks().

Here is the caller graph for this function:

◆ fill_from_bdyfiles()

void REMORA::fill_from_bdyfiles ( int  lev,
amrex::MultiFab &  mf_to_fill,
const amrex::MultiFab &  mf_mask,
const amrex::Real  time,
const int  bccomp,
const int  bdy_var_type,
const int  icomp_to_fill,
const int  icomp_calc = 0,
const amrex::MultiFab &  mf_calc = amrex::MultiFab(),
const amrex::Real  = zero 
)

Fill boundary data from netcdf file.

Definition at line 20 of file REMORA_BoundaryConditions_netcdf.cpp.

Referenced by advance_3d(), FillCoarsePatchMap(), FillPatchBCs(), and init_zeta_from_netcdf().

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

◆ fill_rho_mask_from_netcdf()

void REMORA::fill_rho_mask_from_netcdf ( int  lev,
amrex::MultiFab &  mskr 
)

fill a rho-point mask on any layout of level lev from its NetCDF grid file(s)

Fill a rho-point mask on any layout of level lev from the level's grid file(s), ghost cells included, as init_masks_from_netcdf does for the level's own mask. Also used before the level exists, to weigh or drop boxes by their land (see REMORA_land_layout.cpp).

Parameters
levInteger specifying the level whose grid file(s) to read
mskrrho-point mask to fill

Definition at line 863 of file REMORA_init_from_netcdf.cpp.

Referenced by init_masks_from_netcdf(), and probe_rho_mask().

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

◆ FillBdyCCVels()

void REMORA::FillBdyCCVels ( int  lev,
amrex::MultiFab &  mf_cc_vel 
)

Fill the physical boundary conditions for cell-centered velocity (diagnostic only)

Fill boundary ghost cells for cell-centered velocities. Each component takes the sign implied by its own BC, which with remora.boundary_per_variable can differ between u, v and w on one face.

Parameters
[in]levlevel to fill at
[in,out]mf_cc_velMultiFab of cell-centered velocities

Definition at line 1015 of file REMORA_FillPatch.cpp.

Referenced by ErrorEst(), and WritePlotFile().

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

◆ FillCoarsePatch()

void REMORA::FillCoarsePatch ( int  lev,
amrex::Real  time,
amrex::MultiFab *  mf_fine,
amrex::MultiFab *  mf_crse,
const int  bccomp,
const int  bdy_var_type = BdyVars::null,
const int  icomp = 0,
const bool  fill_all = true,
const int  n_not_fill = 0,
const int  icomp_calc = 0,
const amrex::Real  dt = zero,
const amrex::MultiFab &  mf_calc = amrex::MultiFab() 
)

fill an entire multifab by interpolating from the coarser level

Fill an entire multifab by interpolating from the coarser level – this is used only when a new level of refinement is being created during a run (i.e not at initialization) This will never be used with static refinement.

Parameters
[in]levlevel to FillPatch on
[in]timecurrent time
[in,out]mf_to_fillMultiFab to fill
[in,out]mf_crseMultiFab of coarse data
[in]bccompindex into domain_bcs_type
[in]bdy_var_typewhen filling from NetCDF, which boundary data
[in]icompcomponent to fill
[in]fill_allwhether to fill all components
[in]icomp_calccomponent to use in RHS boundary calculation
[in]dt_levtime step at this level
[in]mf_calcdata to use in RHS boundary calculation

Definition at line 781 of file REMORA_FillPatch.cpp.

Referenced by FillCoarsePatchMap(), init_only(), MakeNewLevelFromCoarse(), set_bathymetry(), set_coriolis(), set_grid_scale(), and set_zeta().

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

◆ FillCoarsePatchMap()

void REMORA::FillCoarsePatchMap ( int  lev,
amrex::Real  time,
amrex::MultiFab *  mf_fine,
amrex::MultiFab *  mf_crse,
const int  bccomp,
const int  bdy_var_type = BdyVars::null,
const int  icomp = 0,
const bool  fill_all = true,
const int  n_not_fill = 0,
const int  icomp_calc = 0,
const amrex::Real  dt = zero,
const amrex::MultiFab &  mf_calc = amrex::MultiFab(),
amrex::Interpolater *  mapper = nullptr 
)

fill an entire multifab by interpolating from the coarser level, explicitly specifying interpolator to use

Fill an entire multifab by interpolating from the coarser level – this is used only when a new level of refinement is being created during a run (i.e not at initialization) This will never be used with static refinement.

Parameters
[in]levlevel to FillPatch on
[in]timecurrent time
[in,out]mf_to_fillMultiFab to fill
[in,out]mf_crseMultiFab of coarse data
[in]bccompindex into domain_bcs_type
[in]bdy_var_typewhen filling from NetCDF, which boundary data
[in]icompcomponent to fill
[in]fill_allwhether to fill all components
[in]icomp_calccomponent to use in RHS boundary calculation
[in]dt_levtime step at this level
[in]mf_calcdata to use in RHS boundary calculation

Definition at line 815 of file REMORA_FillPatch.cpp.

Referenced by FillCoarsePatch(), and FillCoarsePatchPC().

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

◆ FillCoarsePatchPC()

void REMORA::FillCoarsePatchPC ( int  lev,
amrex::Real  time,
amrex::MultiFab *  mf_fine,
amrex::MultiFab *  mf_crse,
const int  bccomp,
const int  bdy_var_type = BdyVars::null,
const int  icomp = 0,
const bool  fill_all = true,
const int  n_not_fill = 0,
const int  icomp_calc = 0,
const amrex::Real  dt = zero,
const amrex::MultiFab &  mf_calc = amrex::MultiFab() 
)

fill an entire multifab by interpolating from the coarser level using the piecewise constant interpolater

Like FillCoarsePatch but uses piecewise constant interpolater

Parameters
[in]levlevel to FillPatch on
[in]timecurrent time
[in,out]mf_to_fillMultiFab to fill
[in,out]mf_crseMultiFab of coarse data
[in]bccompindex into domain_bcs_type
[in]bdy_var_typewhen filling from NetCDF, which boundary data
[in]icompcomponent to fill
[in]fill_allwhether to fill all components
[in]icomp_calccomponent to use in RHS boundary calculation
[in]dt_levtime step at this level
[in]mf_calcdata to use in RHS boundary calculation

Definition at line 747 of file REMORA_FillPatch.cpp.

Referenced by set_masks().

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

◆ FillPatch()

void REMORA::FillPatch ( int  lev,
amrex::Real  time,
amrex::MultiFab &  mf_to_be_filled,
amrex::Vector< amrex::MultiFab * > const &  mfs,
const int  bccomp,
const int  bdy_var_type = BdyVars::null,
const int  icomp = 0,
const bool  fill_all = true,
const bool  fill_set = false,
const int  n_not_fill = 0,
const int  icomp_calc = 0,
const amrex::Real  dt = zero,
const amrex::MultiFab &  mf_calc = amrex::MultiFab(),
amrex::Vector< amrex::MultiFab * > const &  mfs_crse_old = {},
amrex::Vector< amrex::MultiFab * > const &  mfs_crse_new = {},
const int  cf_cache_slot = -1 
)

Fill a new MultiFab by copying in phi from valid region and filling ghost cells.

Fill valid and ghost data in the MultiFab "mf" This version fills the MultiFab mf_to_fill in valid regions with the "state data" at the given time; values in mf when it is passed in are not used.

Parameters
[in]levlevel to FillPatch on
[in]timecurrent time
[in,out]mf_to_fillMultiFab to fill
[in]mfsvector over levels of multifabs associated with mf_to_fill
[in]bccompindex into domain_bcs_type
[in]bdy_var_typewhen filling from NetCDF, which boundary data
[in]icompcomponent to fill
[in]fill_allwhether to fill all components
[in]fill_setwhether to use FillPatchers
[in]icomp_calccomponent to use in RHS boundary calculation
[in]dt_levtime step at this level
[in]mf_calcdata to use in RHS boundary calculation

Definition at line 232 of file REMORA_FillPatch.cpp.

Referenced by Advance(), advance_2d(), advance_3d(), advance_3d_ml(), ErrorEst(), evolveTracers(), gls_corrector(), gls_prestep(), init_bathymetry_from_netcdf(), init_grid_vars_from_netcdf(), init_zeta_from_netcdf(), InitData(), RemakeLevel(), set_2darrays(), set_analytic_vmix(), set_coriolis(), set_hmixcoef(), set_init_data_averaged_down(), set_smflux(), set_surface_state(), set_zeta_averaged_down(), setup_step(), timeStep(), and timeStepML().

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

◆ FillPatchBCs()

void REMORA::FillPatchBCs ( int  lev,
amrex::Real  time,
amrex::MultiFab &  mf_to_fill,
const int  bccomp,
const int  bdy_var_type,
const int  icomp,
const int  ncomp,
const int  n_not_fill,
const int  icomp_calc,
const amrex::Real  dt_lev,
const amrex::MultiFab &  mf_calc 
)

The boundary-condition half of FillPatch: physical and NetCDF boundary conditions, periodic corners and the free-slip top, for a MultiFab whose fine-fine ghost cells are already filled. Lets several fields share one exchange.

The boundary-condition half of FillPatch, for a MultiFab whose fine-fine (and, above level 0, coarse-fine) ghost cells are already filled: physical boundary conditions, boundary data from NetCDF files, periodic corners, and free-slip at the top for the face-centered velocities. Split out so that several fields can share one exchange and then take their conditions in turn (advance_2d does this for ubar, vbar and zeta).

Parameters
[in]levlevel to fill on
[in]timecurrent time
[in,out]mf_to_fillMultiFab to fill
[in]bccompindex into domain_bcs_type
[in]bdy_var_typewhen filling from NetCDF, which boundary data
[in]icompfirst component to fill
[in]ncompnumber of components to fill
[in]n_not_fillnumber of ghost cells not to fill
[in]icomp_calccomponent to use in RHS boundary calculation
[in]dt_levtime step at this level
[in]mf_calcdata to use in RHS boundary calculation

Definition at line 470 of file REMORA_FillPatch.cpp.

Referenced by advance_2d(), and FillPatch().

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

◆ FillPatchNoBC()

void REMORA::FillPatchNoBC ( int  lev,
amrex::Real  time,
amrex::MultiFab &  mf_to_be_filled,
amrex::Vector< amrex::MultiFab * > const &  mfs,
const int  bdy_var_type = BdyVars::null,
const int  icomp = 0,
const bool  fill_all = true,
const bool  fill_set = false,
amrex::Vector< amrex::MultiFab * > const &  mfs_crse_old = {},
amrex::Vector< amrex::MultiFab * > const &  mfs_crse_new = {} 
)

Fill a new MultiFab by copying in phi from valid region and filling ghost cells without applying boundary conditions.

Fill valid and ghost data in the MultiFab "mf" This version fills the MultiFab mf_to_fill in valid regions with the "state data" at the given time; values in mf when it is passed in are not used. Unlike FillPatch, FillPatchNoBC does not apply boundary conditions

Parameters
[in]levlevel to FillPatch on
[in]timecurrent time
[in,out]mf_to_fillMultiFab to fill
[in]mfsvector over levels of multifabs associated with mf_to_fill
[in]bdy_var_typewhen filling from NetCDF, which boundary data
[in]icompcomponent to fill
[in]fill_allwhether to fill all components
[in]fill_setwhether to use FillPatchers

Definition at line 553 of file REMORA_FillPatch.cpp.

Referenced by advance_2d(), advance_3d_ml(), gls_corrector(), setup_step(), timeStep(), and WritePlotFile().

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

◆ foextrap_bc()

int REMORA::foextrap_bc ( ) const
inlinenoexcept

Definition at line 1665 of file REMORA.H.

Referenced by gls_corrector(), init_bcs(), init_only(), set_coriolis(), set_grid_scale(), set_masks(), and WritePlotFile().

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

◆ foextrap_periodic_bc()

int REMORA::foextrap_periodic_bc ( ) const
inlinenoexcept

Definition at line 1664 of file REMORA.H.

Referenced by init_bathymetry_from_netcdf(), init_bcs(), init_grid_vars_from_netcdf(), MakeNewLevelFromCoarse(), RemakeLevel(), set_bathymetry(), set_hmixcoef(), set_smflux(), and set_surface_state().

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

◆ full_domain_dmap()

const DistributionMapping & REMORA::full_domain_dmap ( )

The shared full-domain DistributionMapping, built on first use.

Definition at line 346 of file REMORA_init.cpp.

Referenced by allocate_bathymetry_grid_vars_full_domain(), allocate_init_full_domain(), and ensure_full_domain_masks().

Here is the caller graph for this function:

◆ get_t_old()

amrex::Real REMORA::get_t_old ( int  lev) const

Accessor method for t_old to expose to outside classes.

Parameters
[in]levlevel at which to get time

Definition at line 3748 of file REMORA.cpp.

◆ getAdvFluxReg()

amrex::YAFluxRegister * REMORA::getAdvFluxReg ( int  lev)
inlineprivate

flux register between lev and lev-1

Definition at line 1943 of file REMORA.H.

Referenced by Advance(), advance_3d(), and reflux_to().

Here is the caller graph for this function:

◆ GetAtmosToOceanPsiCoordinates()

void REMORA::GetAtmosToOceanPsiCoordinates ( const amrex::MultiFab *&  x_psi,
const amrex::MultiFab *&  y_psi 
) const

Definition at line 442 of file REMORA_Coupling.cpp.

◆ GetAtmosToOceanPsiLonLat()

void REMORA::GetAtmosToOceanPsiLonLat ( const amrex::MultiFab *&  lon_psi,
const amrex::MultiFab *&  lat_psi 
) const

Definition at line 456 of file REMORA_Coupling.cpp.

◆ GetAtmosToOceanRhoLayout()

void REMORA::GetAtmosToOceanRhoLayout ( amrex::BoxArray &  ba,
amrex::DistributionMapping &  dm 
) const

Definition at line 400 of file REMORA_Coupling.cpp.

Here is the call graph for this function:

◆ GetAtmosToOceanUFaceLayout()

void REMORA::GetAtmosToOceanUFaceLayout ( amrex::BoxArray &  ba,
amrex::DistributionMapping &  dm 
) const

Definition at line 414 of file REMORA_Coupling.cpp.

Here is the call graph for this function:

◆ GetAtmosToOceanVFaceLayout()

void REMORA::GetAtmosToOceanVFaceLayout ( amrex::BoxArray &  ba,
amrex::DistributionMapping &  dm 
) const

Definition at line 428 of file REMORA_Coupling.cpp.

Here is the call graph for this function:

◆ getCPUTime()

amrex::Real REMORA::getCPUTime ( ) const
inlineprivate

Get CPU time used.

Definition at line 2378 of file REMORA.H.

Referenced by writeJobInfo().

Here is the caller graph for this function:

◆ GetDataAtTime()

TimeInterpolatedData REMORA::GetDataAtTime ( int  lev,
amrex::Real  time 
)
private

utility to copy in data from old and/or new state into another multifab

Definition at line 673 of file REMORA_FillPatch.cpp.

Referenced by GetDataAtTime().

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

◆ GetDeckConfiguredAtmosStateLanes()

void REMORA::GetDeckConfiguredAtmosStateLanes ( std::array< bool, AtmosState::NumTypes > &  deck_configured) const

Definition at line 366 of file REMORA_Coupling.cpp.

◆ GetLandSeaMasks()

void REMORA::GetLandSeaMasks ( const amrex::MultiFab *&  mskr,
const amrex::MultiFab *&  msku,
const amrex::MultiFab *&  mskv 
) const

Definition at line 484 of file REMORA_Coupling.cpp.

◆ GetRhoLonLat()

void REMORA::GetRhoLonLat ( const amrex::MultiFab *&  lon_rho,
const amrex::MultiFab *&  lat_rho 
) const

Definition at line 470 of file REMORA_Coupling.cpp.

◆ gls_corrector()

void REMORA::gls_corrector ( int  lev,
amrex::MultiFab *  mf_gls,
amrex::MultiFab *  mf_tke,
amrex::MultiFab &  mf_W,
amrex::MultiFab *  mf_Akv,
amrex::MultiFab *  mf_Akt,
amrex::MultiFab *  mf_Akk,
amrex::MultiFab *  mf_Akp,
amrex::MultiFab *  mf_mskr,
amrex::MultiFab *  mf_msku,
amrex::MultiFab *  mf_mskv,
const int  nstp,
const int  nnew,
const int  N,
const amrex::Real  dt_lev 
)

Corrector step for GLS calculation.

Parameters
[in]levlevel to operate on
[in,out]mf_glsturbulent generic length scale
[in,out]mf_tketurbulent kinetic energy
[in]mf_Wvertical velocity
[in,out]mf_Akvvertical viscosity coefficient
[in,out]mf_Aktvertical diffusivity coefficients
[in,out]mf_Akkturbulent kinetic energy vertical diffusion coefficient
[in,out]mf_Akpturbulent length scale vertical diffusion coefficient
[in]mf_mskrland-sea mask on rho points
[in]mf_mskuland-sea mask on u points
[in]mf_mskvland-sea mask on v points
[in]nstpindex of last time step in gls and tke MultiFabs
[in]nnewindex of time step to update in gls and tke MultiFabs
[in]Nnumber of vertical levels
[in]dt_levtime step at this level

Definition at line 250 of file REMORA_gls.cpp.

Referenced by advance_3d().

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

◆ gls_prestep()

void REMORA::gls_prestep ( int  lev,
amrex::MultiFab *  mf_gls,
amrex::MultiFab *  mf_tke,
amrex::MultiFab &  mf_W,
amrex::MultiFab *  mf_msku,
amrex::MultiFab *  mf_mskv,
const int  nstp,
const int  nnew,
const int  iic,
const int  ntfirst,
const int  N,
const amrex::Real  dt_lev 
)

Prestep for GLS calculation.

Parameters
[in]levlevel to operate on
[in,out]mf_glsturbulent generic length scale
[in,out]mf_tketurbulent kinetic energy
[in]mf_Wvertical velocity
[in]mf_mskuland-sea mask on u points
[in]mf_mskvland-sea mask on v points
[in]nstpindex of last time step in gls and tke MultiFabs
[in]nnewindex of time step to update in gls and tke MultiFabs
[in]iicwhich time step we're on
[in]ntfirstwhat is the first time step?
[in]Nnumber of vertical levels
[in]dt_levtime step at this level

Definition at line 20 of file REMORA_gls.cpp.

Referenced by setup_step().

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

◆ GotoNextLine()

void REMORA::GotoNextLine ( std::istream &  is)
staticprivate

utility to skip to next line in Header

Definition at line 8 of file REMORA_Checkpoint.cpp.

Referenced by ReadCheckpointFile().

Here is the caller graph for this function:

◆ history_restart_record()

long long REMORA::history_restart_record ( int  lev,
const std::string &  path 
)
private

Record at which a restarted run continues a history file.

Find where a restarted run continues an existing history file: its first record at or after the restart time. A file for a different grid is renamed aside, and the run starts a new one at record 0.

Parameters
levlevel the file holds
pathhistory file to continue
Returns
record to write the restart step to

Definition at line 330 of file REMORA_NCPlotFile.cpp.

Referenced by WriteNCPlotFile().

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

◆ init_analytic()

void REMORA::init_analytic ( int  lev)
private

Initialize initial problem data from analytic functions.

Parameters
[in]levlevel to initialize on

Definition at line 29 of file REMORA_init.cpp.

Referenced by init_only().

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

◆ init_bathymetry_from_netcdf()

void REMORA::init_bathymetry_from_netcdf ( int  lev)

Bathymetry data initialization from NetCDF file.

Parameters
levInteger specifying the current level

Definition at line 766 of file REMORA_init_from_netcdf.cpp.

Referenced by set_bathymetry().

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

◆ init_bathymetry_full_domain_from_analytic()

void REMORA::init_bathymetry_full_domain_from_analytic ( )

Full domain bathymetry data initialization from analytic.

Definition at line 398 of file REMORA_init.cpp.

Referenced by init_only().

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

◆ init_bathymetry_full_domain_from_netcdf()

void REMORA::init_bathymetry_full_domain_from_netcdf ( )

Full domain high-res bathymetry data initialization from NetCDF file.

Definition at line 1230 of file REMORA_init_from_netcdf.cpp.

Referenced by init_only().

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

◆ init_bcs()

void REMORA::init_bcs ( )
private

Read in boundary parameters from input file and set up data structures.

Definition at line 9 of file REMORA_init_bcs.cpp.

Referenced by InitData().

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

◆ init_bdry_from_netcdf()

void REMORA::init_bdry_from_netcdf ( int  lev)

Boundary data initialization from NetCDF file.

Parameters
levInteger specifying the current level

Definition at line 900 of file REMORA_init_from_netcdf.cpp.

Referenced by init_only(), and MakeNewLevelFromCoarse().

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

◆ init_beta_plane_coriolis()

void REMORA::init_beta_plane_coriolis ( int  lev)

Calculate Coriolis parameters from beta plane parametrization.

Parameters
[in]levlevel to initialize on

Definition at line 137 of file REMORA_init.cpp.

Referenced by set_coriolis().

Here is the caller graph for this function:

◆ init_biology_from_netcdf()

void REMORA::init_biology_from_netcdf ( int  lev)

Biology initialization from NetCDF file.

Initialize the biological tracers from the initial NetCDF file.

Called from init_biology_ic, which chooses between this and the analytic profile on remora.biology_ic_type rather than on remora.ic_type.

Parameters
levInteger specifying the current level

Definition at line 292 of file REMORA_init_from_netcdf.cpp.

Referenced by init_biology_ic().

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

◆ init_biology_full_domain_from_netcdf()

void REMORA::init_biology_full_domain_from_netcdf ( )

Full-domain high-res biology initialization from NetCDF file.

Biology initialization from full-domain NetCDF file.

Definition at line 430 of file REMORA_init_from_netcdf.cpp.

Referenced by init_biology_ic_full_domain().

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

◆ init_biology_ic()

void REMORA::init_biology_ic ( int  lev)

Initialize biology tracers from whichever source remora.biology_ic_type selects. Call after the physical fields exist: the analytic profiles are functions of temperature.

Initialize the biology tracers from whichever source remora.biology_ic_type selects.

Deliberately decoupled from remora.ic_type. A NetCDF initial file supplies only the tracers it happens to contain – the BioToy file has oxygen but no PO4 or ODU – so validating an option set the file does not cover would otherwise mean regenerating binary input that no fresh clone can reproduce. With biology_ic_type = analytic the physical fields still come from NetCDF while biology comes from the problem's analytic profile.

Must be called after the physical fields are initialized: the analytic biology profiles are functions of temperature.

Parameters
[in]levlevel to initialize on

Definition at line 53 of file REMORA_init.cpp.

Referenced by init_only().

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

◆ init_biology_ic_full_domain()

void REMORA::init_biology_ic_full_domain ( )

Full-domain counterpart of init_biology_ic, for the hires_init_level average-down path.

Full-domain counterpart of init_biology_ic, for the hires_init_level path where initial data is specified on a high-resolution level and averaged down.

Fills the biology components of vec_cons_full_domain[hires_init_level]. Must be called after the physical fields on that level are set (the analytic profiles are functions of temperature) and before whatever averages vec_cons_full_domain down.

Definition at line 97 of file REMORA_init.cpp.

Referenced by init_full_domain_from_analytic(), and init_only().

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

◆ init_clim_nudg_coeff()

void REMORA::init_clim_nudg_coeff ( int  lev)

Wrapper to initialize climatology nudging coefficient.

Parameters
[in]levlevel to operate on

Definition at line 305 of file REMORA_init.cpp.

Referenced by init_only(), MakeNewLevelFromCoarse(), and RemakeLevel().

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

◆ init_clim_nudg_coeff_from_netcdf()

void REMORA::init_clim_nudg_coeff_from_netcdf ( int  lev)

Climatology nudging coefficient initialization from NetCDF file.

Parameters
levInteger specifying the current level

Definition at line 1037 of file REMORA_init_from_netcdf.cpp.

Referenced by init_clim_nudg_coeff().

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

◆ init_coriolis_from_netcdf()

void REMORA::init_coriolis_from_netcdf ( int  lev)

Coriolis parameter data initialization from NetCDF file.

Parameters
levInteger specifying the current level

Definition at line 813 of file REMORA_init_from_netcdf.cpp.

Referenced by set_coriolis().

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

◆ init_data_from_netcdf()

void REMORA::init_data_from_netcdf ( int  lev)

Problem initialization from NetCDF file.

Parameters
levInteger specifying the current level

Definition at line 183 of file REMORA_init_from_netcdf.cpp.

Referenced by init_only().

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

◆ init_data_full_domain_from_netcdf()

void REMORA::init_data_full_domain_from_netcdf ( )

High resolution roblem initialization from NetCDF file.

Definition at line 329 of file REMORA_init_from_netcdf.cpp.

Referenced by init_only().

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

◆ init_full_domain_from_analytic()

void REMORA::init_full_domain_from_analytic ( )

Initialize high-resolution initial data, zeta included, from analytic functions.

Evaluate the analytic initial state, free surface, and biology on the full domain at hires_init_level and average them down to level 0.

That level does not exist yet, so its coordinates are built here: x_r and y_r from the cell size (constant grid scale), z_r and z_w from the free surface and the bathymetry. The bathymetry is the hires grid data when hires_grid_level >= hires_init_level, and the analytic bathymetry evaluated at hires_init_level otherwise.

Definition at line 479 of file REMORA_init.cpp.

Referenced by init_only().

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

◆ init_gls_vmix()

void REMORA::init_gls_vmix ( int  lev,
SolverChoice  solver_choice 
)

Initialize GLS variables.

Parameters
[in]levlevel to operate on
[in]solver_choicealgorithmic choices

Definition at line 260 of file REMORA_init.cpp.

Referenced by init_set_vmix().

Here is the caller graph for this function:

◆ init_grid_vars_from_netcdf()

void REMORA::init_grid_vars_from_netcdf ( int  lev)

Grid variable initialization from NetCDF file.

Parameters
levInteger specifying the current level

Definition at line 561 of file REMORA_init_from_netcdf.cpp.

Referenced by set_bathymetry(), and set_grid_scale().

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

◆ init_grid_vars_full_domain_from_netcdf()

void REMORA::init_grid_vars_full_domain_from_netcdf ( )

Full domain high-res grid variable initialization from NetCDF file.

Definition at line 1283 of file REMORA_init_from_netcdf.cpp.

Referenced by init_only().

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

◆ init_masks()

void REMORA::init_masks ( int  lev,
const amrex::BoxArray &  ba,
const amrex::DistributionMapping &  dm 
)
private

Allocate MultiFabs for masks.

Parameters
[in]levlevel to operate on
[in]baBoxArray for the level
[in]dmDistributionMapping for the level

Definition at line 657 of file REMORA_make_new_level.cpp.

Referenced by MakeNewLevelFromCoarse(), MakeNewLevelFromScratch(), and RemakeLevel().

Here is the caller graph for this function:

◆ init_masks_from_netcdf()

void REMORA::init_masks_from_netcdf ( int  lev)

Mask data initialization from NetCDF file.

Parameters
levInteger specifying the current level

Definition at line 848 of file REMORA_init_from_netcdf.cpp.

Referenced by set_masks().

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

◆ init_masks_full_domain_from_analytic()

void REMORA::init_masks_full_domain_from_analytic ( )

Full domain land-sea mask initialization from analytic.

Definition at line 410 of file REMORA_init.cpp.

Referenced by init_only().

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

◆ init_masks_full_domain_from_netcdf()

void REMORA::init_masks_full_domain_from_netcdf ( )

Full domain high-res mask data initialization from NetCDF file.

Definition at line 1256 of file REMORA_init_from_netcdf.cpp.

Referenced by init_only().

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

◆ init_only()

void REMORA::init_only ( int  lev,
amrex::Real  time 
)

Init (NOT restart or regrid)

Parameters
[in]levlevel to operate on
[in]timecurrent time for initialization

Definition at line 2064 of file REMORA.cpp.

Referenced by MakeNewLevelFromScratch().

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

◆ init_ref_ratios()

void REMORA::init_ref_ratios ( )
private

Reject vertical refinement and accumulate the refinement ratios.

Reject refinement in the vertical, and accumulate the refinement ratios.

Shared by both constructors, so both fill cum_ref_ratios, which the full-domain hires arrays and the mask coarsening index into.

Definition at line 217 of file REMORA.cpp.

Referenced by REMORA(), and REMORA().

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

◆ init_riv_pos_from_netcdf()

void REMORA::init_riv_pos_from_netcdf ( int  lev)
Parameters
[in]levlevel to read in river data

Definition at line 1121 of file REMORA_init_from_netcdf.cpp.

Referenced by init_only(), MakeNewLevelFromCoarse(), and RemakeLevel().

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

◆ init_scalar_metadata()

void REMORA::init_scalar_metadata ( )
private

Build runtime scalar names after nscalar is known.

Definition at line 246 of file REMORA.cpp.

Referenced by ReadParameters().

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

◆ init_scalars_from_netcdf()

void REMORA::init_scalars_from_netcdf ( int  lev)

Passive (dye) scalar initialization from NetCDF file. Called from init_data_from_netcdf: dye follows remora.ic_type rather than having a source flag of its own.

Initialize the passive (dye) scalars from the initial NetCDF file.

Unlike biology, dye has no initialization-source flag of its own: it follows remora.ic_type along with temperature, salinity, and velocity, so this is called from init_data_from_netcdf rather than from a dispatcher. Each dye whose variable the file carries is read into its own component; the rest keep the zero written just before the call.

Parameters
levInteger specifying the current level

Definition at line 246 of file REMORA_init_from_netcdf.cpp.

Referenced by init_data_from_netcdf().

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

◆ init_scalars_full_domain_from_netcdf()

void REMORA::init_scalars_full_domain_from_netcdf ( )

Full-domain high-res passive (dye) scalar initialization from NetCDF file.

Full-domain counterpart of init_scalars_from_netcdf, for the hires_init_level average-down path. Called from init_data_full_domain_from_netcdf before that routine averages vec_cons_full_domain down, so no average down is needed here.

Definition at line 393 of file REMORA_init_from_netcdf.cpp.

Referenced by init_data_full_domain_from_netcdf().

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

◆ init_set_vmix()

void REMORA::init_set_vmix ( int  lev)

Initialize vertical mixing coefficients from file or analytic.

Definition at line 1034 of file REMORA.cpp.

Referenced by init_only(), MakeNewLevelFromCoarse(), and RemakeLevel().

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

◆ init_stretch_coeffs()

void REMORA::init_stretch_coeffs ( )

initialize and calculate stretch coefficients

Definition at line 335 of file REMORA_init.cpp.

Referenced by InitData().

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

◆ init_stuff()

void REMORA::init_stuff ( int  lev,
const amrex::BoxArray &  ba,
const amrex::DistributionMapping &  dm 
)
private

Allocate MultiFabs for state and evolution variables.

Parameters
[in]levlevel to operate on
[in]baBoxArray for the level
[in]dmDistributionMapping for the level

Definition at line 685 of file REMORA_make_new_level.cpp.

Referenced by MakeNewLevelFromCoarse(), MakeNewLevelFromScratch(), and RemakeLevel().

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

◆ init_zeta_from_netcdf()

void REMORA::init_zeta_from_netcdf ( int  lev)

Sea-surface height data initialization from NetCDF file.

Parameters
levInteger specifying the current level

Definition at line 471 of file REMORA_init_from_netcdf.cpp.

Referenced by set_zeta().

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

◆ init_zeta_full_domain_from_netcdf()

void REMORA::init_zeta_full_domain_from_netcdf ( )

Full-domain high res sea-surface height data initialization from NetCDF file.

Definition at line 517 of file REMORA_init_from_netcdf.cpp.

Referenced by init_only().

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

◆ InitData()

void REMORA::InitData ( )

Initialize multilevel data.

This is called from main.cpp and handles all initialization, whether from start or restart

Definition at line 464 of file REMORA.cpp.

Referenced by main().

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

◆ InitializeFromFile()

void REMORA::InitializeFromFile ( )
private

Read the file passed to remora.restart and use it as an initial condition for the current simulation.

◆ InitializeLevelFromData()

void REMORA::InitializeLevelFromData ( int  lev,
const amrex::MultiFab &  initial_data 
)
private

Initialize the new-time data at a level from the initial_data MultiFab.

◆ initializeTracers()

void REMORA::initializeTracers ( amrex::ParGDBBase *  ,
const amrex::Vector< std::unique_ptr< amrex::MultiFab > > &   
)
private

Initialize tracer and hydro particles.

Initialize tracer and hydro particles

Definition at line 31 of file REMORA_Tracers.cpp.

Referenced by MakeNewLevelFromScratch().

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

◆ inject_mask_outside_domain()

void REMORA::inject_mask_outside_domain ( int  lev)

Give lev's rho-mask ghost cells beyond the domain the coarser level's values.

Overwrite lev's rho-mask ghost cells beyond the domain edge with the coarser level's mask there, injected piecewise-constant.

FillCoarsePatchPC fills those cells with foextrap, which copies the interior outward, even across a periodic edge. At a river mouth on a wall that turns the land behind the river wet, and the clamped boundary's salt then mixes into the river cell; at a periodic edge it ignores whatever lies across the seam. Level 0 takes these cells from its grid file, or from a periodic FillBoundary, so the coarser level's ghost cells hold the right mask.

Parameters
[in]levlevel to operate on, > 0

Definition at line 1135 of file REMORA.cpp.

Referenced by set_masks().

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

◆ interp_grid_coords_from_coarse()

void REMORA::interp_grid_coords_from_coarse ( int  lev,
amrex::MultiFab &  fine,
const amrex::MultiFab &  crse 
)

Fill a refined level's coordinate array (lon, lat, angle) from the coarser level, including the ghost cells outside the domain.

Fill a refined level's coordinate array from the coarser level, ghost cells included.

FillCoarsePatch would finish with the physical boundary condition pm and pn want, which copies the edge value into every ghost cell outside the domain and averages the corners; for a coordinate that puts those cells on top of the edge rather than where they are. Here the ghost cells outside the domain are interpolated like the rest, from the coarse level's own ghost cells, which hold the coordinates continued past the edge (extrapolate_metric_to_physical_boundaries with linear on level 0, and this function on the levels between). The coarse level has NGROW+1 ghost cells, enough for the stencil at any refinement ratio from 2 up. The interpolation is conservative-linear, which reproduces a linear field exactly.

The coarse data is copied without periodicity. Across a periodic edge, FillBoundary has already put the wrapped values in the coarse ghost cells, but a ghost cell that also lies beyond a wall (a corner where the seam meets a non-periodic face) keeps the value continued from the file's ring, while its periodic image keeps the other side's. A periodic copy would give that cell both as sources, and which one wins is not defined: on a GPU it varies from run to run (#775). Copied without periodicity, each cell comes from the coarse level's own ghost cell. The fine level's ghost cells across a periodic edge are then refilled from its valid cells, wrapped as on level 0.

Parameters
[in]levthe refined level
[in,out]fineits coordinate array
[in]crsethe coarser level's

Definition at line 1118 of file REMORA_make_new_level.cpp.

Referenced by set_grid_scale().

Here is the caller graph for this function:

◆ is_it_time_for_action()

bool REMORA::is_it_time_for_action ( int  nstep,
amrex::Real  time,
amrex::Real  dt,
int  action_interval,
amrex::Real  action_per 
)

Decide if it is time to take an action.

Parameters
[in]nstepwhat step we're on
[in]levlevel to calculate on
[in]dtlevtime step for this level
[in]action_intervalnumber of time steps between actions
[in]action_pertime interval between actions

Definition at line 285 of file REMORA_SumIQ.cpp.

Referenced by InitData(), and post_timestep().

Here is the caller graph for this function:

◆ level0_fields()

Vector< MultiFab * > REMORA::level0_fields ( bool  all)

The level-0 fields: the evolving ones, and with all the static ones too.

The level-0 fields: those the time step evolves or rebuilds from them, and, with all, the grid, metrics, bathymetry, masks, forcing and coefficients as well.

Definition at line 487 of file REMORA_land_layout.cpp.

Referenced by poison_dry_ghost_cells(), and zero_level0_dry_ghost_cells().

Here is the caller graph for this function:

◆ level0_has_holes()

bool REMORA::level0_has_holes ( ) const

Whether level 0's BoxArray leaves part of the domain out.

Whether a level's BoxArray leaves part of its domain out, as remora.drop_dry_boxes does to level 0. Only meaningful for level 0, whose boxes are disjoint and should cover the domain.

Definition at line 406 of file REMORA_land_layout.cpp.

Referenced by check_dry_box_nesting(), ConfigureDriverAtmosToOceanCoupling(), GetAtmosToOceanRhoLayout(), GetAtmosToOceanUFaceLayout(), GetAtmosToOceanVFaceLayout(), poison_dry_ghost_cells(), set_dry_ghost_cells(), WriteNCPlotFile_which(), and zero_level0_dry_ghost_cells().

Here is the caller graph for this function:

◆ level0_refine_footprint()

BoxList REMORA::level0_refine_footprint ( bool &  unbounded) const

Level-0 index region a finer level may need; unbounded if it can go anywhere.

The level-0 cells whose boxes a finer level needs kept: every refinement indicator's region, in level-0 index space, as AMReX's grid generation sees it. AMReX buffers the tagged cells by amr.n_error_buf, rounds them to blocks of amr.blocking_factor (of level 1) over the refinement ratio, and clears every tag within amr.n_proper such blocks of a cell no level-0 box covers. So a dropped box that close to an indicator would clip the fine grids the full-domain run makes. The region is therefore the indicator's cells plus the buffer, rounded out to whole blocks, grown by n_proper + 1 blocks, and then by the coarse stencil of the coarse-fine fills and the flux register. A box touching it is never dropped, so the fine grids, and the coarse data under and around them, are those of the full-domain run. Level 1 only: drop_dry_level0_boxes drops nothing when amr.max_level > 1, since a level-2 indicator grows level 1 by its own buffer and proper nesting, which this does not follow.

Parameters
[out]unboundedtrue when an indicator has no region, so a finer level may go anywhere

Definition at line 246 of file REMORA_land_layout.cpp.

Referenced by drop_dry_level0_boxes().

Here is the caller graph for this function:

◆ lin_eos()

void REMORA::lin_eos ( const amrex::Box &  bx,
const amrex::Array4< amrex::Real const > &  state,
const amrex::Array4< amrex::Real > &  rho,
const amrex::Array4< amrex::Real > &  rhoA,
const amrex::Array4< amrex::Real > &  rhoS,
const amrex::Array4< amrex::Real > &  bvf,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  z_w,
const amrex::Array4< amrex::Real const > &  z_r,
const amrex::Array4< amrex::Real const > &  h,
const amrex::Array4< amrex::Real const > &  mskr,
const int  N 
)

Calculate density and related quantities from linear equation of state.

Parameters
[in]bxbox for calculation
[in]statestate holds temp, salt
[out]rhodensity
[out]rhoAvertically-averaged density
[out]rhoSdensity perturbation
[out]bvfBrunt-Vaisala frequency
[in]Hzvertical cell height
[in]z_rz coordinates at rho points
[in]z_wz coordinates at w points
[in]hbathymetry
[in]mskrland-sea mask on rho points
[in]Nnumber of vertical levels

Definition at line 61 of file REMORA_rho_eos.cpp.

Referenced by rho_eos().

Here is the caller graph for this function:

◆ load_balance_name()

std::string REMORA::load_balance_name ( ) const

The remora.load_balance spelling of the current strategy.

Returns
the remora.load_balance spelling of the current strategy

Definition at line 219 of file REMORA_land_layout.cpp.

Referenced by MakeDistributionMap(), and ReadParameters().

Here is the caller graph for this function:

◆ MakeDistributionMap()

DistributionMapping REMORA::MakeDistributionMap ( int  lev,
amrex::BoxArray const &  ba 
)
overridevirtual

Distribution mapping for a new BoxArray on level lev, by remora.load_balance: each box weighs its wet cells plus remora.load_balance_land_weight times its land cells (overrides AmrMesh)

The distribution mapping of a new BoxArray on level lev (overrides AmrMesh). Called by AMReX for every new layout – initialization, regrid, a level made from coarse – and by the checkpoint reader. remora.load_balance picks the strategy; each box weighs its wet cells plus remora.load_balance_land_weight times its land cells. Where every box weighs its cell count (no land, or a land weight of one) the SFC strategy is AMReX's own mapping, exactly as remora.load_balance = amrex gives it. Ownership never changes the answer.

Parameters
[in]levlevel of the BoxArray
[in]bathe BoxArray to distribute

Definition at line 143 of file REMORA_land_layout.cpp.

Referenced by MakeNewLevelFromScratch(), and ReadCheckpointFile().

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

◆ MakeNewLevelFromCoarse()

void REMORA::MakeNewLevelFromCoarse ( int  lev,
amrex::Real  time,
const amrex::BoxArray &  ba,
const amrex::DistributionMapping &  dm 
)
overridevirtual

Make a new level using provided BoxArray and DistributionMapping and fill with interpolated coarse level data. Overrides the pure virtual function in AmrCore.

Make a new level using provided BoxArray and DistributionMapping and fill with interpolated coarse level data (overrides the pure virtual function in AmrCore) regrid --> RemakeLevel (if level already existed) regrid --> MakeNewLevelFromCoarse (if adding new level)

Parameters
[in]levlevel to make
[in]timecurrent time
[in]baBoxArray for the level
[in]dmDistributionMapping for the level

Definition at line 81 of file REMORA_make_new_level.cpp.

Here is the call graph for this function:

◆ MakeNewLevelFromScratch()

void REMORA::MakeNewLevelFromScratch ( int  lev,
amrex::Real  time,
const amrex::BoxArray &  ba,
const amrex::DistributionMapping &  dm 
)
overridevirtual

Make a new level from scratch using provided BoxArray and DistributionMapping. Only used during initialization. Overrides the pure virtual function in AmrCore.

Make a new level from scratch using provided BoxArray and DistributionMapping. This is called both for initialization and for restart (overrides the pure virtual function in AmrCore) main.cpp --> REMORA::InitData --> InitFromScratch --> MakeNewGrids --> MakeNewLevelFromScratch restart --> MakeNewGrids --> MakeNewLevelFromScratch

Parameters
[in]levlevel to make
[in]timecurrent time
[in]baBoxArray for the level
[in]dmDistributionMapping for the level

Definition at line 414 of file REMORA_make_new_level.cpp.

Referenced by ReadCheckpointFile().

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

◆ mask_arrays_for_write()

void REMORA::mask_arrays_for_write ( int  lev,
amrex::Real  fill_value,
amrex::Real  fill_where 
)

Mask data arrays before writing output.

Parameters
levlevel to mask
fill_valuefill value to mask with
fill_wherevalue at cells where we will apply the mask. This is necessary because rivers

Definition at line 1371 of file REMORA_Plotfile.cpp.

Referenced by WritePlotFile().

Here is the caller graph for this function:

◆ model_time()

double REMORA::model_time ( amrex::Real  elapsed) const
inlinenoexcept

Time on the model clock, in seconds, of an elapsed time such as t_new.

Definition at line 2427 of file REMORA.H.

Referenced by advance_2d(), advance_3d(), advance_biology(), ErrorEst(), fill_from_bdyfiles(), history_restart_record(), prestep(), set_smflux(), set_surface_state(), setup_step(), WriteCheckpointFile(), WriteNCPlotFile_which(), and WritePlotFile().

Here is the caller graph for this function:

◆ netcdf_plot_path()

std::string REMORA::netcdf_plot_path ( int  which_step,
int  lev 
) const
private

NetCDF file a level's output goes to at this output step.

The NetCDF file a level's output goes to at this output step.

Parameters
which_stepstep being written, naming the file when each output step gets its own
levlevel being written
Returns
path of the file

Definition at line 305 of file REMORA_NCPlotFile.cpp.

Referenced by WriteNCPlotFile().

Here is the caller graph for this function:

◆ netcdf_subdomain()

Box REMORA::netcdf_subdomain ( int  lev) const

Region of a level that its NetCDF output covers.

The region of a level that its NetCDF output covers: the whole domain at that level's resolution, so a refined level's file has one shape however the level was made and wherever regridding moves it. Cells the level's grids don't cover hold the fill value.

Parameters
levlevel being written
Returns
the region the NetCDF file covers

Definition at line 1454 of file REMORA_Plotfile.cpp.

Referenced by compute_omega_and_w(), history_restart_record(), netcdf_subdomain_has_gaps(), and WriteNCPlotFile_which().

Here is the caller graph for this function:

◆ netcdf_subdomain_has_gaps()

bool REMORA::netcdf_subdomain_has_gaps ( int  lev) const

Whether a level's grids leave cells of its NetCDF region uncovered.

Whether a level's grids leave cells of its NetCDF region uncovered, as any refined level that doesn't span the domain does. Those cells are written as the fill value.

Parameters
levlevel being written
Returns
whether the grids miss any cell of netcdf_subdomain(lev)

Definition at line 1467 of file REMORA_Plotfile.cpp.

Referenced by WriteNCPlotFile_which().

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

◆ nonlin_eos()

void REMORA::nonlin_eos ( const amrex::Box &  bx,
const amrex::Array4< amrex::Real const > &  state,
const amrex::Array4< amrex::Real > &  rho,
const amrex::Array4< amrex::Real > &  rhoA,
const amrex::Array4< amrex::Real > &  rhoS,
const amrex::Array4< amrex::Real > &  bvf,
const amrex::Array4< amrex::Real > &  alpha,
const amrex::Array4< amrex::Real > &  beta,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  z_w,
const amrex::Array4< amrex::Real const > &  z_r,
const amrex::Array4< amrex::Real const > &  h,
const amrex::Array4< amrex::Real const > &  mskr,
const int  N 
)

Calculate density and related quantities from nonlinear equation of state.

Parameters
[in]bxbox for calculation
[in]statestate holds temp, salt
[out]rhodensity
[out]rhoAvertically-averaged density
[out]rhoSdensity perturbation
[out]bvfBrunt-Vaisala frequency
[out]alphathermal expansion coefficient
[out]betasaline contraction coefficient
[in]Hzvertical cell height
[in]z_rz coordinates at rho points
[in]z_wz coordinates at w points
[in]hbathymetry
[in]mskrland-sea mask on rho points
[in]Nnumber of vertical levels

Definition at line 158 of file REMORA_rho_eos.cpp.

Referenced by rho_eos().

Here is the caller graph for this function:

◆ num_bc_vars()

int REMORA::num_bc_vars ( ) const
inlinenoexcept

Definition at line 1668 of file REMORA.H.

Referenced by init_bcs().

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

◆ num_bdy_vars()

int REMORA::num_bdy_vars ( ) const
inlinenoexcept

Definition at line 1676 of file REMORA.H.

Referenced by init_bcs(), init_bdry_from_netcdf(), and resize_stuff().

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

◆ num_bio()

int REMORA::num_bio ( ) const
inlinenoexcept

Number of biology tracers carried in the state.

Definition at line 2443 of file REMORA.H.

◆ num_passive_scalars()

int REMORA::num_passive_scalars ( ) const
inlinenoexcept

Number of passive (dye) scalars in the state, not counting biology tracers.

Zero means the state has no dye component at all, so Tracer_comp is either the first biology tracer or one past the end of cons. Problem setups that initialize a dye have to test this rather than nComp(), which cannot tell a dye apart from a biology tracer.

Definition at line 1685 of file REMORA.H.

◆ num_scalar()

int REMORA::num_scalar ( ) const
inlinenoexcept

Number of passive (dye) scalars carried in the state.

Definition at line 2445 of file REMORA.H.

◆ NumDataLogs()

AMREX_FORCE_INLINE int REMORA::NumDataLogs ( )
inlineprivatenoexcept

Definition at line 2366 of file REMORA.H.

Referenced by sum_integrated_quantities().

Here is the caller graph for this function:

◆ PackSurfaceState()

void REMORA::PackSurfaceState ( amrex::Vector< amrex::MultiFab * > &  state,
amrex::Real  time,
const amrex::MultiFab *  weight_o2a_mf,
const amrex::iMultiFab *  index_o2a_mf,
int  max_stencil_size,
const amrex::iMultiFab *  dst_land_mask = nullptr 
)

Extracts SST from the 3D conservative state for the atmospheric driver.

Reads Temp_comp at the top water-column cell (k_sfc), converts from Celsius to Kelvin, and copies the result into state[SSTIndex].

Parameters
[in,out]stateOCN2ATM slab buffer sized by the driver (one MultiFab per ocean-to-atmosphere export layer). state[SSTIndex] (index 0) is overwritten with sea-surface temperature (SST) sampled from the Temp_comp tracer at the uppermost sigma level (k = Nz) and converted from degrees Celsius to Kelvin for the atmospheric driver. An empty vector or null state[0] is treated as a no-op.
[in]timeCurrent ocean model time (unused; retained for driver interface conformance).

Definition at line 500 of file REMORA_Coupling.cpp.

◆ plot_node_coords()

void REMORA::plot_node_coords ( amrex::Vector< amrex::MultiFab > &  mf_xy)

Physical (x, y) of the psi points on every level, for plotfile output.

Physical (x, y) of the psi points (cell corners) on every level, for the horizontal part of the plotfile's nodal displacement and for particle positions. Level 0 takes the grid's own x_psi and y_psi. Each finer level is interpolated bilinearly from the level below, so that a fine node that coincides with a coarse node gets the coarse node's position: a fine level's own x_psi is rebuilt from its pm and pn, which on a stretched grid does not match its parent's, and on a NetCDF grid does not carry the file's origin.

Parameters
[out]mf_xyper level, a 2-component nodal 2D MultiFab: x, then y

Definition at line 1202 of file REMORA_Plotfile.cpp.

Referenced by WritePlotFile().

Here is the caller graph for this function:

◆ PlotFileName()

std::string REMORA::PlotFileName ( int  lev) const
private

get plotfile name

◆ poison_dry_ghost_cells()

void REMORA::poison_dry_ghost_cells ( )

remora.dry_ghost_test: overwrite the ghost cells of kept level-0 boxes that lie in dropped boxes (1: signalling NaN, 2: a large finite value) after initialization

remora.dry_ghost_test (debug). After initialization, overwrite the ghost cells of the kept level-0 boxes that lie in dropped boxes, in every evolving field (remora.dry_ghost_fields = dynamic) or every field (all): 1 writes a signalling NaN, which with amrex.fpe_trap_invalid = 1 stops the run at the first arithmetic read of one; 2 writes remora.dry_ghost_value (default 1e30), so a plotted field that still matches the full-domain run does not depend on those cells while they hold that finite value.

Definition at line 623 of file REMORA_land_layout.cpp.

Referenced by InitData().

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

◆ post_timestep()

void REMORA::post_timestep ( int  nstep,
amrex::Real  time,
amrex::Real  dt_lev 
)

Called after every level 0 timestep.

Parameters
[in]nstepwhich step we're on
[in]timecurrent time
[in]dt_lev0time step on level 0

Definition at line 439 of file REMORA.cpp.

Referenced by Evolve(), and EvolveOneStep().

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

◆ prestep()

void REMORA::prestep ( int  lev,
amrex::MultiFab &  mf_uold,
amrex::MultiFab &  mf_vold,
amrex::MultiFab &  mf_u,
amrex::MultiFab &  mf_v,
amrex::MultiFab *  mf_ru,
amrex::MultiFab *  mf_rv,
amrex::MultiFab &  S_old,
amrex::MultiFab &  S_new,
amrex::MultiFab &  mf_W,
amrex::MultiFab &  mf_DC,
const amrex::MultiFab *  mf_z_r,
const amrex::MultiFab *  mf_z_w,
const amrex::MultiFab *  mf_h,
const amrex::MultiFab *  mf_pm,
const amrex::MultiFab *  mf_pn,
const amrex::MultiFab *  mf_sustr,
const amrex::MultiFab *  mf_svstr,
const amrex::MultiFab *  mf_bustr,
const amrex::MultiFab *  mf_bvstr,
const amrex::MultiFab *  mf_msku,
const amrex::MultiFab *  mf_mskv,
const int  iic,
const int  nfirst,
const int  nnew,
int  nstp,
int  nrhs,
int  N,
const amrex::Real  dt_lev 
)

Wrapper function for prestep.

Parameters
[in]levlevel to operate on
[in]mf_uoldu-velocity from last time step
[in]mf_voldv-velocity from last time step
[out]mf_uu-velocity at current time step
[out]mf_vv-velocity at current time step
[in,out]mf_ruu-velocity RHS at current time step
[in,out]mf_rvv-velocity RHS at current time step
[in]S_oldscalar variables at last time step
[in,out]S_newscalar variables at current time step
[in]mf_Wvertical velocity
mf_DCtemporary variable container
[in]mf_z_rz coordinates at rho points (cell centers)
[in]mf_z_wz coordinates at w points
[in]mf_hbathymetry
[in]mf_pm1/dx
[in]mf_pn1/dy
[in]mf_sustru-direction surface momentum flux
[in]mf_svstrv-direction surface momentum flux
[in]mf_bustru-direction bottom stress
[in]mf_bvstrv-direction bottom stress
[in]mf_mskuland-sea mask on u-points
[in]mf_mskvland-sea mask on v-points
[in]iicwhich time step we're on
[in]ntfirstwhat is the first time step?
[in]nnewindex of time step to update
[in]nstpindex of last time step
[in]nrhsindex of RHS component
[in]Nnumber of vertical levels
[in]dt_levtime step at this level

Definition at line 38 of file REMORA_prestep.cpp.

Referenced by setup_step().

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

◆ prestep_diffusion()

void REMORA::prestep_diffusion ( const amrex::Box &  bx,
const amrex::Box &  gbx,
const int  ioff,
const int  joff,
const amrex::Array4< amrex::Real > &  vel,
const amrex::Array4< amrex::Real const > &  vel_old,
const amrex::Array4< amrex::Real > &  rvel,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  Akv,
const amrex::Array4< amrex::Real > &  FC,
const amrex::Array4< amrex::Real const > &  sstr,
const amrex::Array4< amrex::Real const > &  bstr,
const amrex::Array4< amrex::Real const > &  z_r,
const amrex::Array4< amrex::Real const > &  pm,
const amrex::Array4< amrex::Real const > &  pn,
const int  iic,
const int  ntfirst,
const int  nnew,
int  nstp,
int  nrhs,
int  N,
const amrex::Real  lambda,
const amrex::Real  dt_lev 
)

Update velocities or tracers with diffusion/viscosity as the last part of the prestep.

Called from prestep. The tracer update is a bit different from the u,v updates so we test for it, but checking if ioff=0 and joff=0. In some cases, though, we can recover the tracer update from the generic one by setting those indices. Setting icc and ntfirst identically for the tracers should be equivalent to setting ioff=0 and joff=0

Parameters
[in]vel_bxtile box
[in]gbxgrown tile box
[in]ioffoffset in x direction
[in]joffoffset in y direction
[out]velvelocity or scalar to update
[in]vel_oldvelocity or scalar at last time
[in,out]rvelvelocity or scalar RHS
[in]Hzvertical cell height
[in]Akvvertical viscosity coefficient
FCtemporary
[in]sstrsurface flux
[in]bstrbottom flux
[in]z_rz coordinates at rho points
[in]pm1/dx
[in]pn1/dy
[in]iicwhich time step we're on
[in]ntfirstwhat is the first time step?
[in]nnewindex of time step to update
[in]nstpindex of last time step
[in]nrhsindex of RHS component
[in]Nnumber of vertical levels
[in]lambdaweighting coefficient for the newest (implicit) time step derivatives
[in]dt_levtime step at this level

Definition at line 38 of file REMORA_prestep_diffusion.cpp.

Referenced by prestep().

Here is the caller graph for this function:

◆ prestep_t_advection()

void REMORA::prestep_t_advection ( int  lev,
const amrex::Box &  tbx,
const amrex::Box &  gbx,
const amrex::Array4< amrex::Real > &  tempold,
const amrex::Array4< amrex::Real > &  tempcache,
const amrex::Array4< amrex::Real > &  Hz,
const amrex::Array4< amrex::Real > &  Huon,
const amrex::Array4< amrex::Real > &  Hvom,
const amrex::Array4< amrex::Real > &  W,
const amrex::Array4< amrex::Real > &  DC,
const amrex::Array4< amrex::Real > &  FC,
const amrex::Array4< amrex::Real > &  sstore,
const amrex::Array4< amrex::Real const > &  z_w,
const amrex::Array4< amrex::Real const > &  h,
const amrex::Array4< amrex::Real const > &  pm,
const amrex::Array4< amrex::Real const > &  pn,
const amrex::Array4< amrex::Real const > &  msku,
const amrex::Array4< amrex::Real const > &  mskv,
const amrex::Array4< int const > &  river_pos,
const amrex::Array4< amrex::Real const > &  river_source,
int  iic,
int  ntfirst,
int  nrhs,
int  N,
const amrex::Real  dt_lev 
)

Prestep advection calculations for the tracers.

Parameters
[in]levlevel to operate on
[in]tbxtile box
[in]gbxgrown tile box
[in]tempoldscalar at last time
[in]tempcachecached current time step's scalar value
[in]Hzvertical cell height
[in]Huonu-volume flux
[in]Hvomv-volume flux
[in]Akvvertical viscosity coefficient
[in,out]Wvertical velocity
DCtemporary
FCtemporary
[out]tempstorescratch space for calculations on scalars
[in]z_wz coordinates at w points
[in]hbathymetry
[in]pm1/dx
[in]pn1/dy
[in]mskuland-sea mask on u-points
[in]mskvland-sea mask on v-points
[in]river_posriver positions
[in]river_sourceriver source data to add, if using
[in]iicwhich time step we're on
[in]ntfirstwhat is the first time step?
[in]nrhsindex of RHS component
[in]Nnumber of vertical levels
[in]dt_levtime step at this level

Definition at line 35 of file REMORA_prestep_t_advection.cpp.

Referenced by prestep().

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

◆ print_banner()

void REMORA::print_banner ( MPI_Comm  comm,
std::ostream &  out 
)
static

Definition at line 60 of file REMORA_console_io.cpp.

Referenced by main().

Here is the caller graph for this function:

◆ print_error()

void REMORA::print_error ( MPI_Comm  comm,
const std::string &  msg 
)
static

Definition at line 43 of file REMORA_console_io.cpp.

Referenced by main().

Here is the caller graph for this function:

◆ print_summary()

static void REMORA::print_summary ( std::ostream &  )
static

◆ print_timestep_hierarchy()

void REMORA::print_timestep_hierarchy ( ) const
private

report the per-level slow/fast timestep hierarchy; call after ComputeDt

Report the per-level timestep hierarchy: nsubsteps[lev] baroclinic steps per parent step, each subdivided ndtfast times. Must follow ComputeDt, since dt is seeded to bogus_large_value.

Definition at line 15 of file REMORA_ComputeTimestep.cpp.

Referenced by Evolve().

Here is the caller graph for this function:

◆ print_tpls()

void REMORA::print_tpls ( std::ostream &  out)
static

Definition at line 137 of file REMORA_console_io.cpp.

◆ print_usage()

void REMORA::print_usage ( MPI_Comm  comm,
std::ostream &  out 
)
static

Definition at line 26 of file REMORA_console_io.cpp.

Referenced by main().

Here is the caller graph for this function:

◆ prob_coords()

ProbCoords REMORA::prob_coords ( int  lev) const
private

Coordinate arrays of level lev, for the prob functions.

Parameters
[in]levlevel whose coordinates to return

Definition at line 15 of file REMORA_init.cpp.

Referenced by init_analytic(), and set_zeta().

Here is the caller graph for this function:

◆ probe_rho_mask()

bool REMORA::probe_rho_mask ( int  lev,
amrex::MultiFab &  mskr 
)

The rho-point mask a level lev on mskr's layout would get, before that level exists; false if it cannot be known yet.

Fill mskr, a rho-point mask on any layout of level lev, with the mask set_masks would give a level on that layout, before such a level exists. On level 0 every ghost cell the level's own mask carries is set, as set_masks sets it; on a finer level only the valid cells are, from the parent's mask (piecewise constant, as set_masks injects it), which is all a weight needs.

Parameters
[in]levlevel the layout belongs to
[in,out]mskrmask to fill, on 2D slab boxes, initially anything
Returns
false when the mask cannot be known before the level is made: level 0 with remora.hires_grid_level >= 0 at initialization, whose mask is coarsened from full-domain data that init_only builds

Definition at line 47 of file REMORA_land_layout.cpp.

Referenced by check_dropped_level0_mask(), drop_dry_level0_boxes(), and wet_cells_per_box().

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

◆ prsgrd()

void REMORA::prsgrd ( const amrex::Box &  bx,
const amrex::Box &  gbx,
const amrex::Box &  utbx,
const amrex::Box &  vtbx,
const amrex::Array4< amrex::Real > &  ru,
const amrex::Array4< amrex::Real > &  rv,
const amrex::Array4< amrex::Real const > &  on_u,
const amrex::Array4< amrex::Real const > &  om_v,
const amrex::Array4< amrex::Real const > &  rho,
const amrex::Array4< amrex::Real > &  FC,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  z_r,
const amrex::Array4< amrex::Real const > &  z_w,
const amrex::Array4< amrex::Real const > &  msku,
const amrex::Array4< amrex::Real const > &  mskv,
const int  nrhs,
const int  N 
)

Calculate pressure gradient.

Parameters
[in]phi_bxtilebox
[in]phi_gbxgrownbox
[in]utbxu-nodal tilebox
[in]vtbxv-nodal tilebox
[out]ruu-velocity RHS
[out]rvv-velocity RHS
[in]om_vom_v metric at v points
[in]on_uon_u metric at u points
[in]rhodensity
FCtemporary
[in]Hzvertical cell height
[in]z_rz coordinates at rho points
[in]z_wz coordinates at w points
[in]mskuland-sea mask on u-points
[in]mskvland-sea mask on v-points
[in]nrhsindex of RHS component
[in]Nnumber of vertical levels

Definition at line 25 of file REMORA_prsgrd.cpp.

Referenced by setup_step().

Here is the caller graph for this function:

◆ ReadCheckpointFile()

void REMORA::ReadCheckpointFile ( )
private

read checkpoint file from disk

Definition at line 254 of file REMORA_Checkpoint.cpp.

Referenced by restart().

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

◆ ReadNCMultiFab()

void REMORA::ReadNCMultiFab ( amrex::FabArray< amrex::FArrayBox > &  fab,
const std::string &  name,
int  coordinatorProc = amrex::ParallelDescriptor::IOProcessorNumber(),
int  allow_empty_mf = 0 
)
private

Read MultiFab in NetCDF format.

◆ ReadParameters()

void REMORA::ReadParameters ( )
private

read in some parameters from inputs file

Definition at line 2492 of file REMORA.cpp.

Referenced by REMORA(), and REMORA().

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

◆ readTracersParams()

void REMORA::readTracersParams ( )
private

Read tracer and hydro particles parameters.

Read tracer and hydro particles parameters

Definition at line 10 of file REMORA_Tracers.cpp.

Referenced by ReadParameters().

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

◆ refine_masks_with_grow_cells()

void REMORA::refine_masks_with_grow_cells ( int  fine_lev)

Inject the full-domain rho-mask from fine_lev-1 onto fine_lev, piecewise constant, grow cells included.

Inject the full-domain rho-mask from fine_lev-1 up onto fine_lev, grow cells included.

Piecewise constant, which is the rule set_masks already uses for a level above the one the mask was specified on. Nothing finer is known there, so refining cannot add coastline.

Parameters
[in]fine_levlevel to inject onto

Definition at line 3572 of file REMORA.cpp.

Referenced by ensure_full_domain_masks().

Here is the caller graph for this function:

◆ refinement_criteria_setup()

void REMORA::refinement_criteria_setup ( )
private

Set refinement criteria.

Function to define the refinement criteria based on user input

Definition at line 493 of file REMORA_Tagging.cpp.

Referenced by REMORA(), and REMORA().

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

◆ reflux_to()

void REMORA::reflux_to ( int  lev)

apply the lev/lev+1 tracer flux correction onto lev

Apply the tracer flux correction accumulated at the lev/lev+1 interface onto lev.

Once per step of lev, pairing the reset at the top of Advance(lev), so the accumulate and apply window sits inside one step of lev. Applying it per step of level 0 instead would keep only the last correction whenever lev was itself substepped, and would let the regrid of lev+1 rebuild the register mid-accumulation.

Parameters
[in]levcoarse level of the interface

Definition at line 389 of file REMORA.cpp.

Referenced by timeStep().

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

◆ register_coarse_data()

void REMORA::register_coarse_data ( int  lev,
amrex::Real  time,
amrex::Real  dt_lev 
)

register this level's completed step as the coarse bracket the next finer level interpolates within

Store this level's old and new state in the coarse/fine fill patchers so the next finer level can interpolate its contact points to its own sub-times.

Parameters
[in]levlevel of refinement
[in]timesimulation time at start of the step just taken
[in]dt_levbaroclinic time step at level

Definition at line 94 of file REMORA_Advance.cpp.

Referenced by Advance().

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

◆ regrid()

void REMORA::regrid ( int  lbase,
amrex::Real  time,
bool  initial = false 
)
overridevirtual

Regrid (overrides AmrCore), then check that level 1 stays clear of dropped level-0 boxes.

Regrid (overrides AmrCore), then make sure level 1 has not grown into a dropped level-0 box.

Definition at line 441 of file REMORA_land_layout.cpp.

Referenced by timeStep(), and timeStepML().

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

◆ RemakeLevel()

void REMORA::RemakeLevel ( int  lev,
amrex::Real  time,
const amrex::BoxArray &  ba,
const amrex::DistributionMapping &  dm 
)
overridevirtual

Remake an existing level using provided BoxArray and DistributionMapping and fill with existing fine and coarse data. Overrides the pure virtual function in AmrCore.

Remake an existing level using provided BoxArray and DistributionMapping and fill with existing fine and coarse data. overrides the pure virtual function in AmrCore

Parameters
[in]levlevel to make
[in]timecurrent time
[in]baBoxArray for the level
[in]dmDistributionMapping for the level

Definition at line 240 of file REMORA_make_new_level.cpp.

Here is the call graph for this function:

◆ remora_advance()

void REMORA::remora_advance ( int  level,
amrex::MultiFab &  cons_old,
amrex::MultiFab &  cons_new,
amrex::MultiFab &  xvel_old,
amrex::MultiFab &  yvel_old,
amrex::MultiFab &  zvel_old,
amrex::MultiFab &  xvel_new,
amrex::MultiFab &  yvel_new,
amrex::MultiFab &  zvel_new,
amrex::MultiFab &  source,
const amrex::Geometry  fine_geom,
const amrex::Real  dt,
const amrex::Real  time 
)

Interface for advancing the data at one level by one "slow" timestep.

◆ resize_stuff()

void REMORA::resize_stuff ( int  lev)
private

Resize variable containers to accommodate data on levels 0 to max_lev.

Parameters
[in]levlevel do operate on

Definition at line 509 of file REMORA_make_new_level.cpp.

Referenced by MakeNewLevelFromCoarse(), and MakeNewLevelFromScratch().

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

◆ restart()

void REMORA::restart ( )

\briefRestart

Definition at line 698 of file REMORA.cpp.

Referenced by InitData().

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

◆ restore_perimeter_faces()

void REMORA::restore_perimeter_faces ( const amrex::MultiFab &  saved,
amrex::MultiFab &  mf,
const amrex::MultiFab &  covered,
int  dir,
int  ncomp 
)

put back the coarse normal-velocity faces on the fine patch's perimeter

Put back the values a fine-to-coarse average just wrote onto the fine patch's perimeter normal-velocity faces.

ROMS's fine2coarse hands back every covered cell but excludes those faces: for a child spanning coarse cells I_lo..I_hi it updates u-faces I_lo+1..I_hi only, so the face the nested barotropic boundary condition writes is never returned to the parent. A face is interior exactly when both of the cells it separates are covered, which is the test used here.

Parameters
[in]savedcoarse field as it was before the average
[in,out]mfcoarse field to repair
[in]coveredcell mask from build_covered_mask
[in]dirface normal direction
[in]ncompcomponents to repair

Definition at line 3435 of file REMORA.cpp.

Referenced by AverageDownTo().

Here is the caller graph for this function:

◆ rho_eos()

void REMORA::rho_eos ( const amrex::Box &  bx,
const amrex::Array4< amrex::Real const > &  state,
const amrex::Array4< amrex::Real > &  rho,
const amrex::Array4< amrex::Real > &  rhoA,
const amrex::Array4< amrex::Real > &  rhoS,
const amrex::Array4< amrex::Real > &  bvf,
const amrex::Array4< amrex::Real > &  alpha,
const amrex::Array4< amrex::Real > &  beta,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  z_w,
const amrex::Array4< amrex::Real const > &  z_r,
const amrex::Array4< amrex::Real const > &  h,
const amrex::Array4< amrex::Real const > &  mskr,
const int  N 
)

Wrapper around equation of state calculation.

Parameters
[in]bxbox for calculation
[in]statestate holds temp, salt
[out]rhodensity
[out]rhoAvertically-averaged density
[out]rhoSdensity perturbation
[out]bvfBrunt-Vaisala frequency
[out]alphathermal expansion coefficient
[out]betasaline contraction coefficient
[in]Hzvertical cell height
[in]z_rz coordinates at rho points
[in]z_wz coordinates at w points
[in]hbathymetry
[in]mskrland-sea mask on rho points
[in]Nnumber of vertical levels

Definition at line 22 of file REMORA_rho_eos.cpp.

Referenced by setup_step().

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

◆ rhs_t_3d()

void REMORA::rhs_t_3d ( int  lev,
const amrex::Box &  bx,
const amrex::Array4< amrex::Real > &  t,
const amrex::Array4< amrex::Real const > &  tempstore,
const amrex::Array4< amrex::Real const > &  Huon,
const amrex::Array4< amrex::Real const > &  Hvom,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  pn,
const amrex::Array4< amrex::Real const > &  pm,
const amrex::Array4< amrex::Real const > &  W,
const amrex::Array4< amrex::Real > &  FC,
const amrex::Array4< amrex::Real const > &  mskr,
const amrex::Array4< amrex::Real const > &  msku,
const amrex::Array4< amrex::Real const > &  mskv,
const amrex::Array4< int const > &  river_pos,
const amrex::Array4< amrex::Real const > &  river_source,
int  nrhs,
int  nnew,
int  N,
const amrex::Real  dt_lev,
const amrex::Array4< amrex::Real > &  fx_reg = amrex::Array4<amrex::Real>(),
const amrex::Array4< amrex::Real > &  fy_reg = amrex::Array4<amrex::Real>() 
)

RHS terms for tracer.

Parameters
[in]levlevel to operate on
[in]bxtilebox
[in,out]ttracer data
[in]sstorescratch space for tracer calculations
[in]Huonu-volume flux
[in]Hvomv-volume flux
[in]Hzvertical cell height
[in]pn1/dx
[in]pm1/dy
[in]Wvertical velocity
FCtemporary
[in]mskrland-sea mask on rho-points
[in]mskuland-sea mask on u-points
[in]mskvland-sea mask on v-points
[in]river_posriver positions
[in]river_sourceriver source data to add, if using
[in]nrhsindex of RHS component
[in]nnewindex of current time step
[in]Nnumber of vertical levels
[in]dt_levtime step at this level

Definition at line 28 of file REMORA_rhs_t_3d.cpp.

Referenced by advance_3d().

Here is the caller graph for this function:

◆ rhs_uv_3d()

void REMORA::rhs_uv_3d ( int  lev,
const amrex::Box &  xbx,
const amrex::Box &  ybx,
const amrex::Array4< amrex::Real const > &  uold,
const amrex::Array4< amrex::Real const > &  vold,
const amrex::Array4< amrex::Real > &  ru,
const amrex::Array4< amrex::Real > &  rv,
const amrex::Array4< amrex::Real > &  rufrc,
const amrex::Array4< amrex::Real > &  rvfrc,
const amrex::Array4< amrex::Real const > &  sustr,
const amrex::Array4< amrex::Real const > &  svstr,
const amrex::Array4< amrex::Real const > &  bustr,
const amrex::Array4< amrex::Real const > &  bvstr,
const amrex::Array4< amrex::Real const > &  Huon,
const amrex::Array4< amrex::Real const > &  Hvom,
const amrex::Array4< amrex::Real const > &  omn_u,
const amrex::Array4< amrex::Real const > &  omn_v,
const amrex::Array4< amrex::Real const > &  W,
const amrex::Array4< amrex::Real > &  FC,
int  nrhs,
int  N 
)

RHS terms for 3D momentum.

Parameters
[in]levlevel to operate on
[in]xbxBox for operations on x-velocity
[in]ybxBox for operations on y-velocity
[in]uoldu-velocity at last time step
[in]voldv-velocity at last time step
[in,out]ruu-velocity RHS
[in,out]rvv-velocity RHS
[in,out]rufrcforcing for u-velocity RHS
[in,out]rvfrcforcing for v-velocity RHS
[in]sustru-direction surface momentum flux
[in]svstrv-direction surface momentum flux
[in]bustru-direction bottom stress
[in]bvstrv-direction bottom stress
[in]Huonu-volume flux
[in]Hvomv-volume flux
[in]omn_uom_u*on_u at u points
[in]omn_vom_v*on_v at v points
[in]Wvertical velocity
FCtemporary
[in]nrhsindex of component for RHS
[in]Nnumber of vertical levels

Definition at line 29 of file REMORA_rhs_uv_3d.cpp.

Referenced by setup_step().

Here is the caller graph for this function:

◆ roll_2d_snapshot()

void REMORA::roll_2d_snapshot ( amrex::Vector< std::unique_ptr< amrex::MultiFab > > &  old_v,
amrex::Vector< std::unique_ptr< amrex::MultiFab > > &  new_v,
int  lev,
const amrex::MultiFab &  src,
const amrex::MultiFab &  like 
)

roll a two-snapshot history of a level's end-of-step 2D state

Roll a two-snapshot history of one level's end-of-step 2D state: the previous "new" becomes "old" and src becomes the new one, so the pair brackets [t_old, t_new] of the step just taken. src has one component and is broadcast to all of them. On the first call, and whenever the level's layout changes, both snapshots are set to src, making the child's time interpolation a no-op for that step rather than reading uninitialised data – the same special case ROMS takes when RollingIndex is still zero.

Parameters
[in,out]old_vthe older snapshot, one entry per level
[in,out]new_vthe newer snapshot, one entry per level
[in]levlevel of refinement
[in]srcend-of-step value to store, single component
[in]likeMultiFab whose layout, component count and ghost width to match

Definition at line 189 of file REMORA_Advance.cpp.

Referenced by register_coarse_data().

Here is the caller graph for this function:

◆ rotate_to_grid_axes()

void REMORA::rotate_to_grid_axes ( amrex::MultiFab &  u_east,
amrex::MultiFab &  v_north,
const amrex::MultiFab &  angle 
)

Rotate a vector given as east and north components on rho points onto the grid's xi and eta axes, in place, over the valid cells and first ghost cell.

The xi axis is at angle a from east, counterclockwise (ROMS's angle), so a vector with east and north components (E, N) has, along the grid axes, xi = E cos a + N sin a, eta = -E sin a + N cos a, as ROMS's set_data rotates interpolated winds and stresses.

Parameters
[in,out]u_easteast component on input, xi component on output
[in,out]v_northnorth component on input, eta component on output
[in]anglegrid angle on rho points, radians

Definition at line 1855 of file REMORA.cpp.

Referenced by set_smflux(), and set_surface_state().

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

◆ scale_rhs_vars()

void REMORA::scale_rhs_vars ( int  lev)

Scale RHS momentum variables by 1/cell area, needed before FillPatch to different levels.

Scale one level's RHS momentum terms by 1/cell area.

Parameters
[in]levlevel of refinement

Definition at line 11 of file REMORA_scale_rhs_vars.cpp.

Referenced by timeStep(), and timeStepML().

Here is the caller graph for this function:

◆ scale_rhs_vars_inv()

void REMORA::scale_rhs_vars_inv ( int  lev)

Scale RHS momentum variables by cell area, needed after FillPatch to different levels.

Undo scale_rhs_vars on one level.

Parameters
[in]levlevel of refinement

Definition at line 65 of file REMORA_scale_rhs_vars.cpp.

Referenced by timeStep(), and timeStepML().

Here is the caller graph for this function:

◆ set2DPlotVariables()

void REMORA::set2DPlotVariables ( const std::string &  pp_plot_var_names_2d)
private
Parameters
pp_plot_var_names_2dlist of variable names to plot read in from parameter file

Definition at line 129 of file REMORA_SetPlotVars.cpp.

Referenced by REMORA(), and REMORA().

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

◆ set3DPlotVariables()

void REMORA::set3DPlotVariables ( const std::string &  pp_plot_var_names_3d)
private
Parameters
pp_plot_var_names_3dlist of variable names to plot read in from parameter file

Definition at line 18 of file REMORA_SetPlotVars.cpp.

Referenced by REMORA(), and REMORA().

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

◆ set_2d_cf_bcs()

void REMORA::set_2d_cf_bcs ( int  lev,
amrex::Real  time,
int  know,
int  knew 
)

set this level's barotropic contact points from its parent, mass-conservingly

Set the normal barotropic velocity on this level's coarse-fine interface from the parent's time-averaged mass flux, as ROMS does in put_refine2d (nesting.F):

ubar_f = Dubar_c / D_f,    D_f = 0.5*(h + zeta)_{i-1} + 0.5*(h + zeta)_i

D comes from know; ROMS instead uses one time index for both sides: u2dbc_im.F's nested branch builds D from zeta(kout) and writes ubar(kout), and put_refine2d uses indx1 for both. Since the next half-step forms DUon = ubar(krhs)*D(krhs) with krhs equal to this knew, ROMS recovers Dubar_parent exactly while this carries an extra D(knew)/D(know). Measured at most 1.2e-07 on the step-1 Channel_Test interface velocity, against a 2.4e-03 artifact, with no change to Dogbone volume drift or the Channel_Test blow-up.

Momentum only. setup_step resets all three zeta components to Zt_avg1, so what a finer level interpolates for the free surface is already the parent's fast-time average – as in ROMS, where set_zeta runs ahead of put_refine2d.

Parameters
[in]levlevel of refinement
[in]timesimulation time to interpolate the parent's flux to
[in]knowzeta time component to take the sea surface height from
[in]knewubar/vbar time component to set

Definition at line 153 of file REMORA_set_2d_cf_bcs.cpp.

Referenced by advance_2d().

Here is the caller graph for this function:

◆ set_2d_cf_flux()

void REMORA::set_2d_cf_flux ( int  lev,
amrex::Real  time,
amrex::MultiFab &  mf_DUon,
amrex::MultiFab &  mf_DVom 
)

impose the parent's barotropic mass flux on the coarse-fine interface faces

Impose the parent's barotropic mass flux directly on the coarse-fine interface faces.

set_2d_cf_bcs writes a velocity, which the solver then turns back into a flux using its own depth at a different time index, so the flux it actually carries is not the one imposed. Writing the flux itself makes the transport exact whatever the depth does.

Parameters
[in]levlevel of refinement
[in]timesimulation time to interpolate the parent's flux to
[in,out]mf_DUonbarotropic u-flux
[in,out]mf_DVombarotropic v-flux

Definition at line 313 of file REMORA_set_2d_cf_bcs.cpp.

Referenced by advance_2d().

Here is the caller graph for this function:

◆ set_2darrays()

void REMORA::set_2darrays ( int  lev)

Set 2D momentum arrays from 3D momentum.

Parameters
[in]levlevel to operate on

Definition at line 197 of file REMORA_init.cpp.

Referenced by init_only().

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

◆ set_analytic_vmix()

void REMORA::set_analytic_vmix ( int  lev)

Set vertical mixing coefficients from analytic.

Parameters
[in]levlevel to operate on

Definition at line 1051 of file REMORA.cpp.

Referenced by init_set_vmix(), and setup_step().

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

◆ set_bathymetry()

void REMORA::set_bathymetry ( int  lev)

Initialize bathymetry from file or analytic.

Parameters
[in]levlevel to operate on

Definition at line 754 of file REMORA.cpp.

Referenced by init_only().

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

◆ set_bathymetry_averaged_down()

void REMORA::set_bathymetry_averaged_down ( int  lev)

Copy over bathymetry data that has been averaged down from high resolution input netcdf file.

Parameters
[in]levlevel to operate on

Definition at line 813 of file REMORA.cpp.

Referenced by MakeNewLevelFromCoarse(), RemakeLevel(), and set_bathymetry().

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

◆ set_coriolis()

void REMORA::set_coriolis ( int  lev)

Initialize Coriolis factor from file or analytic.

Set the Coriolis parameter f on a level, or zero it when Coriolis is off.

Parameters
[in]levlevel to operate on

Definition at line 1001 of file REMORA.cpp.

Referenced by init_only(), MakeNewLevelFromCoarse(), and RemakeLevel().

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

◆ set_curvilinear_terms_from_grid_scale()

void REMORA::set_curvilinear_terms_from_grid_scale ( int  lev)

Set curvilinear derivative terms on level lev based on pm and pn.

Parameters
[in]

level to operate on

Definition at line 1184 of file REMORA_make_new_level.cpp.

Referenced by set_grid_scale().

Here is the caller graph for this function:

◆ set_derived_metrics()

void REMORA::set_derived_metrics ( int  lev)

fill vec_metric_r/u/v/p from the level's final pm and pn

The metric products the time step needs, computed once from pm and pn rather than with divides inside every kernel (ROMS metrics.F). Each value uses the expression, and operand order, of the kernels it replaces, so they read identical bits.

Parameters
[in]

level to operate on

Definition at line 1029 of file REMORA_make_new_level.cpp.

Referenced by set_grid_scale().

Here is the caller graph for this function:

◆ set_drag()

void REMORA::set_drag ( int  lev)

Initialize or calculate bottom drag.

◆ set_dry_ghost_cells()

Long REMORA::set_dry_ghost_cells ( amrex::MultiFab &  mf,
amrex::Real  val 
)

Write val into the cells of a level-0 field inside the domain but in no box.

Write val into every cell of mf, a field on the level-0 layout, that lies inside the domain but in no box: the ghost cells of kept boxes inside dropped ones, which no exchange fills. No op when level 0 covers the domain.

Returns
the number of values written on this rank

Definition at line 535 of file REMORA_land_layout.cpp.

Referenced by ensure_stress_rho_arrays(), init_grid_vars_from_netcdf(), poison_dry_ghost_cells(), and zero_level0_dry_ghost_cells().

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

◆ set_grid_coords_from_grid_scale()

void REMORA::set_grid_coords_from_grid_scale ( int  lev)

Set x/y coords on level lev based on pm and pn.

Parameters
[in]

level to operate on

Definition at line 1139 of file REMORA_make_new_level.cpp.

Referenced by set_grid_scale().

Here is the caller graph for this function:

◆ set_grid_scale()

void REMORA::set_grid_scale ( int  lev)

Set pm and pn arrays and x/y coords on level lev.

Parameters
[in]levlevel to operate on

Definition at line 952 of file REMORA_make_new_level.cpp.

Referenced by init_analytic(), init_only(), MakeNewLevelFromCoarse(), RemakeLevel(), and set_bathymetry().

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

◆ set_grid_vars_averaged_down()

void REMORA::set_grid_vars_averaged_down ( int  lev)

Set pm/pn by averaging down from higher-resolution grid.

Parameters
[in]levlevel to operate on

Definition at line 828 of file REMORA.cpp.

Referenced by set_bathymetry(), and set_grid_scale().

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

◆ set_hmixcoef()

void REMORA::set_hmixcoef ( int  lev)

Initialize horizontal mixing coefficients.

Parameters
[in]levlevel to operate on

Definition at line 1499 of file REMORA.cpp.

Referenced by init_only(), MakeNewLevelFromCoarse(), and RemakeLevel().

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

◆ set_init_data_averaged_down()

void REMORA::set_init_data_averaged_down ( int  lev)

Problem initialization from averaged-down high resolution data.

Parameters
[in]levlevel to operate on

Definition at line 982 of file REMORA.cpp.

Referenced by init_only().

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

◆ set_masks()

void REMORA::set_masks ( int  lev)

Initialize land-sea masks from file or analytic.

Initialize the land-sea mask on this level.

Mirrors set_bathymetry: the mask is specified once, on level 0 or at hires_grid_level, and every other level derived from it, so the levels cannot disagree about the coastline.

Parameters
[in]levlevel to operate on

Definition at line 1074 of file REMORA.cpp.

Referenced by init_only(), MakeNewLevelFromCoarse(), and RemakeLevel().

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

◆ set_masks_averaged_down()

void REMORA::set_masks_averaged_down ( int  lev)

Copy this level's land-sea mask out of the full-domain mask that was coarsened down from hires_grid_level.

Parameters
[in]levlevel to operate on

Definition at line 1175 of file REMORA.cpp.

Referenced by set_masks().

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

◆ set_massflux_3d()

void REMORA::set_massflux_3d ( int  lev,
amrex::MultiFab &  mf_Huon,
amrex::MultiFab &  mf_Hvom 
)

Horizontal mass fluxes Hz*u/n and Hz*v/m of the current velocities, as ROMS set_massflux.

Horizontal mass fluxes Hz*u/n and Hz*v/m of the current velocities on the valid faces, as ROMS set_massflux.

Parameters
[in]levlevel
[out]mf_Huonu-volume flux
[out]mf_Hvomv-volume flux

Definition at line 245 of file REMORA_compute_W.cpp.

Referenced by compute_diagnostic_omega().

Here is the caller graph for this function:

◆ set_nsubsteps()

void REMORA::set_nsubsteps ( int  nlevs_max)
private

size nsubsteps and set how many steps each level takes per parent step

Set how many steps each level takes per parent step, from remora.dt_ref_ratio.

Parameters
[in]nlevs_maxmax_level + 1

Definition at line 3138 of file REMORA.cpp.

Referenced by REMORA(), and REMORA().

Here is the caller graph for this function:

◆ set_smflux()

void REMORA::set_smflux ( int  lev)

Initialize or calculate surface momentum flux from file or analytic.

Parameters
[in]levlevel to operate on

Definition at line 1784 of file REMORA.cpp.

Referenced by setup_step().

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

◆ set_surface_state()

void REMORA::set_surface_state ( int  lev)

Initialize or calculate wind speed and other surface state vars from file or analytic.

Parameters
[in]levlevel to operate on

Definition at line 1908 of file REMORA.cpp.

Referenced by setup_step().

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

◆ set_weights()

void REMORA::set_weights ( int  lev)

Set weights for averaging 3D variables to 2D.

Parameters
[in]levlevel to operate on

Definition at line 11 of file REMORA_set_weights.cpp.

Referenced by init_stuff().

Here is the caller graph for this function:

◆ set_zeta()

void REMORA::set_zeta ( int  lev)

Initialize zeta from file or analytic.

Parameters
[in]levlevel to operate on

Definition at line 715 of file REMORA.cpp.

Referenced by init_only().

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

◆ set_zeta_average()

void REMORA::set_zeta_average ( int  lev)

Set Zt_avg1 to zeta.

Parameters
[in]levlevel to operate on

Definition at line 173 of file REMORA_init.cpp.

Referenced by set_zeta().

Here is the caller graph for this function:

◆ set_zeta_averaged_down()

void REMORA::set_zeta_averaged_down ( int  lev)

Copy over zeta data that has been averaged down from high res.

Parameters
[in]levlevel to operate on

Definition at line 971 of file REMORA.cpp.

Referenced by set_zeta().

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

◆ set_zeta_to_Ztavg()

void REMORA::set_zeta_to_Ztavg ( int  lev,
bool  apply_eminusp = true 
)

Set zeta components to be equal to time-averaged Zt_avg1.

Parameters
[in]levlevel to operate on
[in]apply_eminuspwhether to apply the evaporation-minus-precipitation correction to Zt_avg1

Definition at line 1206 of file REMORA_make_new_level.cpp.

Referenced by init_only(), MakeNewLevelFromCoarse(), RemakeLevel(), and setup_step().

Here is the caller graph for this function:

◆ SetDriverAtmosToOceanForcingMode()

void REMORA::SetDriverAtmosToOceanForcingMode ( DriverAtmosForcingMode  mode)

Definition at line 394 of file REMORA_Coupling.cpp.

◆ SetLongwaveFromDriver()

void REMORA::SetLongwaveFromDriver ( )

Definition at line 355 of file REMORA_Coupling.cpp.

◆ setRecordDataInfo()

void REMORA::setRecordDataInfo ( int  i,
const std::string &  filename 
)
inlineprivate

Definition at line 2392 of file REMORA.H.

Referenced by ReadParameters().

Here is the caller graph for this function:

◆ SetStartTime()

void REMORA::SetStartTime ( double  time)
inlinenoexcept

Set remora.start_time. Call before InitData, which starts the clock from it.

Definition at line 125 of file REMORA.H.

◆ setup_step()

void REMORA::setup_step ( int  lev,
amrex::Real  time,
amrex::Real  dt_lev 
)

Set everything up for a step on a level.

Parameters
[in]levlevel to operate on
[in]timetime at start of step
[in]dt_levtime step at level

Definition at line 11 of file REMORA_setup_step.cpp.

Referenced by Advance(), and timeStepML().

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

◆ store_2d_flux()

void REMORA::store_2d_flux ( int  lev)

store this level's barotropic mass flux per unit cell edge length

Store this level's barotropic mass flux per unit cell edge length, for a finer level to interpolate.

Parameters
[in]levlevel of refinement

Definition at line 70 of file REMORA_set_2d_cf_bcs.cpp.

Referenced by register_coarse_data().

Here is the caller graph for this function:

◆ store_particle_omega()

void REMORA::store_particle_omega ( int  lev,
const amrex::MultiFab &  mf_W 
)
private

Keep advance_3d's W, as omega, for the particles to advect with, if any species advects on this level.

Particles are advected in terrain-following coordinates, so they need omega, the velocity across the w-levels, rather than a Cartesian vertical velocity. As in ROMS floats, it comes from the time-averaged fluxes update_massflux_3d leaves, the ones the tracers move with, rather than the diagnostic omega from the current velocities. advance_3d integrates those fluxes into W, the same volume flux compute_omega would build, its first ghost column included, so this keeps W scaled by pm*pn instead of integrating the columns again. The scaling and fill are those of compute_omega, so the result is the same to the bit.

Parameters
[in]levlevel
[in]mf_Wadvance_3d's W, on the valid region and the first ghost column

Definition at line 105 of file REMORA_Tracers.cpp.

Referenced by advance_3d().

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

◆ stretch_transform()

void REMORA::stretch_transform ( int  lev)

Calculate vertical stretched coordinates.

Parameters
[in]levlevel to operate on

Definition at line 116 of file REMORA_DepthStretchTransform.H.

Referenced by advance_3d(), AverageDownTo(), init_only(), MakeNewLevelFromCoarse(), ReadCheckpointFile(), and RemakeLevel().

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

◆ stretch_transform_full_domain()

void REMORA::stretch_transform_full_domain ( int  lev,
const amrex::MultiFab &  mf_h,
const amrex::MultiFab &  mf_zeta,
amrex::MultiFab &  mf_z_r,
amrex::MultiFab &  mf_z_w 
)

Calculate z_r and z_w on full-domain arrays at a level not yet created.

z_r and z_w for a level not yet created, on full-domain arrays, over every grow cell of mf_z_w. mf_h and mf_zeta must cover the same region.

Parameters
[in]levlevel whose vertical grid to use
[in]mf_hbathymetry (component 0), 2D
[in]mf_zetafree surface (component 0), 2D
[out]mf_z_rdepth of rho points
[out]mf_z_wdepth of w points, on the same layout as mf_z_r but nodal in z

Definition at line 264 of file REMORA_DepthStretchTransform.H.

Referenced by init_full_domain_from_analytic().

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

◆ sum_integrated_quantities()

void REMORA::sum_integrated_quantities ( amrex::Real  time)

Integrate conserved quantities for diagnostics.

Parameters
[in]timecurrent time

Definition at line 12 of file REMORA_SumIQ.cpp.

Referenced by InitData(), and post_timestep().

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

◆ t3dmix2()

void REMORA::t3dmix2 ( const amrex::Box &  bx,
const amrex::Array4< amrex::Real > &  state,
const amrex::Array4< amrex::Real > &  state_rhs,
const amrex::Array4< amrex::Real const > &  diff2,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  z_r,
const amrex::Array4< amrex::Real const > &  pm,
const amrex::Array4< amrex::Real const > &  pn,
const amrex::Array4< amrex::Real const > &  metu,
const amrex::Array4< amrex::Real const > &  metv,
const amrex::Array4< amrex::Real const > &  msku,
const amrex::Array4< amrex::Real const > &  mskv,
const amrex::Real  dt_lev,
const int  ncomp,
const int  N 
)

Wrapper for harmonic diffusivity for tracers.

Parameters
[in]bxbox to operate on
[in,out]statescalar data
[out]state_rhsscalar data RHS
[in]diff2diffusivity
[in]Hzvertical cell height
[in]z_rrho-point z coordinate
[in]pm1/dx
[in]pn1/dy
[in]metumetric products at u points (MetricU)
[in]metvmetric products at v points (MetricV)
[in]mskuland-sea mask on u-points
[in]mskvland-sea mask on v-points
[in]dt_levtime step at level
[in]ncompnumber of components to do this calculation on
[in]Nnumber of vertical levels

Definition at line 23 of file REMORA_t3dmix.cpp.

Referenced by setup_step().

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

◆ t3dmix2_geo()

void REMORA::t3dmix2_geo ( const amrex::Box &  bx,
const amrex::Array4< amrex::Real > &  state,
const amrex::Array4< amrex::Real > &  state_rhs,
const amrex::Array4< amrex::Real const > &  diff2,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  z_r,
const amrex::Array4< amrex::Real const > &  pm,
const amrex::Array4< amrex::Real const > &  pn,
const amrex::Array4< amrex::Real const > &  metu,
const amrex::Array4< amrex::Real const > &  metv,
const amrex::Array4< amrex::Real const > &  msku,
const amrex::Array4< amrex::Real const > &  mskv,
const amrex::Real  dt_lev,
const int  ncomp,
const int  N 
)

Harmonic diffusivity for tracers along geopotential surfaces.

Parameters
[in]bxbox to operate on
[in,out]statescalar data
[out]state_rhsscalar data RHS
[in]diff2diffusivity
[in]Hzvertical cell height
[in]z_rrho-point z coordinates
[in]pm1/dx
[in]pn1/dy
[in]metumetric products at u points (MetricU)
[in]metvmetric products at v points (MetricV)
[in]mskuland-sea mask on u-points
[in]mskvland-sea mask on v-points
[in]dt_levtime step at level
[in]ncompnumber of components to do this calculation on
[in]Nnumber of vertical levels

Definition at line 136 of file REMORA_t3dmix.cpp.

Referenced by t3dmix2().

Here is the caller graph for this function:

◆ t3dmix2_s()

void REMORA::t3dmix2_s ( const amrex::Box &  bx,
const amrex::Array4< amrex::Real > &  state,
const amrex::Array4< amrex::Real > &  state_rhs,
const amrex::Array4< amrex::Real const > &  diff2,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  pm,
const amrex::Array4< amrex::Real const > &  pn,
const amrex::Array4< amrex::Real const > &  metu,
const amrex::Array4< amrex::Real const > &  metv,
const amrex::Array4< amrex::Real const > &  msku,
const amrex::Array4< amrex::Real const > &  mskv,
const amrex::Real  dt_lev,
const int  ncomp 
)

Harmonic diffusivity for tracers along S-coordinate level surfaces.

Parameters
[in]bxbox to operate on
[in,out]statescalar data
[out]state_rhsscalar data RHS
[in]diff2diffusivity
[in]Hzvertical cell height
[in]pm1/dx
[in]pn1/dy
[in]metumetric products at u points (MetricU)
[in]metvmetric products at v points (MetricV)
[in]mskuland-sea mask on u-points
[in]mskvland-sea mask on v-points
[in]dt_levtime step at level
[in]ncompnumber of components to do this calculation on

Definition at line 61 of file REMORA_t3dmix.cpp.

Referenced by t3dmix2().

Here is the caller graph for this function:

◆ timeStep()

void REMORA::timeStep ( int  lev,
amrex::Real  time,
int  iteration 
)
private

advance a level by dt, includes a recursive call for finer levels

Parameters
[in]levlevel of refinement
[in]timesimulation time at start of step
[in]iterationiteration in subcycling, if using

Definition at line 11 of file REMORA_TimeStep.cpp.

Referenced by Evolve(), EvolveOneStep(), and timeStep().

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

◆ timeStepML()

void REMORA::timeStepML ( amrex::Real  time,
int  iteration 
)
private

advance all levels by dt, loops over finer levels

Parameters
[in]timesimulation time at start of step
[in]iterationiteration in subcycling, if using

Definition at line 10 of file REMORA_TimeStepML.cpp.

Referenced by Evolve(), and EvolveOneStep().

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

◆ tke_bc()

int REMORA::tke_bc ( ) const
inlinenoexcept

Definition at line 1663 of file REMORA.H.

Referenced by gls_corrector(), gls_prestep(), and init_bcs().

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

◆ u2d_simple_bc()

int REMORA::u2d_simple_bc ( ) const
inlinenoexcept

Definition at line 1666 of file REMORA.H.

Referenced by init_bcs(), and setup_step().

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

◆ ubar_bc()

int REMORA::ubar_bc ( ) const
inlinenoexcept

Definition at line 1660 of file REMORA.H.

Referenced by advance_2d(), fill_from_bdyfiles(), init_bcs(), MakeNewLevelFromCoarse(), RemakeLevel(), and set_2darrays().

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

◆ update_avgdown_masks()

void REMORA::update_avgdown_masks ( int  crse_lev)

Make sure the coarse masks the average-down kernels read sit on the coarsened layout of level crse_lev+1, rebuilding them if a regrid has moved it.

Make sure the coarse rho-, u- and v-masks are defined on the layout average_down_masked computes on: level crse_lev+1's grids coarsened, rather than level crse_lev's own grids.

The masks are a function of position alone, so between regrids this is the same answer every step; building it once turns three allocations and three ParallelCopy calls per step into three per regrid.

Parameters
[in]crse_levcoarse level of the pair

Definition at line 3180 of file REMORA.cpp.

Referenced by AverageDownTo().

Here is the caller graph for this function:

◆ update_massflux_3d()

void REMORA::update_massflux_3d ( int  lev,
const amrex::Box &  bx,
const int  ioff,
const int  joff,
const amrex::Array4< amrex::Real > &  phi,
const amrex::Array4< amrex::Real > &  phibar,
const amrex::Array4< amrex::Real > &  Hphi,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  om_v_or_on_u,
const amrex::Array4< amrex::Real const > &  Dphi1,
const amrex::Array4< amrex::Real const > &  Dphi2,
const amrex::Array4< amrex::Real > &  DC,
const amrex::Array4< amrex::Real > &  FC,
const amrex::Array4< amrex::Real const > &  msk,
const int  nnew 
)

Correct mass flux.

Parameters
[in]levlevel of refinement (coarsest level is 0)
[in]bxbox on which to update
[in]ioffoffset in x-direction
[in]joffoffset in y-direction
[in,out]phiu or v
[in,out]phibarubar or vbar
[in,out]Hphiphi-volume flux
[in]Hzvertical cell height
[in]om_v_or_on_uon_u for u, om_v for v
[in]Dphi_avg1DU_avg1 or DV_avg1
[in]Dphi_avg2DU_avg2 or DV_avg2
DCtemporary
FCtemporary
[in]mskland-sea mask
[in]nnewcomponent of velocity

Definition at line 23 of file REMORA_update_massflux_3d.cpp.

Referenced by advance_3d().

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

◆ update_nodal_masks()

void REMORA::update_nodal_masks ( int  lev)

Rebuild the u-, v- and psi-point masks from vec_mskr and fill their ghosts.

Rebuild the u-, v- and psi-point masks from vec_mskr and fill their ghost cells.

Every path goes through here, so the levels cannot end up with different definitions.

Parameters
[in]levlevel to operate on

Definition at line 1309 of file REMORA_make_new_level.cpp.

Referenced by init_masks_from_netcdf(), set_masks(), and set_masks_averaged_down().

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

◆ uv3dmix()

void REMORA::uv3dmix ( const amrex::Box &  xbx,
const amrex::Box &  ybx,
const amrex::Array4< amrex::Real > &  u,
const amrex::Array4< amrex::Real > &  v,
const amrex::Array4< amrex::Real const > &  uold,
const amrex::Array4< amrex::Real const > &  vold,
const amrex::Array4< amrex::Real > &  rufrc,
const amrex::Array4< amrex::Real > &  rvfrc,
const amrex::Array4< amrex::Real const > &  visc2_p,
const amrex::Array4< amrex::Real const > &  visc2_r,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  pm,
const amrex::Array4< amrex::Real const > &  pn,
const amrex::Array4< amrex::Real const > &  metr,
const amrex::Array4< amrex::Real const > &  metp,
const amrex::Array4< amrex::Real const > &  mskp,
int  nrhs,
int  nnew,
const amrex::Real  dt_lev 
)

Harmonic viscosity.

Parameters
[in]xbxx-nodal tile box
[in]ybxy-nodal tile box
[in,out]uu-direction velocity
[in,out]vv-direction velocity
[in]uoldu-direction velocity at last step
[in]voldv-direction velocity at last step
[in,out]rufrcforcing term for u-velocity RHS
[in,out]rvfrcforcing term for v-velocity RHS
[in]visc2_pharmonic viscosity on psi points
[in]visc2_rharmonic viscosity on rho points
[in]Hzvertical cell height
[in]pm1/dx
[in]pn1/dy
[in]metrmetric products at rho points (MetricR)
[in]metpmetric products at psi points (MetricP)
[in]mskpland-sea mask on psi-points
[in]nrhsindex of RHS component
[in]nnewindex of time step to update
[in]dt_levtime step at this level

Definition at line 27 of file REMORA_uv3dmix.cpp.

Referenced by setup_step().

Here is the caller graph for this function:

◆ v2d_simple_bc()

int REMORA::v2d_simple_bc ( ) const
inlinenoexcept

Definition at line 1667 of file REMORA.H.

Referenced by init_bcs(), and setup_step().

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

◆ vbar_bc()

int REMORA::vbar_bc ( ) const
inlinenoexcept

Definition at line 1661 of file REMORA.H.

Referenced by advance_2d(), fill_from_bdyfiles(), init_bcs(), MakeNewLevelFromCoarse(), RemakeLevel(), and set_2darrays().

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

◆ vert_mean_3d()

void REMORA::vert_mean_3d ( const amrex::Box &  bx,
const int  ioff,
const int  joff,
const amrex::Array4< amrex::Real > &  phi,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real const > &  Dphi_avg1,
const amrex::Array4< amrex::Real > &  DC,
const amrex::Array4< amrex::Real > &  CF,
const amrex::Array4< amrex::Real const > &  on_u_or_om_v,
const amrex::Array4< amrex::Real const > &  msk,
const int  nnew,
const int  N 
)

Adjust 3D momentum variables based on vertical mean momentum.

Parameters
[in]phi_bxbox to update on
[in]ioffx-direction offset
[in]joffy-direction offset
[in,out]phivelocity (u or v)
[in]Dphi_avg1time average of barotropic velocity
DCtemporary
CFtemporary
[in]on_u_or_om_von_u for u, om_v for v
[in]mskland-sea mask
[in]nnewindex of time step to update
[in]Nnumber of vertical levels

Definition at line 19 of file REMORA_vert_mean_3d.cpp.

Referenced by advance_3d().

Here is the caller graph for this function:

◆ vert_visc_3d()

void REMORA::vert_visc_3d ( const amrex::Box &  bx,
const int  ioff,
const int  joff,
const amrex::Array4< amrex::Real > &  phi,
const amrex::Array4< amrex::Real const > &  Hz,
const amrex::Array4< amrex::Real > &  Hzk,
const amrex::Array4< amrex::Real > &  AK,
const amrex::Array4< amrex::Real const > &  Akv,
const amrex::Array4< amrex::Real > &  BC,
const amrex::Array4< amrex::Real > &  DC,
const amrex::Array4< amrex::Real > &  FC,
const amrex::Array4< amrex::Real > &  CF,
const int  nnew,
const int  N,
const amrex::Real  dt_lev 
)

Calculate effects of vertical viscosity or diffusivity.

Parameters
[in]phi_bxbox to update on
[in]ioffx-direction offset
[in]joffy-direction offset
[in,out]phivelocity (u or v)
[in]Hzvertical height of cells
Hzktemporary
AKtemporary
[in]Akvvertical viscosity coefficient
BCtemporary
DCtemporary
FCtemporary
CFtemporary
[in]nnewindex of time step to update
[in]Nnumber of vertical levels
[in]dt_levtime step at this refinement level

Definition at line 23 of file REMORA_vert_visc_3d.cpp.

Referenced by advance_3d().

Here is the caller graph for this function:

◆ volWgtSumMF()

Real REMORA::volWgtSumMF ( int  lev,
const amrex::MultiFab &  mf,
int  comp,
bool  local,
bool  finemask 
)

Perform the volume-weighted sum.

Parameters
[in]levlevel to calculate on
[in]mfdata to sum over
[in]compcomponent on which to calculate sum
[in]localwhether to do the sum locally
[in]finemaskwhether to mask fine level

Definition at line 209 of file REMORA_SumIQ.cpp.

Referenced by sum_integrated_quantities().

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

◆ wet_cells_per_box()

bool REMORA::wet_cells_per_box ( int  lev,
const amrex::BoxArray &  ba,
amrex::Vector< amrex::Long > &  wet 
)

Wet cells in each box of a prospective layout of level lev; false if unknown.

Wet rho cells in each box of a prospective layout of level lev: the box's wet columns times its vertical extent. The same on every rank.

Parameters
[in]levlevel the layout belongs to
[in]bathe layout's (3D) boxes
[out]wetwet cells per box of ba
Returns
false when the mask cannot be known yet (see probe_rho_mask)

Definition at line 111 of file REMORA_land_layout.cpp.

Referenced by MakeDistributionMap().

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

◆ winds_need_rotation()

bool REMORA::winds_need_rotation ( ) const
inline

Whether the winds come from a lat-lon file and are to be rotated; the other component then comes from one too, or is uniform (checked at startup)

Definition at line 1410 of file REMORA.H.

Referenced by set_surface_state().

Here is the caller graph for this function:

◆ WriteAtFinalTime()

void REMORA::WriteAtFinalTime ( )

Write checkpoint and plotfiles at end of simulation.

Definition at line 342 of file REMORA.cpp.

Referenced by Evolve().

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

◆ WriteAtIntermediateTime()

void REMORA::WriteAtIntermediateTime ( int  step,
amrex::Real  cur_time 
)

Write checkpoint and plotfiles at intermediate point of simulation, if needed.

Definition at line 359 of file REMORA.cpp.

Referenced by Evolve(), and EvolveOneStep().

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

◆ writeBuildInfo()

void REMORA::writeBuildInfo ( std::ostream &  os)
static

Write build info to os.

Definition at line 135 of file REMORA_writeJobInfo.cpp.

Referenced by main().

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

◆ WriteCheckpointFile()

void REMORA::WriteCheckpointFile ( )
private

write checkpoint file to disk

Definition at line 15 of file REMORA_Checkpoint.cpp.

Referenced by InitData(), WriteAtFinalTime(), and WriteAtIntermediateTime().

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

◆ WriteGenericPlotfileHeaderWithBathymetry()

void REMORA::WriteGenericPlotfileHeaderWithBathymetry ( std::ostream &  HeaderFile,
int  nlevels,
const amrex::Vector< amrex::BoxArray > &  bArray,
const amrex::Vector< std::string > &  varnames_3d,
const amrex::Vector< std::string > &  varnames_2d_rho,
const amrex::Vector< std::string > &  varnames_2d_u,
const amrex::Vector< std::string > &  varnames_2d_v,
const amrex::Vector< amrex::Geometry > &  my_geom,
double  time,
const amrex::Vector< int > &  level_steps,
const amrex::Vector< amrex::IntVect > &  rr,
const std::string &  versionName,
const std::string &  levelPrefix,
const std::string &  mfPrefix 
) const

write out header data for an AMReX plotfile

Parameters
HeaderFileoutput stream for header
nlevelsnumber of levels to write out
bArrayvector over levels of BoxArrays
varnames_3d3D variable names to write out
varnames_2d2D variable names to write out
my_geomgeometry to use for writing plotfile
timetime at which to output
level_stepsvector over level of iterations
my_ref_ratiorefinement ratio to use for writing plotfile
versionNameversion string for VisIt
levelPrefixstring to prepend to level number
mfPrefixsubdirectory for multifab data

Definition at line 1040 of file REMORA_Plotfile.cpp.

Referenced by WriteMultiLevelPlotfileWithBathymetry().

Here is the caller graph for this function:

◆ writeJobInfo()

void REMORA::writeJobInfo ( const std::string &  dir) const

Write job info to stdout.

Definition at line 7 of file REMORA_writeJobInfo.cpp.

Referenced by WritePlotFile().

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

◆ WriteMultiLevelPlotfileWithBathymetry()

void REMORA::WriteMultiLevelPlotfileWithBathymetry ( const std::string &  plotfilename,
int  nlevels,
const amrex::Vector< const amrex::MultiFab * > &  mf,
const amrex::Vector< const amrex::MultiFab * > &  mf_nd,
const amrex::Vector< const amrex::MultiFab * > &  mf_u,
const amrex::Vector< const amrex::MultiFab * > &  mf_v,
const amrex::Vector< const amrex::MultiFab * > &  mf_w,
const amrex::Vector< const amrex::MultiFab * > &  mf_2d_rho,
const amrex::Vector< const amrex::MultiFab * > &  mf_2d_u,
const amrex::Vector< const amrex::MultiFab * > &  mf_2d_v,
const amrex::Vector< std::string > &  varnames_3d,
const amrex::Vector< std::string > &  varnames_2d_rho,
const amrex::Vector< std::string > &  varnames_2d_u,
const amrex::Vector< std::string > &  varnames_2d_v,
const amrex::Vector< amrex::Geometry > &  my_geom,
double  time,
const amrex::Vector< int > &  level_steps,
const amrex::Vector< amrex::IntVect > &  rr,
const std::string &  versionName = "HyperCLaw-V1.1",
const std::string &  levelPrefix = "Level_",
const std::string &  mfPrefix = "Cell",
const amrex::Vector< std::string > &  extra_dirs = amrex::Vector<std::string>() 
) const

write out particular data to an AMReX plotfile

Parameters
plotfilenamename of plotfile to write to
nlevelsnumber of levels to write out
mfMultiFab of data to write out
mf_ndMultifab of nodal data to write out
varnames_3d3D variable names to write out
varnames_2d_rho2D cell-centered variable names to write out
varnames_2d_u2D x-face-based variable names to write out
varnames_2d_v2D y-face-based variable names to write out
my_geomgeometry to use for writing plotfile
timetime at which to output
level_stepsvector over level of iterations
rrrefinement ratio to use for writing plotfile
versionNameversion string for VisIt
levelPrefixstring to prepend to level number
mfPrefixsubdirectory for multifab data
extra_dirsadditional subdirectories within plotfile

Definition at line 857 of file REMORA_Plotfile.cpp.

Referenced by WritePlotFile().

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

◆ WriteNCMultiFab()

void REMORA::WriteNCMultiFab ( const amrex::FabArray< amrex::FArrayBox > &  fab,
const std::string &  name,
bool  set_ghost = false 
) const
private

Write MultiFab in NetCDF format.

◆ WriteNCPlotFile()

void REMORA::WriteNCPlotFile ( int  istep,
amrex::MultiFab const *  plotMF,
int  lev = 0,
amrex::MultiFab const *  mf_omega = nullptr,
amrex::MultiFab const *  mf_wvel = nullptr 
)
private

Write plotfile using NetCDF (wrapper)

Parameters
which_stepcurrent step for output
plotMFcell-centered plot variables at this level
levlevel to write
mf_omegaomega at w points, or nullptr when it is not plotted
mf_wvelw at w points, or nullptr when it is not plotted

Definition at line 241 of file REMORA_NCPlotFile.cpp.

Referenced by WritePlotFile().

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

◆ WriteNCPlotFile_which()

void REMORA::WriteNCPlotFile_which ( int  lev,
amrex::MultiFab const *  plotMF,
amrex::MultiFab const *  mf_omega,
amrex::MultiFab const *  mf_wvel,
bool  write_header,
bool  write_grid,
ncutils::NCFile &  ncf,
bool  is_history,
long long  history_record = 0 
)
private

Write a particular NetCDF plotfile.

Parameters
levlevel of data to output
plotMFcell-centered plot variables at this level
mf_omegaomega at w points, or nullptr when it is not plotted
mf_wvelw at w points, or nullptr when it is not plotted
write_headerwhether to write a header
write_gridwhether to write the fixed grid variables
ncfnetcdf file object
is_historywhether the file being written is a history file
history_recordrecord of the history file to write to

Definition at line 382 of file REMORA_NCPlotFile.cpp.

Referenced by WriteNCPlotFile().

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

◆ WritePlotFile()

void REMORA::WritePlotFile ( int  istep)

main driver for writing AMReX plotfiles

Definition at line 103 of file REMORA_Plotfile.cpp.

Referenced by InitData(), timeStepML(), WriteAtFinalTime(), and WriteAtIntermediateTime().

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

◆ xvel_bc()

int REMORA::xvel_bc ( ) const
inlinenoexcept

Definition at line 1657 of file REMORA.H.

Referenced by Advance(), advance_3d(), ErrorEst(), evolveTracers(), FillBdyCCVels(), FillPatchNoBC(), gls_corrector(), gls_prestep(), init_bcs(), init_only(), InitData(), MakeNewLevelFromCoarse(), RemakeLevel(), set_init_data_averaged_down(), timeStepML(), and update_massflux_3d().

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

◆ yvel_bc()

int REMORA::yvel_bc ( ) const
inlinenoexcept

Definition at line 1658 of file REMORA.H.

Referenced by Advance(), advance_3d(), ErrorEst(), evolveTracers(), FillPatchNoBC(), gls_corrector(), gls_prestep(), init_bcs(), init_only(), InitData(), MakeNewLevelFromCoarse(), RemakeLevel(), set_init_data_averaged_down(), timeStepML(), and update_massflux_3d().

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

◆ zero_level0_dry_ghost_cells()

void REMORA::zero_level0_dry_ghost_cells ( )

Zero those cells in every level-0 field (see set_dry_ghost_cells)

With level-0 boxes dropped, the ghost cells of a kept box that lie in a dropped box are never filled by an exchange, and the land stencils of the kept box read them. What those stencils compute stays on land only while the values there are finite: a wet cell is at least NGROW+2 land cells away and the masks multiply the land values out (the regression tests write 7 there and compare), but 0 * NaN is NaN, so a NaN there spreads into the water within a few steps. A fresh FArrayBox holds NaN in a debug build (amrex.init_snan), so these cells are zeroed in every level-0 field as soon as the fields exist, before anything reads them. Fields made later on the level-0 layout (lon/lat/angle from the grid file, the rho-point surface stress) zero theirs when they are allocated.

The scratch MultiFabs the step allocates on the level-0 layout (for example in setup_step, gls, bulk_fluxes and the prestep) are not zeroed there. Nothing that the step reads from them in a dropped region reaches a kept cell's result: the Debug CI build (amrex.init_snan) and the dropped-vs-full feature checks with signalling NaNs and the invalid, zero and overflow traps on all complete with bitwise water points. A new kernel that reads such scratch in its ghost cells and lets the value reach a wet cell would break that; zero the scratch with set_dry_ghost_cells then.

Definition at line 606 of file REMORA_land_layout.cpp.

Referenced by MakeNewLevelFromScratch().

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

◆ zeta_bc()

int REMORA::zeta_bc ( ) const
inlinenoexcept

Definition at line 1662 of file REMORA.H.

Referenced by advance_2d(), fill_from_bdyfiles(), init_bcs(), init_zeta_from_netcdf(), RemakeLevel(), and set_zeta_averaged_down().

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

◆ zvel_bc()

int REMORA::zvel_bc ( ) const
inlinenoexcept

Definition at line 1659 of file REMORA.H.

Referenced by advance_3d_ml(), ErrorEst(), FillPatchNoBC(), gls_corrector(), init_bcs(), init_only(), InitData(), MakeNewLevelFromCoarse(), RemakeLevel(), set_analytic_vmix(), setup_step(), and timeStep().

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

Member Data Documentation

◆ advflux_reg

amrex::Vector<std::unique_ptr<amrex::YAFluxRegister> > REMORA::advflux_reg
private

array of flux registers for refluxing in multilevel

Definition at line 1940 of file REMORA.H.

Referenced by define_flux_register(), getAdvFluxReg(), InitData(), REMORA(), and REMORA().

◆ bdry_time_name_byvar

amrex::Vector<std::string> REMORA::bdry_time_name_byvar
private

Name of time fields for boundary data.

Definition at line 2322 of file REMORA.H.

Referenced by init_bdry_from_netcdf(), and ReadParameters().

◆ bdry_time_varname

std::string REMORA::bdry_time_varname = "ocean_time"
private

Default name of time field for boundary data.

Definition at line 2320 of file REMORA.H.

Referenced by ReadParameters().

◆ bdy_index

amrex::Vector<int> REMORA::bdy_index
private

Container to connect boundary data being read in boundary condition containers.

Needed for phys_bc_need_data to work correctly

Definition at line 1979 of file REMORA.H.

Referenced by init_bcs().

◆ Bio_comp

int REMORA::Bio_comp = Tracer_comp
private

First cons component of the biology block, i.e. Tracer_comp + nscalar. The state is laid out as temp, salt, the passive scalars, then biology.

Definition at line 2019 of file REMORA.H.

Referenced by advance_biology(), bio_comp_start(), init_biology_from_netcdf(), init_biology_full_domain_from_netcdf(), init_biology_ic(), init_biology_ic_full_domain(), init_scalars_from_netcdf(), init_scalars_full_domain_from_netcdf(), ReadParameters(), and set3DPlotVariables().

◆ biology_ic_type

Biology IC source, independent of the physical IC source.

Definition at line 2026 of file REMORA.H.

Referenced by init_biology_ic(), init_biology_ic_full_domain(), and ReadParameters().

◆ boundary_series

amrex::Vector<amrex::Vector<std::unique_ptr<NCTimeSeriesBoundary> > > REMORA::boundary_series
private

Vector over BdyVars of boundary series data containers.

Definition at line 1850 of file REMORA.H.

Referenced by fill_from_bdyfiles(), init_bdry_from_netcdf(), and ReadParameters().

◆ boxes_at_level

◆ cf_2d_cache

amrex::Vector<amrex::Array<CF2DCache,3> > REMORA::cf_2d_cache
private

per level: the caches for ubar, vbar and zeta (slots 0, 1, 2)

Definition at line 2112 of file REMORA.H.

Referenced by cf_2d_cache_entry(), and FillPatch().

◆ cf_2d_fill_cache

int REMORA::cf_2d_fill_cache = 1
private

reuse the coarse-fine ghost values of a fine level's barotropic fills (ubar, vbar, zeta in advance_2d). 0: recompute on every fast step, where the two-level fill re-exchanges and re-interpolates the coarse level each time. 1 (default): compute once per (component, fill time) within a parent step and replay the result; bitwise identical, since the fill reads only the registered coarse data and, for faces, the interface faces FillSet rewrites before every fill, none of which changes inside the parent step. 2: as 1, but also recompute and abort on any difference in the replayed cells. Subcycled driver only.

Definition at line 2102 of file REMORA.H.

Referenced by FillPatch(), and ReadParameters().

◆ cf_avgdown_bar

int REMORA::cf_avgdown_bar = 1
private

Definition at line 2079 of file REMORA.H.

Referenced by AverageDownTo(), and ReadParameters().

◆ cf_avgdown_perimeter

int REMORA::cf_avgdown_perimeter = 1
private

exclude the coarse-fine perimeter's normal-velocity faces from the fine-to-coarse average, as ROMS does. 1 (default) matches ROMS; 0 includes the perimeter faces in the average.

Definition at line 2062 of file REMORA.H.

Referenced by AverageDownTo(), and ReadParameters().

◆ cf_avgdown_stencil

int REMORA::cf_avgdown_stencil = 1
private

average the fine velocity onto the coarse over ROMS's nine-point stencil (fine2coarse2d, half-width (Rscale-1)/2 in both directions) instead of only the faces that tile the coarse face. On by default: with cf_flux_pc it takes the interface refinement perturbation from 1.29x ROMS's to 1.01x on the matched dogbone, the residual 1% closing only with cf_impose_flux, which stays off. Not conservative in principle – the nine-point mean does not preserve transport across the interface – but only about 3e-10 of volume drift in practice, well under the free-surface ghost band's cost.

Definition at line 2130 of file REMORA.H.

Referenced by AverageDownTo(), and ReadParameters().

◆ cf_avgdown_volume_weighted

int REMORA::cf_avgdown_volume_weighted = 0
private

average the fine tracers onto the coarse weighted by cell volume, Hz/(pm*pn), rather than by area as ROMS's fine2coarse3d does. Off by default. Where the fine layer thickness varies under a coarse cell, as interpolated bathymetry near land makes it, the area mean gains or loses tracer content. Volume weighting keeps it only where the coarse cell's volume matches the fine volumes under it, so not at a coast, and it is not applied to the initial high-resolution cascade (average_down_with_grow_cells).

Definition at line 2138 of file REMORA.H.

Referenced by AverageDownTo(), and ReadParameters().

◆ cf_crse_gen

amrex::Vector<long> REMORA::cf_crse_gen
private

per level: bumped whenever register_coarse_data hands the level's new state to the next finer level, which invalidates that level's cf_2d_cache

Definition at line 2115 of file REMORA.H.

Referenced by FillPatch(), and register_coarse_data().

◆ cf_fill_all_kcomp

int REMORA::cf_fill_all_kcomp = 1
private

write every leapfrog record of the coarse-fine ghost band, as put_refine2d does when it sets zeta(:,:,1:3) and Zt_avg1 to one value; without it those records go a whole parent step stale. On by default. Roundoff on the ROMS-matched deck, where the fine zeta halo is barely read, but the dominant cost to volume conservation on the subcycled dogbone: 2.0e-09 to 2.9e-08 of drift over 20 steps, volume being the integral of the free surface this writes. ROMS makes the same trade.

Definition at line 2087 of file REMORA.H.

Referenced by advance_2d(), and ReadParameters().

◆ cf_fill_vel_after

int REMORA::cf_fill_vel_after = 0
private

re-fill the child's 3D velocity from the parent after the step, so the coarse-fine boundary carries the parent's shear profile rather than the one vert_mean_3d left there. Diagnostic; off, so it changes no answer unless set. Both drivers do it only under this knob – see the comment in Advance. On the ratio-3 Dogbone it moves level-1 x-velocity by 4.1e-3 relative and level 0 by 1.9e-4 after 20 steps.

Definition at line 2070 of file REMORA.H.

Referenced by Advance(), ReadParameters(), and timeStepML().

◆ cf_flux_pc

int REMORA::cf_flux_pc = 1
private

distribute the parent's interface mass flux piecewise-constantly over the fine faces under each parent face, as ROMS's get_persisted2d does, instead of with the linear tangential variation of AMReX's face interpolator. Both conserve the total; they differ in the profile along the interface. On by default: it removes the fine level's own excess divergence there.

Definition at line 2121 of file REMORA.H.

Referenced by ReadParameters(), set_2d_cf_bcs(), and set_2d_cf_flux().

◆ cf_impose_flux

int REMORA::cf_impose_flux = 0
private

impose the parent's barotropic mass flux on DUon/DVom at the coarse-fine interface, rather than relying on the velocity written by set_2d_cf_bcs being turned back into the same flux. Off by default: it improves conservation but does not cure the two-level barotropic instability seen in Channel_Test.

Definition at line 2052 of file REMORA.H.

Referenced by advance_2d(), and ReadParameters().

◆ cf_print_iface

int REMORA::cf_print_iface = -1
private

print the imposed coarse-fine interface velocity at this baroclinic step (-1 = off). Diagnostic only; the fine level is not in the NetCDF output.

Definition at line 2142 of file REMORA.H.

Referenced by ReadParameters(), and set_2d_cf_bcs().

◆ cf_set_2d_bcs

int REMORA::cf_set_2d_bcs = 1
private

0 = never impose the 2D coarse-fine interface condition, 1 = every fast step, 2 = only the first fast step of each baroclinic step.

1 matches ROMS and is the default: put_refine2d runs once before the barotropic loop, but u2dbc_im re-applies the same mass-flux formula on every fast step inside it, so 2 is only half the ROMS schedule. On the dogbone, 2 helps early and is much worse later.

Definition at line 2078 of file REMORA.H.

Referenced by advance_2d(), and ReadParameters().

◆ cf_set_width

int REMORA::cf_set_width {0}
private

Width for fixing values at coarse-fine interface.

Definition at line 1866 of file REMORA.H.

Referenced by Construct_REMORAFillPatchers(), Define_REMORAFillPatchers(), FillPatch(), FillPatchNoBC(), set_2d_cf_bcs(), and set_2d_cf_flux().

◆ cf_time_interp_zeta

int REMORA::cf_time_interp_zeta = 1
private

interpolate the parent in time onto the child's own sub-time, as put_refine2d does, rather than freezing it at the end of the parent step. On by default, and non-conservative for the same reason as cf_fill_all_kcomp: 1.4e-08 of volume drift on its own.

Definition at line 2092 of file REMORA.H.

Referenced by advance_2d(), ReadParameters(), and register_coarse_data().

◆ cf_width

int REMORA::cf_width {0}
private

◆ cfl

amrex::Real REMORA::cfl = Real(0.8)
staticprivate

CFL condition.

Definition at line 2030 of file REMORA.H.

Referenced by estTimeStep(), and ReadParameters().

◆ change_max

amrex::Real REMORA::change_max = Real(1.1)
staticprivate

Fraction maximum change in subsequent time steps.

Definition at line 2032 of file REMORA.H.

Referenced by ComputeDt(), and ReadParameters().

◆ check_cf_metrics_flag

int REMORA::check_cf_metrics_flag = 0
private

measure whether fine cell edges tile the coarse ones at a coarse-fine interface, which is what makes the imposed mass flux conservative

Definition at line 2150 of file REMORA.H.

Referenced by AverageDownTo(), and ReadParameters().

◆ check_cf_tol

amrex::Real REMORA::check_cf_tol = 1.e-12
private

tolerance for the above

Definition at line 2152 of file REMORA.H.

Referenced by check_cf_metrics(), and ReadParameters().

◆ check_file

std::string REMORA::check_file {"chk"}
private

Checkpoint file prefix.

Definition at line 2175 of file REMORA.H.

Referenced by ReadParameters(), and WriteCheckpointFile().

◆ check_int

int REMORA::check_int = -1
private

Checkpoint output interval in iterations.

Definition at line 2177 of file REMORA.H.

Referenced by InitData(), ReadParameters(), WriteAtFinalTime(), and WriteAtIntermediateTime().

◆ check_int_time

amrex::Real REMORA::check_int_time = amrex::Real(-one)
private

Checkpoint output interval in seconds.

Definition at line 2179 of file REMORA.H.

Referenced by InitData(), ReadParameters(), WriteAtFinalTime(), and WriteAtIntermediateTime().

◆ check_plot_z

int REMORA::check_plot_z = 0
private

check the nodal z a viewer rebuilds from the plotfile's Nu_nd set against z_phys_nd on each level, and fine against coarse at coincident nodes

Definition at line 2156 of file REMORA.H.

Referenced by ReadParameters(), and WritePlotFile().

◆ check_plot_z_tol

amrex::Real REMORA::check_plot_z_tol = -1.0
private

abort when the coarse-fine mismatch at interior nodes exceeds this; negative (the default) only reports it, since where a finer level carries finer bathymetry the two levels' bottoms legitimately differ

Definition at line 2160 of file REMORA.H.

Referenced by check_plot_nodal_z(), and ReadParameters().

◆ chunk_history_file

bool REMORA::chunk_history_file = false
private

Whether to split the netcdf history file into fixed-length chunks.

Definition at line 2182 of file REMORA.H.

Referenced by netcdf_plot_path(), and ReadParameters().

◆ clim_cons_time_varname

amrex::Vector<std::string> REMORA::clim_cons_time_varname
private

Vector over cons components of the name of the time field for that tracer's climatology data.

Definition at line 2334 of file REMORA.H.

Referenced by init_only(), and ReadParameters().

◆ clim_u_time_varname

std::string REMORA::clim_u_time_varname = "ocean_time"
private

Name of time field for u climatology data.

Definition at line 2329 of file REMORA.H.

Referenced by init_only(), and ReadParameters().

◆ clim_ubar_time_varname

std::string REMORA::clim_ubar_time_varname = "ocean_time"
private

Name of time field for ubar climatology data.

Definition at line 2325 of file REMORA.H.

Referenced by init_only(), and ReadParameters().

◆ clim_v_time_varname

std::string REMORA::clim_v_time_varname = "ocean_time"
private

Name of time field for v climatology data.

Definition at line 2331 of file REMORA.H.

Referenced by init_only(), and ReadParameters().

◆ clim_vbar_time_varname

std::string REMORA::clim_vbar_time_varname = "ocean_time"
private

Name of time field for vbar climatology data.

Definition at line 2327 of file REMORA.H.

Referenced by ReadParameters().

◆ cloud_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::cloud_data_from_file
private

Data container for cloud cover fraction read from file.

Definition at line 1825 of file REMORA.H.

Referenced by init_only(), and set_surface_state().

◆ cons_clim_data_from_file

amrex::Vector<std::unique_ptr<NCTimeSeries> > REMORA::cons_clim_data_from_file
private

Vector over cons components of climatology data read from file.

Entry icomp is null unless solverChoice.do_cons_clim_nudg[icomp] is set.

Definition at line 1840 of file REMORA.H.

Referenced by advance_3d(), and init_only().

◆ cons_names

◆ cons_new

◆ cons_old

amrex::Vector<amrex::MultiFab*> REMORA::cons_old

multilevel data container for last step's scalar data: temperature, salinity, passive tracer

Definition at line 458 of file REMORA.H.

Referenced by advance_3d(), ClearLevel(), gls_corrector(), InitData(), level0_fields(), MakeNewLevelFromCoarse(), MakeNewLevelFromScratch(), ReadCheckpointFile(), register_coarse_data(), RemakeLevel(), REMORA(), REMORA(), setup_step(), timeStep(), timeStepML(), and WriteCheckpointFile().

◆ Cs_r

amrex::Gpu::DeviceVector<amrex::Real> REMORA::Cs_r

Stretching coefficients at rho points.

Definition at line 542 of file REMORA.H.

Referenced by calc_stretch_coeffs(), init_stretch_coeffs(), stretch_transform(), stretch_transform_full_domain(), and WriteNCPlotFile_which().

◆ Cs_w

amrex::Gpu::DeviceVector<amrex::Real> REMORA::Cs_w

Stretching coefficients at w points.

Definition at line 544 of file REMORA.H.

Referenced by calc_stretch_coeffs(), init_stretch_coeffs(), stretch_transform(), stretch_transform_full_domain(), and WriteNCPlotFile_which().

◆ cum_ref_ratios

◆ datalog

amrex::Vector<std::unique_ptr<std::fstream> > REMORA::datalog
private

Definition at line 2405 of file REMORA.H.

Referenced by DataLog(), NumDataLogs(), ReadParameters(), and setRecordDataInfo().

◆ datalogname

amrex::Vector<std::string> REMORA::datalogname
private

Definition at line 2406 of file REMORA.H.

Referenced by DataLogName(), and ReadParameters().

◆ derived_names_2d

const amrex::Vector<std::string> REMORA::derived_names_2d {}
private

Names of derived fields for 2d plotfile fields.

Definition at line 2215 of file REMORA.H.

Referenced by set2DPlotVariables().

◆ derived_names_3d

const amrex::Vector<std::string> REMORA::derived_names_3d {"vorticity", "omega"}
private

Names of derived fields for 3d plotfile fields.

Definition at line 2213 of file REMORA.H.

Referenced by set3DPlotVariables().

◆ dm_full_domain

amrex::DistributionMapping REMORA::dm_full_domain

the DistributionMapping every full-domain multifab is built on. Each of those covers the domain in a single box, so the map holds one entry, and which rank it names is whichever holds the least fab memory when it is built. Building one per allocator therefore put the mask and the data it weights on different ranks under MPI. Empty until full_domain_dmap first needs it.

Definition at line 1621 of file REMORA.H.

Referenced by full_domain_dmap().

◆ do_reflux

int REMORA::do_reflux = 1
private

correct the coarse tracer with the finer level's accumulated advective flux at their interface. Only has an effect under remora.do_substep with two-way coupling.

Definition at line 2057 of file REMORA.H.

Referenced by Advance(), advance_3d(), ReadParameters(), and reflux_to().

◆ do_substep

int REMORA::do_substep = 1
private

◆ domain_bc_type

amrex::Array<std::string,2*AMREX_SPACEDIM> REMORA::domain_bc_type
private

Array of strings describing domain boundary conditions.

Definition at line 1960 of file REMORA.H.

Referenced by init_bcs(), and writeJobInfo().

◆ domain_bcs_type

amrex::Vector<amrex::BCRec> REMORA::domain_bcs_type
private

◆ domain_bcs_type_d

amrex::Gpu::DeviceVector<amrex::BCRec> REMORA::domain_bcs_type_d
private

GPU vector (over BCVars) of BCRecs.

Definition at line 1957 of file REMORA.H.

Referenced by init_bcs(), and init_stuff().

◆ driver_atmos_forcing_mode

DriverAtmosForcingMode REMORA::driver_atmos_forcing_mode = DriverAtmosForcingMode::State

Active atmosphere-to-ocean forcing contract on the most recent driver apply.

Definition at line 604 of file REMORA.H.

Referenced by ApplyAtmosphericFluxes(), ApplyAtmosphericStates(), ConfigureDriverAtmosToOceanCoupling(), InitData(), SetDriverAtmosToOceanForcingMode(), and setup_step().

◆ driver_atmos_state_from_driver

std::array<bool, AtmosState::NumTypes> REMORA::driver_atmos_state_from_driver {}

provenance flags for driver-supplied atmospheric forcing lanes

Definition at line 598 of file REMORA.H.

Referenced by ApplyAtmosphericFluxes(), ApplyAtmosphericStates(), and set_surface_state().

◆ driver_uses_two_way_coupling

bool REMORA::driver_uses_two_way_coupling = false

Driver-level direction flag copied in before InitData.

Definition at line 602 of file REMORA.H.

Referenced by ConfigureDriverAtmosToOceanCoupling(), and InitData().

◆ drop_dry_boxes

bool REMORA::drop_dry_boxes = true

Leave out level-0 boxes that are land over their whole footprint (remora.drop_dry_boxes)

Definition at line 355 of file REMORA.H.

Referenced by MakeNewLevelFromScratch(), and ReadParameters().

◆ dry_ghost_test

int REMORA::dry_ghost_test = 0

Debug: see poison_dry_ghost_cells.

Definition at line 357 of file REMORA.H.

Referenced by poison_dry_ghost_cells(), and ReadParameters().

◆ dt

amrex::Vector<amrex::Real> REMORA::dt
private

◆ Dubar_fresh

amrex::Vector<int> REMORA::Dubar_fresh

per level, whether vec_Dubar_new and vec_Dvbar_new hold no previous step's flux (just allocated, or a restart from a checkpoint without them), so the next store_2d_flux sets the old snapshot to the new one instead of to that zero

Definition at line 651 of file REMORA.H.

Referenced by init_stuff(), ReadCheckpointFile(), store_2d_flux(), and WriteCheckpointFile().

◆ EminusP_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::EminusP_data_from_file
private

Data container for evaporation minus precipitation read from file.

Definition at line 1827 of file REMORA.H.

Referenced by init_only(), and set_surface_state().

◆ expand_plotvars_to_unif_rr

bool REMORA::expand_plotvars_to_unif_rr = false
private

whether plotfile variables should be expanded to a uniform refinement ratio

Definition at line 2221 of file REMORA.H.

Referenced by ReadParameters(), and WritePlotFile().

◆ file_min_digits

int REMORA::file_min_digits = 5
staticprivate

Minimum number of digits in plotfile name or chunked history file.

Definition at line 2274 of file REMORA.H.

Referenced by netcdf_plot_path(), ReadParameters(), WriteCheckpointFile(), and WritePlotFile().

◆ fine_mask

amrex::MultiFab REMORA::fine_mask
private

Mask that zeroes out values on a coarse level underlying grids on the next finest level.

Definition at line 2354 of file REMORA.H.

Referenced by build_fine_mask().

◆ fixed_dt

amrex::Real REMORA::fixed_dt = -one
staticprivate

User specified fixed baroclinic time step.

Definition at line 2034 of file REMORA.H.

Referenced by estTimeStep(), and ReadParameters().

◆ FPr_c

amrex::Vector<REMORAFillPatcher> REMORA::FPr_c
private

Vector over levels of FillPatchers for scalars.

Definition at line 1869 of file REMORA.H.

Referenced by Construct_REMORAFillPatchers(), Define_REMORAFillPatchers(), FillPatch(), FillPatchNoBC(), register_coarse_data(), and timeStepML().

◆ FPr_Dubar

amrex::Vector<REMORAFillPatcher> REMORA::FPr_Dubar
private

Vector over levels of FillPatchers for Dubar (2D)

Definition at line 1883 of file REMORA.H.

Referenced by Construct_REMORAFillPatchers(), Define_REMORAFillPatchers(), register_coarse_data(), set_2d_cf_bcs(), and set_2d_cf_flux().

◆ FPr_Dvbar

amrex::Vector<REMORAFillPatcher> REMORA::FPr_Dvbar
private

Vector over levels of FillPatchers for Dvbar (2D)

Definition at line 1885 of file REMORA.H.

Referenced by Construct_REMORAFillPatchers(), Define_REMORAFillPatchers(), register_coarse_data(), set_2d_cf_bcs(), and set_2d_cf_flux().

◆ FPr_u

amrex::Vector<REMORAFillPatcher> REMORA::FPr_u
private

Vector over levels of FillPatchers for u (3D)

Definition at line 1871 of file REMORA.H.

Referenced by Construct_REMORAFillPatchers(), Define_REMORAFillPatchers(), FillPatch(), FillPatchNoBC(), register_coarse_data(), and timeStepML().

◆ FPr_ubar

amrex::Vector<REMORAFillPatcher> REMORA::FPr_ubar
private

Vector over levels of FillPatchers for ubar (2D)

Definition at line 1879 of file REMORA.H.

Referenced by Construct_REMORAFillPatchers(), Define_REMORAFillPatchers(), FillPatch(), FillPatchNoBC(), register_coarse_data(), and timeStepML().

◆ FPr_v

amrex::Vector<REMORAFillPatcher> REMORA::FPr_v
private

Vector over levels of FillPatchers for v (3D)

Definition at line 1873 of file REMORA.H.

Referenced by Construct_REMORAFillPatchers(), Define_REMORAFillPatchers(), FillPatch(), FillPatchNoBC(), register_coarse_data(), and timeStepML().

◆ FPr_vbar

amrex::Vector<REMORAFillPatcher> REMORA::FPr_vbar
private

Vector over levels of FillPatchers for vbar (2D)

Definition at line 1881 of file REMORA.H.

Referenced by Construct_REMORAFillPatchers(), Define_REMORAFillPatchers(), FillPatch(), FillPatchNoBC(), register_coarse_data(), and timeStepML().

◆ FPr_w

amrex::Vector<REMORAFillPatcher> REMORA::FPr_w
private

Vector over levels of FillPatchers for w.

Definition at line 1875 of file REMORA.H.

Referenced by Construct_REMORAFillPatchers(), Define_REMORAFillPatchers(), FillPatch(), FillPatchNoBC(), register_coarse_data(), and timeStepML().

◆ frc_regrid_options

LatLonRegridOptions REMORA::frc_regrid_options
private

How forcing on a lat-lon grid is interpolated (remora.frc_regrid and friends)

Definition at line 2341 of file REMORA.H.

Referenced by init_only(), ReadParameters(), set_smflux(), and winds_need_rotation().

◆ frc_time_varname

std::string REMORA::frc_time_varname = ""
private

Name of time field for forcing data.

Definition at line 2338 of file REMORA.H.

Referenced by init_only(), and ReadParameters().

◆ hires_grid_level

◆ hires_init_level

◆ history_count

int REMORA::history_count = 0
private

Counter for which time index we are writing to in the netcdf history file.

Definition at line 2186 of file REMORA.H.

Referenced by InitData(), netcdf_plot_path(), ReadCheckpointFile(), WriteAtFinalTime(), WriteAtIntermediateTime(), and WriteCheckpointFile().

◆ history_files

amrex::Vector<NCHistoryFile> REMORA::history_files
private

Per level, the history file it is writing to.

Definition at line 2199 of file REMORA.H.

Referenced by WriteNCPlotFile().

◆ istep

◆ last_check_file_step

int REMORA::last_check_file_step
private

Step when we last output a checkpoint file.

Definition at line 1987 of file REMORA.H.

Referenced by InitData(), restart(), WriteAtFinalTime(), and WriteAtIntermediateTime().

◆ last_check_file_time

amrex::Real REMORA::last_check_file_time
private

Simulation time when we last output a checkpoint file.

Definition at line 1989 of file REMORA.H.

Referenced by InitData(), restart(), and WriteAtIntermediateTime().

◆ last_plot_file_step

int REMORA::last_plot_file_step
private

Step when we last output a plotfile.

Definition at line 1982 of file REMORA.H.

Referenced by InitData(), WriteAtFinalTime(), WriteAtIntermediateTime(), and WriteCheckpointFile().

◆ last_plot_file_time

amrex::Real REMORA::last_plot_file_time
private

Simulation time when we last output a plotfile.

Definition at line 1984 of file REMORA.H.

Referenced by InitData(), restart(), WriteAtFinalTime(), and WriteAtIntermediateTime().

◆ load_balance

LoadBalance REMORA::load_balance = LoadBalance::sfc

Definition at line 365 of file REMORA.H.

Referenced by load_balance_name(), MakeDistributionMap(), and ReadParameters().

◆ load_balance_land_weight

amrex::Real REMORA::load_balance_land_weight = amrex::Real(1.0)

cost of a land cell relative to a wet one in the load-balance weights (remora.load_balance_land_weight); 1 weighs boxes by cell count

Definition at line 368 of file REMORA.H.

Referenced by MakeDistributionMap(), and ReadParameters().

◆ longwave_down_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::longwave_down_data_from_file
private

Data container for downward longwave radiation flux read from file.

Definition at line 1821 of file REMORA.H.

Referenced by init_only(), and set_surface_state().

◆ m_bc_extdir_vals

amrex::Vector<amrex::GpuArray<amrex::Real, AMREX_SPACEDIM*2> > REMORA::m_bc_extdir_vals
private

Array holding the Dirichlet values at walls which need them.

Definition at line 1963 of file REMORA.H.

Referenced by init_bcs(), and init_stuff().

◆ m_biology

std::unique_ptr<REMORABiology::Biology> REMORA::m_biology = REMORABiology::make_biology("none")
private

Selected ecosystem, owning its parameters and host-side kernels.

Definition at line 2024 of file REMORA.H.

Referenced by advance_biology(), init_biology_ic(), init_biology_ic_full_domain(), init_scalar_metadata(), ReadParameters(), and set3DPlotVariables().

◆ m_reported_atm_flux_validation

bool REMORA::m_reported_atm_flux_validation = false

Latch so the flux validation block prints once per run unless remora.v >= 1.

Definition at line 259 of file REMORA.H.

Referenced by ApplyAtmosphericFluxes().

◆ m_use_hydro_particles

bool REMORA::m_use_hydro_particles
private

tracer particles that fall with gravity

Definition at line 2237 of file REMORA.H.

Referenced by evolveTracers(), initializeTracers(), readTracersParams(), and store_particle_omega().

◆ m_use_tracer_particles

bool REMORA::m_use_tracer_particles
private

tracer particles that advect with flow

Definition at line 2235 of file REMORA.H.

Referenced by evolveTracers(), initializeTracers(), readTracersParams(), and store_particle_omega().

◆ m_warned_surface_temp_max

amrex::Real REMORA::m_warned_surface_temp_max = amrex::Real(273.15 + 40.0)

Definition at line 263 of file REMORA.H.

Referenced by PackSurfaceState().

◆ m_warned_surface_temp_min

amrex::Real REMORA::m_warned_surface_temp_min = amrex::Real(273.15 - 2.5)

Worst wet surface temperature extremes (K) and NaN count already warned about; the warning repeats only when a later exchange is worse. Start at the bounds.

Definition at line 262 of file REMORA.H.

Referenced by PackSurfaceState().

◆ m_warned_surface_temp_nan

amrex::Long REMORA::m_warned_surface_temp_nan = 0

Definition at line 264 of file REMORA.H.

Referenced by PackSurfaceState().

◆ max_step

int REMORA::max_step = std::numeric_limits<int>::max()
private

maximum number of steps

Definition at line 1997 of file REMORA.H.

Referenced by Evolve(), and ReadParameters().

◆ n_scratch_2d

constexpr int REMORA::n_scratch_2d = 7
staticconstexpr

Definition at line 626 of file REMORA.H.

Referenced by advance_2d(), and init_stuff().

◆ nbio

int REMORA::nbio = 0
private

Number of biology tracers, set by the active biology model. Zero when no biology model is active.

Definition at line 2016 of file REMORA.H.

Referenced by advance_biology(), init_biology_from_netcdf(), init_biology_full_domain_from_netcdf(), init_biology_ic(), init_biology_ic_full_domain(), num_bio(), ReadParameters(), and set3DPlotVariables().

◆ nc_bdry_file

amrex::Vector< std::string > REMORA::nc_bdry_file = {""}
staticprivate

NetCDF boundary data.

Definition at line 59 of file REMORA.H.

Referenced by init_bdry_from_netcdf(), and ReadParameters().

◆ nc_clim_coeff_file

std::string REMORA::nc_clim_coeff_file
private

NetCDF climatology coefficient file.

Definition at line 2317 of file REMORA.H.

Referenced by init_clim_nudg_coeff(), init_clim_nudg_coeff_from_netcdf(), and ReadParameters().

◆ nc_clim_his_file

amrex::Vector<std::string> REMORA::nc_clim_his_file
private

NetCDF climatology history file(s)

Definition at line 2315 of file REMORA.H.

Referenced by init_only(), and ReadParameters().

◆ nc_frc_file

amrex::Vector<std::string> REMORA::nc_frc_file
private

NetCDF forcing file(s)

Definition at line 2310 of file REMORA.H.

Referenced by init_only(), and ReadParameters().

◆ nc_grid_file

amrex::Vector< amrex::Vector< std::string > > REMORA::nc_grid_file = {{""}}
staticprivate

◆ nc_grid_file_hires

std::string REMORA::nc_grid_file_hires
private

Grid file for high resolution bathymetry.

Definition at line 2295 of file REMORA.H.

Referenced by init_bathymetry_full_domain_from_netcdf(), init_grid_vars_full_domain_from_netcdf(), init_masks_full_domain_from_netcdf(), and ReadParameters().

◆ nc_hires_grid_box

amrex::Box REMORA::nc_hires_grid_box
private

◆ nc_hires_init_box

amrex::Box REMORA::nc_hires_init_box
private

◆ nc_init_file

amrex::Vector< amrex::Vector< std::string > > REMORA::nc_init_file = {{""}}
staticprivate

NetCDF initialization file.

Definition at line 60 of file REMORA.H.

Referenced by init_biology_from_netcdf(), init_data_from_netcdf(), init_scalars_from_netcdf(), init_zeta_from_netcdf(), and ReadParameters().

◆ nc_init_file_hires

std::string REMORA::nc_init_file_hires
private

◆ nc_riv_file

amrex::Vector<std::string> REMORA::nc_riv_file
private

NetCDF river file(s)

Definition at line 2312 of file REMORA.H.

Referenced by init_only(), init_riv_pos_from_netcdf(), and ReadParameters().

◆ ncons

◆ ndtfast

int REMORA::ndtfast = 0
staticprivate

User specified, number of barotropic steps per baroclinic step.

Definition at line 2036 of file REMORA.H.

Referenced by Advance(), estTimeStep(), print_timestep_hierarchy(), ReadParameters(), set_weights(), and timeStepML().

◆ netcdf_fill_value

amrex::Real REMORA::netcdf_fill_value = amrex::Real(1.0e37)
private

fill value for masked arrays in netcdf output

Definition at line 2226 of file REMORA.H.

Referenced by compute_omega_and_w(), ReadParameters(), WriteNCPlotFile_which(), and WritePlotFile().

◆ nfast

int REMORA::nfast
private

Number of fast steps to take.

Definition at line 2038 of file REMORA.H.

Referenced by Advance(), advance_2d(), print_timestep_hierarchy(), set_weights(), and timeStepML().

◆ nscalar

int REMORA::nscalar = 0
private

Number of passive (dye) scalars carried in the state, beyond temperature and salinity. Does not count biology tracers. Dye is opt-in: a run carries one only when remora.nscalar asks for it.

Definition at line 2013 of file REMORA.H.

Referenced by init_scalar_metadata(), init_scalars_from_netcdf(), init_scalars_full_domain_from_netcdf(), num_passive_scalars(), num_scalar(), and ReadParameters().

◆ nsubsteps

amrex::Vector<int> REMORA::nsubsteps
private

How many substeps on each level?

Definition at line 1918 of file REMORA.H.

Referenced by ComputeDt(), print_timestep_hierarchy(), set_nsubsteps(), timeStep(), and timeStepML().

◆ num_boxes_at_level

◆ num_files_at_level

amrex::Vector<int> REMORA::num_files_at_level
private

how many netcdf input files specified at each level

Definition at line 1911 of file REMORA.H.

Referenced by ReadParameters().

◆ Pair_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::Pair_data_from_file
private

Data container for air pressure read from file.

Definition at line 1817 of file REMORA.H.

Referenced by init_only(), and set_surface_state().

◆ particle_advect

amrex::Vector<amrex::Vector<int> > REMORA::particle_advect
private

Per level and species, whether the species advects on the level this step.

Definition at line 2262 of file REMORA.H.

Referenced by evolveTracers(), and store_particle_omega().

◆ particle_omega

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::particle_omega
private

Per level, the omega and the boundary-filled u and v that particles advect with. Kept between steps, and redefined when the level's grids change.

Definition at line 2255 of file REMORA.H.

Referenced by ClearLevel(), evolveTracers(), and store_particle_omega().

◆ particle_omega_stored

amrex::Vector<int> REMORA::particle_omega_stored
private

Per level, whether store_particle_omega has run since the last evolveTracers, and so whether particle_omega and particle_advect hold this step's values.

Definition at line 2260 of file REMORA.H.

Referenced by evolveTracers(), and store_particle_omega().

◆ particle_u

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::particle_u
private

Definition at line 2256 of file REMORA.H.

Referenced by ClearLevel(), and evolveTracers().

◆ particle_v

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::particle_v
private

Definition at line 2257 of file REMORA.H.

Referenced by ClearLevel(), and evolveTracers().

◆ particleData

◆ phys_bc_need_data

amrex::Vector<amrex::GpuArray<bool, AMREX_SPACEDIM*2> > REMORA::phys_bc_need_data
private

These are flags that indicate whether we need to read in boundary data from file.

Sized num_bdy_vars()+1; the extra trailing slot is a scratch entry that variables with no NetCDF boundary lane (see bdy_index) write into and nothing reads.

Definition at line 1973 of file REMORA.H.

Referenced by init_bcs(), and init_bdry_from_netcdf().

◆ phys_bc_type

amrex::Vector<amrex::GpuArray<REMORA_BC, AMREX_SPACEDIM*2> > REMORA::phys_bc_type
private

Array holding the "physical" boundary condition types (e.g. "inflow")

Definition at line 1966 of file REMORA.H.

Referenced by FillBdyCCVels(), and init_bcs().

◆ physbcs

amrex::Vector<std::unique_ptr<REMORAPhysBCFunct> > REMORA::physbcs
private

Vector (over level) of functors to apply physical boundary conditions.

Definition at line 1937 of file REMORA.H.

Referenced by advance_3d(), FillCoarsePatchMap(), FillPatchBCs(), gls_corrector(), init_stuff(), init_zeta_from_netcdf(), REMORA(), REMORA(), and setup_step().

◆ plot_file_name

std::string REMORA::plot_file_name {"plt_"}
private

Plotfile prefix.

Definition at line 2169 of file REMORA.H.

Referenced by netcdf_plot_path(), ReadParameters(), and WritePlotFile().

◆ plot_file_on_restart

int REMORA::plot_file_on_restart = 1
private

Whether to output a plotfile on restart from checkpoint.

Definition at line 1991 of file REMORA.H.

Referenced by InitData().

◆ plot_int

int REMORA::plot_int = -1
private

Plotfile output interval in iterations.

Definition at line 2171 of file REMORA.H.

Referenced by InitData(), ReadParameters(), WriteAtFinalTime(), and WriteAtIntermediateTime().

◆ plot_int_time

amrex::Real REMORA::plot_int_time = amrex::Real(-one)
private

Plotfile output interval in seconds.

Definition at line 2173 of file REMORA.H.

Referenced by InitData(), ReadParameters(), WriteAtFinalTime(), and WriteAtIntermediateTime().

◆ plot_nodal_data

bool REMORA::plot_nodal_data = true
staticprivate

Whether to write nodal data (Nu_nd) to plotfiles.

Definition at line 2280 of file REMORA.H.

Referenced by check_plot_nodal_z(), ReadParameters(), WriteGenericPlotfileHeaderWithBathymetry(), WriteMultiLevelPlotfileWithBathymetry(), and WritePlotFile().

◆ plot_omega

bool REMORA::plot_omega = false
private

Whether to write omega, the S-coordinate vertical velocity, to NetCDF output.

Definition at line 2206 of file REMORA.H.

Referenced by set3DPlotVariables(), WriteNCPlotFile_which(), and WritePlotFile().

◆ plot_staggered_vels

bool REMORA::plot_staggered_vels = false
staticprivate

Whether to write the staggered velocities (not averaged to cell centers)

Definition at line 2277 of file REMORA.H.

Referenced by ReadParameters(), WriteGenericPlotfileHeaderWithBathymetry(), WriteMultiLevelPlotfileWithBathymetry(), and WritePlotFile().

◆ plot_var_names_2d

amrex::Vector<std::string> REMORA::plot_var_names_2d
private

Names of 2D variables to output to AMReX plotfile.

Definition at line 2204 of file REMORA.H.

Referenced by append2DPlotVariables(), set2DPlotVariables(), WriteNCPlotFile_which(), and WritePlotFile().

◆ plot_var_names_3d

amrex::Vector<std::string> REMORA::plot_var_names_3d
private

Names of 3D variables to output to AMReX plotfile.

Definition at line 2202 of file REMORA.H.

Referenced by append3DPlotVariables(), set3DPlotVariables(), WriteNCPlotFile_which(), and WritePlotFile().

◆ plot_wvel

bool REMORA::plot_wvel = false
private

Whether to write z_velocity, the true vertical velocity, to NetCDF output as w.

Definition at line 2208 of file REMORA.H.

Referenced by set3DPlotVariables(), WriteNCPlotFile_which(), and WritePlotFile().

◆ plotfile_fill_value

amrex::Real REMORA::plotfile_fill_value = zero
private

fill value for masked arrays in amrex plotfiles

Definition at line 2224 of file REMORA.H.

Referenced by ReadParameters(), and WritePlotFile().

◆ plotfile_type

PlotfileType REMORA::plotfile_type = PlotfileType::amrex
staticprivate

Native or NetCDF plotfile output.

Definition at line 2283 of file REMORA.H.

Referenced by ReadParameters(), and WritePlotFile().

◆ pp_prefix

std::string REMORA::pp_prefix {"remora"}

◆ previousCPUTimeUsed

amrex::Real REMORA::previousCPUTimeUsed = zero
staticprivate

Accumulator variable for CPU time used thusfar.

Definition at line 2374 of file REMORA.H.

Referenced by getCPUTime().

◆ prob

◆ qair_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::qair_data_from_file
private

Data container for specific humidity read from file.

Definition at line 1815 of file REMORA.H.

Referenced by init_only(), and set_surface_state().

◆ rain_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::rain_data_from_file
private

Data container for precipitation rate read from file.

Definition at line 1823 of file REMORA.H.

Referenced by init_only(), and set_surface_state().

◆ ref_tags

Vector< REMORAErrorTag > REMORA::ref_tags
staticprivate

Holds info for dynamically generated tagging criteria.

Definition at line 2351 of file REMORA.H.

Referenced by ErrorEst(), level0_refine_footprint(), and refinement_criteria_setup().

◆ refine_region_unbounded

bool REMORA::refine_region_unbounded = false

Whether some refinement indicator has no region, so it may refine anywhere.

Definition at line 361 of file REMORA.H.

Referenced by level0_refine_footprint(), and refinement_criteria_setup().

◆ refine_regions

amrex::Vector<amrex::RealBox> REMORA::refine_regions

Physical-space region of each refinement indicator, for level0_refine_footprint.

Definition at line 359 of file REMORA.H.

Referenced by level0_refine_footprint(), and refinement_criteria_setup().

◆ reflux_clamp

int REMORA::reflux_clamp = 1
private

stop that correction driving a tracer negative, as ROMS does. On by default to match ROMS; costs exact conservation on any step that clamps.

Definition at line 2146 of file REMORA.H.

Referenced by ReadParameters(), and reflux_to().

◆ regrid_int

int REMORA::regrid_int = 2
private

how often each level regrids the higher levels of refinement (after a level advances that many time steps)

Definition at line 2163 of file REMORA.H.

Referenced by ReadParameters(), refinement_criteria_setup(), timeStep(), and timeStepML().

◆ regrid_int_from_input

bool REMORA::regrid_int_from_input = false
private

Whether the input set amr.regrid_int (queryAdd makes it present afterwards)

Definition at line 2165 of file REMORA.H.

Referenced by ReadParameters(), and refinement_criteria_setup().

◆ restart_chkfile

std::string REMORA::restart_chkfile = ""
private

If set, restart from this checkpoint file.

Definition at line 2008 of file REMORA.H.

Referenced by InitData(), MakeNewLevelFromScratch(), ReadCheckpointFile(), ReadParameters(), and WriteNCPlotFile().

◆ riv_time_varname

std::string REMORA::riv_time_varname = "river_time"
private

Name of time field for river time.

Definition at line 2336 of file REMORA.H.

Referenced by init_only(), and ReadParameters().

◆ river_direction

amrex::Gpu::DeviceVector<int> REMORA::river_direction
private

Vector over rivers of river direction: 0: u-face; 1: v-face; 2: w-face.

Definition at line 1856 of file REMORA.H.

Referenced by advance_2d(), advance_3d(), init_riv_pos_from_netcdf(), prestep_t_advection(), and rhs_t_3d().

◆ river_source_cons

amrex::Vector<std::unique_ptr<NCTimeSeriesRiver> > REMORA::river_source_cons
private

Vector of data containers for scalar data in rivers.

Definition at line 1843 of file REMORA.H.

Referenced by advance_3d(), init_only(), and prestep().

◆ river_source_transport

std::unique_ptr<NCTimeSeriesRiver> REMORA::river_source_transport
private

Data container for momentum transport in rivers.

Definition at line 1845 of file REMORA.H.

Referenced by advance_3d(), and init_only().

◆ river_source_transportbar

std::unique_ptr<NCTimeSeriesRiver> REMORA::river_source_transportbar
private

Data container for vertically integrated momentum transport in rivers.

Definition at line 1847 of file REMORA.H.

Referenced by advance_2d(), and init_only().

◆ running_with_coupling_driver

bool REMORA::running_with_coupling_driver = false

True once REMORA has received forcing through the coupling driver.

Definition at line 600 of file REMORA.H.

Referenced by ApplyAtmosphericFluxes(), ApplyAtmosphericStates(), ConfigureDriverAtmosToOceanCoupling(), drop_dry_level0_boxes(), InitData(), and setup_step().

◆ s_r

amrex::Gpu::DeviceVector<amrex::Real> REMORA::s_r

Scaled vertical coordinate (range [0,1]) that transforms to z, defined at rho points (cell centers)

Definition at line 532 of file REMORA.H.

Referenced by calc_stretch_coeffs(), init_stretch_coeffs(), stretch_transform(), and WriteNCPlotFile_which().

◆ s_w

amrex::Gpu::DeviceVector<amrex::Real> REMORA::s_w

Scaled vertical coordinate (range [0,1]) that transforms to z, defined at w-points (cell faces)

Definition at line 534 of file REMORA.H.

Referenced by calc_stretch_coeffs(), init_stretch_coeffs(), stretch_transform(), and WriteNCPlotFile_which().

◆ set_bcs_by_var

bool REMORA::set_bcs_by_var
private

whether to set boundary conditions by variable rather than just by side

Definition at line 1934 of file REMORA.H.

Referenced by init_bcs().

◆ solverChoice

SolverChoice REMORA::solverChoice
staticprivate

Container for algorithmic choices.

Definition at line 2218 of file REMORA.H.

Referenced by Advance(), advance_2d(), advance_3d(), advance_biology(), ApplyAtmosphericFluxes(), average_down_with_grow_cells(), bulk_fluxes(), calc_stretch_coeffs(), check_mask_consistency(), define_flux_register(), drop_dry_level0_boxes(), ensure_full_domain_masks(), ErrorEst(), estTimeStep(), fill_from_bdyfiles(), FillCoarsePatchMap(), FillPatchBCs(), GetDeckConfiguredAtmosStateLanes(), gls_corrector(), init_analytic(), init_bathymetry_full_domain_from_analytic(), init_bcs(), init_bdry_from_netcdf(), init_beta_plane_coriolis(), init_biology_ic(), init_biology_ic_full_domain(), init_clim_nudg_coeff(), init_clim_nudg_coeff_from_netcdf(), init_full_domain_from_analytic(), init_masks_full_domain_from_analytic(), init_only(), init_set_vmix(), init_stuff(), init_zeta_from_netcdf(), InitData(), lin_eos(), MakeNewLevelFromCoarse(), nonlin_eos(), post_timestep(), prestep(), prestep_t_advection(), probe_rho_mask(), prsgrd(), ReadCheckpointFile(), ReadParameters(), reflux_to(), RemakeLevel(), rho_eos(), rhs_t_3d(), rhs_uv_3d(), set2DPlotVariables(), set_analytic_vmix(), set_bathymetry(), set_coriolis(), set_grid_scale(), set_hmixcoef(), set_masks(), set_smflux(), set_surface_state(), set_zeta(), set_zeta_to_Ztavg(), SetLongwaveFromDriver(), setup_step(), stretch_transform(), stretch_transform_full_domain(), t3dmix2(), timeStep(), timeStepML(), WriteCheckpointFile(), WriteNCPlotFile_which(), and WritePlotFile().

◆ srflx_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::srflx_data_from_file
private

Data container for shortwave radiation flux read from file.

Definition at line 1819 of file REMORA.H.

Referenced by init_only(), and set_surface_state().

◆ start_time

double REMORA::start_time = 0.0
private

Time of the start of the simulation, in seconds on the model clock.

Also the origin of t_new and t_old. Double regardless of Real: seconds since a calendar epoch outgrow a float's resolution within days.

Definition at line 2005 of file REMORA.H.

Referenced by elapsed_time(), model_time(), ReadCheckpointFile(), ReadParameters(), SetStartTime(), WriteCheckpointFile(), and WriteNCPlotFile_which().

◆ startCPUTime

amrex::Real REMORA::startCPUTime = zero
staticprivate

Variable for CPU timing.

Definition at line 2372 of file REMORA.H.

Referenced by getCPUTime(), and InitData().

◆ steps_per_history_file

int REMORA::steps_per_history_file = -1
private

Time steps per netcdf history file. Must be > 0 if chunk_history_file.

Definition at line 2184 of file REMORA.H.

Referenced by netcdf_plot_path(), and ReadParameters().

◆ stop_time

double REMORA::stop_time = std::numeric_limits<amrex::Real>::max()
private

Time to stop, in seconds on the model clock (not since start_time)

Definition at line 1999 of file REMORA.H.

Referenced by ComputeDt(), Evolve(), EvolveOneStep(), and ReadParameters().

◆ stress_on_rho

bool REMORA::stress_on_rho = false
private

Whether the surface stress is read on rho points, from a lat-lon grid.

Definition at line 1807 of file REMORA.H.

Referenced by init_only(), and set_smflux().

◆ sum_interval

int REMORA::sum_interval = -1
staticprivate

Diagnostic sum output interval in number of steps.

Definition at line 2269 of file REMORA.H.

Referenced by InitData(), post_timestep(), and ReadParameters().

◆ sum_per

amrex::Real REMORA::sum_per = -one
staticprivate

Diagnostic sum output interval in time.

Definition at line 2271 of file REMORA.H.

Referenced by InitData(), post_timestep(), and ReadParameters().

◆ sustr_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::sustr_data_from_file
private

Data container for u-component surface momentum flux read from file.

Definition at line 1798 of file REMORA.H.

Referenced by init_only(), and set_smflux().

◆ svstr_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::svstr_data_from_file
private

Data container for v-component surface momentum flux read from file.

Definition at line 1800 of file REMORA.H.

Referenced by init_only(), and set_smflux().

◆ t_new

amrex::Vector<amrex::Real> REMORA::t_new
private

new time at each level, in seconds since start_time

Model time is split into a double start_time and a Real elapsed time, as ROMS splits DSTART from the time it advances. The solver, the FillPatch time interpolation, and the kernels only ever see elapsed time, which stays small enough for a float to resolve a timestep. Anything that needs a time on the model clock – forcing and boundary files, the calendar, output time stamps, user-given times – goes through model_time() in double.

Definition at line 1927 of file REMORA.H.

Referenced by advance_2d(), ComputeDt(), Evolve(), EvolveOneStep(), evolveTracers(), FillPatch(), FillPatchNoBC(), GetDataAtTime(), gls_corrector(), history_restart_record(), init_only(), init_zeta_from_netcdf(), InitData(), MakeNewLevelFromCoarse(), plot_node_coords(), ReadCheckpointFile(), RemakeLevel(), REMORA(), REMORA(), restart(), set_2d_cf_bcs(), set_2darrays(), set_init_data_averaged_down(), set_zeta_averaged_down(), setup_step(), timeStep(), timeStepML(), WriteAtFinalTime(), WriteCheckpointFile(), WriteNCPlotFile_which(), and WritePlotFile().

◆ t_old

◆ Tair_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::Tair_data_from_file
private

Data container for air temperature read from file.

Definition at line 1813 of file REMORA.H.

Referenced by init_only(), and set_surface_state().

◆ time_interp_flux

bool REMORA::time_interp_flux = false
private

interpolate the parent's barotropic mass flux in time at the coarse-fine interface, rather than holding its step average. Off matches most ROMS configurations.

Definition at line 2046 of file REMORA.H.

Referenced by ReadParameters(), and register_coarse_data().

◆ total_nc_plot_file_step

int REMORA::total_nc_plot_file_step = 1
static

Definition at line 1689 of file REMORA.H.

Referenced by WriteNCPlotFile_which().

◆ u_clim_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::u_clim_data_from_file
private

Data container for u-velocity climatology data read from file.

Definition at line 1834 of file REMORA.H.

Referenced by init_only(), and setup_step().

◆ ubar_clim_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::ubar_clim_data_from_file
private

Data container for ubar climatology data read from file.

Definition at line 1830 of file REMORA.H.

Referenced by advance_2d(), and init_only().

◆ Uwind_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::Uwind_data_from_file
private

Data container for u-direction wind read from file.

Definition at line 1809 of file REMORA.H.

Referenced by init_only(), set_surface_state(), and winds_need_rotation().

◆ v_clim_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::v_clim_data_from_file
private

Data container for v-velocity climatology data read from file.

Definition at line 1836 of file REMORA.H.

Referenced by init_only(), and setup_step().

◆ vbar_clim_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::vbar_clim_data_from_file
private

Data container for vbar climatology data read from file.

Definition at line 1832 of file REMORA.H.

Referenced by advance_2d(), and init_only().

◆ vec_Akk

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Akk

Turbulent kinetic energy vertical diffusion coefficient.

Definition at line 792 of file REMORA.H.

Referenced by advance_3d(), gls_corrector(), init_gls_vmix(), init_stuff(), level0_fields(), ReadCheckpointFile(), resize_stuff(), and WriteCheckpointFile().

◆ vec_Akp

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Akp

Turbulent length scale vertical diffusion coefficient.

Definition at line 794 of file REMORA.H.

Referenced by advance_3d(), gls_corrector(), init_gls_vmix(), init_stuff(), level0_fields(), ReadCheckpointFile(), resize_stuff(), and WriteCheckpointFile().

◆ vec_Akt

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Akt

◆ vec_Akv

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Akv

◆ vec_alpha

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_alpha

Thermal expansion coefficient (3D)

Definition at line 775 of file REMORA.H.

Referenced by init_stuff(), level0_fields(), resize_stuff(), and setup_step().

◆ vec_angler

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_angler

angle from east to the local xi axis on rho-points (2D, radians, positive counterclockwise: ROMS's angle); only filled when the grid NetCDF file carries angle

Definition at line 751 of file REMORA.H.

Referenced by init_grid_vars_from_netcdf(), init_only(), level0_fields(), resize_stuff(), set_grid_scale(), set_grid_vars_averaged_down(), set_smflux(), set_surface_state(), WriteNCPlotFile_which(), and WritePlotFile().

◆ vec_angler_full_domain

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_angler_full_domain

angle on the whole domain, as vec_lonr_full_domain

Definition at line 758 of file REMORA.H.

Referenced by init_grid_vars_full_domain_from_netcdf(), resize_stuff(), and set_grid_vars_averaged_down().

◆ vec_beta

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_beta

Saline contraction coefficient (3D)

Definition at line 777 of file REMORA.H.

Referenced by init_stuff(), level0_fields(), resize_stuff(), and setup_step().

◆ vec_btflux

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_btflux

Bottom tracer flux; input arrays.

Definition at line 586 of file REMORA.H.

Referenced by init_stuff(), level0_fields(), resize_stuff(), and setup_step().

◆ vec_btflx

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_btflx

Bottom tracer flux; working arrays.

Definition at line 584 of file REMORA.H.

Referenced by init_stuff(), level0_fields(), prestep(), resize_stuff(), and setup_step().

◆ vec_bustr

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_bustr

Bottom stress in the u direction.

Definition at line 614 of file REMORA.H.

Referenced by gls_corrector(), init_stuff(), level0_fields(), resize_stuff(), setup_step(), and WritePlotFile().

◆ vec_bvf

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_bvf

Brunt-Vaisala frequency (3D)

Definition at line 773 of file REMORA.H.

Referenced by gls_corrector(), init_stuff(), level0_fields(), resize_stuff(), and setup_step().

◆ vec_bvstr

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_bvstr

Bottom stress in the v direction.

Definition at line 616 of file REMORA.H.

Referenced by gls_corrector(), init_stuff(), level0_fields(), resize_stuff(), setup_step(), and WritePlotFile().

◆ vec_cloud

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_cloud

cloud cover fraction [0-1], defined at rho-points

Definition at line 593 of file REMORA.H.

Referenced by ApplyAtmosphericStates(), bulk_fluxes(), init_only(), init_stuff(), level0_fields(), resize_stuff(), and set_surface_state().

◆ vec_cons_full_domain

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_cons_full_domain

◆ vec_diff2

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_diff2

Harmonic diffusivity for temperature / salinity.

Definition at line 524 of file REMORA.H.

Referenced by init_stuff(), level0_fields(), mask_arrays_for_write(), resize_stuff(), set_hmixcoef(), setup_step(), WriteNCPlotFile_which(), and WritePlotFile().

◆ vec_dmde

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_dmde

◆ vec_dndx

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_dndx

◆ vec_DU_avg1

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_DU_avg1

time average of barotropic x velocity flux (2D)

Definition at line 632 of file REMORA.H.

Referenced by advance_2d_onestep(), advance_3d_ml(), init_stuff(), level0_fields(), ReadCheckpointFile(), resize_stuff(), and WriteCheckpointFile().

◆ vec_DU_avg2

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_DU_avg2

correct time average of barotropic x velocity flux for coupling (2D)

Definition at line 634 of file REMORA.H.

Referenced by advance_2d_onestep(), advance_3d_ml(), init_stuff(), level0_fields(), ReadCheckpointFile(), resize_stuff(), store_2d_flux(), and WriteCheckpointFile().

◆ vec_Dubar_new

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Dubar_new

◆ vec_Dubar_old

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Dubar_old

DU_avg2 per unit cell edge length, at the start and end of this level's step. What a subcycled finer level interpolates to get a mass-conserving ubar (2D)

Definition at line 641 of file REMORA.H.

Referenced by init_stuff(), level0_fields(), register_coarse_data(), resize_stuff(), and store_2d_flux().

◆ vec_DUon

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_DUon

Scratch for the barotropic step, kept per level rather than allocated on every fast step: the x and y mass fluxes of the current fast step.

Definition at line 620 of file REMORA.H.

Referenced by advance_2d(), init_stuff(), level0_fields(), and resize_stuff().

◆ vec_DV_avg1

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_DV_avg1

time average of barotropic y velocity flux

Definition at line 636 of file REMORA.H.

Referenced by advance_2d_onestep(), advance_3d_ml(), init_stuff(), level0_fields(), ReadCheckpointFile(), resize_stuff(), and WriteCheckpointFile().

◆ vec_DV_avg2

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_DV_avg2

correct time average of barotropic y velocity flux for coupling (2D)

Definition at line 638 of file REMORA.H.

Referenced by advance_2d_onestep(), advance_3d_ml(), init_stuff(), level0_fields(), ReadCheckpointFile(), resize_stuff(), store_2d_flux(), and WriteCheckpointFile().

◆ vec_Dvbar_new

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Dvbar_new

◆ vec_Dvbar_old

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Dvbar_old

DV_avg2 per unit cell edge length, see vec_Dubar_old (2D)

Definition at line 645 of file REMORA.H.

Referenced by init_stuff(), level0_fields(), register_coarse_data(), resize_stuff(), and store_2d_flux().

◆ vec_DVom

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_DVom

Definition at line 621 of file REMORA.H.

Referenced by advance_2d(), init_stuff(), level0_fields(), and resize_stuff().

◆ vec_EminusP

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_EminusP

evaporation minus precipitation [kg/m^2/s], defined at rho-points

Definition at line 595 of file REMORA.H.

Referenced by bulk_fluxes(), init_only(), init_stuff(), level0_fields(), resize_stuff(), set_surface_state(), and set_zeta_to_Ztavg().

◆ vec_evap

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_evap

evaporation rate [kg/m^2/s]

Definition at line 591 of file REMORA.H.

Referenced by ApplyAtmosphericFluxes(), init_stuff(), level0_fields(), resize_stuff(), set_zeta_to_Ztavg(), setup_step(), and WriteNCPlotFile_which().

◆ vec_fcor

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_fcor

◆ vec_gls

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_gls

◆ vec_h

◆ vec_h_full_domain

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_h_full_domain

◆ vec_Huon

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Huon

◆ vec_Hvom

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Hvom

◆ vec_Hz

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Hz

◆ vec_latp

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_latp

latitude on psi-points (2D, degrees north); only filled when the grid NetCDF file carries lat_psi

Definition at line 740 of file REMORA.H.

Referenced by GetAtmosToOceanPsiLonLat(), init_grid_vars_from_netcdf(), level0_fields(), and resize_stuff().

◆ vec_latr

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_latr

latitude on rho-points (2D, degrees north); only filled when the grid NetCDF file carries lat_rho

Definition at line 747 of file REMORA.H.

Referenced by GetRhoLonLat(), init_grid_vars_from_netcdf(), init_only(), level0_fields(), resize_stuff(), set_grid_scale(), set_grid_vars_averaged_down(), WriteNCPlotFile_which(), and WritePlotFile().

◆ vec_latr_full_domain

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_latr_full_domain

lat_rho on the whole domain, as vec_lonr_full_domain

Definition at line 756 of file REMORA.H.

Referenced by init_grid_vars_full_domain_from_netcdf(), resize_stuff(), and set_grid_vars_averaged_down().

◆ vec_lhflx

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_lhflx

◆ vec_longwave_down

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_longwave_down

Downward longwave radiation.

Definition at line 573 of file REMORA.H.

Referenced by ApplyAtmosphericStates(), init_only(), init_stuff(), level0_fields(), resize_stuff(), set_surface_state(), and setup_step().

◆ vec_lonp

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_lonp

longitude on psi-points (2D, degrees east); only filled when the grid NetCDF file carries lon_psi

Definition at line 737 of file REMORA.H.

Referenced by GetAtmosToOceanPsiLonLat(), init_grid_vars_from_netcdf(), level0_fields(), and resize_stuff().

◆ vec_lonr

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_lonr

longitude on rho-points (2D, degrees east); only filled when the grid NetCDF file carries lon_rho

Definition at line 744 of file REMORA.H.

Referenced by GetRhoLonLat(), init_grid_vars_from_netcdf(), init_only(), level0_fields(), resize_stuff(), set_grid_scale(), set_grid_vars_averaged_down(), WriteNCPlotFile_which(), and WritePlotFile().

◆ vec_lonr_full_domain

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_lonr_full_domain

lon_rho on the whole domain, levels up to hires_grid_level; only filled when remora.nc_grid_file_hires carries it

Definition at line 754 of file REMORA.H.

Referenced by init_grid_vars_full_domain_from_netcdf(), resize_stuff(), and set_grid_vars_averaged_down().

◆ vec_lrflx

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_lrflx

◆ vec_Lscale

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Lscale

Vertical mixing turbulent length scale.

Definition at line 790 of file REMORA.H.

Referenced by gls_corrector(), init_gls_vmix(), init_stuff(), level0_fields(), ReadCheckpointFile(), resize_stuff(), and WriteCheckpointFile().

◆ vec_metric_p

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_metric_p

metric products at psi points, components MetricP (2D)

Definition at line 710 of file REMORA.H.

Referenced by advance_2d(), init_stuff(), level0_fields(), resize_stuff(), set_derived_metrics(), and setup_step().

◆ vec_metric_r

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_metric_r

metric products of pm and pn at rho points, components MetricR (2D). Recomputed by set_derived_metrics whenever set_grid_scale sets pm and pn

Definition at line 704 of file REMORA.H.

Referenced by advance_2d(), init_stuff(), level0_fields(), resize_stuff(), set_derived_metrics(), and setup_step().

◆ vec_metric_u

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_metric_u

metric products at u points, components MetricU (2D)

Definition at line 706 of file REMORA.H.

Referenced by advance_2d(), advance_3d(), init_stuff(), level0_fields(), resize_stuff(), set_2d_cf_flux(), set_derived_metrics(), set_massflux_3d(), setup_step(), and store_2d_flux().

◆ vec_metric_v

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_metric_v

metric products at v points, components MetricV (2D)

Definition at line 708 of file REMORA.H.

Referenced by advance_2d(), advance_3d(), init_stuff(), level0_fields(), resize_stuff(), set_2d_cf_flux(), set_derived_metrics(), set_massflux_3d(), setup_step(), and store_2d_flux().

◆ vec_mskp

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_mskp

◆ vec_mskr

◆ vec_mskr3d

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_mskr3d

land/sea mask at cell centers, copied to all z levels (3D)

Definition at line 683 of file REMORA.H.

Referenced by ErrorEst(), fill_3d_masks(), init_masks(), level0_fields(), and resize_stuff().

◆ vec_mskr_crse_on_fine

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_mskr_crse_on_fine

the level's rho-, u- and v-masks copied onto the layout of the level above it coarsened, which is the layout the two-way average-down computes on. Indexed by the coarse level of the pair. Built on demand and reused until a regrid, since the masks are a function of position alone and so do not change between them.

Definition at line 689 of file REMORA.H.

Referenced by AverageDownTo(), clear_avgdown_masks(), resize_stuff(), and update_avgdown_masks().

◆ vec_mskr_full_domain

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_mskr_full_domain

Land/sea mask at cell centers on the whole domain at each potential level. Specified at hires_grid_level and coarsened down from there, so that a refined coastline and the bathymetry it goes with come from the same grid.

Definition at line 495 of file REMORA.H.

Referenced by allocate_bathymetry_grid_vars_full_domain(), average_down_with_grow_cells(), coarsen_bathymetry_with_grow_cells(), coarsen_masks_with_grow_cells(), ensure_full_domain_masks(), init_masks_full_domain_from_analytic(), init_masks_full_domain_from_netcdf(), probe_rho_mask(), refine_masks_with_grow_cells(), resize_stuff(), and set_masks_averaged_down().

◆ vec_msku

◆ vec_msku_crse_on_fine

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_msku_crse_on_fine

Definition at line 690 of file REMORA.H.

Referenced by AverageDownTo(), clear_avgdown_masks(), resize_stuff(), and update_avgdown_masks().

◆ vec_mskv

◆ vec_mskv_crse_on_fine

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_mskv_crse_on_fine

Definition at line 691 of file REMORA.H.

Referenced by AverageDownTo(), clear_avgdown_masks(), resize_stuff(), and update_avgdown_masks().

◆ vec_nudg_coeff

amrex::Vector<amrex::Vector<std::unique_ptr<amrex::MultiFab> > > REMORA::vec_nudg_coeff

◆ vec_Pair

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Pair

Air pressure [mb], defined at rho-points.

Definition at line 566 of file REMORA.H.

Referenced by ApplyAtmosphericStates(), init_only(), init_stuff(), level0_fields(), resize_stuff(), set_surface_state(), setup_step(), and WriteNCPlotFile_which().

◆ vec_pm

◆ vec_pm_full_domain

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_pm_full_domain

horizontal scaling factor: 1 / dx (2D) on whole domain

Definition at line 698 of file REMORA.H.

Referenced by allocate_bathymetry_grid_vars_full_domain(), init_grid_vars_full_domain_from_netcdf(), resize_stuff(), and set_grid_vars_averaged_down().

◆ vec_pn

◆ vec_pn_full_domain

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_pn_full_domain

horizontal scaling factor: 1 / dy (2D) on whole domain

Definition at line 700 of file REMORA.H.

Referenced by allocate_bathymetry_grid_vars_full_domain(), init_grid_vars_full_domain_from_netcdf(), resize_stuff(), and set_grid_vars_averaged_down().

◆ vec_qair

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_qair

Specific humidity [kg/kg], defined at rho-points.

Definition at line 564 of file REMORA.H.

Referenced by ApplyAtmosphericStates(), init_only(), init_stuff(), level0_fields(), resize_stuff(), set_surface_state(), and setup_step().

◆ vec_rain

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_rain

◆ vec_rdrag

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_rdrag

Linear drag coefficient [m/s], defined at rho points.

Definition at line 607 of file REMORA.H.

Referenced by init_stuff(), level0_fields(), ReadCheckpointFile(), resize_stuff(), setup_step(), and WriteCheckpointFile().

◆ vec_rdrag2

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_rdrag2

Quadratic drag coefficient [unitless], defined at rho points.

Definition at line 609 of file REMORA.H.

Referenced by init_stuff(), level0_fields(), ReadCheckpointFile(), resize_stuff(), setup_step(), and WriteCheckpointFile().

◆ vec_reflux_flux

amrex::Vector<amrex::Array<amrex::MultiFab,AMREX_SPACEDIM> > REMORA::vec_reflux_flux

A fine level's advective tracer fluxes on its faces, kept only when OpenMP threads defer the flux-register FineAdd to a fixed-order pass (see advance_3d)

Definition at line 629 of file REMORA.H.

Referenced by advance_3d().

◆ vec_rhoA

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_rhoA

vertically-averaged density

Definition at line 771 of file REMORA.H.

Referenced by advance_2d_onestep(), init_stuff(), level0_fields(), resize_stuff(), and setup_step().

◆ vec_rhoS

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_rhoS

density perturbation

Definition at line 769 of file REMORA.H.

Referenced by Advance(), advance_2d_onestep(), init_stuff(), level0_fields(), resize_stuff(), and setup_step().

◆ vec_river_position

amrex::Vector<std::unique_ptr<amrex::iMultiFab> > REMORA::vec_river_position
private

iMultiFab for river positions; contents are indices of rivers

Definition at line 1854 of file REMORA.H.

Referenced by advance_2d(), advance_3d(), init_riv_pos_from_netcdf(), init_stuff(), prestep(), and resize_stuff().

◆ vec_ru

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_ru

◆ vec_ru2d

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_ru2d

◆ vec_rubar

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_rubar

barotropic x velocity for the RHS (2D)

Definition at line 659 of file REMORA.H.

Referenced by advance_2d_onestep(), init_stuff(), level0_fields(), and resize_stuff().

◆ vec_rufrc

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_rufrc

u velocity RHS, integrated, including advection and bottom/surface stresses (2D)

Definition at line 512 of file REMORA.H.

Referenced by advance_2d_onestep(), init_stuff(), level0_fields(), resize_stuff(), and setup_step().

◆ vec_rv

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_rv

◆ vec_rv2d

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_rv2d

◆ vec_rvbar

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_rvbar

barotropic y velocity for the RHS (2D)

Definition at line 661 of file REMORA.H.

Referenced by advance_2d_onestep(), init_stuff(), level0_fields(), and resize_stuff().

◆ vec_rvfrc

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_rvfrc

v velocity RHS, integrated, including advection and bottom/surface stresses (2D)

Definition at line 514 of file REMORA.H.

Referenced by advance_2d_onestep(), init_stuff(), level0_fields(), resize_stuff(), and setup_step().

◆ vec_rzeta

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_rzeta

free surface height for the RHS (2D)

Definition at line 663 of file REMORA.H.

Referenced by advance_2d_onestep(), init_stuff(), level0_fields(), and resize_stuff().

◆ vec_scratch_2d

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_scratch_2d

Scratch for the barotropic step: the n_scratch_2d fields one pass of advance_2d hands the next (new depth, free-surface pressure-gradient terms, and the momentum right-hand sides stored at their face index), cell-centered 2D.

Definition at line 625 of file REMORA.H.

Referenced by advance_2d(), init_stuff(), level0_fields(), and resize_stuff().

◆ vec_shflx

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_shflx

◆ vec_srflx

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_srflx

◆ vec_sstore

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_sstore

additional scratch space for calculations on temp, salt, etc

Definition at line 766 of file REMORA.H.

Referenced by advance_3d_ml(), init_stuff(), level0_fields(), prestep(), resize_stuff(), and setup_step().

◆ vec_stflux

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_stflux

Surface tracer flux; input arrays.

Definition at line 582 of file REMORA.H.

Referenced by ApplyAtmosphericFluxes(), init_stuff(), level0_fields(), resize_stuff(), setup_step(), WriteNCPlotFile_which(), and WritePlotFile().

◆ vec_stflx

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_stflx

Surface tracer flux; working arrays.

Definition at line 580 of file REMORA.H.

Referenced by init_stuff(), level0_fields(), prestep(), resize_stuff(), and setup_step().

◆ vec_sustr

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_sustr

◆ vec_sustr_rho

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_sustr_rho
private

Surface stress from a lat-lon file, east and north components on rho points before it is rotated onto the grid and averaged to the u and v faces; one per level, unallocated when the stress file is on the model grid.

Definition at line 1804 of file REMORA.H.

Referenced by ensure_stress_rho_arrays(), init_only(), level0_fields(), and set_smflux().

◆ vec_svstr

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_svstr

◆ vec_svstr_rho

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_svstr_rho
private

Definition at line 1805 of file REMORA.H.

Referenced by ensure_stress_rho_arrays(), init_only(), level0_fields(), and set_smflux().

◆ vec_Tair

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_Tair

Air temperature [°C], defined at rho-points.

Definition at line 562 of file REMORA.H.

Referenced by ApplyAtmosphericStates(), init_only(), init_stuff(), level0_fields(), resize_stuff(), set_surface_state(), setup_step(), and WriteNCPlotFile_which().

◆ vec_tke

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_tke

◆ vec_ubar

◆ vec_uwind

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_uwind

Wind in the u direction, defined at rho-points.

Definition at line 558 of file REMORA.H.

Referenced by advance_biology(), ApplyAtmosphericStates(), init_only(), init_stuff(), level0_fields(), resize_stuff(), set_surface_state(), setup_step(), and WriteNCPlotFile_which().

◆ vec_vbar

◆ vec_visc2_p

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_visc2_p

Harmonic viscosity defined on the psi points (corners of horizontal grid cells)

Definition at line 520 of file REMORA.H.

Referenced by advance_2d_onestep(), init_stuff(), level0_fields(), resize_stuff(), set_hmixcoef(), and setup_step().

◆ vec_visc2_r

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_visc2_r

Harmonic viscosity defined on the rho points (centers)

Definition at line 522 of file REMORA.H.

Referenced by advance_2d_onestep(), init_stuff(), level0_fields(), mask_arrays_for_write(), resize_stuff(), set_hmixcoef(), setup_step(), WriteNCPlotFile_which(), and WritePlotFile().

◆ vec_vwind

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_vwind

Wind in the v direction, defined at rho-points.

Definition at line 560 of file REMORA.H.

Referenced by advance_biology(), ApplyAtmosphericStates(), init_only(), init_stuff(), level0_fields(), resize_stuff(), set_surface_state(), setup_step(), and WriteNCPlotFile_which().

◆ vec_weight1

amrex::Vector<amrex::Real> REMORA::vec_weight1

Weights for calculating avg1 in 2D advance.

Definition at line 780 of file REMORA.H.

Referenced by advance_2d(), and set_weights().

◆ vec_weight2

amrex::Vector<amrex::Real> REMORA::vec_weight2

Weights for calculating avg2 in 2D advance.

Definition at line 782 of file REMORA.H.

Referenced by advance_2d(), and set_weights().

◆ vec_xp

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_xp

◆ vec_xr

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_xr

◆ vec_xu

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_xu

◆ vec_xv

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_xv

◆ vec_xvel_full_domain

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_xvel_full_domain

multilevel data container for high res initial x velocities (u in ROMS)

Definition at line 478 of file REMORA.H.

Referenced by allocate_init_full_domain(), init_data_full_domain_from_netcdf(), init_full_domain_from_analytic(), resize_stuff(), and set_init_data_averaged_down().

◆ vec_yp

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_yp

◆ vec_yr

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_yr

◆ vec_yu

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_yu

◆ vec_yv

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_yv

◆ vec_yvel_full_domain

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_yvel_full_domain

multilevel data container for high res initial y velocities (v in ROMS)

Definition at line 480 of file REMORA.H.

Referenced by allocate_init_full_domain(), init_data_full_domain_from_netcdf(), init_full_domain_from_analytic(), resize_stuff(), and set_init_data_averaged_down().

◆ vec_z_phys_nd

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_z_phys_nd

◆ vec_z_r

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_z_r

z coordinates at rho points (cell centers)

Definition at line 527 of file REMORA.H.

Referenced by advance_biology(), init_stuff(), level0_fields(), prob_coords(), resize_stuff(), setup_step(), and stretch_transform().

◆ vec_z_w

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_z_w

z coordinates at w points (faces between z-cells)

Definition at line 530 of file REMORA.H.

Referenced by advance_3d_ml(), advance_biology(), compute_omega(), gls_corrector(), init_stuff(), level0_fields(), prob_coords(), resize_stuff(), setup_step(), and stretch_transform().

◆ vec_zeta

◆ vec_zeta_crse_new

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_zeta_crse_new

see vec_zeta_crse_old (2D)

Definition at line 657 of file REMORA.H.

Referenced by advance_2d(), ReadCheckpointFile(), register_coarse_data(), and WriteCheckpointFile().

◆ vec_zeta_crse_old

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_zeta_crse_old

free surface at the start and end of this level's step, every leapfrog component holding the same value. What a subcycled finer level interpolates in time to get its contact points, as ROMS's put_refine2d does (2D)

Definition at line 655 of file REMORA.H.

Referenced by advance_2d(), ReadCheckpointFile(), and register_coarse_data().

◆ vec_zeta_full_domain

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_zeta_full_domain

high resolution initial free surface height (2D)

Definition at line 672 of file REMORA.H.

Referenced by allocate_init_full_domain(), init_full_domain_from_analytic(), init_zeta_full_domain_from_netcdf(), resize_stuff(), and set_zeta_averaged_down().

◆ vec_ZoBot

amrex::Vector<std::unique_ptr<amrex::MultiFab> > REMORA::vec_ZoBot

Bottom roughness length [m], defined at rho points.

Definition at line 611 of file REMORA.H.

Referenced by gls_corrector(), init_stuff(), level0_fields(), ReadCheckpointFile(), resize_stuff(), setup_step(), and WriteCheckpointFile().

◆ vec_Zt_avg1

◆ verbose

◆ Vwind_data_from_file

std::unique_ptr<NCTimeSeries> REMORA::Vwind_data_from_file
private

Data container for v-direction wind read from file.

Definition at line 1811 of file REMORA.H.

Referenced by init_only(), set_surface_state(), and winds_need_rotation().

◆ write_history_file

bool REMORA::write_history_file = true
staticprivate

Whether to output NetCDF files as a single history file with several time steps.

Definition at line 1795 of file REMORA.H.

Referenced by netcdf_plot_path(), ReadParameters(), and WriteNCPlotFile().

◆ xvel_new

◆ xvel_old

amrex::Vector<amrex::MultiFab*> REMORA::xvel_old

◆ yvel_new

◆ yvel_old

amrex::Vector<amrex::MultiFab*> REMORA::yvel_old

◆ zvel_new

amrex::Vector<amrex::MultiFab*> REMORA::zvel_new

◆ zvel_old

amrex::Vector<amrex::MultiFab*> REMORA::zvel_old

multilevel data container for last step's z velocities (largely unused; W stored separately)

Definition at line 464 of file REMORA.H.

Referenced by advance_3d_ml(), ClearLevel(), init_only(), InitData(), level0_fields(), MakeNewLevelFromCoarse(), MakeNewLevelFromScratch(), ReadCheckpointFile(), register_coarse_data(), RemakeLevel(), REMORA(), REMORA(), setup_step(), timeStep(), timeStepML(), and WriteCheckpointFile().


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