ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_ForceRestoreSnow.H File Reference

One bulk snow layer on the two-stream force-restore surface (erf.radiation.seb_snow_enable): the snow routine of the ISBA scheme as Douville, Royer and Mahfouf (1995, "DRM95") describe it in their Sec. 2.1, for bare ground (vegetation fraction 0). More...

#include <limits>
#include <AMReX_Algorithm.H>
#include <AMReX_GpuQualifiers.H>
#include <AMReX_Math.H>
#include <AMReX_REAL.H>
#include <ERF_MicrophysicsConstants.H>
#include <ERF_NumericalConstants.H>
Include dependency graph for ERF_ForceRestoreSnow.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ForceRestoreSnowParams
 Parameters of one snow step (from erf.radiation.seb_*). More...
 
struct  ForceRestoreSnowFluxes
 What one snow step moved in one column [kg/m^2]. More...
 

Functions

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

Variables

constexpr amrex::Real force_restore_snow_t_melt = amrex::Real(273.16)
 The melting point T_00 [K] of DRM95 Eq. (12). More...
 

Detailed Description

One bulk snow layer on the two-stream force-restore surface (erf.radiation.seb_snow_enable): the snow routine of the ISBA scheme as Douville, Royer and Mahfouf (1995, "DRM95") describe it in their Sec. 2.1, for bare ground (vegetation fraction 0).

The state is the snow water equivalent W_n kg/m^2.

  • Mass (DRM95 Eq. 6): dW_n/dt = P_n - E_n - F_n, with P_n the frozen precipitation, E_n the sublimation and F_n the melt.
  • Cover fraction (DRM95 Eq. 7): p_ng = W_n / (W_n + W_crn), W_crn = 10 kg/m^2 (erf.radiation.seb_snow_critical_swe_kg_m2).
  • Albedo (DRM95 Eq. 8 with veg = 0): alpha_t = (1 - p_ng) alpha_g + p_ng alpha_n, alpha_n = 0.70 (erf.radiation.seb_snow_albedo), "the uniform and constant value of the snow albedo".
  • Sublimation. DRM95 states that p_ng partitions the surface evaporation between the soil and the snow, without an equation. Here E_n = p_ng E for an upward E = LE / L_v, at most the snow there is; the soil keeps the rest. A downward flux (dew, frost) stays with the soil, as in the balance without snow. The latent heat flux itself is not changed: it uses L_v over the snow too.
  • Melt (DRM95 Eq. 12). The balance gives a first estimate T_s* of the surface temperature. Where snow lies and T_s* > T_00 = 273.16 K, F_n dt = (T_s* - T_00) / (C_t L_f), at most the snow there is. C_t [K m^2/J] is the inverse of the surface heat capacity C_s J/m^2/K. The melt takes L_f F_n dt from the surface, so T_s = T_s* - L_f F_n dt / C_s: T_00 while snow remains ("the surface temperature can only exceed the melting point when all the snow has melted on the ground", DRM95 Sec. 2.1).
  • Melt water and the sublimated water the balance took from the soil go to the soil with the rain (ERF_ForceRestoreHydrology.H).

The update is forward Euler, in the order snowfall, sublimation, melt, and satisfies to round-off W_n_new - W_n_old = snowfall - sublimation - melt.

Not here (DRM95 Sec. 2.2, their new scheme): prognostic snow density and albedo, the snow heat capacity, the vegetation masking, and the snow roughness length (DRM95 Eqs. 9-10).

Reference:

  • Douville, H., J.-F. Royer, and J.-F. Mahfouf, 1995: A new snow parameterization for the Meteo-France climate model. Part I: validation in stand-alone experiments. Climate Dynamics, 12, 21-35.

Function Documentation

◆ force_restore_snow_albedo()

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.

Parameters
[in]alb_groundsnow-free albedo alpha_g [-]
[in]w_nsnow water equivalent [kg/m^2]
[in]prmparameters
Returns
(1 - p_ng) alpha_g + p_ng alpha_n
110 {
111  const amrex::Real p_ng = force_restore_snow_fraction(w_n, prm.w_crn);
112  return (amrex::Real(1.0) - p_ng) * alb_ground + p_ng * prm.albedo;
113 }
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::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

Referenced by ForceRestoreSnow::apply_albedo().

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

◆ force_restore_snow_fraction()

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

Parameters
[in]w_nsnow water equivalent [kg/m^2]
[in]w_crncritical snow water equivalent [kg/m^2], > 0
Returns
W_n / (W_n + W_crn) in [0, 1); zero for no snow or a non-finite W_n.
94 {
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);
97 }

Referenced by force_restore_snow_albedo(), and force_restore_snow_step().

Here is the caller graph for this function:

◆ force_restore_snow_step()

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.

Parameters
[in,out]w_nsnow water equivalent [kg/m^2]
[in,out]t_ssurface temperature [K]: the balance's estimate in, the value after the melt out, at most prm.t_max. The estimate of a snow-covered column comes in without that bound, so the heat above it melts snow first.
[in]p_nfrozen precipitation [kg/m^2/s]
[in]eevaporation LE / L_v [kg/m^2/s], positive upward
[in]dtthe step [s]
[in]prmparameters
Returns
the snow taken in, sublimated and melted
132 {
134  if (!(p_n > zero) || !amrex::Math::isfinite(p_n)) { p_n = zero; }
135  if (!(e > zero) || !amrex::Math::isfinite(e)) { e = zero; }
136 
137  // The cover fraction of the snow at the start of the step: DRM95 Eq. (7).
138  const amrex::Real p_ng = force_restore_snow_fraction(w_n, prm.w_crn);
139 
140  // Each term below reports what W_n actually changed by, not the amount asked for: in
141  // single precision an increment below the resolution of a deep pack leaves W_n as it
142  // was, and the soil must then not be handed water the snow did not lose.
143 
144  // Snowfall: DRM95 Eq. (6), first term.
145  amrex::Real w_new = w_n + p_n * dt;
146  out.snowfall = w_new - w_n;
147  w_n = w_new;
148 
149  // Sublimation from the covered fraction: DRM95 Eq. (6), second term. A negative W_n (a
150  // corrupt state, which the caller refuses after the step) gives none.
151  // amrex::max takes references: a namespace-scope constant passed to it is odr-used, which
152  // CUDA refuses in device code, so the constants are passed as temporaries here and below.
153  w_new = w_n - amrex::min(p_ng * e * dt, amrex::max(w_n, amrex::Real(0.0)));
154  out.sublimation = w_n - w_new;
155  w_n = w_new;
156 
157  // Melt: DRM95 Eq. (12), with C_t = 1 / C_s.
158  if (w_n > zero && t_s > force_restore_snow_t_melt) {
159  const amrex::Real potential = prm.c_s * (t_s - force_restore_snow_t_melt) / lat_ice;
160  if (potential < w_n) {
161  w_new = w_n - potential;
162  out.melt = w_n - w_new;
163  w_n = w_new;
164  // The heat of the part W_n did not take stays in T_s for the next step; it is
165  // zero to round-off in double precision.
166  t_s = amrex::max(amrex::Real(force_restore_snow_t_melt),
167  force_restore_snow_t_melt + lat_ice * (potential - out.melt) / prm.c_s);
168  } else {
169  out.melt = w_n;
170  w_n = zero;
171  t_s -= lat_ice * out.melt / prm.c_s;
172  }
173  }
174  // The balance's upper bound, after the melt has taken its heat.
175  if (t_s > prm.t_max) { t_s = prm.t_max; }
176  return out;
177 }
constexpr amrex::Real force_restore_snow_t_melt
The melting point T_00 [K] of DRM95 Eq. (12).
Definition: ERF_ForceRestoreSnow.H:61
constexpr amrex::Real lat_ice
Definition: ERF_MicrophysicsConstants.H:114
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
amrex::Real c_s
Definition: ERF_ForceRestoreSnow.H:70
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

Referenced by ForceRestoreSnow::step().

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

Variable Documentation

◆ force_restore_snow_t_melt

constexpr amrex::Real force_restore_snow_t_melt = amrex::Real(273.16)
constexpr

The melting point T_00 [K] of DRM95 Eq. (12).

Referenced by force_restore_snow_step().