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:63
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
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(), ForceRestorePrecipRate::begin_step(), bottom_node_slab(), IBFaceSet::build(), SurfaceLayer::build_relative_velocities(), BuildScalarDiffusionFluxes_S(), BuildScalarDiffusionFluxes_S_Impl(), erf_actuator::erf_detail_ActuatorSampling::centre_column_value(), ERF::check_mesh_type(), column_bands(), erf_actuator::erf_detail_ActuatorSampling::column_value(), 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(), ERF::compute_tag_field(), moeng_flux::compute_v_flux(), ComputeDiffusivityMRF(), ComputeDiffusivityMYJ(), ComputeDiffusivityYSU(), TurbulentPerturbation::configure_automatic(), ERF::convert_legacy_surface_temperature(), copy_ground_plane(), copy_surface_tau_for_implicit(), SurfaceLayer::define_surface_current(), DiffusionSrcForState_S(), dqdz_cc(), ForceRestorePrecipRate::end_step(), 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(), WRFSurfaceFields::fill(), near_surface_diagnostics::fill(), ForceRestorePrecipRate::fill_accumulation(), ShocPreprocess::fill_columns(), plotfile2d::fill_precipitation_accumulations(), erf_detail_MakeNewLevel::fill_qmoist_restart_var(), 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(), ERF::FillPlot3DVars(), plotfile2d::erf_detail_Plotfile2DInterpolator::find_sampled_bracket(), fire_surface_precip_accum_k0(), SurfaceLayer::get_lsm_tsurf(), height_above_ground(), if_bld::horiz_face(), hse_terrain_columns(), TwoStreamRadiation::hydrology_begin_step(), TwoStreamRadiation::hydrology_end_step(), if(), immersed_wall_dist(), ImmersedForcingTerrain_HorizMom_FractionStress(), ImmersedForcingTerrain_Scalar_FractionStress(), ImplicitDiffForMomLU_N(), ImplicitDiffForMomLU_S(), ImplicitDiffForMomLU_T(), ImplicitDiffForStateLU_N(), ImplicitDiffForStateLU_S(), ImplicitDiffForStateLU_T(), 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(), init_state_from_input_sounding(), SurfaceLayer::init_tke_from_ustar(), init_velocities_from_input_sounding(), LargeScaleForcingData::interp_forcing(), ERFFillPatcher::InterpFace(), erf_actuator::ZBounds::k_range(), make_buoyancy(), make_fast_coeffs(), make_ib_wall_face_masks(), make_sources(), ERF::make_sub_dz(), make_zsfc_nd(), IBFaceSet::map_buildings_to_level0(), MOSTAverage::max_k_read(), erf_actuator::erf_detail_ActuatorSampling::node_level_table(), nonhydro_residual_cc(), 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(), ERF::ReadCheckpointFileSurfaceLayer(), rebalance_columns(), ERF::rebuild_base_state_from_coarse(), ERF::resolve_station_stencils(), rotate_scalar_flux(), rotate_stress_tensor(), erf_actuator::sample_cell_scalar(), erf_actuator::erf_detail_ActuatorSampling::sample_component(), sample_perturbation_wind(), ERF::sample_stations(), erf_actuator::sample_velocity_local(), ERF::SampleA2OPrecipAccumulation(), sedimentation_add_column_sums(), FloodCoupler::set_flood_grid(), 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(), SolveTridiag(), erf_actuator::spread_partial_norms(), NOAHMP::stage_forcing(), StretchedScalarGradient(), surface_precip_accum_k0(), surface_precip_fill_k0(), surface_precip_liquid_frozen_accum_k0(), surface_slab(), terrain_at_station(), erf_actuator::terrain_heights(), TerrainScalarDiffusionGzAtKFace(), SurfaceLayer::update_fluxes(), windfarm_face_height_above_ground(), and MOSTAverage::write_xz_positions().

◆ use_eb

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