Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/general-ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,23 @@ jobs:
- name: Run the check_default_params script
run: python tests/check_default_params.py

# Job to check if duplicate parameters exist in param template files
check_duplicate_params:

runs-on: ubuntu-latest

steps:
# Checkout the repo
- uses: actions/checkout@v4

# Run the test
- name: Run the check_duplicate_params script
run: |
python tests/check_duplicate_params.py param_templates/MOM_input.yaml
python tests/check_duplicate_params.py param_templates/input_data_list.yaml
python tests/check_duplicate_params.py param_templates/input_nml.yaml
python tests/check_duplicate_params.py param_templates/diag_table.yaml

# Job to run check_input_data_list script
check_input_data_list:

Expand Down
9 changes: 6 additions & 3 deletions cime_config/buildnml
Original file line number Diff line number Diff line change
Expand Up @@ -399,10 +399,13 @@ def prechecks(case, inst_suffixes):
f"Missing rpointer files in rundir. Expected files with pattern {rpointer_pattern}.",
)

# check if the restart file is present in rundir
# check if the restart file is present in rundir for fresh branch or hybrid runs
if run_type in ["branch", "hybrid"] and not continue_run and not get_refcase:
restart_file = os.path.join(rundir, f'./{run_refcase}.mom6.r.{run_refdate}-{run_reftod}.nc')
assert os.path.exists(restart_file), f"Missing restart file {run_refcase}.mom6.r.{run_refdate}-{run_reftod}.nc in rundir."
restart_file_pattern = run_refcase + r".mom6.*.r." + run_refdate + "-" + run_reftod + r".*nc$"
restart_files = [
f for f in os.listdir(rundir) if re.match(restart_file_pattern, f)
]
assert len(restart_files) > 0, f"Missing restart file in rundir. Expected file matching pattern {restart_file_pattern}."

def postchecks(case, MOM_input_final):
"""Performs checks after input files are generated. To be called within prep_input() as a final step."""
Expand Down
26 changes: 5 additions & 21 deletions param_templates/MOM_input.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,6 @@ Global:
$OCN_GRID == "tx2_3v2": 480
$OCN_GRID == "tx0.25v1": 1080
$OCN_GRID == "MISOMIP": 40
IO_LAYOUT:
description: |
"default = 0
The processor layout to be used, or 0,0 to automatically
set the io_layout to be the same as the layout."
datatype: string
value: 1, 1
NK:
description: |
"[nondim]
Expand Down Expand Up @@ -295,7 +288,9 @@ Global:
"default = WRIGHT_FULL
EQN_OF_STATE determines which ocean equation of state should be used."
datatype: string
value: "WRIGHT_FULL"
value:
$OCN_GRID == "MISOMIP": "LINEAR"
else: "WRIGHT_FULL"
DTFREEZE_DP:
description: |
"[deg C Pa-1] default = 0.0
Expand Down Expand Up @@ -2946,16 +2941,6 @@ Global:
units: not defined
value:
$OCN_GRID == "MISOMIP": 1.0
EQN_OF_STATE:
description: |
"default = 'WRIGHT'
EQN_OF_STATE determines which ocean equation of state
should be used. Currently, the valid choices are
'LINEAR', 'UNESCO', and 'WRIGHT'.
This is only used if USE_EOS is true."
datatype: string
value:
$OCN_GRID == "MISOMIP": "LINEAR"
RHO_T0_S0:
description: |
"[kg m-3] default = 1000.0
Expand Down Expand Up @@ -3148,7 +3133,6 @@ Global:
target density."
datatype: logical
units: Boolean
value:
value:
$MOM6_VERTICAL_GRID == "hycom1" and $OCN_GRID == "tx2_3v2": True
ISOMIP_TNUDG:
Expand Down Expand Up @@ -3737,8 +3721,8 @@ Global:
be the same as the layout.
datatype: list
value:
$OCN_GRID == "tx0.25v1":
4, 3
$OCN_GRID == "tx0.25v1": 4, 3
else: 1, 1
AUTO_MASKTABLE:
description: |
Turn on automatic mask table generation to eliminate land blocks
Expand Down
3 changes: 0 additions & 3 deletions param_templates/input_data_list.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ mom.input_data_list:
$OCN_GRID in ["tx2_3v2", "tx0.25v1"]:
$INIT_LAYERS_FROM_Z_FILE == "True":
"${INPUTDIR}/${TEMP_SALT_Z_INIT_FILE}"
MAX_LAYER_THICKNESS_CONFIG:
$MOM6_VERTICAL_GRID == "hycom1" and $OCN_GRID in ["tx2_3v2"]:
"${DIN_LOC_ROOT}/ocn/mom/tx2_3v2/dz_max-2025-09-12.nc"
SURFACE_PRESSURE_FILE:
$OCN_GRID == "MISOMIP": "${INPUTDIR}/MISOMIP_181108.nc"
SALT_RESTORE_FILE:
Expand Down
20 changes: 11 additions & 9 deletions param_templates/json/MOM_input.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,6 @@
"$OCN_GRID == \"MISOMIP\"": 40
}
},
"IO_LAYOUT": {
"description": "The processor layout to be used, or 0,0 to automatically set the io_layout to\nbe the same as the layout.\n",
"datatype": "list",
"value": {
"$OCN_GRID == \"tx0.25v1\"": "4, 3"
}
},
"NK": {
"description": "\"[nondim]\nThe number of model layers.\"\n",
"datatype": "integer",
Expand Down Expand Up @@ -200,10 +193,11 @@
}
},
"EQN_OF_STATE": {
"description": "\"default = 'WRIGHT'\nEQN_OF_STATE determines which ocean equation of state\nshould be used. Currently, the valid choices are\n'LINEAR', 'UNESCO', and 'WRIGHT'.\nThis is only used if USE_EOS is true.\"\n",
"description": "\"default = WRIGHT_FULL\nEQN_OF_STATE determines which ocean equation of state should be used.\"\n",
"datatype": "string",
"value": {
"$OCN_GRID == \"MISOMIP\"": "LINEAR"
"$OCN_GRID == \"MISOMIP\"": "LINEAR",
"else": "WRIGHT_FULL"
}
},
"DTFREEZE_DP": {
Expand Down Expand Up @@ -3028,6 +3022,14 @@
"$COMP_WAV == \"ww3\" and $MOM6_WW3_CPL_METHOD == \"most\"": "0.04, 0.11, 0.33"
}
},
"IO_LAYOUT": {
"description": "The processor layout to be used, or 0,0 to automatically set the io_layout to\nbe the same as the layout.\n",
"datatype": "list",
"value": {
"$OCN_GRID == \"tx0.25v1\"": "4, 3",
"else": "1, 1"
}
},
"AUTO_MASKTABLE": {
"description": "Turn on automatic mask table generation to eliminate land blocks\n",
"datatype": "list",
Expand Down
2 changes: 1 addition & 1 deletion param_templates/json/input_data_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"$OCN_GRID == \"tx2_3v2\"": "${INPUTDIR}/lev-2025-09-12.nc"
},
"MAX_LAYER_THICKNESS_CONFIG": {
"$MOM6_VERTICAL_GRID == \"hycom1\" and $OCN_GRID in [\"tx2_3v2\"]": "${DIN_LOC_ROOT}/ocn/mom/tx2_3v2/dz_max-2025-09-12.nc"
"$OCN_GRID == \"tx2_3v2\"": "${INPUTDIR}/dz_max-2025-09-12.nc"
},
"DIAG_COORD_DEF_Z": {
"$OCN_GRID == \"tx0.25v1\"": "${INPUTDIR}/interpolate_zgrid_40L.nc"
Expand Down
Loading