ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
erf_surface_temperature Namespace Reference

Functions

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)
 

Function Documentation

◆ pressure_at_boundary_from_cell()

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 centre. 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 centre.

24 {
25  return getPgivenRTh(rho_theta, qv) + rho * CONST_GRAV * delta_z;
26 }
constexpr amrex::Real CONST_GRAV
Definition: ERF_Constants.H:56
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getPgivenRTh(const amrex::Real rhotheta, const amrex::Real qv=amrex::Real(0))
Definition: ERF_EOS.H:81
@ rho
Definition: ERF_Kessler.H:25
@ qv
Definition: ERF_Kessler.H:31

Referenced by SurfaceLayer::fill_qsurf_with_qsat(), SurfaceLayer::fill_tsurf_with_coupled_sst(), SurfaceLayer::fill_tsurf_with_sfc_sst(), and pressure_at_surface().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 
)
34 {
35  return pressure_at_boundary_from_cell(rho, rho_theta, qv, delta_z);
36 }
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)
Definition: ERF_SurfaceTemperature.H:20

Referenced by Radiation::mf_to_kokkos_buffers(), and vertical_two_stream_sweep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ temperature_to_theta()

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 
)
77 {
78  if (!valid_pressure(pressure) || !valid_temperature(temperature) ||
79  !amrex::Math::isfinite(rdOcp) || rdOcp <= amrex::Real(0.0)) {
80  return false;
81  }
82  const amrex::Real result = getThgivenTandP(temperature, pressure, rdOcp);
83  if (!valid_temperature(result)) {
84  return false;
85  }
86  theta = result;
87  return true;
88 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getThgivenTandP(const amrex::Real T, const amrex::Real P, const amrex::Real rdOcp)
Definition: ERF_EOS.H:18
const Real rdOcp
Definition: ERF_InitCustomPert_ABL.H:72
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ theta
Definition: ERF_SLM.H:19
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool valid_pressure(const amrex::Real pressure)
Definition: ERF_SurfaceTemperature.H:40
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool valid_temperature(const amrex::Real temperature)
Definition: ERF_SurfaceTemperature.H:47

Referenced by SurfaceLayer::fill_tsurf_with_coupled_sst(), SurfaceLayer::fill_tsurf_with_sfc_sst(), and metgrid_surface_theta().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ theta_to_temperature()

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 
)
58 {
59  if (!valid_pressure(pressure) || !valid_temperature(theta) ||
60  !amrex::Math::isfinite(rdOcp) || rdOcp <= amrex::Real(0.0)) {
61  return false;
62  }
63  const amrex::Real result = getTgivenPandTh(pressure, theta, rdOcp);
64  if (!valid_temperature(result)) {
65  return false;
66  }
67  temperature = result;
68  return true;
69 }
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real getTgivenPandTh(const amrex::Real P, const amrex::Real th, const amrex::Real rdOcp)
Definition: ERF_EOS.H:32

Referenced by SurfaceLayer::fill_qsurf_with_qsat(), rrtmgp::resolve_surface_temperature(), and vertical_two_stream_sweep().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valid_pressure()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_surface_temperature::valid_pressure ( const amrex::Real  pressure)
41 {
42  return amrex::Math::isfinite(pressure) && pressure > amrex::Real(0.0);
43 }

Referenced by temperature_to_theta(), and theta_to_temperature().

Here is the caller graph for this function:

◆ valid_temperature()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE bool erf_surface_temperature::valid_temperature ( const amrex::Real  temperature)
48 {
49  return amrex::Math::isfinite(temperature) && temperature > amrex::Real(0.0);
50 }

Referenced by temperature_to_theta(), and theta_to_temperature().

Here is the caller graph for this function: