Skip to content

Commit f0aef17

Browse files
committed
Merge branch 'jgfouca/fix_run_and_cmp' into master (PR #6805)
Fix bug in p3/shoc run_and_cmp The for loop that processes options was stopping too soon. I think maybe someone assumed that every option would have a value after it, but that is no longer true. Also, the -n (no-baseline) option conflicted with the nadv option for shoc, so I changed that to -l. This PR should fix the nightly fails for shoc_run_and_cmp. [BFB] * origin/jgfouca/fix_run_and_cmp: Fix bug in p3/shoc run_and_cmp
2 parents 25a9e14 + 79fadbc commit f0aef17

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

components/eamxx/src/physics/p3/tests/p3_run_and_cmp.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ int main (int argc, char** argv) {
260260
std::string predict_nc = "both";
261261
std::string prescribed_ccn = "both";
262262
std::string baseline_fn;
263-
for (int i = 1; i < argc-1; ++i) {
263+
for (int i = 1; i < argc; ++i) {
264264
if (ekat::argv_matches(argv[i], "-g", "--generate")) { generate = true; no_baseline = false; }
265265
if (ekat::argv_matches(argv[i], "-c", "--compare")) { no_baseline = false; }
266266
if (ekat::argv_matches(argv[i], "-b", "--baseline-file")) {
@@ -301,9 +301,6 @@ int main (int argc, char** argv) {
301301
expect_another_arg(i, argc);
302302
++i;
303303
repeat = std::atoi(argv[i]);
304-
if (repeat > 0) {
305-
generate = true;
306-
}
307304
}
308305
if (ekat::argv_matches(argv[i], "-pn", "--predict-nc")) {
309306
expect_another_arg(i, argc);

components/eamxx/src/physics/shoc/tests/shoc_run_and_cmp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ int main (int argc, char** argv) {
214214
" -i <cols> Number of columns(ncol). Default=8.\n"
215215
" -k <nlev> Number of vertical levels. Default=72.\n"
216216
" -q <num_qtracers> Number of q tracers. Default=3.\n"
217-
" -n <nadv> Number of SHOC loops per timestep. Default=15.\n"
217+
" -l <nadv> Number of SHOC loops per timestep. Default=15.\n"
218218
" -r <repeat> Number of repetitions, implies timing run (generate + no I/O). Default=0.\n";
219219

220220
return 1;
@@ -231,7 +231,7 @@ int main (int argc, char** argv) {
231231
Int repeat = 0;
232232
std::string baseline_fn;
233233
std::string device;
234-
for (int i = 1; i < argc-1; ++i) {
234+
for (int i = 1; i < argc; ++i) {
235235
if (ekat::argv_matches(argv[i], "-g", "--generate")) { generate = true; no_baseline = false; }
236236
if (ekat::argv_matches(argv[i], "-c", "--compare")) { no_baseline = false; }
237237
if (ekat::argv_matches(argv[i], "-b", "--baseline-file")) {
@@ -269,7 +269,7 @@ int main (int argc, char** argv) {
269269
++i;
270270
num_qtracers = std::atoi(argv[i]);
271271
}
272-
if (ekat::argv_matches(argv[i], "-n", "--nadv")) {
272+
if (ekat::argv_matches(argv[i], "-l", "--nadv")) {
273273
expect_another_arg(i, argc);
274274
++i;
275275
nadv = std::atoi(argv[i]);

0 commit comments

Comments
 (0)