1 #ifndef ERF_FORCE_RESTORE_SNOW_H_
2 #define ERF_FORCE_RESTORE_SNOW_H_
6 #include <AMReX_Algorithm.H>
7 #include <AMReX_GpuQualifiers.H>
8 #include <AMReX_Math.H>
9 #include <AMReX_REAL.H>
68 amrex::Real
w_crn = amrex::Real(10.0);
69 amrex::Real
albedo = amrex::Real(0.70);
70 amrex::Real
c_s = amrex::Real(2.0e4);
72 amrex::Real
t_max = std::numeric_limits<amrex::Real>::max();
82 amrex::Real
melt = amrex::Real(0.0);
92 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
95 if (!(w_n > amrex::Real(0.0)) || !amrex::Math::isfinite(w_n)) {
return amrex::Real(0.0); }
96 return w_n / (w_n + w_crn);
107 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
112 return (amrex::Real(1.0) - p_ng) * alb_ground + p_ng * prm.albedo;
128 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
134 if (!(p_n >
zero) || !amrex::Math::isfinite(p_n)) { p_n =
zero; }
135 if (!(e >
zero) || !amrex::Math::isfinite(e)) { e =
zero; }
145 amrex::Real w_new = w_n + p_n * dt;
153 w_new = w_n - amrex::min(p_ng * e * dt, amrex::max(w_n, amrex::Real(0.0)));
160 if (potential < w_n) {
161 w_new = w_n - potential;
162 out.
melt = w_n - w_new;
175 if (t_s > prm.t_max) { t_s = prm.t_max; }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real force_restore_snow_fraction(amrex::Real w_n, amrex::Real w_crn) noexcept
Snow cover fraction p_ng of the ground, DRM95 Eq. (7).
Definition: ERF_ForceRestoreSnow.H:93
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ForceRestoreSnowFluxes force_restore_snow_step(amrex::Real &w_n, amrex::Real &t_s, amrex::Real p_n, amrex::Real e, amrex::Real dt, const ForceRestoreSnowParams &prm) noexcept
One step of the snow layer of one column, after the balance has updated T_s.
Definition: ERF_ForceRestoreSnow.H:130
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real force_restore_snow_albedo(amrex::Real alb_ground, amrex::Real w_n, const ForceRestoreSnowParams &prm) noexcept
Surface albedo with snow, DRM95 Eq. (8) with veg = 0.
Definition: ERF_ForceRestoreSnow.H:108
constexpr amrex::Real force_restore_snow_t_melt
The melting point T_00 [K] of DRM95 Eq. (12).
Definition: ERF_ForceRestoreSnow.H:61
Physical constants and tuning parameters used only by the moisture and cloud-physics code.
constexpr amrex::Real lat_ice
Definition: ERF_MicrophysicsConstants.H:114
Dimensionless numeric literals and pure mathematical constants.
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
What one snow step moved in one column [kg/m^2].
Definition: ERF_ForceRestoreSnow.H:79
amrex::Real melt
Snow melted.
Definition: ERF_ForceRestoreSnow.H:82
amrex::Real snowfall
Frozen precipitation taken in.
Definition: ERF_ForceRestoreSnow.H:80
amrex::Real sublimation
Snow sublimated.
Definition: ERF_ForceRestoreSnow.H:81
Parameters of one snow step (from erf.radiation.seb_*).
Definition: ERF_ForceRestoreSnow.H:67
amrex::Real c_s
Definition: ERF_ForceRestoreSnow.H:70
amrex::Real w_crn
Critical snow water equivalent W_crn [kg/m^2] (seb_snow_critical_swe_kg_m2)
Definition: ERF_ForceRestoreSnow.H:68
amrex::Real albedo
Snow albedo alpha_n [-] (seb_snow_albedo)
Definition: ERF_ForceRestoreSnow.H:69
amrex::Real t_max
Upper bound of T_s after the melt [K] (seb_prognostic_t_max_k); no bound by default.
Definition: ERF_ForceRestoreSnow.H:72