Skip to content
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

stc_qbo_enso #492

Closed
wants to merge 8 commits into from
Closed

stc_qbo_enso #492

wants to merge 8 commits into from

Conversation

delsbury
Copy link
Contributor

@delsbury delsbury commented Nov 1, 2023

This driver script (stc_qbo_enso.py) and its associated helper script (stc_qbo_enso_plottingcodeqbo.py and stc_qbo_enso_plottingcodeenso.py) do calculations to assess the representation of stratospheric teleconnections associated with the Quasi-Biennial Oscillation (QBO) and the El Nino Southern Oscillation (ENSO).

Associated issue # (replace this phrase and parentheses with the issue number)

How Has This Been Tested?
The POD has been tested with 1979-2014 data from "CESM2-WACCM_CMIP_historical_r1i1p1f1," the historical simulation for the first CESM2-WACCM ensemble member. The "run script" is called "config_file.jsonc." Running the POD produces six plots (3 for each hemisphere, north vs. south) that show the atmospheric response to the Quasi-Biennial Oscillation (QBO) and six plots (3 for each hemisphere) that show the atmospheric response to the El Nino Southern Oscillation. Observational equivalents are also produced using ERA5 data. The POD saves the model output file in the model/netCDF folder. The run time for the entire POD is ~ 25 minutes. Much of the POD code was written using Python 3.8.18, but has been tested and runs successfully with the active MDTF Python environments that use Python 3.11 >. The POD uses the following Python packages, with their versions shown in parentheses: xarray (20231.1.0), numpy (1.24.3), xesmf (0.6.0), matplotlib (3.2.2), cartopy (0.18.0), and scipy (1.9.1). Note that the POD runs successfuly with the MDTF conda environments activated, which means its robust to different versions of the aforementioned packages. All of this work was done of Mac OSX (current version: 12.7.1)

Checklist:

  • My branch is up-to-date with the NOAA-GFDL main branch, and all merge conflicts are resolved

YES

  • The scripts are written in Python 3.11 or above (preferred; required if funded by a CPO grant), NCL, or R

YES

  • All of my scripts are in the diagnostics/[POD short name] subdirectory, and include a main_driver script, template html, and settings.jsonc file

YES

  • I have made corresponding changes to the documentation in the POD's doc/ subdirectory
  • I have requested that the framework developers add packages required by my POD to the python3, NCL, or R environment yaml file if necessary, and my environment builds with conda_env_setup.sh
  • I have added any necessary data to input_data/obs_data/[pod short name] and/or input_data/model/[pod short name]

YES

YES

  • I have provided the code to generate digested data files from raw data files

YES

  • Each digested data file generated by the script contains numerical data (no figures), and is 3 GB or less in size

YES

  • I have included copies of the figures generated by the POD in the pull request

YES

  • The repository contains no extra test scripts or data files

YES

CESM2-WACCM_CMIP_historical_r1i1p1f1-1979-2014-enso34-psl-NH
CESM2-WACCM_CMIP_historical_r1i1p1f1-1979-2014-enso34-psl-SH
CESM2-WACCM_CMIP_historical_r1i1p1f1-1979-2014-enso34-uzm-NH
CESM2-WACCM_CMIP_historical_r1i1p1f1-1979-2014-enso34-uzm-SH
CESM2-WACCM_CMIP_historical_r1i1p1f1-1979-2014-enso34-vt-NH
CESM2-WACCM_CMIP_historical_r1i1p1f1-1979-2014-enso34-vt-SH
CESM2-WACCM_CMIP_historical_r1i1p1f1-1979-2014-qbo30hPa-metrics.txt
CESM2-WACCM_CMIP_historical_r1i1p1f1-1979-2014-qbo30hPa-psl-NH
CESM2-WACCM_CMIP_historical_r1i1p1f1-1979-2014-qbo30hPa-psl-SH
CESM2-WACCM_CMIP_historical_r1i1p1f1-1979-2014-qbo30hPa-uzm-NH
CESM2-WACCM_CMIP_historical_r1i1p1f1-1979-2014-qbo30hPa-uzm-SH
CESM2-WACCM_CMIP_historical_r1i1p1f1-1979-2014-qbo30hPa-vt-NH
CESM2-WACCM_CMIP_historical_r1i1p1f1-1979-2014-qbo30hPa-vt-SH

@wrongkindofdoctor wrongkindofdoctor self-assigned this Nov 1, 2023
@wrongkindofdoctor wrongkindofdoctor added the diagnostic Issue pertains to a contributed diagnostic label Nov 1, 2023
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link
Collaborator

@wrongkindofdoctor wrongkindofdoctor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@delsbury Thanks for submitting your POD to the MDTF-diagnostics repo. The documentation and POD scripts are in good shape-there is just some minor cleanup needed before I can merge the stc_qbo_enso POD into the main branch. In addition to the unused variables and imports identified by CodeQL, please make the requested changes to your PR.

@@ -0,0 +1,125 @@
// Configuration for MDTF-diagnostics driver script self-test.
//
// Copy this file and customize the settings as needed to run the framework on
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this file to diagnostics/stc_qbo_enso

@@ -54,6 +54,7 @@ def main(argv):
return 0 # will actually exit from print_help
else:
# case where we run the actual framework
print ('HERE')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove debug print statement from framework code

@@ -1049,6 +1049,8 @@ class MDTFTopLevelArgParser(MDTFArgParser):
"""Class for constructing the command-line interface, parsing the options,
and handing off execution to the selected subcommand.
"""

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove debugging print statement from framework code

@@ -616,7 +616,10 @@ def build_axes(self, *coords, verify=True):
# validate that we don't have duplicate axes
d = util.WormDict()
verify_d = util.WormDict()
print (verify_d, "verify_d")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove debugging print statements from framework code

@@ -483,6 +483,7 @@ def _iter_shallow_alternates(var):
for alts in v.alternates:
linked_alts.append([vlist_vars[v_name] for v_name in alts])
v.alternates = linked_alts
print (list(vlist_vars.values()), "list(vlist_vars.values())")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove debugging print statement from framework code

@@ -873,6 +874,7 @@ def from_struct(cls, pod_name, d, parent, **kwargs):
pod_name) from exc
try:
pod.varlist = Varlist.from_struct(d, parent=pod)
print (pod.varlist, "pod.varlist")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove debugging print statement from framework code

Comment on lines +40 to +43
The names of any environment variables set for the diagnostic (enclosed in
curly braces) will be replaced by the same values they had when the diagnostic
was run. For example, this diagnostic's favorite color is "{{EXAMPLE_FAV_COLOR}}."
</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove template lines

Comment on lines +14 to +17
<title>MDTF example diagnostic</title>
<img src="../mdtf_diag_banner.png">
<h3>Example diagnostic: time-averaged near-surface temperature</h3>
<p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change title and short description to match your POD

@delsbury delsbury closed this by deleting the head repository Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
diagnostic Issue pertains to a contributed diagnostic
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants