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:

Namespaces

 erf_detail_SEBTurbulentFlux
 

Functions

void erf_detail_SEBTurbulentFlux::overwrite_valid_land_surface_cells (MultiFab &dst, const MultiFab &src, Real scale, const MultiFab *add)
 
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 
)
56 {
57  seb_field.setVal(fallback);
58  if (field != nullptr) {
59  overwrite_valid_land_surface_cells(seb_field, *field, scale, add_field);
60  }
61 }
void overwrite_valid_land_surface_cells(MultiFab &dst, const MultiFab &src, Real scale, const MultiFab *add)
Definition: ERF_SEBTurbulentFlux.cpp:14
Here is the call graph for this function:

◆ 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 
)
71 {
72  // The fallback fills every cell, halo included; the surface layer's flux then
73  // overwrites the valid cells when it is the source, and the land model's valid
74  // values overwrite those in turn.
75  seb_flux.setVal(fallback);
76  const SEBFluxOrigin below = select_seb_flux_origin(false, source,
77  surface_layer_flux != nullptr);
78  if (below == SEBFluxOrigin::SurfaceLayer) {
79  // The 2D-output conversions, so the balance's H and LE are exactly the
80  // sensible_heat_flux and latent_heat_flux a plotfile reports.
81  if (kind == SEBTurbulentFlux::Sensible) {
83  seb_flux, 0, surface_layer_flux, surface_k, fallback);
84  } else {
86  seb_flux, 0, surface_layer_flux, surface_k, fallback);
87  }
88  }
89  if (land_surface_field != nullptr) {
90  overwrite_valid_land_surface_cells(seb_flux, *land_surface_field, Real(1.0), nullptr);
91  }
92  return select_seb_flux_origin(land_surface_field != nullptr, source,
93  surface_layer_flux != nullptr);
94 }
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
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: