|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Simplified SEB — Diagnostic mode residual computation. More...
#include <AMReX_GpuControl.H>#include <AMReX_Math.H>#include <AMReX_FArrayBox.H>#include <cmath>#include <ERF_Constants.H>#include <ERF_MicrophysicsConstants.H>

Go to the source code of this file.
Functions | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | diagnose_seb_residual (amrex::Real sw_net, amrex::Real lw_net, amrex::Real hfx, amrex::Real lh, amrex::Real grdflx) |
| Diagnose the surface energy balance residual. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | prognostic_dTs_dt (amrex::Real seb_residual, amrex::Real t_s, amrex::Real t_deep, amrex::Real c_s, amrex::Real tau) |
| Compute prognostic surface temperature tendency using force-restore formulation. More... | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | prognostic_dqs_dt (amrex::Real le, amrex::Real q_s, amrex::Real q_deep, amrex::Real d_s, amrex::Real tau_q) |
| Compute prognostic surface moisture tendency using force-restore formulation. More... | |
Simplified SEB — Diagnostic mode residual computation.
Implements diagnostic-only surface energy balance residual diagnosis. No prognostic update to surface temperature or fluxes; residual is computed and reported for validation and diagnostic purposes only.
Surface Energy Balance Equation: R_net(i,j) = SW_net(i,j) + LW_net(i,j) = [sw_flux_sfc(i,j)] + [lw_flux_sfc(i,j)]
SEB_residual(i,j) = R_net(i,j) - hfx_sfc(i,j) - lh_sfc(i,j) - grdflx_sfc(i,j)
Where:
A perfectly closed budget gives SEB_residual = 0; non-zero residual indicates energy not accounted for by the four main SEB terms.
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real diagnose_seb_residual | ( | amrex::Real | sw_net, |
| amrex::Real | lw_net, | ||
| amrex::Real | hfx, | ||
| amrex::Real | lh, | ||
| amrex::Real | grdflx | ||
| ) |
Diagnose the surface energy balance residual.
Computes the SEB residual from net radiative flux and turbulent/ground heat fluxes. All inputs are guarded with amrex::Math::isfinite() to safely handle NaN/Inf; if any input is non-finite, returns 0.0 (safe no-op).
GPU Safety:
| [in] | sw_net | Shortwave net flux at surface [W/m^2] |
| [in] | lw_net | Longwave net flux at surface [W/m^2] |
| [in] | hfx | Sensible heat flux [W/m^2] |
| [in] | lh | Latent heat flux [W/m^2] |
| [in] | grdflx | Ground heat flux [W/m^2] |
Referenced by TwoStreamRadiation::advance().

| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real prognostic_dqs_dt | ( | amrex::Real | le, |
| amrex::Real | q_s, | ||
| amrex::Real | q_deep, | ||
| amrex::Real | d_s, | ||
| amrex::Real | tau_q | ||
| ) |
Compute prognostic surface moisture tendency using force-restore formulation.
Computes dq_s/dt from latent heat flux and restoring term toward deep soil moisture: dq_s/dt = -(LE / (L_v * rhor * d_s)) - (1/tau_q) * (q_s - q_deep)
Constants:
All inputs are guarded with amrex::Math::isfinite() to safely handle NaN/Inf; if any input is non-finite, any parameter is non-positive (d_s <= 0, tau_q <= 0), returns 0.0 (safe no-op).
GPU Safety:
| [in] | le | Latent heat flux [W/m^2] |
| [in] | q_s | Current surface moisture [kg/kg] |
| [in] | q_deep | Deep soil moisture [kg/kg] |
| [in] | d_s | Effective surface moisture layer depth [m] |
| [in] | tau_q | Moisture force-restore timescale [s] |
Referenced by TwoStreamRadiation::advance().

| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real prognostic_dTs_dt | ( | amrex::Real | seb_residual, |
| amrex::Real | t_s, | ||
| amrex::Real | t_deep, | ||
| amrex::Real | c_s, | ||
| amrex::Real | tau | ||
| ) |
Compute prognostic surface temperature tendency using force-restore formulation.
Computes dT_s/dt from SEB residual and restoring term toward deep soil temperature: dT_s/dt = SEB_residual / C_s - (2*pi/tau) * (T_s - T_deep)
All inputs are guarded with amrex::Math::isfinite() to safely handle NaN/Inf; if any input is non-finite, any parameter is non-positive (C_s <= 0, tau <= 0), returns 0.0 (safe no-op).
GPU Safety:
| [in] | seb_residual | SEB residual [W/m^2] = R_net - H - LE - G |
| [in] | t_s | Current surface temperature [K] |
| [in] | t_deep | Deep soil temperature [K] |
| [in] | c_s | Effective surface heat capacity [J/(m^2*K)] |
| [in] | tau | Force-restore timescale [s] |
Referenced by TwoStreamRadiation::advance().
