Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/create_test_conda_env.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: create_test_conda_env

on: [push]
on: [push, pull_request]

jobs:
build-linux:
Expand Down
75 changes: 75 additions & 0 deletions flow.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@
{% set ANALYSIS_STOP = PP_STOP %}
{% endif %}

{# Default DO_CMOR to False if not defined #}
{% if DO_CMOR is not defined %}
{% set DO_CMOR = False %}
{% endif %}

{# The combined yaml is the definitive configuration source #}
{% set YAML = EXPERIMENT + '.yaml' %}

Expand Down Expand Up @@ -286,6 +291,13 @@
{{ YAML | get_analysis_info('task-graph', PP_COMPONENTS, PP_DIR, PP_START, PP_STOP, PP_CHUNKS, DO_ANALYSIS_ONLY) }}
{% endif %}

#
# CMOR task graph
#
{% if DO_CMOR %}
R1/$ = data-catalog-final => cmor-config => cmor-yaml
{% endif %}

{% endif %}

[runtime]
Expand Down Expand Up @@ -918,6 +930,69 @@
{{ YAML | get_analysis_info('task-definitions', PP_COMPONENTS, PP_DIR, PP_START, PP_STOP, PP_CHUNKS, False ) }}
{% endif %}

{% if DO_CMOR %}
[[CMOR-CONFIG]]
script = """
set -euo pipefail
echo Arguments:
echo " pp_dir: $pp_dir"
echo " cmor_tables_dir: $cmor_tables_dir"
echo " cmor_mip_era: $cmor_mip_era"
echo " cmor_exp_config: $cmor_exp_config"
echo " cmor_output_yaml: $cmor_output_yaml"
echo " cmor_output_dir: $cmor_output_dir"
echo " cmor_varlist_dir: $cmor_varlist_dir"
echo Utilities:
type fre

mkdir -p $cmor_output_dir $cmor_varlist_dir

fre -vv cmor config \
--pp_dir=$pp_dir \
--mip_tables_dir=$cmor_tables_dir \
--mip_era=$cmor_mip_era \
--exp_config=$cmor_exp_config \
--output_yaml=$cmor_output_yaml \
--output_dir=$cmor_output_dir \
--varlist_dir=$cmor_varlist_dir
"""
[[[environment]]]
pp_dir = {{ PP_DIR }}
cmor_tables_dir = {{ CMOR_TABLES_DIR }}
cmor_mip_era = {{ CMOR_MIP_ERA }}
cmor_exp_config = {{ CMOR_EXP_CONFIG }}
cmor_output_yaml = {{ PP_DIR }}/cmor/cmor_config.yaml
cmor_output_dir = {{ CMOR_OUTPUT_DIR }}
cmor_varlist_dir = {{ PP_DIR }}/cmor/varlists
[[cmor-config]]
inherit = CMOR-CONFIG

[[CMOR-YAML]]
script = """
set -euo pipefail
echo Arguments:
echo " cmor_output_yaml: $cmor_output_yaml"
echo " experiment: $experiment"
echo " platform: $platform"
echo " target: $target"
echo Utilities:
type fre

fre -vv cmor yaml \
--yamlfile=$cmor_output_yaml \
--experiment=$experiment \
--platform=$platform \
--target=$target
"""
[[[environment]]]
cmor_output_yaml = {{ PP_DIR }}/cmor/cmor_config.yaml
experiment = {{ EXPERIMENT }}
platform = {{ PLATFORM }}
target = {{ TARGET }}
[[cmor-yaml]]
inherit = CMOR-YAML
{% endif %}

[[CLEAN]]
pre-script = "set -x"

Expand Down
15 changes: 15 additions & 0 deletions rose-suite.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,18 @@

## Location for shared analysis scripts
#FRE_ANALYSIS_HOME="/home/fms/local/opt/fre-analysis/test"

## Switch to run CMOR (Climate Model Output Rewriter) on generated pp output
#DO_CMOR=False

## Directory containing MIP table JSON files (e.g. cmip6-cmor-tables or cmip7-cmor-tables)
#CMOR_TABLES_DIR="/path/to/cmip6-cmor-tables/Tables"

## MIP era identifier, e.g. 'cmip6' or 'cmip7'
#CMOR_MIP_ERA="cmip6"

## Path to CMOR experiment/input configuration JSON file (contains calendar, grid, output dir structure)
#CMOR_EXP_CONFIG="/path/to/CMOR_input_example.json"

## Root output directory for CMORized data
#CMOR_OUTPUT_DIR="/path/to/cmor_output"
Loading