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

minor renaming #69

Merged
merged 2 commits into from
May 27, 2024
Merged
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
2 changes: 1 addition & 1 deletion libs/observers/sdmmonitor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib)

# Add executables and create library target
set(SOURCES
"condensation_observer.cpp"
"monitor_condensation.cpp"
)
# must use STATIC (not(!) SHARED) lib for linking to executable if build is CUDA enabled with Kokkos
add_library("${LIBNAME}" STATIC ${SOURCES})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
*
*
* ----- CLEO -----
* File: condensation_observer.cpp
* File: monitor_condensation.cpp
* Project: sdmmonitor
* Created Date: Wednesday 8th May 2024
* Author: Clara Bayley (CB)
* Additional Contributors:
* -----
* Last Modified: Saturday 25th May 2024
* Last Modified: Monday 27th May 2024
* Modified By: CB
* -----
* License: BSD 3-Clause "New" or "Revised" License
Expand All @@ -19,7 +19,7 @@
* functionality to monitor condensation SDM microphysical process
*/

#include "./condensation_observer.hpp"
#include "./monitor_condensation.hpp"

/**
* @brief Parallel loop to fill d_data with zero value.
Expand All @@ -35,8 +35,8 @@ void MonitorCondensation::reset_monitor() const {
*
* Add totmass_condensed to current value for mass condensed since d_data was last reset.
*
* _Note:_ conversion of mass condensed at one timestep from double precision (8 bytes double) to
* single precision (4 bytes float) in output.
* _Note:_ possible conversion of mass condensed at one timestep from double precision
* (8 bytes double) to single precision (4 bytes float) in output depending on datatype alias.
*
* @param team_member Kokkkos team member in TeamPolicy parallel loop over gridboxes
* @param totmass_condensed Mass condensed in one gridbox during one microphysical timestep
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
*
*
* ----- CLEO -----
* File: condensation_observer.hpp
* File: monitor_condensation.hpp
* Project: sdmmonitor
* Created Date: Wednesday 8th May 2024
* Author: Clara Bayley (CB)
* Additional Contributors:
* -----
* Last Modified: Saturday 25th May 2024
* Last Modified: Monday 27th May 2024
* Modified By: CB
* -----
* License: BSD 3-Clause "New" or "Revised" License
Expand All @@ -20,8 +20,8 @@
* microphysical process in each gridbox a constant interval at the start of each timestep.
*/

#ifndef LIBS_OBSERVERS_SDMMONITOR_CONDENSATION_OBSERVER_HPP_
#define LIBS_OBSERVERS_SDMMONITOR_CONDENSATION_OBSERVER_HPP_
#ifndef LIBS_OBSERVERS_SDMMONITOR_MONITOR_CONDENSATION_HPP_
#define LIBS_OBSERVERS_SDMMONITOR_MONITOR_CONDENSATION_HPP_

#include <Kokkos_Core.hpp>
#include <concepts>
Expand All @@ -47,8 +47,8 @@ struct MonitorCondensation {
*
* Add totmass_condensed to current value for mass condensed since d_data was last reset.
*
* _Note:_ conversion of mass condensed at one timestep from double precision (8 bytes double) to
* single precision (4 bytes float) in output.
* _Note:_ possible conversion of mass condensed at one timestep from double precision
* (8 bytes double) to single precision (4 bytes float) in output depending on datatype alias.
*
* @param team_member Kokkkos team member in TeamPolicy parallel loop over gridboxes
* @param totmass_condensed Mass condensed in one gridbox during one microphysical timestep
Expand Down Expand Up @@ -79,18 +79,17 @@ struct MonitorCondensation {
template <typename Store>
inline Observer auto CondensationObserver(const unsigned int interval, Dataset<Store>& dataset,
const size_t maxchunk, const size_t ngbxs) {
using Mo = MonitorCondensation;
const auto name = std::string_view("massdelta_cond");
const auto units = std::string_view("g");
constexpr auto scale_factor = dlc::MASS0grams;
const auto chunkshape = good2Dchunkshape(maxchunk, ngbxs);
const auto dimnames = std::vector<std::string>{"time", "gbxindex"};
const auto xzarr_ptr = std::make_shared<XarrayZarrArray<Store, MonitorCondensation::datatype>>(
dataset.template create_array<MonitorCondensation::datatype>(name, units, scale_factor,
chunkshape, dimnames));
const auto xzarr_ptr = std::make_shared<XarrayZarrArray<Store, Mo::datatype>>(
dataset.template create_array<Mo::datatype>(name, units, scale_factor, chunkshape, dimnames));

const auto do_obs = DoSDMMonitorObs<Store, MonitorCondensation, MonitorCondensation::datatype>(
dataset, xzarr_ptr, MonitorCondensation(ngbxs));
const auto do_obs = DoSDMMonitorObs<Store, Mo, Mo::datatype>(dataset, xzarr_ptr, Mo(ngbxs));
return ConstTstepObserver(interval, do_obs);
}

#endif // LIBS_OBSERVERS_SDMMONITOR_CONDENSATION_OBSERVER_HPP_
#endif // LIBS_OBSERVERS_SDMMONITOR_MONITOR_CONDENSATION_HPP_
4 changes: 2 additions & 2 deletions src/main_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* Author: Clara Bayley (CB)
* Additional Contributors:
* -----
* Last Modified: Saturday 25th May 2024
* Last Modified: Monday 27th May 2024
* Modified By: CB
* -----
* License: BSD 3-Clause "New" or "Revised" License
Expand Down Expand Up @@ -50,7 +50,7 @@
#include "observers/nsupers_observer.hpp"
#include "observers/observers.hpp"
#include "observers/runstats_observer.hpp"
#include "observers/sdmmonitor/condensation_observer.hpp"
#include "observers/sdmmonitor/monitor_condensation.hpp"
#include "observers/state_observer.hpp"
#include "observers/streamout_observer.hpp"
#include "observers/superdrops_observer.hpp"
Expand Down
Loading