|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Go to the source code of this file.
Functions | |
| ParmParse | pp_prob ("prob") |
| pp_erf | query ("deterministic_ic_pert", deterministic_ic_pert) |
| pp_erf | query ("fix_random_seed", fix_random_seed) |
| pp_erf | query ("random_seed", random_seed) |
| pp_prob | query ("rho_0", rho_0) |
| pp_prob | query ("T_0", T_0) |
| pp_prob | query ("A_0", A_0) |
| pp_prob | query ("KE_0", KE_0) |
| pp_prob | query ("rhoKE_0", rhoKE_0) |
| pp_prob | query ("KE_decay_height", KE_decay_height) |
| pp_prob | query ("KE_decay_order", KE_decay_order) |
| pp_prob | query ("T_0_Pert_Mag", T_0_Pert_Mag) |
| pp_prob | query ("pert_rhotheta", pert_rhotheta) |
| pp_prob | query ("pert_deltaU", pert_deltaU) |
| pp_prob | query ("pert_deltaV", pert_deltaV) |
| pp_prob | query ("pert_ref_height", pert_ref_height) |
| pp_prob | query ("pert_deltaT", pert_deltaT) |
| pp_prob | query ("bubble_x_c", bubble_x_c) |
| pp_prob | query ("bubble_y_c", bubble_y_c) |
| pp_prob | query ("bubble_z_c", bubble_z_c) |
| pp_prob | query ("bubble_x_r", bubble_x_r) |
| pp_prob | query ("bubble_y_r", bubble_y_r) |
| pp_prob | query ("bubble_z_r", bubble_z_r) |
| if (add_bubble) | |
| if (bubble_keys_given) | |
| pp_prob | query ("pert_periods_T", pert_periods_T) |
| if (KE_decay_height > 0 &&state_pert.nComp() > RhoKE_comp) | |
| if (pert_ref_height > 0) | |
| if (add_sinusoidal_T &&sc.fixed_density[lev]) | |
| ParallelForRNG (bx, [=] AMREX_GPU_DEVICE(int i, int j, int k, const amrex::RandomEngine &engine) noexcept { const Real x=prob_lo_x+(i+myhalf) *dx;const Real y=prob_lo_y+(j+myhalf) *dy;const Real z=z_cc(i, j, k);const Real z_agl=z - erf_prob_heights::z_ground_cc(i, j, z_sfc_nd);const Real r=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc)+(z-zc) *(z-zc));if((z_agl<=pert_ref_height) &&(T_0_Pert_Mag !=amrex::Real(0))) { Real rand_double;if(deterministic_ic_pert) { rand_double=erf_hash_rng::hash_uniform(i, j, k, temperature_hash_comp, lev, ic_pert_seed);} else { rand_double=amrex::Random(engine);} state_pert(i, j, k, RhoTheta_comp)=(rand_double *amrex::Real(2) - amrex::Real(1)) *T_0_Pert_Mag;if(!pert_rhotheta) { state_pert(i, j, k, RhoTheta_comp) *=r_hse(i, j, k);} } if(add_bubble) { const Real rx=(x - bubble_x_c)/bubble_x_r;const Real ry=(y - bubble_y_c)/bubble_y_r;const Real rz=(z - bubble_z_c)/bubble_z_r;const Real rr=std::sqrt(rx *rx+ry *ry+rz *rz);if(rr<=amrex::Real(1)) { const Real cb=std::cos(myhalf *PI *rr);const Real dtheta=bubble_dT *cb *cb;const Real rho=state(i, j, k, Rho_comp);const Real rhotheta=state(i, j, k, RhoTheta_comp);if(bubble_fixed_density) { state_pert(i, j, k, RhoTheta_comp)+=rho *dtheta;} else { const Real rho_new=rhotheta/(rhotheta/rho+dtheta);state_pert(i, j, k, Rho_comp)+=rho_new - rho;if(use_moisture) { state_pert(i, j, k, RhoQ1_comp)+=(rho_new - rho) *state(i, j, k, RhoQ1_comp)/rho;} } } } if(add_sinusoidal_T) { const Real zl=z_agl/pert_ref_height;const Real damp=std::exp(-myhalf *zl *zl);const Real rho=state(i, j, k, Rho_comp);const Real rhotheta=state(i, j, k, RhoTheta_comp);const Real qv=(use_moisture) ? state(i, j, k, RhoQ1_comp)/rho :amrex::Real(0);const Real Told=getTgivenRandRTh(rho, rhotheta, qv);const Real P=getPgivenRTh(rhotheta, qv);const Real Tnew=Told+tfac *damp *z_agl *std::cos(cval *(x - xc));const Real theta_new=getThgivenTandP(Tnew, P, rdOcp);const Real rho_new=getRhogivenThetaPress(theta_new, P, rdOcp, qv);state_pert(i, j, k, Rho_comp)+=rho_new - rho;if(use_moisture) { state_pert(i, j, k, RhoQ1_comp)+=(rho_new - rho) *qv;} } state_pert(i, j, k, RhoScalar_comp)=A_0 *std::exp(-amrex::Real(10.) *r *r);if(state_pert.nComp() > RhoKE_comp) { if(rhoKE_0 > 0) { state_pert(i, j, k, RhoKE_comp)=rhoKE_0;} else { state_pert(i, j, k, RhoKE_comp)=r_hse(i, j, k) *KE_0;} if(KE_decay_height > 0) { state_pert(i, j, k, RhoKE_comp) *=amrex::max(std::pow(1 - amrex::min(z_agl/KE_decay_height, amrex::Real(1)), KE_decay_order), amrex::Real(1e-12));} } }) | |
Variables | |
| int | deterministic_ic_pert = 0 |
| int | fix_random_seed = 0 |
| long | random_seed = -1 |
| const std::uint64_t | ic_pert_seed |
| constexpr int | temperature_hash_comp = 0 |
| Real | rho_0 = amrex::Real(0) |
| Real | T_0 = amrex::Real(0) |
| Real | A_0 = amrex::Real(1) |
| Real | KE_0 = amrex::Real(0.1) |
| Real | rhoKE_0 = -1 |
| Real | KE_decay_height = -1 |
| Real | KE_decay_order = 1 |
| Real | T_0_Pert_Mag = amrex::Real(0) |
| bool | pert_rhotheta = true |
| Real | pert_deltaU = amrex::Real(0) |
| Real | pert_deltaV = amrex::Real(0) |
| Real | pert_ref_height = amrex::Real(100.0) |
| Real | pert_deltaT = amrex::Real(0) |
| Real | bubble_dT = amrex::Real(0) |
| const bool | bubble_dT_given = pp_prob.query("bubble_dT", bubble_dT) |
| Real | bubble_x_c = amrex::Real(0) |
| Real | bubble_y_c = amrex::Real(0) |
| Real | bubble_z_c = amrex::Real(0) |
| Real | bubble_x_r = amrex::Real(0) |
| Real | bubble_y_r = amrex::Real(0) |
| Real | bubble_z_r = amrex::Real(0) |
| const bool | add_bubble = (bubble_dT != amrex::Real(0)) |
| const bool | bubble_reporter = bx.contains(geomdata.Domain().smallEnd()) |
| else | |
| const bool | bubble_fixed_density = (sc.fixed_density[lev] != 0) |
| Real | pert_periods_T = amrex::Real(5.0) |
| const Real | dx = geomdata.CellSize(0) |
| const Real | dy = geomdata.CellSize(1) |
| const Real | prob_lo_x = geomdata.ProbLo(0) |
| const Real | prob_lo_y = geomdata.ProbLo(1) |
| const Real | prob_lo_z = phys_zlo(geomdata, lev) |
| const Real | prob_hi_x = geomdata.ProbHi(0) |
| const Real | prob_hi_y = geomdata.ProbHi(1) |
| const Real | prob_hi_z = phys_zhi(geomdata, lev) |
| const Real | xc = myhalf * (prob_lo_x + prob_hi_x) |
| const Real | yc = myhalf * (prob_lo_y + prob_hi_y) |
| const Real | zc = myhalf * (prob_lo_z + prob_hi_z) |
| const bool | add_sinusoidal_T |
| const Real | cval = pert_periods_T * two * PI / (prob_hi_x - prob_lo_x) |
| const Real | tfac |
| const bool | use_moisture = (sc.moisture_type != MoistureType::None) |
| const Real | rdOcp = sc.rdOcp |
| if | ( | add_bubble | ) |
Referenced by ApplyNeumannBCs(), erf_substep_NS(), FillZeroAreaFaceFluxes(), ERF::InitData_post(), SurfaceModel::is_field_mapped(), erf_terrain_file::MakeTablePeriodic(), obs_nudging::obs_nudging_tendency(), ERF::ParameterSanityChecks(), and two_stream_sun_date().


| if | ( | add_sinusoidal_T &&sc. | fixed_density[lev] | ) |
| if | ( | bubble_keys_given | ) |
| if | ( | KE_decay_height | , |
| 0 &&state_pert. | nComp(), | ||
| RhoKE_comp | |||
| ) |
| if | ( | pert_ref_height | , |
| 0 | |||
| ) |
| ParallelForRNG | ( | bx | , |
| [=] AMREX_GPU_DEVICE(int i, int j, int k, const amrex::RandomEngine &engine) noexcept { const Real x=prob_lo_x+(i+myhalf) *dx;const Real y=prob_lo_y+(j+myhalf) *dy;const Real z=z_cc(i, j, k);const Real z_agl=z - erf_prob_heights::z_ground_cc(i, j, z_sfc_nd);const Real r=std::sqrt((x-xc) *(x-xc)+(y-yc) *(y-yc)+(z-zc) *(z-zc));if((z_agl<=pert_ref_height) &&(T_0_Pert_Mag !=amrex::Real(0))) { Real rand_double;if(deterministic_ic_pert) { rand_double=erf_hash_rng::hash_uniform(i, j, k, temperature_hash_comp, lev, ic_pert_seed);} else { rand_double=amrex::Random(engine);} state_pert(i, j, k, RhoTheta_comp)=(rand_double *amrex::Real(2) - amrex::Real(1)) *T_0_Pert_Mag;if(!pert_rhotheta) { state_pert(i, j, k, RhoTheta_comp) *=r_hse(i, j, k);} } if(add_bubble) { const Real rx=(x - bubble_x_c)/bubble_x_r;const Real ry=(y - bubble_y_c)/bubble_y_r;const Real rz=(z - bubble_z_c)/bubble_z_r;const Real rr=std::sqrt(rx *rx+ry *ry+rz *rz);if(rr<=amrex::Real(1)) { const Real cb=std::cos(myhalf *PI *rr);const Real dtheta=bubble_dT *cb *cb;const Real rho=state(i, j, k, Rho_comp);const Real rhotheta=state(i, j, k, RhoTheta_comp);if(bubble_fixed_density) { state_pert(i, j, k, RhoTheta_comp)+=rho *dtheta;} else { const Real rho_new=rhotheta/(rhotheta/rho+dtheta);state_pert(i, j, k, Rho_comp)+=rho_new - rho;if(use_moisture) { state_pert(i, j, k, RhoQ1_comp)+=(rho_new - rho) *state(i, j, k, RhoQ1_comp)/rho;} } } } if(add_sinusoidal_T) { const Real zl=z_agl/pert_ref_height;const Real damp=std::exp(-myhalf *zl *zl);const Real rho=state(i, j, k, Rho_comp);const Real rhotheta=state(i, j, k, RhoTheta_comp);const Real qv=(use_moisture) ? state(i, j, k, RhoQ1_comp)/rho :amrex::Real(0);const Real Told=getTgivenRandRTh(rho, rhotheta, qv);const Real P=getPgivenRTh(rhotheta, qv);const Real Tnew=Told+tfac *damp *z_agl *std::cos(cval *(x - xc));const Real theta_new=getThgivenTandP(Tnew, P, rdOcp);const Real rho_new=getRhogivenThetaPress(theta_new, P, rdOcp, qv);state_pert(i, j, k, Rho_comp)+=rho_new - rho;if(use_moisture) { state_pert(i, j, k, RhoQ1_comp)+=(rho_new - rho) *qv;} } state_pert(i, j, k, RhoScalar_comp)=A_0 *std::exp(-amrex::Real(10.) *r *r);if(state_pert.nComp() > RhoKE_comp) { if(rhoKE_0 > 0) { state_pert(i, j, k, RhoKE_comp)=rhoKE_0;} else { state_pert(i, j, k, RhoKE_comp)=r_hse(i, j, k) *KE_0;} if(KE_decay_height > 0) { state_pert(i, j, k, RhoKE_comp) *=amrex::max(std::pow(1 - amrex::min(z_agl/KE_decay_height, amrex::Real(1)), KE_decay_order), amrex::Real(1e-12));} } } | |||
| ) |
Referenced by ERF::create_random_perturbations().


| ParmParse pp_prob | ( | "prob" | ) |
Referenced by erf_init_const_dens_and_linear_th_hse(), erf_init_const_dens_and_th_hse(), erf_init_rayleigh(), ProblemBase::init_custom_terrain(), init_my_custom_terrain(), erf_cloud_chamber::parse_initialization(), and ProblemBase::terrain_is_specified().

| pp_prob query | ( | "bubble_x_c" | , |
| bubble_x_c | |||
| ) |
| pp_prob query | ( | "bubble_x_r" | , |
| bubble_x_r | |||
| ) |
| pp_prob query | ( | "bubble_y_c" | , |
| bubble_y_c | |||
| ) |
| pp_prob query | ( | "bubble_y_r" | , |
| bubble_y_r | |||
| ) |
| pp_prob query | ( | "bubble_z_c" | , |
| bubble_z_c | |||
| ) |
| pp_prob query | ( | "bubble_z_r" | , |
| bubble_z_r | |||
| ) |
| pp_erf query | ( | "deterministic_ic_pert" | , |
| deterministic_ic_pert | |||
| ) |
| pp_erf query | ( | "fix_random_seed" | , |
| fix_random_seed | |||
| ) |
| pp_prob query | ( | "KE_decay_height" | , |
| KE_decay_height | |||
| ) |
| pp_prob query | ( | "KE_decay_order" | , |
| KE_decay_order | |||
| ) |
| pp_prob query | ( | "pert_deltaT" | , |
| pert_deltaT | |||
| ) |
| pp_prob query | ( | "pert_deltaU" | , |
| pert_deltaU | |||
| ) |
| pp_prob query | ( | "pert_deltaV" | , |
| pert_deltaV | |||
| ) |
| pp_prob query | ( | "pert_periods_T" | , |
| pert_periods_T | |||
| ) |
| pp_for_pert_vels query | ( | "pert_ref_height" | , |
| pert_ref_height | |||
| ) |
| pp_prob query | ( | "pert_rhotheta" | , |
| pert_rhotheta | |||
| ) |
| pp_erf query | ( | "random_seed" | , |
| random_seed | |||
| ) |
| pp_prob query | ( | "T_0_Pert_Mag" | , |
| T_0_Pert_Mag | |||
| ) |
| Real A_0 = amrex::Real(1) |
Referenced by ParallelForRNG().
| const bool add_bubble = (bubble_dT != amrex::Real(0)) |
Referenced by ParallelForRNG().
| const bool add_sinusoidal_T |
Referenced by if(), and ParallelForRNG().
| Real bubble_dT = amrex::Real(0) |
Referenced by if(), and ParallelForRNG().
| const bool bubble_dT_given = pp_prob.query("bubble_dT", bubble_dT) |
Referenced by if().
| const bool bubble_fixed_density = (sc.fixed_density[lev] != 0) |
Referenced by ParallelForRNG().
| const bool bubble_reporter = bx.contains(geomdata.Domain().smallEnd()) |
Referenced by if().
| Real bubble_x_c = amrex::Real(0) |
Referenced by if(), and ParallelForRNG().
| Real bubble_x_r = amrex::Real(0) |
Referenced by if(), and ParallelForRNG().
| Real bubble_y_c = amrex::Real(0) |
Referenced by if(), and ParallelForRNG().
| Real bubble_y_r = amrex::Real(0) |
Referenced by if(), and ParallelForRNG().
| Real bubble_z_c = amrex::Real(0) |
Referenced by if(), and ParallelForRNG().
| Real bubble_z_r = amrex::Real(0) |
Referenced by if(), and ParallelForRNG().
| const Real cval = pert_periods_T * two * PI / (prob_hi_x - prob_lo_x) |
Referenced by ParallelForRNG().
| int deterministic_ic_pert = 0 |
Referenced by ParallelForRNG().
| const Real dx = geomdata.CellSize(0) |
Referenced by ParallelForRNG().
| const Real dy = geomdata.CellSize(1) |
Referenced by erf_sbm::SBMTransport::advance_stage(), erf_auxiliary::AuxiliaryInertTracer::advance_stage(), ERF::apply_gaussian_smoothing_to_perturbations(), erf_auxiliary::ApplyAuxiliaryMappedStage(), erf_auxiliary::ApplyMappedFluxTendency(), MOSTAverage::compute_eb_averages(), compute_gradp_xy(), compute_gradp_z(), ShocStructure::diagnose_length_and_brunt(), ShocDiagnostics::diagnose_pre_implicit(), DiffusionSrcForMom_EB(), DiffusionSrcForState_EB(), erf_detail_DiffusionSrcForMom_EB::eb_wall_correction(), erf_calc_slopes_eb_Dirichlet(), erf_calc_slopes_eb_Dirichlet_staggered(), erf_calc_slopes_eb_staggered(), erf_calc_slopes_eb_staggered_upwind(), interpolate_from_coarse(), erf_detail_DiffusionSrcForMom_EB::launch_eb_wall_correction(), NodalReconstruction::NodalReconstruction(), ParallelForRNG(), ibseb::ray_blocked_walk(), ibseb::ray_hit_landing(), MOSTAverage::set_eb_normalization(), erf_topography::shadowed(), and erf_cloud_chamber::staggered_velocity_v_scale().
| else |
| int fix_random_seed = 0 |
Referenced by ERF::ERF_shared(), and TurbulentPerturbation::init_tpi().
| const std::uint64_t ic_pert_seed |
Referenced by ParallelForRNG().
| Real KE_0 = amrex::Real(0.1) |
Referenced by ParallelForRNG().
| Real KE_decay_height = -1 |
Referenced by if(), and ParallelForRNG().
| Real KE_decay_order = 1 |
Referenced by if(), and ParallelForRNG().
| Real pert_deltaT = amrex::Real(0) |
Referenced by if().
| Real pert_deltaU = amrex::Real(0) |
| Real pert_deltaV = amrex::Real(0) |
| Real pert_periods_T = amrex::Real(5.0) |
Referenced by if().
| Real pert_ref_height = amrex::Real(100.0) |
Referenced by ParallelForRNG().
| bool pert_rhotheta = true |
Referenced by if(), and ParallelForRNG().
| const Real prob_hi_x = geomdata.ProbHi(0) |
| const Real prob_hi_y = geomdata.ProbHi(1) |
| const Real prob_hi_z = phys_zhi(geomdata, lev) |
| const Real prob_lo_x = geomdata.ProbLo(0) |
Referenced by ParallelForRNG().
| const Real prob_lo_y = geomdata.ProbLo(1) |
Referenced by ParallelForRNG().
| const Real prob_lo_z = phys_zlo(geomdata, lev) |
| long random_seed = -1 |
Referenced by ERF::ERF_shared(), and TurbulentPerturbation::init_tpi().
| const Real rdOcp = sc.rdOcp |
Referenced by IBFaceSet::add_heat_flux_to_source(), SatAdj::AdjustSatAdjCell(), SatAdj::AdvanceSatAdj(), erf_resolved_wall_flux::apply(), erf_cloud_chamber_wall_stress::apply(), erf_cloud_chamber_wall_stress::apply_face(), apply_fire_tendency_to_cc_source(), erf_cloud_chamber_wall_stress::apply_tangent_stress(), erf_cloud_chamber_wall_stress::averaged_physical_traction_component(), erf_cloud_chamber_wall_flux::bulk_theta_flux_in(), SAM::Cloud(), compute_rh_from_conservative(), compute_t_from_conservative(), ERF::convert_legacy_surface_temperature(), WSM6::Copy_Micro_to_State(), TwoStreamRadiation::define_level(), diagnose_microphysics_thermo_state(), ERF::erf_enforce_hse(), ERF::estTimeStep(), 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(), ERF::FillPlot3DVars(), SurfaceLayer::get_lsm_tsurf(), getExnergivenP(), getExnergivenRTh(), getRhogivenThetaPress(), getTgivenPandTh(), getThgivenRandT(), getThgivenTandP(), rrtmgp::inverse_exner(), kessler_copy_state_to_micro_cell(), Radiation::kokkos_buffers_to_mf(), make_two_stream_params(), Radiation::mf_to_kokkos_buffers(), morrison_copy_state_to_micro_cell(), erf_cloud_chamber_wall_flux::most_wall_coefficients(), ParallelForRNG(), erf_moist_perturbation::perturb_temperature_and_vapour(), Radiation::populateDatalogMF(), erf_checkpoint_surface_temperature::potential_to_absolute_temperature(), SAM::Precip(), ReadBndryPlanes::read_file(), realbdy_compute_interior_ghost_rhs(), realbdy_compute_relaxation(), rrtmgp::resolve_surface_temperature(), erf_cloud_chamber_wall_flux::resolved_theta_flux_in(), sam_cons_to_primitive_with_base_state(), sam_copy_state_to_micro_cell(), sam_theta_from_stored_mbar_converted_to_pa(), erf_surface_temperature::temperature_to_theta(), erf_surface_temperature::theta_to_temperature(), erf_cloud_chamber_wall_stress::wall_traction_at_cell(), wdm6_copy_state_to_micro_cell(), wsm6_copy_micro_to_state_cell(), and wsm6_copy_state_to_micro_cell().
| Real rho_0 = amrex::Real(0) |
Referenced by erf_init_const_dens_and_linear_th_hse(), erf_init_const_dens_and_th_hse(), erf_init_const_dens_hse(), ProblemBase::init_base_parms(), init_state_from_input_sounding(), SAM::PrecipFall(), sam_precip_component_max_fall_speed(), sam_precip_flux_components_density_corrected(), sam_precip_flux_density_corrected(), and sam_surface_accumulation().
| Real rhoKE_0 = -1 |
Referenced by ParallelForRNG().
| Real T_0 = amrex::Real(0) |
| Real T_0_Pert_Mag = amrex::Real(0) |
Referenced by if(), and ParallelForRNG().
|
constexpr |
Referenced by ParallelForRNG().
| const Real tfac |
Referenced by ParallelForRNG().
| const bool use_moisture = (sc.moisture_type != MoistureType::None) |
Referenced by SurfaceLayer::compute_sfc_params_from_lsm_fluxes(), SurfaceLayer::compute_SurfaceLayer_bcs(), ComputeDiffusivityMRF(), ComputeDiffusivityMYJ(), ComputeDiffusivityMYNN25(), ComputeDiffusivityMYNNEDMF(), ComputeDiffusivityYSU(), ComputeTurbulentViscosity(), ComputeVirtualTStarPBL(), ERF::create_background_state_for_ensemble(), ERF::derive_diag_profiles(), ERF::derive_diag_profiles_stag(), 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(), SurfaceLayer::get_lsm_tsurf(), ERF::HurricaneMinPressureTracker(), ERF::MakeHorizontalAverages(), ParallelForRNG(), slow_rhs_pre_z_pressure_buoyancy(), and SurfaceLayer::update_fluxes().
Referenced by erf_vortex_Gaussian(), LineSampler::make_interp_plan(), ParallelFor(), and ParallelForRNG().
Referenced by erf_vortex_Gaussian(), ParallelFor(), and ParallelForRNG().