Note

This page is rendered from the Jupyter notebook notebooks/Getting_started.ipynb in the ACCESS-MOPPy repository. The outputs below were stored the last time the notebook was run; cells are not re-executed when the documentation is built. Open the notebook on GitHub to run it yourself.

ACCESS-MOPPy Getting Started#

Welcome to the ACCESS-MOPPy Getting Started guide!

This notebook will walk you through the initial setup and basic usage of ACCESS-MOPPy, a tool designed to post-process ACCESS model output and produce CMIP-compliant datasets. You’ll learn how to configure your environment, prepare your data, and run the CMORisation workflow using both the Python API and Dask for scalable processing.

By following this guide, you’ll be able to:

  • Set up your user configuration

  • Select input data files

  • Run the CMORisation process for selected variables

  • Inspect and save the processed output

Set up configuration#

When you first import access_moppy in a Python environment, the package will automatically create a user.yml file in your home directory (~/.moppy/user.yml).

During this initial setup, you will be prompted to provide some basic information, including:

  • Your name

  • Your email address

  • Your work organization

  • Your ORCID

This information is stored in user.yml and will be used as global attributes in the files generated during the CMORisation process. This ensures that each CMORised file includes metadata identifying who performed the CMORisation, allowing us to track data provenance and follow up with the responsible person if needed.

[1]:
from access_moppy import ACCESS_ESM_CMORiser
DEBUG access_moppy: Loaded Configuration:
DEBUG access_moppy: Creator Name: Romain Beucher
DEBUG access_moppy: Organisation: ACCESS-NRI
DEBUG access_moppy: Creator Email: romain.beucher@anu.edu.au
DEBUG access_moppy: Creator URL: 0000-0003-3891-5444
DEBUG access_moppy.utilities: access_moppy is up to date (version 1.3.0b0+36.g814281c.dirty).

Dask support#

ACCESS-MOPPeR supports Dask for parallel processing, which can significantly speed up the CMORisation workflow, especially when working with large datasets. To use Dask with ACCESS-MOPPeR, you can create a Dask client it will be used to manage the distributed computation. This allows you to take advantage of multiple CPU cores or even a cluster of machines, depending on your setup. You can configure the Dask client to use a specific number of threads per worker, which can help optimize performance based on your hardware and the size of the datasets you are processing.

Here’s an example of how to set up a Dask client:

import dask.distributed as dask

client = dask.Client(threads_per_worker=1)
client
[2]:
import dask.distributed as dask

client = dask.Client(threads_per_worker=1)
client
[2]:

Client

Client-c32142a4-692d-11f1-99a6-000003c2fe80

Connection method: Cluster object Cluster type: distributed.LocalCluster
Dashboard: /proxy/8787/status

Cluster Info

Data selection#

ACCESS_ESM_CMORiser supports two ways to supply input data:

Option 1 — ``input_folder`` (recommended): pass the archive root directory and ACCESS-MOPPy discovers the right files automatically, using the variable’s mapping entry and the model’s file_discovery configuration. No glob patterns required.

Option 2 — ``input_data``: pass an explicit list of file paths. Useful when you need precise control or when the archive layout differs from the model defaults.

For this notebook we use the December Spin-up run for ACCESS-ESM1.6 development, available on NCI at /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control.

[3]:
# Root of the payu archive — used throughout the notebook
ARCHIVE_ROOT = "/g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control"
print(f"Archive root: {ARCHIVE_ROOT}")
Archive root: /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control
[4]:
# Optional — build an explicit file list if you need fine-grained control.
# When using input_folder, ACCESS-MOPPy does this automatically.
import glob

files = glob.glob(ARCHIVE_ROOT + "/output40[0-1]/atmosphere/netCDF/aiihca.pa-*_mon.nc")
print(f"Explicit file list: {len(files)} atmospheric file(s) found")
Explicit file list: 24 atmospheric file(s) found

Automatic file discovery (recommended)#

Instead of constructing glob patterns by hand, discover_files can find all the input files for a given CMIP variable automatically.
It reads the file_discovery configuration embedded in the model mapping JSON — the same JSON that drives the CMORisation — so the correct subdirectory, file-naming scheme, and per-variable resolution are always applied without any manual effort.

Key features:

  • Works across all components (atmosphere, ocean, sea ice, land, aerosol)

  • For ocean variables: resolves files per model variable (one file per diagnostic)

  • For atmosphere / sea ice: resolves the single packed file for the relevant output frequency

  • Optional start_year / end_year filtering without opening any files

  • Falls back gracefully to an explicit pattern if a per-variable file_pattern is set in the mapping

[5]:
from access_moppy.file_discovery import discover_files

# --- Atmosphere: monthly surface downwelling shortwave ---
# All monthly atmosphere variables are packed in the same UM output file.
# discover_files returns all matching files across every output sub-directory.
atmos_files = discover_files(ARCHIVE_ROOT, "Amon.rsds")
print(f"Amon.rsds  → {len(atmos_files)} file(s)")
for f in atmos_files[:3]:
    print(f"  {f}")

# --- Ocean: monthly sea-surface temperature ---
# Ocean diagnostics are one-variable-per-file; discover_files uses the
# model_variables from the mapping to build the correct per-variable glob.
ocean_files = discover_files(ARCHIVE_ROOT, "Omon.tos")
print(f"\nOmon.tos   → {len(ocean_files)} file(s)")
for f in ocean_files[:3]:
    print(f"  {f}")

# --- Sea ice: monthly sea-ice concentration ---
siconc_files = discover_files(ARCHIVE_ROOT, "SImon.siconc")
print(f"\nSImon.siconc → {len(siconc_files)} file(s)")
for f in siconc_files[:3]:
    print(f"  {f}")
INFO access_moppy.file_discovery: discover_files: 5268 file(s) found for 'Amon.rsds' — year range 2676–3114
Amon.rsds  → 5268 file(s)
  /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control/output000/atmosphere/netCDF/aiihca.pa-267601_mon.nc
  /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control/output000/atmosphere/netCDF/aiihca.pa-267602_mon.nc
  /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control/output000/atmosphere/netCDF/aiihca.pa-267603_mon.nc
INFO access_moppy.file_discovery: discover_files: 439 file(s) found for 'Omon.tos' — year range 2676–3114

Omon.tos   → 439 file(s)
  /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control/output000/ocean/ocean-2d-surface_temp-1monthly-mean-ym_2676_01.nc
  /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control/output001/ocean/ocean-2d-surface_temp-1monthly-mean-ym_2677_01.nc
  /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control/output002/ocean/ocean-2d-surface_temp-1monthly-mean-ym_2678_01.nc
INFO access_moppy.file_discovery: discover_files: 5268 file(s) found for 'SImon.siconc' — year range 2676–3114

SImon.siconc → 5268 file(s)
  /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control/output000/ice/iceh-1monthly-mean_2676-01.nc
  /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control/output000/ice/iceh-1monthly-mean_2676-02.nc
  /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control/output000/ice/iceh-1monthly-mean_2676-03.nc
[6]:
# Optional: restrict to a specific time range by year.
# Filtering is done by parsing the year from the filename — no files are opened.
files_1990s = discover_files(ARCHIVE_ROOT, "Amon.rsds", start_year=1990, end_year=1999)
print(f"Amon.rsds (1990–1999) → {len(files_1990s)} file(s)")
INFO access_moppy.file_discovery: discover_files: no files found for 'Amon.rsds'
Amon.rsds (1990–1999) → 0 file(s)

Checking the available year range#

Before choosing start_year / end_year it is useful to know what years are actually present in the archive.
discover_year_range scans the same files as discover_files but returns a (first_year, last_year) tuple without opening any files.
[7]:
from access_moppy.file_discovery import discover_year_range

for compound in ("Amon.rsds", "Omon.tos", "SImon.siconc"):
    yr = discover_year_range(ARCHIVE_ROOT, compound)
    if yr:
        print(f"{compound:20s}  years {yr[0]}–{yr[1]}")
    else:
        print(f"{compound:20s}  no files found")
INFO access_moppy.file_discovery: discover_files: 5268 file(s) found for 'Amon.rsds' — year range 2676–3114
Amon.rsds             years 2676–3114
INFO access_moppy.file_discovery: discover_files: 439 file(s) found for 'Omon.tos' — year range 2676–3114
Omon.tos              years 2676–3114
INFO access_moppy.file_discovery: discover_files: 5268 file(s) found for 'SImon.siconc' — year range 2676–3114
SImon.siconc          years 2676–3114

Parent experiment information#

In CMIP workflows, providing parent experiment information is required for proper data provenance and traceability. This metadata describes the relationship between your experiment and its parent (for example, a historical run branching from a piControl simulation), and is essential for CMIP data publication and compliance.

However, for some applications—such as when using ACCESS-MOPPeR to interact with evaluation frameworks like ESMValTool or ILAMB—strict CMIP compliance is not always necessary. In these cases, you may choose to skip providing parent experiment information to simplify the workflow.

If you choose to skip this step, ACCESS-MOPPeR will issue a warning to let you know that, if you write the output to disk, the resulting file may not be compatible with CMIP requirements for publication. This flexibility allows you to use ACCESS-MOPPeR for rapid evaluation and prototyping, while still supporting full CMIP compliance when needed.

[8]:
parent_experiment_config = {
    "parent_experiment_id": "piControl-spinup",  # <-- This is for placeholder.
    "parent_activity_id": "CMIP",
    "parent_source_id": "ACCESS-ESM1-5",  # <-- ACCESS-ESM1-6 is not yet registered in the CMIP6 catalog, so we use ACCESS-ESM1-5 as a placeholder
    "parent_variant_label": "r1i1p1f1",
    "parent_time_units": "days since 0001-01-01 00:00:00",
    "parent_mip_era": "CMIP6",
    "branch_time_in_child": 0.0,  # <-- This is for placeholder. The actual branch time in child should be the time of the first time step in the input data, converted to the parent time units.
    "branch_time_in_parent": 54786.0,  # <-- This is the branch time in parent for the December Spin-up run, which is the time of the first time step in the input data (1850-12-01), converted to the parent time units (days since 0001-01-01).
    "branch_method": "standard",
}

Set up the CMORiser for CMORisation#

To begin the CMORisation process, create an instance of ACCESS_ESM_CMORiser.
The simplest approach is to pass input_folder — the archive root — and let ACCESS-MOPPy discover the input files automatically.
You can optionally narrow the time range with start_year / end_year.
A crucial parameter is compound_name, specified as table.variable (e.g. Amon.rsds).
This uniquely identifies the variable, its output frequency, and the CMIP table, so the correct metadata standards are applied automatically.
[10]:
# input_folder triggers automatic file discovery — no glob required.
# Optionally restrict the time range with start_year / end_year.
cmoriser = ACCESS_ESM_CMORiser(
    input_folder=ARCHIVE_ROOT,  # archive root; files are auto-discovered
    start_year=2676,
    end_year=2678,  # optional year filter
    compound_name="Amon.rsds",
    experiment_id="piControl-spinup",
    source_id="ACCESS-ESM1-5",  # ACCESS-ESM1-6 not yet in the CMIP6 catalog
    variant_label="r1i1p1f1",
    grid_label="gn",
    activity_id="CMIP",
    parent_info=parent_experiment_config,
)
INFO access_moppy.file_discovery: discover_files: 36 file(s) found for 'Amon.rsds' — year range 2676–2678
✓ Auto-discovered 36 file(s) for Amon.rsds under '/g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control'

Choosing CMIP6 vs CMIP6Plus vs CMIP7#

You can select which controlled vocabulary set is used by passing the cmip_version argument when creating ACCESS_ESM_CMORiser:

  • cmip_version="CMIP6" (default) uses CMIP6 vocabularies

  • cmip_version="CMIP6Plus" uses CMIP6Plus vocabularies

  • cmip_version="CMIP7" uses CMIP7 vocabularies

For CMIP7 you can either pass a CMIP6-style table.variable name when a mapping exists, or use the explicit CMIP7 branded name directly. The example below uses the full branded name for the ACCESS-ESM1.6 spinup dataset so it is easy to copy into a real CMIP7 workflow.

from access_moppy import ACCESS_ESM_CMORiser

# CMIP6 (default)
cmip6_cmoriser = ACCESS_ESM_CMORiser(
    input_data=files,
    compound_name="Amon.rsds",
    experiment_id="historical",
    source_id="ACCESS-ESM1-5",
    variant_label="r1i1p1f1",
    grid_label="gn",
    activity_id="CMIP",
    cmip_version="CMIP6",
)

# CMIP6Plus
cmip6plus_cmoriser = ACCESS_ESM_CMORiser(
    input_data=files,
    compound_name="Amon.rsds",
    experiment_id="historical",
    source_id="ACCESS-CM2",
    variant_label="r1i1p1f1",
    grid_label="gn",
    activity_id="CMIP",
    cmip_version="CMIP6Plus",
)

# Real CMIP7 example using the ACCESS-ESM1.6 spinup dataset
cmip7_cmoriser = ACCESS_ESM_CMORiser(
    input_data=files,
    compound_name="atmos.rsds.tavg-u-hxy-u.mon.GLB",
    experiment_id="piControl-spinup",
    source_id="ACCESS-ESM1-6",
    variant_label="r1i1p1f1",
    grid_label="gn",
    activity_id="CMIP",
    cmip_version="CMIP7",
)

Tip: Use source_id, experiment_id, and related metadata values that exist in the selected vocabulary set. For CMIP7 branded names, include the region suffix such as .GLB.

Exploring Variable Mappings#

ACCESS-MOPPy provides an enhanced variable mapping display that helps you understand how your raw model variables are mapped to CMIP-compliant variables. The variable_mapping attribute now provides a rich, interactive display in Jupyter notebooks that shows:

  • Variable metadata (CF standard names, units, dimensions)

  • Mapping completeness and validation status

  • Model-specific mapping information

  • Easy-to-read tabular format with color coding

Let’s explore the variable mapping for our selected variable:

[11]:
# Display the variable mapping with enhanced formatting
# This shows the mapping between raw model variables and CMIP standards
cmoriser.variable_mapping
[11]:
ACCESS-MOPPy Variable Mapping
Amon.rsds
Model: ACCESS-ESM1.6
Variable: rsds
CF Standard Name: surface_downwelling_shortwave_flux_in_air
Units: W m-2
Dimensions: time: time, lat: lat, lon: lon
Model Variable: fld_s01i235
Processing: DIRECT
Formula: fld_s01i235
Positive: down

The variable mapping display above shows:

  • Variable Name: The CMIP variable name (rsds - surface downwelling shortwave flux)

  • CF Standard Name: The Climate and Forecast conventions standard name

  • Units: Expected units for the CMIP-compliant variable

  • Dimensions: How the data dimensions map between raw and CMIP formats

  • Model Info: Shows the ACCESS model version used for this mapping

Exploring Different Variables#

Let’s see how the variable mapping display looks for different types of variables. Here’s an example with atmospheric temperature (tas):

[12]:
# Create a CMORiser for a different variable to see mapping differences
tas_cmoriser = ACCESS_ESM_CMORiser(
    input_folder=ARCHIVE_ROOT,
    compound_name="Amon.tas",  # Near-surface air temperature
    experiment_id="historical",
    source_id="ACCESS-ESM1-5",
    variant_label="r1i1p1f1",
    grid_label="gn",
    activity_id="CMIP",
)

# Display the mapping for atmospheric temperature
tas_cmoriser.variable_mapping
INFO access_moppy.file_discovery: discover_files: 5268 file(s) found for 'Amon.tas' — year range 2676–3114
✓ Auto-discovered 5268 file(s) for Amon.tas under '/g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control'
/g/data/tm70/rb5533/code-dev/ACCESS-MOPPy/src/access_moppy/driver.py:382: UserWarning: No parent_info provided. Defaulting to piControl parent experiment metadata. You should verify this is appropriate. Incorrect parent settings may lead to invalid CMIP submission.
  warnings.warn(
[12]:
ACCESS-MOPPy Variable Mapping
Amon.tas
Model: ACCESS-ESM1.6
Variable: tas
CF Standard Name: air_temperature
Units: K
Dimensions: time: time, lat: lat, lon: lon
Model Variable: fld_s03i236
Processing: DIRECT
Formula: fld_s03i236

Working with Ocean Variables#

ACCESS-MOPPy also supports ocean variables from the ACCESS-ESM1.6 ocean component. Ocean data typically requires different file selection strategies, as ocean variables are stored in different file patterns and locations compared to atmospheric data.

Here’s how to work with ocean salinity (so) from the ocean monthly table (Omon):

[13]:
# Preview which ocean salinity files will be used (optional — for inspection only).
# ACCESS_ESM_CMORiser does this internally when you pass input_folder.
from access_moppy.file_discovery import discover_files

ocean_files = discover_files(ARCHIVE_ROOT, "Omon.so")
print(f"Omon.so → {len(ocean_files)} file(s)")
for f in ocean_files[:3]:
    print(f"  {f}")
INFO access_moppy.file_discovery: discover_files: 439 file(s) found for 'Omon.so' — year range 2676–3114
Omon.so → 439 file(s)
  /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control/output000/ocean/ocean-3d-salt-1monthly-mean-ym_2676_01.nc
  /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control/output001/ocean/ocean-3d-salt-1monthly-mean-ym_2677_01.nc
  /g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control/output002/ocean/ocean-3d-salt-1monthly-mean-ym_2678_01.nc
[14]:
# Create a CMORiser for ocean salinity — discovery handled automatically
ocean_cmoriser = ACCESS_ESM_CMORiser(
    input_folder=ARCHIVE_ROOT,
    compound_name="Omon.so",  # Ocean salinity
    experiment_id="piControl-spinup",
    source_id="ACCESS-ESM1-5",
    variant_label="r1i1p1f1",
    grid_label="gn",
    activity_id="CMIP",
    parent_info=parent_experiment_config,
)

# Display the ocean variable mapping
ocean_cmoriser.variable_mapping
INFO access_moppy.file_discovery: discover_files: 439 file(s) found for 'Omon.so' — year range 2676–3114
✓ Auto-discovered 439 file(s) for Omon.so under '/g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control'
[14]:
ACCESS-MOPPy Variable Mapping
Omon.so
Model: ACCESS-ESM1.6
Variable: so
CF Standard Name: sea_water_salinity
Units: 0.001
Dimensions: time: time, st_ocean: lev, yt_ocean: latitude, xt_ocean: longitude
Model Variable: salt
Processing: DIRECT
Formula: salt

Ocean Grid Variables (Fixed Fields)#

Ocean grid variables like cell areas and depths are stored in different files and use the Ofx (Ocean fixed) table. These are time-independent variables that describe the ocean grid geometry:

[15]:
# Example: Ocean cell area (areacello) — an Ofx (fixed/time-invariant) variable.
# These specific grid files are passed explicitly because they are well-known
# static files rather than time-varying output cycles.
grid_files = [
    ARCHIVE_ROOT + "/output401/ocean/ocean-2d-area_t.nc",
    ARCHIVE_ROOT + "/output401/ocean/ocean-2d-ht.nc",  # needed for depth info
]

# Create CMORiser for ocean cell area
areacello_cmoriser = ACCESS_ESM_CMORiser(
    input_data=grid_files,
    compound_name="Ofx.areacello",  # Ocean cell area
    experiment_id="piControl-spinup",
    source_id="ACCESS-ESM1-5",
    variant_label="r1i1p1f1",
    grid_label="gn",
    activity_id="CMIP",
    parent_info=parent_experiment_config,
)

Key Differences Between Model Components#

Notice the differences in variable handling across ACCESS-ESM components:

  1. File Patterns:

    • Atmosphere: aiihca.pa-*_mon.nc (atmosphere component)

    • Ocean: *-{variable}-1monthly-mean*.nc (ocean component, specific variable naming)

    • Land: aiihca.pe-*_mon.nc (land component)

  2. CMIP Tables:

    • Amon: Atmospheric monthly variables

    • Omon: Ocean monthly variables

    • Ofx: Ocean fixed (time-independent) variables

    • Lmon: Land monthly variables (physical land surface)

    • Emon: Earth system monthly variables (biogeochemical/ecological)

  3. File Selection:

    • Atmospheric and land variables: Use component-specific file patterns

    • Ocean variables: Require knowledge of underlying model variable names through mappings

  4. Grid Information:

    • Atmospheric and land: Typically self-contained grid information

    • Ocean: Often requires additional files for proper coordinate information

Working with Land Variables#

ACCESS-MOPPy also supports land variables from the ACCESS-ESM1.6 land component. Land variables are organized into different CMIP tables depending on their scientific domain:

  • Lmon: Standard land monthly variables (e.g., soil moisture, runoff, vegetation)

  • Emon: Earth system monthly variables (e.g., carbon fluxes, fire, vegetation dynamics)

Land data in ACCESS models typically comes from the land component output files with their own naming patterns:

[16]:
# Example 1: Land Monthly Variable - Surface Runoff (mrro)
land_cmoriser = ACCESS_ESM_CMORiser(
    input_folder=ARCHIVE_ROOT,
    compound_name="Lmon.mrro",  # Surface runoff
    experiment_id="piControl-spinup",
    source_id="ACCESS-ESM1-5",
    variant_label="r1i1p1f1",
    grid_label="gn",
    activity_id="CMIP",
    parent_info=parent_experiment_config,
)

# Display the land variable mapping
land_cmoriser.variable_mapping
INFO access_moppy.file_discovery: discover_files: 5268 file(s) found for 'Lmon.mrro' — year range 2676–3114
✓ Auto-discovered 5268 file(s) for Lmon.mrro under '/g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control'
[16]:
ACCESS-MOPPy Variable Mapping
Lmon.mrro
Model: ACCESS-ESM1.6
Variable: mrro
CF Standard Name: runoff_flux
Units: kg m-2 s-1
Dimensions: time: time, lat: lat, lon: lon
Model Variables:
(2 variables)
  • fld_s08i234
  • fld_s08i235
Processing: FORMULA
Operation: add
[17]:
# Example 2: Earth System Monthly Variable - Carbon stock on land (cLand)
emon_cmoriser = ACCESS_ESM_CMORiser(
    input_folder=ARCHIVE_ROOT,
    compound_name="Emon.cLand",
    experiment_id="piControl-spinup",
    source_id="ACCESS-ESM1-5",
    variant_label="r1i1p1f1",
    grid_label="gn",
    activity_id="CMIP",
    parent_info=parent_experiment_config,
)

# Display the Emon variable mapping
emon_cmoriser.variable_mapping
INFO access_moppy.file_discovery: discover_files: 5268 file(s) found for 'Emon.cLand' — year range 2676–3114
✓ Auto-discovered 5268 file(s) for Emon.cLand under '/g/data/p73/archive/CMIP7/ACCESS-ESM1-6/spinup/Dec25-PI-control'
[17]:
ACCESS-MOPPy Variable Mapping
Emon.cLand
Model: ACCESS-ESM1.6
Variable: cLand
CF Standard Name: mass_content_of_carbon_in_vegetation_and_litter_and_soil_and_forestry_and_agricultural_products
Units: kg m-2
Dimensions: time: time, lat: lat, lon: lon
Model Variables:
(15 variables)
  • fld_s03i851
  • fld_s03i852
  • fld_s03i853
  • fld_s03i854
  • fld_s03i855
  • fld_s03i856
  • fld_s03i857
  • fld_s03i858
  • fld_s03i859
  • fld_s03i860
  • fld_s03i898
  • fld_s03i899
  • fld_s03i900
  • fld_s03i317
  • fld_s03i395
Processing: FORMULA
Operation: calc_cland_with_wood_products

Land Variable Categories#

Land variables in ACCESS-ESM are organized into different CMIP tables based on their scientific focus:

  1. Lmon (Land Monthly):

    • Standard land surface variables

    • Examples: mrro (runoff), mrso (soil moisture), tsl (soil temperature)

    • Physical land surface processes

  2. Emon (Earth System Monthly):

    • Biogeochemical and ecological variables

    • Examples: gpp (gross primary productivity), npp (net primary productivity), cVeg (vegetation carbon)

    • Carbon cycle and ecosystem dynamics

  3. File Patterns:

    • Land files: aiihca.pe-*_mon.nc (land component output)

    • Same files can contain variables for both Lmon and Emon tables

    • Variables are differentiated by the CMIP table specification, not the source files

Running the CMORiser#

To start the CMORisation process, simply call the run() method on your cmoriser instance as shown below. This step may take some time, especially if you are processing a large number of files.

We recommend using the dask-labextension with JupyterLab to monitor the progress of your computation. The extension provides a convenient dashboard to track task progress and resource usage directly within your notebook interface.

[18]:
cmoriser.run()
DEBUG access_moppy.utilities: Monthly CMIP6 table detected (Amon.rsds) - using calendar-aware validation
DEBUG access_moppy.utilities: Sampling 10 files from 36 total for efficient frequency detection
DEBUG access_moppy.utilities: Opening 8 files with xarray multi-file dataset...
/g/data/tm70/rb5533/code-dev/ACCESS-MOPPy/src/access_moppy/utilities.py:1562: UserWarning: Inconsistent time intervals detected in bounds: 31 days 00:00:00 vs 29 days 00:00:00
  warnings.warn(
DEBUG access_moppy.utilities: Detected frequency from time bounds: 31 days 00:00:00
DEBUG access_moppy.utilities: Efficiently detected frequency: 31 days 00:00:00
DEBUG access_moppy.utilities: Validated monthly data with calendar variations (detected: 31 days 00:00:00)
DEBUG access_moppy.utilities: Monthly data detected - no resampling required (calendar variations are natural)
DEBUG access_moppy.base: Validated compatible temporal frequency: 31 days 00:00:00
DEBUG access_moppy.base: Normalizing missing values to NaN for consistent processing...
DEBUG access_moppy.base: Missing values normalized to NaN - XArray will handle propagation correctly
DEBUG access_moppy.base: Applying final CMIP6 missing value standardization for rsds
DEBUG access_moppy.base: Final CMIP6 missing value applied: 1e+20

In-memory processing with xarray and Dask#

The CMORisation workflow processes data entirely in memory using xarray and Dask. This approach enables efficient parallel computation and flexible data manipulation, but requires that your system has enough memory to handle the size of your dataset.

Once the CMORisation is complete, you can access the resulting dataset by calling the to_dataset() method on your cmoriser instance (see below). The returned object is a standard xarray dataset, which means you can slice, analyze, or further process the data using familiar xarray operations.

[19]:
ds = cmoriser.to_dataset()
[20]:
ds
[20]:
<xarray.Dataset> Size: 4MB
Dimensions:    (lat: 145, bnds: 2, lon: 192, time: 36)
Coordinates:
  * lat        (lat) float64 1kB -90.0 -88.75 -87.5 -86.25 ... 87.5 88.75 90.0
  * lon        (lon) float64 2kB 0.0 1.875 3.75 5.625 ... 354.4 356.2 358.1
  * time       (time) float64 288B 9.77e+05 9.771e+05 ... 9.781e+05 9.781e+05
Dimensions without coordinates: bnds
Data variables:
    lat_bnds   (lat, bnds) float64 2kB dask.array<chunksize=(145, 2), meta=np.ndarray>
    lon_bnds   (lon, bnds) float64 3kB dask.array<chunksize=(192, 2), meta=np.ndarray>
    time_bnds  (time, bnds) float64 576B dask.array<chunksize=(1, 2), meta=np.ndarray>
    rsds       (time, lat, lon) float32 4MB dask.array<chunksize=(1, 145, 192), meta=np.ndarray>
Attributes: (12/44)
    Conventions:            CF-1.7 CMIP-6.2
    activity_id:            CMIP
    creation_date:          2026-06-16T02:49:19Z
    data_specs_version:     01.00.33
    experiment:             pre-industrial control (spin-up)
    experiment_id:          piControl-spinup
    ...                     ...
    branch_method:          standard
    external_variables:     areacella
    creator_name:           Romain Beucher
    creator_organisation:   ACCESS-NRI
    creator_email:          romain.beucher@anu.edu.au
    creator_url:            0000-0003-3891-5444

Writing the output to a NetCDF file#

To save your CMORised data to disk, use the write() method of the cmoriser instance. This will create a NetCDF file with all attributes set according to the CMIP Controlled Vocabulary, ensuring compliance with CMIP metadata standards.

After writing the file, we recommend validating it using PrePARE, a tool provided by PCMDI to check the conformity of CMIP files. PrePARE will help you identify any issues with metadata or file structure before publication or further analysis.

[21]:
cmoriser.write()
DEBUG access_moppy.base: Normalized 'time' units: 'days since 0001-01-01 00:00' -> 'days since 0001-01-01 00:00:00'
DEBUG access_moppy.base: Normalized 'time_bnds' units: 'days since 0001-01-01 00:00' -> 'days since 0001-01-01 00:00:00'
DEBUG access_moppy.base: Data size: 0.01 GB, Available memory: 79.12 GB
INFO access_moppy.base: CMORised output written to rsds_Amon_ACCESS-ESM1-5_piControl-spinup_r1i1p1f1_gn_267601-267812.nc
DEBUG access_moppy.base: Optimized layout: metadata -> data chunks
DEBUG access_moppy.base: HDF5 compression: shuffle + zlib(level 4) + fletcher32 for data variables
[ ]: