Skip to content

Conversation

lizziel
Copy link
Contributor

@lizziel lizziel commented Feb 25, 2025

Name and Institution (Required)

Name: Lizzie Lundgren
Institution: Harvard University

Describe the update

The purpose of this PR is to expand plot capabilities in the 1-month benchmark code to enable easier debugging and validation of GEOS-Chem collections not typically included in the benchmark. It includes the following updates:

  • Add new benchmark functions make_benchmark_collection_2d_var_plots and make_benchmark_collection_3d_var_plots which can be used with any GEOS-Chem output collection. Each function does a straight comparison of ref and dev without special handling beyond optionally limiting variable list to variables starting with a specific prefix.
  • Adds 1-month benchmark comparison plot options for Budget, UVFlux, and StateMet collections. All are off by default. StateMet plots are split up into 2D and 3D variable plot files. Comparisons include GCC vs GCC, GCHP vs GCC, and GCHP vs GCHP.
  • Update benchmark slurm script to run 1-month benchmark by default. This update is because the 1-month benchmark is run more frequently for debugging and feature validation than the 1-yr benchmark which was previously the default.

Note that the Budget, UVFlux, and StateMet plots all use the new generic collection comparison functions. These may be used as examples to quickly make comparison plots of other collections not configurable in the 1-month benchmark yaml.

Expected changes

This is a no diff update.

Reference(s)

None

Related Github Issue

None

@lizziel lizziel added category: Feature Request New feature or request topic: Benchmark Plots and Tables Issues pertaining to generating plots/tables from benchmark output labels Feb 25, 2025
@lizziel lizziel force-pushed the feature/generic_collection_plots_in_1mo_benchmark branch from 97deee7 to de2d65e Compare March 4, 2025 21:03
@yantosca yantosca force-pushed the feature/generic_collection_plots_in_1mo_benchmark branch from de2d65e to f2bc0b8 Compare April 30, 2025 14:58
@lizziel
Copy link
Contributor Author

lizziel commented Apr 30, 2025

@yantosca will test these updates. I was able to successfully generate comparison plots for GCC vs GCC and GCHP vs GCHP. There is an issue with GCC vs GCHP that needs investigation.

@yantosca
Copy link
Contributor

Thanks @lizziel. I've rebased this atop of GCPy 1.6.1 since the branch was older than that. Hope to have this sorted out soon.

lizziel added 6 commits April 30, 2025 11:41
Each function does a straight comparison of ref and dev without special
handling beyond optionally limiting variable list to variables starting
with a specific prefix.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
StateMet is split up into 2D and 3D variable plots. Comparisons include
GCC vs GCC, GCHP vs GCC, and GCHP vs GCHP. All new plots are off by
default.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
This update is because the 1-month benchmark is run more frequently for
debugging and feature validation than  the 1-yr benchmark which was
previously the default.

Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
@yantosca yantosca force-pushed the feature/generic_collection_plots_in_1mo_benchmark branch from f2bc0b8 to d1d17c4 Compare April 30, 2025 15:42
gcpy/benchmark/benchmark_slurm.sh
- Set environment variable MPLBACKEND to "agg", which will
  request a non-interactive matplotlib backend.  This is OK
  since we'll be printing plots directly to PDF files.

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
gcpy/benchmark/run_benchmark.py
- At the start of each section (GCC vs. GCC, GCHP vs GCC., GCHP vs. GCHP),
  2 variables (refmet and devmet) are created to hold the list of met
  field files to read.  We now pass these varaibles to the routines
  make_benchmark_collection_2d_var_plots and
  make_benchmark_collection_3d_var_plots for plotting the 2D and 3D
  StateMet output.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
gcpy/plot_compare_zonal_mean.py
- Added code to remove GCHP area variable Met_AREAM2 from the list
  of variables for which zonal mean comparisons will be made.
  This variable can show up in when we are creating GCHP vs GCC or
  GCHP vs GCHP zonal mean plots for the StateMet collection.

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
gcpy/util.py
- Implemented the following fixes:
  - A variable must have either (lon, lat) or (Xdim, Ydim) are in
    both Ref & Dev to be included in the commonvars_data list.
  - A variable must not have lev in both Ref & Dev to be included
    in the commonvars2D list.
  - A variable must have lev in both Ref & Dev to be included
    in the commonvars3D list.

gcpy/plot/compare_zonal_mean.py
- Removed the if block that removed Met_AreaM2 from varlist

CHANGELOG.md
- Updated accordingly

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
@yantosca yantosca marked this pull request as ready for review May 8, 2025 20:04
@yantosca yantosca requested a review from msulprizio May 8, 2025 20:04
@yantosca
Copy link
Contributor

yantosca commented May 8, 2025

@msulprizio I am making you a reviewer because @lizziel opened this PR and I pushed the most recent update... so we need 3rd party approval

@yantosca
Copy link
Contributor

yantosca commented May 8, 2025

@lizziel @msulprizio: I fixed a logic error in compare_varnames in util.py that was causing Met_AREAM2 (a 2-D array) to be lumped in with the 3-D arrays in the zonal mean plotting. We now get these outputs for GCHP vs. GCC:

note, the zonal mean files were too big to attach but the StratZonalMean files are proof that the code works.

@lizziel
Copy link
Contributor Author

lizziel commented May 8, 2025

Thanks @yantosca for finding and fixing that bug!

Copy link
Contributor Author

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

@yantosca, I did a quick review and made a couple notes on the debug code I think you might have added when diagnosing the Met_AREAM2 issue.

plot/compare_zonal_mean.py
- Remove debug print statement
- Remove obsolete comments

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
Copy link
Contributor

@msulprizio msulprizio 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 to merge!

@yantosca yantosca merged commit 0619fbf into dev May 9, 2025
17 checks passed
@yantosca yantosca deleted the feature/generic_collection_plots_in_1mo_benchmark branch May 9, 2025 14:31
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: Benchmark Plots and Tables Issues pertaining to generating plots/tables from benchmark output
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants