|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Go to the source code of this file.
Functions | |
| ParmParse | pp_prob ("prob") |
| pp_prob | query ("T_0", T_0) |
| pp_prob | query ("x_c", x_c) |
| pp_prob | query ("y_c", y_c) |
| pp_prob | query ("z_c", z_c) |
| pp_prob | query ("x_r", x_r) |
| pp_prob | query ("y_r", y_r) |
| pp_prob | query ("z_r", z_r) |
| pp_prob | query ("T_pert", T_pert) |
| pp_prob | query ("T_pert_is_airtemp", T_pert_is_airtemp) |
| pp_prob | query ("perturb_rho", perturb_rho) |
| pp_prob | query ("do_moist_bubble", do_moist_bubble) |
| pp_prob | query ("theta_pert", theta_pert) |
| AMREX_ALWAYS_ASSERT (bx.length()[2]==khi+1) | |
| background fields should have been initialized with erf init_type<< std::endl;} Real qt_init=amrex::Real(0.02);pp_prob.query("qt_init", qt_init);Real eq_pot_temp=amrex::Real(320.0);pp_prob.query("eq_pot_temp", eq_pot_temp);bool use_empirical=false;pp_prob.query("use_empircal_psat", use_empirical);if(do_moist_bubble) { Vector< Real > h_r(khi+2);Vector< Real > h_p(khi+2);Vector< Real > h_t(khi+2);Vector< Real > h_q_v(khi+2);Gpu::DeviceVector< Real > d_r(khi+2);Gpu::DeviceVector< Real > d_p(khi+2);Gpu::DeviceVector< Real > d_t(khi+2);Gpu::DeviceVector< Real > d_q_v(khi+2);HSEutils::init_isentropic_hse_no_terrain(h_t.data(), h_r.data(), h_p.data(), h_q_v.data(), dz, khi, qt_init, eq_pot_temp, use_empirical, false);Gpu::copyAsync(Gpu::hostToDevice, h_r.begin(), h_r.end(), d_r.begin());Gpu::copyAsync(Gpu::hostToDevice, h_p.begin(), h_p.end(), d_p.begin());Gpu::copyAsync(Gpu::hostToDevice, h_t.begin(), h_t.end(), d_t.begin());Gpu::copyAsync(Gpu::hostToDevice, h_q_v.begin(), h_q_v.end(), d_q_v.begin());Real *theta_back=d_t.data();Real *p_back=d_p.data();Real *q_v_back=d_q_v.data();const int qci_comp=sc.moisture_indices.qi;const bool is_eulerian=(Microphysics::modelType(sc.moisture_type)==MoistureModelType::Eulerian);const bool split_condensate=(qci_comp > | ParallelFor (bx, [=, zero_d=zero, one_d=one, tbgmin_d=tbgmin, a_bg_d=a_bg] AMREX_GPU_DEVICE(int i, int j, int k) { const auto prob_lo=geomdata.ProbLo();const auto 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=prob_lo[2]+(k+myhalf) *dx[2];Real rad, delta_theta, theta_total, rho, RH;rad=zero_d;if(x_r > 0) rad+=amrex::Math::powi< 2 >((x - x_c)/x_r);if(y_r > 0) rad+=amrex::Math::powi< 2 >((y - y_c)/y_r);if(z_r > 0) rad+=amrex::Math::powi< 2 >((z - z_c)/z_r);rad=std::sqrt(rad);if(rad<=amrex::Real(1)) { delta_theta=theta_pert *amrex::Math::powi< 2 >(std::cos(PI *rad/two));} else { delta_theta=zero_d;} theta_total=theta_back[k] *(delta_theta/amrex::Real(300.0)+1);Real T=getTgivenPandTh(p_back[k], theta_total, RdoCp);rho=p_back[k]/(R_d *T *(one_d+RvoRd *q_v_back[k]));RH=compute_relative_humidity(use_empirical);Real q_v_hot=vapor_mixing_ratio(p_back[k], T, RH);Real T_back=getTgivenPandTh(p_back[k], theta_back[k], RdoCp);Real rho_back=p_back[k]/(R_d *T_back *(one_d+RvoRd *q_v_back[k]));state_pert(i, j, k, RhoTheta_comp)=rho *theta_total - rho_back *theta_back[k] *(one_d+RvoRd *q_v_back[k]);state_pert(i, j, k, Rho_comp)=rho - rho_back *(one_d+qt_init);state_pert(i, j, k, RhoScalar_comp)=zero_d;state_pert(i, j, k, RhoQ1_comp)=rho *q_v_hot;state_pert(i, j, k, RhoQ2_comp)=rho *(qt_init - q_v_hot);if(split_condensate) { Real omn=std::max(zero_d, std::min(one_d,(T-tbgmin_d) *a_bg_d));Real qn=state_pert(i, j, k, RhoQ2_comp);state_pert(i, j, k, RhoQ2_comp)=qn *omn;state_pert(i, j, k, qci_comp)=qn *(one_d - omn);} }) |
Variables | |
| Real | T_0 = amrex::Real(300.0) |
| Real | x_c = zero |
| Real | y_c = zero |
| Real | z_c = zero |
| Real | x_r = zero |
| Real | y_r = zero |
| Real | z_r = zero |
| Real | T_pert = -amrex::Real(15.0) |
| bool | T_pert_is_airtemp = true |
| bool | perturb_rho = true |
| bool | do_moist_bubble = false |
| do_moist_bubble &Real | theta_pert = two |
| const int | khi = geomdata.Domain().bigEnd()[2] |
| const Real | dz = geomdata.CellSize()[2] |
| const Real | rdOcp = sc.rdOcp |
| else | |
| AMREX_ALWAYS_ASSERT | ( | bx. | length()[2] = =khi+1 | ) |
Referenced by Accumulate_Interval_Means(), ShocDriver::add_fast_tend(), ShocDriver::add_slow_tend(), AddPertToBckgnd(), ShocDriver::advance(), EWP::advance(), Fitch::advance(), GeneralAD::advance(), SimpleAD::advance(), MRISplitIntegrator< T >::advance(), ERF::advance_dycore(), ShocImplicit::advance_implicit_state(), AdvectionSrcForMom(), AdvectionSrcForMom_ConstantDz(), AdvectionSrcForMom_EB(), AdvectionSrcForMom_StretchedDz(), AdvectionSrcForMom_TF(), AdvectionSrcForOpenBC_Tangent_Cons(), AdvectionSrcForOpenBC_Tangent_Xmom(), AdvectionSrcForOpenBC_Tangent_Ymom(), AdvectionSrcForOpenBC_Tangent_Zmom(), erf_resolved_wall_flux::apply_face(), ShocDriver::apply_state_update(), ApplyBndryForcing_Forecast(), ApplySpongeZoneBCsForCC(), ApplySpongeZoneBCsForMom(), ApplySpongeZoneBCsForMom_ReadFromFile(), polygon_::area(), ERF::AverageDown(), ERF::AverageDownMoistStateTo(), ERF::AverageDownTo(), ERFFillPatcher::BuildMask(), closest_index(), SAM::CoefficientRowAt(), MOSTAverage::compute_eb_averages(), ERF::compute_native_shoc_tendencies(), compute_source_terms_Fn_Ft(), ComputeDiffusivityMRF(), ComputeDiffusivityMYJ(), ComputeDiffusivityMYNN25(), ComputeDiffusivityMYNNEDMF(), ComputeDiffusivityYSU(), ComputeDiffusivityYSUNew(), ERF::ComputeGlobalMinLocation(), ComputeTurbulentViscosity(), ShocDriver::debug_check_bad_column(), polygon_::define(), ERFFillPatcher::Define(), eb_aux_::define(), ForestDrag::define_drag_field(), ERF::derive_diag_profiles(), ERF::derive_diag_profiles_stag(), ShocTKE::diagnose_tke_and_diffusivities(), polygon_::distance(), derived::erf_derenstrophysq(), derived::erf_derhelicity(), derived::erf_derlocalhelicity(), derived::erf_dermagvel(), derived::erf_dermagvelsq(), derived::erf_dermaxreflectivity(), derived::erf_dermoisttemp(), derived::erf_dermucape(), derived::erf_derprecipitable(), derived::erf_derreflectivity(), derived::erf_dersoundspeed(), derived::erf_dertemp(), derived::erf_dervortx(), derived::erf_dervorty(), derived::erf_dervortz(), erf_dtesati(), erf_esati(), erf_gammafff(), erf_make_tau_terms(), erf_slow_rhs_post(), erf_slow_rhs_pre(), erf_substep_NS(), ERFFillPatcher::ERFFillPatcher(), ERF::ErrorEst(), expand_and_interpolate_1d(), ERFFillPatcher::Fill(), plotfile2d::fill_condensed_water_paths(), ERF::fill_from_bndryregs(), plotfile2d::fill_precipitation_accumulations(), sea_level_pressure_diagnostics::fill_sea_level_pressure(), SurfaceLayer::fill_tsurf_with_sst_and_tsk(), ERF::FillForecastStateMultiFabs(), ERF::FillIntermediatePatch(), ERF::FillPatchCrseLevel(), ERF::FillPatchFineLevel(), ShocImplicit::finalize_from_pdf(), PlaneSampler::get_sample_data(), ReadBndryPlanes::get_tendency(), SDInitProperties::getDistribution(), SAM::IceFall(), ERFPhysBCFunct_w::impose_vertical_zvel_bcs(), NOAHMP::Init(), ERF::init_bcs(), ERF::init_Dirichlet_bc_data(), init_fine_terrain_grid(), ERF::init_geo_wind_profile(), ERF::init_only(), SolverChoice::init_params(), init_state_from_input_sounding_hse(), init_zlevels(), ERF::InitData_post(), ERF::initHSE(), ERF::interp_base_state_from_coarse(), LargeScaleForcingData::interp_forcing(), ReadBndryPlanes::interp_in_time(), intersect_plane_edge(), PlaneAverage::line_average(), PlaneAverage::line_average_interpolated(), LineSampler::LineSampler(), NOAHMP::Lsm_Data_Ptr(), SLM::Lsm_Data_Ptr(), NOAHMP::Lsm_DataName(), SLM::Lsm_DataName(), NOAHMP::Lsm_Flux_Ptr(), SLM::Lsm_Flux_Ptr(), NOAHMP::Lsm_FluxName(), SLM::Lsm_FluxName(), NOAHMP::Lsm_Set_Lev0_Data_Ptr(), NOAHMP::Lsm_Set_Lev0_Flux_Ptr(), make_buoyancy(), make_mom_sources(), ERF::make_physbcs(), make_sources(), SurfaceLayer::make_SurfaceLayer_at_level(), ERF::MakeNewLevelFromCoarse(), ERF::MakeNewLevelFromScratch(), HSEutils::Newton_Raphson_hse(), ERF::ParameterSanityChecks(), PlaneAverage::PlaneAverage(), PlaneSampler::PlaneSampler(), SAM::PrecipFall(), SDInitProperties::printParameters(), ERF::project_momenta(), ERF::project_velocity_tb(), Kessler::Qmoist_Ptr(), Morrison::Qmoist_Ptr(), SAM::Qmoist_Ptr(), SatAdj::Qmoist_Ptr(), WDM6::Qmoist_Ptr(), WSM6::Qmoist_Ptr(), ERF::read_box_for_refinement(), SurfaceLayer::read_custom_roughness(), ProblemBase::read_custom_terrain(), LargeScaleForcingData::read_forcing_file(), InputSpongeData::read_from_file(), InputSoundingData::read_from_file(), ReadBndryPlanes::read_input_files(), SolverChoice::read_int_string(), read_times_from_erfbdy(), ERF::ReadCheckpointFile(), ReadNetCDFFile(), ERF::ReadParameters(), ReadTimeSliceFromNetCDFFile(), ERF::ReadVelsOnlyFromCheckpointFile(), realbdy_bc_bxs_xy(), realbdy_compute_interior_ghost_rhs(), realbdy_interior_bxs_xy(), ERF::refinement_criteria_setup(), ERFFillPatcher::RegisterCoarseData(), ERF::RemakeLevel(), MOSTAverage::set_eb_normalization(), ShocDriver::set_eddy_diffs(), MOSTAverage::set_k_indices_N(), InputSpongeData::size(), InputSoundingData::size(), ERF::sum_derived_quantities(), ERF::sum_energy_quantities(), ERF::timeStep(), update_stretched_dz(), ERF::Write3DPlotFile(), ERF::WriteCheckpointFile(), ERF::WriteGenericPlotfileHeaderWithTerrain(), and ERF::WriteMultiLevelPlotfileWithTerrain().
| background fields should have been initialized with erf init_type<< std::endl; } Real qt_init = amrex::Real(0.02); pp_prob.query("qt_init", qt_init); Real eq_pot_temp = amrex::Real(320.0); pp_prob.query("eq_pot_temp",eq_pot_temp); bool use_empirical = false; pp_prob.query("use_empircal_psat",use_empirical); if (do_moist_bubble) { Vector<Real> h_r(khi+2); Vector<Real> h_p(khi+2); Vector<Real> h_t(khi+2); Vector<Real> h_q_v(khi+2); Gpu::DeviceVector<Real> d_r(khi+2); Gpu::DeviceVector<Real> d_p(khi+2); Gpu::DeviceVector<Real> d_t(khi+2); Gpu::DeviceVector<Real> d_q_v(khi+2); HSEutils::init_isentropic_hse_no_terrain(h_t.data(), h_r.data(),h_p.data(),h_q_v.data(),dz,khi, qt_init,eq_pot_temp,use_empirical,false); Gpu::copyAsync(Gpu::hostToDevice, h_r.begin(), h_r.end(), d_r.begin()); Gpu::copyAsync(Gpu::hostToDevice, h_p.begin(), h_p.end(), d_p.begin()); Gpu::copyAsync(Gpu::hostToDevice, h_t.begin(), h_t.end(), d_t.begin()); Gpu::copyAsync(Gpu::hostToDevice, h_q_v.begin(), h_q_v.end(), d_q_v.begin()); Real* theta_back = d_t.data(); Real* p_back = d_p.data(); Real* q_v_back = d_q_v.data(); const int qci_comp = sc.moisture_indices.qi; const bool is_eulerian = (Microphysics::modelType(sc.moisture_type) == MoistureModelType::Eulerian); const bool split_condensate = (qci_comp > ParallelFor | ( | bx | , |
| [=, zero_d=zero, one_d=one, tbgmin_d=tbgmin, a_bg_d=a_bg] AMREX_GPU_DEVICE(int i, int j, int k) { const auto prob_lo=geomdata.ProbLo();const auto 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=prob_lo[2]+(k+myhalf) *dx[2];Real rad, delta_theta, theta_total, rho, RH;rad=zero_d;if(x_r > 0) rad+=amrex::Math::powi< 2 >((x - x_c)/x_r);if(y_r > 0) rad+=amrex::Math::powi< 2 >((y - y_c)/y_r);if(z_r > 0) rad+=amrex::Math::powi< 2 >((z - z_c)/z_r);rad=std::sqrt(rad);if(rad<=amrex::Real(1)) { delta_theta=theta_pert *amrex::Math::powi< 2 >(std::cos(PI *rad/two));} else { delta_theta=zero_d;} theta_total=theta_back[k] *(delta_theta/amrex::Real(300.0)+1);Real T=getTgivenPandTh(p_back[k], theta_total, RdoCp);rho=p_back[k]/(R_d *T *(one_d+RvoRd *q_v_back[k]));RH=compute_relative_humidity(use_empirical);Real q_v_hot=vapor_mixing_ratio(p_back[k], T, RH);Real T_back=getTgivenPandTh(p_back[k], theta_back[k], RdoCp);Real rho_back=p_back[k]/(R_d *T_back *(one_d+RvoRd *q_v_back[k]));state_pert(i, j, k, RhoTheta_comp)=rho *theta_total - rho_back *theta_back[k] *(one_d+RvoRd *q_v_back[k]);state_pert(i, j, k, Rho_comp)=rho - rho_back *(one_d+qt_init);state_pert(i, j, k, RhoScalar_comp)=zero_d;state_pert(i, j, k, RhoQ1_comp)=rho *q_v_hot;state_pert(i, j, k, RhoQ2_comp)=rho *(qt_init - q_v_hot);if(split_condensate) { Real omn=std::max(zero_d, std::min(one_d,(T-tbgmin_d) *a_bg_d));Real qn=state_pert(i, j, k, RhoQ2_comp);state_pert(i, j, k, RhoQ2_comp)=qn *omn;state_pert(i, j, k, qci_comp)=qn *(one_d - omn);} } | |||
| ) |

| ParmParse pp_prob | ( | "prob" | ) |
| pp_prob query | ( | "do_moist_bubble" | , |
| do_moist_bubble | |||
| ) |
| pp_prob query | ( | "perturb_rho" | , |
| perturb_rho | |||
| ) |
| pp_prob query | ( | "T_pert_is_airtemp" | , |
| T_pert_is_airtemp | |||
| ) |
| pp_prob query | ( | "theta_pert" | , |
| theta_pert | |||
| ) |
| bool do_moist_bubble = false |
| const Real dz = geomdata.CellSize()[2] |
| else |
| const int khi = geomdata.Domain().bigEnd()[2] |
Referenced by Morrison::Advance(), WDM6::Advance(), WSM6::Advance(), bilinear_interpolation(), ERF::compute_max_buoyancy_gradp_diagnostic(), ERF::compute_max_pressure_gradient_diagnostic(), MYNNPBLH::compute_pblh(), ComputeDiffusivityMRF(), ComputeDiffusivityMYJ(), ComputeDiffusivityYSUNew(), SLM::ComputeFluxes(), SLM::ComputeTsurf(), DiffusionSrcForState_S(), derived::erf_dermucape(), ERF::erf_enforce_hse(), erf_init_dens_hse_dry(), erf_init_dens_hse_moist(), erf_init_rayleigh(), erf_slow_rhs_pre(), erf_substep_MT(), erf_substep_NS(), erf_substep_T(), ERF::ErrorEst(), ERF::estTimeStep(), ShocPreprocess::fill_columns(), fill_fab_from_arrays(), plotfile2d::fill_sampled_level_component(), ERF::FillBdyCCVels(), ImplicitDiffForMomLU_N(), ImplicitDiffForMomLU_S(), ImplicitDiffForMomLU_T(), ImplicitDiffForStateLU_N(), ImplicitDiffForStateLU_S(), ImplicitDiffForStateLU_T(), Radiation::Init(), ERF::init_Dirichlet_bc_data(), ERF::init_geo_wind_profile(), HSEutils::init_isentropic_hse_constant_dz(), HSEutils::init_isentropic_hse_no_terrain(), HSEutils::init_isentropic_hse_stretched_dz(), HSEutils::init_isentropic_hse_terrain(), ERF::initRayleigh_at_level(), LargeScaleForcingData::interp_forcing(), make_buoyancy(), make_fast_coeffs(), make_sources(), ERF::PackAtmosphericStates(), ERF::read_box_for_refinement(), InputSpongeData::read_from_file(), InputSoundingData::read_from_file(), rebalance_columns(), ERF::sample_lines(), SHOCInterface::set_grids(), ERF::setRayleighRefFromSounding(), ERF::setSpongeRefFromSounding(), SolveTridiag(), ProblemBase::update_geostrophic_profile(), ProblemBase::update_w_subsidence(), and ERF::Write2DPlotFile().
| bool perturb_rho = true |
| const Real rdOcp = sc.rdOcp |
| Real T_0 = amrex::Real(300.0) |
| Real T_pert = -amrex::Real(15.0) |
| bool T_pert_is_airtemp = true |
| do_moist_bubble& Real theta_pert = two |
Referenced by ParallelFor().
Referenced by ParallelFor().
Referenced by ParallelFor().
Referenced by ParallelFor().
Referenced by ParallelFor().
Referenced by ParallelFor().
Referenced by ParallelFor().