From a79d77e96423584ef80ab6a0608b739ce9a42d44 Mon Sep 17 00:00:00 2001 From: Rich Fiorella Date: Wed, 10 Jun 2026 08:27:57 -0600 Subject: [PATCH 1/3] feat(eamxx): register water tracer and isotope processes Add infrastructure for water-tracer and isotope tracking: - Register WaterTracers and WaterIsotopes process types - Add CMake build rules and process factory integration - Create stub process interfaces with identity tendencies - Add namelist defaults for tracer_count configuration Part of water isotope infrastructure campaign (spec 001). --- .../cime_config/namelist_defaults_eamxx.xml | 10 ++++ components/eamxx/src/physics/CMakeLists.txt | 1 + .../eamxx/src/physics/register_physics.hpp | 12 ++++ .../src/physics/water_tracers/CMakeLists.txt | 24 ++++++++ ...eamxx_water_isotopes_process_interface.cpp | 26 ++++++++ ...eamxx_water_isotopes_process_interface.hpp | 46 ++++++++++++++ .../eamxx_water_tracers_process_interface.cpp | 51 ++++++++++++++++ .../eamxx_water_tracers_process_interface.hpp | 60 +++++++++++++++++++ 8 files changed, 230 insertions(+) create mode 100644 components/eamxx/src/physics/water_tracers/CMakeLists.txt create mode 100644 components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.cpp create mode 100644 components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.hpp create mode 100644 components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.cpp create mode 100644 components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.hpp diff --git a/components/eamxx/cime_config/namelist_defaults_eamxx.xml b/components/eamxx/cime_config/namelist_defaults_eamxx.xml index f01b86033d07..7cac4a97ca58 100644 --- a/components/eamxx/cime_config/namelist_defaults_eamxx.xml +++ b/components/eamxx/cime_config/namelist_defaults_eamxx.xml @@ -274,6 +274,16 @@ be lost if SCREAM_HACK_XML is not enabled. true + + + 0 + + + + + 0 + + false diff --git a/components/eamxx/src/physics/CMakeLists.txt b/components/eamxx/src/physics/CMakeLists.txt index 296b0b8b50bc..37f039fefdf5 100644 --- a/components/eamxx/src/physics/CMakeLists.txt +++ b/components/eamxx/src/physics/CMakeLists.txt @@ -20,3 +20,4 @@ if (SCREAM_ENABLE_MAM) add_subdirectory(mam) endif() add_subdirectory(gw) +add_subdirectory(water_tracers) diff --git a/components/eamxx/src/physics/register_physics.hpp b/components/eamxx/src/physics/register_physics.hpp index 4004baf3a3b8..2adb4022f84b 100644 --- a/components/eamxx/src/physics/register_physics.hpp +++ b/components/eamxx/src/physics/register_physics.hpp @@ -50,6 +50,12 @@ #ifdef EAMXX_HAS_CLD_FRAC_NET #include "physics/cld_fraction/cld_frac_net/eamxx_cld_frac_net_process_interface.hpp" #endif +#ifdef EAMXX_HAS_WATER_TRACERS +#include "physics/water_tracers/eamxx_water_tracers_process_interface.hpp" +#endif +#ifdef EAMXX_HAS_WATER_ISOTOPES +#include "physics/water_tracers/eamxx_water_isotopes_process_interface.hpp" +#endif namespace scream { @@ -100,6 +106,12 @@ inline void register_physics () { #ifdef EAMXX_HAS_CLD_FRAC_NET proc_factory.register_product("cld_frac_net",&create_atmosphere_process); #endif +#ifdef EAMXX_HAS_WATER_TRACERS + proc_factory.register_product("water_tracers",&create_atmosphere_process); +#endif +#ifdef EAMXX_HAS_WATER_ISOTOPES + proc_factory.register_product("water_isotopes",&create_atmosphere_process); +#endif // If no physics was enabled, silence compile warning about unused var (void) proc_factory; diff --git a/components/eamxx/src/physics/water_tracers/CMakeLists.txt b/components/eamxx/src/physics/water_tracers/CMakeLists.txt new file mode 100644 index 000000000000..11cfbf83f302 --- /dev/null +++ b/components/eamxx/src/physics/water_tracers/CMakeLists.txt @@ -0,0 +1,24 @@ +set(WATER_TRACERS_SRCS + eamxx_water_tracers_process_interface.cpp + eamxx_water_isotopes_process_interface.cpp +) + +add_library(water_tracers ${WATER_TRACERS_SRCS}) + +# Define public compile definitions so registration guards become active +target_compile_definitions(water_tracers PUBLIC + EAMXX_HAS_WATER_TRACERS + EAMXX_HAS_WATER_ISOTOPES +) + +target_include_directories(water_tracers PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} +) + +# Link required EAMxx libraries +target_link_libraries(water_tracers scream_share) + +# Conditionally link into eamxx_physics INTERFACE target (P3 pattern) +if (TARGET eamxx_physics) + target_link_libraries(eamxx_physics INTERFACE water_tracers) +endif() diff --git a/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.cpp b/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.cpp new file mode 100644 index 000000000000..62d5629e6f31 --- /dev/null +++ b/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.cpp @@ -0,0 +1,26 @@ +#include "eamxx_water_isotopes_process_interface.hpp" + +namespace scream +{ + +// ========================================================================================= +WaterIsotopes::WaterIsotopes(const ekat::Comm& comm, const ekat::ParameterList& params) + : WaterTracers(comm, params) +{ + // Water isotopes inherits all tracer handling from WaterTracers + // No additional initialization needed at this stage +} + +// ========================================================================================= +void WaterIsotopes::run_impl(const double dt) +{ + // Call base class tracer physics (currently a no-op) + WaterTracers::run_impl(dt); + + // TODO (later campaign specs): Add fractionation physics here + // - Equilibrium fractionation during phase changes + // - Kinetic fractionation during evaporation + // - Isotope-specific adjustments to microphysics processes +} + +} // namespace scream diff --git a/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.hpp b/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.hpp new file mode 100644 index 000000000000..6e7ed73bae44 --- /dev/null +++ b/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.hpp @@ -0,0 +1,46 @@ +#ifndef SCREAM_WATER_ISOTOPES_HPP +#define SCREAM_WATER_ISOTOPES_HPP + +#include "eamxx_water_tracers_process_interface.hpp" +#include "ekat/ekat_parameter_list.hpp" + +#include + +namespace scream +{ +/* + * The class responsible to handle water isotope transport and fractionation + * + * This process extends WaterTracers to add equilibrium and kinetic fractionation + * during phase changes for water isotope species (e.g., HDO, H2-18O, HTO). + * + * By inheriting from WaterTracers, this class reuses all tracer field handling + * and only needs to override specific fractionation hooks. + * + * Note: This is a stub implementation that registers the process. Fractionation + * physics will be added in later specs of the water isotope campaign. +*/ + +class WaterIsotopes : public WaterTracers +{ +public: + // Constructors + WaterIsotopes (const ekat::Comm& comm, const ekat::ParameterList& params); + + // Override the name to distinguish from base WaterTracers + std::string name () const override { return "water_isotopes"; } + +protected: + + // Override run_impl to add fractionation physics + // For now, just calls base class implementation + void run_impl (const double dt) override; + + // TODO (later campaign specs): Add virtual hooks for fractionation processes + // e.g., apply_equilibrium_fractionation(), apply_kinetic_fractionation() + +}; // class WaterIsotopes + +} // namespace scream + +#endif // SCREAM_WATER_ISOTOPES_HPP diff --git a/components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.cpp b/components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.cpp new file mode 100644 index 000000000000..cc0f638d1d90 --- /dev/null +++ b/components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.cpp @@ -0,0 +1,51 @@ +#include "eamxx_water_tracers_process_interface.hpp" + +#include + +namespace scream +{ + +// ========================================================================================= +WaterTracers::WaterTracers(const ekat::Comm& comm, const ekat::ParameterList& params) + : AtmosphereProcess(comm, params) + , m_tracer_count(0) +{ + // Read tracer count from parameter list (default 0) + m_tracer_count = m_params.get("tracer_count", 0); +} + +// ========================================================================================= +void WaterTracers::create_requests() +{ + // Get the grid for this process + m_grid = m_grids_manager->get_grid("physics"); + m_num_cols = m_grid->get_num_local_dofs(); // Number of columns on this rank + m_num_levs = m_grid->get_num_vertical_levels(); // Number of levels per column + + // TODO (spec 002): Define field requests for water tracer arrays + // For now, this process requires no fields and computes no fields + // Field definitions will be added in spec 002 +} + +// ========================================================================================= +void WaterTracers::initialize_impl(const RunType /* run_type */) +{ + // TODO (spec 002+): Initialize tracer field arrays and any precomputed data + // For now, this is a no-op since no fields are defined yet +} + +// ========================================================================================= +void WaterTracers::run_impl(const double /* dt */) +{ + // TODO (spec 002+): Implement tracer transport and physics + // This stub implementation performs no operations + // Tracer physics will be added in subsequent specs of the water isotope campaign +} + +// ========================================================================================= +void WaterTracers::finalize_impl() +{ + // Nothing to finalize at this stage +} + +} // namespace scream diff --git a/components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.hpp b/components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.hpp new file mode 100644 index 000000000000..6d8e36e9b2fe --- /dev/null +++ b/components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.hpp @@ -0,0 +1,60 @@ +#ifndef SCREAM_WATER_TRACERS_HPP +#define SCREAM_WATER_TRACERS_HPP + +#include "share/atm_process/atmosphere_process.hpp" +#include "ekat/ekat_parameter_list.hpp" + +#include + +namespace scream +{ +/* + * The class responsible to handle water tracer transport through the atmosphere + * + * This process manages additional water species that track through the model + * without undergoing fractionation. Water isotopes (a special case with + * fractionation) are handled by the WaterIsotopes subclass. + * + * Note: This is a stub implementation that registers the process and sets up + * the basic infrastructure. Field definitions and physics implementation are + * deferred to later specs in the water isotope campaign. +*/ + +class WaterTracers : public AtmosphereProcess +{ +public: + using KT = ekat::KokkosTypes; + + // Constructors + WaterTracers (const ekat::Comm& comm, const ekat::ParameterList& params); + + // The type of subcomponent + AtmosphereProcessType type () const { return AtmosphereProcessType::Physics; } + + // The name of the subcomponent + virtual std::string name () const { return "water_tracers"; } + + // Create grid-dependent field requests + void create_requests (); + +protected: + + // The three main overrides for the subcomponent + void initialize_impl (const RunType run_type); + void run_impl (const double dt); + void finalize_impl (); + + // Keep track of field dimensions + int m_num_cols; + int m_num_levs; + + // Number of tracers to track (from parameter list) + int m_tracer_count; + + std::shared_ptr m_grid; + +}; // class WaterTracers + +} // namespace scream + +#endif // SCREAM_WATER_TRACERS_HPP From 3c9d221e7f3298e9f88dd78e0ec34aaa182fa47f Mon Sep 17 00:00:00 2001 From: Rich Fiorella Date: Fri, 19 Jun 2026 16:13:50 -0600 Subject: [PATCH 2/3] cleanup comments --- .../eamxx_water_isotopes_process_interface.cpp | 7 ++----- .../eamxx_water_isotopes_process_interface.hpp | 6 +++--- .../eamxx_water_tracers_process_interface.cpp | 10 +++++----- 3 files changed, 10 insertions(+), 13 deletions(-) diff --git a/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.cpp b/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.cpp index 62d5629e6f31..dffd1a98ac2a 100644 --- a/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.cpp +++ b/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.cpp @@ -7,7 +7,7 @@ namespace scream WaterIsotopes::WaterIsotopes(const ekat::Comm& comm, const ekat::ParameterList& params) : WaterTracers(comm, params) { - // Water isotopes inherits all tracer handling from WaterTracers + // Water isotopes will inherit all tracer handling from WaterTracers // No additional initialization needed at this stage } @@ -17,10 +17,7 @@ void WaterIsotopes::run_impl(const double dt) // Call base class tracer physics (currently a no-op) WaterTracers::run_impl(dt); - // TODO (later campaign specs): Add fractionation physics here - // - Equilibrium fractionation during phase changes - // - Kinetic fractionation during evaporation - // - Isotope-specific adjustments to microphysics processes + // TODO: Add fractionation physics here } } // namespace scream diff --git a/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.hpp b/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.hpp index 6e7ed73bae44..5d72181109eb 100644 --- a/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.hpp +++ b/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.hpp @@ -12,13 +12,13 @@ namespace scream * The class responsible to handle water isotope transport and fractionation * * This process extends WaterTracers to add equilibrium and kinetic fractionation - * during phase changes for water isotope species (e.g., HDO, H2-18O, HTO). + * during phase changes for water isotope species. * * By inheriting from WaterTracers, this class reuses all tracer field handling * and only needs to override specific fractionation hooks. * * Note: This is a stub implementation that registers the process. Fractionation - * physics will be added in later specs of the water isotope campaign. + * physics will be added later. */ class WaterIsotopes : public WaterTracers @@ -36,7 +36,7 @@ class WaterIsotopes : public WaterTracers // For now, just calls base class implementation void run_impl (const double dt) override; - // TODO (later campaign specs): Add virtual hooks for fractionation processes + // TODO: Add virtual hooks for fractionation processes // e.g., apply_equilibrium_fractionation(), apply_kinetic_fractionation() }; // class WaterIsotopes diff --git a/components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.cpp b/components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.cpp index cc0f638d1d90..729ed701edfb 100644 --- a/components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.cpp +++ b/components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.cpp @@ -22,24 +22,24 @@ void WaterTracers::create_requests() m_num_cols = m_grid->get_num_local_dofs(); // Number of columns on this rank m_num_levs = m_grid->get_num_vertical_levels(); // Number of levels per column - // TODO (spec 002): Define field requests for water tracer arrays + // TODO: Define field requests for water tracer arrays // For now, this process requires no fields and computes no fields - // Field definitions will be added in spec 002 + // Field definitions will be added later } // ========================================================================================= void WaterTracers::initialize_impl(const RunType /* run_type */) { - // TODO (spec 002+): Initialize tracer field arrays and any precomputed data + // TODO: Initialize tracer field arrays and any precomputed data // For now, this is a no-op since no fields are defined yet } // ========================================================================================= void WaterTracers::run_impl(const double /* dt */) { - // TODO (spec 002+): Implement tracer transport and physics + // TODO: Implement tracer transport and physics // This stub implementation performs no operations - // Tracer physics will be added in subsequent specs of the water isotope campaign + // Tracer physics will be added in subsequent PRs } // ========================================================================================= From 5a4ef23235c30279eeae8ab023410a996a122deb Mon Sep 17 00:00:00 2001 From: Rich Fiorella Date: Wed, 8 Jul 2026 15:43:30 -0600 Subject: [PATCH 3/3] Restructure water tracers/isotopes into separate libraries Move water tracer and isotope processes from physics/water_tracers/ to physics/aux_tracers/{water_tracers,water_isotopes}/ with separate libraries per process. Water isotopes depend on and extend water tracers. - Add aux_tracers/CMakeLists.txt with EAMXX_ENABLE_WATER_TRACERS and EAMXX_ENABLE_WATER_ISOTOPES options (both default OFF) - Enforce dependency: isotopes require tracers - Create separate water_tracers and water_isotopes libraries - Update register_physics.hpp include paths - Use full include path in water_isotopes header for robustness --- components/eamxx/src/physics/CMakeLists.txt | 2 +- .../src/physics/aux_tracers/CMakeLists.txt | 34 +++++++++++++++++++ .../aux_tracers/water_isotopes/CMakeLists.txt | 28 +++++++++++++++ ...eamxx_water_isotopes_process_interface.cpp | 0 ...eamxx_water_isotopes_process_interface.hpp | 2 +- .../aux_tracers/water_tracers/CMakeLists.txt | 28 +++++++++++++++ .../eamxx_water_tracers_process_interface.cpp | 0 .../eamxx_water_tracers_process_interface.hpp | 0 .../eamxx/src/physics/register_physics.hpp | 4 +-- .../src/physics/water_tracers/CMakeLists.txt | 24 ------------- 10 files changed, 94 insertions(+), 28 deletions(-) create mode 100644 components/eamxx/src/physics/aux_tracers/CMakeLists.txt create mode 100644 components/eamxx/src/physics/aux_tracers/water_isotopes/CMakeLists.txt rename components/eamxx/src/physics/{water_tracers => aux_tracers/water_isotopes}/eamxx_water_isotopes_process_interface.cpp (100%) rename components/eamxx/src/physics/{water_tracers => aux_tracers/water_isotopes}/eamxx_water_isotopes_process_interface.hpp (93%) create mode 100644 components/eamxx/src/physics/aux_tracers/water_tracers/CMakeLists.txt rename components/eamxx/src/physics/{ => aux_tracers}/water_tracers/eamxx_water_tracers_process_interface.cpp (100%) rename components/eamxx/src/physics/{ => aux_tracers}/water_tracers/eamxx_water_tracers_process_interface.hpp (100%) delete mode 100644 components/eamxx/src/physics/water_tracers/CMakeLists.txt diff --git a/components/eamxx/src/physics/CMakeLists.txt b/components/eamxx/src/physics/CMakeLists.txt index 37f039fefdf5..2d7ee5afdfe8 100644 --- a/components/eamxx/src/physics/CMakeLists.txt +++ b/components/eamxx/src/physics/CMakeLists.txt @@ -20,4 +20,4 @@ if (SCREAM_ENABLE_MAM) add_subdirectory(mam) endif() add_subdirectory(gw) -add_subdirectory(water_tracers) +add_subdirectory(aux_tracers) diff --git a/components/eamxx/src/physics/aux_tracers/CMakeLists.txt b/components/eamxx/src/physics/aux_tracers/CMakeLists.txt new file mode 100644 index 000000000000..99043ce890ea --- /dev/null +++ b/components/eamxx/src/physics/aux_tracers/CMakeLists.txt @@ -0,0 +1,34 @@ +# Auxiliary tracers for EAMxx. +# +# This folder groups the "auxiliary tracer" physics processes. Currently, +# there are two options: passive water tracers and, built on top of them, +# water isotopes. Additional tracer classes could be added in an analagous +# way. The build is governed by these CMake options: +# +# EAMXX_ENABLE_WATER_TRACERS - build the passive water tracer process +# EAMXX_ENABLE_WATER_ISOTOPES - build the water isotope process +# +# Water isotopes are implemented on top of the water tracer infrastructure, so +# they can ONLY be built when water tracers are also enabled. If isotopes are +# requested without tracers we auto-enable tracers and warn, rather than build +# an inconsistent configuration. + +option(EAMXX_ENABLE_WATER_TRACERS "Whether to build the EAMxx water tracer process" OFF) +option(EAMXX_ENABLE_WATER_ISOTOPES "Whether to build the EAMxx water isotope process" OFF) + +# Enforce the dependency: isotopes require tracers. +if (EAMXX_ENABLE_WATER_ISOTOPES AND NOT EAMXX_ENABLE_WATER_TRACERS) + message(STATUS "WARNING: EAMXX_ENABLE_WATER_ISOTOPES=ON requires EAMXX_ENABLE_WATER_TRACERS; " + "auto-enabling water tracers.") + set(EAMXX_ENABLE_WATER_TRACERS ON CACHE BOOL "Whether to build the EAMxx water tracer process" FORCE) +endif() + +# Each process lives in its own sibling subdirectory. Descend +# into each only when the corresponding process is enabled. water_isotopes must +# be added after water_tracers, since it depends on the water_tracers target. +if (EAMXX_ENABLE_WATER_TRACERS) + add_subdirectory(water_tracers) +endif() +if (EAMXX_ENABLE_WATER_ISOTOPES) + add_subdirectory(water_isotopes) +endif() diff --git a/components/eamxx/src/physics/aux_tracers/water_isotopes/CMakeLists.txt b/components/eamxx/src/physics/aux_tracers/water_isotopes/CMakeLists.txt new file mode 100644 index 000000000000..cb69f08fc21e --- /dev/null +++ b/components/eamxx/src/physics/aux_tracers/water_isotopes/CMakeLists.txt @@ -0,0 +1,28 @@ +# Water isotope physics process. +# +# This directory is only entered when EAMXX_ENABLE_WATER_ISOTOPES is ON, +# which in turn guarantees EAMXX_ENABLE_WATER_TRACERS is ON +# (isotopes are layered on top of the water tracer infrastructure). Following +# the EAMxx one-library-per-process pattern, the water isotope process gets its +# own library. + +add_library(water_isotopes + eamxx_water_isotopes_process_interface.cpp +) + +# Public compile definition so the registration guard in register_physics.hpp +# becomes active. +target_compile_definitions(water_isotopes PUBLIC EAMXX_HAS_WATER_ISOTOPES) + +# Expose this directory +target_include_directories(water_isotopes PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} +) + +target_link_libraries(water_isotopes PUBLIC scream_share) +target_link_libraries(water_isotopes PRIVATE water_tracers) + +# Link into the eamxx_physics INTERFACE target. +if (TARGET eamxx_physics) + target_link_libraries(eamxx_physics INTERFACE water_isotopes) +endif() diff --git a/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.cpp b/components/eamxx/src/physics/aux_tracers/water_isotopes/eamxx_water_isotopes_process_interface.cpp similarity index 100% rename from components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.cpp rename to components/eamxx/src/physics/aux_tracers/water_isotopes/eamxx_water_isotopes_process_interface.cpp diff --git a/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.hpp b/components/eamxx/src/physics/aux_tracers/water_isotopes/eamxx_water_isotopes_process_interface.hpp similarity index 93% rename from components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.hpp rename to components/eamxx/src/physics/aux_tracers/water_isotopes/eamxx_water_isotopes_process_interface.hpp index 5d72181109eb..e3249e9f1dc2 100644 --- a/components/eamxx/src/physics/water_tracers/eamxx_water_isotopes_process_interface.hpp +++ b/components/eamxx/src/physics/aux_tracers/water_isotopes/eamxx_water_isotopes_process_interface.hpp @@ -1,7 +1,7 @@ #ifndef SCREAM_WATER_ISOTOPES_HPP #define SCREAM_WATER_ISOTOPES_HPP -#include "eamxx_water_tracers_process_interface.hpp" +#include "physics/aux_tracers/water_tracers/eamxx_water_tracers_process_interface.hpp" #include "ekat/ekat_parameter_list.hpp" #include diff --git a/components/eamxx/src/physics/aux_tracers/water_tracers/CMakeLists.txt b/components/eamxx/src/physics/aux_tracers/water_tracers/CMakeLists.txt new file mode 100644 index 000000000000..5607cd5036ae --- /dev/null +++ b/components/eamxx/src/physics/aux_tracers/water_tracers/CMakeLists.txt @@ -0,0 +1,28 @@ +# Water tracer physics process. +# +# This directory is only entered when EAMXX_ENABLE_WATER_TRACERS is ON. +# Following the EAMxx one-library-per-process pattern, the +# water tracer process gets its own library. The sibling water_isotopes library +# depends on this one. + +add_library(water_tracers + eamxx_water_tracers_process_interface.cpp +) + +# Public compile definition so the registration guard in register_physics.hpp +# becomes active. +target_compile_definitions(water_tracers PUBLIC EAMXX_HAS_WATER_TRACERS) + +# Expose this directory to allow includes of the +# process interface headers. +target_include_directories(water_tracers PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} +) + +# Link required EAMxx libraries. +target_link_libraries(water_tracers scream_share) + +# Link into the eamxx_physics INTERFACE target. +if (TARGET eamxx_physics) + target_link_libraries(eamxx_physics INTERFACE water_tracers) +endif() diff --git a/components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.cpp b/components/eamxx/src/physics/aux_tracers/water_tracers/eamxx_water_tracers_process_interface.cpp similarity index 100% rename from components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.cpp rename to components/eamxx/src/physics/aux_tracers/water_tracers/eamxx_water_tracers_process_interface.cpp diff --git a/components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.hpp b/components/eamxx/src/physics/aux_tracers/water_tracers/eamxx_water_tracers_process_interface.hpp similarity index 100% rename from components/eamxx/src/physics/water_tracers/eamxx_water_tracers_process_interface.hpp rename to components/eamxx/src/physics/aux_tracers/water_tracers/eamxx_water_tracers_process_interface.hpp diff --git a/components/eamxx/src/physics/register_physics.hpp b/components/eamxx/src/physics/register_physics.hpp index 2adb4022f84b..3615ac0b49b0 100644 --- a/components/eamxx/src/physics/register_physics.hpp +++ b/components/eamxx/src/physics/register_physics.hpp @@ -51,10 +51,10 @@ #include "physics/cld_fraction/cld_frac_net/eamxx_cld_frac_net_process_interface.hpp" #endif #ifdef EAMXX_HAS_WATER_TRACERS -#include "physics/water_tracers/eamxx_water_tracers_process_interface.hpp" +#include "physics/aux_tracers/water_tracers/eamxx_water_tracers_process_interface.hpp" #endif #ifdef EAMXX_HAS_WATER_ISOTOPES -#include "physics/water_tracers/eamxx_water_isotopes_process_interface.hpp" +#include "physics/aux_tracers/water_isotopes/eamxx_water_isotopes_process_interface.hpp" #endif namespace scream { diff --git a/components/eamxx/src/physics/water_tracers/CMakeLists.txt b/components/eamxx/src/physics/water_tracers/CMakeLists.txt deleted file mode 100644 index 11cfbf83f302..000000000000 --- a/components/eamxx/src/physics/water_tracers/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -set(WATER_TRACERS_SRCS - eamxx_water_tracers_process_interface.cpp - eamxx_water_isotopes_process_interface.cpp -) - -add_library(water_tracers ${WATER_TRACERS_SRCS}) - -# Define public compile definitions so registration guards become active -target_compile_definitions(water_tracers PUBLIC - EAMXX_HAS_WATER_TRACERS - EAMXX_HAS_WATER_ISOTOPES -) - -target_include_directories(water_tracers PUBLIC - ${CMAKE_CURRENT_SOURCE_DIR} -) - -# Link required EAMxx libraries -target_link_libraries(water_tracers scream_share) - -# Conditionally link into eamxx_physics INTERFACE target (P3 pattern) -if (TARGET eamxx_physics) - target_link_libraries(eamxx_physics INTERFACE water_tracers) -endif()