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

Go to the source code of this file.

Functions

 AMREX_ALWAYS_ASSERT_WITH_MESSAGE (m_cloud_chamber_config.active, "Cloud Chamber: initializer reached without a parsed configuration")
 
 AMREX_ALWAYS_ASSERT_WITH_MESSAGE (sc.anelastic[lev]==1 &&sc.fixed_density[lev]==1, "Cloud Chamber: the selected level must use fixed-density anelastic dynamics")
 
 AMREX_ALWAYS_ASSERT_WITH_MESSAGE (sc.terrain_type==TerrainType::None &&sc.buildings_type==BuildingsType::None &&sc.mesh_type==MeshType::ConstantDz, "Cloud Chamber: terrain, buildings, and non-Cartesian mesh modes are unsupported")
 
 if (m_cloud_chamber_config.cloudy)
 
 ParallelFor (bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real x=prob_lo[0]+(Real(i)+Real(0.5)) *dx[0];const Real y=prob_lo[1]+(Real(j)+Real(0.5)) *dx[1];const Real z=prob_lo[2]+(Real(k)+Real(0.5)) *dx[2];const Real rho=state(i, j, k, Rho_comp);const Real temperature=erf_cloud_chamber::linear_profile(config.initial_temperature_bottom, config.initial_temperature_top, z, config.prob_lo[2], config.prob_hi[2] - config.prob_lo[2])+erf_cloud_chamber::deterministic_perturbation(x, y, z, config.prob_lo, GpuArray< Real, AMREX_SPACEDIM >{ config.prob_hi[0] - config.prob_lo[0], config.prob_hi[1] - config.prob_lo[1], config.prob_hi[2] - config.prob_lo[2]}, config.temperature_perturbation_amplitude);const Real target_theta=config.physical_initialization ? temperature *std::pow(p_0/p_hse(i, j, k), rdOcp) :erf_cloud_chamber::theta_at(config, x, y, z);state_pert(i, j, k, RhoTheta_comp)=rho *target_theta - state(i, j, k, RhoTheta_comp);if(config.cloudy) { const Real target_qv=config.physical_initialization ? erf_cloud_chamber::vapor_mixing_ratio_from_relative_humidity(temperature, p_hse(i, j, k), config.initial_relative_humidity) :erf_cloud_chamber::qv_at(config, z);state_pert(i, j, k, RhoQ1_comp)=rho *target_qv - state(i, j, k, RhoQ1_comp);state_pert(i, j, k, RhoQ2_comp)=-state(i, j, k, RhoQ2_comp);} })
 

Variables

 else
 
const GpuArray< Real, AMREX_SPACEDIM > prob_lo
 
const GpuArray< Real, AMREX_SPACEDIM > dx
 
const auto config = m_cloud_chamber_config
 
const Real rdOcp = sc.rdOcp
 

Function Documentation

◆ AMREX_ALWAYS_ASSERT_WITH_MESSAGE() [1/3]

AMREX_ALWAYS_ASSERT_WITH_MESSAGE ( m_cloud_chamber_config.  active,
"Cloud Chamber: initializer reached without a parsed configuration"   
)

Referenced by add_par(), Kessler::AdvanceKessler(), Radiation::alloc_buffers(), ERF::ApplyOceanSurfaceState(), SolverChoice::check_params(), MOSTAverage::compute_averages(), ComputeDiffusivityMYJ(), ComputeDiffusivityMYNN25(), erf_slow_rhs_post(), LineSampler::get_sample_data(), PlaneSampler::get_sample_data(), ERF::GetOceanToAtmosSurfaceLayout(), if(), Radiation::Init(), NOAHMP::Init(), ERF::init_Dirichlet_bc_data(), ERF::init_only(), SolverChoice::init_params(), ERF::InitData_post(), SHOCInterface::initialize_impl(), interpolatedVal(), adiabatic_mod_charnock::iterate_flux(), adiabatic_donelan::iterate_flux(), adiabatic_wave_coupled::iterate_flux(), adiabatic_charnock::iterate_flux(), surface_flux_charnock::iterate_flux(), surface_flux_mod_charnock::iterate_flux(), surface_flux_donelan::iterate_flux(), surface_temp_charnock::iterate_flux(), surface_temp_mod_charnock::iterate_flux(), surface_temp_donelan::iterate_flux(), surface_flux_wave_coupled::iterate_flux(), surface_temp_wave_coupled::iterate_flux(), surface_flux::iterate_flux(), surface_temp::iterate_flux(), surface_temp_eb::iterate_flux(), surface_flux_eb::iterate_flux(), NOAHMP::m_ensure_nsoil_resolved(), MOSTAverage::make_MOSTAverage_at_level(), SAM::NewtonIterSat(), SatAdj::NewtonSolveSatTemperature(), ERF::PackAtmosphericStates(), Radiation::Radiation(), ERF::ReadParameters(), SHOCInterface::set_grids(), MOSTAverage::set_k_indices_N(), MOSTAverage::set_k_indices_T(), MOSTAverage::set_norm_indices_T(), MOSTAverage::set_norm_positions_T(), MOSTAverage::set_z_positions_T(), MOSTAverage::trilinear_interp_T(), validate_shoc_runtime_options(), ERF::Write3DPlotFile(), and PlaneSampler::write_sample_data().

◆ AMREX_ALWAYS_ASSERT_WITH_MESSAGE() [2/3]

AMREX_ALWAYS_ASSERT_WITH_MESSAGE ( sc.  anelastic[lev] = =1 &&sc.fixed_density[lev]==1,
"Cloud Chamber: the selected level must use fixed-density anelastic dynamics"   
)

◆ AMREX_ALWAYS_ASSERT_WITH_MESSAGE() [3/3]

AMREX_ALWAYS_ASSERT_WITH_MESSAGE ( sc.  terrain_type = =TerrainType::None &&sc.buildings_type==BuildingsType::None &&sc.mesh_type==MeshType::ConstantDz,
"Cloud Chamber:  terrain,
buildings  ,
and non-Cartesian mesh modes are unsupported"   
)

◆ if()

if ( m_cloud_chamber_config.  cloudy)
23  {
25  sc.moisture_type == MoistureType::SatAdj,
26  "Cloud Chamber: cloudy mode requires erf.moisture_model = SatAdj");
27 } else {
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(m_cloud_chamber_config.active, "Cloud Chamber: initializer reached without a parsed configuration")
Here is the call graph for this function:

◆ ParallelFor()

ParallelFor ( bx  ,
[=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { const Real x=prob_lo[0]+(Real(i)+Real(0.5)) *dx[0];const Real y=prob_lo[1]+(Real(j)+Real(0.5)) *dx[1];const Real z=prob_lo[2]+(Real(k)+Real(0.5)) *dx[2];const Real rho=state(i, j, k, Rho_comp);const Real temperature=erf_cloud_chamber::linear_profile(config.initial_temperature_bottom, config.initial_temperature_top, z, config.prob_lo[2], config.prob_hi[2] - config.prob_lo[2])+erf_cloud_chamber::deterministic_perturbation(x, y, z, config.prob_lo, GpuArray< Real, AMREX_SPACEDIM >{ config.prob_hi[0] - config.prob_lo[0], config.prob_hi[1] - config.prob_lo[1], config.prob_hi[2] - config.prob_lo[2]}, config.temperature_perturbation_amplitude);const Real target_theta=config.physical_initialization ? temperature *std::pow(p_0/p_hse(i, j, k), rdOcp) :erf_cloud_chamber::theta_at(config, x, y, z);state_pert(i, j, k, RhoTheta_comp)=rho *target_theta - state(i, j, k, RhoTheta_comp);if(config.cloudy) { const Real target_qv=config.physical_initialization ? erf_cloud_chamber::vapor_mixing_ratio_from_relative_humidity(temperature, p_hse(i, j, k), config.initial_relative_humidity) :erf_cloud_chamber::qv_at(config, z);state_pert(i, j, k, RhoQ1_comp)=rho *target_qv - state(i, j, k, RhoQ1_comp);state_pert(i, j, k, RhoQ2_comp)=-state(i, j, k, RhoQ2_comp);} }   
)
Here is the call graph for this function:

Variable Documentation

◆ config

◆ dx

const GpuArray<Real, AMREX_SPACEDIM> dx
Initial value:
= {
geomdata.CellSize(0), geomdata.CellSize(1), geomdata.CellSize(2)}

Referenced by ParallelFor().

◆ else

else
Initial value:
{
sc.moisture_type == MoistureType::None,
"Cloud Chamber: dry mode requires no active moisture model")

◆ prob_lo

◆ rdOcp

const Real rdOcp = sc.rdOcp

Referenced by ParallelFor().