@@ -28,7 +28,7 @@ TEST_CASE("zonal_avg") {
28
28
using namespace ekat ::units;
29
29
30
30
// A numerical tolerance
31
- auto tol = std::numeric_limits<Real>::epsilon () * 100 ;
31
+ const auto tol = std::numeric_limits<Real>::epsilon () * 100 ;
32
32
33
33
// A world comm
34
34
ekat::Comm comm (MPI_COMM_WORLD);
@@ -153,7 +153,7 @@ TEST_CASE("zonal_avg") {
153
153
const Real zavg1 = sp (1.0 );
154
154
qc1.deep_copy (zavg1);
155
155
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>();
157
157
for (int nlat = 0 ; nlat < nlats; nlat++) {
158
158
REQUIRE_THAT (diag1_view_host (nlat), Catch::Matchers::WithinRel (zavg1, tol));
159
159
}
@@ -167,7 +167,7 @@ TEST_CASE("zonal_avg") {
167
167
diag2->compute_diagnostic ();
168
168
auto diag2_field = diag2->get_diagnostic ();
169
169
170
- auto diag2_view_host = diag2_field.get_view <Real **, Host>();
170
+ auto diag2_view_host = diag2_field.get_view <const Real **, Host>();
171
171
for (int i = 0 ; i < nlevs; ++i) {
172
172
for (int nlat = 0 ; nlat < nlats; nlat++) {
173
173
REQUIRE_THAT (diag2_view_host (nlat, i), Catch::Matchers::WithinRel (zavg2, tol));
@@ -180,7 +180,7 @@ TEST_CASE("zonal_avg") {
180
180
FieldIdentifier diag3m_id (" qc_zonal_avg_manual" , diag3m_layout, kg / kg, grid->name ());
181
181
Field diag3m_field (diag3m_id);
182
182
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>();
184
184
auto diag3m_view_h = diag3m_field.get_view <Real ***, Host>();
185
185
for (int i = 0 ; i < ncols; i++) {
186
186
const int nlat = i % nlats;
0 commit comments