From d65256783f6db64a24bebe7779aadaca66cd83db Mon Sep 17 00:00:00 2001 From: tcclevenger Date: Wed, 17 Jul 2024 09:02:50 -0600 Subject: [PATCH 1/3] Port shoc_assumed_pdf functions individually (like in shoc.F90) --- .../eamxx/src/physics/shoc/CMakeLists.txt | 12 + ...shoc_assumed_pdf_compute_buoyancy_flux.cpp | 14 + ...umed_pdf_compute_cloud_liquid_variance.cpp | 14 + ..._assumed_pdf_compute_liquid_water_flux.cpp | 14 + .../shoc/eti/shoc_assumed_pdf_compute_qs.cpp | 14 + .../shoc/eti/shoc_assumed_pdf_compute_s.cpp | 14 + .../shoc_assumed_pdf_compute_sgs_liquid.cpp | 14 + .../shoc_assumed_pdf_compute_temperature.cpp | 14 + .../shoc_assumed_pdf_inplume_correlations.cpp | 14 + .../eti/shoc_assumed_pdf_qw_parameters.cpp | 14 + .../eti/shoc_assumed_pdf_thl_parameters.cpp | 14 + .../eti/shoc_assumed_pdf_tilde_to_real.cpp | 14 + .../eti/shoc_assumed_pdf_vv_parameters.cpp | 14 + ...assumed_pdf_compute_buoyancy_flux_impl.hpp | 41 +++ ...pdf_compute_cloud_liquid_variance_impl.hpp | 39 +++ ...med_pdf_compute_liquid_water_flux_impl.hpp | 33 +++ .../impl/shoc_assumed_pdf_compute_qs_impl.hpp | 55 ++++ .../impl/shoc_assumed_pdf_compute_s_impl.hpp | 69 +++++ ...oc_assumed_pdf_compute_sgs_liquid_impl.hpp | 30 ++ ...c_assumed_pdf_compute_temperature_impl.hpp | 29 ++ .../shoc/impl/shoc_assumed_pdf_impl.hpp | 264 ++++-------------- ..._assumed_pdf_inplume_correlations_impl.hpp | 50 ++++ .../shoc_assumed_pdf_qw_parameters_impl.hpp | 79 ++++++ .../shoc_assumed_pdf_thl_parameters_impl.hpp | 82 ++++++ .../shoc_assumed_pdf_tilde_to_real_impl.hpp | 32 +++ .../shoc_assumed_pdf_vv_parameters_impl.hpp | 61 ++++ .../eamxx/src/physics/shoc/shoc_functions.hpp | 164 ++++++++++- 27 files changed, 992 insertions(+), 216 deletions(-) create mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_buoyancy_flux.cpp create mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_cloud_liquid_variance.cpp create mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_liquid_water_flux.cpp create mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_qs.cpp create mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_s.cpp create mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_sgs_liquid.cpp create mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_temperature.cpp create mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_inplume_correlations.cpp create mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_qw_parameters.cpp create mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_thl_parameters.cpp create mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_tilde_to_real.cpp create mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_vv_parameters.cpp create mode 100644 components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_buoyancy_flux_impl.hpp create mode 100644 components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp create mode 100644 components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp create mode 100644 components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_qs_impl.hpp create mode 100644 components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_s_impl.hpp create mode 100644 components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_sgs_liquid_impl.hpp create mode 100644 components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_temperature_impl.hpp create mode 100644 components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_inplume_correlations_impl.hpp create mode 100644 components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_qw_parameters_impl.hpp create mode 100644 components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_thl_parameters_impl.hpp create mode 100644 components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_tilde_to_real_impl.hpp create mode 100644 components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_vv_parameters_impl.hpp diff --git a/components/eamxx/src/physics/shoc/CMakeLists.txt b/components/eamxx/src/physics/shoc/CMakeLists.txt index 891626b9d3d..e6724622a92 100644 --- a/components/eamxx/src/physics/shoc/CMakeLists.txt +++ b/components/eamxx/src/physics/shoc/CMakeLists.txt @@ -25,6 +25,18 @@ if (NOT EAMXX_ENABLE_GPU) list(APPEND SHOC_SRCS eti/shoc_adv_sgs_tke.cpp eti/shoc_assumed_pdf.cpp + eti/shoc_assumed_pdf_compute_buoyancy_flux.cpp + eti/shoc_assumed_pdf_compute_cloud_liquid_variance.cpp + eti/shoc_assumed_pdf_compute_liquid_water_flux.cpp + eti/shoc_assumed_pdf_compute_qs.cpp + eti/shoc_assumed_pdf_compute_sgs_liquid.cpp + eti/shoc_assumed_pdf_compute_temperature.cpp + eti/shoc_assumed_pdf_inplume_correlations.cpp + eti/shoc_assumed_pdf_qw_parameters.cpp + eti/shoc_assumed_pdf_compute_s.cpp + eti/shoc_assumed_pdf_thl_parameters.cpp + eti/shoc_assumed_pdf_tilde_to_real.cpp + eti/shoc_assumed_pdf_vv_parameters.cpp eti/shoc_calc_shoc_varorcovar.cpp eti/shoc_calc_shoc_vertflux.cpp eti/shoc_check_length_scale_shoc_length.cpp diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_buoyancy_flux.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_buoyancy_flux.cpp new file mode 100644 index 00000000000..4d38b8525dd --- /dev/null +++ b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_buoyancy_flux.cpp @@ -0,0 +1,14 @@ +#include "shoc_assumed_pdf_compute_buoyancy_flux_impl.hpp" + +namespace scream { +namespace shoc { + +/* + * Explicit instantiation for doing shoc_assumed_pdf_compute_buoyancy_flux on Reals using the + * default device. + */ + +template struct Functions; + +} // namespace shoc +} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_cloud_liquid_variance.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_cloud_liquid_variance.cpp new file mode 100644 index 00000000000..eb83e209877 --- /dev/null +++ b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_cloud_liquid_variance.cpp @@ -0,0 +1,14 @@ +#include "shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp" + +namespace scream { +namespace shoc { + +/* + * Explicit instantiation for doing shoc_assumed_pdf_compute_cloud_liquid_variance on Reals using the + * default device. + */ + +template struct Functions; + +} // namespace shoc +} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_liquid_water_flux.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_liquid_water_flux.cpp new file mode 100644 index 00000000000..d8f99806cf9 --- /dev/null +++ b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_liquid_water_flux.cpp @@ -0,0 +1,14 @@ +#include "shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp" + +namespace scream { +namespace shoc { + +/* + * Explicit instantiation for doing shoc_assumed_pdf_compute_liquid_water_flux on Reals using the + * default device. + */ + +template struct Functions; + +} // namespace shoc +} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_qs.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_qs.cpp new file mode 100644 index 00000000000..fbac9733184 --- /dev/null +++ b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_qs.cpp @@ -0,0 +1,14 @@ +#include "shoc_assumed_pdf_compute_qs_impl.hpp" + +namespace scream { +namespace shoc { + +/* + * Explicit instantiation for doing shoc_assumed_pdf_compute_qs on Reals using the + * default device. + */ + +template struct Functions; + +} // namespace shoc +} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_s.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_s.cpp new file mode 100644 index 00000000000..b74ae269a76 --- /dev/null +++ b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_s.cpp @@ -0,0 +1,14 @@ +#include "shoc_assumed_pdf_compute_s_impl.hpp" + +namespace scream { +namespace shoc { + +/* + * Explicit instantiation for doing shoc_assumed_pdf_compute_s on Reals using the + * default device. + */ + +template struct Functions; + +} // namespace shoc +} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_sgs_liquid.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_sgs_liquid.cpp new file mode 100644 index 00000000000..d2c786e8836 --- /dev/null +++ b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_sgs_liquid.cpp @@ -0,0 +1,14 @@ +#include "shoc_assumed_pdf_compute_sgs_liquid_impl.hpp" + +namespace scream { +namespace shoc { + +/* + * Explicit instantiation for doing shoc_assumed_pdf_compute_sgs_liquid on Reals using the + * default device. + */ + +template struct Functions; + +} // namespace shoc +} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_temperature.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_temperature.cpp new file mode 100644 index 00000000000..8fdf36d6408 --- /dev/null +++ b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_temperature.cpp @@ -0,0 +1,14 @@ +#include "shoc_assumed_pdf_compute_temperature_impl.hpp" + +namespace scream { +namespace shoc { + +/* + * Explicit instantiation for doing shoc_assumed_pdf_compute_temperature on Reals using the + * default device. + */ + +template struct Functions; + +} // namespace shoc +} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_inplume_correlations.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_inplume_correlations.cpp new file mode 100644 index 00000000000..d29641dd73b --- /dev/null +++ b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_inplume_correlations.cpp @@ -0,0 +1,14 @@ +#include "shoc_assumed_pdf_inplume_correlations_impl.hpp" + +namespace scream { +namespace shoc { + +/* + * Explicit instantiation for doing shoc_assumed_pdf_inplume_correlations on Reals using the + * default device. + */ + +template struct Functions; + +} // namespace shoc +} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_qw_parameters.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_qw_parameters.cpp new file mode 100644 index 00000000000..b9a9501b988 --- /dev/null +++ b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_qw_parameters.cpp @@ -0,0 +1,14 @@ +#include "shoc_assumed_pdf_qw_parameters_impl.hpp" + +namespace scream { +namespace shoc { + +/* + * Explicit instantiation for doing shoc_assumed_pdf_qw_parameters on Reals using the + * default device. + */ + +template struct Functions; + +} // namespace shoc +} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_thl_parameters.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_thl_parameters.cpp new file mode 100644 index 00000000000..716fd7cd3d2 --- /dev/null +++ b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_thl_parameters.cpp @@ -0,0 +1,14 @@ +#include "shoc_assumed_pdf_thl_parameters_impl.hpp" + +namespace scream { +namespace shoc { + +/* + * Explicit instantiation for doing shoc_assumed_pdf_thl_parameters on Reals using the + * default device. + */ + +template struct Functions; + +} // namespace shoc +} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_tilde_to_real.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_tilde_to_real.cpp new file mode 100644 index 00000000000..250e3f1a0a4 --- /dev/null +++ b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_tilde_to_real.cpp @@ -0,0 +1,14 @@ +#include "shoc_assumed_pdf_tilde_to_real_impl.hpp" + +namespace scream { +namespace shoc { + +/* + * Explicit instantiation for doing shoc_assumed_pdf_tilde_to_real on Reals using the + * default device. + */ + +template struct Functions; + +} // namespace shoc +} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_vv_parameters.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_vv_parameters.cpp new file mode 100644 index 00000000000..2af26cfc1ad --- /dev/null +++ b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_vv_parameters.cpp @@ -0,0 +1,14 @@ +#include "shoc_assumed_pdf_vv_parameters_impl.hpp" + +namespace scream { +namespace shoc { + +/* + * Explicit instantiation for doing shoc_assumed_pdf_vv_parameters on Reals using the + * default device. + */ + +template struct Functions; + +} // namespace shoc +} // namespace scream diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_buoyancy_flux_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_buoyancy_flux_impl.hpp new file mode 100644 index 00000000000..db31f1ab1bd --- /dev/null +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_buoyancy_flux_impl.hpp @@ -0,0 +1,41 @@ +#ifndef SHOC_SHOC_ASSUMED_PDF_COMPUTE_BUOYANCY_FLUX_IMPL_HPP +#define SHOC_SHOC_ASSUMED_PDF_COMPUTE_BUOYANCY_FLUX_IMPL_HPP + +#include "shoc_functions.hpp" // for ETI only but harmless for GPU + +#include + +namespace scream { +namespace shoc { + +/* + * Implementation of shoc_assumed_pdf_compute_buoyancy_flux. Clients should NOT + * #include this file, but include shoc_functions.hpp instead. + */ + +template +KOKKOS_FUNCTION +void Functions::shoc_assumed_pdf_compute_buoyancy_flux( + const Spack& wthlsec, + const Spack& wqwsec, + const Spack& pval, + const Spack& wqls, + Spack& wthv_sec) +{ + const Scalar basepres = C::P0; + const Scalar rair = C::Rair; + const Scalar rv = C::RV; + const Scalar cp = C::CP; + const Scalar lcond = C::LatVap; + const Scalar basetemp = C::basetemp; + const Scalar epsterm = rair/rv; + + wthv_sec = wthlsec + ((1 - epsterm)/epsterm)*basetemp*wqwsec + + ((lcond/cp)*ekat::pow(basepres/pval, (rair/cp)) + - (1/epsterm)*basetemp)*wqls; +} + +} // namespace shoc +} // namespace scream + +#endif diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp new file mode 100644 index 00000000000..06f740d6eb5 --- /dev/null +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp @@ -0,0 +1,39 @@ +#ifndef SHOC_SHOC_ASSUMED_PDF_COMPUTE_CLOUD_LIQUID_VARIANCE_IMPL_HPP +#define SHOC_SHOC_ASSUMED_PDF_COMPUTE_CLOUD_LIQUID_VARIANCE_IMPL_HPP + +#include "shoc_functions.hpp" // for ETI only but harmless for GPU + +#include + +namespace scream { +namespace shoc { + +/* + * Implementation of shoc_assumed_pdf_compute_cloud_liquid_variance. Clients should NOT + * #include this file, but include shoc_functions.hpp instead. + */ + +template +KOKKOS_FUNCTION +void Functions::shoc_assumed_pdf_compute_cloud_liquid_variance( + const Spack& a, + const Spack& s1, + const Spack& ql1, + const Spack& C1, + const Spack& std_s1, + const Spack& s2, + const Spack& ql2, + const Spack& C2, + const Spack& std_s2, + const Spack& shoc_ql, + Spack& shoc_ql2) +{ + shoc_ql2 = ekat::max(0, a*(s1*ql1 + C1*ekat::square(std_s1)) + + (1 - a)*(s2*ql2 + C2*ekat::square(std_s2)) + - ekat::square(shoc_ql)); +} + +} // namespace shoc +} // namespace scream + +#endif diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp new file mode 100644 index 00000000000..b225494e7b6 --- /dev/null +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp @@ -0,0 +1,33 @@ +#ifndef SHOC_SHOC_ASSUMED_PDF_COMPUTE_LIQUID_WATER_FLUX_IMPL_HPP +#define SHOC_SHOC_ASSUMED_PDF_COMPUTE_LIQUID_WATER_FLUX_IMPL_HPP + +#include "shoc_functions.hpp" // for ETI only but harmless for GPU + +#include + +namespace scream { +namespace shoc { + +/* + * Implementation of shoc_assumed_pdf_compute_liquid_water_flux. Clients should NOT + * #include this file, but include shoc_functions.hpp instead. + */ + +template +KOKKOS_FUNCTION +void Functions::shoc_assumed_pdf_compute_liquid_water_flux( + const Spack& a, + const Spack& w1_1, + const Spack& w_first, + const Spack& ql1, + const Spack& w1_2, + const Spack& ql2, + Spack& wqls) +{ + wqls = a*((w1_1 - w_first)*ql1) + (1 - a)*((w1_2 - w_first)*ql2); +} + +} // namespace shoc +} // namespace scream + +#endif diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_qs_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_qs_impl.hpp new file mode 100644 index 00000000000..3949f087bfe --- /dev/null +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_qs_impl.hpp @@ -0,0 +1,55 @@ +#ifndef SHOC_SHOC_ASSUMED_PDF_COMPUTE_QS_IMPL_HPP +#define SHOC_SHOC_ASSUMED_PDF_COMPUTE_QS_IMPL_HPP + +#include "shoc_functions.hpp" // for ETI only but harmless for GPU +#include "physics_functions.hpp" + +#include + +namespace scream { +namespace shoc { + +/* + * Implementation of shoc_assumed_pdf_compute_qs. Clients should NOT + * #include this file, but include shoc_functions.hpp instead. + */ + +template +KOKKOS_FUNCTION +void Functions::shoc_assumed_pdf_compute_qs( + const Spack& Tl1_1, + const Spack& Tl1_2, + const Spack& pval, + const Smask& active_entries, + Spack& qs1, + Spack& beta1, + Spack& qs2, + Spack& beta2) +{ + const Scalar rair = C::Rair; + const Scalar rv = C::RV; + const Scalar cp = C::CP; + const Scalar lcond = C::LatVap; + + // Compute MurphyKoop_svp + const int liquid = 0; + const Spack esval1_1 = scream::physics::Functions::MurphyKoop_svp(Tl1_1,liquid,active_entries,"shoc::shoc_assumed_pdf (Tl1_1)"); + const Spack esval1_2 = scream::physics::Functions::MurphyKoop_svp(Tl1_2,liquid,active_entries,"shoc::shoc_assumed_pdf (Tl1_2)"); + const Spack lstarn(lcond); + + qs1 = sp(0.622)*esval1_1/ekat::max(esval1_1, pval - esval1_1); + beta1 = (rair/rv)*(lstarn/(rair*Tl1_1))*(lstarn/(cp*Tl1_1)); + + // Only compute qs2 and beta2 if the two plumes are not equal + const Smask condition = (Tl1_1 != Tl1_2); + qs2 = qs1; + beta2 = beta1; + + qs2.set(condition, sp(0.622)*esval1_2/ekat::max(esval1_2, pval - esval1_2)); + beta2.set(condition, (rair/rv)*(lstarn/(rair*Tl1_2))*(lstarn/(cp*Tl1_2))); +} + +} // namespace shoc +} // namespace scream + +#endif diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_s_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_s_impl.hpp new file mode 100644 index 00000000000..180bf889d36 --- /dev/null +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_s_impl.hpp @@ -0,0 +1,69 @@ +#ifndef SHOC_SHOC_ASSUMED_PDF_COMPUTE_S_IMPL_HPP +#define SHOC_SHOC_ASSUMED_PDF_COMPUTE_S_IMPL_HPP + +#include "shoc_functions.hpp" // for ETI only but harmless for GPU + +#include + +namespace scream { +namespace shoc { + +/* + * Implementation of shoc_assumed_pdf_compute_s. Clients should NOT + * #include this file, but include shoc_functions.hpp instead. + */ + +template +KOKKOS_FUNCTION +void Functions::shoc_assumed_pdf_compute_s( + const Spack& qw1, + const Spack& qs, + const Spack& beta, + const Spack& pval, + const Spack& thl2, + const Spack& qw2, + const Spack& sqrtthl2, + const Spack& sqrtqw2, + const Spack& r_qwthl, + Spack& s, + Spack& std_s, + Spack& qn, + Spack& C) +{ + const Scalar rair = C::Rair; + const Scalar basepres = C::P0; + const Scalar cp = C::CP; + const Scalar lcond = C::LatVap; + const Scalar pi = C::Pi; + + const Scalar sqrt2(std::sqrt(Scalar(2.0))), sqrt2pi(std::sqrt(2*pi)); + + const Spack cthl=((1 + beta*qw1)/ekat::square(1 + beta*qs))*(cp/lcond)* + beta*qs*ekat::pow(pval/basepres, (rair/cp)); + const Spack cqt = 1/(1 + beta*qs); + + std_s = ekat::sqrt(ekat::max(0, + ekat::square(cthl)*thl2 + + ekat::square(cqt)*qw2 - 2*cthl*sqrtthl2*cqt*sqrtqw2*r_qwthl)); + const auto std_s_not_small = std_s > std::sqrt(std::numeric_limits::min()) * 100; + s = qw1-qs*((1 + beta*qw1)/(1 + beta*qs)); + if (std_s_not_small.any()) { + C.set(std_s_not_small, sp(0.5)*(1 + ekat::erf(s/(sqrt2*std_s)))); + } + C.set(!std_s_not_small && s > 0, 1); + const auto std_s_C_not_small = std_s_not_small && C != 0; + if (std_s_C_not_small.any()) { + qn.set(std_s_C_not_small, s*C+(std_s/sqrt2pi)*ekat::exp(-sp(0.5)*ekat::square(s/std_s))); + } + qn.set(!std_s_not_small && s > 0, s); + + // Checking to prevent empty clouds + const auto qn_le_zero = qn <= 0; + C.set(qn_le_zero,0); + qn.set(qn_le_zero,0); +} + +} // namespace shoc +} // namespace scream + +#endif diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_sgs_liquid_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_sgs_liquid_impl.hpp new file mode 100644 index 00000000000..cbc12f99a67 --- /dev/null +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_sgs_liquid_impl.hpp @@ -0,0 +1,30 @@ +#ifndef SHOC_SHOC_ASSUMED_PDF_COMPUTE_SGS_LIQUID_IMPL_HPP +#define SHOC_SHOC_ASSUMED_PDF_COMPUTE_SGS_LIQUID_IMPL_HPP + +#include "shoc_functions.hpp" // for ETI only but harmless for GPU + +#include + +namespace scream { +namespace shoc { + +/* + * Implementation of shoc_assumed_pdf_compute_sgs_liquid. Clients should NOT + * #include this file, but include shoc_functions.hpp instead. + */ + +template +KOKKOS_FUNCTION +void Functions::shoc_assumed_pdf_compute_sgs_liquid( + const Spack& a, + const Spack& ql1, + const Spack& ql2, + Spack& shoc_ql) +{ + shoc_ql = ekat::max(0, a*ql1 + (1 - a)*ql2); +} + +} // namespace shoc +} // namespace scream + +#endif diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_temperature_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_temperature_impl.hpp new file mode 100644 index 00000000000..e857951c5f2 --- /dev/null +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_temperature_impl.hpp @@ -0,0 +1,29 @@ +#ifndef SHOC_SHOC_ASSUMED_PDF_COMPUTE_TEMPERATURE_IMPL_HPP +#define SHOC_SHOC_ASSUMED_PDF_COMPUTE_TEMPERATURE_IMPL_HPP + +#include "shoc_functions.hpp" // for ETI only but harmless for GPU + +#include + +namespace scream { +namespace shoc { + +/* + * Implementation of shoc_assumed_pdf_compute_temperature. Clients should NOT + * #include this file, but include shoc_functions.hpp instead. + */ + +template +KOKKOS_FUNCTION +void Functions::shoc_assumed_pdf_compute_temperature( + const Spack& thl1, + const Spack& pval, + Spack& Tl1) +{ + Tl1 = thl1/(ekat::pow(C::P0/pval,(C::Rair/C::CP))); +} + +} // namespace shoc +} // namespace scream + +#endif diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_impl.hpp index 84e76c5941a..cd004adbd2d 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_impl.hpp @@ -77,15 +77,6 @@ void Functions::shoc_assumed_pdf( const Scalar w_tol_sqd = 4e-4; const Scalar w_thresh = 0; const Scalar largeneg = SC::largeneg; - const Scalar rair = C::Rair; - const Scalar rv = C::RV; - const bool dothetal_skew = SC::dothetal_skew; - const Scalar basepres = C::P0; - const Scalar cp = C::CP; - const Scalar lcond = C::LatVap; - const Scalar pi = C::Pi; - const Scalar basetemp = C::basetemp; - const Scalar epsterm = rair/rv; const Scalar Tl_min = 100; // Interpolate many variables from interface grid to thermo grid @@ -125,121 +116,35 @@ void Functions::shoc_assumed_pdf( const auto sqrtqt = ekat::max(rt_tol,ekat::sqrt(qwsec)); // Find parameters for vertical velocity - Spack Skew_w(0), w1_1(w_first), w1_2(w_first), w2_1(0), w2_2(0), a(0.5); - { - const Smask condition = w_sec(k) > w_tol_sqd; - - const Scalar tmp_val(0.4); - const Scalar one_m_tmp_val(1 - tmp_val); - const Scalar sqrtw2t(std::sqrt(1-tmp_val)); - - Skew_w.set(condition, w3var/ekat::sqrt(ekat::cube(w_sec(k)))); - a.set(condition, - ekat::max(sp(0.01), - ekat::min(sp(0.99), - sp(0.5)*(1 - Skew_w*ekat::sqrt(1/(4*(one_m_tmp_val*one_m_tmp_val*one_m_tmp_val) - + ekat::square(Skew_w))))))); - - w1_1.set(condition, ekat::sqrt((1 - a)/a)*sqrtw2t); - w1_2.set(condition, -1*ekat::sqrt(a/(1 - a))*sqrtw2t); - w2_1.set(condition, tmp_val*w_sec(k)); - w2_2.set(condition, tmp_val*w_sec(k)); - } + Spack Skew_w, w1_1, w1_2, w2_1, w2_2, a; + shoc_assumed_pdf_vv_parameters(w_first, w2sec, w3var, w_tol_sqd, Skew_w, w1_1, w1_2, w2_1, w2_2, a); // Find parameters for thetal - Spack thl1_1(thl_first), thl1_2(thl_first), thl2_1(0), thl2_2(0), - sqrtthl2_1(0), sqrtthl2_2(0); - { - const Smask condition = thlsec > (thl_tol*thl_tol) && ekat::abs(w1_2 - w1_1) > w_thresh; - - const Spack corrtest1 = ekat::max(-1, ekat::min(1, wthlsec/(sqrtw2*sqrtthl))); - const Spack tmp_val_1(-corrtest1/w1_1), tmp_val_2(-corrtest1/w1_2); - - Spack Skew_thl(0); - if (dothetal_skew == true) { - const auto tsign = ekat::abs(tmp_val_1 - tmp_val_2); - Skew_thl.set(tsign>sp(0.4), sp(1.2)*Skew_w); - Skew_thl.set(tsign>sp(0.2) && tsign<=sp(0.4), (((sp(1.2)*Skew_w)/sp(0.2))*(tsign-sp(0.2)))); - } - - if (condition.any()) { - thl2_1.set(condition, - ekat::min(100, - ekat::max(0, (3*tmp_val_1*(1 - a*ekat::square(tmp_val_2) - (1-a)*ekat::square(tmp_val_1)) - - (Skew_thl - a*ekat::cube(tmp_val_2) - (1 - a)*ekat::cube(tmp_val_1))) - /(3*a*(tmp_val_1 - tmp_val_2))))*thlsec); - thl2_2.set(condition, - ekat::min(100, - ekat::max(0, (-3*tmp_val_2*(1 - a*ekat::square(tmp_val_2) - - (1 - a)*ekat::square(tmp_val_1)) - + (Skew_thl - a*ekat::cube(tmp_val_2) - (1 - a)*ekat::cube(tmp_val_1))) - /(3*(1 - a)*(tmp_val_1 - tmp_val_2))))*thlsec); - - thl1_1.set(condition, tmp_val_2*sqrtthl+thl_first); - thl1_2.set(condition, tmp_val_1*sqrtthl+thl_first); - - sqrtthl2_1.set(condition, ekat::sqrt(thl2_1)); - sqrtthl2_2.set(condition, ekat::sqrt(thl2_2)); - } - - } + Spack thl1_1, thl1_2, thl2_1, thl2_2, sqrtthl2_1, sqrtthl2_2; + shoc_assumed_pdf_thl_parameters(wthlsec,sqrtw2,sqrtthl,thlsec,thl_first,w1_1,w1_2,Skew_w,a, + thl_tol, w_thresh, + thl1_1, thl1_2, thl2_1, thl2_2, sqrtthl2_1, sqrtthl2_2); // Find parameters for total water mixing ratio - Spack qw1_1(qw_first), qw1_2(qw_first), qw2_1(0), qw2_2(0), - sqrtqw2_1(0), sqrtqw2_2(0); - { - const Smask condition = qwsec > (rt_tol*rt_tol) && ekat::abs(w1_2 - w1_1) > w_thresh; - - const Spack corrtest2 = ekat::max(-1, ekat::min(1, wqwsec/(sqrtw2*sqrtqt))); - const Spack tmp_val_1(-corrtest2/w1_1), tmp_val_2(-corrtest2/w1_2); - - const auto tsign = ekat::abs(tmp_val_1 - tmp_val_2); - Spack Skew_qw(0); - Skew_qw.set(tsign>sp(0.4), sp(1.2)*Skew_w); - Skew_qw.set(tsign>sp(0.2) && tsign<=sp(0.4), (((sp(1.2)*Skew_w)/sp(0.2))*(tsign-sp(0.2)))); - - if (condition.any()) { - qw2_1.set(condition, - ekat::min(100, - ekat::max(0, (3*tmp_val_1*(1 - a*ekat::square(tmp_val_2) - (1 - a)*ekat::square(tmp_val_1)) - - (Skew_qw - a*ekat::cube(tmp_val_2) - (1 - a)*ekat::cube(tmp_val_1))) - /(3*a*(tmp_val_1 - tmp_val_2))))*qwsec); - qw2_2.set(condition, - ekat::min(100, - ekat::max(0, (-3*tmp_val_2*(1 - a*ekat::square(tmp_val_2) - (1 - a)*ekat::square(tmp_val_1)) - + (Skew_qw - a*ekat::cube(tmp_val_2) - (1 - a)*ekat::cube(tmp_val_1))) - /(3*(1 - a)*(tmp_val_1 - tmp_val_2))))*qwsec); - } - - qw1_1.set(condition, tmp_val_2*sqrtqt+qw_first); - qw1_2.set(condition, tmp_val_1*sqrtqt+qw_first); - - sqrtqw2_1.set(condition, ekat::sqrt(qw2_1)); - sqrtqw2_2.set(condition, ekat::sqrt(qw2_2)); - } + Spack qw1_1, qw1_2, qw2_1, qw2_2, sqrtqw2_1, sqrtqw2_2; + shoc_assumed_pdf_qw_parameters(wqwsec, sqrtw2, Skew_w, sqrtqt, qwsec, w1_2, w1_1, qw_first, a, + rt_tol, w_thresh, + qw1_1, qw1_2, qw2_1, qw2_2, sqrtqw2_1, sqrtqw2_2); // Convert from tilde variables to "real" variables - w1_1 *= sqrtw2; - w1_1 += w_first; - w1_2 *= sqrtw2; - w1_2 += w_first; + shoc_assumed_pdf_tilde_to_real(w_first, sqrtw2, w1_1); + shoc_assumed_pdf_tilde_to_real(w_first, sqrtw2, w1_2); // Find within-plume correlations. - Spack r_qwthl_1(0); - { - const Spack testvar = a*sqrtqw2_1*sqrtthl2_1 + (1 - a)*sqrtqw2_2*sqrtthl2_2; - const auto testvar_ne_zero = testvar != 0; - if (testvar_ne_zero.any()) { - r_qwthl_1.set(testvar_ne_zero, - ekat::max(-1, - ekat::min(1, (qwthlsec - a*(qw1_1 - qw_first)*(thl1_1 - thl_first) - - (1 - a)*(qw1_2 - qw_first)*(thl1_2 - thl_first))/testvar))); - } - } + Spack r_qwthl_1; + shoc_assumed_pdf_inplume_correlations(sqrtqw2_1, sqrtthl2_1, a, sqrtqw2_2, sqrtthl2_2, qwthlsec, + qw1_1, qw_first, thl1_1, thl_first, qw1_2, thl1_2, + r_qwthl_1); // Begin to compute cloud property statistics - Spack Tl1_1 = thl1_1/(ekat::pow(basepres/pval,(rair/cp))); - Spack Tl1_2 = thl1_2/(ekat::pow(basepres/pval,(rair/cp))); + Spack Tl1_1, Tl1_2; + shoc_assumed_pdf_compute_temperature(thl1_1,pval, Tl1_1); + shoc_assumed_pdf_compute_temperature(thl1_2,pval, Tl1_2); const auto index_range = ekat::range(k*Spack::n); const Smask active_entries = (index_range < nlev); @@ -295,121 +200,54 @@ void Functions::shoc_assumed_pdf( } // Compute qs and beta - Spack qs1(0), qs2(0), beta1(0), beta2(0); - { - // Compute MurphyKoop_svp - const int liquid = 0; - const Spack esval1_1 = scream::physics::Functions::MurphyKoop_svp(Tl1_1,liquid,active_entries,"shoc::shoc_assumed_pdf (Tl1_1)"); - const Spack esval1_2 = scream::physics::Functions::MurphyKoop_svp(Tl1_2,liquid,active_entries,"shoc::shoc_assumed_pdf (Tl1_2)"); - const Spack lstarn(lcond); - - qs1 = sp(0.622)*esval1_1/ekat::max(esval1_1, pval - esval1_1); - beta1 = (rair/rv)*(lstarn/(rair*Tl1_1))*(lstarn/(cp*Tl1_1)); - - // Only compute qs2 and beta2 if the two plumes are not equal - const Smask condition = (Tl1_1 != Tl1_2); - qs2 = qs1; - beta2 = beta1; - - qs2.set(condition, sp(0.622)*esval1_2/ekat::max(esval1_2, pval - esval1_2)); - beta2.set(condition, (rair/rv)*(lstarn/(rair*Tl1_2))*(lstarn/(cp*Tl1_2))); - } + Spack qs1, qs2, beta1, beta2; + shoc_assumed_pdf_compute_qs(Tl1_1, Tl1_2, pval, active_entries, qs1, beta1, qs2, beta2); // Cloud computations // Compute s terms. - Spack s1(0), std_s1(0), qn1(0), C1(0), ql1(0), - s2(0), std_s2(0), qn2(0), C2(0), ql2(0); - { - const Scalar sqrt2(std::sqrt(Scalar(2.0))), sqrt2pi(std::sqrt(2*pi)); - - // First plume - const Spack cthl1=((1 + beta1*qw1_1)/ekat::square(1 + beta1*qs1))*(cp/lcond)* - beta1*qs1*ekat::pow(pval/basepres, (rair/cp)); - const Spack cqt1 = 1/(1 + beta1*qs1); - - std_s1 = ekat::sqrt(ekat::max(0, - ekat::square(cthl1)*thl2_1 - + ekat::square(cqt1)*qw2_1 - 2*cthl1*sqrtthl2_1*cqt1*sqrtqw2_1*r_qwthl_1)); - const auto std_s1_not_small = std_s1 > std::sqrt(safe_min()) * 100; - s1 = qw1_1-qs1*((1 + beta1*qw1_1)/(1 + beta1*qs1)); - if (std_s1_not_small.any()) { - C1.set(std_s1_not_small, sp(0.5)*(1 + ekat::erf(s1/(sqrt2*std_s1)))); - } - C1.set(!std_s1_not_small && s1 > 0, 1); - const auto std_s1_C1_not_small = std_s1_not_small && C1 != 0; - if (std_s1_C1_not_small.any()) { - qn1.set(std_s1_C1_not_small, s1*C1+(std_s1/sqrt2pi)*ekat::exp(-sp(0.5)*ekat::square(s1/std_s1))); - } - qn1.set(!std_s1_not_small && s1 > 0, s1); - - // Checking to prevent empty clouds - const auto qn1_le_zero = qn1 <= 0; - C1.set(qn1_le_zero,0); - qn1.set(qn1_le_zero,0); - - ql1 = ekat::min(qn1, qw1_1); - - // Second plume - // Only compute variables of the second plume if the two plumes are not equal - const Smask equal(qw1_1==qw1_2 && thl2_1==thl2_2 && qs1==qs2); - std_s2.set(equal, std_s1); - s2.set(equal, s1); - C2.set(equal, C1); - qn2.set(equal, qn1); - - const Spack cthl2(!equal, - ((1 + beta2*qw1_2)/ekat::square(1 + beta2*qs2))*(cp/lcond)* - beta2*qs2*ekat::pow(pval/basepres, (rair/cp))); - const Spack cqt2(!equal, - 1/(1 + beta2*qs2)); - - const auto nequal = !equal; - if (nequal.any()) { - std_s2.set(nequal, - ekat::sqrt(ekat::max(0, - ekat::square(cthl2)*thl2_2 - + ekat::square(cqt2)*qw2_2 - 2*cthl2*sqrtthl2_2*cqt2*sqrtqw2_2*r_qwthl_1))); - s2.set(nequal, qw1_2-qs2*((1 + beta2*qw1_2)/(1 + beta2*qs2))); - const auto std_s2_not_small = std_s2 > std::sqrt(safe_min()) * 100; - const auto nequal_std_s2_not_small = nequal && std_s2_not_small; - if (nequal_std_s2_not_small.any()) { - C2.set(nequal_std_s2_not_small, sp(0.5)*(1 + ekat::erf(s2/(sqrt2*std_s2)))); - } - C2.set(nequal && !std_s2_not_small && s2 > 0, 1); - const auto nequal_std_s2_C2_not_small = nequal_std_s2_not_small && C2 != 0; - if (nequal_std_s2_C2_not_small.any()) { - qn2.set(nequal_std_s2_C2_not_small, s2*C2+(std_s2/sqrt2pi)*ekat::exp(-sp(0.5)*ekat::square(s2/std_s2))); - } - qn2.set(nequal && !std_s2_not_small && s2 > 0, s2); - } - - // Checking to prevent empty clouds - const auto qn2_le_zero = qn2 <= 0; - C2.set(qn2_le_zero,0); - qn2.set(qn2_le_zero,0); - - ql2 = ekat::min(qn2, qw1_2); + Spack s1, std_s1, qn1, C1, ql1, s2, std_s2, qn2, C2, ql2; + + // First plume + shoc_assumed_pdf_compute_s(qw1_1, qs1, beta1, pval, thl2_1, qw2_1, + sqrtthl2_1, sqrtqw2_1, r_qwthl_1, + s1, std_s1, qn1, C1); + + // Second plume + // Only compute variables of the second plume if the two plumes are not equal + const Smask equal(qw1_1==qw1_2 && thl2_1==thl2_2 && qs1==qs2); + std_s2.set(equal, std_s1); + s2.set(equal, s1); + C2.set(equal, C1); + qn2.set(equal, qn1); + + const auto nequal = !equal; + if (nequal.any()) { + shoc_assumed_pdf_compute_s(qw1_2, qs2, beta2, pval, thl2_2, qw2_2, + sqrtthl2_2, sqrtqw2_2, r_qwthl_1, + s2, std_s2, qn2, C2); } + ql1 = ekat::min(qn1, qw1_1); + ql2 = ekat::min(qn2, qw1_2); + // Compute SGS cloud fraction shoc_cldfrac(k) = ekat::min(1, a*C1 + (1 - a)*C2); // Compute SGS liquid water mixing ratio - shoc_ql(k) = ekat::max(0, a*ql1 + (1 - a)*ql2); + shoc_assumed_pdf_compute_sgs_liquid(a, ql1, ql2, shoc_ql(k)); // Compute cloud liquid variance (CLUBB formulation, adjusted to SHOC parameters based) - shoc_ql2(k) = ekat::max(0, a*(s1*ql1 + C1*ekat::square(std_s1)) - + (1 - a)*(s2*ql2 + C2*ekat::square(std_s2)) - - ekat::square(shoc_ql(k))); + shoc_assumed_pdf_compute_cloud_liquid_variance(a, s1, ql1, C1, std_s1, + s2, ql2, C2, std_s2, shoc_ql(k), + shoc_ql2(k)); // Compute liquid water flux - wqls(k) = a*((w1_1 - w_first)*ql1) + (1 - a)*((w1_2 - w_first)*ql2); + shoc_assumed_pdf_compute_liquid_water_flux(a, w1_1, w_first, ql1, w1_2, ql2, wqls(k)); // Compute the SGS buoyancy flux - wthv_sec(k) = wthlsec + ((1 - epsterm)/epsterm)*basetemp*wqwsec - + ((lcond/cp)*ekat::pow(basepres/pval, (rair/cp)) - - (1/epsterm)*basetemp)*wqls(k); + shoc_assumed_pdf_compute_buoyancy_flux(wthlsec, wqwsec, pval, wqls(k), + wthv_sec(k)); }); // Release temporary variables from the workspace diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_inplume_correlations_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_inplume_correlations_impl.hpp new file mode 100644 index 00000000000..52554ea9c98 --- /dev/null +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_inplume_correlations_impl.hpp @@ -0,0 +1,50 @@ +#ifndef SHOC_SHOC_ASSUMED_PDF_INPLUME_CORRELATIONS_IMPL_HPP +#define SHOC_SHOC_ASSUMED_PDF_INPLUME_CORRELATIONS_IMPL_HPP + +#include "shoc_functions.hpp" // for ETI only but harmless for GPU + +#include + +namespace scream { +namespace shoc { + +/* + * Implementation of shoc_assumed_pdf_inplume_correlations. Clients should NOT + * #include this file, but include shoc_functions.hpp instead. + * + * Find within-plume correlation + */ + +template +KOKKOS_FUNCTION +void Functions::shoc_assumed_pdf_inplume_correlations( + const Spack& sqrtqw2_1, + const Spack& sqrtthl2_1, + const Spack& a, + const Spack& sqrtqw2_2, + const Spack& sqrtthl2_2, + const Spack& qwthlsec, + const Spack& qw1_1, + const Spack& qw_first, + const Spack& thl1_1, + const Spack& thl_first, + const Spack& qw1_2, + const Spack& thl1_2, + Spack& r_qwthl_1) +{ + r_qwthl_1 = 0; + + const Spack testvar = a*sqrtqw2_1*sqrtthl2_1 + (1 - a)*sqrtqw2_2*sqrtthl2_2; + const auto testvar_ne_zero = testvar != 0; + if (testvar_ne_zero.any()) { + r_qwthl_1.set(testvar_ne_zero, + ekat::max(-1, + ekat::min(1, (qwthlsec - a*(qw1_1 - qw_first)*(thl1_1 - thl_first) + - (1 - a)*(qw1_2 - qw_first)*(thl1_2 - thl_first))/testvar))); + } +} + +} // namespace shoc +} // namespace scream + +#endif diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_qw_parameters_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_qw_parameters_impl.hpp new file mode 100644 index 00000000000..546be97f6fb --- /dev/null +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_qw_parameters_impl.hpp @@ -0,0 +1,79 @@ +#ifndef SHOC_SHOC_ASSUMED_PDF_QW_PARAMETERS_IMPL_HPP +#define SHOC_SHOC_ASSUMED_PDF_QW_PARAMETERS_IMPL_HPP + +#include "shoc_functions.hpp" // for ETI only but harmless for GPU + +#include + +namespace scream { +namespace shoc { + +/* + * Implementation of shoc_assumed_pdf_qw_parameters. Clients should NOT + * #include this file, but include shoc_functions.hpp instead. + * + * Find parameters for total water mixing ratio + */ + +template +KOKKOS_FUNCTION +void Functions::shoc_assumed_pdf_qw_parameters( + const Spack& wqwsec, + const Spack& sqrtw2, + const Spack& Skew_w, + const Spack& sqrtqt, + const Spack& qwsec, + const Spack& w1_2, + const Spack& w1_1, + const Spack& qw_first, + const Spack& a, + const Scalar rt_tol, + const Scalar w_thresh, + Spack& qw1_1, + Spack& qw1_2, + Spack& qw2_1, + Spack& qw2_2, + Spack& sqrtqw2_1, + Spack& sqrtqw2_2) +{ + qw1_1 = qw_first; + qw1_2 = qw_first; + qw2_1 = 0; + qw2_2 = 0; + sqrtqw2_1 = 0; + sqrtqw2_2 = 0; + + const Smask condition = qwsec > (rt_tol*rt_tol) && ekat::abs(w1_2 - w1_1) > w_thresh; + + const Spack corrtest2 = ekat::max(-1, ekat::min(1, wqwsec/(sqrtw2*sqrtqt))); + const Spack tmp_val_1(-corrtest2/w1_1), tmp_val_2(-corrtest2/w1_2); + + const auto tsign = ekat::abs(tmp_val_1 - tmp_val_2); + Spack Skew_qw(0); + Skew_qw.set(tsign>sp(0.4), sp(1.2)*Skew_w); + Skew_qw.set(tsign>sp(0.2) && tsign<=sp(0.4), (((sp(1.2)*Skew_w)/sp(0.2))*(tsign-sp(0.2)))); + + if (condition.any()) { + qw2_1.set(condition, + ekat::min(100, + ekat::max(0, (3*tmp_val_1*(1 - a*ekat::square(tmp_val_2) - (1 - a)*ekat::square(tmp_val_1)) + - (Skew_qw - a*ekat::cube(tmp_val_2) - (1 - a)*ekat::cube(tmp_val_1))) + /(3*a*(tmp_val_1 - tmp_val_2))))*qwsec); + qw2_2.set(condition, + ekat::min(100, + ekat::max(0, (-3*tmp_val_2*(1 - a*ekat::square(tmp_val_2) - (1 - a)*ekat::square(tmp_val_1)) + + (Skew_qw - a*ekat::cube(tmp_val_2) - (1 - a)*ekat::cube(tmp_val_1))) + /(3*(1 - a)*(tmp_val_1 - tmp_val_2))))*qwsec); + } + + qw1_1.set(condition, tmp_val_2*sqrtqt+qw_first); + qw1_2.set(condition, tmp_val_1*sqrtqt+qw_first); + + sqrtqw2_1.set(condition, ekat::sqrt(qw2_1)); + sqrtqw2_2.set(condition, ekat::sqrt(qw2_2)); +} + +} // namespace shoc +} // namespace scream + +#endif diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_thl_parameters_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_thl_parameters_impl.hpp new file mode 100644 index 00000000000..90d60e439b5 --- /dev/null +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_thl_parameters_impl.hpp @@ -0,0 +1,82 @@ +#ifndef SHOC_SHOC_ASSUMED_PDF_THL_PARAMETERS_IMPL_HPP +#define SHOC_SHOC_ASSUMED_PDF_THL_PARAMETERS_IMPL_HPP + +#include "shoc_functions.hpp" // for ETI only but harmless for GPU + +#include + +namespace scream { +namespace shoc { + +/* + * Implementation of shoc_assumed_pdf_thl_parameters. Clients should NOT + * #include this file, but include shoc_functions.hpp instead. + * + * Find parameters for thetal + */ + +template +KOKKOS_FUNCTION +void Functions::shoc_assumed_pdf_thl_parameters( + const Spack& wthlsec, + const Spack& sqrtw2, + const Spack& sqrtthl, + const Spack& thlsec, + const Spack& thl_first, + const Spack& w1_1, + const Spack& w1_2, + const Spack& Skew_w, + const Spack& a, + const Scalar thl_tol, + const Scalar w_thresh, + Spack& thl1_1, + Spack& thl1_2, + Spack& thl2_1, + Spack& thl2_2, + Spack& sqrtthl2_1, + Spack& sqrtthl2_2) +{ + thl1_1 = thl_first; + thl1_2 = thl_first; + thl2_1 = 0; + thl2_2 = 0; + sqrtthl2_1 = 0; + sqrtthl2_2 = 0; + + const Smask condition = thlsec > (thl_tol*thl_tol) && ekat::abs(w1_2 - w1_1) > w_thresh; + + const Spack corrtest1 = ekat::max(-1, ekat::min(1, wthlsec/(sqrtw2*sqrtthl))); + const Spack tmp_val_1(-corrtest1/w1_1), tmp_val_2(-corrtest1/w1_2); + + Spack Skew_thl(0); + if (SC::dothetal_skew == true) { + const auto tsign = ekat::abs(tmp_val_1 - tmp_val_2); + Skew_thl.set(tsign>sp(0.4), sp(1.2)*Skew_w); + Skew_thl.set(tsign>sp(0.2) && tsign<=sp(0.4), (((sp(1.2)*Skew_w)/sp(0.2))*(tsign-sp(0.2)))); + } + + if (condition.any()) { + thl2_1.set(condition, + ekat::min(100, + ekat::max(0, (3*tmp_val_1*(1 - a*ekat::square(tmp_val_2) - (1-a)*ekat::square(tmp_val_1)) + - (Skew_thl - a*ekat::cube(tmp_val_2) - (1 - a)*ekat::cube(tmp_val_1))) + /(3*a*(tmp_val_1 - tmp_val_2))))*thlsec); + thl2_2.set(condition, + ekat::min(100, + ekat::max(0, (-3*tmp_val_2*(1 - a*ekat::square(tmp_val_2) + - (1 - a)*ekat::square(tmp_val_1)) + + (Skew_thl - a*ekat::cube(tmp_val_2) - (1 - a)*ekat::cube(tmp_val_1))) + /(3*(1 - a)*(tmp_val_1 - tmp_val_2))))*thlsec); + + thl1_1.set(condition, tmp_val_2*sqrtthl+thl_first); + thl1_2.set(condition, tmp_val_1*sqrtthl+thl_first); + + sqrtthl2_1.set(condition, ekat::sqrt(thl2_1)); + sqrtthl2_2.set(condition, ekat::sqrt(thl2_2)); + } +} + +} // namespace shoc +} // namespace scream + +#endif diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_tilde_to_real_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_tilde_to_real_impl.hpp new file mode 100644 index 00000000000..2eaee89a72f --- /dev/null +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_tilde_to_real_impl.hpp @@ -0,0 +1,32 @@ +#ifndef SHOC_SHOC_ASSUMED_PDF_TILDE_TO_REAL_IMPL_HPP +#define SHOC_SHOC_ASSUMED_PDF_TILDE_TO_REAL_IMPL_HPP + +#include "shoc_functions.hpp" // for ETI only but harmless for GPU + +#include + +namespace scream { +namespace shoc { + +/* + * Implementation of shoc_assumed_pdf_tilde_to_real. Clients should NOT + * #include this file, but include shoc_functions.hpp instead. + * + * Convert tilde variables to "real" variables + */ + +template +KOKKOS_FUNCTION +void Functions::shoc_assumed_pdf_tilde_to_real( + const Spack& w_first, + const Spack& sqrtw2, + Spack& w1) +{ + w1 *= sqrtw2; + w1 += w_first; +} + +} // namespace shoc +} // namespace scream + +#endif diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_vv_parameters_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_vv_parameters_impl.hpp new file mode 100644 index 00000000000..601622ee0f4 --- /dev/null +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_vv_parameters_impl.hpp @@ -0,0 +1,61 @@ +#ifndef SHOC_SHOC_ASSUMED_PDF_VV_PARAMETERS_IMPL_HPP +#define SHOC_SHOC_ASSUMED_PDF_VV_PARAMETERS_IMPL_HPP + +#include "shoc_functions.hpp" // for ETI only but harmless for GPU + +#include + +namespace scream { +namespace shoc { + +/* + * Implementation of shoc shoc_assumed_pdf_vv_parameters. Clients should NOT + * #include this file, but include shoc_functions.hpp instead. + * + * Find parameters for vertical velocity + */ + +template +KOKKOS_FUNCTION +void Functions::shoc_assumed_pdf_vv_parameters( + const Spack& w_first, + const Spack& w_sec, + const Spack& w3var, + const Scalar w_tol_sqd, + Spack& Skew_w, + Spack& w1_1, + Spack& w1_2, + Spack& w2_1, + Spack& w2_2, + Spack& a) +{ + Skew_w = 0; + w1_1 = w_first; + w1_2 = w_first; + w2_1 = 0; + w2_2 = 0; + a = 0.5; + + const Smask condition = w_sec > w_tol_sqd; + + const Scalar tmp_val(0.4); + const Scalar one_m_tmp_val(1 - tmp_val); + const Scalar sqrtw2t(std::sqrt(1-tmp_val)); + + Skew_w.set(condition, w3var/ekat::sqrt(ekat::cube(w_sec))); + a.set(condition, + ekat::max(sp(0.01), + ekat::min(sp(0.99), + sp(0.5)*(1 - Skew_w*ekat::sqrt(1/(4*(one_m_tmp_val*one_m_tmp_val*one_m_tmp_val) + + ekat::square(Skew_w))))))); + + w1_1.set(condition, ekat::sqrt((1 - a)/a)*sqrtw2t); + w1_2.set(condition, -1*ekat::sqrt(a/(1 - a))*sqrtw2t); + w2_1.set(condition, tmp_val*w_sec); + w2_2.set(condition, tmp_val*w_sec); +} + +} // namespace shoc +} // namespace scream + +#endif diff --git a/components/eamxx/src/physics/shoc/shoc_functions.hpp b/components/eamxx/src/physics/shoc/shoc_functions.hpp index afb9f618d52..d3cd9192058 100644 --- a/components/eamxx/src/physics/shoc/shoc_functions.hpp +++ b/components/eamxx/src/physics/shoc/shoc_functions.hpp @@ -412,9 +412,9 @@ struct Functions #ifdef SCREAM_SMALL_KERNELS static void diag_second_shoc_moments_disp( const Int& shcol, const Int& nlev, const Int& nlevi, - const Scalar& thl2tune, - const Scalar& qw2tune, - const Scalar& qwthl2tune, + const Scalar& thl2tune, + const Scalar& qw2tune, + const Scalar& qwthl2tune, const Scalar& w2tune, const view_2d& thetal, const view_2d& qw, @@ -780,6 +780,154 @@ struct Functions const view_2d& shoc_ql2); #endif + KOKKOS_FUNCTION + static void shoc_assumed_pdf_compute_buoyancy_flux( + const Spack& wthlsec, + const Spack& wqwsec, + const Spack& pval, + const Spack& wqls, + Spack& wthv_sec); + + KOKKOS_FUNCTION + static void shoc_assumed_pdf_compute_cloud_liquid_variance( + const Spack& a, + const Spack& s1, + const Spack& ql1, + const Spack& C1, + const Spack& std_s1, + const Spack& s2, + const Spack& ql2, + const Spack& C2, + const Spack& std_s2, + const Spack& shoc_ql, + Spack& shoc_ql2); + + + KOKKOS_FUNCTION + static void shoc_assumed_pdf_compute_liquid_water_flux( + const Spack& a, + const Spack& w1_1, + const Spack& w_first, + const Spack& ql1, + const Spack& w1_2, + const Spack& ql2, + Spack& wqls); + + KOKKOS_FUNCTION + static void shoc_assumed_pdf_compute_qs( + const Spack& Tl1_1, + const Spack& Tl1_2, + const Spack& pval, + const Smask& active_entries, + Spack& qs1, + Spack& beta1, + Spack& qs2, + Spack& beta2); + + KOKKOS_FUNCTION + static void shoc_assumed_pdf_compute_s( + const Spack& qw1, + const Spack& qs, + const Spack& beta, + const Spack& pval, + const Spack& thl2, + const Spack& qw2, + const Spack& sqrtthl2, + const Spack& sqrtqw2, + const Spack& r_qwthl, + Spack& s, + Spack& std_s, + Spack& qn, + Spack& C); + + KOKKOS_FUNCTION + static void shoc_assumed_pdf_compute_sgs_liquid( + const Spack& a, + const Spack& ql1, + const Spack& ql2, + Spack& shoc_ql); + + KOKKOS_FUNCTION + static void shoc_assumed_pdf_compute_temperature( + const Spack& thl1, + const Spack& pval, + Spack& Tl1); + + KOKKOS_FUNCTION + static void shoc_assumed_pdf_inplume_correlations( + const Spack& sqrtqw2_1, + const Spack& sqrtthl2_1, + const Spack& a, + const Spack& sqrtqw2_2, + const Spack& sqrtthl2_2, + const Spack& qwthlsec, + const Spack& qw1_1, + const Spack& qw_first, + const Spack& thl1_1, + const Spack& thl_first, + const Spack& qw1_2, + const Spack& thl1_2, + Spack& r_qwthl_1); + + KOKKOS_FUNCTION + static void shoc_assumed_pdf_qw_parameters( + const Spack& wqwsec, + const Spack& sqrtw2, + const Spack& Skew_w, + const Spack& sqrtqt, + const Spack& qwsec, + const Spack& w1_2, + const Spack& w1_1, + const Spack& qw_first, + const Spack& a, + const Scalar rt_tol, + const Scalar w_thresh, + Spack& qw1_1, + Spack& qw1_2, + Spack& qw2_1, + Spack& qw2_2, + Spack& sqrtqw2_1, + Spack& sqrtqw2_2); + + KOKKOS_FUNCTION + static void shoc_assumed_pdf_thl_parameters( + const Spack& wthlsec, + const Spack& sqrtw2, + const Spack& sqrtthl, + const Spack& thlsec, + const Spack& thl_first, + const Spack& w1_1, + const Spack& w1_2, + const Spack& Skew_w, + const Spack& a, + const Scalar thl_tol, + const Scalar w_thresh, + Spack& thl1_1, + Spack& thl1_2, + Spack& thl2_1, + Spack& thl2_2, + Spack& sqrtthl2_1, + Spack& sqrtthl2_2); + + KOKKOS_FUNCTION + static void shoc_assumed_pdf_tilde_to_real( + const Spack& w_first, + const Spack& sqrtw2, + Spack& w1); + + KOKKOS_FUNCTION + static void shoc_assumed_pdf_vv_parameters( + const Spack& w_first, + const Spack& w_sec, + const Spack& w3var, + const Scalar w_tol_sqd, + Spack& Skew_w, + Spack& w1_1, + Spack& w1_2, + Spack& w2_1, + Spack& w2_2, + Spack& a); + KOKKOS_FUNCTION static void compute_shr_prod( const MemberType& team, @@ -1246,6 +1394,16 @@ struct Functions # include "shoc_update_prognostics_implicit_impl.hpp" # include "shoc_diag_third_shoc_moments_impl.hpp" # include "shoc_assumed_pdf_impl.hpp" +# include "shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp" +# include "shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp" +# include "shoc_assumed_pdf_compute_qs_impl.hpp" +# include "shoc_assumed_pdf_compute_s_impl.hpp" +# include "shoc_assumed_pdf_compute_sgs_liquid_impl.hpp" +# include "shoc_assumed_pdf_compute_temperature_impl.hpp" +# include "shoc_assumed_pdf_qw_parameters_impl.hpp" +# include "shoc_assumed_pdf_compute_s_impl.hpp" +# include "shoc_assumed_pdf_thl_parameters_impl.hpp" +# include "shoc_assumed_pdf_vv_parameters_impl.hpp" # include "shoc_adv_sgs_tke_impl.hpp" # include "shoc_compute_tmpi_impl.hpp" # include "shoc_integ_column_stability_impl.hpp" From 0a92aaaa9ca2333124a9b0b6452665b68a979f94 Mon Sep 17 00:00:00 2001 From: tcclevenger Date: Thu, 1 Aug 2024 16:01:07 -0600 Subject: [PATCH 2/3] GPU fixes: missing includes, and accessing constants on dev --- .../shoc/impl/shoc_assumed_pdf_compute_temperature_impl.hpp | 5 ++++- components/eamxx/src/physics/shoc/shoc_functions.hpp | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_temperature_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_temperature_impl.hpp index e857951c5f2..eb5f80c2d8f 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_temperature_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_temperature_impl.hpp @@ -20,7 +20,10 @@ void Functions::shoc_assumed_pdf_compute_temperature( const Spack& pval, Spack& Tl1) { - Tl1 = thl1/(ekat::pow(C::P0/pval,(C::Rair/C::CP))); + constexpr Scalar basepres = C::P0; + constexpr Scalar rair = C::Rair; + constexpr Scalar cp = C::CP; + Tl1 = thl1/(ekat::pow(basepres/pval,(rair/cp))); } } // namespace shoc diff --git a/components/eamxx/src/physics/shoc/shoc_functions.hpp b/components/eamxx/src/physics/shoc/shoc_functions.hpp index d3cd9192058..08a0d4976fe 100644 --- a/components/eamxx/src/physics/shoc/shoc_functions.hpp +++ b/components/eamxx/src/physics/shoc/shoc_functions.hpp @@ -1394,15 +1394,18 @@ struct Functions # include "shoc_update_prognostics_implicit_impl.hpp" # include "shoc_diag_third_shoc_moments_impl.hpp" # include "shoc_assumed_pdf_impl.hpp" +# include "shoc_assumed_pdf_compute_buoyancy_flux_impl.hpp" # include "shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp" # include "shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp" # include "shoc_assumed_pdf_compute_qs_impl.hpp" # include "shoc_assumed_pdf_compute_s_impl.hpp" # include "shoc_assumed_pdf_compute_sgs_liquid_impl.hpp" # include "shoc_assumed_pdf_compute_temperature_impl.hpp" +# include "shoc_assumed_pdf_inplume_correlations_impl.hpp" # include "shoc_assumed_pdf_qw_parameters_impl.hpp" # include "shoc_assumed_pdf_compute_s_impl.hpp" # include "shoc_assumed_pdf_thl_parameters_impl.hpp" +# include "shoc_assumed_pdf_tilde_to_real_impl.hpp" # include "shoc_assumed_pdf_vv_parameters_impl.hpp" # include "shoc_adv_sgs_tke_impl.hpp" # include "shoc_compute_tmpi_impl.hpp" From 26fab5c3448eb1864122add7572904794b139f88 Mon Sep 17 00:00:00 2001 From: tcclevenger Date: Thu, 1 Aug 2024 16:07:58 -0600 Subject: [PATCH 3/3] Use KOKKOS_INLINE_FUNCTION --- .../eamxx/src/physics/shoc/CMakeLists.txt | 12 ----- ...shoc_assumed_pdf_compute_buoyancy_flux.cpp | 14 ----- ...umed_pdf_compute_cloud_liquid_variance.cpp | 14 ----- ..._assumed_pdf_compute_liquid_water_flux.cpp | 14 ----- .../shoc/eti/shoc_assumed_pdf_compute_qs.cpp | 14 ----- .../shoc/eti/shoc_assumed_pdf_compute_s.cpp | 14 ----- .../shoc_assumed_pdf_compute_sgs_liquid.cpp | 14 ----- .../shoc_assumed_pdf_compute_temperature.cpp | 14 ----- .../shoc_assumed_pdf_inplume_correlations.cpp | 14 ----- .../eti/shoc_assumed_pdf_qw_parameters.cpp | 14 ----- .../eti/shoc_assumed_pdf_thl_parameters.cpp | 14 ----- .../eti/shoc_assumed_pdf_tilde_to_real.cpp | 14 ----- .../eti/shoc_assumed_pdf_vv_parameters.cpp | 14 ----- ...assumed_pdf_compute_buoyancy_flux_impl.hpp | 2 +- ...pdf_compute_cloud_liquid_variance_impl.hpp | 2 +- ...med_pdf_compute_liquid_water_flux_impl.hpp | 2 +- .../impl/shoc_assumed_pdf_compute_qs_impl.hpp | 2 +- .../impl/shoc_assumed_pdf_compute_s_impl.hpp | 2 +- ...oc_assumed_pdf_compute_sgs_liquid_impl.hpp | 2 +- ...c_assumed_pdf_compute_temperature_impl.hpp | 2 +- ..._assumed_pdf_inplume_correlations_impl.hpp | 2 +- .../shoc_assumed_pdf_qw_parameters_impl.hpp | 2 +- .../shoc_assumed_pdf_thl_parameters_impl.hpp | 2 +- .../shoc_assumed_pdf_tilde_to_real_impl.hpp | 2 +- .../shoc_assumed_pdf_vv_parameters_impl.hpp | 2 +- .../eamxx/src/physics/shoc/shoc_functions.hpp | 52 ++++++++++--------- 26 files changed, 39 insertions(+), 217 deletions(-) delete mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_buoyancy_flux.cpp delete mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_cloud_liquid_variance.cpp delete mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_liquid_water_flux.cpp delete mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_qs.cpp delete mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_s.cpp delete mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_sgs_liquid.cpp delete mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_temperature.cpp delete mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_inplume_correlations.cpp delete mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_qw_parameters.cpp delete mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_thl_parameters.cpp delete mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_tilde_to_real.cpp delete mode 100644 components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_vv_parameters.cpp diff --git a/components/eamxx/src/physics/shoc/CMakeLists.txt b/components/eamxx/src/physics/shoc/CMakeLists.txt index e6724622a92..891626b9d3d 100644 --- a/components/eamxx/src/physics/shoc/CMakeLists.txt +++ b/components/eamxx/src/physics/shoc/CMakeLists.txt @@ -25,18 +25,6 @@ if (NOT EAMXX_ENABLE_GPU) list(APPEND SHOC_SRCS eti/shoc_adv_sgs_tke.cpp eti/shoc_assumed_pdf.cpp - eti/shoc_assumed_pdf_compute_buoyancy_flux.cpp - eti/shoc_assumed_pdf_compute_cloud_liquid_variance.cpp - eti/shoc_assumed_pdf_compute_liquid_water_flux.cpp - eti/shoc_assumed_pdf_compute_qs.cpp - eti/shoc_assumed_pdf_compute_sgs_liquid.cpp - eti/shoc_assumed_pdf_compute_temperature.cpp - eti/shoc_assumed_pdf_inplume_correlations.cpp - eti/shoc_assumed_pdf_qw_parameters.cpp - eti/shoc_assumed_pdf_compute_s.cpp - eti/shoc_assumed_pdf_thl_parameters.cpp - eti/shoc_assumed_pdf_tilde_to_real.cpp - eti/shoc_assumed_pdf_vv_parameters.cpp eti/shoc_calc_shoc_varorcovar.cpp eti/shoc_calc_shoc_vertflux.cpp eti/shoc_check_length_scale_shoc_length.cpp diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_buoyancy_flux.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_buoyancy_flux.cpp deleted file mode 100644 index 4d38b8525dd..00000000000 --- a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_buoyancy_flux.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "shoc_assumed_pdf_compute_buoyancy_flux_impl.hpp" - -namespace scream { -namespace shoc { - -/* - * Explicit instantiation for doing shoc_assumed_pdf_compute_buoyancy_flux on Reals using the - * default device. - */ - -template struct Functions; - -} // namespace shoc -} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_cloud_liquid_variance.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_cloud_liquid_variance.cpp deleted file mode 100644 index eb83e209877..00000000000 --- a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_cloud_liquid_variance.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp" - -namespace scream { -namespace shoc { - -/* - * Explicit instantiation for doing shoc_assumed_pdf_compute_cloud_liquid_variance on Reals using the - * default device. - */ - -template struct Functions; - -} // namespace shoc -} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_liquid_water_flux.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_liquid_water_flux.cpp deleted file mode 100644 index d8f99806cf9..00000000000 --- a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_liquid_water_flux.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp" - -namespace scream { -namespace shoc { - -/* - * Explicit instantiation for doing shoc_assumed_pdf_compute_liquid_water_flux on Reals using the - * default device. - */ - -template struct Functions; - -} // namespace shoc -} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_qs.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_qs.cpp deleted file mode 100644 index fbac9733184..00000000000 --- a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_qs.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "shoc_assumed_pdf_compute_qs_impl.hpp" - -namespace scream { -namespace shoc { - -/* - * Explicit instantiation for doing shoc_assumed_pdf_compute_qs on Reals using the - * default device. - */ - -template struct Functions; - -} // namespace shoc -} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_s.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_s.cpp deleted file mode 100644 index b74ae269a76..00000000000 --- a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_s.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "shoc_assumed_pdf_compute_s_impl.hpp" - -namespace scream { -namespace shoc { - -/* - * Explicit instantiation for doing shoc_assumed_pdf_compute_s on Reals using the - * default device. - */ - -template struct Functions; - -} // namespace shoc -} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_sgs_liquid.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_sgs_liquid.cpp deleted file mode 100644 index d2c786e8836..00000000000 --- a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_sgs_liquid.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "shoc_assumed_pdf_compute_sgs_liquid_impl.hpp" - -namespace scream { -namespace shoc { - -/* - * Explicit instantiation for doing shoc_assumed_pdf_compute_sgs_liquid on Reals using the - * default device. - */ - -template struct Functions; - -} // namespace shoc -} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_temperature.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_temperature.cpp deleted file mode 100644 index 8fdf36d6408..00000000000 --- a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_compute_temperature.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "shoc_assumed_pdf_compute_temperature_impl.hpp" - -namespace scream { -namespace shoc { - -/* - * Explicit instantiation for doing shoc_assumed_pdf_compute_temperature on Reals using the - * default device. - */ - -template struct Functions; - -} // namespace shoc -} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_inplume_correlations.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_inplume_correlations.cpp deleted file mode 100644 index d29641dd73b..00000000000 --- a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_inplume_correlations.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "shoc_assumed_pdf_inplume_correlations_impl.hpp" - -namespace scream { -namespace shoc { - -/* - * Explicit instantiation for doing shoc_assumed_pdf_inplume_correlations on Reals using the - * default device. - */ - -template struct Functions; - -} // namespace shoc -} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_qw_parameters.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_qw_parameters.cpp deleted file mode 100644 index b9a9501b988..00000000000 --- a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_qw_parameters.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "shoc_assumed_pdf_qw_parameters_impl.hpp" - -namespace scream { -namespace shoc { - -/* - * Explicit instantiation for doing shoc_assumed_pdf_qw_parameters on Reals using the - * default device. - */ - -template struct Functions; - -} // namespace shoc -} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_thl_parameters.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_thl_parameters.cpp deleted file mode 100644 index 716fd7cd3d2..00000000000 --- a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_thl_parameters.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "shoc_assumed_pdf_thl_parameters_impl.hpp" - -namespace scream { -namespace shoc { - -/* - * Explicit instantiation for doing shoc_assumed_pdf_thl_parameters on Reals using the - * default device. - */ - -template struct Functions; - -} // namespace shoc -} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_tilde_to_real.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_tilde_to_real.cpp deleted file mode 100644 index 250e3f1a0a4..00000000000 --- a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_tilde_to_real.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "shoc_assumed_pdf_tilde_to_real_impl.hpp" - -namespace scream { -namespace shoc { - -/* - * Explicit instantiation for doing shoc_assumed_pdf_tilde_to_real on Reals using the - * default device. - */ - -template struct Functions; - -} // namespace shoc -} // namespace scream diff --git a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_vv_parameters.cpp b/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_vv_parameters.cpp deleted file mode 100644 index 2af26cfc1ad..00000000000 --- a/components/eamxx/src/physics/shoc/eti/shoc_assumed_pdf_vv_parameters.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "shoc_assumed_pdf_vv_parameters_impl.hpp" - -namespace scream { -namespace shoc { - -/* - * Explicit instantiation for doing shoc_assumed_pdf_vv_parameters on Reals using the - * default device. - */ - -template struct Functions; - -} // namespace shoc -} // namespace scream diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_buoyancy_flux_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_buoyancy_flux_impl.hpp index db31f1ab1bd..7a0633fe7f3 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_buoyancy_flux_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_buoyancy_flux_impl.hpp @@ -14,7 +14,7 @@ namespace shoc { */ template -KOKKOS_FUNCTION +KOKKOS_INLINE_FUNCTION void Functions::shoc_assumed_pdf_compute_buoyancy_flux( const Spack& wthlsec, const Spack& wqwsec, diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp index 06f740d6eb5..dac01954db3 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp @@ -14,7 +14,7 @@ namespace shoc { */ template -KOKKOS_FUNCTION +KOKKOS_INLINE_FUNCTION void Functions::shoc_assumed_pdf_compute_cloud_liquid_variance( const Spack& a, const Spack& s1, diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp index b225494e7b6..ceb64c533a3 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp @@ -14,7 +14,7 @@ namespace shoc { */ template -KOKKOS_FUNCTION +KOKKOS_INLINE_FUNCTION void Functions::shoc_assumed_pdf_compute_liquid_water_flux( const Spack& a, const Spack& w1_1, diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_qs_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_qs_impl.hpp index 3949f087bfe..867ffe3fed3 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_qs_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_qs_impl.hpp @@ -15,7 +15,7 @@ namespace shoc { */ template -KOKKOS_FUNCTION +KOKKOS_INLINE_FUNCTION void Functions::shoc_assumed_pdf_compute_qs( const Spack& Tl1_1, const Spack& Tl1_2, diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_s_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_s_impl.hpp index 180bf889d36..70fb386055a 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_s_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_s_impl.hpp @@ -14,7 +14,7 @@ namespace shoc { */ template -KOKKOS_FUNCTION +KOKKOS_INLINE_FUNCTION void Functions::shoc_assumed_pdf_compute_s( const Spack& qw1, const Spack& qs, diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_sgs_liquid_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_sgs_liquid_impl.hpp index cbc12f99a67..837fe90e299 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_sgs_liquid_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_sgs_liquid_impl.hpp @@ -14,7 +14,7 @@ namespace shoc { */ template -KOKKOS_FUNCTION +KOKKOS_INLINE_FUNCTION void Functions::shoc_assumed_pdf_compute_sgs_liquid( const Spack& a, const Spack& ql1, diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_temperature_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_temperature_impl.hpp index eb5f80c2d8f..e60a744ae93 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_temperature_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_compute_temperature_impl.hpp @@ -14,7 +14,7 @@ namespace shoc { */ template -KOKKOS_FUNCTION +KOKKOS_INLINE_FUNCTION void Functions::shoc_assumed_pdf_compute_temperature( const Spack& thl1, const Spack& pval, diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_inplume_correlations_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_inplume_correlations_impl.hpp index 52554ea9c98..600af5a6f51 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_inplume_correlations_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_inplume_correlations_impl.hpp @@ -16,7 +16,7 @@ namespace shoc { */ template -KOKKOS_FUNCTION +KOKKOS_INLINE_FUNCTION void Functions::shoc_assumed_pdf_inplume_correlations( const Spack& sqrtqw2_1, const Spack& sqrtthl2_1, diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_qw_parameters_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_qw_parameters_impl.hpp index 546be97f6fb..d4cb020a7fa 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_qw_parameters_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_qw_parameters_impl.hpp @@ -16,7 +16,7 @@ namespace shoc { */ template -KOKKOS_FUNCTION +KOKKOS_INLINE_FUNCTION void Functions::shoc_assumed_pdf_qw_parameters( const Spack& wqwsec, const Spack& sqrtw2, diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_thl_parameters_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_thl_parameters_impl.hpp index 90d60e439b5..686786d6fe2 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_thl_parameters_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_thl_parameters_impl.hpp @@ -16,7 +16,7 @@ namespace shoc { */ template -KOKKOS_FUNCTION +KOKKOS_INLINE_FUNCTION void Functions::shoc_assumed_pdf_thl_parameters( const Spack& wthlsec, const Spack& sqrtw2, diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_tilde_to_real_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_tilde_to_real_impl.hpp index 2eaee89a72f..e2de2705fb8 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_tilde_to_real_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_tilde_to_real_impl.hpp @@ -16,7 +16,7 @@ namespace shoc { */ template -KOKKOS_FUNCTION +KOKKOS_INLINE_FUNCTION void Functions::shoc_assumed_pdf_tilde_to_real( const Spack& w_first, const Spack& sqrtw2, diff --git a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_vv_parameters_impl.hpp b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_vv_parameters_impl.hpp index 601622ee0f4..6cd23756759 100644 --- a/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_vv_parameters_impl.hpp +++ b/components/eamxx/src/physics/shoc/impl/shoc_assumed_pdf_vv_parameters_impl.hpp @@ -16,7 +16,7 @@ namespace shoc { */ template -KOKKOS_FUNCTION +KOKKOS_INLINE_FUNCTION void Functions::shoc_assumed_pdf_vv_parameters( const Spack& w_first, const Spack& w_sec, diff --git a/components/eamxx/src/physics/shoc/shoc_functions.hpp b/components/eamxx/src/physics/shoc/shoc_functions.hpp index 08a0d4976fe..d1d547245b1 100644 --- a/components/eamxx/src/physics/shoc/shoc_functions.hpp +++ b/components/eamxx/src/physics/shoc/shoc_functions.hpp @@ -780,7 +780,7 @@ struct Functions const view_2d& shoc_ql2); #endif - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION static void shoc_assumed_pdf_compute_buoyancy_flux( const Spack& wthlsec, const Spack& wqwsec, @@ -788,7 +788,7 @@ struct Functions const Spack& wqls, Spack& wthv_sec); - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION static void shoc_assumed_pdf_compute_cloud_liquid_variance( const Spack& a, const Spack& s1, @@ -803,7 +803,7 @@ struct Functions Spack& shoc_ql2); - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION static void shoc_assumed_pdf_compute_liquid_water_flux( const Spack& a, const Spack& w1_1, @@ -813,7 +813,7 @@ struct Functions const Spack& ql2, Spack& wqls); - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION static void shoc_assumed_pdf_compute_qs( const Spack& Tl1_1, const Spack& Tl1_2, @@ -824,7 +824,7 @@ struct Functions Spack& qs2, Spack& beta2); - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION static void shoc_assumed_pdf_compute_s( const Spack& qw1, const Spack& qs, @@ -840,20 +840,20 @@ struct Functions Spack& qn, Spack& C); - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION static void shoc_assumed_pdf_compute_sgs_liquid( const Spack& a, const Spack& ql1, const Spack& ql2, Spack& shoc_ql); - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION static void shoc_assumed_pdf_compute_temperature( const Spack& thl1, const Spack& pval, Spack& Tl1); - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION static void shoc_assumed_pdf_inplume_correlations( const Spack& sqrtqw2_1, const Spack& sqrtthl2_1, @@ -869,7 +869,7 @@ struct Functions const Spack& thl1_2, Spack& r_qwthl_1); - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION static void shoc_assumed_pdf_qw_parameters( const Spack& wqwsec, const Spack& sqrtw2, @@ -889,7 +889,7 @@ struct Functions Spack& sqrtqw2_1, Spack& sqrtqw2_2); - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION static void shoc_assumed_pdf_thl_parameters( const Spack& wthlsec, const Spack& sqrtw2, @@ -909,13 +909,13 @@ struct Functions Spack& sqrtthl2_1, Spack& sqrtthl2_2); - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION static void shoc_assumed_pdf_tilde_to_real( const Spack& w_first, const Spack& sqrtw2, Spack& w1); - KOKKOS_FUNCTION + KOKKOS_INLINE_FUNCTION static void shoc_assumed_pdf_vv_parameters( const Spack& w_first, const Spack& w_sec, @@ -1394,19 +1394,6 @@ struct Functions # include "shoc_update_prognostics_implicit_impl.hpp" # include "shoc_diag_third_shoc_moments_impl.hpp" # include "shoc_assumed_pdf_impl.hpp" -# include "shoc_assumed_pdf_compute_buoyancy_flux_impl.hpp" -# include "shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp" -# include "shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp" -# include "shoc_assumed_pdf_compute_qs_impl.hpp" -# include "shoc_assumed_pdf_compute_s_impl.hpp" -# include "shoc_assumed_pdf_compute_sgs_liquid_impl.hpp" -# include "shoc_assumed_pdf_compute_temperature_impl.hpp" -# include "shoc_assumed_pdf_inplume_correlations_impl.hpp" -# include "shoc_assumed_pdf_qw_parameters_impl.hpp" -# include "shoc_assumed_pdf_compute_s_impl.hpp" -# include "shoc_assumed_pdf_thl_parameters_impl.hpp" -# include "shoc_assumed_pdf_tilde_to_real_impl.hpp" -# include "shoc_assumed_pdf_vv_parameters_impl.hpp" # include "shoc_adv_sgs_tke_impl.hpp" # include "shoc_compute_tmpi_impl.hpp" # include "shoc_integ_column_stability_impl.hpp" @@ -1425,4 +1412,19 @@ struct Functions #endif // GPU && !KOKKOS_ENABLE_*_RELOCATABLE_DEVICE_CODE +// Some functions should be inlined, thus do not use ETI +# include "shoc_assumed_pdf_compute_buoyancy_flux_impl.hpp" +# include "shoc_assumed_pdf_compute_cloud_liquid_variance_impl.hpp" +# include "shoc_assumed_pdf_compute_liquid_water_flux_impl.hpp" +# include "shoc_assumed_pdf_compute_qs_impl.hpp" +# include "shoc_assumed_pdf_compute_s_impl.hpp" +# include "shoc_assumed_pdf_compute_sgs_liquid_impl.hpp" +# include "shoc_assumed_pdf_compute_temperature_impl.hpp" +# include "shoc_assumed_pdf_inplume_correlations_impl.hpp" +# include "shoc_assumed_pdf_qw_parameters_impl.hpp" +# include "shoc_assumed_pdf_compute_s_impl.hpp" +# include "shoc_assumed_pdf_thl_parameters_impl.hpp" +# include "shoc_assumed_pdf_tilde_to_real_impl.hpp" +# include "shoc_assumed_pdf_vv_parameters_impl.hpp" + #endif // SHOC_FUNCTIONS_HPP