|
ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
|
Classes | |
| struct | SurfacePressureResult |
| struct | ConversionFailure |
Enumerations | |
| enum class | SurfacePressureError : int { none = 0 , bad_density , bad_rho_theta , no_moisture_comp , bad_rho_qv , bad_qv , bad_delta_z , bad_pressure } |
| enum class | SurfaceTemperatureSource : int { tsk , sst , prescribed } |
| enum class | ConversionError : int { none = 0 , bad_density , bad_rho_theta , no_moisture_comp , bad_rho_qv , bad_qv , bad_delta_z , bad_theta_to_temperature , bad_temperature_to_theta , bad_pressure , bad_skin_temperature , bad_q_air , bad_q_surf } |
Functions | |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE SurfacePressureResult | diagnose_surface_pressure (const amrex::Real rho, const amrex::Real rho_theta, const amrex::Real rho_qv, const bool moist, const bool have_rho_qv, const amrex::Real delta_z) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | pressure_at_boundary_from_cell (const amrex::Real rho, const amrex::Real rho_theta, const amrex::Real qv, const amrex::Real delta_z) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real | pressure_at_surface (const amrex::Real rho, const amrex::Real rho_theta, const amrex::Real qv, const amrex::Real delta_z) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | valid_pressure (const amrex::Real pressure) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | valid_temperature (const amrex::Real temperature) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | theta_to_temperature (const amrex::Real theta, const amrex::Real pressure, const amrex::Real rdOcp, amrex::Real &temperature) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | temperature_to_theta (const amrex::Real temperature, const amrex::Real pressure, const amrex::Real rdOcp, amrex::Real &theta) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool | sst_ignored (const bool ignore_sst_requested, const bool have_tsk) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE SurfaceTemperatureSource | surface_temperature_source (const bool is_land, const bool have_tsk, const bool ignore_sst) |
| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ConversionError | conversion_error (const SurfacePressureError error) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE void | record_conversion_failure (ConversionFailure *fail, const bool fatal, const ConversionError code, const int i, const int j, const int k, const amrex::Real rho=amrex::Real(0.0), const amrex::Real rho_theta=amrex::Real(0.0), const amrex::Real rho_qv=amrex::Real(0.0), const amrex::Real t_surf=amrex::Real(0.0), const amrex::Real pressure=amrex::Real(0.0), const amrex::Real delta_z=amrex::Real(0.0), const amrex::Real q_air=amrex::Real(0.0)) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE SurfacePressureResult | diagnose_and_record_surface_pressure (ConversionFailure *fail, const bool fatal, const int i, const int j, const int k, const amrex::Real rho, const amrex::Real rho_theta, const amrex::Real rho_qv, const bool moist, const bool have_rho_qv, const amrex::Real delta_z, const amrex::Real surface_temperature=amrex::Real(0.0)) |
| AMREX_FORCE_INLINE const char * | conversion_error_text (const ConversionError code) |
| void | abort_on_conversion_failure (const char *who, const int lev, ConversionFailure const &fail) |
|
strong |
Why a surface conversion could not be made, in the order the kernels test for it.
Every kernel that converts between the atmospheric state and a surface temperature or humidity guards the same sequence of ways that state can be unusable. Which guard tripped is the difference between "the surface layer gave up" and knowing that the state handed to it was already bad – so the guards are named rather than merged into a single flag.
| Enumerator | |
|---|---|
| none | |
| bad_density | |
| bad_rho_theta | |
| no_moisture_comp | |
| bad_rho_qv | |
| bad_qv | |
| bad_delta_z | |
| bad_theta_to_temperature | |
| bad_temperature_to_theta | |
| bad_pressure | |
| bad_skin_temperature | |
| bad_q_air | |
| bad_q_surf | |
|
strong |
|
strong |
The field a cell of the lower boundary takes its surface temperature from, when the level has an SST (SurfaceLayer::fill_tsurf_with_sst_and_tsk)
| Enumerator | |
|---|---|
| tsk | the skin temperature, TSK |
| sst | the sea-surface temperature, SST |
| prescribed | the prescribed land surface potential temperature (most.pot_surf_temp) |
|
inline |
Describe what this rank recorded, then abort if any rank recorded anything.
Collective: every rank must call this. Each rank that failed describes its own first failure before the abort, so a failure confined to one rank still names the cell and the numbers rather than only the check that tripped.
| [in] | who | Name of the fill, used to open the message |
| [in] | lev | Level being filled |
| [in] | fail | This rank's record |
Referenced by ERF::convert_legacy_surface_temperature(), and SurfaceLayer::update_fluxes().


| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE ConversionError erf_surface_temperature::conversion_error | ( | const SurfacePressureError | error | ) |
Referenced by ERF::convert_legacy_surface_temperature(), diagnose_and_record_surface_pressure(), and SurfaceLayer::fill_tsurf_with_sst_and_tsk().

| AMREX_FORCE_INLINE const char* erf_surface_temperature::conversion_error_text | ( | const ConversionError | code | ) |
| AMREX_GPU_DEVICE AMREX_FORCE_INLINE SurfacePressureResult erf_surface_temperature::diagnose_and_record_surface_pressure | ( | ConversionFailure * | fail, |
| const bool | fatal, | ||
| const int | i, | ||
| const int | j, | ||
| const int | k, | ||
| const amrex::Real | rho, | ||
| const amrex::Real | rho_theta, | ||
| const amrex::Real | rho_qv, | ||
| const bool | moist, | ||
| const bool | have_rho_qv, | ||
| const amrex::Real | delta_z, | ||
| const amrex::Real | surface_temperature = amrex::Real(0.0) |
||
| ) |
Diagnose pressure and append a structured diagnostic if the state is unusable.
Referenced by 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(), and SurfaceLayer::get_lsm_tsurf().


| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE SurfacePressureResult erf_surface_temperature::diagnose_surface_pressure | ( | const amrex::Real | rho, |
| const amrex::Real | rho_theta, | ||
| const amrex::Real | rho_qv, | ||
| const bool | moist, | ||
| const bool | have_rho_qv, | ||
| const amrex::Real | delta_z | ||
| ) |
Diagnose pressure at a boundary face from the adjacent atmospheric cell.
The state pressure is diagnosed at the cell center. Adding rho*g*delta_z gives the pressure at the boundary face, where delta_z is the signed distance from the face to the cell center. The moisture component is read only when moisture is enabled and present.
Referenced by ERF::convert_legacy_surface_temperature(), diagnose_and_record_surface_pressure(), and SurfaceLayer::fill_tsurf_with_sst_and_tsk().


| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real erf_surface_temperature::pressure_at_boundary_from_cell | ( | const amrex::Real | rho, |
| const amrex::Real | rho_theta, | ||
| const amrex::Real | qv, | ||
| const amrex::Real | delta_z | ||
| ) |
Pressure at a boundary face from the adjacent atmospheric cell state.
The state pressure is diagnosed at the cell center. Adding rho*g*delta_z gives the pressure at the boundary face, where delta_z is the signed distance from the face to the cell center.
Referenced by pressure_at_surface().


| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real erf_surface_temperature::pressure_at_surface | ( | const amrex::Real | rho, |
| const amrex::Real | rho_theta, | ||
| const amrex::Real | qv, | ||
| const amrex::Real | delta_z | ||
| ) |
Referenced by ERF::FillPlot2DVars(), Radiation::mf_to_kokkos_buffers(), and vertical_two_stream_sweep().


| AMREX_GPU_DEVICE AMREX_FORCE_INLINE void erf_surface_temperature::record_conversion_failure | ( | ConversionFailure * | fail, |
| const bool | fatal, | ||
| const ConversionError | code, | ||
| const int | i, | ||
| const int | j, | ||
| const int | k, | ||
| const amrex::Real | rho = amrex::Real(0.0), |
||
| const amrex::Real | rho_theta = amrex::Real(0.0), |
||
| const amrex::Real | rho_qv = amrex::Real(0.0), |
||
| const amrex::Real | t_surf = amrex::Real(0.0), |
||
| const amrex::Real | pressure = amrex::Real(0.0), |
||
| const amrex::Real | delta_z = amrex::Real(0.0), |
||
| const amrex::Real | q_air = amrex::Real(0.0) |
||
| ) |
Record one cell's failure.
Every failing cell adds to a count; the first authoritative one to arrive also claims the description, so what gets reported is a failure that matters rather than whichever thread happened to finish last. Pass the values the caller has reached by this point: the report prints the ones that mean something for the code it is given.
| [in,out] | fail | This rank's record |
| [in] | fatal | Whether this is a cell the fill is authoritative for |
| [in] | code | Which guard tripped |
| [in] | i,j,k | The cell whose state was read |
Referenced by ERF::convert_legacy_surface_temperature(), diagnose_and_record_surface_pressure(), 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(), and SurfaceLayer::get_lsm_tsurf().

| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_surface_temperature::sst_ignored | ( | const bool | ignore_sst_requested, |
| const bool | have_tsk | ||
| ) |
Whether the surface layer ignores the SST of a level: when asked to (most.ignore_sst), and whenever the level has TSK, which carries the SST over water (update_sst_tsk) and so supplies every cell (make_SurfaceLayer_at_level).
Referenced by SurfaceLayer::make_SurfaceLayer_at_level(), and erf_checkpoint_surface_temperature::restart_surface_temperature_use().

| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE SurfaceTemperatureSource erf_surface_temperature::surface_temperature_source | ( | const bool | is_land, |
| const bool | have_tsk, | ||
| const bool | ignore_sst | ||
| ) |
Which field supplies the surface temperature of a cell: TSK over land, and over water where the SST is ignored, if the level has TSK; else the SST over water and the prescribed temperature over land.
| is_land | whether the cell is land: a nonzero land mask, or no land mask at all |
| have_tsk | whether the level has TSK |
| ignore_sst | whether the surface layer ignores the SST (sst_ignored) |
Referenced by SurfaceLayer::fill_tsurf_with_sst_and_tsk(), and erf_checkpoint_surface_temperature::potential_to_absolute_temperature().

| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_surface_temperature::temperature_to_theta | ( | const amrex::Real | temperature, |
| const amrex::Real | pressure, | ||
| const amrex::Real | rdOcp, | ||
| amrex::Real & | theta | ||
| ) |
Referenced by 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(), and SurfaceLayer::get_lsm_tsurf().


| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_surface_temperature::theta_to_temperature | ( | const amrex::Real | theta, |
| const amrex::Real | pressure, | ||
| const amrex::Real | rdOcp, | ||
| amrex::Real & | temperature | ||
| ) |
Referenced by erf_checkpoint_surface_temperature::potential_to_absolute_temperature(), rrtmgp::resolve_surface_temperature(), and vertical_two_stream_sweep().


| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_surface_temperature::valid_pressure | ( | const amrex::Real | pressure | ) |
Referenced by temperature_to_theta(), and theta_to_temperature().

| AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_surface_temperature::valid_temperature | ( | const amrex::Real | temperature | ) |
Referenced by erf_checkpoint_surface_temperature::potential_to_absolute_temperature(), temperature_to_theta(), and theta_to_temperature().
