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

Flow-Dependent, Cross-Timescale Model Diagnostic POD #127

Open
wants to merge 120 commits into
base: main
Choose a base branch
from

Conversation

drewmresnick
Copy link

Submission of Dummy PR

This PR only includes a partially complete diagnostics documentation file. The rest of the documentation and additional files are still being compiled.

@jkrasting jkrasting added the diagnostic Issue pertains to a contributed diagnostic label Feb 2, 2021
@jkrasting jkrasting changed the title Dummy PR for 'flow-dependent, cross-timescale model diagnostic' POD Flow-Dependent, Cross-Timescale Model Diagnostic POD Feb 2, 2021
Copy link
Collaborator

@jkrasting jkrasting left a comment

Choose a reason for hiding this comment

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

Thanks @drewmresnick

diagnostics/flow_dep_diags/doc/flow_dep_diags.rst Outdated Show resolved Hide resolved
@bitterbark
Copy link
Collaborator

bitterbark commented Feb 5, 2021 via email

tsjackson-noaa
tsjackson-noaa previously approved these changes Feb 9, 2021
@lgtm-com
Copy link
Contributor

lgtm-com bot commented Feb 10, 2021

This pull request introduces 5 alerts when merging ca56b80 into 333fac2 - view on LGTM.com

new alerts:

  • 3 for Unused import
  • 1 for Except block handles 'BaseException'
  • 1 for Syntax error

@lgtm-com
Copy link
Contributor

lgtm-com bot commented Jun 22, 2021

This pull request introduces 7 alerts when merging 89b8d69 into 578f3d6 - view on LGTM.com

new alerts:

  • 6 for Unused local variable
  • 1 for Unused import

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.

@drewmresnick I've requested some final minor corrections. Also, remove the unused variables and module import caught by LGTM.

diagnostics/flow_dep_diag/flow_dep_diag.py Outdated Show resolved Hide resolved
diagnostics/flow_dep_diag/flow_dep_diag.py Outdated Show resolved Hide resolved
diagnostics/flow_dep_diag/flow_dep_diag.py Outdated Show resolved Hide resolved
diagnostics/flow_dep_diag/flow_dep_diag.py Outdated Show resolved Hide resolved
src/default_tests.jsonc Outdated Show resolved Hide resolved
@@ -157,6 +156,22 @@
"units": "W m-2",
"ndim": 3
},
// Variables for flow_dep_diag module:
Copy link
Collaborator

Choose a reason for hiding this comment

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

We need to add in the companion fields to the GFDL and CMIP fieldlists

Copy link
Author

Choose a reason for hiding this comment

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

@jkrasting Is this then not something I need to worry about?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@drewmresnick This is a todo for the framework team, so one of us will take care of it.

Copy link
Contributor

@tsjackson-noaa tsjackson-noaa Jul 1, 2021

Choose a reason for hiding this comment

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

Thanks for bringing this to my attention. Unfortunately constructions of the from variable_at_XX_mbar aren't CF standard names [*].

The way variables on pressure levels are intended to be specified in the settings file is described in the documentation: the level is specified separately with a scalar_coordinate attribute, which refers to a vertical coordinate axis defined in the dimensions section of the file. By spelling out what's meant in more detail like this, it e.g. enables the framework to extract levels from 3D data on the fly in a fully units-aware way.

For more examples of how this is set up, look at the settings file for the Wheeler-Kiladis diagnostic.

[*]: I haven't been able to find a concise reference for this: the upshot is that standard names are meant to identify physical quantities, independently of how that quantity is sampled in space or time (but there are exceptions to this, such as air_pressure_at_sea_level, which deal with physical rather than mathematical boundaries). Variables on pressure levels in the CMIP6 data request don't use different standard names in this way (example), and pressure levels aren't one of the cases covered in construction of derived standard names.

diagnostics/flow_dep_diag/ClimAnom_func.py Outdated Show resolved Hide resolved
diagnostics/flow_dep_diag/PyWR.py Show resolved Hide resolved

#the diagnostic assumes your grid has a longitudinal range -180,180
#Shift your grid from 0,360 using the following lines
ds.coords['lon'] = (ds.coords['lon'] + 180) % 360 - 180 #shift the values
Copy link
Collaborator

Choose a reason for hiding this comment

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

Test condition before applying the shift.

Copy link
Author

Choose a reason for hiding this comment

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

I do not think it needs to test for a condition because if the values are between -180,180 the correct grid units will be retained using this calculation. I will add comments to explain this.

@@ -0,0 +1,103 @@
name: MDTF_flow_dep_diag
Copy link
Collaborator

Choose a reason for hiding this comment

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

This YAML is overly prescriptive. At a minimum, remove the build codes. Consider just listing the main top-level packages rather than every dependency.

Copy link
Author

Choose a reason for hiding this comment

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

@jkrasting Is there a way to automatically generate the yaml file with only top-level packages. I know at least for removing the build codes I can use the --no-builds flag.

Copy link
Collaborator

@wrongkindofdoctor wrongkindofdoctor Jul 9, 2021

Choose a reason for hiding this comment

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

@drewmresnick you can try using conda env export --from-history > flow_dep_diag.yml per this SO reply. However, the post states that this will not include package versions. Otherwise, you'll have to modify the file manually, as conda does not seem to have this exact capability.

@wrongkindofdoctor
Copy link
Collaborator

Hi, @drewmresnick. It's been a while since you've updated your PR, so I'm just checking to make sure that things are going okay with the development. Let me know if you have any ?'s, or need help with anything.

@wrongkindofdoctor wrongkindofdoctor changed the base branch from develop to main June 17, 2022 14:27
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.

5 participants