Skip to content

Commit 4371b0a

Browse files
committed
Merge PR #389 (Use separate species database files for Ref & Dev)
This merge brings PR #389 (Modify benchmark scripts to look for species_database.yml files in Ref and Dev rundirs, by @yantosca) into the GCPy 1.7.0 development stream In PR #389, we have done the following: 1. Removed the paths:spcdb_dir YAML tag in *benchmark.yml config files. 2. Added function get_species_database_files in gcpy/benchmark/modules/benchmark_utils.py, which returns the absolute paths to species_database.yml files in Ref and Dev. 3. Added function read_species_metadata to gcpy/util.py, which accepts either a single file path to species_database.yml or a list of file paths to the species_database.yml files in the Ref & Dev rundirs) and returns the Ref and Dev species database dicts. If only one file path is passed, the same species database will be returned for both Ref and Dev. 4. Replaced the spcdb_dir keyword argument in several functions with spcdb_files, which can be of type str or list. 5. Modified gcpy/plot/compare_single_level.py and gcpy/plot/compare_zonal_mean.py to accept spcdb_files instead of spcdb_dir. Added corresponding logic so that the Ref species database is used with Ref data and the Dev species database is used with Ref data. 6. Fixed several issues: a. Renamed spcdb to metadata make_benchmark_aerosol_tables b. Added parentheses in routine face_area (in cstools.py) to force c orrect operator order c. Updated make_benchmark_aerosol_tables to include all dust species in the aerosol burdens table d. Updated make_benchmark_aerosol_tables to remove hardwiring in the computation of global AOD e. Restored missing YAML tags in 1yr_fullchem_benchmark.yml configuration file f. Added structural updates suggested by Pylint g. Fixed error in the determination of which variables are "Ref only" and "Dev only" in routine create_benchmark_emission_tables Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
2 parents 9b509d6 + 7296622 commit 4371b0a

25 files changed

+1520
-1448
lines changed

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1616
- Added new constants for default lon/lat and stretched-grid settings in `gcpy/constants.py`
1717
- Added PyDoc headers in routines where they were missing
1818
- Added `examples/grids/display_gcclassic_grid_info.py` to display info about a GEOS-Chem Classic horizontal grid
19+
- Added functions `get_molwt_from_metadata` and `read_species_metadata` to `gcpy/util.py`
20+
- Added function `get_species_database_files` to `gcpy/benchmark/modules/benchmark_utils.py`
21+
- Added constant `SPECIES_DATABASE` to `gcpy/benchmark/modules/benchmark_utils.py`
1922

2023
### Changed
2124
- Modified criteria for terminating read of log files in `benchmark_scrape_gcclassic_timers.py` to avoid being spoofed by output that is attached by Intel VTune
@@ -39,17 +42,22 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
3942
- Updated default GCPy Python environment to use Python 3.13 (instead of 3.12)
4043
- Benchmark routines now look for `species_database.yml` in the `Ref` and `Dev` run directories
4144
- Replaced `get_species_database_dir` with `get_species_database_files` in `gcpy/benchmark/modules/benchmark_funcs.py`
42-
- Replaced `spcdb_dir` YAML tag with directory-specific `species_metadata` tags to specify paths to `species_database.yml` files
45+
- Updated `gcpy/benchmark/modules/benchmark_scrape_gchp_timers.py` to look for GCHP timers in `allPEs.log` if not found in the log file
46+
- Updated routine `make_benchmark_aerosol_tables` to include all dust species in the aerosol burdens table
4347

4448
### Fixed
4549
- Fixed grid area calculation scripts of `grid_area` in `gcpy/gcpy/cstools.py`
4650
- Fixed various security issues in GitHub Actions workflows
4751
- Fixed colorbar bounds for case of comparing cubed-sphere grids
4852
- Fixed the restart regridding for stretched GCHP when target lat/lon is exactly 0.0 in `gcpy/regrid_restart_file.py`
53+
- Fixed computation of the global AOD benchmark table caused by hardwired species names
54+
- Fixed error in `create_benchmark_emissions_table` where all species were assumed to be in Ref and Dev even if they were not
4955

5056
### Removed
5157
- Removed `PdfMerger()` from `compare_single_level` and `compare_zonal_mean`, it has been removed in pypdf >= 5.0.0
5258
- Removed `.load()` statements from xarray Datasets to improve performance
59+
- Removed `paths:spcdb_dir` YAML tag in benchmark configuration files
60+
- Removed `st_Ox` from `benchmark_categories.yml`; this species is no longer used in TransportTracers simulations
5361

5462
## [1.6.2] - 2025-06-12
5563
### Added

gcpy/benchmark/cloud/template.1hr_benchmark.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ paths:
2929
main_dir: ${GEOSCHEM_BENCHMARK_WORKING_DIR}
3030
results_dir: BenchmarkResults
3131
weights_dir: ${GEOSCHEM_BENCHMARK_WORKING_DIR}/weights
32-
spcdb_dir: default
3332
#
3433
# data: Contains configurations for ref and dev runs
35-
# version: Version string (must not contain spaces)
36-
# dir: Path to run directory
37-
# outputs_subdir: Subdirectory w/ GEOS-Chem diagnostic files
38-
# restarts_subdir: Subdirectory w/ GEOS-Chem restarts
39-
# bmk_start: Simulation start date (YYYY-MM-DDThh:mm:ss)
40-
# bmk_end: Simulation end date (YYYY-MM-DDThh:mm:ss)
41-
# resolution: GCHP resolution string
34+
# version: Version string (must not contain spaces)
35+
# dir: Path to run directory
36+
# outputs_subdir: Subdirectory w/ GEOS-Chem diagnostic files
37+
# restarts_subdir: Subdirectory w/ GEOS-Chem restarts
38+
# logs_subdir: Subdirectory w/ GEOS-Chem log files
39+
# logs_template: Template for log file names (may include tokens)
40+
# bmk_start: Simulation start date (YYYY-MM-DDThh:mm:ss)
41+
# bmk_end: Simulation end date (YYYY-MM-DDThh:mm:ss)
42+
# resolution: GCHP resolution string
4243
#
4344
data:
4445
ref:

gcpy/benchmark/cloud/template.1mo_benchmark.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,15 @@ paths:
3232
spcdb_dir: default
3333
#
3434
# data: Contains configurations for ref and dev runs
35-
# version: Version string (must not contain spaces)
36-
# dir: Path to run directory
37-
# outputs_subdir: Subdirectory w/ GEOS-Chem diagnostic files
38-
# restarts_subdir: Subdirectory w/ GEOS-Chem restarts
39-
# bmk_start: Simulation start date (YYYY-MM-DDThh:mm:ss)
40-
# bmk_end: Simulation end date (YYYY-MM-DDThh:mm:ss)
41-
# resolution: GCHP resolution string
35+
# version: Version string (must not contain spaces)
36+
# dir: Path to run directory
37+
# outputs_subdir: Subdirectory w/ GEOS-Chem diagnostic files
38+
# restarts_subdir: Subdirectory w/ GEOS-Chem restarts
39+
# logs_subdir: Subdirectory w/ GEOS-Chem log files
40+
# logs_template: Template for log file names (may include tokens)
41+
# bmk_start: Simulation start date (YYYY-MM-DDThh:mm:ss)
42+
# bmk_end: Simulation end date (YYYY-MM-DDThh:mm:ss)
43+
# resolution: GCHP resolution string
4244
#
4345
data:
4446
ref:

gcpy/benchmark/config/1mo_benchmark.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,22 @@
2121
# main_dir: High-level directory containing ref & dev rundirs
2222
# results_dir: Directory where plots/tables will be created
2323
# weights_dir: Path to regridding weights
24-
# spcdb_dir: Folder in which the species_database.yml file is
25-
# located. If set to "default", then will look for
26-
# species_database.yml in one of the Dev rundirs.
2724
#
2825
paths:
2926
main_dir: /path/to/benchmark/main/dir
3027
results_dir: /path/to/BenchmarkResults
3128
weights_dir: /n/holylfs06/LABS/jacob_lab/Shared/GEOS-CHEM/gcgrid/gcdata/ExtData/GCHP/RegriddingWeights
32-
spcdb_dir: default
3329
#
3430
# data: Contains configurations for ref and dev runs
35-
# version: Version string (must not contain spaces)
36-
# dir: Path to run directory
37-
# outputs_subdir: Subdirectory w/ GEOS-Chem diagnostic files
38-
# restarts_subdir: Subdirectory w/ GEOS-Chem restarts
39-
# bmk_start: Simulation start date (YYYY-MM-DDThh:mm:ss)
40-
# bmk_end: Simulation end date (YYYY-MM-DDThh:mm:ss)
41-
# resolution: GCHP resolution string
31+
# version: Version string (must not contain spaces)
32+
# dir: Path to run directory
33+
# outputs_subdir: Subdirectory w/ GEOS-Chem diagnostic files
34+
# restarts_subdir: Subdirectory w/ GEOS-Chem restarts
35+
# logs_subdir: Subdirectory w/ GEOS-Chem log files
36+
# logs_template: Template for log file names (may include tokens)
37+
# bmk_start: Simulation start date (YYYY-MM-DDThh:mm:ss)
38+
# bmk_end: Simulation end date (YYYY-MM-DDThh:mm:ss)
39+
# resolution: GCHP resolution string
4240
#
4341
data:
4442
ref:

gcpy/benchmark/config/1yr_ch4_benchmark.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,11 @@
2121
# main_dir: High-level directory containing ref & dev rundirs
2222
# results_dir: Directory where plots/tables will be created
2323
# weights_dir: Path to regridding weights
24-
# spcdb_dir: Folder in which the species_database.yml file is
25-
# located. If set to "default", then will look for
26-
# species_database.yml in one of the Dev rundirs.
2724
#
2825
paths:
2926
main_dir: /path/to/benchmark/main/dir # EDIT AS NEEDED
3027
results_dir: /path/to/BenchmarkResults # EDIT AS NEEDED
3128
weights_dir: /n/holylfs06/LABS/jacob_lab/Shared/GEOS-CHEM/gcgrid/gcdata/ExtData/GCHP/RegriddingWeights
32-
spcdb_dir: default
3329
#
3430
# Observational data dirs are on Harvard Cannon, edit if necessary
3531
#
@@ -43,13 +39,15 @@ paths:
4339
site_file: allozonesondes_site_elev.csv
4440
#
4541
# data: Contains configurations for ref and dev runs
46-
# version: Version string (must not contain spaces)
47-
# dir: Path to run directory
48-
# outputs_subdir: Subdirectory w/ GEOS-Chem diagnostic files
49-
# restarts_subdir: Subdirectory w/ GEOS-Chem restarts
50-
# bmk_start: Simulation start date (YYYY-MM-DDThh:mm:ss)
51-
# bmk_end: Simulation end date (YYYY-MM-DDThh:mm:ss)
52-
# resolution: GCHP resolution string
42+
# version: Version string (must not contain spaces)
43+
# dir: Path to run directory
44+
# outputs_subdir: Subdirectory w/ GEOS-Chem diagnostic files
45+
# restarts_subdir: Subdirectory w/ GEOS-Chem restarts
46+
# logs_subdir: Subdirectory w/ GEOS-Chem log files
47+
# logs_template: Template for log file names (may include tokens)
48+
# bmk_start: Simulation start date (YYYY-MM-DDThh:mm:ss)
49+
# bmk_end: Simulation end date (YYYY-MM-DDThh:mm:ss)
50+
# resolution: GCHP resolution string
5351
#
5452
data:
5553
ref:

gcpy/benchmark/config/1yr_fullchem_benchmark.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,12 @@
2121
# main_dir: High-level directory containing ref & dev rundirs
2222
# results_dir: Directory where plots/tables will be created
2323
# weights_dir: Path to regridding weights
24-
# spcdb_dir: Folder in which the species_database.yml file is
25-
# located. If set to "default", then will look for
26-
# species_database.yml in one of the Dev rundirs.
2724
# obs_data: Paths to observations (for models vs. obs plots)
2825
#
2926
paths:
3027
main_dir: /path/to/benchmark/main/dir
3128
results_dir: /path/to/BenchmarkResults
3229
weights_dir: /n/holylfs06/LABS/jacob_lab/Shared/GEOS-CHEM/gcgrid/gcdata/ExtData/GCHP/RegriddingWeights
33-
spcdb_dir: default
3430
#
3531
# Observational data dirs are on Harvard Cannon, edit if necessary
3632
#
@@ -44,13 +40,16 @@ paths:
4440
site_file: allozonesondes_site_elev.csv
4541
#
4642
# data: Contains configurations for ref and dev runs
47-
# version: Version string (must not contain spaces)
48-
# dir: Path to run directory
49-
# outputs_subdir: Subdirectory w/ GEOS-Chem diagnostic files
50-
# restarts_subdir: Subdirectory w/ GEOS-Chem restarts
51-
# bmk_start: Simulation start date (YYYY-MM-DDThh:mm:ss)
52-
# bmk_end: Simulation end date (YYYY-MM-DDThh:mm:ss)
53-
# resolution: GCHP resolution string
43+
# version: Version string (must not contain spaces)
44+
# dir: Path to run directory
45+
# outputs_subdir: Subdirectory w/ GEOS-Chem diagnostic files
46+
# restarts_subdir: Subdirectory w/ GEOS-Chem restarts
47+
# logs_subdir: Subdirectory w/ GEOS-Chem log files
48+
# logs_template: Template for log file names (may include tokens)
49+
# bmk_start: Simulation start date (YYYY-MM-DDThh:mm:ss)
50+
# bmk_end: Simulation end date (YYYY-MM-DDThh:mm:ss)
51+
# resolution: GCHP resolution string
52+
#
5453
#
5554
data:
5655
ref:
@@ -134,15 +133,18 @@ options:
134133
plot_drydep: True
135134
plot_emis: True
136135
plot_jvalues: True
136+
plot_models_vs_obs: True
137137
plot_options:
138138
by_spc_cat: True
139139
by_hco_cat: True
140140
#
141141
# Benchmark tables
142142
#
143+
aer_budget_table: True
143144
emis_table: True
144145
mass_accum_table: False
145146
mass_table: True
147+
Ox_budget_table: True
146148
OH_metrics: True
147149
ops_budget_table: False
148150
sanity_check_table: True

gcpy/benchmark/config/1yr_tt_benchmark.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,23 @@
2121
# main_dir: High-level directory containing ref & dev rundirs
2222
# results_dir: Directory where plots/tables will be created
2323
# weights_dir: Path to regridding weights
24-
# spcdb_dir: Folder in which the species_database.yml file is
25-
# located. If set to "default", then will look for
26-
# species_database.yml in one of the Dev rundirs.
2724
#
2825
paths:
2926
main_dir: /path/to/benchmark/main/dir
3027
results_dir: /path/to/BenchmarkResults
3128
weights_dir: /n/holylfs06/LABS/jacob_lab/Shared/GEOS-CHEM/gcgrid/gcdata/ExtData/GCHP/RegriddingWeights
32-
spcdb_dir: default
3329
#
3430
# data: Contains configurations for ref and dev runs
35-
# version: Version string (must not contain spaces)
36-
# dir: Path to run directory
37-
# outputs_subdir: Subdirectory w/ GEOS-Chem diagnostic files
38-
# restarts_subdir: Subdirectory w/ GEOS-Chem restarts
39-
# bmk_start: Simulation start date (YYYY-MM-DDThh:mm:ss)
40-
# bmk_end: Simulation end date (YYYY-MM-DDThh:mm:ss)
41-
# resolution: GCHP resolution string
31+
# version: Version string (must not contain spaces)
32+
# dir: Path to run directory
33+
# outputs_subdir: Subdirectory w/ GEOS-Chem diagnostic files
34+
# restarts_subdir: Subdirectory w/ GEOS-Chem restarts
35+
# logs_subdir: Subdirectory w/ GEOS-Chem log files
36+
# logs_template: Template for log file names (may include tokens)
37+
# bmk_start: Simulation start date (YYYY-MM-DDThh:mm:ss)
38+
# bmk_end: Simulation end date (YYYY-MM-DDThh:mm:ss)
39+
# resolution: GCHP resolution string
40+
#
4241
#
4342
data:
4443
ref:

gcpy/benchmark/modules/benchmark_categories.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ TransportTracersBenchmark:
256256
- e90_n
257257
- e90_s
258258
- st80_25
259-
- stOX
260259
WetLossConv:
261260
WetLossConv:
262261
- Pb210

gcpy/benchmark/modules/benchmark_drydep.py

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def make_benchmark_drydep_plots(
1818
refstr,
1919
dev,
2020
devstr,
21+
spcdb_files,
2122
collection="DryDep",
2223
dst="./benchmark",
2324
subdst=None,
@@ -30,7 +31,6 @@ def make_benchmark_drydep_plots(
3031
n_job=-1,
3132
time_mean=False,
3233
varlist=None,
33-
spcdb_dir=None,
3434
):
3535
"""
3636
Creates six-panel comparison plots (PDF format) from GEOS-Chem
@@ -48,6 +48,8 @@ def make_benchmark_drydep_plots(
4848
data set.
4949
devstr: str
5050
A string to describe dev (e.g. version number)
51+
spcdb_files : list
52+
Paths to species_database.yml files in Ref & Dev rundirs
5153
5254
Keyword Args (optional):
5355
collection : str
@@ -79,20 +81,13 @@ def make_benchmark_drydep_plots(
7981
Set to 1 to disable parallel plotting. Value of -1 allows the
8082
application to decide.
8183
Default value: -1
82-
spcdb_dir: str
83-
Directory of species_datbase.yml file
84-
Default value: None
8584
time_mean : bool
8685
Determines if we should average the datasets over time
8786
Default value: False
8887
varlist: list of str
8988
List of variables to plot. If varlist is None, then
9089
all common variables in Ref & Dev will be plotted.
9190
"""
92-
# Make sure the species database folder is passed
93-
if spcdb_dir is None:
94-
msg = "The spcdb_dir argument has not been specified!"
95-
raise ValueError(msg)
9691

9792
# Replace whitespace in the ref and dev labels
9893
refstr = util.replace_whitespace(refstr)
@@ -144,7 +139,7 @@ def make_benchmark_drydep_plots(
144139
sigdiff_list=sigdiff_list,
145140
weightsdir=weightsdir,
146141
n_job=n_job,
147-
spcdb_dir=spcdb_dir
142+
spcdb_files=spcdb_files,
148143
)
149144
util.add_bookmarks_to_pdf(
150145
pdfname,

0 commit comments

Comments
 (0)