From b8a7ee769e07ebd81d97e9952f8127b3f572d776 Mon Sep 17 00:00:00 2001 From: pdziekan Date: Wed, 13 Jan 2021 15:50:14 +0100 Subject: [PATCH 1/2] add diag_sstp_coal --- include/libcloudph++/lgrngn/particles.hpp | 3 +++ src/particles_diag.ipp | 7 +++++++ src/particles_multi_gpu_diag.ipp | 7 +++++++ 3 files changed, 17 insertions(+) diff --git a/include/libcloudph++/lgrngn/particles.hpp b/include/libcloudph++/lgrngn/particles.hpp index f494b8d9a..a14aa80da 100644 --- a/include/libcloudph++/lgrngn/particles.hpp +++ b/include/libcloudph++/lgrngn/particles.hpp @@ -108,6 +108,7 @@ 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 diag_puddle() { assert(false); return std::map(); } virtual real_t *outbuf() { assert(false); return NULL; } @@ -197,6 +198,7 @@ namespace libcloudphxx void diag_precip_rate(); void diag_max_rw(); void diag_vel_div(); + int diag_sstp_coal(); std::map diag_puddle(); real_t *outbuf(); @@ -294,6 +296,7 @@ namespace libcloudphxx void diag_precip_rate(); void diag_max_rw(); void diag_vel_div(); + int diag_sstp_coal(); std::map diag_puddle(); struct impl; diff --git a/src/particles_diag.ipp b/src/particles_diag.ipp index a948143a3..0c773941b 100644 --- a/src/particles_diag.ipp +++ b/src/particles_diag.ipp @@ -415,6 +415,13 @@ namespace libcloudphxx thrust::sequence(pimpl->count_ijk.begin(), pimpl->count_ijk.end()); } + // to get current value of sstp_coal, as it can change in const_multi runs + template + int particles_t::diag_sstp_coal() + { + return pimpl->opts_init.sstp_coal; + } + // compute 1st (non-specific) moment of rw^3 * vt of all SDs // TODO: replace it with simple diag vt? template diff --git a/src/particles_multi_gpu_diag.ipp b/src/particles_multi_gpu_diag.ipp index b3dad92cc..3ca5c14aa 100644 --- a/src/particles_multi_gpu_diag.ipp +++ b/src/particles_multi_gpu_diag.ipp @@ -49,6 +49,13 @@ namespace libcloudphxx pimpl->mcuda_run(&particles_t::diag_vel_div); } + // to get current value of sstp_coal, as it can change in const_multi runs + template + int particles_t::diag_sstp_coal() + { + throw std::runtime_error("diag_sstp_coal is not implemented yet for the multi_CUDA backend"); + } + template void particles_t::diag_sd_conc() { From e574e2a14837fcc9789cd0838b0116d717ed3626 Mon Sep 17 00:00:00 2001 From: pdziekan Date: Wed, 13 Jan 2021 15:53:42 +0100 Subject: [PATCH 2/2] fix diag_sstp_coal definition in multi CUDa --- src/particles_multi_gpu_diag.ipp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/particles_multi_gpu_diag.ipp b/src/particles_multi_gpu_diag.ipp index 3ca5c14aa..67f724860 100644 --- a/src/particles_multi_gpu_diag.ipp +++ b/src/particles_multi_gpu_diag.ipp @@ -49,9 +49,8 @@ namespace libcloudphxx pimpl->mcuda_run(&particles_t::diag_vel_div); } - // to get current value of sstp_coal, as it can change in const_multi runs - template - int particles_t::diag_sstp_coal() + template + int particles_t::diag_sstp_coal() { throw std::runtime_error("diag_sstp_coal is not implemented yet for the multi_CUDA backend"); }