Skip to content

Commit ed9849e

Browse files
committed
fix the issue with standard MOM6 grids:
Case creator attemps to set NTASKS_OCN for by checking OCN_NX and OCN_NY but those variables are not set for standard MOM6 grids. While we can retrieve them for standard grids too, we should still not change NTASKS for standard ocn grids, because they have associated, and optimized NTASKS values set in config_pes files.
1 parent 82ff46f commit ed9849e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

visualCaseGen/custom_widget_types/case_creator.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ def create_case(self, do_exec):
149149
print(f"{COMMENT}Navigating to the case directory:{RESET}\n")
150150
print(f"cd {caseroot}\n")
151151

152+
152153
# Apply case modifications, e.g., xmlchanges and user_nl changes
153154
self._apply_all_xmlchanges(do_exec)
154155

@@ -508,8 +509,8 @@ def _apply_all_xmlchanges(self, do_exec):
508509
else:
509510
assert lnd_grid_mode in [None, "", "Standard"], f"Unknown land grid mode: {lnd_grid_mode}"
510511

511-
# Set NTASKS based on grid size. e.g. NX * NY < max_pts_per_core
512-
if cvars["COMP_OCN"].value == "mom":
512+
# Set NTASKS based on grid size if custom ocn grid. e.g. NX * NY < max_pts_per_core
513+
if cvars["COMP_OCN"].value == "mom" and cvars["OCN_GRID_MODE"].value == "Custom":
513514
num_points = int(cvars["OCN_NX"].value) * int(cvars["OCN_NY"].value)
514515
cores = CaseCreator._calc_cores_based_on_grid(num_points)
515516
with self._out:

0 commit comments

Comments
 (0)