Skip to content

Commit

Permalink
ACCESS-ESM1.5 QA test: Update error messages for CICE configurations …
Browse files Browse the repository at this point in the history
…tests
  • Loading branch information
jo-basevi committed Aug 28, 2024
1 parent e92cad4 commit 0e91aec
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/model_config_tests/qa/test_access_esm1p5_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,9 @@ def test_cice_configuration_icefields_nml_in_ice_history_nml(
cice_control_path = control_path / model_name

icefields_nml_error_msg = (
"Expected CICE configuration to have ice_history.nml that "
"contains an icefields_nml namelist. This is to keep icefields "
"namelist separate from the cice_in.nml to allow simpler changes."
f"Expected CICE configuration to have {ICE_HISTORY_NML_FNAME} that "
f"contains an {ICEFIELDS_NML_NAME} namelist. This is to keep icefields "
f"namelist separate from the {CICE_IN_NML_FNAME} to allow simpler changes."
)

# Check ice_history.nml exists
Expand All @@ -225,9 +225,15 @@ def test_cice_configuration_icefields_nml_in_ice_history_nml(

# Check icefields_nml not in cice_in.nml
cice_in_path = cice_control_path / CICE_IN_NML_FNAME
assert cice_in_path.is_file()
assert cice_in_path.is_file(), (
f"No {CICE_IN_NML_FNAME} file found. This is a required "
"configuration file for the CICE model component."
)
cice_in = f90nml.read(cice_in_path)
assert ICEFIELDS_NML_NAME not in cice_in, icefields_nml_error_msg
assert ICEFIELDS_NML_NAME not in cice_in, (
f"{ICEFIELDS_NML_NAME} namelist found in {CICE_IN_NML_FNAME}. "
f"This should only be in {ICE_HISTORY_NML_FNAME} to prevent duplication."
)

# Check no repeated fields between the two namelist files
common_nmls = set(cice_in) & set(ice_history_nml)
Expand Down

0 comments on commit 0e91aec

Please sign in to comment.