Skip to content

Commit

Permalink
Merge PR #277 (Update model vs. obs benchmark scripts)
Browse files Browse the repository at this point in the history
This merge brings PR # (Add inquiry functions to return nearest model
data to a (lat,lon) location; Update benchmark model vs. obs scripts;
Add models vs sondes output, by @yantosca) into the GCPy development
stream.

This PR adds the following functionality:

1. Inquiry functions to return nearest model data to a (lat,lon) location
   for both GCClassic and GCHP grids

2. Updated benchmark vs. model scripts.  Also added a script to plot
   model vs. sonde data

3. Updated get_vert_grid in gcpy/util.py to accept a surface pressure,
   so that we can generate GEOS-Chem vertical level information starting
   at other pressures than the default 1013.25 hPa.

Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
  • Loading branch information
yantosca committed Feb 9, 2024
2 parents 99de641 + 567342f commit 811760d
Show file tree
Hide file tree
Showing 9 changed files with 1,077 additions and 515 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- Script `./release/changeVersionNumbers.sh`, used to update version numbers in various files before release
- Mamba/Conda enviroment file `docs/environment_files/read_the_docs_environment.yml`, for building ReadTheDocs documentation
- Environment files `docs/environment_files/gcpy_requirements.txt` and `docs/environment_files/read_the_docs_requirements.txt`
- New benchmark script `gcpy/benchmark/modules/benchmark_models_vs_sondes.py`

### Changed
- Bump pip from 23.2.1 to 23.3 (dependabot suggested this)
Expand All @@ -26,6 +27,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- `environment.yml` links to `docs/environment_files/gcpy_environment.yml`
- `requirements.txt` links to `docs/environment_files/requirements.txt`
- Python packages for RTD documenation builds from `docs/environment_files/environment.yml`
- Script `benchmark_model_vs_obs.py` now uses grid inquiry functions from `grid.py` to return data nearest to a (lat,lon) location
- Moved routine `get_geoschem_level_metadata` to `gcpy/benchmark/modules/benchmark_utils.py`
- Refactored `get_vert_grid.py` (in `gcpy/grid.py`) to accept the `p_sfc` argument; Also never-nested the if-block logic.
- `benchmark_slurm.sh` script now saves output to a log file with the same base name as the YAML config file
- `benchmark_models_vs_obs.py` now reads the observational data paths and metadata from `1yr_fullchem_benchmark.yml`

### Fixed
- CS inquiry functions in `gcpy/cstools.py` now work properly for `xr.Dataset` and `xr.DataArray` objects
Expand All @@ -39,8 +45,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### Removed
- Example script `gcpy/examples/plotting/mda8_o3_timeseries.py`
- Removed `Pylint` GitHub action

### Removed
- Environment file `docs/environment_files/environment.yml`
- Environment file `docs/environment_files/requirements.txt`
- Removed `awscli` from the GCPy environment; version 2 is no longer available on conda-forge or PyPi
Expand Down
2 changes: 1 addition & 1 deletion gcpy/benchmark/benchmark_slurm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ config="1yr_fullchem_benchmark.yml"
#config="1yr_tt_benchmark.yml"

# Call the run_benchmark script to make the plots
python -m gcpy.benchmark.run_benchmark "${config}" > benchmark.log 2>&1
python -m gcpy.benchmark.run_benchmark "${config}" > "${config/.yml/.log}: 2>&1
# Turn off python environment
mamba deactivate
Expand Down
14 changes: 12 additions & 2 deletions gcpy/benchmark/config/1yr_fullchem_benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,24 @@
# spcdb_dir: Folder in which the species_database.yml file is
# located. If set to "default", then will look for
# species_database.yml in one of the Dev rundirs.
# obs_data_dir: Path to observational data (for models vs obs plots)
# obs_data: Paths to observations (for models vs. obs plots)
#
paths:
main_dir: /path/to/benchmark/main/dir
results_dir: /path/to/BenchmarkResults
weights_dir: /n/holyscratch01/external_repos/GEOS-CHEM/gcgrid/data/ExtData/GCHP/RegriddingWeights
spcdb_dir: default
obs_data_dir: /path/to/observational/data
#
# Observational data dirs are on Harvard Cannon, edit if necessary
#
obs_data:
ebas_o3:
data_dir: /n/jacob_lab/Lab/obs_data_for_bmk/ebas_sfc_o3_2019
data_label: "O3 (EBAS, 2019)"
sondes:
data_dir: /n/jacob_lab/Lab/obs_data_for_bmk/sondes_2010-2019
data_file: allozonesondes_2010-2019.csv
site_file: allozonesondes_site_elev.csv
#
# data: Contains configurations for ref and dev runs
# version: Version string (must not contain spaces)
Expand Down
Loading

0 comments on commit 811760d

Please sign in to comment.