Skip to content

Commit

Permalink
Convert pressure-level recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrost-mo committed Aug 22, 2024
1 parent aa7e160 commit fa30f29
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 55 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{% if DOMAIN_MEAN_VERTICAL_PROFILE_SERIES %}
{% for equivalent_field in restructure_field_list(PRESSURE_LEVEL_MODEL_FIELDS) %}
{% for model_number, field in equivalent_field.items() %}
[runtime]
{% for model_field in PRESSURE_LEVEL_MODEL_FIELDS %}
[[pre_process_domain_mean_vertical_profile_series_{{model_field}}]]
inherit = PARALLEL
[[generic_domain_mean_vertical_profile_series_m{{model_number}}_{{sanitise_task_name(field)}}]]
inherit = PROCESS
[[[environment]]]
CSET_RECIPE_NAME = "generic_domain_mean_vertical_profile_series.yaml"
CSET_ADDOPTS = "--VARNAME='{{model_field}}' --PLEVEL='{{PRESSURE_LEVELS}}'"

[[collate_domain_mean_vertical_profile_series_{{model_field}}]]
inherit = COLLATE
[[[environment]]]
CSET_RECIPE_NAME = "generic_domain_mean_vertical_profile_series.yaml"
CSET_ADDOPTS = "--VARNAME='{{model_field}}' --PLEVEL='{{PRESSURE_LEVELS}}'"
CSET_ADDOPTS = """
--VARNAME='{{field}}'
--MODEL_NAME='{{models[model_number-1]["name"]}}'
"""
MODEL_NUMBER = {{model_number}}
{% endfor %}
{% endfor %}
{% endif %}
23 changes: 12 additions & 11 deletions cset-workflow/includes/plot_spatial_plevel_model_field.cylc
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
{% if PLOT_SPATIAL_PRESSURE_LEVEL_MODEL_FIELD %}
[runtime]
{% for model_field in PRESSURE_LEVEL_MODEL_FIELDS %}
{% for equivalent_field in restructure_field_list(PRESSURE_LEVEL_MODEL_FIELDS) %}
{% for model_number, field in equivalent_field.items() %}
{% for plevel in PRESSURE_LEVELS %}
[[process_generic_plevel_spatial_plot_sequence_{{model_field}}_{{plevel}}]]
inherit = PARALLEL
[[[environment]]]
CSET_RECIPE_NAME = "generic_plevel_spatial_plot_sequence.yaml"
CSET_ADDOPTS = "--VARNAME={{model_field}} --PLEVEL={{plevel}}"

[[collate_generic_plevel_spatial_plot_sequence_{{model_field}}_{{plevel}}]]
inherit = COLLATE
[runtime]
[[generic_plevel_spatial_plot_sequence_m{{model_number}}_{{sanitise_task_name(field)}}]]
inherit = PROCESS
[[[environment]]]
CSET_RECIPE_NAME = "generic_plevel_spatial_plot_sequence.yaml"
CSET_ADDOPTS = "--VARNAME={{model_field}} --PLEVEL={{plevel}}"
CSET_ADDOPTS = """
--VARNAME='{{field}}'
--PLEVEL='{{plevel}}'
--MODEL_NAME='{{models[model_number-1]["name"]}}'
"""
MODEL_NUMBER = {{model_number}}
{% endfor %}
{% endfor %}
{% endfor %}
{% endif %}
24 changes: 5 additions & 19 deletions src/CSET/recipes/generic_domain_mean_vertical_profile_series.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
category: Profiles
title: Domain horizontal mean $VARNAME vertical profile as series
title: $MODEL_NAME Domain horizontal mean $VARNAME vertical profile as series
description: Plots a time series of vertical profiles for the domain mean $VARNAME using a log pressure coordinate.

# Pre-processing steps.
parallel:
steps:
- operator: read.read_cube
constraint:
operator: constraints.combine_constraints
Expand All @@ -12,27 +11,14 @@ parallel:
varname: $VARNAME
pressure_level_constraint:
operator: constraints.generate_level_constraint
coordinate: "pressure"
levels: $PLEVEL
validity_time_constraint:
operator: constraints.generate_time_constraint
time_start: $VALIDITY_TIME
coordinate: pressure
levels: "*"

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

# Save domain meaned variable to a file per validity time.
- operator: write.write_cube_to_nc
filename: intermediate/pressure_level_domain_mean

# Collation steps.
# Reads in intermediate cube and plots it.
collate:
- operator: read.read_cube
filename_pattern: intermediate/*.nc

# plot the vertical line series
# Plot the vertical line series.
- operator: plot.plot_vertical_line_series
series_coordinate: pressure
sequence_coordinate: time
Expand Down
18 changes: 3 additions & 15 deletions src/CSET/recipes/generic_plevel_spatial_plot_sequence.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
category: Pressure Level Spatial
title: $VARNAME $PLEVEL Level Spatial Plot
title: $MODEL_NAME $VARNAME $PLEVEL Level Spatial Plot
description: |
Extracts ands plots the $PLEVELNAME from a file at pressure level $PLEVEL.
Extracts ands plots the $PLEVELNAME from $MODEL_NAME at pressure level $PLEVEL.
parallel:
- operator: read.read_cube
Expand All @@ -10,25 +10,13 @@ parallel:
variable_constraint:
operator: constraints.generate_var_constraint
varname: $VARNAME
validity_time_constraint:
operator: constraints.generate_time_constraint
time_start: $VALIDITY_TIME
pressure_level_constraint:
operator: constraints.generate_level_constraint
coordinate: "pressure"
coordinate: pressure
levels: $PLEVEL

- operator: write.write_cube_to_nc

- operator: plot.spatial_contour_plot
sequence_coordinate: time

- operator: write.write_cube_to_nc
filename: intermediate/pressure_level_field

collate:
- operator: read.read_cube
filename_pattern: intermediate/*.nc

- operator: write.write_cube_to_nc
overwrite: True

0 comments on commit fa30f29

Please sign in to comment.