-
Notifications
You must be signed in to change notification settings - Fork 16
Zppy pcmdi enhancement #815
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
Draft
zhangshixuan1987
wants to merge
21
commits into
main
Choose a base branch
from
zppy_pcmdi_enhancement
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
c8aa983
Claude-Augment enhancement on zppy-pcmdi
zhangshixuan1987 4220184
Claude-augument enhancement: fix time precision and bnds dimension wa…
zhangshixuan1987 7c0e1cf
Rebase to latest main
zhangshixuan1987 5040692
Rebase to latest main
zhangshixuan1987 e4e3b17
Claude-Augment Enhancement for robustness
zhangshixuan1987 a550cb6
bug fix
zhangshixuan1987 5e38c52
precommit refromat
zhangshixuan1987 bede594
rebase to latest main
zhangshixuan1987 7767d88
Ajust to allow enso metrics and revise enso vars to be identified by
zhangshixuan1987 faf9999
Modify the job dependency workflow for the pcmdi
zhangshixuan1987 aa1a3f4
Enanble ts processing on mpaso and mpassi model output
zhangshixuan1987 4b0370d
Correct the variable name for default setup for enso
zhangshixuan1987 44fce79
Bug fix in zppy/templates/ts.bash for variable filtering in global
zhangshixuan1987 3d24cde
Fix the ocean and seaice data processing typ setup
zhangshixuan1987 6345cfd
Add export MPLBACKEND=Agg to the pcmdi workflow
zhangshixuan1987 1595ef6
Enable MPAS ocean/sea-ice time-series processing to support pcmdi
zhangshixuan1987 740f231
Fix by pre-commit check
zhangshixuan1987 d2c8d7f
Rebase code to the main branch and refactor MPAS regrid handling
zhangshixuan1987 f17a7e1
Update tests for MPAS TS defaults
zhangshixuan1987 9b02629
Remove obsolete mpas_rst_template default
zhangshixuan1987 984e77e
Save PCMDI mean climate data
zhangshixuan1987 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
Some comments aren't visible on the classic Files Changed page.
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
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 |
|---|---|---|
|
|
@@ -54,9 +54,9 @@ def pcmdi_diags(config, script_dir, existing_bundles, job_ids_file): | |
| define_current_set(c) | ||
| if c["current_set"] == "enso": | ||
| logger.warning( | ||
| "The 'enso' set is not yet supported in PCMDI Diags. Skipping launching of associated jobs." | ||
| "The 'enso' set is currently a testing mode in PCMDI Diags. Turn on it with care." | ||
| ) | ||
| break # Skip this task | ||
| # continue # Skip this task | ||
| c["sub"] = get_value_from_parameter( | ||
| c, "subsection", "sub", ParameterInferenceType.SECTION_INFERENCE | ||
| ) | ||
|
|
@@ -89,7 +89,7 @@ def pcmdi_diags(config, script_dir, existing_bundles, job_ids_file): | |
|
|
||
| if c["current_set"] != "synthetic_plots": | ||
| check_and_define_parameters(c) | ||
| print(c["prefix"]) | ||
| logger.debug(c["prefix"]) | ||
| define_relevant_years(c) | ||
| else: | ||
| prefix = f"pcmdi_diags_{c['sub']}_{c['run_type']}" | ||
|
|
@@ -119,21 +119,8 @@ def pcmdi_diags(config, script_dir, existing_bundles, job_ids_file): | |
| if c["current_set"] != "synthetic_plots": | ||
| for yr in range(c["year1"], c["year2"], c["ts_num_years"]): | ||
| add_ts_dependencies(c, dependencies, script_dir, yr) | ||
| set_value_of_parameter_if_undefined( | ||
| c, | ||
| "e3sm_to_cmip_atm_subsection", | ||
| "atm_monthly_180x360_aave", | ||
| ParameterInferenceType.SECTION_INFERENCE, | ||
| ) | ||
| add_dependencies( | ||
| dependencies, | ||
| script_dir, | ||
| "e3sm_to_cmip", | ||
| c["e3sm_to_cmip_atm_subsection"], | ||
| c["year1"], | ||
| c["year2"], | ||
| c["ts_num_years"], | ||
| ) | ||
| for yr in range(c["year1"], c["year2"], c["ts_num_years"]): | ||
| add_e3sm_to_cmip_dependencies(c, dependencies, script_dir, yr) | ||
| else: | ||
| if i < len(year_sets) - 1: | ||
| continue | ||
|
|
@@ -345,22 +332,79 @@ def define_relevant_years_for_synthetic_plots(c: Dict[str, Any]) -> None: | |
| c["enso_years"] = year_str | ||
|
|
||
|
|
||
| def _as_subsection_list(subsection: str) -> List[str]: | ||
| return [item.strip() for item in subsection.split(",") if item.strip()] | ||
|
|
||
|
|
||
| def add_ts_dependencies( | ||
| c: Dict[str, Any], dependencies: List[str], script_dir: str, yr: int | ||
| ): | ||
| start_yr = yr | ||
| end_yr = yr + c["ts_num_years"] - 1 | ||
|
|
||
| if c["current_set"] in BASE_PCMDI_SETS: | ||
| add_dependencies( | ||
| dependencies, | ||
| script_dir, | ||
| "ts", | ||
| # Ensure the key exists because set_value_of_parameter_if_undefined() | ||
| # only fills values for existing keys with an empty string. | ||
| if "ts_subsection" not in c: | ||
| c["ts_subsection"] = "" | ||
|
|
||
| set_value_of_parameter_if_undefined( | ||
| c, | ||
| "ts_subsection", | ||
| "atm_monthly_180x360_aave", | ||
| ParameterInferenceType.SECTION_INFERENCE, | ||
| ) | ||
|
|
||
| ts_subsections = [ | ||
| item.strip() for item in c["ts_subsection"].split(",") if item.strip() | ||
| ] | ||
|
|
||
| for ts_subsection in ts_subsections: | ||
| add_dependencies( | ||
| dependencies, | ||
| script_dir, | ||
| "ts", | ||
| ts_subsection, | ||
| start_yr, | ||
| end_yr, | ||
| c["ts_num_years"], | ||
| ) | ||
|
|
||
|
|
||
| def add_e3sm_to_cmip_dependencies( | ||
| c: Dict[str, Any], dependencies: List[str], script_dir: str, yr: int | ||
| ): | ||
|
Comment on lines
+374
to
+376
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From Claude:
|
||
| start_yr = yr | ||
| end_yr = yr + c["ts_num_years"] - 1 | ||
|
|
||
| if c["current_set"] in BASE_PCMDI_SETS: | ||
| if "e3sm_to_cmip_atm_subsection" not in c: | ||
| c["e3sm_to_cmip_atm_subsection"] = "" | ||
|
|
||
| set_value_of_parameter_if_undefined( | ||
| c, | ||
| "e3sm_to_cmip_atm_subsection", | ||
| "atm_monthly_180x360_aave", | ||
| start_yr, | ||
| end_yr, | ||
| c["ts_num_years"], | ||
| ParameterInferenceType.SECTION_INFERENCE, | ||
| ) | ||
|
|
||
| e3sm_to_cmip_atm_subsections = [ | ||
| item.strip() | ||
| for item in c["e3sm_to_cmip_atm_subsection"].split(",") | ||
| if item.strip() | ||
| ] | ||
|
|
||
| for e3sm_to_cmip_atm_subsection in e3sm_to_cmip_atm_subsections: | ||
| add_dependencies( | ||
| dependencies, | ||
| script_dir, | ||
| "e3sm_to_cmip", | ||
| e3sm_to_cmip_atm_subsection, | ||
| start_yr, | ||
| end_yr, | ||
| c["ts_num_years"], | ||
| ) | ||
|
|
||
|
|
||
| def add_pcmdi_dependencies( | ||
| c: Dict[str, Any], dependencies: List[str], script_dir: str | ||
|
|
@@ -370,6 +414,8 @@ def add_pcmdi_dependencies( | |
| status_suffix = f"_{c['year1']:04d}-{c['year2']:04d}" | ||
| elif c["run_type"] == "model_vs_model": | ||
| status_suffix = f"_{c['year1']:04d}-{c['year2']:04d}_vs_{c['ref_year1']:04d}-{c['ref_year2']:04d}" | ||
| else: | ||
| raise ValueError(f"Invalid run_type={c['run_type']}") | ||
|
|
||
| if c["clim_viewer"]: | ||
| status_file = os.path.join( | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From Claude:
The
ensoset now runs instead of being skipped. A few questions: (1) Is this intentional and isensoconsidered stable enough for general use? (2) The commented-outcontinueis misleading — if the intent is to allow it to run, the comment should be removed entirely rather than left as dead code. (3) The warning message has a grammatical issue: "Turn on it with care" should be "Use with care" or "Enable with care."There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a big change -- is this the PR that enables ENSO support for
pcmdi_diags?