Skip to content

Commit

Permalink
Merge branch 'development' into pbl-doc-update
Browse files Browse the repository at this point in the history
  • Loading branch information
AMLattanzi authored Oct 3, 2023
2 parents 4400741 + 0598c89 commit cb7f1f9
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 82 deletions.
5 changes: 5 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# 23.10

-- First release since JOSS paper. Too many key ERF PRs to summarize.

-- AMReX submodule set to 23.10 release hash (388738d)
3 changes: 3 additions & 0 deletions Docs/sphinx_doc/GettingStarted.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ type:
git clone --recursive https://github.com/erf-model/ERF.git
.. include:: submodule.rst


.. include:: building.rst


Expand Down
22 changes: 22 additions & 0 deletions Docs/sphinx_doc/submodule.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.. _Submodule:

Git Submodules
--------------

When using the submodule to build, it is ideal to properly update and match what is in the repository. Depending on Git version, different commands and options to ensure these match. An example workflow is to run ``git pull`` to get the latest commit on your current branch, and then run ``git submodule update`` to explicitly update the submodule. This should work for all versions of ``git`` which support submodules.

The following example demonstrates a shorter form that combines both commands and requires Git 2.14 or newer:

.. code:: shell
# Replaces your git pull to use both the updated code and the updated submodule
git pull --recurse-submodules
The following example demonstrates setting defaults in the config file for the repository and requires Git 2.15 or newer:

.. code:: shell
# Set this once
git config submodule.recurse true
# When configured as true, this will use both the updated code and the updated submodule
git pull
# This option will override any configuration and not update the submodule
git pull --no-recurse-submodules
These example also apply to ``git checkout``. For more details see _`Git Tools Submodules`: https://git-scm.com/book/en/v2/Git-Tools-Submodules
18 changes: 9 additions & 9 deletions Source/BoundaryConditions/ABLMost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,35 @@ ABLMost::update_fluxes (int lev,
if (flux_type == FluxCalcType::MOENG) {
if (theta_type == ThetaCalcType::HEAT_FLUX) {
if (rough_type == RoughCalcType::CONSTANT) {
surface_flux most_flux(m_ma.get_zref(),surf_temp, surf_temp_flux);
surface_flux most_flux(m_ma.get_zref(), surf_temp_flux);
compute_fluxes(lev, max_iters, most_flux);
} else if (rough_type == RoughCalcType::CHARNOCK) {
surface_flux_charnock most_flux(m_ma.get_zref(),surf_temp, surf_temp_flux, cnk_a);
surface_flux_charnock most_flux(m_ma.get_zref(), surf_temp_flux, cnk_a);
compute_fluxes(lev, max_iters, most_flux);
} else {
surface_flux_mod_charnock most_flux(m_ma.get_zref(),surf_temp, surf_temp_flux, depth);
surface_flux_mod_charnock most_flux(m_ma.get_zref(), surf_temp_flux, depth);
compute_fluxes(lev, max_iters, most_flux);
}
} else if (theta_type == ThetaCalcType::SURFACE_TEMPERATURE) {
if (rough_type == RoughCalcType::CONSTANT) {
surface_temp most_flux(m_ma.get_zref(),surf_temp, surf_temp_flux);
surface_temp most_flux(m_ma.get_zref(), surf_temp_flux);
compute_fluxes(lev, max_iters, most_flux);
} else if (rough_type == RoughCalcType::CHARNOCK) {
surface_temp_charnock most_flux(m_ma.get_zref(),surf_temp, surf_temp_flux, cnk_a);
surface_temp_charnock most_flux(m_ma.get_zref(), surf_temp_flux, cnk_a);
compute_fluxes(lev, max_iters, most_flux);
} else {
surface_temp_mod_charnock most_flux(m_ma.get_zref(),surf_temp, surf_temp_flux, depth);
surface_temp_mod_charnock most_flux(m_ma.get_zref(), surf_temp_flux, depth);
compute_fluxes(lev, max_iters, most_flux);
}
} else {
if (rough_type == RoughCalcType::CONSTANT) {
adiabatic most_flux(m_ma.get_zref(),surf_temp, surf_temp_flux);
adiabatic most_flux(m_ma.get_zref(), surf_temp_flux);
compute_fluxes(lev, max_iters, most_flux);
} else if (rough_type == RoughCalcType::CHARNOCK) {
adiabatic_charnock most_flux(m_ma.get_zref(),surf_temp, surf_temp_flux, cnk_a);
adiabatic_charnock most_flux(m_ma.get_zref(), surf_temp_flux, cnk_a);
compute_fluxes(lev, max_iters, most_flux);
} else {
adiabatic_mod_charnock most_flux(m_ma.get_zref(),surf_temp, surf_temp_flux, depth);
adiabatic_mod_charnock most_flux(m_ma.get_zref(), surf_temp_flux, depth);
compute_fluxes(lev, max_iters, most_flux);
}
} // theta flux
Expand Down
29 changes: 5 additions & 24 deletions Source/BoundaryConditions/MOSTStress.H
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ public:
amrex::Real kappa{KAPPA}; ///< von Karman constant
amrex::Real gravity{CONST_GRAV}; ///< Acceleration due to gravity (m/s^2)
amrex::Real surf_temp_flux{0.0}; ///< Heat flux
amrex::Real surf_temp; ///< Surface temperature
amrex::Real Cnk_a{0.0185}; ///< Standard Charnock constant https://doi.org/10.1175/JAMC-D-17-0137.1
amrex::Real Cnk_b1{1.0/30.0}; ///< Modified Charnock Eq (4) https://doi.org/10.1175/JAMC-D-17-0137.1
amrex::Real Cnk_b2{1260.0}; ///< Modified Charnock Eq (4) https://doi.org/10.1175/JAMC-D-17-0137.1
Expand Down Expand Up @@ -70,11 +69,9 @@ private:
struct adiabatic
{
adiabatic (amrex::Real zref,
amrex::Real temp,
amrex::Real flux)
{
mdata.zref = zref;
mdata.surf_temp = temp;
mdata.surf_temp_flux = flux;
}

Expand Down Expand Up @@ -110,12 +107,10 @@ private:
struct adiabatic_charnock
{
adiabatic_charnock (amrex::Real zref,
amrex::Real temp,
amrex::Real flux,
amrex::Real cnk_a)
{
mdata.zref = zref;
mdata.surf_temp = temp;
mdata.surf_temp_flux = flux;
mdata.Cnk_a = cnk_a;
}
Expand Down Expand Up @@ -164,12 +159,10 @@ private:
struct adiabatic_mod_charnock
{
adiabatic_mod_charnock (amrex::Real zref,
amrex::Real temp,
amrex::Real flux,
amrex::Real depth)
{
mdata.zref = zref;
mdata.surf_temp = temp;
mdata.surf_temp_flux = flux;
mdata.Cnk_d = depth;
mdata.Cnk_b = mdata.Cnk_b1 * std::log(mdata.Cnk_b2 / mdata.Cnk_d);
Expand Down Expand Up @@ -219,11 +212,9 @@ private:
struct surface_flux
{
surface_flux (amrex::Real zref,
amrex::Real temp,
amrex::Real flux)
{
mdata.zref = zref;
mdata.surf_temp = temp;
mdata.surf_temp_flux = flux;
}

Expand Down Expand Up @@ -279,12 +270,10 @@ private:
struct surface_flux_charnock
{
surface_flux_charnock (amrex::Real zref,
amrex::Real temp,
amrex::Real flux,
amrex::Real cnk_a)
{
mdata.zref = zref;
mdata.surf_temp = temp;
mdata.surf_temp_flux = flux;
mdata.Cnk_a = cnk_a;
}
Expand Down Expand Up @@ -339,17 +328,15 @@ private:


/**
* Surface flux with charnock roughness
* Surface flux with modified charnock roughness
*/
struct surface_flux_mod_charnock
{
surface_flux_mod_charnock (amrex::Real zref,
amrex::Real temp,
amrex::Real flux,
amrex::Real depth)
{
mdata.zref = zref;
mdata.surf_temp = temp;
mdata.surf_temp_flux = flux;
mdata.Cnk_d = depth;
mdata.Cnk_b = mdata.Cnk_b1 * std::log(mdata.Cnk_b2 / mdata.Cnk_d);
Expand Down Expand Up @@ -410,11 +397,9 @@ private:
struct surface_temp
{
surface_temp (amrex::Real zref,
amrex::Real temp,
amrex::Real flux)
{
mdata.zref = zref;
mdata.surf_temp = temp;
mdata.surf_temp_flux = flux;
}

Expand Down Expand Up @@ -467,17 +452,15 @@ private:


/**
* Surface temperature with constant roughness
* Surface temperature with charnock roughness
*/
struct surface_temp_charnock
{
surface_temp_charnock (amrex::Real zref,
amrex::Real temp,
amrex::Real flux,
amrex::Real cnk_a)
{
mdata.zref = zref;
mdata.surf_temp = temp;
mdata.surf_temp_flux = flux;
mdata.Cnk_a = cnk_a;
}
Expand Down Expand Up @@ -534,17 +517,15 @@ private:


/**
* Surface temperature with constant roughness
* Surface temperature with modified charnock roughness
*/
struct surface_temp_mod_charnock
{
surface_temp_mod_charnock (amrex::Real zref,
amrex::Real temp,
amrex::Real flux,
amrex::Real depth)
{
mdata.zref = zref;
mdata.surf_temp = temp;
mdata.surf_temp_flux = flux;
mdata.Cnk_d = depth;
mdata.Cnk_b = mdata.Cnk_b1 * std::log(mdata.Cnk_b2 / mdata.Cnk_d);
Expand Down Expand Up @@ -606,7 +587,7 @@ private:
*/
struct moeng_flux
{
moeng_flux(int l_zlo,
moeng_flux (int l_zlo,
amrex::Real l_dz)
: zlo(l_zlo), dz(l_dz) {}

Expand Down Expand Up @@ -809,7 +790,7 @@ private:
*/
struct donelan_flux
{
donelan_flux(int l_zlo,
donelan_flux (int l_zlo,
amrex::Real l_dz)
: zlo(l_zlo), dz(l_dz) {}

Expand Down
4 changes: 2 additions & 2 deletions Source/ERF_Constants.H
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef _CONSTANTS_H_
#define _CONSTANTS_H_
#ifndef ERF_CONSTANTS_H_
#define ERF_CONSTANTS_H_

#include <AMReX_REAL.H>

Expand Down
4 changes: 2 additions & 2 deletions Source/IndexDefines.H
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#define PrimQt_comp (RhoQt_comp-1)
#define PrimQp_comp (RhoQp_comp-1)
#elif defined(ERF_USE_WARM_NO_PRECIP)
#define PrimQv_comp RhoQv_comp-1
#define PrimQc_comp RhoQc_comp-1
#define PrimQv_comp (RhoQv_comp-1)
#define PrimQc_comp (RhoQc_comp-1)
#endif
#define NUM_PRIM (NVAR-1)

Expand Down
2 changes: 1 addition & 1 deletion Source/Microphysics/Cloud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using namespace amrex;
/**
* Compute Cloud-related Microphysics quantities.
*/
void Microphysics::Cloud() {
void Microphysics::Cloud () {

constexpr Real an = 1.0/(tbgmax-tbgmin);
constexpr Real bn = tbgmin*an;
Expand Down
4 changes: 2 additions & 2 deletions Source/Microphysics/Diagnose.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* Computes diagnostic quantities like cloud ice/liquid and precipitation ice/liquid
* from the existing Microphysics variables.
*/
void Microphysics::Diagnose() {
void Microphysics::Diagnose () {

auto qt = mic_fab_vars[MicVar::qt];
auto qp = mic_fab_vars[MicVar::qp];
Expand Down Expand Up @@ -44,7 +44,7 @@ void Microphysics::Diagnose() {
/**
* Wrapper for the PrecipFall, Cloud, Precipitation, and Diagnostics routines.
*/
void Microphysics::Proc() {
void Microphysics::Proc () {

MicroPrecipFall();

Expand Down
2 changes: 1 addition & 1 deletion Source/Microphysics/IceFall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ using namespace amrex;
/**
* Computes contributions to Microphysics and thermodynamic variables from falling cloud ice in each column.
*/
void Microphysics::IceFall() {
void Microphysics::IceFall () {

Real dz = m_geom.CellSize(2);
Real dtn = dt;
Expand Down
8 changes: 4 additions & 4 deletions Source/Microphysics/Init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ using namespace amrex;
* @param[in] geom Geometry associated with these MultiFabs and grids
* @param[in] dt_advance Timestep for the advance
*/
void Microphysics::Init(const MultiFab& cons_in, MultiFab& qmoist,
const BoxArray& grids_to_evolve,
const Geometry& geom,
const Real& dt_advance)
void Microphysics::Init (const MultiFab& cons_in, MultiFab& qmoist,
const BoxArray& grids_to_evolve,
const Geometry& geom,
const Real& dt_advance)
{
m_geom = geom;
m_gtoe = grids_to_evolve;
Expand Down
34 changes: 17 additions & 17 deletions Source/Microphysics/Microphysics.H
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ class Microphysics {

public:
// constructor
Microphysics() {}
Microphysics () {}

// Set up for first time
void define(SolverChoice& sc)
void define (SolverChoice& sc)
{
docloud = sc.do_cloud;
doprecip = sc.do_precip;
Expand All @@ -70,39 +70,39 @@ class Microphysics {
}

// destructor
~Microphysics() = default;
~Microphysics () = default;

// cloud physics
void Cloud();
void Cloud ();

// ice physics
void IceFall();
void IceFall ();

// precip
void Precip();
void Precip ();

// precip fall
void PrecipFall(int hydro_type);
void PrecipFall (int hydro_type);

// micro interface for precip fall
void MicroPrecipFall();
void MicroPrecipFall ();

// init
void Init(const amrex::MultiFab& cons_in,
amrex::MultiFab& qmoist,
const amrex::BoxArray& grids_to_evolve,
const amrex::Geometry& geom,
const amrex::Real& dt_advance);
void Init (const amrex::MultiFab& cons_in,
amrex::MultiFab& qmoist,
const amrex::BoxArray& grids_to_evolve,
const amrex::Geometry& geom,
const amrex::Real& dt_advance);

// update ERF variables
void Update(amrex::MultiFab& cons_in,
amrex::MultiFab& qmoist);
void Update (amrex::MultiFab& cons_in,
amrex::MultiFab& qmoist);

// diagnose
void Diagnose();
void Diagnose ();

// process microphysics
void Proc();
void Proc ();

private:
// geometry
Expand Down
Loading

0 comments on commit cb7f1f9

Please sign in to comment.