Skip to content

Commit

Permalink
rhs_cellwise_nwtrhp_ice function
Browse files Browse the repository at this point in the history
  • Loading branch information
AgnieszkaMakulska committed Oct 29, 2024
1 parent 54512a8 commit 9ae4f96
Show file tree
Hide file tree
Showing 6 changed files with 184 additions and 153 deletions.
79 changes: 39 additions & 40 deletions bindings/python/blk_1m.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,48 +121,47 @@ namespace libcloudphxx
np2bz<arr_t>(rr)
);
}

template <class arr_t>
void rhs_cellwise_ice(
const b1m::opts_t<typename arr_t::T_numtype> &opts,
bp_array &dot_rc,
bp_array &dot_rr,
bp_array &dot_rv,
bp_array &dot_ria,
const bp_array &rc,
const bp_array &rr,
const bp_array &rv,
const bp_array &ria,
const bp_array &theta,
const bp_array &p,
const bp_array &rhod,
const typename arr_t::T_numtype &dt
)

template <class arr_t>
void rhs_cellwise_nwtrph(
const b1m::opts_t<typename arr_t::T_numtype> &opts,
bp_array &dot_th,
bp_array &dot_rv,
bp_array &dot_rc,
bp_array &dot_rr,
const bp_array &rhod,
const bp_array &p,
const bp_array &th,
const bp_array &rv,
const bp_array &rc,
const bp_array &rr,
const typename arr_t::T_numtype &dt
)
{
arr_t
np2bz_dot_rc(np2bz<arr_t>(dot_rc)),
np2bz_dot_rr(np2bz<arr_t>(dot_rr)),
np2bz_dot_rv(np2bz<arr_t>(dot_rv)),
np2bz_dot_ria(np2bz<arr_t>(dot_ria));
b1m::rhs_cellwise_ice(
opts,
np2bz_dot_rc,
np2bz_dot_rr,
np2bz_dot_rv,
np2bz_dot_ria,
np2bz<arr_t>(rc),
np2bz<arr_t>(rr),
np2bz<arr_t>(rv),
np2bz<arr_t>(ria),
np2bz<arr_t>(theta),
np2bz<arr_t>(p),
np2bz<arr_t>(rhod),
dt
);
}
arr_t
np2bz_dot_rc(np2bz<arr_t>(dot_rc)),
np2bz_dot_rr(np2bz<arr_t>(dot_rr)),
np2bz_dot_rv(np2bz<arr_t>(dot_rv)),
np2bz_dot_th(np2bz<arr_t>(dot_th));
b1m::rhs_cellwise_nwtrph(
opts,
np2bz_dot_th,
np2bz_dot_rv,
np2bz_dot_rc,
np2bz_dot_rr,
np2bz<arr_t>(rhod),
np2bz<arr_t>(p),
np2bz<arr_t>(th),
np2bz<arr_t>(rv),
np2bz<arr_t>(rc),
np2bz<arr_t>(rr),
dt
);
}


template <class arr_t>
void rhs_cellwise_nwtrph(
void rhs_cellwise_nwtrph_ice(
const b1m::opts_t<typename arr_t::T_numtype> &opts,
bp_array &dot_th,
bp_array &dot_rv,
Expand All @@ -185,7 +184,7 @@ namespace libcloudphxx
np2bz_dot_rr(np2bz<arr_t>(dot_rr)),
np2bz_dot_rv(np2bz<arr_t>(dot_rv)),
np2bz_dot_th(np2bz<arr_t>(dot_th));
b1m::rhs_cellwise_nwtrph(
b1m::rhs_cellwise_nwtrph_ice(
opts,
np2bz_dot_th,
np2bz_dot_rv,
Expand Down
5 changes: 2 additions & 3 deletions bindings/python/lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ BOOST_PYTHON_MODULE(libcloudphxx)
.def_readwrite("conv", &b1m::opts_t<real_t>::conv)
.def_readwrite("accr", &b1m::opts_t<real_t>::accr)
.def_readwrite("sedi", &b1m::opts_t<real_t>::sedi)
.def_readwrite("ice", &b1m::opts_t<real_t>::ice)
.def_readwrite("homA1", &b1m::opts_t<real_t>::homA1)
.def_readwrite("homA2", &b1m::opts_t<real_t>::homA2)
.def_readwrite("hetA", &b1m::opts_t<real_t>::hetA)
Expand All @@ -167,8 +166,8 @@ BOOST_PYTHON_MODULE(libcloudphxx)
bp::def("adj_cellwise_constp", blk_1m::adj_cellwise_constp<arr_t>);
bp::def("adj_cellwise_nwtrph", blk_1m::adj_cellwise_nwtrph<arr_t>);
bp::def("rhs_cellwise", blk_1m::rhs_cellwise<arr_t>);
bp::def("rhs_cellwise_ice", blk_1m::rhs_cellwise_ice<arr_t>);
bp::def("rhs_cellwise_nwtrph", blk_1m::rhs_cellwise_nwtrph<arr_t>);
bp::def("rhs_cellwise_nwtrph", blk_1m::rhs_cellwise_nwtrph<arr_t>);
bp::def("rhs_cellwise_nwtrph_ice", blk_1m::rhs_cellwise_nwtrph_ice<arr_t>);
bp::def("rhs_columnwise", blk_1m::rhs_columnwise<arr_t>); // TODO: handle the returned flux
}

Expand Down
1 change: 0 additions & 1 deletion include/libcloudph++/blk_1m/options.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ namespace libcloudphxx
conv = true, // autoconversion
accr = true, // accretion
sedi = true, // sedimentation
ice = true, // enable ice processes
homA1 = true, // homogeneous nucleation 1 of ice A
homA2 = true, // homogeneous nucleation 2 of ice A
hetA = true; // heterogeneous nucleation of ice A
Expand Down
Loading

0 comments on commit 9ae4f96

Please sign in to comment.