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

Go to the source code of this file.

Functions

ParmParse pp ("prob")
 
pp query ("KE_0", KE_0)
 
pp query ("KE_decay_height", KE_decay_height)
 
pp query ("KE_decay_order", KE_decay_order)
 
 if (KE_decay_height > 0 &&state_pert.nComp() > RhoKE_comp)
 
 if (state_pert.nComp() > RhoKE_comp)
 

Variables

Real KE_0 = zero
 
Real KE_decay_height = -1
 
Real KE_decay_order = 1
 
const bool use_eb = (sc.terrain_type == TerrainType::EB)
 
const int klo = geomdata.Domain().smallEnd(2)
 

Function Documentation

◆ if() [1/2]

if ( KE_decay_height  ,
0 &&state_pert.  nComp(),
RhoKE_comp   
)
11  {
12  amrex::Print() << "Initial KE profile (order " << KE_decay_order
13  << ") will extend up to " << KE_decay_height
14  << std::endl;
15  AMREX_ALWAYS_ASSERT_WITH_MESSAGE(klo == bx.smallEnd(2),
16  "Vertical decomposition with KE initialization is not allowed.");
17  }
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(axis >=0 &&axis< AMREX_SPACEDIM, "prob.axis must be 0, 1 or 2")
const int klo
Definition: ERF_InitCustomPert_KE.H:9
Real KE_decay_order
Definition: ERF_InitCustomPert_KE.H:6
Real KE_decay_height
Definition: ERF_InitCustomPert_KE.H:5
Here is the call graph for this function:

◆ if() [2/2]

if ( state_pert.  nComp(),
RhoKE_comp   
)
19  {
21  "KE_0 must be non-negative.");
22 
23  ParallelFor(bx, [=,one_d=one] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
24  {
25  // Set an initial value for SGS KE
26  state_pert(i, j, k, RhoKE_comp) = r_hse(i,j,k) * KE_0;
27  // scale initial SGS kinetic energy with height
28  if (KE_decay_height > 0) {
29  const Real z_sfc = (use_eb) ? zero :
30  fourth * ( z_nd(i ,j ,klo) + z_nd(i+1,j ,klo)
31  + z_nd(i ,j+1,klo) + z_nd(i+1,j+1,klo) );
32  const Real z_agl = z_cc(i,j,k) - z_sfc;
33  state_pert(i, j, k, RhoKE_comp) *= max(
34  std::pow(1 - min(z_agl/KE_decay_height,one_d), KE_decay_order),
35  amrex::Real(1e-12));
36  }
37  });
38  }
#define RhoKE_comp
Definition: ERF_IndexDefines.H:55
Real KE_0
Definition: ERF_InitCustomPert_KE.H:4
const bool use_eb
Definition: ERF_InitCustomPert_KE.H:8
ParallelFor(fab_box, [=] AMREX_GPU_DEVICE(int i, int j, int k) { qrcuten_arr(i, j, k)=Real(0);qscuten_arr(i, j, k)=Real(0);qicuten_arr(i, j, k)=Real(0);})
constexpr amrex::Real one
Definition: ERF_NumericalConstants.H:37
constexpr amrex::Real fourth
Definition: ERF_NumericalConstants.H:42
constexpr amrex::Real zero
Definition: ERF_NumericalConstants.H:36
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Here is the call graph for this function:

◆ pp()

ParmParse pp ( "prob"  )

◆ query() [1/3]

pp query ( "KE_0"  ,
KE_0   
)

◆ query() [2/3]

pp query ( "KE_decay_height"  ,
KE_decay_height   
)

◆ query() [3/3]

pp query ( "KE_decay_order"  ,
KE_decay_order   
)

Variable Documentation

◆ KE_0

Real KE_0 = zero

Referenced by if().

◆ KE_decay_height

Real KE_decay_height = -1

Referenced by if().

◆ KE_decay_order

Real KE_decay_order = 1

Referenced by if().

◆ klo

const int klo = geomdata.Domain().smallEnd(2)

Referenced by ObsNudging::add_momentum_sources(), NOAHMP::Advance_With_State(), Morrison::AdvanceColumns(), WDM6::AdvanceColumns(), WSM6::AdvanceColumns(), apply_fire_tendency_to_cc_source(), bottom_node_slab(), IBFaceSet::build(), BuildScalarDiffusionFluxes_S(), BuildScalarDiffusionFluxes_S_Impl(), ERF::check_mesh_type(), column_bands(), ERF::compute_max_buoyancy_gradp_diagnostic(), ERF::compute_max_pressure_gradient_diagnostic(), MYNNPBLH::compute_pblh(), SurfaceLayer::compute_sfc_params_from_lsm_fluxes(), SurfaceLayer::compute_SurfaceLayer_bcs(), moeng_flux::compute_v_flux(), ComputeDiffusivityMRF(), ComputeDiffusivityMYJ(), ComputeDiffusivityYSUNew(), TurbulentPerturbation::configure_automatic(), copy_ground_plane(), copy_surface_tau_for_implicit(), DiffusionSrcForState_S(), derived::erf_derhelicity(), derived::erf_dermucape(), ERF::erf_enforce_hse(), erf_init_dens_hse_dry(), erf_slow_rhs_post(), erf_slow_rhs_pre(), erf_substep_MT(), erf_substep_NS(), erf_substep_T(), ERF::ErrorEst(), ERF::estTimeStep(), erf_terrain_file::FaceBandSlopes(), near_surface_diagnostics::fill(), ShocPreprocess::fill_columns(), plotfile2d::fill_precipitation_accumulations(), fill_qmoist_restart_var(), SurfaceLayer::fill_qsurf_with_skin_moisture(), plotfile2d::fill_sampled_level_component(), sea_level_pressure_diagnostics::fill_sea_level_pressure(), ERF::fill_surface_nodes(), fill_terrain_surface_slab(), SurfaceLayer::fill_tsurf_with_abs_surf_temp(), SurfaceLayer::fill_tsurf_with_coupled_sst(), SurfaceLayer::fill_tsurf_with_sfc_sst(), SurfaceLayer::fill_tsurf_with_skin_temperature(), SurfaceLayer::fill_tsurf_with_sst_and_tsk(), near_surface_diagnostics::fill_wind_10m(), ERF::FillBdyCCVels(), ERF::FillPlot2DVars(), fire_surface_precip_accum_k0(), SurfaceLayer::get_lsm_tsurf(), if_bld::horiz_face(), if(), immersed_wall_dist(), ImmersedForcingTerrain_HorizMom_FractionStress(), ImmersedForcingTerrain_Scalar_FractionStress(), ImplicitDiffForMomLU_N(), ImplicitDiffForMomLU_S(), ImplicitDiffForMomLU_T(), ImplicitDiffForStateLU_N(), ImplicitDiffForStateLU_S(), ImplicitDiffForStateLU_T(), Radiation::Init(), NOAHMP::Init(), ERF::init_custom(), ERF::init_Dirichlet_bc_data(), ERF::init_geo_wind_profile(), HSEutils::init_isentropic_hse_constant_dz(), HSEutils::init_isentropic_hse_stretched_dz(), HSEutils::init_isentropic_hse_terrain(), SurfaceLayer::init_tke_from_ustar(), LargeScaleForcingData::interp_forcing(), ERFFillPatcher::InterpFace(), make_buoyancy(), make_fast_coeffs(), make_ib_wall_face_masks(), make_sources(), ERF::make_sub_dz(), IBFaceSet::map_buildings_to_level0(), ERFPhysBCFunct_w::operator()(), BelowGroundGhostSync::operator()(), ERF::PackAtmosphericStates(), ERF::poisson_wall_dist(), ERF::read_box_for_refinement(), SurfaceLayer::read_custom_roughness(), ProblemBase::read_custom_terrain(), InputSpongeData::read_from_file(), InputSoundingData::read_from_file(), rebalance_columns(), ERF::resolve_station_stencils(), rotate_scalar_flux(), rotate_stress_tensor(), ERF::sample_lines(), sample_perturbation_wind(), ERF::sample_stations(), sedimentation_add_column_sums(), SHOCInterface::set_grids(), MOSTAverage::set_norm_indices_T(), MOSTAverage::set_norm_positions_T(), SurfaceLayer::set_pblh(), SurfaceLayer::set_sfc_params_from_file_fluxes(), MOSTAverage::set_z_positions_T(), ERF::setRayleighRefFromSounding(), SolveTridiag(), NOAHMP::stage_forcing(), StretchedScalarGradient(), surface_slab(), terrain_at_station(), TerrainScalarDiffusionGzAtKFace(), SurfaceLayer::update_fluxes(), and MOSTAverage::write_xz_positions().

◆ use_eb

const bool use_eb = (sc.terrain_type == TerrainType::EB)