Skip to content

Commit

Permalink
correct typos causing RunTimeError to be missed
Browse files Browse the repository at this point in the history
  • Loading branch information
glemieux committed May 23, 2024
1 parent 00d23e9 commit 2ac13bc
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions cime_config/SystemTests/pvt.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,29 @@
logger = logging.getLogger(__name__)

class PVT(SystemTestsCommon):
def __init_(self,case):
def __init__(self,case):
SystemTestsCommon.__init__(self,case)

# Do not allow PVT to be run with certain testmods
# Should this be targeted to a specific testmod for simplicity for now?
# Technically this could be run with the luh fates_harvest_modes
error_message = None
casebaseid = self._case.get_value("CASEBASEID")
casebasid = casebaseid.split("-")[-1]
casebaseid = casebaseid.split("-")[-1]
if casebaseid[0:10] != "FatesLUPFT":
error_message = (
"Only call PVT with test FatesLUPFT"
)
logger.error(error_message)
raise RuntimeError(error_message)
error_message = (f"Only call PVT with testmod FatesLUPFT. {casebaseid} selected.")

# Only allow to run if resolution is 4x5 for now
# Eventually we could set this up to generate the necessary land use x pft mapping
# on the fly, although this would also require generating the land use timeseries
# regridding on the fly which is a more time consuming endevour currently
lnd_grid = self._case.get_value("LND_GRID")
if lnd_grid != "4x5":
error_message = (
"PVT can currently only be run with 4x5 resolution"
)
error_message = (f"PVT can currently only be run with 4x5 resolution. {lnd_grid} selected.")

if error_message is not None:
logger.error(error_message)
raise RuntimeError(error_message)

def run_phase(self):
# -------------------------------------------------------------------
# (1) Run FATES spin-up case in potential vegetation mode
Expand Down

0 comments on commit 2ac13bc

Please sign in to comment.