Skip to content

Commit

Permalink
Add simple __init__() method to tower child types.
Browse files Browse the repository at this point in the history
  • Loading branch information
samsrabin committed Feb 15, 2025
1 parent 196bdc0 commit 8587867
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions python/ctsm/site_and_regional/neon_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class NeonSite(TowerSite):
A class for encapsulating neon sites.
"""

def __init__(self, *args, **kwargs):
super().__init__("NEON", *args, **kwargs)

def modify_user_nl(self, case_root, run_type, rundir, site_lines=None):
# TODO: include neon-specific user namelist lines, using this as just an example currently
if site_lines is None:
Expand Down
3 changes: 3 additions & 0 deletions python/ctsm/site_and_regional/plumber_site.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class Plumber2Site(TowerSite):
A class for encapsulating plumber sites.
"""

def __init__(self, *args, **kwargs):
super().__init__("PLUMBER2", *args, **kwargs)

def set_ref_case(self, case):
super().set_ref_case(case)
return True ### Check if super returns false, if this will still return True?
6 changes: 2 additions & 4 deletions python/ctsm/site_and_regional/run_tower.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,7 @@ def parse_neon_listing(listing_file, valid_neon_sites):
if site_name in line:
finidat = line.split(",")[0].split("/")[-1]

neon_site = NeonSite(
"NEON", site_name, start_year, end_year, start_month, end_month, finidat
)
neon_site = NeonSite(site_name, start_year, end_year, start_month, end_month, finidat)
logger.debug(neon_site)
available_list.append(neon_site)

Expand Down Expand Up @@ -194,7 +192,7 @@ def setup_plumber_data(valid_plumber_sites):
finidat = None

plumber_site = Plumber2Site(
"PLUMBER2", site_name, start_year, end_year, start_month, end_month, finidat
site_name, start_year, end_year, start_month, end_month, finidat
)
available_list.append(plumber_site)

Expand Down

0 comments on commit 8587867

Please sign in to comment.