Physics implementation
Physics and parameterizations are assembled in src/driver/Model.cpp according to boolean flags in the JSON configuration. The dynamical core (Dynamics::DynamicalCore) always participates; optional components are constructed only when enabled.
Components and toggles
| Component | Config flag | Implementation (typical entry) |
|---|---|---|
| P3 microphysics | physics.p3.enable_p3 |
Physics::VVM_P3_Interface |
| RRTMGP radiation | physics.rrtmgp.enable_rrtmgp |
Physics::RRTMGP::RRTMGPRadiation |
| Turbulence | physics.turbulence.enable_turbulence |
Physics::TurbulenceProcess |
| Surface fluxes | physics.surface.enable_surface |
Physics::SurfaceProcess |
| Noah land | physics.land.enable_land |
Physics::LandProcess |
| Sponge layer | dynamics.forcings.sponge_layer.enable |
Dynamics::SpongeLayer |
| Lateral nudging | dynamics.forcings.lateral_boundary_nudging.enable |
Dynamics::LateralBoundaryNudging |
| Random perturbation | dynamics.forcings.random_perturbation.enable |
Dynamics::RandomForcing |
Time-step order (Model::run_step)
The following order is implemented in Model::run_step (abbreviated):
- Lateral boundary nudging — update large-scale forcing if enabled.
- Thermodynamic tendencies —
dycore_->calculate_thermo_tendencies(). - Radiation — on steps divisible by
rad_frequency_step,radiation_->run; thencalculate_tendenciesforth. - Update thermodynamics —
dycore_->update_thermodynamics(dt). - Random forcing — if enabled.
- P3 —
microphysics_->runusing updated thermodynamic state. - Turbulence — compute coefficients and tendency fields for configured thermodynamic variables.
- Surface — periodic
compute_coefficientsand tendencies intofe_tendency_*fields. - Land — periodic
runandcalculate_tendenciesfor surface-coupled variables. - Forward updates — apply turbulence/surface/land tendency updates via
TimeIntegrator::apply_forward_updatewhere applicable. - Sponge / nudging — additional forward updates on selected variables.
- Halo exchange for thermodynamic variables and boundary application.
- Vorticity —
calculate_vorticity_tendencies,update_vorticity, then turbulence/sponge updates on vorticity-related fields, halos, vertical structure forzeta, optional wind diagnosis (diagnose_wind_fields) unless in idealized modes that disable the wind solver.
Radiation frequency, surface frequency, and land frequency are controlled by rad_frequency_step, physics.surface.frequency_step, and physics.land.frequency_step (interpreted against the model step index in code).
Crucially, the P3 scheme requires both the previous and current states for its calculations. In the procedure above, var_prev represents the state before the advection update, while var_now represents the state after advection.
This is why microphysics_->run is called after dycore_->update_thermodynamics(dt)—this sequence ensures that the original var_now is shifted to var_prev, and the newly advected state becomes the current var_now.
P3
The P3 implementation lives under src/physics/p3/ with EAMxx-style pack-oriented kernels. Lookup tables can be generated or read from rundata/p3/ depending on make_lookup_table and paths in configuration.
RRTMGP
RRTMGP interfaces are under src/physics/rrtmgp/, including VVM_rrtmgp_process_interface and Kokkos-oriented gas optics / RTE layers under external/cpp/. column_chunk_size and rad_frequency_step trade accuracy, performance, and coupling frequency.
Land and surface
- Surface modes (e.g.
sflux_tc_2d) provide lower-boundary flux tendencies into the samefe_tendency_*machinery as turbulence. - Land (Noah) runs on a sub-step schedule and feeds tendencies for surface-coupled quantities; Fortran OpenACC code is integrated via the build system for GPU execution where configured.
Idealized dynamics tests
When simulation.idealized_test is one of advection_u, advection_v, advection_w, stretching, or twisting, the constructor sets wind_solver_ false so the vertical wind solver is skipped for those benchmarks. 2dbubble keeps the solver unless the same list logic changes in the future—refer to Model constructor for the authoritative list in no_solver_mode.
Further reading
- Regression tests:
tests/CMakeLists.txtandtests/configs/*.json