Skip to content

Commit

Permalink
Minor Big in override
Browse files Browse the repository at this point in the history
  • Loading branch information
manishvenu committed Oct 18, 2024
1 parent 73874aa commit 8476f28
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion regional_mom6/regional_mom6.py
Original file line number Diff line number Diff line change
Expand Up @@ -2505,7 +2505,7 @@ def setup_run_directory(
return

def change_MOM_parameter(
self, param_name, param_value=None, comment=None, delete=False
self, param_name, param_value=None, comment=None, override=True, delete=False
):
"""
*Requires already copied MOM parameter files in the run directory*
Expand Down Expand Up @@ -2542,6 +2542,7 @@ def change_MOM_parameter(

MOM_override_dict[param_name]["value"] = param_value
MOM_override_dict[param_name]["comment"] = comment
MOM_override_dict[param_name]["override"] = override
else:
if param_name in MOM_override_dict.keys():
original_val = MOM_override_dict[param_name]["value"]
Expand Down Expand Up @@ -2613,6 +2614,11 @@ def write_MOM_file(self, MOM_file_dict):
if "#override" in var:
var = var.replace("#override", "")
var = var.strip()
else:
# As in there wasn't an override before but we want one
if MOM_file_dict[var]["override"]:
lines[jj] = "#override " + lines[jj]
print("Added override to variable " + var + "!")
if var in MOM_file_dict.keys() and (
str(MOM_file_dict[var]["value"])
) != str(original_MOM_file_dict[var]["value"]):
Expand Down

0 comments on commit 8476f28

Please sign in to comment.