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

Go to the source code of this file.

Functions

ParmParse pp ("prob")
 
pp query ("rho_0", rho_0)
 
pp query ("T_0", T_0)
 
pp query ("A_0", A_0)
 
pp query ("KE_0", KE_0)
 
pp query ("T_0_Pert_Mag", T_0_Pert_Mag)
 
pp query ("qv_0_Pert_Mag", qv_0_Pert_Mag)
 
pp query ("pert_ref_height", pert_ref_height)
 
pp query ("custom_TKE", custom_TKE)
 
 ParallelForRNG (bx, [=] AMREX_GPU_DEVICE(int i, int j, int k, const RandomEngine &engine) noexcept { const Real *prob_lo=geomdata.ProbLo();const Real *prob_hi=geomdata.ProbHi();const Real *dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+myhalf) *dx[0];const Real y=prob_lo[1]+(j+myhalf) *dx[1];const Real z=use_z_phys ? z_cc(i, j, k) :prob_lo[2]+(k+myhalf) *dx[2];const Real z_agl=z - erf_prob_heights::z_ground_cc(i, j, z_sfc_nd);const Real xc=myhalf *(prob_lo[0]+prob_hi[0]);const Real yc=myhalf *(prob_lo[1]+prob_hi[1]);const Real zc=myhalf *(phys_z_lo+phys_z_hi);const Real r=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc)+(z-zc) *(z-zc));const bool rand_T=(z_agl<=pert_ref_height) &&(T_0_Pert_Mag !=zero);const bool rand_qv=use_moisture &&(z_agl<=pert_ref_height) &&(qv_0_Pert_Mag !=zero);Real dT=zero;Real dqv=zero;if(rand_T) { Real rand_double=amrex::Random(engine);dT=(rand_double *two - one) *T_0_Pert_Mag;} if(rand_qv) { Real rand_double=amrex::Random(engine);dqv=(rand_double *two - one) *qv_0_Pert_Mag;} if(rand_T||rand_qv) { Real drho, drhoqv;erf_moist_perturbation::perturb_temperature_and_vapour(state(i, j, k, Rho_comp), state(i, j, k, RhoTheta_comp), use_moisture ? state(i, j, k, RhoQ1_comp) :zero, dT, dqv, rand_T, use_moisture, rdOcp, drho, drhoqv);if(rand_T) { state_pert(i, j, k, Rho_comp)=drho;state_pert(i, j, k, RhoTheta_comp)=zero;} if(use_moisture) { state_pert(i, j, k, RhoQ1_comp)=drhoqv;} } state_pert(i, j, k, RhoScalar_comp)=A_0 *std::exp(-amrex::Real(10.) *r *r);if(custom_TKE) { state_pert(i, j, k, RhoKE_comp)=(one - z/phys_z_hi) *r_hse(i, j, k);} else { state_pert(i, j, k, RhoKE_comp)=KE_0;} if(use_moisture) { state_pert(i, j, k, RhoQ2_comp)=state_pert(i, j, k, Rho_comp) *state(i, j, k, RhoQ2_comp)/state(i, j, k, Rho_comp);} })
 

Variables

const bool use_z_phys = use_physical_z()
 
const Real phys_z_lo = phys_zlo(geomdata, lev)
 
const Real phys_z_hi = phys_zhi(geomdata, lev)
 
amrex::Real rho_0 = zero
 
amrex::Real T_0 = zero
 
amrex::Real A_0 = one
 
amrex::Real KE_0 = amrex::Real(0.1)
 
Real T_0_Pert_Mag = zero
 
Real qv_0_Pert_Mag = zero
 
Real pert_ref_height = amrex::Real(100.0)
 
bool custom_TKE = false
 
const bool use_moisture = (sc.moisture_type != MoistureType::None)
 
const Real rdOcp = sc.rdOcp
 

Function Documentation

◆ ParallelForRNG()

ParallelForRNG ( bx  ,
[=] AMREX_GPU_DEVICE(int i, int j, int k, const RandomEngine &engine) noexcept { const Real *prob_lo=geomdata.ProbLo();const Real *prob_hi=geomdata.ProbHi();const Real *dx=geomdata.CellSize();const Real x=prob_lo[0]+(i+myhalf) *dx[0];const Real y=prob_lo[1]+(j+myhalf) *dx[1];const Real z=use_z_phys ? z_cc(i, j, k) :prob_lo[2]+(k+myhalf) *dx[2];const Real z_agl=z - erf_prob_heights::z_ground_cc(i, j, z_sfc_nd);const Real xc=myhalf *(prob_lo[0]+prob_hi[0]);const Real yc=myhalf *(prob_lo[1]+prob_hi[1]);const Real zc=myhalf *(phys_z_lo+phys_z_hi);const Real r=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc)+(z-zc) *(z-zc));const bool rand_T=(z_agl<=pert_ref_height) &&(T_0_Pert_Mag !=zero);const bool rand_qv=use_moisture &&(z_agl<=pert_ref_height) &&(qv_0_Pert_Mag !=zero);Real dT=zero;Real dqv=zero;if(rand_T) { Real rand_double=amrex::Random(engine);dT=(rand_double *two - one) *T_0_Pert_Mag;} if(rand_qv) { Real rand_double=amrex::Random(engine);dqv=(rand_double *two - one) *qv_0_Pert_Mag;} if(rand_T||rand_qv) { Real drho, drhoqv;erf_moist_perturbation::perturb_temperature_and_vapour(state(i, j, k, Rho_comp), state(i, j, k, RhoTheta_comp), use_moisture ? state(i, j, k, RhoQ1_comp) :zero, dT, dqv, rand_T, use_moisture, rdOcp, drho, drhoqv);if(rand_T) { state_pert(i, j, k, Rho_comp)=drho;state_pert(i, j, k, RhoTheta_comp)=zero;} if(use_moisture) { state_pert(i, j, k, RhoQ1_comp)=drhoqv;} } state_pert(i, j, k, RhoScalar_comp)=A_0 *std::exp(-amrex::Real(10.) *r *r);if(custom_TKE) { state_pert(i, j, k, RhoKE_comp)=(one - z/phys_z_hi) *r_hse(i, j, k);} else { state_pert(i, j, k, RhoKE_comp)=KE_0;} if(use_moisture) { state_pert(i, j, k, RhoQ2_comp)=state_pert(i, j, k, Rho_comp) *state(i, j, k, RhoQ2_comp)/state(i, j, k, Rho_comp);} }   
)
Here is the call graph for this function:

◆ pp()

ParmParse pp ( "prob"  )

Referenced by add_par(), Morrison::AdvanceColumns(), WDM6::AdvanceColumns(), WSM6::AdvanceColumns(), ERF::appendPlotVariables(), plotfile2d::available_diagnostic_names(), SolverChoice::build_coriolis_forcings_const_lat(), eb_aux_::define(), AdvChoice::display(), erf_init_dens_hse_moist(), ERF::ERF_shared(), ERF::ErrorEst(), Morrison::Init(), WDM6::Init(), SLM::Init(), ProblemBase::init_buildings_surface(), ERF::init_custom(), SLM::init_from_inputs(), init_my_custom_terrain(), IBSEBParams::init_params(), CanopyTurbulence::init_params(), RadChoice::init_params(), TurbChoice::init_params(), SolverChoice::init_params(), AdvChoice::init_params(), DampingChoice::init_params(), DiffChoice::init_params(), EBChoice::init_params(), SpongeChoice::init_params(), ERF::init_phys_bcs(), ProblemBase::init_terrain_surface(), TurbulentPerturbation::init_tpi(), init_which_terrain_grid(), WindFarm::init_windfarm_lat_lon(), init_zlevels(), ERF::init_zphys(), ERF::InitData_post(), ERF::InitData_pre(), ERF::initializeFire(), InputSoundingData::InputSoundingData(), InputSpongeData::InputSpongeData(), LargeScaleForcingData::LargeScaleForcingData(), LineSampler::LineSampler(), SurfaceLayer::make_SurfaceLayer_at_level(), make_terrain_fitted_coords(), ProblemBase::name(), ObsNudging::ObsNudging(), plotfile2d::parse_requested_sampled_level_sets(), plotfile2d::parse_sampled_level_definition(), erf_wall_scalar_bc::parse_wall_face_scalars(), PlaneSampler::PlaneSampler(), query_one_or_per_level(), query_one_or_per_level_enum_case_insensitive(), Radiation::Radiation(), FireCouplingParams::read(), RRTMGPSolarChoice::read(), TopographicShadingChoice::read(), SolverChoice::read_int_string(), read_shoc_runtime_options(), read_shoc_transport_modes(), ReadBndryPlanes::ReadBndryPlanes(), ERF::ReadParameters(), ERF::refinement_criteria_setup(), erf_cloud_chamber::reject_unsupported_face_keys(), ERF::remake_zphys(), SurfaceLayer::set_default_roughness(), MOSTAverage::set_k_indices_N(), MOSTAverage::set_k_indices_T(), MOSTAverage::set_norm_indices_T(), MOSTAverage::set_norm_positions_T(), MOSTAverage::set_z_positions_EB(), MOSTAverage::set_z_positions_T(), ERF::setPlotVariables(), ERF::setPlotVariables2D(), ERF::setSubVolVariables(), IRadiation::setupDataLog(), SHOCInterface::SHOCInterface(), StationSampler::StationSampler(), ProblemBase::terrain_is_specified(), which_fine_terrain(), WriteBndryPlanes::WriteBndryPlanes(), and ERF::WriteSubvolume().

◆ query() [1/8]

pp query ( "A_0"  ,
A_0   
)

◆ query() [2/8]

pp query ( "custom_TKE"  ,
custom_TKE   
)

◆ query() [3/8]

pp query ( "KE_0"  ,
KE_0   
)

◆ query() [4/8]

pp query ( "pert_ref_height"  ,
pert_ref_height   
)

◆ query() [5/8]

pp query ( "qv_0_Pert_Mag"  ,
qv_0_Pert_Mag   
)

◆ query() [6/8]

pp query ( "rho_0"  ,
rho_0   
)

◆ query() [7/8]

pp query ( "T_0"  ,
T_0   
)

◆ query() [8/8]

pp query ( "T_0_Pert_Mag"  ,
T_0_Pert_Mag   
)

Variable Documentation

◆ A_0

Referenced by ParallelForRNG().

◆ custom_TKE

bool custom_TKE = false

Referenced by ParallelForRNG().

◆ KE_0

amrex::Real KE_0 = amrex::Real(0.1)

Referenced by ParallelForRNG().

◆ pert_ref_height

Real pert_ref_height = amrex::Real(100.0)

Referenced by ParallelForRNG().

◆ phys_z_hi

const Real phys_z_hi = phys_zhi(geomdata, lev)

Referenced by ParallelForRNG().

◆ phys_z_lo

const Real phys_z_lo = phys_zlo(geomdata, lev)

Referenced by ParallelForRNG().

◆ qv_0_Pert_Mag

Real qv_0_Pert_Mag = zero

Referenced by ParallelForRNG().

◆ rdOcp

const Real rdOcp = sc.rdOcp

Referenced by ParallelForRNG().

◆ rho_0

amrex::Real rho_0 = zero

◆ T_0

◆ T_0_Pert_Mag

Real T_0_Pert_Mag = zero

Referenced by ParallelForRNG().

◆ use_moisture

const bool use_moisture = (sc.moisture_type != MoistureType::None)

Referenced by ParallelForRNG().

◆ use_z_phys

const bool use_z_phys = use_physical_z()

Referenced by ParallelForRNG().