1 #ifndef ERF_FORCE_RESTORE_PRECIP_RATE_H_
2 #define ERF_FORCE_RESTORE_PRECIP_RATE_H_
6 #include <AMReX_MultiFab.H>
7 #include <AMReX_REAL.H>
8 #include <AMReX_Vector.H>
21 const amrex::MultiFab*
rate =
nullptr;
23 amrex::Real
scale = amrex::Real(0.0);
55 void resize (
int nlevs_max);
62 const amrex::DistributionMapping& dm);
65 [[nodiscard]]
bool defined (
int lev)
const noexcept {
66 return lev >= 0 && lev < static_cast<int>(
m_rate.size()) &&
m_rate[lev] !=
nullptr;
100 [[nodiscard]]
const amrex::MultiFab*
rate (
int lev)
const noexcept {
111 amrex::Vector<std::unique_ptr<amrex::MultiFab>>
m_rate;
const int klo
Definition: ERF_InitCustomPert_KE.H:9
The surface precipitation rate of each level's step, for the force-restore hydrology (ERF_ForceRestor...
Definition: ERF_ForceRestorePrecipRate.H:50
bool m_split
rain and frozen apart (seb_snow_enable)
Definition: ERF_ForceRestorePrecipRate.H:115
amrex::Vector< amrex::Real > m_elapsed
time since m_accum_start [s]
Definition: ERF_ForceRestorePrecipRate.H:114
ForceRestorePrecipInput rain(int lev, amrex::Real dt) const noexcept
The rain a step of length dt takes (the total without the snow layer).
Definition: ERF_ForceRestorePrecipRate.H:87
void resize(int nlevs_max)
Definition: ERF_ForceRestorePrecipRate.cpp:12
void end_step(int lev, const SurfacePrecipAccumulationSources &sources, int klo, amrex::Real dt)
The rate [kg/m^2/s]: the accumulation now minus the one begin_step stored, over the time since that s...
Definition: ERF_ForceRestorePrecipRate.cpp:72
void begin_step(int lev, const SurfacePrecipAccumulationSources &sources, int klo)
Store the accumulation [kg/m^2] at the start of the level's step. When no step used the rate of the p...
Definition: ERF_ForceRestorePrecipRate.cpp:55
void define_level(int lev, const RadChoice &rc, const amrex::BoxArray &ba2d, const amrex::DistributionMapping &dm)
Allocate the level's fields; a no-op without erf.radiation.seb_precipitation_source.
Definition: ERF_ForceRestorePrecipRate.cpp:23
amrex::Vector< std::unique_ptr< amrex::MultiFab > > m_rate
rate of the last end_step
Definition: ERF_ForceRestorePrecipRate.H:111
void fill_accumulation(amrex::MultiFab &accum, const SurfacePrecipAccumulationSources &sources, int klo) const
Definition: ERF_ForceRestorePrecipRate.cpp:43
amrex::Vector< std::unique_ptr< amrex::MultiFab > > m_accum_now
work field of end_step
Definition: ERF_ForceRestorePrecipRate.H:110
ForceRestorePrecipInput frozen(int lev, amrex::Real dt) const noexcept
The frozen precipitation a step of length dt takes; none unless split().
Definition: ERF_ForceRestorePrecipRate.H:92
bool defined(int lev) const noexcept
True once define_level allocated lev.
Definition: ERF_ForceRestorePrecipRate.H:65
ForceRestorePrecipInput input(int lev, int comp, amrex::Real dt) const noexcept
Definition: ERF_ForceRestorePrecipRate.cpp:99
Comp
Components of rate(lev). Frozen exists only with the snow layer.
Definition: ERF_ForceRestorePrecipRate.H:53
@ Rain
Definition: ERF_ForceRestorePrecipRate.H:53
@ Frozen
Definition: ERF_ForceRestorePrecipRate.H:53
amrex::Vector< std::unique_ptr< amrex::MultiFab > > m_accum_start
accumulation at the step start
Definition: ERF_ForceRestorePrecipRate.H:109
bool split() const noexcept
True when the rate is split into rain and frozen precipitation.
Definition: ERF_ForceRestorePrecipRate.H:70
bool m_noted_no_frozen
the no-frozen-accumulator note was printed
Definition: ERF_ForceRestorePrecipRate.H:116
amrex::Vector< int > m_started
begin_step ran this step
Definition: ERF_ForceRestorePrecipRate.H:112
amrex::Vector< int > m_unused
end_step's rate not yet taken by a step
Definition: ERF_ForceRestorePrecipRate.H:113
const amrex::MultiFab * rate(int lev) const noexcept
The rate of the last end_step [kg/m^2/s] (Comp components), or nullptr. For output.
Definition: ERF_ForceRestorePrecipRate.H:100
void mark_used(int lev) noexcept
The steps of this level took the rate: it is not applied again.
Definition: ERF_ForceRestorePrecipRate.cpp:113
constexpr std::array< amrex::Real, num_veg_params > rc
Definition: ERF_SLM_DefaultParams.H:22
Container holding radiation-related choices and parameters.
Definition: ERF_RadStruct.H:142
Definition: ERF_SurfacePrecipitation.H:40