|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
The per-level state of the force-restore snow layer (ERF_ForceRestoreSnow.H, erf.radiation.seb_snow_enable): the snow water equivalent and the running totals that close each column's snow budget. More...
#include <ERF_ForceRestoreSnowState.H>

Classes | |
| struct | StepSums |
| Domain sums of one step on one level (rank-reduced), for the log. More... | |
Public Types | |
| enum | Total : int { Snowfall = 0 , Sublimation , Melt , NumTotals } |
| Components of totals(lev), each a running total [kg/m^2] since the start. More... | |
Public Member Functions | |
| void | resize (int nlevs_max) |
| void | define_level (int lev, const RadChoice &rc, const amrex::BoxArray &ba2d, const amrex::DistributionMapping &dm, const amrex::IntVect &ng) |
| Allocate the level's fields, with the snow water equivalent at erf.radiation.seb_snow_initial_swe_kg_m2; a no-op unless seb_snow_enable. More... | |
| bool | defined (int lev) const noexcept |
True once define_level allocated lev. More... | |
| StepSums | step (int lev, amrex::MultiFab &t_s, const amrex::MultiFab &lh, const amrex::MultiFab *footprint, amrex::Real dt, const ForceRestoreSnowParams &prm, const ForceRestorePrecipInput &snowfall, amrex::Real &t_s_sum_local, amrex::Real &t_s_max_local, const amrex::iMultiFab *land_mask=nullptr) |
One snow step on every open column of lev, after the balance has updated T_s. A footprint cell (footprint > 0.5) keeps its state and hands the soil no water; so does a water column (land_mask 0), which the balance does not run on. More... | |
| void | apply_albedo (int lev, amrex::MultiFab &alb_sw, const ForceRestoreSnowParams &prm, const amrex::MultiFab *footprint=nullptr, const amrex::iMultiFab *land_mask=nullptr) const |
Write the surface albedo with snow into alb_sw, which holds the snow-free albedo: DRM95 Eq. (8) with veg = 0, per column, on valid cells. A footprint cell (footprint > 0.5, or none with nullptr) keeps the snow-free albedo: no snow lies on a building, whatever W_n holds there before the first step. The same holds for a water column (land_mask 0): step() and this function leave out the same columns. More... | |
| amrex::MultiFab * | swe (int lev) noexcept |
| The snow water equivalent [kg/m^2], or nullptr. More... | |
| amrex::MultiFab * | totals (int lev) noexcept |
| The running totals (Total components) [kg/m^2], or nullptr. More... | |
| const amrex::MultiFab * | soil_water (int lev) const noexcept |
| Water the last step() handed the soil [kg/m^2]: melt plus sublimation; or nullptr. More... | |
| void | write_checkpoint (int lev, const std::string &checkpointname) const |
| void | read_checkpoint (int lev, const std::string &restart_chkfile, const amrex::Periodicity &period) |
| Read W_n and the totals. A checkpoint with neither file was written without the snow layer: the snow starts from the input (noted once). One file without the other is an incomplete checkpoint and stops the run, naming the missing file. More... | |
Static Public Member Functions | |
| static ForceRestoreSnowParams | params (const RadChoice &rc) |
| The parameters of one step, from the erf.radiation.seb_* inputs. More... | |
Private Attributes | |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | m_swe |
| W_n. More... | |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | m_totals |
| Total components. More... | |
| amrex::Vector< std::unique_ptr< amrex::MultiFab > > | m_soil_water |
| melt + sublimation of the last step More... | |
The per-level state of the force-restore snow layer (ERF_ForceRestoreSnow.H, erf.radiation.seb_snow_enable): the snow water equivalent and the running totals that close each column's snow budget.
Owned by TwoStreamRadiation, beside the force-restore hydrology (ERF_ForceRestoreHydrologyState.H) and the precipitation rate of the step (ERF_ForceRestorePrecipRate.H). step(...) after the balance, and before the hydrology step, applies one snow step to every open column: it takes the frozen precipitation, changes T_s where snow melts and leaves the water for the soil in soil_water(lev), which the hydrology step takes. The snow water equivalent and the totals are checkpointed, and TwoStreamRadiation lists them with its prognostic fields for regrid, coarse-fine filling and averaging down.
| enum ForceRestoreSnow::Total : int |
| void ForceRestoreSnow::apply_albedo | ( | int | lev, |
| amrex::MultiFab & | alb_sw, | ||
| const ForceRestoreSnowParams & | prm, | ||
| const amrex::MultiFab * | footprint = nullptr, |
||
| const amrex::iMultiFab * | land_mask = nullptr |
||
| ) | const |
Write the surface albedo with snow into alb_sw, which holds the snow-free albedo: DRM95 Eq. (8) with veg = 0, per column, on valid cells. A footprint cell (footprint > 0.5, or none with nullptr) keeps the snow-free albedo: no snow lies on a building, whatever W_n holds there before the first step. The same holds for a water column (land_mask 0): step() and this function leave out the same columns.

| void ForceRestoreSnow::define_level | ( | int | lev, |
| const RadChoice & | rc, | ||
| const amrex::BoxArray & | ba2d, | ||
| const amrex::DistributionMapping & | dm, | ||
| const amrex::IntVect & | ng | ||
| ) |
Allocate the level's fields, with the snow water equivalent at erf.radiation.seb_snow_initial_swe_kg_m2; a no-op unless seb_snow_enable.
|
inlinenoexcept |
True once define_level allocated lev.
Referenced by apply_albedo(), read_checkpoint(), soil_water(), swe(), totals(), and write_checkpoint().

|
static |
The parameters of one step, from the erf.radiation.seb_* inputs.
Referenced by TwoStreamRadiation::advance().

| void ForceRestoreSnow::read_checkpoint | ( | int | lev, |
| const std::string & | restart_chkfile, | ||
| const amrex::Periodicity & | period | ||
| ) |
Read W_n and the totals. A checkpoint with neither file was written without the snow layer: the snow starts from the input (noted once). One file without the other is an incomplete checkpoint and stops the run, naming the missing file.

| void ForceRestoreSnow::resize | ( | int | nlevs_max | ) |
|
inlinenoexcept |
Water the last step() handed the soil [kg/m^2]: melt plus sublimation; or nullptr.

| ForceRestoreSnow::StepSums ForceRestoreSnow::step | ( | int | lev, |
| amrex::MultiFab & | t_s, | ||
| const amrex::MultiFab & | lh, | ||
| const amrex::MultiFab * | footprint, | ||
| amrex::Real | dt, | ||
| const ForceRestoreSnowParams & | prm, | ||
| const ForceRestorePrecipInput & | snowfall, | ||
| amrex::Real & | t_s_sum_local, | ||
| amrex::Real & | t_s_max_local, | ||
| const amrex::iMultiFab * | land_mask = nullptr |
||
| ) |
One snow step on every open column of lev, after the balance has updated T_s. A footprint cell (footprint > 0.5) keeps its state and hands the soil no water; so does a water column (land_mask 0), which the balance does not run on.
| t_s | surface temperature [K]; lowered where snow melts | |
| lh | latent heat flux the balance used [W/m^2]; E = LH / L_v | |
| footprint | building footprints, or nullptr | |
| dt | the step [s] | |
| prm | params(rc) | |
| snowfall | the frozen precipitation of the step (ForceRestorePrecipRate::frozen) | |
| [out] | t_s_sum_local | sum of T_s over this rank's open columns after the step |
| [out] | t_s_max_local | max |T_s| over this rank's open columns after the step |
| land_mask | the level's land mask (0 water), or nullptr: every column is land |

|
inlinenoexcept |
The snow water equivalent [kg/m^2], or nullptr.
Referenced by TwoStreamRadiation::snow_swe().


|
inlinenoexcept |
The running totals (Total components) [kg/m^2], or nullptr.
Referenced by TwoStreamRadiation::snow_totals().


| void ForceRestoreSnow::write_checkpoint | ( | int | lev, |
| const std::string & | checkpointname | ||
| ) | const |

|
private |
melt + sublimation of the last step
Referenced by soil_water().
|
private |
W_n.
Referenced by apply_albedo(), defined(), read_checkpoint(), swe(), and write_checkpoint().
|
private |
Total components.
Referenced by read_checkpoint(), totals(), and write_checkpoint().