From 144da57073a95ee25e5ae3e040e4ac3babb0eb93 Mon Sep 17 00:00:00 2001 From: Luca Bertagna Date: Thu, 16 May 2024 17:02:37 -0600 Subject: [PATCH] EAMxx: fix OOB access in nudging unit test --- components/eamxx/src/physics/nudging/tests/nudging_tests.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/eamxx/src/physics/nudging/tests/nudging_tests.cpp b/components/eamxx/src/physics/nudging/tests/nudging_tests.cpp index 8870b4cce20..51773cb249d 100644 --- a/components/eamxx/src/physics/nudging/tests/nudging_tests.cpp +++ b/components/eamxx/src/physics/nudging/tests/nudging_tests.cpp @@ -169,6 +169,9 @@ TEST_CASE("nudging_tests") { auto fine_h = fine.get_view(); auto data_h = data.get_view(); const bool is_pmid = data.name()=="p_mid"; + const int nlevs_fine = 2*nlevs_data-1; + const int top = 0; + const int bot = nlevs_fine-1; for (int icol=0; icol