Skip to content

Commit 6551b4e

Browse files
committed
added some missing const specifiers to zonal_avg_test
1 parent 042516d commit 6551b4e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

components/eamxx/src/diagnostics/tests/zonal_avg_test.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ TEST_CASE("zonal_avg") {
2828
using namespace ekat::units;
2929

3030
// A numerical tolerance
31-
auto tol = std::numeric_limits<Real>::epsilon() * 100;
31+
const auto tol = std::numeric_limits<Real>::epsilon() * 100;
3232

3333
// A world comm
3434
ekat::Comm comm(MPI_COMM_WORLD);
@@ -153,7 +153,7 @@ TEST_CASE("zonal_avg") {
153153
const Real zavg1 = sp(1.0);
154154
qc1.deep_copy(zavg1);
155155
diag1->compute_diagnostic();
156-
auto diag1_view_host = diag1_field.get_view<Real *, Host>();
156+
auto diag1_view_host = diag1_field.get_view<const Real *, Host>();
157157
for (int nlat = 0; nlat < nlats; nlat++) {
158158
REQUIRE_THAT(diag1_view_host(nlat), Catch::Matchers::WithinRel(zavg1, tol));
159159
}
@@ -167,7 +167,7 @@ TEST_CASE("zonal_avg") {
167167
diag2->compute_diagnostic();
168168
auto diag2_field = diag2->get_diagnostic();
169169

170-
auto diag2_view_host = diag2_field.get_view<Real **, Host>();
170+
auto diag2_view_host = diag2_field.get_view<const Real **, Host>();
171171
for (int i = 0; i < nlevs; ++i) {
172172
for (int nlat = 0; nlat < nlats; nlat++) {
173173
REQUIRE_THAT(diag2_view_host(nlat, i), Catch::Matchers::WithinRel(zavg2, tol));
@@ -180,7 +180,7 @@ TEST_CASE("zonal_avg") {
180180
FieldIdentifier diag3m_id("qc_zonal_avg_manual", diag3m_layout, kg / kg, grid->name());
181181
Field diag3m_field(diag3m_id);
182182
diag3m_field.allocate_view();
183-
auto qc3_view_h = qc3.get_view<Real ***, Host>();
183+
auto qc3_view_h = qc3.get_view<const Real ***, Host>();
184184
auto diag3m_view_h = diag3m_field.get_view<Real ***, Host>();
185185
for (int i = 0; i < ncols; i++) {
186186
const int nlat = i % nlats;

0 commit comments

Comments
 (0)