Skip to content

Commit c44cf05

Browse files
committed
relax not_compset constraint for default grids
1 parent 713c856 commit c44cf05

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

visualCaseGen/cime_interface.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
Compset = namedtuple("Compset", ["alias", "lname", "model"])
1616
Resolution = namedtuple("Resolution", ["alias", "compset", "not_compset", "desc"])
17-
ComponentGrid = namedtuple("ComponentGrid", ["name", "nx", "ny", "mesh", "desc", "compset_constr", "not_compset_constr"])
17+
ComponentGrid = namedtuple("ComponentGrid", ["name", "nx", "ny", "mesh", "desc", "compset_constr", "not_compset_constr", "is_default"])
1818

1919

2020
class CIME_interface:
@@ -399,6 +399,7 @@ def _get_domains(self):
399399
desc=desc+support,
400400
compset_constr=set(), # to be filled in later
401401
not_compset_constr=set(), # to be filled in later
402+
is_default=False # to be updated later
402403
)
403404

404405
return domains
@@ -433,9 +434,8 @@ def _retrieve_domains_and_resolutions(self):
433434
self.resolutions = []
434435

435436
# Loop through model grid defaults. i.e., default grids for each model, to populate self.domains
436-
# We currently don't make use of the model grid defaults, but we still read them in case any
437-
# domain is only listed in the model grid defaults and not in the model grids. In that case,
438-
# we want to make sure that the domain is still included in the self.domains dict.
437+
# We read them in case any domain is only listed in the model grid defaults and not in the model grids.
438+
# In that case, we want to make sure that the domain is still included in the self.domains dict.
439439
model_grid_defaults = self._grids_obj.get_child("model_grid_defaults", root=grids)
440440
default_grids = self._grids_obj.get_children("grid", root=model_grid_defaults)
441441
for default_grid in default_grids:
@@ -454,6 +454,7 @@ def _retrieve_domains_and_resolutions(self):
454454
desc=domains[comp_grid].desc,
455455
compset_constr=set(),
456456
not_compset_constr=set(),
457+
is_default=True
457458
)
458459
domain_found[comp_grid] = True
459460

@@ -495,6 +496,7 @@ def _retrieve_domains_and_resolutions(self):
495496
desc=domains[comp_grid].desc,
496497
compset_constr=set(),
497498
not_compset_constr=set(),
499+
is_default=False
498500
)
499501
domain_found[comp_grid] = True
500502

visualCaseGen/specs/grid_options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ def check_comp_grid(comp_class, proposed_grid, compset_lname):
9696
proposed_grid.compset_constr, compset_lname
9797
):
9898
return False
99-
if proposed_grid.not_compset_constr and re.search(
99+
if (not proposed_grid.is_default) and proposed_grid.not_compset_constr and re.search(
100100
proposed_grid.not_compset_constr, compset_lname
101101
):
102102
return False

0 commit comments

Comments
 (0)