Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developed Peters et al. 2022 lifter #17

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d42432d
Initial commit for Peters et al 2022 Lifter
a-urq Apr 23, 2024
e0d72b2
Started work on the Peters et al 2022 lifter code; dry lift lapse rat…
a-urq Jun 12, 2024
f452b43
Fixed errors in design of dry_adiabat_peters_et_al
a-urq Jun 12, 2024
43ae63f
Added code for entrainment rate determination
a-urq Jun 15, 2024
fdd27ee
Added saturated adiabatic lapse rate code to thermo.cpp
a-urq Jun 15, 2024
2ed5d08
Added functions for profile setting and entrainment rate determinatio…
a-urq Jun 15, 2024
7e60e5e
Fixed a whole bunch of compile errors, which necessitated some rearra…
a-urq Jun 15, 2024
5f7f16b
Moved lifters to their own file <lifters.h>. This avoids the circular…
a-urq Jun 15, 2024
fc7faca
Quickly fixed compile error in test_parcel.cpp
a-urq Jun 15, 2024
71b8871
Finished writing Peters/ECAPE lifter, still needs to be tested.
a-urq Jun 17, 2024
e5b33a8
Started testing/debugging. Beware, there are std::couts littered ever…
a-urq Jun 18, 2024
eedc7a5
Peters lifter is looking good! Need to do further testing to confirm …
a-urq Jun 20, 2024
5f7162e
Added .vscode to git ignore
a-urq Jun 20, 2024
8e0de96
Added .vscode to git ignore
a-urq Jun 20, 2024
717b00f
Delete .vscode directory
a-urq Jun 20, 2024
72d3057
Fixed a lot of things in thermo::entrainment_cape and added printout …
a-urq Jun 21, 2024
59a038a
Merge branch 'develop-peters-lifter' of github.com:a-urq/SHARPlib int…
a-urq Jun 21, 2024
cdb7544
Testing and debugging completed. A few alterations remain before the …
a-urq Jun 24, 2024
24be25c
Testing and cleanup finalized.
a-urq Jun 25, 2024
d9cbed8
Delete .cproject from Eclipse IDE
a-urq Jun 25, 2024
6432c7e
Delete .project from Eclipse IDE
a-urq Jun 25, 2024
ea8104a
Removed build artifacts from ./examples/C++
a-urq Jul 4, 2024
748b078
Merge branch 'develop-peters-lifter' of github.com:a-urq/SHARPlib int…
a-urq Jul 4, 2024
ee84190
Added lifters.h to SHARPlib.h
a-urq Aug 23, 2024
d756c21
Added lifters.h to SHARPlib.h and removed compile artifacts
a-urq Aug 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,6 @@ swig/nwsspc/sharp/calc/parcel.py
swig/nwsspc/sharp/calc/profile.py
swig/nwsspc/sharp/calc/thermo.py
swig/nwsspc/sharp/calc/winds.py

# Ignore VSCode folder
.vscode/
21 changes: 20 additions & 1 deletion examples/C++/main.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

#include <SHARPlib/constants.h>
#include <SHARPlib/params/convective.h>
#include <SHARPlib/layer.h>
#include <SHARPlib/lifters.h>
#include <SHARPlib/parcel.h>
#include <SHARPlib/profile.h>
#include <SHARPlib/thermo.h>
Expand Down Expand Up @@ -50,6 +52,8 @@ void build_profile(sharp::Profile* prof, std::vector<std::string>& row,
prof->vtmp[idx] = sharp::virtual_temperature(tmpk, prof->mixr[idx]);
prof->theta[idx] = sharp::theta(pres, tmpk, sharp::THETA_REF_PRESSURE);
prof->theta_e[idx] = sharp::thetae(pres, tmpk, dwpk);
prof->moist_static_energy[idx] = sharp::moist_static_energy(hght - prof->hght[0], tmpk,
sharp::specific_humidity(sharp::mixratio(pres, dwpk)));

sharp::WindComponents uv = sharp::vector_to_components(wspd, wdir);

Expand Down Expand Up @@ -132,7 +136,20 @@ int main(int argc, char* argv[]) {
sharp::Profile* prof = read_sounding(snd_file1);

if (prof) {
static constexpr sharp::lifter_wobus lifter;
std::cout << "Using Peters lifter (irrev-adiabatic, auto entrainment)" << std::endl;

// static sharp::lifter_wobus lifter;

// static sharp::lifter_cm1 lifter;

static sharp::lifter_peters_et_al lifter;

lifter.ma_type = sharp::ascent_type::adiab_entr;
lifter.set_profile(prof);
lifter.determine_entrainment_rate(prof, sharp::LPL::MU);

std::cout << "Using entrainment rate: " << 1000.0 * lifter.entr_rate << " km^-1" << std::endl;

sharp::Parcel sfc_pcl;
sharp::Parcel mu_pcl;
sharp::Parcel ml_pcl;
Expand Down Expand Up @@ -193,3 +210,5 @@ int main(int argc, char* argv[]) {

delete prof;
}


1 change: 1 addition & 0 deletions include/SHARPlib/SHARPlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <SHARPlib/constants.h>
#include <SHARPlib/interp.h>
#include <SHARPlib/layer.h>
#include <SHARPlib/lifters.h>
#include <SHARPlib/params/convective.h>
#include <SHARPlib/parcel.h>
#include <SHARPlib/profile.h>
Expand Down
5 changes: 5 additions & 0 deletions include/SHARPlib/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@ static constexpr float EXP_LV = 2.501e6f;
// Latent heat of sublimation of water
// ice (J/kg) at triple point temperature
static constexpr float EXP_LS = 2.836017e6f;
// Latent heat of freezing of water
// ice (J/kg) at triple point temperature
static constexpr float EXP_LF = EXP_LS - EXP_LV;
// triple point temperature, same as ZEROCNK but labeled different for clarity
static constexpr float T_TRIP = 273.15f;

// Some microphysics stuff I don't quite understand, but I think
// It's meant to help with a more accurate, temperature-dependent
Expand Down
Loading