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

Add a vertically resolved CO2 diagnostic #39

Merged
merged 3 commits into from
Jan 23, 2024

Conversation

spencerkclark
Copy link
Member

@spencerkclark spencerkclark commented Jan 10, 2024

Description

This PR adds a diagnostic for the carbon dioxide concentration used by the model, which is useful both for reference and debugging purposes.

This PR is also ensures that all 3D diagnostics-manager controlled diagnostics are only registered if gfs_physics_nml.ldiag3d is set to .true.; this prevents awkward crashes in the case that one requests a 3D physics field, but memory is not allocated for it. Note this requires a PR to the atmos_drivers repository (see NOAA-GFDL/atmos_drivers#33).

How Has This Been Tested?

I have tested this at C12 resolution in a short three hour run starting on 2016-08-01. The spatial pattern and global mean vertical profiles (on the order of 400 to 403 parts per million) both look reasonable.

2024-01-10-co2-diagnostic-instantaneous

2024-01-10-volume-and-time-mean-CO2

Checklist:

Please check all whether they apply or not

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

This is also ensures that all 3D diagnostics-manager controlled diagnostics are
only registered if gfs_physics_nml.ldiag3d is set to .true..
Comment on lines +3034 to +3044
index = index + 1
Diag_diag_manager_controlled(index)%axes = 3
Diag_diag_manager_controlled(index)%name = 'co2'
Diag_diag_manager_controlled(index)%desc = 'carbon dioxide concentration'
Diag_diag_manager_controlled(index)%unit = 'volume mixing ratio'
Diag_diag_manager_controlled(index)%mod_name = 'gfs_phys'
Diag_diag_manager_controlled(index)%coarse_graining_method = AREA_WEIGHTED
allocate (Diag_diag_manager_controlled(index)%data(nblks))
do nb = 1,nblks
Diag_diag_manager_controlled(index)%data(nb)%var3 => IntDiag(nb)%co2(:,:)
enddo
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only diagnostic field added; the other changes are related only to indentation.

@laurenchilutti
Copy link
Contributor

@spencerkclark Could you merge in the main branch? I just merged in a PR that resolves issues with the CI in this repository.

@spencerkclark
Copy link
Member Author

@laurenchilutti nice, sure thing!

Copy link
Contributor

@lharris4 lharris4 left a comment

Choose a reason for hiding this comment

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

This is very nice, thank you. The guardian flag for the 3d diagnostics is quite helpful. I also didn't realize that there were so many other GHGs available (n2o, ch4, co, and even CFCs), which opens up possibilities for GHG response studies.

@bensonr bensonr merged commit f329dbf into NOAA-GFDL:main Jan 23, 2024
74 checks passed
@spencerkclark spencerkclark deleted the co2-diagnostic branch January 23, 2024 12:51
spencerkclark added a commit to ai2cm/fv3net that referenced this pull request Jan 23, 2024
This PR bumps SHiELD-wrapper to include the latest SHiELD updates,
including a CO2 diagnostic:
NOAA-GFDL/SHiELD_physics#39.

Coverage reports (updated automatically):
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.

4 participants