Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions include/libcloudph++/lgrngn/opts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace libcloudphxx
struct opts_t
{
// process toggling
bool adve, sedi, subs, cond, coal, src, rlx, rcyc, turb_adve, turb_cond, turb_coal, ice_nucl;
bool adve, sedi, subs, cond, coal, src, rlx, rcyc, turb_adve, turb_cond, turb_coal, ice_nucl, depo;

// RH limit for drop growth
real_t RH_max;
Expand All @@ -42,7 +42,7 @@ namespace libcloudphxx
opts_t() :
adve(true), sedi(true), subs(false), cond(true), coal(true), src(false), rlx(false), rcyc(false),
chem_dsl(false), chem_dsc(false), chem_rct(false),
turb_adve(false), turb_cond(false), turb_coal(false), ice_nucl(false),
turb_adve(false), turb_cond(false), turb_coal(false), ice_nucl(false), depo(false),
RH_max(44), // :) (anything greater than 1.1 would be enough
dt(-1) // negative means that we do not override dt in this step
{
Expand Down
2 changes: 1 addition & 1 deletion include/libcloudph++/lgrngn/opts_init.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ namespace libcloudphxx
// super-droplet advection scheme
as_t adve_scheme;

// RH formula
// RH formula, for ice, pv_tet and rv_tet work as pv_cc and rv_cc, respectively, because there is no Tetens formula for ice
RH_formula_t RH_formula;
//</listing>

Expand Down
6 changes: 3 additions & 3 deletions src/impl/common/calc_liq_ice_content_change.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace libcloudphxx

if(opts_init.ice_switch)
{
thrust_device::vector<real_t> &d_ice_mass = d_ice_mass_gp->get();
thrust_device::vector<real_t> &d_ice_mass_percell = d_ice_mass_percell_gp->get();

moms_gt0(ice_a.begin()); // choose ice particles (ice_a>0)
moms_calc(thrust::make_transform_iterator(
Expand All @@ -40,8 +40,8 @@ namespace libcloudphxx

thrust::transform(
count_mom.begin(), count_mom.begin() + count_n, // input - 1st arg
thrust::make_permutation_iterator(d_ice_mass.begin(), count_ijk.begin()), // 2nd arg
thrust::make_permutation_iterator(d_ice_mass.begin(), count_ijk.begin()), // output
thrust::make_permutation_iterator(d_ice_mass_percell.begin(), count_ijk.begin()), // 2nd arg
thrust::make_permutation_iterator(d_ice_mass_percell.begin(), count_ijk.begin()), // output
thrust::plus<real_t>()
);
}
Expand Down
22 changes: 11 additions & 11 deletions src/impl/common/particles_impl_update_th_rv.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,15 @@ namespace libcloudphxx
// else if (phase == phase_change::deposition)
// if(opts_init.ice_switch) // TODO: call update_th_rv once per cond/depo
// {
// thrust_device::vector<real_t> &d_ice_mass = d_ice_mass_gp->get();
// nancheck(d_ice_mass, "update_th_rv: input d_ice_mass");
// thrust_device::vector<real_t> &d_ice_mass_percell = d_ice_mass_percell_gp->get();
// nancheck(d_ice_mass_percell, "update_th_rv: input d_ice_mass_percell");

// thrust::transform(
// d_ice_mass.begin(), d_ice_mass.end(), // input - 1st arg
// d_ice_mass_percell.begin(), d_ice_mass_percell.end(), // input - 1st arg
// thrust::make_constant_iterator<real_t>( // input - 2nd arg
// - real_t(1)
// ),
// d_ice_mass.begin(), // output
// d_ice_mass_percell.begin(), // output
// thrust::multiplies<real_t>()
// );
// }
Expand All @@ -130,12 +130,12 @@ namespace libcloudphxx

if(opts_init.ice_switch)
{
thrust_device::vector<real_t> &d_ice_mass = d_ice_mass_gp->get();
nancheck(d_ice_mass, "update_th_rv: input d_ice_mass");
thrust_device::vector<real_t> &d_ice_mass_percell = d_ice_mass_percell_gp->get();
nancheck(d_ice_mass_percell, "update_th_rv: input d_ice_mass_percell");

thrust::transform(
rv.begin(), rv.end(), // input - 1st arg
d_ice_mass.begin(), // input - 2nd arg
d_ice_mass_percell.begin(), // input - 2nd arg
rv.begin(), // output
thrust::minus<real_t>()
);
Expand Down Expand Up @@ -170,13 +170,13 @@ namespace libcloudphxx
// else if (phase == phase_change::deposition)
if(opts_init.ice_switch)
{
thrust_device::vector<real_t> &d_ice_mass = d_ice_mass_gp->get();
thrust_device::vector<real_t> &d_ice_mass_percell = d_ice_mass_percell_gp->get();
thrust::transform(
th.begin(), th.end(), // input - 1st arg
thrust::make_transform_iterator(
zip_it_t(thrust::make_tuple(
d_ice_mass.begin(), //
T.begin(), // dth = d_ice_mass * d_th_d_rv(T, th)
d_ice_mass_percell.begin(), //
T.begin(), // dth = d_ice_mass_percell * d_th_d_rv(T, th)
th.begin() //
)),
detail::dth_dep<real_t>()
Expand All @@ -186,7 +186,7 @@ namespace libcloudphxx
);
}
drw_mom3_gp.reset(); // destroy guard to tmp array that stored change in 3rd moment of rw
d_ice_mass_gp.reset(); // destroy guard to tmp array that stored change in 3rd moment of rw
d_ice_mass_percell_gp.reset(); // destroy guard to tmp array that stored change in 3rd moment of rw
nancheck(th, "update_th_rv: th after update");
}

Expand Down
8 changes: 4 additions & 4 deletions src/impl/common/save_liq_ice_content_before_change.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ namespace libcloudphxx

if(opts_init.ice_switch)
{
reset_guardp(d_ice_mass_gp, tmp_device_real_cell);
thrust_device::vector<real_t> &d_ice_mass = d_ice_mass_gp->get();
reset_guardp(d_ice_mass_percell_gp, tmp_device_real_cell);
thrust_device::vector<real_t> &d_ice_mass_percell = d_ice_mass_percell_gp->get();

moms_gt0(ice_a.begin()); // choose ice particles (ice_a>0)
moms_calc(thrust::make_transform_iterator(
Expand All @@ -46,13 +46,13 @@ namespace libcloudphxx

// fill with 0s if not all cells have particles
if(count_n!=n_cell) {
thrust::fill(d_ice_mass.begin(), d_ice_mass.end(), real_t(0.));
thrust::fill(d_ice_mass_percell.begin(), d_ice_mass_percell.end(), real_t(0.));
// thrust::fill(ice_mass.begin(), ice_mass.end(), real_t(0.));
}

thrust::transform(
count_mom.begin(), count_mom.begin() + count_n,
thrust::make_permutation_iterator(d_ice_mass.begin(), count_ijk.begin()),
thrust::make_permutation_iterator(d_ice_mass_percell.begin(), count_ijk.begin()),
thrust::negate<real_t>()
);
}
Expand Down

This file was deleted.

128 changes: 0 additions & 128 deletions src/impl/condensation/perparticle/cond_perparticle_advance_rw2.ipp

This file was deleted.

Loading
Loading