Skip to content
This repository was archived by the owner on Sep 21, 2025. It is now read-only.

Commit 9442b38

Browse files
authored
Merge pull request #188 from ACCESS-Community-Hub/prerelease
Prerelease for v1.1.0
2 parents 49651f7 + 6873c75 commit 9442b38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+6369
-3326
lines changed

.github/workflows/mopper-conda-release.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ jobs:
2525
with:
2626
python-version: ${{ matrix.python-version }}
2727
activate-environment: mopper_env
28+
channels: conda-forge, coecms
29+
channel-priority: true
2830
environment-file: conda/environment.yaml # Path to the build conda environment
31+
auto-update-conda: false
2932
show-channel-urls: true #
3033
- name: Build and upload the conda packages
3134
uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0

.github/workflows/mopper-test-conda.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ jobs:
2929
with:
3030
python-version: ${{ matrix.python-version }}
3131
activate-environment: mopper_env
32+
channels: conda-forge, coecms
33+
channel-priority: true
3234
environment-file: conda/environment.yaml # Path to the build conda environment
35+
auto-update-conda: false
3336
show-channel-urls: true #
3437
- name: Build but do not upload the conda packages
3538
uses: uibcdf/action-build-and-upload-conda-packages@v1.3.0

ACDD_conf.yaml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
cmor:
55
# If test true it will just run the setup but not launch the job automatically
66
test: false
7-
appdir: /g/data/ua8/Working/packages/ACCESS-MOPPeR
7+
# working directory if default uses current directory
8+
appdir: default
89
# output directory for all generated data (CMORISED files & logs)
910
# if default it is set to /scratch/$project/$user/MOPPER_OUTPUT<exp>
1011
outpath: default
@@ -29,6 +30,11 @@ cmor:
2930
access_version: CM2
3031
# reference date for time units (set as 'default' to use start_date)
3132
reference_date: 1970-01-01
33+
# Path and file templates can be changed based on the experiment.
34+
# The example below should be considered a minimum requirement.
35+
# Consider adding 'table_id" if using the "all tables" option to list
36+
# the variables to process as variables can be present at same frequency
37+
# in more than one tables
3238
path_template: "{product_version}/{frequency}"
3339
# date_range is automatically added at the end of filename
3440
file_template: "{variable_id}_{source_id}_{experiment_id}_{frequency}"
@@ -41,6 +47,7 @@ cmor:
4147
shuffle: 1
4248
# Variables to CMORise:
4349
# CMOR table/variable to process; default is 'all'.
50+
# 'all' will use all the tables listed in the mapping file
4451
# Or create a yaml file listing variables to process (VAR_SUBSET[_LIST]).
4552
# each line: <table: [var1, var2, var3 ..]>
4653
tables: CMIP6_Amon
@@ -81,16 +88,21 @@ cmor:
8188
_AXIS_ENTRY_FILE: "ACDD_coordinate.json"
8289
_FORMULA_VAR_FILE: "ACDD_formula_terms.json"
8390
grids: "ACDD_grids.json"
84-
# Additional NCI information:
91+
# Additional NCI information:
8592
# NCI project to charge compute; $PROJECT = your default project
8693
project: v45
87-
# additional NCI projects to be included in the storage flags
94+
# additional NCI projects to be included in the storage flags, comma separated list
8895
addprojs: []
8996
# queue and memory (GB) per CPU (depends on queue),
90-
# hugemem is reccomended for high reoslution data and/or derived variables
97+
# hugemem is recommended for high reoslution data and/or derived variables
9198
# hugemem requires a minimum of 6 cpus this is handled by the code
9299
queue: hugemem
93100
mem_per_cpu: 32
101+
max_cpus: 24
102+
# Mopper uses multiprocessing to produce files in parallel, usually 1 cpu per worker
103+
# is a good compromise, occasionally you might want to pass a higher number
104+
# if running out of memory
105+
cpuxworker: 1
94106
# walltime in "hh:mm:ss"
95107
walltime: '8:00:00'
96108
mode: custom
@@ -99,7 +111,7 @@ cmor:
99111
# you can override that by supplying the env to pass to "source"
100112
# Ex
101113
# conda_env: <custom-env-path>/bin/activate
102-
# or you can set "test: true" and modify mopper_job.sh manually
114+
# to allow other settings use "test: true" and modify mopper_job.sh manually
103115
conda_env: default
104116

105117
#
@@ -174,4 +186,4 @@ attrs:
174186
parent: !!bool false
175187
# CMOR will add a tracking_id if you want to define a prefix add here
176188
tracking_id_prefix:
177-
comment: "post-processed using ACCESS-MOPPeR v1.0.0 https://doi.org/10.5281/zenodo.12747219"
189+
comment: "post-processed using ACCESS-MOPPeR v1.1.0 https://doi.org/10.5281/zenodo.13841181"

CMIP6_conf.yaml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
cmor:
55
# If test true it will just run the setup but not launch the job automatically
66
test: false
7-
appdir: /g/data/ua8/Working/packages/ACCESS-MOPPeR
7+
# working directory if default uses current directory
8+
appdir: default
89
# output directory for all generated data (CMORISED files & logs)
910
# if default it is set to /scratch/$project/$user/MOPPER_OUTPUT<exp>
1011
outpath: default
@@ -38,6 +39,7 @@ cmor:
3839

3940
# Variables to CMORise:
4041
# CMOR table/variable to process; default is 'all'.
42+
# 'all' will use all the tables listed in the mapping file
4143
# Or create a yaml file listing variables to process (VAR_SUBSET[_LIST]).
4244
# each line: <table: [var1, var2, var3 ..]>
4345
tables: CMIP6_Amon
@@ -79,19 +81,29 @@ cmor:
7981
grids: CMIP6_grids.json
8082
# Additional NCI information:
8183
# NCI project to charge compute; $PROJECT = your default project
82-
# NCI queue to use; hugemem is recommended
8384
project: v45
84-
# additional NCI projects to be included in the storage flags
85+
# additional NCI projects to be included in the storage flags, comma separated list
8586
addprojs: []
8687
# queue and memory (GB) per CPU (depends on queue)
87-
# hugemem is reccomended for high reoslution data and/or derived variables
88+
# hugemem is recommended for high resolution data and/or derived variables
8889
# hugemem requires a minimum of 6 cpus this is handled by the code
8990
queue: hugemem
9091
mem_per_cpu: 30
92+
max_cpus: 24
93+
# Mopper uses multiprocessing to produce files in parallel, usually 1 cpu per worker
94+
# is a good compromise, occasionally you might want to pass a higher number
95+
# if running out of memory
96+
cpuxworker: 1
9197
# walltime in "hh:mm:ss"
9298
walltime: '8:00:00'
9399
mode: cmip6
100+
# if default uses hh5 conda env
101+
# conda_env to use by default hh5 analysis3-unstable
102+
# as this has the code and all dependecies installed
103+
# you can override that by supplying the env to pass to "source"
104+
# Ex
94105
# conda_env: <custom-env-path>/bin/activate
106+
# to allow other settings use "test: true" and modify mopper_job.sh manually
95107
conda_env: default
96108

97109
# Global attributes: these will be added to each files comment unwanted ones
@@ -163,4 +175,4 @@ attrs:
163175
#CMOR will add a tracking_id if you want to define a prefix add here
164176
tracking_id_prefix:
165177
Conventions: "CF-1.7 CMIP-6.2"
166-
comment: "post-processed using ACCESS-MOPPeR v1.0.0 https://doi.org/10.5281/zenodo.12747219"
178+
comment: "post-processed using ACCESS-MOPPeR v1.1.0 https://doi.org/10.5281/zenodo.13841181"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# [ACCESS Model Output Post-Processor (MOPPeR)](https://access-mopper.readthedocs.io/en/latest)
22
[![Read the docs](https://readthedocs.org/projects/access-mopper/badge/?version=latest)](https://access-mopper.readthedocs.io/en/latest/)
3-
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.12747219.svg)](https://doi.org/10.5281/zenodo.12747219)
3+
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.13841181.svg)](https://doi.org/10.5281/zenodo.13841181)
44

55
This code is derived from the [APP4](https://doi.org/10.5281/zenodo.7703469), initially created by Peter Uhe for CMIP5, and further developed for CMIP6-era by Chloe Mackallah from CSIRO, O&A Aspendale.
66

@@ -36,6 +36,6 @@ If you want to install an unstable version or a different branch:
3636
MOPPeR is pre-installed into a Conda environment at NCI. Load it with::
3737

3838
module use /g/data3/hh5/public/modules
39-
module load conda/analysis3
39+
module load conda/analysis3-unstable
4040

4141
NB. You need to be a member of the hh5 project to load the modules.

conda/environment.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: mopper_env
22
channels:
33
- conda-forge
4-
- coecms
5-
- default
64

75
dependencies:
86
- anaconda-client

conda/meta.yaml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
package:
22
name: mopper
33
#version: "{{ environ.get('GIT_DESCRIBE_TAG', '1.0') }}"
4-
version: '1.0.0'
4+
version: '1.1.0'
55
#source:
66
# path: ./
77

88
source:
99
#url: https://github.com/ACCESS-Hive/ACCESS-MOPPeR/archive/refs/tags/{{version}}.tar.gz
1010
git_url: https://github.com/ACCESS-Hive/ACCESS-MOPPeR.git
11-
#git_tag: prerelease
12-
git_rev: "1.0.0"
11+
git_tag: prerelease
12+
#git_rev: "1.1.0"
1313
#git_depth: 1 # (Defaults to -1/not shallow)
14+
#path: ../.
1415

1516
build:
1617
number: 1
@@ -27,29 +28,21 @@ requirements:
2728
run:
2829
- python
2930
- click
31+
- xarray>=2024.05.0
3032
- cmor
31-
- xarray
3233
- numpy
3334
- dask
3435
- pyyaml
3536
- cftime
3637
- python-dateutil
38+
- metpy
39+
- gsw
3740

3841
test:
39-
#imports:
40-
# - mopdb
41-
# - mopper
4242
source_files:
4343
- tests
4444
- tests/testdata
4545
requires:
46-
- cmor
47-
- xarray
48-
- numpy
49-
- dask
50-
- pyyaml
51-
- cftime
52-
- python-dateutil
5346
- pytest
5447
- pyfakefs
5548
- coverage

conda/testenv.yaml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
name: testenv
22
channels:
33
- conda-forge
4+
- nodefaults
45

56
dependencies:
6-
- cmor
77
- click
8-
- xarray
8+
- xarray>=2024.05.0
9+
- cmor
910
- numpy
1011
- dask
1112
- pyyaml
1213
- cftime
1314
- python-dateutil
15+
- metpy
16+
- gsw
1417
- pytest
1518
- coverage
1619
- codecov

docs/calculations.rst

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
Calculating derived variables
2+
=============================
3+
4+
Calculations are used to derive a variable from one or multiple inputs, to resample a variable to a new frequency or generally to modify a variable so it will match fully the corresponding definition in a CMOR table.
5+
6+
How calculations work
7+
---------------------
8+
Calculations are defined in the mapping file under the filed by the same name. The `calculation` string gets literally evaluated by the tool using python eval() function.
9+
As an example
10+
simple calculation could be summing avariable across all its vertical levels:
11+
12+
.. code-block:: bash
13+
14+
mrso;fld_s08i223;var[0].sum(dim='depth')
15+
16+
`var` represents the list of input variables, in this case there's only one which var[0] in the calculation string. In this case the calculation is very simple and can be fully defined in the mapping itself. If the calculation is more complex it's easier to use a pre-defined function, for example:
17+
18+
.. code-block:: bash
19+
20+
hus24;fld_s00i010 fld_s00i408;plevinterp(var[0], var[1], 24)
21+
22+
Here plevinterp is called to interpolate specific humidity from model levels to pressure levels, this function takes three input arguments, the variable to interpolate, pressure at model levels and finally the number of pressure levels, which corresponds to a specific definition of the pressure levels coordinate.
23+
Already available functions are listed below.
24+
25+
.. note::
26+
27+
When more than one variable is used as input, if the variables are not all in the same file, more than one file pattern can be specified in the mapping row.
28+
29+
Resample
30+
^^^^^^^^
31+
If a variable is available in the raw model output but not at the desired frequency, the tool will try to see if a higher frequency is available to be resampled. For example, if a user is interested in daily surface temperature but this is available only as hourly data, during the `mop setup` phase the tool will add a `resample` attribute with value 'D' to the variable and this will used as argument for the resample function. Which kind of statistics to use for the function is defined based on the `timeshot` attribute, so if a variable is defined as a maximum, minimum or sum these are used in the resample instead of the mean.
32+
33+
Contributing
34+
------------
35+
TBA
36+
37+
38+
Available functions
39+
-------------------
40+
41+
Atmosphere and aerosol
42+
^^^^^^^^^^^^^^^^^^^^^^
43+
.. automodule:: mopper.calc_atmos
44+
:members:
45+
:undoc-members:
46+
:show-inheritance:
47+
48+
49+
Ocean
50+
^^^^^
51+
.. automodule:: mopper.calc_ocean
52+
:members:
53+
:undoc-members:
54+
:show-inheritance:
55+
56+
57+
SeaIce
58+
^^^^^^
59+
.. automodule:: mopper.calc_seaice
60+
:members:
61+
:undoc-members:
62+
:show-inheritance:
63+
64+
65+
Land
66+
^^^^
67+
.. automodule:: mopper.calc_land
68+
:members:
69+
:undoc-members:
70+
:show-inheritance:
71+
72+
73+
Other
74+
^^^^^
75+
.. automodule:: mopper.calc_utils
76+
:members:
77+
:undoc-members:
78+
:show-inheritance:

docs/cmor.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ There are custom tables for CM2 variables not yet included in the CMIP6 tables a
4848
Experiment input file
4949
---------------------
5050

51-
This provides user-supplied metadata and configuration directives used by CMOR, in cluding which controlled vocabulary (CV), grids and coordinate definitions to use and values for the attributes describing the model and simulation.
51+
This provides user-supplied metadata and configuration directives used by CMOR, including which controlled vocabulary (CV), grids and coordinate definitions to use and values for the attributes describing the model and simulation.
5252

5353
We simplified this process so the user only has to pass one configuration file to control all the necessary inputs.
5454
The `mop setup` command will then create an experiment file as expected by CMOR based on this and the selected CV file. This is described in the :ref:`Getting started section <conf-file>`.

0 commit comments

Comments
 (0)