Skip to content

Commit a2ff208

Browse files
committed
Merge branch 'oksanaguba/eamxx/fixer-clean' (PR #7553)
Adds (dycore) energy fixer. The infrastructure can be used for another process (and will be used for IEFLX), but the current impl is for the dycore. It is identical to the EAM impl, where pressure adjustment and dycore energy leaks are fixed as one global change to temperature for each column/level as the same temperature tendency. There is a check if fixer debug output is on ( enable_energy_fixer_debug_info ) , which computes global energy after the fixer to confirm that it does match. This debug output is used in a test that has postproc *py script to confirm that the energy is fixed up to a tolerance. For full discussion see #7276 . Climo results ( model vs model, with fixer and without from the same branch) https://web.lcrc.anl.gov/public/e3sm/diagnostic_output/ac.onguba/theta/ fixerJuly24-2025/latlon-pdf-vs-default/viewer/lat_lon/index.html . [nonBFB] for any cime runs with eamxx and dycore. Potentially climate-changing, too.
2 parents 4fee675 + 9c77714 commit a2ff208

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

components/eamxx/src/share/property_checks/mass_and_energy_conservation_check.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ PropertyCheck::ResultAndMsg MassAndEnergyConservationCheck::check() const
304304

305305
void MassAndEnergyConservationCheck::global_fixer(const bool & print_debug_info)
306306
{
307+
using TPF = ekat::TeamPolicyFactory<DefaultDevice::execution_space>;
307308
const auto ncols = m_num_cols;
308309
const auto nlevs = m_num_levs;
309310

@@ -328,7 +329,7 @@ void MassAndEnergyConservationCheck::global_fixer(const bool & print_debug_info)
328329
const auto ice_flux = m_fields.at("ice_flux" ).get_view<const Real*>();
329330
const auto heat_flux = m_fields.at("heat_flux" ).get_view<const Real*>();
330331

331-
const auto policy = ExeSpaceUtils::get_default_team_policy(ncols, nlevs);
332+
const auto policy = TPF::get_default_team_policy(ncols, nlevs);
332333

333334
using namespace ekat::units;
334335
using namespace ShortFieldTagsNames;
@@ -485,10 +486,11 @@ compute_gas_mass_on_column (const KT::MemberType& team,
485486
const int nlevs,
486487
const uview_1d<const Real>& pseudo_density)
487488
{
489+
using RU = ekat::ReductionUtils<DefaultDevice::execution_space>;
488490
using PC = scream::physics::Constants<Real>;
489491
const Real gravit = PC::gravit;
490492

491-
return ExeSpaceUtils::parallel_reduce<Real>(team, 0, nlevs,
493+
return RU::parallel_reduce<Real>(team, 0, nlevs,
492494
[&] (const int lev, Real& local_mass) {
493495
local_mass += pseudo_density(lev)/gravit;
494496
});

components/eamxx/src/share/property_checks/mass_and_energy_conservation_check.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#include "share/field/field.hpp"
77
#include "share/field/field_utils.hpp"
88

9-
#include "ekat/kokkos/ekat_kokkos_utils.hpp"
10-
#include "ekat/mpi/ekat_comm.hpp"
9+
#include <ekat_team_policy_utils.hpp>
10+
#include "ekat_comm.hpp"
1111

1212
namespace scream {
1313

0 commit comments

Comments
 (0)