SDMMethods¶
Header file: <libs/runcleo/sdmmethods.hpp>
[source]
-
template<GridboxMaps GbxMaps, MicrophysicalProcess Microphys, Motion<GbxMaps> M, typename BoundaryConditions, Observer Obs>
class SDMMethods¶ Struct wrapping the core ingredients of the Super-droplet Model (SDM) part of CLEO.
This struct encapsulates the essential components of the Super-droplet Model (SDM) in the CLEO coupled model. It includes components for handling gridboxes, super-droplets’ motion, microphysics, and observers.
- Template Parameters:
GbxMaps – Type of the GridboxMaps.
Microphys – Type of the MicrophysicalProcess.
M – Type of super-droplets’ Motion.
Obs – Type of the Observer.
Public Functions
-
inline SDMMethods(const unsigned int couplstep, const GbxMaps gbxmaps, const Microphys microphys, const MoveSupersInDomain<GbxMaps, M, BoundaryConditions> movesupers, const Obs obs)¶
Constructor for SDMMethods.
Initializes SDMMethods with the provided coupling timestep, gridbox maps, microphysics, motion, and observer.
- Parameters:
couplstep – Coupling timestep.
gbxmaps – object that is type of GridboxMaps.
microphys – object that is type of MicrophysicalProcess.
movesupers – object that is type of super-droplets’ Motion.
obs – object that is type of Observer.
-
inline auto get_couplstep() const¶
Get the coupling step value.
This function retrieves and returns the size of the coupling timestep.
- Returns:
The coupling timestep value.
-
inline void prepare_to_timestep(const viewd_constgbx d_gbxs) const¶
Prepare CLEO SDM for timestepping.
This function prepares the CLEO SDM for timestepping by calling the
before_timestepping
function of the observer.- Parameters:
d_gbxs – View of gridboxes on device.
-
inline void at_start_step(const unsigned int t_mdl, const dualview_gbx gbxs) const¶
Execute at the start of each coupled model timestep.
This function is called at the start of each coupled model timestep (i.e. at start of
t_mdl
) and includes calls to the observer’sat_start_step
function for both the domain and individual gridboxes.- Parameters:
t_mdl – Current timestep of the coupled model.
gbxs – Dualview of gridboxes (on host and on device).
-
inline void run_step(const unsigned int t_mdl, const unsigned int t_mdl_next, viewd_gbx d_gbxs, const viewd_supers totsupers) const¶
Run CLEO SDM for a specified timestep range.
This function runs CLEO SDM on the device from time
t_mdl
tot_mdl_next
, with a sub-timestepping routine for the super-droplets’ movement and microphysics.- Parameters:
t_mdl – Current timestep of the coupled model.
t_mdl_next – Next timestep of the coupled model.
d_gbxs – View of gridboxes on device.
totsupers – View of all superdrops (both in and out of bounds of domain).
Public Members
-
struct SDMMethods::SDMMicrophysics sdm_microphysics¶
instance of SDMMicrophysics, operator is call of SDM microphysics
Private Functions
-
inline unsigned int next_sdmstep(const unsigned int t_sdm, const unsigned int next_mdl) const¶
Get the next timestep for SDM.
Given the current timestep for SDM (
t_sdm
) and the next timestep for the coupled model (next_mdl
), this function determines which event (motion or one complete step) will be the next to occur and returns the time of the sooner event (i.e., nextt_move
ort_mdl
).- Parameters:
t_sdm – Current timestep of SDM.
next_mdl – Next timestep of the coupled model.
- Returns:
The timestep of the sooner event.
-
inline void superdrops_movement(const unsigned int t_sdm, viewd_gbx d_gbxs, const viewd_supers totsupers, const SDMMonitor auto mo) const¶
Move superdroplets according to the
movesupers
struct.This function moves superdroplets, including their movement between gridboxes and boundary conditions, according to the
movesupers
struct.movesupers
is an instance of the MoveSupersInDomain templated type with a certain instance of a type of GridboxMaps, super-droplets’ Motion and boundary conditions.- Parameters:
t_sdm – Current timestep for SDM.
d_gbxs – View of gridboxes on device.
totsupers – View of all superdrops (both in and out of bounds of domain).
mo – Monitor of SDM processes.
Private Members
-
unsigned int couplstep¶
Coupling timestep.
-
MoveSupersInDomain<GbxMaps, M, BoundaryConditions> movesupers¶
object for super-droplets’ MoveSupersInDomain with certain type of Motion and BoundaryConditions.
-
struct SDMMicrophysics¶
Structure for encapsulating the microphysics process in SDM.
The
operator()
is called for SDM microphysics, and it uses Kokkos parallel_for for parallelized execution. struct required so that capture by value KOKKOS_CLASS_LAMBDA (ie. [=] on CPU) only captures objects relevant to microphysics and not other members of SDMMethods (which may not be GPU compatible).- Template Parameters:
Microphys – Type of the MicrophysicalProcess.
Public Functions
-
template<SDMMonitor SDMMo>
inline void operator()(const unsigned int t_sdm, const unsigned int t_next, const viewd_gbx d_gbxs, const SDMMo mo) const¶ run SDM microphysics for each gridbox (using sub-timestepping routine).
This function runs SDM microphysics for each gridbox using a sub-timestepping routine. Kokkos::parallel_for is nested parallelism within parallelised loop over gridboxes, serial equivalent is simply:
for (size_t ii(0); ii < ngbxs; ++ii) { [...] }
- Parameters:
t_sdm – Current timestep for SDM.
t_next – Next timestep for SDM.
d_gbxs – View of gridboxes on device.
mo – SDMMonitor to use.
Public Members
-
Microphys microphys¶
type of MicrophysicalProcess.