Skip to content

Commit

Permalink
Merge branch 'develop' into feature/new_abiotic_model
Browse files Browse the repository at this point in the history
  • Loading branch information
vgro committed Jan 15, 2024
2 parents fd352c6 + dd41f74 commit 0ed12ef
Show file tree
Hide file tree
Showing 64 changed files with 2,777 additions and 2,356 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"
- uses: pre-commit/[email protected]

test:
Expand All @@ -19,7 +19,7 @@ jobs:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ "3.9" , "3.10", "3.11" ]
python-version: [ "3.10", "3.11" ]

steps:
- uses: actions/checkout@v3
Expand All @@ -40,7 +40,7 @@ jobs:
run: poetry run pytest --cov-report xml

- name: Upload coverage to Codecov
if: (matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9')
if: (matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10')
uses: codecov/codecov-action@v3

docs_build:
Expand All @@ -50,7 +50,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.10"

- name: Install Poetry
uses: abatilo/[email protected]
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ repos:
rev: v0.33.0
hooks:
- id: markdownlint
- repo: https://github.com/asottile/pyupgrade
rev: v3.13.0
hooks:
- id: pyupgrade
args: [--py310-plus]
4 changes: 4 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ class MyReferenceStyle(AuthorYearReferenceStyle):
("py:class", "virtual_rainforest.models.abiotic.energy_balance.EnergyBalance"),
# Something off about JSONSchema intersphinx mapping?
("py:obj", "virtual_rainforest.core.schema.ValidatorWithDefaults.ID_OF"),
# HACK - sphinx seems to thing GRID_STRUCTURE_SIG is a tuple not a type alias
("py:obj", "virtual_rainforest.core.grid.GRID_STRUCTURE_SIG.__repr__"),
("py:obj", "virtual_rainforest.core.grid.GRID_STRUCTURE_SIG.count"),
("py:obj", "virtual_rainforest.core.grid.GRID_STRUCTURE_SIG.index"),
]
intersphinx_mapping = {
"numpy": ("https://numpy.org/doc/stable/", None),
Expand Down
43 changes: 26 additions & 17 deletions docs/source/data_recipes/CDS_toolbox_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ of the Virtual Rainforest. This document describes how to download climate data
the Copernicus [Climate Data Store](https://cds.climate.copernicus.eu/) (CDS) and basic
pre-processing options using the
[CDS toolbox](https://cds.climate.copernicus.eu/cdsapp#!/toolbox).
At present, the pre-processing does not include scaling or topographic adjustment.
You need to create a user account to access all data and functionalities.

NOTE: You need to create a user account to access all data and functionalities.
```{note}
At present, the pre-processing does not include scaling or topographic adjustment.
```

## Climate input variables

Expand All @@ -33,7 +35,7 @@ variables (or derivatives) at each time step (default: monthly means):

* Air temperature (typically 2m; mean, minimum, and maximum)
* Air humidity (typically 2m; relative or specific humidity)
* Air pressure (typically mean sealevel or surface pressure)
* Air pressure (typically mean sea level or surface pressure)
* Wind speed (typically 10m)
* Precipitation

Expand Down Expand Up @@ -63,12 +65,15 @@ simulations:

ERA5-Land is a reanalysis dataset providing a consistent view of the evolution of land
variables over several decades at an enhanced resolution compared to ERA5 (0.1 x 0.1
deg resolution).
deg).

The full documentation and download link can be accessed
[here for hourly data](https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-land?tab=overview)
and [here for monthly data](https://cds.climate.copernicus.eu/cdsapp#!/dataset/reanalysis-era5-land-monthly-means?tab=overview)

Example code to manipulate downloaded ERA5-Land data as used in the `vr_run` example
is available [here](../../../virtual_rainforest/example_data/generation_scripts/climate_example_data.py).

* WFDE5

This global dataset provides bias-corrected reconstruction of near-surface
Expand All @@ -77,7 +82,9 @@ simulations:
available in hourly and daily time steps for the period 1979-2019 in 0.5 x 0.5 deg
resolution.

The full documentation and download link can be accessed [here](https://cds.climate.copernicus.eu/cdsapp#!/dataset/derived-near-surface-meteorological-variables?tab=overview).
The full documentation and download link can be accessed
[here](https://cds.climate.copernicus.eu/cdsapp#!/dataset/derived-near-surface-meteorological-variables?tab=overview)
.

* CORDEX-SEA

Expand All @@ -90,15 +97,15 @@ simulations:

The full documentation and download link can be accessed [here](https://cds.climate.copernicus.eu/cdsapp#!/dataset/projections-cordex-domains-single-levels?tab=overview).

* Atmospheric CO2
* Atmospheric $\ce{CO_{2}}$

Observed global CO2 levels (Mauna Loa, NOAA/GML) are available in monthly or annual
resolution (1958 - present) [here](https://gml.noaa.gov/ccgg/trends/graph.html).
Monthly data derived from satellite observation (2002 - present) is available
Observed global $\ce{CO_{2}}$ levels (Mauna Loa, NOAA/GML) are available in monthly or
annual resolution (1958 - present) [here](https://gml.noaa.gov/ccgg/trends/graph.html)
. Monthly data derived from satellite observation (2002 - present) is available
[here](https://cds.climate.copernicus.eu/cdsapp#!/dataset/satellite-carbon-dioxide?tab=overview)
. Alternatively, reconstructed gridded monthly CO2 data for the historical period
(1953 - 2013) and future CMIP6 scenarios (2015 - 2150) can be downloaded
[here](https://zenodo.org/record/5021361){cite:p}`cheng_wei_global_2021`.
. Alternatively, reconstructed gridded monthly $\ce{CO_{2}}$ data for the historical
period (1953 - 2013) and future CMIP6 scenarios (2015 - 2150) can be downloaded
[here](https://zenodo.org/record/5021361) {cite:p}`cheng_wei_global_2021`.

## Step-by-step example

Expand All @@ -109,7 +116,7 @@ data, navigate to the tab 'Download Data'.
### Selection

This is an example of a selection of tabs to download historical '2m air temperature'
from the CORDEX-SEA:
from the CORDEX-SEA (you can download multiple variables and years in one request):

* Domain (South-East Asia),
* Experiment (here: 'historical', RCPs available)
Expand All @@ -121,10 +128,12 @@ from the CORDEX-SEA:
* Ensemble member (r1i1p1)
* Start year and End year (here: 2001-2005)

Once you selected the data, you can either download the dataset for further processing,
[see here](./ERA5_preprocessing_example.md) an example of how to manipulate ERA5 data
using xarray, or click on 'show Toolbox request' at the bottom of the page, copy the
code, and open the CDS toolbox editor.
Once you selected the data, you can either download the dataset for further processing
or click on 'show Toolbox request' at the bottom of the page, copy the code, and open
the CDS toolbox editor.

The code to manipulate climate data as used in the `vr_run` example is available
[here](../../../virtual_rainforest/example_data/generation_scripts/climate_example_data.py).

### Toolbox template CORDEX-SEA

Expand Down
215 changes: 0 additions & 215 deletions docs/source/data_recipes/ERA5_preprocessing_example.md

This file was deleted.

Loading

0 comments on commit 0ed12ef

Please sign in to comment.