ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_WDM6.H File Reference
#include <memory>
#include <string>
#include <vector>
#include <AMReX_FArrayBox.H>
#include <AMReX_Geometry.H>
#include <AMReX_MultiFabUtil.H>
#include "ERF_Constants.H"
#include "ERF_MicrophysicsConstants.H"
#include "ERF_DataStruct.H"
#include "ERF_IndexDefines.H"
#include "ERF_MicrophysicsUtils.H"
#include "ERF_NullMoist.H"
#include "ERF_SurfacePrecipitation.H"
Include dependency graph for ERF_WDM6.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  WDM6
 

Namespaces

 MicVar_WDM6
 

Enumerations

enum  {
  MicVar_WDM6::rho = 0 , MicVar_WDM6::theta , MicVar_WDM6::tabs , MicVar_WDM6::pres ,
  MicVar_WDM6::qv , MicVar_WDM6::qc , MicVar_WDM6::qi , MicVar_WDM6::qr ,
  MicVar_WDM6::qs , MicVar_WDM6::qg , MicVar_WDM6::nn , MicVar_WDM6::nc ,
  MicVar_WDM6::nr , MicVar_WDM6::rain_accum , MicVar_WDM6::snow_accum , MicVar_WDM6::graup_accum ,
  MicVar_WDM6::NumVars
}
 

Functions

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wdm6_copy_state_to_micro_cell (const amrex::Array4< const amrex::Real > &states, const amrex::Array4< const amrex::Real > &base, const amrex::Array4< amrex::Real > &rho, const amrex::Array4< amrex::Real > &theta, const amrex::Array4< amrex::Real > &tabs, const amrex::Array4< amrex::Real > &pres, const amrex::Array4< amrex::Real > &qv, const amrex::Array4< amrex::Real > &qc, const amrex::Array4< amrex::Real > &qi, const amrex::Array4< amrex::Real > &qr, const amrex::Array4< amrex::Real > &qs, const amrex::Array4< amrex::Real > &qg, const amrex::Real rdOcp, const bool use_anelastic_reference_pressure, const int i, const int j, const int k) noexcept
 
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real wdm6_theta_from_temperature_and_pressure (const amrex::Real temperature, const amrex::Real pressure, const amrex::Real configured_rdOcp, const bool use_anelastic_reference_pressure) noexcept
 
constexpr amrex::Real wdm6_literal (double d)
 

Function Documentation

◆ wdm6_copy_state_to_micro_cell()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void wdm6_copy_state_to_micro_cell ( const amrex::Array4< const amrex::Real > &  states,
const amrex::Array4< const amrex::Real > &  base,
const amrex::Array4< amrex::Real > &  rho,
const amrex::Array4< amrex::Real > &  theta,
const amrex::Array4< amrex::Real > &  tabs,
const amrex::Array4< amrex::Real > &  pres,
const amrex::Array4< amrex::Real > &  qv,
const amrex::Array4< amrex::Real > &  qc,
const amrex::Array4< amrex::Real > &  qi,
const amrex::Array4< amrex::Real > &  qr,
const amrex::Array4< amrex::Real > &  qs,
const amrex::Array4< amrex::Real > &  qg,
const amrex::Real  rdOcp,
const bool  use_anelastic_reference_pressure,
const int  i,
const int  j,
const int  k 
)
noexcept
59 {
60  const amrex::Real rho_value = states(i,j,k,Rho_comp);
61  const amrex::Real rho_theta = states(i,j,k,RhoTheta_comp);
62  rho(i,j,k) = rho_value;
63  theta(i,j,k) = rho_theta / rho_value;
64  qv(i,j,k) = amrex::max(amrex::Real(0.0), states(i,j,k,RhoQ1_comp) / rho_value);
65  qc(i,j,k) = amrex::max(amrex::Real(0.0), states(i,j,k,RhoQ2_comp) / rho_value);
66  qi(i,j,k) = amrex::max(amrex::Real(0.0), states(i,j,k,RhoQ3_comp) / rho_value);
67  qr(i,j,k) = amrex::max(amrex::Real(0.0), states(i,j,k,RhoQ4_comp) / rho_value);
68  qs(i,j,k) = amrex::max(amrex::Real(0.0), states(i,j,k,RhoQ5_comp) / rho_value);
69  qg(i,j,k) = amrex::max(amrex::Real(0.0), states(i,j,k,RhoQ6_comp) / rho_value);
70 
71  const amrex::Real p0 = use_anelastic_reference_pressure
72  ? base(i,j,k,BaseState::p0_comp) : amrex::Real(0.0);
74  rho_value, rho_theta, qv(i,j,k), rdOcp,
75  use_anelastic_reference_pressure, p0);
76  tabs(i,j,k) = thermo.temperature;
77  pres(i,j,k) = thermo.pressure_pa;
78 }
#define Rho_comp
Definition: ERF_IndexDefines.H:39
#define RhoQ4_comp
Definition: ERF_IndexDefines.H:48
#define RhoTheta_comp
Definition: ERF_IndexDefines.H:40
#define RhoQ2_comp
Definition: ERF_IndexDefines.H:46
#define RhoQ3_comp
Definition: ERF_IndexDefines.H:47
#define RhoQ1_comp
Definition: ERF_IndexDefines.H:45
#define RhoQ6_comp
Definition: ERF_IndexDefines.H:50
#define RhoQ5_comp
Definition: ERF_IndexDefines.H:49
const Real rdOcp
Definition: ERF_InitCustomPert_ABL.H:72
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE MicrophysicsThermoState diagnose_microphysics_thermo_state(const amrex::Real rho, const amrex::Real rho_theta, const amrex::Real qv, const amrex::Real rdOcp, const bool use_anelastic_reference_pressure, const amrex::Real p0) noexcept
Definition: ERF_MicrophysicsUtils.H:35
amrex::Real Real
Definition: ERF_ShocInterface.H:19
@ p0_comp
Definition: ERF_IndexDefines.H:77
@ qr
Definition: ERF_WDM6.H:29
@ qv
Definition: ERF_WDM6.H:26
@ qc
Definition: ERF_WDM6.H:27
@ qi
Definition: ERF_WDM6.H:28
@ pres
Definition: ERF_WDM6.H:25
@ qg
Definition: ERF_WDM6.H:31
@ theta
Definition: ERF_WDM6.H:23
@ qs
Definition: ERF_WDM6.H:30
@ rho
Definition: ERF_WDM6.H:22
@ tabs
Definition: ERF_WDM6.H:24
Definition: ERF_ConsoleIO.cpp:15
real(c_double), parameter p0
Definition: ERF_module_model_constants.F90:40
Definition: ERF_MicrophysicsUtils.H:22
amrex::Real pressure_pa
Definition: ERF_MicrophysicsUtils.H:23
amrex::Real temperature
Definition: ERF_MicrophysicsUtils.H:24
Here is the call graph for this function:

◆ wdm6_literal()

constexpr amrex::Real wdm6_literal ( double  d)
constexpr
97 {
98 #ifdef ERF_WDM6_F32_LITERALS
99  // Match the Fortran as compiled today: its literals carry no kind suffix,
100  // so they are evaluated in single precision and then widened.
101  return amrex::Real(static_cast<float>(d));
102 #else
103  // True doubles. Correct when the Fortran is built -fdefault-real-8.
104  return amrex::Real(d);
105 #endif
106 }

Referenced by WDM6::Advance(), WDM6::initialize_coeffs(), wdm6_diffus(), wdm6_lamdac_exact(), wdm6_lamdar(), wdm6_nislfv_rain_plm6_column(), wdm6_slope_rain_cell(), wdm6_venfac(), and wdm6_viscos().

Here is the caller graph for this function:

◆ wdm6_theta_from_temperature_and_pressure()

AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real wdm6_theta_from_temperature_and_pressure ( const amrex::Real  temperature,
const amrex::Real  pressure,
const amrex::Real  configured_rdOcp,
const bool  use_anelastic_reference_pressure 
)
noexcept
86 {
87  const amrex::Real theta_rdOcp = use_anelastic_reference_pressure
88  ? configured_rdOcp : RdoCp;
89  return getThgivenTandP(temperature, pressure, theta_rdOcp);
90 }
constexpr amrex::Real RdoCp
Definition: ERF_Constants.H:41
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

Referenced by WDM6::Advance().

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