diff --git a/payu/models/cesm_cmeps.py b/payu/models/cesm_cmeps.py index d65b34b3..8c172a7e 100644 --- a/payu/models/cesm_cmeps.py +++ b/payu/models/cesm_cmeps.py @@ -195,7 +195,7 @@ def _setup_checks(self): nthreads = int(self.runconfig.get("PELAYOUT_attributes", f"{realm}_nthreads")) rootpe = int(self.runconfig.get("PELAYOUT_attributes", f"{realm}_rootpe")) pestride = int(self.runconfig.get("PELAYOUT_attributes", f"{realm}_pestride")) - npes = (ntasks-1)*nthreads*pestride #count to the last process, starting at 0 + npes = (ntasks-1)*nthreads*pestride # count to the last process, starting at 0 if (rootpe + npes) > cpucount: raise ValueError( f"Insufficient cpus for the {realm} pelayout in {NUOPC_CONFIG}" @@ -204,7 +204,7 @@ def _setup_checks(self): # check iolayout if realm == "cpl": comp = "MED" # med and cpl names are both used in runconfig - else : + else: comp = realm.upper() if comp in self.runconfig.get_component_list(): io_section = f"{comp}_modelio" @@ -218,9 +218,9 @@ def _setup_checks(self): ) match nc_type: - case "netcdf" : + case "netcdf": break - case "netcdf4p" | "pnetcdf" : + case "netcdf4p" | "pnetcdf": if self.runconfig.get(io_section, "pio_async_interface") == ".false." : niotasks = int(self.runconfig.get(io_section, "pio_numiotasks")) iostride = int(self.runconfig.get(io_section, "pio_stride")) @@ -235,7 +235,7 @@ def _setup_checks(self): f"netcdf4c in {io_section} of {NUOPC_CONFIG} is deprecated, " "use netcdf4p" ) - case _ : + case _: raise ValueError( f"The iotype for {io_section} in {NUOPC_CONFIG} is " 'invalid, valid options are "netcdf", "pnetcdf" and "netcdf4p"' @@ -364,7 +364,7 @@ def get(self, section, variable, value=None): return self.contents[span[0]:span[1]] else: return value - + def get_component_list(self, value=None): """ Get the `component_list`