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

Remove large droplets #418

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
fd19579
get rid of n_user_params, separate vector for coll_eff
pdziekan Jun 21, 2017
51e8b39
some fixes to kernel efficisencies
pdziekan Jun 21, 2017
086384d
rad-rat kernel interpolation, use it in all kernels, only hall will w…
pdziekan Jun 22, 2017
4deea80
add a swtorage of old (Jon's) kernel definitions
pdziekan Jun 22, 2017
df4732f
add hall+davis no waals with EFM-like definition
pdziekan Jun 22, 2017
e9af6c2
coal scale factor fix: do not round the numerator
pdziekan Jun 28, 2017
c92b052
Merge branch 'coal_scale_factor_fix' into kernel_efficiencies_fix
pdziekan Jun 28, 2017
8bb3ce1
Revert "coal scale factor fix: do not round the numerator"
pdziekan Jun 28, 2017
d584e88
do not radrat interpolate if r1==r2
pdziekan Jun 29, 2017
ccafe5d
fix radrat interpolation
pdziekan Jun 29, 2017
86ba7b8
rename kernel_def_old to kernel_def_old
pdziekan Jun 29, 2017
a45939f
hall eff table exactly like in the paper, retain eff tables similar t…
pdziekan Jun 29, 2017
6ccf6d4
Merge branch 'kernel_efficiencies_fix' of https://github.com/pdziekan…
pdziekan Jun 30, 2017
b8a7ee7
add diag_sstp_coal
pdziekan Jan 13, 2021
e574e2a
fix diag_sstp_coal definition in multi CUDa
pdziekan Jan 13, 2021
202b01b
implement remove_wet_rng (no test nor Python binding yet)
pdziekan Jan 14, 2021
287f5d0
Merge branch 'diag_sstp_coal' into remove_large_droplets
pdziekan Jan 14, 2021
40588bc
include particles_remove
pdziekan Jan 14, 2021
0487393
Merge branch 'master' into kernel_efficiencies_fix
pdziekan Jan 18, 2021
5dff736
kernel with eff - add default ctor
pdziekan Jan 18, 2021
4d6893f
Merge remote-tracking branch 'origin/kernel_efficiencies_fix' into re…
pdziekan Jan 18, 2021
f9e5b60
move ctor for arrinfo
pdziekan Jan 21, 2021
d108019
Merge remote-tracking branch 'origin/arrinfo_move_ctor' into remove_l…
pdziekan Jan 21, 2021
f2c8f0e
hall efficiencies like in EFM
pdziekan Jan 21, 2021
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
7 changes: 7 additions & 0 deletions include/libcloudph++/lgrngn/arrinfo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ namespace libcloudphxx
data(ai.data),
strides(!strvec.empty() ? &strvec[0] : ai.strides)
{}

// non-default move ctor handling both the original and alternative usage
arrinfo_t(arrinfo_t &&ai) :
strvec(std::move(ai.strvec)),
data(ai.data),
strides(!strvec.empty() ? &strvec[0] : ai.strides)
{}
};
};
};
12 changes: 10 additions & 2 deletions include/libcloudph++/lgrngn/particles.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,12 @@ namespace libcloudphxx
virtual void diag_incloud_time_mom(const int&) { assert(false); } // requires opts_init.diag_incloud_time==true
virtual void diag_max_rw() { assert(false); }
virtual void diag_vel_div() { assert(false); }
virtual int diag_sstp_coal() { assert(false); }
virtual std::map<libcloudphxx::common::output_t, real_t> diag_puddle() { assert(false); return std::map<libcloudphxx::common::output_t, real_t>(); }
virtual real_t *outbuf() { assert(false); return NULL; }

virtual void remove_wet_rng(const real_t&, const real_t&) { assert(false); }

// storing a pointer to opts_init (e.g. for interrogatin about
// dimensions in Python bindings)
opts_init_t<real_t> *opts_init;
Expand Down Expand Up @@ -197,9 +200,12 @@ namespace libcloudphxx
void diag_precip_rate();
void diag_max_rw();
void diag_vel_div();
int diag_sstp_coal();
std::map<libcloudphxx::common::output_t, real_t> diag_puddle();
real_t *outbuf();

void remove_wet_rng(const real_t&, const real_t&);

struct impl;
std::unique_ptr<impl> pimpl;

Expand Down Expand Up @@ -285,16 +291,18 @@ namespace libcloudphxx
void diag_wp_mom(const int&);
void diag_incloud_time_mom(const int&);
void diag_wet_mass_dens(const real_t&, const real_t&);
real_t *outbuf();

void diag_chem(const enum common::chem::chem_species_t&);
void diag_rw_ge_rc();
void diag_RH_ge_Sc();
void diag_all();
void diag_precip_rate();
void diag_max_rw();
void diag_vel_div();
int diag_sstp_coal();
std::map<libcloudphxx::common::output_t, real_t> diag_puddle();
real_t *outbuf();

void remove_wet_rng(const real_t&, const real_t&);

struct impl;
std::unique_ptr<impl> pimpl;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#pragma once
namespace libcloudphxx
{
namespace lgrngn
{
namespace detail
{
template<class real_t>
real_t hall_davis_no_waals_r_max()
{
return 300.e-6; // not used??
}

const int hall_davis_no_waals_n_rad = 15;
const int hall_davis_no_waals_n_rat = 21;

template<class real_t>
void hall_davis_no_waals_efficiencies(std::vector<real_t> &vec)
{
//NVCC doesn't support extended initializer list. First make an array, then copy it to a vector.
const real_t arr[hall_davis_no_waals_n_rat][hall_davis_no_waals_n_rad] =
{
{0, 0, 0, 0, 0,
0, 0, 0, 0, 0,
0, 0, 0, 0, 0},
{0, 0, 0, 0, 0,
0, 0, 0.001, 0.084, 0.05,
0.2543, 0.5, 0.7807, 0.87, 0.97},
{0, 0, 0, 0, 0,
0, 0, 0.07, 0.4, 0.43,
0.58, 0.79, 0.93, 0.96, 1},
{0, 0, 0, 0, 0,
0, 0, 0.28, 0.62, 0.64,
0.7629, 0.91, 0.9687, 0.98, 1},
{0, 0.01215, 0, 0, 0,
0, 0, 0.5, 0.7, 0.77,
0.84, 0.95, 0.95, 1, 1},
{0.01122, 0.01215, 0.01742, 0.0209, 0.02843,
0, 0.1357, 0.62, 0.79, 0.84,
0.8829, 0.95, 1, 1, 1},
{0.01122, 0.01215, 0.01742, 0.0261, 0.0341,
0.08008, 0.1807, 0.68, 0.83, 0.87,
0.9, 1, 1, 1, 1},
{0.01122, 0.01641, 0.02219, 0.0261, 0.03975,
0.09509, 0.2707, 0.74, 0.864, 0.89,
0.9229, 1, 1, 1, 1},
{0.01122, 0.01641, 0.02219, 0.03131, 0.04541,
0.1101, 0.3157, 0.78, 0.88, 0.9,
0.94, 1, 1, 1, 1},
{0.01503, 0.02067, 0.02696, 0.03651, 0.05107,
0.1251, 0.4057, 0.8, 0.9, 0.91,
0.95, 1, 1, 1, 1},
{0.01503, 0.02067, 0.02696, 0.03822, 0.05673,
0.143, 0.4507, 0.8, 0.9, 0.91,
0.95, 1, 1, 1, 1},
{0.01503, 0.02067, 0.02696, 0.03822, 0.05381,
0.1336, 0.39, 0.8, 0.9, 0.91,
0.95, 1, 1, 1, 1},
{0.02, 0.02264, 0.02696, 0.03644, 0.05089,
0.1242, 0.3597, 0.78, 0.9, 0.91,
0.95, 1, 1, 1, 1},
{0.02, 0.02264, 0.02696, 0.03466, 0.04797,
0.1148, 0.299, 0.77, 0.888, 0.91,
0.95, 1, 1, 1, 1},
{0.02, 0.0246, 0.02696, 0.03288, 0.04504,
0.09603, 0.2687, 0.76, 0.88, 0.92,
0.95, 1, 1, 1, 1},
{0.02497, 0.0246, 0.02696, 0.03288, 0.04212,
0.08665, 0.2081, 0.77, 0.882, 0.93,
0.9743, 1, 1, 1, 1},
{0.02497, 0.0246, 0.02696, 0.0311, 0.0392,
0.07726, 0.1778, 0.77, 0.89, 0.95,
1, 1, 1, 1, 1},
{0.02497, 0.02657, 0.02696, 0.02932, 0.03627,
0.06788, 0.1171, 0.78, 0.938, 1,
1.023, 1, 1, 1, 1},
{0.02497, 0.02657, 0.02696, 0.02843, 0.03335,
0.0538, 0.08679, 0.79, 1.01, 1.03,
1.04, 1, 1, 1, 1},
{0.02696, 0.02696, 0.02696, 0.02843, 0.03335,
0.0538, 0.08679, 0.95, 1.5, 1.7,
2.543, 1, 1, 1, 1},
{0.02696, 0.02696, 0.02696, 0.02843, 0.03335,
0.0538, 0.08679, 1.4, 2.3, 3,
4, 1, 1, 1, 1}
};

vec = std::vector<real_t>(&(arr[0][0]), &(arr[hall_davis_no_waals_n_rat][hall_davis_no_waals_n_rad]));
}

template<class real_t>
void hall_davis_no_waals_radii(std::vector<real_t> &vec)
{
//NVCC doesn't support extended initializer list. First make an array, then copy it to a vector.
const real_t arr[hall_davis_no_waals_n_rad] = {6.e-6,8.e-6,10.e-6,15.e-6,20.e-6,25.e-6,30.e-6,40.e-6,50.e-6,60.e-6,70.e-6,100.e-6,150.e-6,200.e-6,300.e-6};

vec = std::vector<real_t>(arr, arr + hall_davis_no_waals_n_rad );
}

template<class real_t>
void hall_davis_no_waals_ratios(std::vector<real_t> &vec)
{
//NVCC doesn't support extended initializer list. First make an array, then copy it to a vector.
const real_t arr[hall_davis_no_waals_n_rat] = {0.,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5, 0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0};

vec = std::vector<real_t>(arr, arr + hall_davis_no_waals_n_rat );
}
}
}
}
Loading