ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_SEBTurbulentFlux.cpp File Reference
#include <ERF_SEBTurbulentFlux.H>
#include <ERF_Plotfile2DFill.H>
#include <ERF_Constants.H>
#include <AMReX_Gpu.H>
Include dependency graph for ERF_SEBTurbulentFlux.cpp:

Functions

void fill_seb_field_from_land_surface (MultiFab &seb_field, const MultiFab *field, Real fallback, Real scale, const MultiFab *add_field)
 
SEBFluxOrigin fill_seb_turbulent_flux (MultiFab &seb_flux, SEBTurbulentFlux kind, const MultiFab *land_surface_field, const MultiFab *surface_layer_flux, int surface_k, SEBTurbulentFluxSource source, Real fallback)
 

Function Documentation

◆ fill_seb_field_from_land_surface()

void fill_seb_field_from_land_surface ( MultiFab &  seb_field,
const MultiFab *  field,
Real  fallback,
Real  scale,
const MultiFab *  add_field 
)
55 {
56  seb_field.setVal(fallback);
57  if (field != nullptr) {
58  overwrite_valid_land_surface_cells(seb_field, *field, scale, add_field);
59  }
60 }

◆ fill_seb_turbulent_flux()

SEBFluxOrigin fill_seb_turbulent_flux ( MultiFab &  seb_flux,
SEBTurbulentFlux  kind,
const MultiFab *  land_surface_field,
const MultiFab *  surface_layer_flux,
int  surface_k,
SEBTurbulentFluxSource  source,
Real  fallback 
)
70 {
71  // The fallback fills every cell, halo included; the surface layer's flux then
72  // overwrites the valid cells when it is the source, and the land model's valid
73  // values overwrite those in turn.
74  seb_flux.setVal(fallback);
75  const SEBFluxOrigin below = select_seb_flux_origin(false, source,
76  surface_layer_flux != nullptr);
77  if (below == SEBFluxOrigin::SurfaceLayer) {
78  // The 2D-output conversions, so the balance's H and LE are exactly the
79  // sensible_heat_flux and latent_heat_flux a plotfile reports.
80  if (kind == SEBTurbulentFlux::Sensible) {
82  seb_flux, 0, surface_layer_flux, surface_k, fallback);
83  } else {
85  seb_flux, 0, surface_layer_flux, surface_k, fallback);
86  }
87  }
88  if (land_surface_field != nullptr) {
89  overwrite_valid_land_surface_cells(seb_flux, *land_surface_field, Real(1.0), nullptr);
90  }
91  return select_seb_flux_origin(land_surface_field != nullptr, source,
92  surface_layer_flux != nullptr);
93 }
SEBFluxOrigin select_seb_flux_origin(bool land_surface_field_present, SEBTurbulentFluxSource source, bool surface_layer_flux_present) noexcept
The precedence rule: land-surface field, then surface layer, then default.
Definition: ERF_SEBTurbulentFlux.H:51
SEBFluxOrigin
Which of the three sources a field was filled from.
Definition: ERF_SEBTurbulentFlux.H:38
amrex::Real Real
Definition: ERF_ShocInterface.H:19
void fill_sensible_heat_flux_from_klevel_or_missing(MultiFab &dst, int dst_comp, const MultiFab *src, int src_k, Real missing_value)
Definition: ERF_Plotfile2DFill.cpp:107
void fill_latent_heat_flux_from_klevel_or_missing(MultiFab &dst, int dst_comp, const MultiFab *src, int src_k, Real missing_value)
Definition: ERF_Plotfile2DFill.cpp:138

Referenced by TwoStreamRadiation::advance().

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