Skip to content

Commit 346bff5

Browse files
committed
EAMxx: public methods for cuda in ZonalAvgDiag
1 parent 2d55ab7 commit 346bff5

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

components/eamxx/src/diagnostics/zonal_avg.hpp

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,6 @@ namespace scream {
1313

1414
class ZonalAvgDiag : public AtmosphereDiagnostic {
1515

16-
// Utility to compute the contraction of a field along its column dimension.
17-
// This is equivalent to f_out = einsum('i,i...k->...k', weight, f_in).
18-
// The implementation is such that:
19-
// - all Field objects must be allocated
20-
// - the first dimension for field, weight, and lat is for the columns (COL)
21-
// - the first dimension for result is for the zonal bins (CMP,"bin")
22-
// - field and result must be the same dimension, up to 3
23-
static void compute_zonal_sum(const Field &result, const Field &field, const Field &weight,
24-
const Field &lat, const ekat::Comm *comm = nullptr);
25-
2616
public:
2717
// Constructors
2818
ZonalAvgDiag(const ekat::Comm &comm, const ekat::ParameterList &params);
@@ -37,11 +27,19 @@ class ZonalAvgDiag : public AtmosphereDiagnostic {
3727
#ifdef KOKKOS_ENABLE_CUDA
3828
public:
3929
#endif
30+
void initialize_impl(const RunType /*run_type*/);
4031
void compute_diagnostic_impl();
32+
// Utility to compute the contraction of a field along its column dimension.
33+
// This is equivalent to f_out = einsum('i,i...k->...k', weight, f_in).
34+
// The implementation is such that:
35+
// - all Field objects must be allocated
36+
// - the first dimension for field, weight, and lat is for the columns (COL)
37+
// - the first dimension for result is for the zonal bins (CMP,"bin")
38+
// - field and result must be the same dimension, up to 3
39+
static void compute_zonal_sum(const Field &result, const Field &field, const Field &weight,
40+
const Field &lat, const ekat::Comm *comm = nullptr);
4141

4242
protected:
43-
void initialize_impl(const RunType /*run_type*/);
44-
4543
std::string m_diag_name;
4644
int m_num_zonal_bins;
4745

0 commit comments

Comments
 (0)