Skip to content

Commit e69814a

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 e69814a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

visualCaseGen/custom_widget_types/case_creator.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,12 +149,19 @@ 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+
153+
print(f"{COMMENT}dbg-1{RESET}\n")
154+
152155
# Apply case modifications, e.g., xmlchanges and user_nl changes
153156
self._apply_all_xmlchanges(do_exec)
154157

158+
print(f"{COMMENT}dbg-2{RESET}\n")
159+
160+
155161
# Run case.setup
156162
run_case_setup(do_exec, self._is_non_local(), self._out)
157163

164+
print(f"{COMMENT}dbg-3{RESET}\n")
158165
# Apply user_nl changes
159166
self._apply_all_namelist_changes(do_exec)
160167

@@ -508,8 +515,8 @@ def _apply_all_xmlchanges(self, do_exec):
508515
else:
509516
assert lnd_grid_mode in [None, "", "Standard"], f"Unknown land grid mode: {lnd_grid_mode}"
510517

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

0 commit comments

Comments
 (0)