Skip to content

Commit

Permalink
Adds recipe and includes files, updates rose-meta.conf in diagnostics…
Browse files Browse the repository at this point in the history
… for hour of day aggregation.

Fixes #1032
  • Loading branch information
daflack committed Jan 30, 2025
1 parent bc5c4fe commit b0a034d
Showing 15 changed files with 424 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% if DOMAIN_MEAN_SURFACE_TIME_SERIES_CASE_AGGREGATION_HOUR_OF_DAY|default(False) %}
{% for field in SURFACE_MODEL_FIELDS %}
{% for model in models %}
[runtime]
[[generic_surface_domain_mean_time_series_case_aggregation_by_hour_of_day_m{{model["id"]}}_{{sanitise_task_name(field)}}]]
inherit = PROCESS_CASE_AGGREGATION
[[[directives]]]
--mem=5000
[[[environment]]]
CSET_RECIPE_NAME = "generic_surface_domain_mean_time_series_case_aggregation_hour_of_day.yaml"
CSET_ADDOPTS = """
--VARNAME='{{field}}'
--MODEL_NAME='{{model["name"]}}'
"""
MODEL_IDENTIFIERS = {{model["id"]}}
{% endfor %}
{% endfor %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% if DOMAIN_MEAN_VERTICAL_PROFILE_MODEL_LEVEL_SERIES_CASE_AGGREGATION_HOUR_OF_DAY|default(False) %}
{% for field in MODEL_LEVEL_MODEL_FIELDS %}
{% for model in models %}
[runtime]
[[generic_mlevel_domain_mean_vertical_profile_series_case_aggregation_by_hour_of_day_m{{model["id"]}}_{{sanitise_task_name(field)}}]]
inherit = PROCESS_CASE_AGGREGATION
[[[directives]]]
--mem=5000
[[[environment]]]
CSET_RECIPE_NAME = "generic_mlevel_domain_mean_vertical_profile_series_case_aggregation_hour_of_day.yaml"
CSET_ADDOPTS = """
--VARNAME='{{field}}'
--MODEL_NAME='{{model["name"]}}'
"""
MODEL_IDENTIFIERS = {{model["id"]}}
{% endfor %}
{% endfor %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% if DOMAIN_MEAN_VERTICAL_PROFILE_SERIES_CASE_AGGREGATION_HOUR_OF_DAY|default(False) %}
{% for field in PRESSURE_LEVEL_MODEL_FIELDS %}
{% for model in models %}
[runtime]
[[generic_plevel_domain_mean_vertical_profile_series_case_aggregation_by_hour_of_day_m{{model["id"]}}_{{sanitise_task_name(field)}}]]
inherit = PROCESS_CASE_AGGREGATION
[[[directives]]]
--mem=5000
[[[environment]]]
CSET_RECIPE_NAME = "generic_plevel_domain_mean_vertical_profile_series_case_aggregation_hour_of_day.yaml"
CSET_ADDOPTS = """
--VARNAME='{{field}}'
--MODEL_NAME='{{model["name"]}}'
"""
MODEL_IDENTIFIERS = {{model["id"]}}
{% endfor %}
{% endfor %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% if PLOT_SPATIAL_MODEL_LEVEL_MODEL_FIELD_CASE_AGGREGATION_HOUR_OF_DAY|default(False) %}
{% for field in MODEL_LEVEL_MODEL_FIELDS %}
{% for model in models %}
{% for mlevel in UM_MODEL_LEVELS %}
[runtime]
[[generic_mlevel_spatial_plot_sequence_case_aggregation_by_hour_of_day_m{{model["id"]}}_{{sanitise_task_name(field)}}_lv{{sanitise_task_name(mlevel)}}]]
inherit = PROCESS_CASE_AGGREGATION
[[[directives]]]
--mem=5000
[[[environment]]]
CSET_RECIPE_NAME = "generic_mlevel_spatial_plot_sequence_case_aggregation_mean_hour_of_day.yaml"
CSET_ADDOPTS = """
--VARNAME='{{field}}'
--MLEVEL='{{mlevel}}'
--MODEL_NAME='{{model["name"]}}'
"""
MODEL_IDENTIFIERS = {{model["id"]}}
{% endfor %}
{% endfor %}
{% endfor %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{% if PLOT_SPATIAL_PRESSURE_LEVEL_MODEL_FIELD_CASE_AGGREGATION_HOUR_OF_DAY|default(False) %}
{% for field in PRESSURE_LEVEL_MODEL_FIELDS %}
{% for model in models %}
{% for plevel in PRESSURE_LEVELS %}
[runtime]
[[generic_plevel_spatial_plot_sequence_case_aggregation_by_hour_of_day_m{{model["id"]}}_{{sanitise_task_name(field)}}_lv{{sanitise_task_name(plevel)}}]]
inherit = PROCESS_CASE_AGGREGATION
[[[directives]]]
--mem=5000
[[[environment]]]
CSET_RECIPE_NAME = "generic_plevel_spatial_plot_sequence_case_aggregation_mean_hour_of_day.yaml"
CSET_ADDOPTS = """
--VARNAME='{{field}}'
--PLEVEL='{{plevel}}'
--MODEL_NAME='{{model["name"]}}'
"""
MODEL_IDENTIFIERS = {{model["id"]}}
{% endfor %}
{% endfor %}
{% endfor %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{% if PLOT_SPATIAL_SURFACE_MODEL_FIELD_CASE_AGGREGATION_HOUR_OF_DAY|default(False) %}
{% for field in SURFACE_MODEL_FIELDS %}
{% for model in models %}
[runtime]
[[generic_spatial_plot_time_series_case_aggregation_by_hour_of_day_m{{model["id"]}}_{{sanitise_task_name(field)}}]]
inherit = PROCESS_CASE_AGGREGATION
[[[directives]]]
--mem=5000
[[[environment]]]
CSET_RECIPE_NAME = "generic_surface_spatial_plot_sequence_case_aggregation_mean_hour_of_day.yaml"
CSET_ADDOPTS = """
--VARNAME='{{field}}'
--MODEL_NAME='{{model["name"]}}'
"""
MODEL_IDENTIFIERS = {{model["id"]}}
{% endfor %}
{% endfor %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{% if SPATIAL_SURFACE_DIFFERENCE_CASE_AGGREGATION_HOUR_OF_DAY|default(False) %}
# Models are listed in order, so model 1 is the first element.
{% set base_model = models[0] %}
# As we use model 1 as the base model we skip it here.
{% for model in models[1:] %}
{% for field in SURFACE_MODEL_FIELDS %}
[runtime]
[[spatial_surface_difference_case_aggregation_by_hour_of_day_m{{model["id"]}}_{{sanitise_task_name(field)}}]]
inherit = PROCESS_CASE_AGGREGATION
[[[directives]]]
--mem=5000
[[[environment]]]
CSET_RECIPE_NAME = "surface_spatial_difference_case_aggregation_mean_hour_of_day.yaml"
CSET_ADDOPTS = """
--VARNAME='{{field}}'
--BASE_MODEL='{{base_model["name"]}}'
--OTHER_MODEL='{{model["name"]}}'
"""
MODEL_IDENTIFIERS = '1 {{model["id"]}}'
{% endfor %}
{% endfor %}
{% endif %}
73 changes: 72 additions & 1 deletion cset-workflow/meta/diagnostics/rose-meta.conf
Original file line number Diff line number Diff line change
@@ -31,6 +31,14 @@ type=python_boolean
compulsory=true
sort-key=0surface2

[template variables=PLOT_SPATIAL_SURFACE_MODEL_FIELD_CASE_AGGREGATION_HOUR_OF_DAY]
ns=Diagnostics/Quicklook
description=Create case aggregated plots for the specified surface fields
averaged by hour of day.
type=python_boolean
compulsory=true
sort-key=0surface2

[template variables=SPATIAL_SURFACE_DIFFERENCE]
ns=Diagnostics/Quicklook
description=Create difference plots for the specified surface fields.
@@ -40,7 +48,14 @@ sort-key=0surface3

[template variables=SPATIAL_SURFACE_DIFFERENCE_CASE_AGGREGATION_LEAD_TIME]
ns=Diagnostics/Quicklook
description=Create difference plots for the specified surface fields.
description=Create difference plots for the specified surface fields aggregated by lead time.
type=python_boolean
compulsory=true
sort-key=0surface3

[template variables=SPATIAL_SURFACE_DIFFERENCE_CASE_AGGREGATION_HOUR_OF_DAY]
ns=Diagnostics/Quicklook
description=Create difference plots for the specified surface fields aggregated by hour of day.
type=python_boolean
compulsory=true
sort-key=0surface3
@@ -60,6 +75,14 @@ type=python_boolean
compulsory=true
sort-key=0surface4

[template variables=DOMAIN_MEAN_SURFACE_TIME_SERIES_CASE_AGGREGATION_HOUR_OF_DAY]
ns=Diagnostics/Quicklook
description=Create a case aggregated time series plot of surface field domain
mean by hour of day.
type=python_boolean
compulsory=true
sort-key=0surface4

[template variables=DOMAIN_SURFACE_HISTOGRAM_SERIES_FIELD]
ns=Diagnostics/Quicklook
description=Create a series of histogram plots for selected surface fields for each cycle time.
@@ -75,6 +98,14 @@ type=python_boolean
compulsory=true
sort-key=0surface5

[template variables=DOMAIN_SURFACE_HISTOGRAM_SERIES_FIELD_CASE_AGGREGATION_HOUR_OF_DAY]
ns=Diagnostics/Quicklook
description=Create a series of histogram plots for selected surface fields.
Cases are aggregated by hour of day.
type=python_boolean
compulsory=true
sort-key=0surface5

[template variables=SURFACE_SINGLE_POINT_TIME_SERIES]
ns=Diagnostics/Quicklook
description=Plot a time series at a single specified location in a surface field.
@@ -146,6 +177,14 @@ type=python_boolean
compulsory=true
sort-key=1pressure3

[template variables=PLOT_SPATIAL_PRESSURE_LEVEL_MODEL_FIELD_CASE_AGGREGATION_HOUR_OF_DAY]
ns=Diagnostics/Quicklook
description=Create plots for the specified pressure level fields.
Cases are aggregated by hour of day.
type=python_boolean
compulsory=true
sort-key=1pressure3

[template variables=DOMAIN_MEAN_VERTICAL_PROFILE_SERIES]
ns=Diagnostics/Quicklook
description=Domain averaged vertical profile of pressure levels for each time.
@@ -161,6 +200,14 @@ type=python_boolean
compulsory=true
sort-key=1pressure3

[template variables=DOMAIN_MEAN_VERTICAL_PROFILE_SERIES_CASE_AGGREGATION_HOUR_OF_DAY]
ns=Diagnostics/Quicklook
description=Domain averaged vertical profile of pressure levels for each time.
Cases are aggregated by hour of day.
type=python_boolean
compulsory=true
sort-key=1pressure3

[template variables=DOMAIN_HISTOGRAM_SERIES]
ns=Diagnostics/Quicklook
description=Create a series of histogram plots for selected pressure levels for each cycle time.
@@ -185,6 +232,14 @@ type=python_boolean
compulsory=true
sort-key=1pressure4a

[template variables=DOMAIN_HISTOGRAM_SERIES_CASE_AGGREGATION_HOUR_OF_DAY]
ns=Diagnostics/Quicklook
description=Create a series of histogram plots for selected pressure levels for each cycle time.
Cases are aggregated by hour of day.
type=python_boolean
compulsory=true
sort-key=1pressure4a

[template variables=EXTRACT_PLEVEL_TRANSECT]
ns=Diagnostics/Quicklook
description=Plot a cross section of pressure for variables.
@@ -258,6 +313,14 @@ type=python_boolean
compulsory=true
sort-key=2modellevel3

[template variables=PLOT_SPATIAL_MODEL_LEVEL_MODEL_FIELD_CASE_AGGREGATION_HOUR_OF_DAY]
ns=Diagnostics/Quicklook
description=Create plots for specified model level fields and aggregate cases by
hour of day.
type=python_boolean
compulsory=true
sort-key=2modellevel3

[template variables=DOMAIN_MEAN_VERTICAL_PROFILE_MODEL_LEVEL_SERIES]
ns=Diagnostics/Quicklook
description=Domain averaged vertical profile for each validity time.
@@ -273,6 +336,14 @@ type=python_boolean
compulsory=true
sort-key=2modellevel4

[template variables=DOMAIN_MEAN_VERTICAL_PROFILE_MODEL_LEVEL_SERIES_CASE_AGGREGATION_HOUR_OF_DAY]
ns=Diagnostics/Quicklook
description=Case aggregated,domain averaged vertical profile for each validity
time aggregated by hour of day.
type=python_boolean
compulsory=true
sort-key=2modellevel4

[template variables=EXTRACT_MLEVEL_TRANSECT]
ns=Diagnostics/Quicklook
description=Plot a cross section of model_level_number for variables.
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
category: Profiles
title: $MODEL_NAME Domain horizontal mean $VARNAME vertical profile as series case aggregation by hour of day
description: |
Plots a time series of vertical profiles for the domain mean $VARNAME using a
`model_level_number` coordinate. This recipe aggregates over all cases using a
consistent hour of day.
steps:
- operator: read.read_cubes
constraint:
operator: constraints.combine_constraints
variable_constraint:
operator: constraints.generate_var_constraint
varname: $VARNAME
pressure_level_constraint:
operator: constraints.generate_level_constraint
coordinate: model_level_number
levels: "*"

- operator: collapse.collapse
coordinate: [grid_latitude, grid_longitude]
method: MEAN

- operator: collapse.collapse_by_hour_of_day
method: MEAN

# Plot the vertical line series.
- operator: plot.plot_vertical_line_series
series_coordinate: model_level_number
sequence_coordinate: hour

# Make a single NetCDF with all the data inside it.
- operator: write.write_cube_to_nc
overwrite: True
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
category: Model Level Spatial
title: $MODEL_NAME $VARNAME $MLEVEL Level Spatial Plot case aggregation by hour of day
description: |
Extracts ands plots the $VARNAME from a file at model level $MLEVEL. The cases
are aggregated together by keeping the hour of day consistent.
steps:
- operator: read.read_cubes
constraint:
operator: constraints.combine_constraints
variable_constraint:
operator: constraints.generate_var_constraint
varname: $VARNAME
model_level_constraint:
operator: constraints.generate_level_constraint
coordinate: "model_level_number"
levels: $MLEVEL

- operator: collapse.collapse_by_hour_of_day
method: MEAN

- operator: plot.spatial_contour_plot
sequence_coordinate: hour
stamp_coordinate: realization

- operator: write.write_cube_to_nc
overwrite: True
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
category: Profiles
title: $MODEL_NAME Domain horizontal mean $VARNAME vertical profile as series case aggregation by hour of day
description: |
Plots a time series of vertical profiles for the domain mean $VARNAME using a
log pressure coordinate. Multiple cases are aggregated together keeping the
hour of day consistent.
steps:
- operator: read.read_cubes
constraint:
operator: constraints.combine_constraints
variable_constraint:
operator: constraints.generate_var_constraint
varname: $VARNAME
pressure_level_constraint:
operator: constraints.generate_level_constraint
coordinate: pressure
levels: "*"

- operator: collapse.collapse
coordinate: [grid_latitude, grid_longitude]
method: MEAN

- operator: collapse.collapse_by_hour_of_day
method: MEAN

# Plot the vertical line series.
- operator: plot.plot_vertical_line_series
series_coordinate: pressure
sequence_coordinate: hour

# Make a single NetCDF with all the data inside it.
- operator: write.write_cube_to_nc
overwrite: True
Loading

0 comments on commit b0a034d

Please sign in to comment.