Skip to content

Commit

Permalink
black formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
wwieder committed Oct 6, 2023
1 parent 5f9b08c commit b429b63
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
26 changes: 15 additions & 11 deletions python/ctsm/site_and_regional/single_point_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

logger = logging.getLogger(__name__)

NAT_PFT = 15 # natural pfts
NUM_PFT = 17 # for runs with generic crops
MAX_PFT = 78 # for runs with explicit crops
NAT_PFT = 15 # natural pfts
NUM_PFT = 17 # for runs with generic crops
MAX_PFT = 78 # for runs with explicit crops

# -- constants to represent months of year
FIRST_MONTH = 1
Expand Down Expand Up @@ -134,8 +134,8 @@ def __init__(
self.dom_pft = dom_pft
self.pct_pft = pct_pft
self.num_pft = num_pft
self.cth = cth
self.cbh = cbh
self.cth = cth
self.cbh = cbh
self.include_nonveg = include_nonveg
self.uni_snow = uni_snow
self.cap_saturation = cap_saturation
Expand Down Expand Up @@ -207,12 +207,16 @@ def check_dom_pft(self):

# -- check dom_pft vs MAX_pft
if self.num_pft - 1 < max_dom_pft < NUM_PFT:
logger.info("WARNING, you trying to run with generic crops (16 PFT surface dataset)")
#raise argparse.ArgumentTypeError(err_msg)
logger.info(
"WARNING, you trying to run with generic crops (16 PFT surface dataset)"
)
# raise argparse.ArgumentTypeError(err_msg)

# -- check if all dom_pft are in the same range:
if min_dom_pft < NAT_PFT <= max_dom_pft:
logger.info("WARNING, you are subsetting using mixed land units that have both natural pfts and crop cfts. Check that your surface dataset looks correct.")
logger.info(
"WARNING, you are subsetting using mixed land units that have both natural pfts and crop cfts. Check that your surface dataset looks correct."
)

def check_nonveg(self):
"""
Expand Down Expand Up @@ -407,10 +411,10 @@ def modify_surfdata_atpoint(self, f_orig):

# -- loop over all dom_pft and pct_pft
zip_pfts = zip(self.dom_pft, self.pct_pft, self.cth, self.cbh)
for dom_pft, pct_pft,cth,cbh in zip_pfts:
for dom_pft, pct_pft, cth, cbh in zip_pfts:
if cth is not None:
f_mod["MONTHLY_HEIGHT_TOP"][:,:,:,dom_pft] = cth
f_mod["MONTHLY_HEIGHT_BOT"][:,:,:,dom_pft] = cbh
f_mod["MONTHLY_HEIGHT_TOP"][:, :, :, dom_pft] = cth
f_mod["MONTHLY_HEIGHT_BOT"][:, :, :, dom_pft] = cbh
if dom_pft < NAT_PFT:
f_mod["PCT_NAT_PFT"][:, :, dom_pft] = pct_pft
else:
Expand Down
2 changes: 1 addition & 1 deletion python/ctsm/subset_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def get_parser():
type=float,
default=None,
nargs="*",
)
)

# -- region-specific parser options
rg_parser.add_argument(
Expand Down

0 comments on commit b429b63

Please sign in to comment.