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

Support GEOS-Chem "History" diagnostics in CESM-GC #11

Merged
merged 10 commits into from Nov 17, 2022

Conversation

jimmielin
Copy link

@jimmielin jimmielin commented Nov 3, 2022

This is based-off GCHP's gchp_historyexports_mod.F90 to create cesmgc_history_mod.F90.

It will support any GEOS-Chem diagnostic in HISTORY.rc (without wildcards) to be output in CAM history. The names will be the same.

Notes:

  • An updated HISTORY.rc for GC/run/CESM will need to be used to remove wildcards and write out everything explicitly. A companion PR in the GEOS-Chem science repository is here: Update CESM/HISTORY.rc geos-chem#1480
  • cam_history_support.F90 has been changed to make the maximum field length 32 chars. A companion PR in the ESCOMP/CAM repository to request CAM to update this upstream is here: part of cam6_3_084 : Update maximum CAM history field length to 32 (up from 24). ESCOMP/CAM#686
  • We probably need to clean up cesmgc_diag_mod.F90 to remove obsolete code. I've commented out the sections adding the Jval_ diagnostics, as they have been fully superceded by cesmgc_history_mod.F90.

@lizziel
Copy link

lizziel commented Nov 16, 2022

The new GEOS-Chem PR that goes with this is geoschem/geos-chem#1509. I closed out the old one so that we could bring it into 14.0.2, and so that I could push updates to it as well. The file no longer includes any wildcards (several had just a few tags so I manually put them in, and the others I just put ozone), and I removed most of the budget diagnostics since the components they are from are not used in CESM. I also removed the convection diagnostics.

I tested out the new file using this branch, turning all GEOS-Chem collections on, thereby enabling allocation of all diagnostics listed in the file. I then added at least one diagnostic from each GEOS-Chem collection to user_cam_nl. I ran into an error due to name conflict between CESM diagnostic PM25 and GEOS-Chem diagnostic PM25, so I commented the GEOS-Chem one out in HISTORY.rc with a note about duplicate name.

The workflow to turn on diagnostics in GEOS-Chem and output in CESM actually wasn't too bad. I did run into issues where I miscopied some of the GEOS-Chem diagnostic names to user_nl_cam and so ran into errors. However, all errors were well documented in the log and easy to fix. I liked how it was easy to find all the diagnostic options for GEOS-Chem within HISTORY.rc. Without that guide it would be really hard to know what would be possible to put in user_nl_cam. Question: Is there a similar guide for CAM diagnostics?

I looked at the output values for all of the GEOS-Chem diagnostics I added to user_nl_cam. All of them were non-zero except for the fields I included from the Aerosols and AerosolMass collections. This made me realize we need to add some additional diagnostics subroutine calls to CAM that we have in GC-Classic main.F and in GCHP gchp_chunk_mod.F90. These include:

  1. Set_Diagnostics_EndofTimestep
  2. Zero_Diagnostics_StartofTimestep
  3. Set_AerMass_Diagnostic

@jimmielin, I can add these in after merging this PR. Or if you want to put them in CAM for this update that works too.

@jimmielin
Copy link
Author

Thanks Lizzie!

Question: Is there a similar guide for CAM diagnostics?

Yes. There are guides here for some CAM-chem output, https://wiki.ucar.edu/display/camchem/Using+CAM-chem+Output, but the real resource lies in the "master field list", which is in atm.log right at the beginning of the run. You will see that I have populated the list with the GEOS-Chem diagnostic descriptions as well, so it will be very useful to see the list of all available output fields (a few thousand of them are possible!)

Apologies for missing the aerosol mass diagnostics code. Please feel free to put them in after merging the PR, I forgot that they're not set together from within DO_CHEMISTRY.

Thanks!
Haipeng

src/chemistry/geoschem/cesmgc_history_mod.F90 Outdated Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_history_mod.F90 Outdated Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_history_mod.F90 Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_history_mod.F90 Outdated Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_history_mod.F90 Outdated Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_history_mod.F90 Outdated Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_history_mod.F90 Outdated Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_history_mod.F90 Outdated Show resolved Hide resolved
@jimmielin
Copy link
Author

No longer needs to allocate temporaries. I checked and diagnostics have values as expected, except the ones which correspond to Set_Diagnostics_EndofTimestep. Good for another round of review. Thanks!

Copy link

@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.

Thanks for cleaning up the allocation. This is much better!

src/chemistry/geoschem/cesmgc_diag_mod.F90 Outdated Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_diag_mod.F90 Outdated Show resolved Hide resolved
src/chemistry/geoschem/chemistry.F90 Outdated Show resolved Hide resolved
src/chemistry/geoschem/chemistry.F90 Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_history_mod.F90 Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_history_mod.F90 Outdated Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_history_mod.F90 Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_history_mod.F90 Outdated Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_history_mod.F90 Outdated Show resolved Hide resolved
src/chemistry/geoschem/cesmgc_history_mod.F90 Outdated Show resolved Hide resolved
Copy link

@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.

Thanks for making all the changes. Ready for merge.

@lizziel lizziel merged commit 6553464 into CESM-GC_rebased_on_cam6_0_034 Nov 17, 2022
@jimmielin jimmielin deleted the hplin/new_history_diags branch March 2, 2023 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants