-
Notifications
You must be signed in to change notification settings - Fork 341
b4b-dev: Plumber2 Implementation #2406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 31 commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
7d061f9
preliminary plumber files
TeaganKing a508497
include plumber2site values in config_component.xml
TeaganKing 11cafe6
general setup to run plumber
TeaganKing fdbc70c
update cime config
TeaganKing dd028a3
reformat
TeaganKing 80e94fe
remove run_length since overwritten by usermods dirs
TeaganKing 83b3ed5
remove run_length from plumber_site and update args
TeaganKing 0b6e209
update tests; include cases with experiment label in gitignore
TeaganKing 7a0f7f2
update plumber for consistency and fix import
TeaganKing dc44a68
updates to run_tower
TeaganKing 459f0ce
make adjustments for valid plumber vs neon sites
TeaganKing e3e806e
updates to checking plumber data
TeaganKing 1bca632
now correctly finding all plumber sites
TeaganKing bf2dad3
allow for None for either plumber or neon sites
TeaganKing c82efb8
fixed location of plumber data
TeaganKing d523301
a few other fixes for having None option for either neon or plumber
TeaganKing cc2da4d
include plumber filesin gitignore
TeaganKing bc94326
update default run type to be ad for plumber and remain transient for…
TeaganKing 1970863
resolve 'Do not know about batch job case.run' with updated run type …
TeaganKing df69f23
Update plumber_site.py script documentation
TeaganKing 3e43097
Update run_tower.py to do's
TeaganKing f2e03b2
update testing for neon and plumber
TeaganKing 4e93b99
black formatting for test
TeaganKing 5164bb7
remove run_lenght arg
TeaganKing a7462b1
testing updates-- test_sys_run_tower still fails
TeaganKing 24897b3
test updates
TeaganKing 0e8375a
Update plumber_site.py with minor comment
TeaganKing b98f8ee
address some of Will's comments
TeaganKing 52c9786
add clarifying comments
TeaganKing aa06d7a
allow skipping of modify_user_nl and also add a few other clarificati…
TeaganKing 39b3023
formatting
TeaganKing ca84b47
Update python/ctsm/site_and_regional/neon_site.py
TeaganKing b3bbddd
Update python/ctsm/site_and_regional/plumber_site.py
TeaganKing e2d83e4
Fix a couple pylint errors
ekluzek eae7eb3
Merge remote-tracking branch 'escomp/b4b-dev' into plumber
ekluzek 809d4ca
Fix some pylint errors
ekluzek 1b34b25
Fix a pylint error
ekluzek 74b665b
Fix so plumber2 sites have the right directory and get the list
ekluzek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,115 @@ | ||
| """ | ||
| This module contains the Plumber2Site class and class functions which are used in run_tower.py | ||
TeaganKing marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| """ | ||
|
|
||
| # Import libraries | ||
| import logging | ||
| import os | ||
| import sys | ||
|
|
||
| # Get the ctsm util tools and then the cime tools. | ||
| _CTSM_PYTHON = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "python")) | ||
| sys.path.insert(1, _CTSM_PYTHON) | ||
|
|
||
| # -- import local classes for this script | ||
| # pylint: disable=wrong-import-position | ||
| from ctsm.site_and_regional.tower_site import TowerSite | ||
|
|
||
| # pylint: disable=wrong-import-position, import-error, unused-import, wrong-import-order | ||
| from ctsm import add_cime_to_path | ||
| from ctsm.path_utils import path_to_ctsm_root | ||
|
|
||
| from CIME import build | ||
| from CIME.case import Case | ||
| from CIME.utils import safe_copy, expect, symlink_force | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| # pylint: disable=too-many-instance-attributes | ||
| class Plumber2Site(TowerSite): | ||
| """ | ||
| A class for encapsulating plumber sites. | ||
| """ | ||
|
|
||
| def build_base_case( | ||
| self, | ||
| cesmroot, | ||
| output_root, | ||
| res, | ||
| compset, | ||
| user_mods_dirs=None, | ||
| overwrite=False, | ||
| setup_only=False, | ||
| ): | ||
| if user_mods_dirs is None: | ||
| user_mods_dirs = [ | ||
| os.path.join(self.cesmroot, "cime_config", "usermods_dirs", "PLUMBER2", self.name) | ||
| ] | ||
| case_path = super().build_base_case(cesmroot, output_root, res, compset, user_mods_dirs) | ||
|
|
||
| return case_path | ||
|
|
||
| # pylint: disable=too-many-statements | ||
| def run_case( | ||
| self, | ||
| base_case_root, | ||
| run_type, | ||
| prism, | ||
TeaganKing marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| user_version, | ||
| tower_type=None, | ||
| user_mods_dirs=None, | ||
| overwrite=False, | ||
| setup_only=False, | ||
| no_batch=False, | ||
| rerun=False, | ||
| experiment=False, | ||
| ): | ||
| """ | ||
| Run case. | ||
| Args: | ||
| self | ||
| base_case_root: str, opt | ||
| file path of base case | ||
| run_type: str, opt | ||
| transient, post_ad, or ad case, default ad | ||
| (ad case is default because PLUMBER requires spinup) | ||
| prism: bool, opt | ||
wwieder marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| if True, use PRISM precipitation, default False | ||
| Note: only supported for NEON sites | ||
| user_version: str, opt | ||
| default 'latest'; this could be useful later | ||
| This is currently only implemented with neon (not plumber) sites | ||
| overwrite: bool, opt | ||
| default False | ||
| setup_only: bool, opt | ||
| default False; if True, set up but do not run case | ||
| no_batch: bool, opt | ||
| default False | ||
| rerun: bool, opt | ||
| default False | ||
| experiment: str, opt | ||
| name of experiment, default False | ||
| """ | ||
| user_mods_dirs = [ | ||
| os.path.join(self.cesmroot, "cime_config", "usermods_dirs", "PLUMBER2", self.name) | ||
| ] | ||
| tower_type = "PLUMBER" | ||
| super().run_case( | ||
| base_case_root, | ||
| run_type, | ||
| prism, | ||
| user_version, | ||
| tower_type, | ||
| user_mods_dirs, | ||
| overwrite, | ||
| setup_only, | ||
| no_batch, | ||
| rerun, | ||
| experiment, | ||
| ) | ||
|
|
||
| def set_ref_case(self, case): | ||
| super().set_ref_case(case) | ||
| return True ### Check if super returns false, if this will still return True? | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.