Skip to content

Add example script to check GCHP emission diagnostics entries in HISTORY.rc and HEMCO_Diagn.rc #357

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 5 commits into from
Apr 30, 2025

Conversation

yantosca
Copy link
Contributor

Name and Institution (Required)

Name: Bob Yantosca
Institution: Harvard + GCST

Describe the update

We have added an example script (plus documentation) to check the emission entries in the GCHP template files run/GCHP/HEMCO_Diagn.rc.templates/HEMCO_Diagn.rc.{simulation} and run/GCHP/HISTORY.rc.templates/HISTORY.rc.{simulation}. This will make it less likely that diagnostic entries will be listed in one file but not in the other (as often happens when new diagnostics are added).

Expected changes

$ git clone --recurse-submodules https://github.com/geoschem/GCHP
$ cd gchp/run
$ mamba activate gcpy_env    # If using mamba, or
$ python -m gcpy.examples.diagnostics.check_gchp_emission_diags . fullchem

will give output such as:

===============================================================================
Common to both HISTORY.rc and HEMCO_Diagn.rc
===============================================================================
  #EmisCH4_Anthro
  #EmisCH4_BioBurn
  #EmisCH4_Ship
  #EmisCH4_Total
  #EmisSESQ_Biogenic
  #InvAEIC_ACET
  #InvAEIC_ALD2
  #InvAEIC_ALK4
  #InvAEIC_BCPI
  #InvAEIC_C2H6
  #InvAEIC_C3H8
  ... etc ...
  EmisACET_BioBurn
  EmisACET_Biogenic
  EmisACET_Ocean
  EmisACET_Total
  EmisACR_BioBurn
  EmisACR_Total
  EmisACTA_BioBurn
  EmisACTA_Total
  EmisALD2_Anthro
  ... etc ...

===============================================================================
In HISTORY.rc but not in HEMCO_Diagn.rc
===============================================================================

===============================================================================
In HEMCO_Diagn.rc but not in HISTORY.rc
===============================================================================
  #EmisNO_Fert
  #InvCEDS_ALK6
  #InvGTChlorine_HCl

The output indicates that some diagnostics in HEMCO_Diagn.rc are not present in HISTORY.rc, and should be added there
for consistency. A comment before the emission entry means that the diagnostic will be disabled by default.

gcpy/benchmark/modules/emission_species.yml
- Added a comment that 'NO' must have quotes or else it will be
  interpreted as False

gcpy/examples/check_gchp_emission_diags.py
- Example script that reads GCHP emission diagnostic entries in
  HEMCO_Config.rc and HISTORY.rc template files to check for
  consistency.  Will print lists of entries that are common to both
  files, and in one file but not in the other.

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <[email protected]>
gcpy/examples/diagnostics/check_emission_diags.py
- Now return results in sorted order

Signed-off-by: Bob Yantosca <[email protected]>
docs/source/Check-GCHP-Emission-Diags.rst
- Documentation chapter for checking GCHP emission entries

docs/source/index.rst
- Added Check-GCHP-Emission-Diags to examples toctree

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <[email protected]>
@yantosca yantosca added category: Feature Request New feature or request topic: Example Scripts Related to GCPy example scripts labels Apr 17, 2025
@yantosca yantosca added this to the 1.7.0 milestone Apr 17, 2025
@yantosca yantosca requested a review from lizziel April 17, 2025 15:24
@yantosca yantosca self-assigned this Apr 17, 2025
@lizziel lizziel changed the base branch from main to dev April 29, 2025 20:19
Copy link
Contributor

@lizziel lizziel left a comment

Choose a reason for hiding this comment

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

Looks good. Just one typo that snuck in to fix.

"commandsm" -> "commands"

Signed-off-by: Bob Yantosca <[email protected]>
@yantosca yantosca requested a review from lizziel April 29, 2025 20:41
gcpy/examples/diagnostics/check_gchp_emission_diags.py
- In the "if name == '__main__' section of the code, the command
  "raiseValueError(msg)" is now "raiseValueError(MSG)".

Signed-off-by: Bob Yantosca <[email protected]>
@yantosca yantosca merged commit 63fc7c9 into dev Apr 30, 2025
@yantosca yantosca deleted the feature/check-gchp-emissions branch April 30, 2025 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Feature Request New feature or request topic: Example Scripts Related to GCPy example scripts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants