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

on-the-fly cmoriser for ACCESS native data #2430

Open
wants to merge 113 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
b774a36
branch for access live cmoriser
Mar 28, 2024
5acf65c
update simple version for live cmoriser
May 14, 2024
e7277a0
fix issue with multi-model-statistics
May 15, 2024
a0a05bc
comments added, ready for pull request
May 21, 2024
a32a48f
add packages in environment.yml
May 21, 2024
efcea11
change file name
May 21, 2024
9c0c9b8
reformat
May 22, 2024
f98406d
change class name to CapWords convention
May 22, 2024
2b5f8d5
Update environment.yml
rhaegar325 May 22, 2024
8043643
Update access_esm.py
rhaegar325 May 22, 2024
a86e1d9
reformat
May 22, 2024
c8bc262
reformat
May 22, 2024
f389559
summary line and description
May 22, 2024
7815a07
reformat
May 22, 2024
6db0088
reformat
May 22, 2024
4018368
reformat
May 22, 2024
0e864b6
reformat
May 22, 2024
200e2d6
update documentation
May 24, 2024
803c544
update documentation
May 24, 2024
fbfefdc
update documentation
May 24, 2024
88047fc
update documentation
May 24, 2024
0cd3498
Update find_data.rst
rbeucher May 24, 2024
7cd6cf8
update config-developer.yml
May 24, 2024
7c91b6c
restore some changes
May 24, 2024
b446f6f
add test for cmoriser
May 31, 2024
9a0104f
reformat test_access_esm.py
May 31, 2024
64054ba
reformat test_access_esm.py
May 31, 2024
b8c6057
reformat test_access_esm.py
May 31, 2024
869c481
reformat esmvalcore/_task.py
May 31, 2024
6885d9a
add access test data
May 31, 2024
8cc0f3b
change datapath
May 31, 2024
c803837
fix _fix
May 31, 2024
d2d1da3
test for access cmoriser
Jun 3, 2024
013d5f0
test for access cmoriser
Jun 3, 2024
b116bfc
test for access cmoriser
Jun 3, 2024
c371ba0
test for access cmoriser
Jun 4, 2024
84fe2ed
Merge branch 'main' into access-live-cmoriser
rbeucher Jun 4, 2024
6d80f5f
test for access cmoriser
Jun 4, 2024
a566cfd
test for access cmoriser
Jun 4, 2024
b666121
test for access cmoriser
Jun 4, 2024
f7fb9d7
test for access cmoriser
Jun 4, 2024
97acf57
add author name
Jun 4, 2024
645a203
Merge branch 'main' into access-live-cmoriser
rhaegar325 Jun 4, 2024
5f587df
clean code
Jun 6, 2024
f10b23c
Merge branch 'main' into access-live-cmoriser
rhaegar325 Jun 7, 2024
fb3ef3f
slitely change the import line
Jun 7, 2024
fdaf89d
use extra_facets
Jun 13, 2024
857b9d1
follow chnage request
Jun 13, 2024
1753b8d
follow chnage request
Jun 13, 2024
b0e1400
follow chnage request
Jun 13, 2024
7a06b34
follow chnage request
Jun 13, 2024
7f2ffeb
follow chnage request
Jun 13, 2024
24ef703
follow chnage request
Jun 13, 2024
c5c7393
change test file
Jun 13, 2024
4569cf5
fix height value
Jun 13, 2024
cadd99e
change docs
Jun 13, 2024
42ec653
change docs
Jun 13, 2024
7422346
add modeling_realm to extra_facet
Jun 14, 2024
41c6530
add modeling_realm to extra_facet
Jun 14, 2024
c92373d
add modeling_realm to extra_facet
Jun 14, 2024
fe5e4d6
fix output_file
Jun 19, 2024
fecb98b
fix output_file
Jun 19, 2024
8f744ff
add more variables to live-cmoriser
Jun 18, 2024
1456249
add more variables to live-cmoriser
Jun 18, 2024
bd3769e
add more available variables for cmoriser
rhaegar325 Jun 20, 2024
e160394
add more available variables for cmoriser
rhaegar325 Jun 20, 2024
573b4f1
add test
rhaegar325 Jun 20, 2024
f7081ba
add test
rhaegar325 Jun 20, 2024
b5143bd
Update doc/quickstart/find_data.rst
rhaegar325 Jul 3, 2024
08722f0
fix test
rhaegar325 Jul 3, 2024
8e89122
fix test
rhaegar325 Jul 3, 2024
2b93eb3
fix test
rhaegar325 Jul 3, 2024
8743481
fix test
rhaegar325 Jul 3, 2024
e909bf4
fix test
rhaegar325 Jul 3, 2024
21481a3
fix test
rhaegar325 Jul 3, 2024
17789cb
fix test
rhaegar325 Jul 3, 2024
2ee9aa0
fix test
rhaegar325 Jul 3, 2024
320ec83
fix test
rhaegar325 Jul 3, 2024
8ab57f7
fix test
rhaegar325 Jul 3, 2024
66b7d7e
fix test
rhaegar325 Jul 3, 2024
f29e18d
fix test
rhaegar325 Jul 3, 2024
442b2db
fix test
rhaegar325 Jul 3, 2024
7022df1
fix test
rhaegar325 Jul 4, 2024
151642e
remove eval()
rhaegar325 Jul 4, 2024
2f500ea
remove eval()
rhaegar325 Jul 4, 2024
5d6d519
remove eval()
rhaegar325 Jul 4, 2024
4f26996
Update esmvalcore/cmor/_fixes/access/access_esm.py
rhaegar325 Jul 4, 2024
814ece5
Update doc/quickstart/find_data.rst
rhaegar325 Jul 4, 2024
d08ae67
Update doc/quickstart/find_data.rst
rhaegar325 Jul 4, 2024
0451b7d
Update esmvalcore/cmor/_fixes/access/access_esm.py
rhaegar325 Jul 4, 2024
18ceca5
Update esmvalcore/cmor/_fixes/access/access_esm.py
rhaegar325 Jul 4, 2024
e15236e
fix format
rhaegar325 Jul 4, 2024
dcb13a7
change extra_facets
rhaegar325 Jul 4, 2024
1d3a0cf
change institude to dataset
rhaegar325 Jul 4, 2024
bac5051
change institude to dataset
rhaegar325 Jul 4, 2024
44af431
fix filename
rhaegar325 Jul 4, 2024
1106514
fix filename
rhaegar325 Jul 4, 2024
5a837e5
fix filename
rhaegar325 Jul 4, 2024
04921ea
fix filename
rhaegar325 Jul 4, 2024
9105512
add condition before fix_height_value
rhaegar325 Jul 4, 2024
ce60ea0
fix test
rhaegar325 Jul 4, 2024
41aeee0
fix test
rhaegar325 Jul 4, 2024
ef3e7de
Update doc/quickstart/find_data.rst
rhaegar325 Jul 4, 2024
b36738d
Update doc/quickstart/find_data.rst
rhaegar325 Jul 4, 2024
07519cb
fix test
rhaegar325 Jul 4, 2024
475f4b8
fix test
rhaegar325 Jul 4, 2024
5fd5b64
fix doc
rhaegar325 Jul 4, 2024
862d318
fix doc and test
rhaegar325 Jul 4, 2024
70d4258
fix test
rhaegar325 Jul 4, 2024
cb87ce6
fix test
rhaegar325 Jul 4, 2024
155c7cc
fix test
rhaegar325 Jul 4, 2024
71252bd
fix test
rhaegar325 Jul 4, 2024
f429566
fix test
rhaegar325 Jul 4, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@
{
"affiliation": "DLR, Germany",
"name": "Cammarano, Diego"
},
{
"affiliation": "ACCESS-NRI, Australia",
"name": "Yousong, Zeng",
"orcid": "0000-0002-8385-5367"
}
],
"description": "ESMValCore: A community tool for pre-processing data from Earth system models in CMIP and running analysis scripts.",
Expand Down
5 changes: 5 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,11 @@ authors:
family-names: Cammarano
given-names: Diego

affiliation: "ACCESS-NRI, Australia"
family-names: Yousong
given-names: Zeng
orcid: "https://orcid.org/0000-0002-8385-5367"

cff-version: 1.2.0
date-released: 2024-05-08
doi: "10.5281/zenodo.3387139"
Expand Down
50 changes: 50 additions & 0 deletions doc/quickstart/find_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,56 @@ explained in :ref:`extra_facets`, and which content is :download:`available here
</../esmvalcore/config/extra_facets/ipslcm-mappings.yml>`. These multi-variable
files must also undergo some data selection.

.. _read_access-esm:

ACCESS-ESM
^^^^^^^^^^

ESMValTool can read native `ACCESS-ESM <https://research.csiro.au/access/about/esm1-5/>`__
model output.

.. warning::

This is the first version of ACCESS-ESM CMORizer for ESMValCore Currently,
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved
only two variables (`tas`, and `pr`) are fully supported.

To read ACCESS-ESM native data, users need to add the directory file structure to
`config_developer.yml`.

.. code-block:: yaml
ACCESS:
cmor_strict: false
input_dir:
default:
- '{institute}/{dataset_name}/{exp}/{modeling_realm}/netCDF'
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved
input_file:
default: '{dataset}.{special_attr}-*.nc'
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved
output_file: '{dataset}.{special_attr}'
cmor_type: 'CMIP6'
cmor_default_table_prefix: 'CMIP6_'
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved
.. hint::

We only provide one default `input_dir` since this is how ACCESS-ESM native data was
stored on NCI. Users can modify this path to match their local file structure.
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved

Default `input_file` will automatically load all the native ACCESS-ESM data(1850-2014).
If you only need to evaluate a shorter period. Users can add a more specific time range
(`{dataset}.{special_attr}-YYYYMM*.nc` e.g.) to avoid the cost of loading unnecessary data.
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved

Thus, example dataset entries could look like this:

.. code-block:: yaml
dataset:
Copy link

Choose a reason for hiding this comment

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

Not sure if this is intentional or can be confusing as currently searching for published CMIP6 we use dataset: ACCESS-ESM1-5 eg:

- {dataset: ACCESS-ESM1-5, activity: CMIP ,project: CMIP6,  grid: gn,
      exp: historical, ensemble: r1i1p1f1, start_year: 1986, end_year: 2005}

does it make more sense to have { institute: ACCESS_ESM, dataset: ACCESS-ESM1-5 } (switch them)?
then change input_dir default above?

Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't look resolved to me. ACCESS-ESM1-5 is not the institute, but rather the name of the model, right? So this probably would be a better fit for dataset (you can then rename your fix file from cmor/_fixes/access/access_esm.py to cmor/_fixes/access/access_esm1_5.py and possible extend this with more fix files if you want to look at other versions of the model. Then you can get rid of institute altogether.

- {project: ACCESS, institute: ACCESS-ESM1-5, mip: Amon, dataset:ACCESS_ESM, dataset_name: HI-CN-05,
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved
exp: history, modeling_realm: atm, special_attr: pa, start_year: 1986, end_year: 1986}
`dataset` and `dataset_name` are not redundant, `dataset` is for ESMValCore to search for CMORizer,
`dataset_name` is to search for data.
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved


.. _data-retrieval:

Expand Down
Empty file.
128 changes: 128 additions & 0 deletions esmvalcore/cmor/_fixes/access/access_esm.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
"""On-the-fly CMORizer for ACCESS-ESM.
Note
----
This is the first version of ACCESS-ESM CMORizer in for ESMValCore
Currently, only two variables (`tas`,`pr`) is fully supported.
"""
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved
import logging
import os

from iris.cube import CubeList

from esmvalcore.cmor._fixes.native_datasets import NativeDatasetFix

logger = logging.getLogger(__name__)


class Tas(NativeDatasetFix):
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved
"""Fix variable(tas) only."""

def __init__(self, vardef, extra_facets, session, frequency):
"""Initialise some class variable Heritage from native_dataset."""
super().__init__(vardef, extra_facets, session, frequency)

self.cube = None

self.current_dir = os.path.dirname(__file__)
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved

def fix_height_name(self):
"""Fix variable name of coordinate 'height'."""
if self.cube.coord('height').var_name != 'height':
self.cube.coord('height').var_name = 'height'
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved

def fix_long_name(self):
"""Fix variable long_name."""
self.cube.long_name = 'Near-Surface Air Temperature'

def fix_var_name(self):
"""Fix variable long_name."""
self.cube.var_name = 'tas'

def fix_coord_system(self):
"""Delete coord_system to make CubeList able to merge."""
for dim in self.cube.dim_coords:
if dim.coord_system is not None:
self.cube.coord(dim.standard_name).coord_system = None

def fix_metadata(self, cubes):
"""Fix metadata.
Fix name of coordinate(height), long name and variable name of
variable(tas).
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved
Parameters
----------
cubes : iris.cube.CubeList
Input cubes.
Returns
-------
iris.cube.CubeList
"""
original_short_name = 'fld_s03i236'
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved

self.cube = self.get_cube(cubes, var_name=original_short_name)

self.fix_height_name()

self.fix_long_name()

self.fix_var_name()

self.fix_coord_system()

return CubeList([self.cube])


class Pr(NativeDatasetFix):
"""Fix variable(pr) only."""

def __init__(self, vardef, extra_facets, session, frequency):
"""Initialise some class variable Heritage from native_dataset."""
super().__init__(vardef, extra_facets, session, frequency)

self.cube = None

self.current_dir = os.path.dirname(__file__)

def fix_var_name(self):
"""Fix variable long_name."""
self.cube.var_name = 'pr'

def fix_long_name(self):
"""Fix variable long_name."""
self.cube.long_name = 'Precipitation'

def fix_coord_system(self):
"""Delete coord_system to make CubeList able to merge."""
for dim in self.cube.dim_coords:
if dim.coord_system is not None:
self.cube.coord(dim.standard_name).coord_system = None

def fix_metadata(self, cubes):
"""Fix metadata.
Fix name of coordinate(height), long name and variable name of
variable(tas).
Parameters
----------
cubes : iris.cube.CubeList
Input cubes.
Returns
-------
iris.cube.CubeList
"""
original_short_name = 'fld_s05i216'

self.cube = self.get_cube(cubes, var_name=original_short_name)

self.fix_var_name()

self.fix_long_name()

self.fix_coord_system()

return CubeList([self.cube])
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved
11 changes: 11 additions & 0 deletions esmvalcore/config-developer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,3 +194,14 @@ CESM:
output_file: '{project}_{dataset}_{case}_{gcomp}_{scomp}_{type}_{mip}_{short_name}'
cmor_type: 'CMIP6'
cmor_default_table_prefix: 'CMIP6_'

ACCESS:
cmor_strict: false
input_dir:
default:
- '{institute}/{dataset_name}/{exp}/{modeling_realm}/netCDF'
input_file:
default: '{dataset}.{special_attr}-*.nc'
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved
rhaegar325 marked this conversation as resolved.
Show resolved Hide resolved
output_file: '{dataset}.{special_attr}'
cmor_type: 'CMIP6'
cmor_default_table_prefix: 'CMIP6_'
Empty file.
Loading