Skip to content

Commit

Permalink
Convert more recipes and include files
Browse files Browse the repository at this point in the history
  • Loading branch information
jfrost-mo committed Aug 20, 2024
1 parent 3803b2b commit 64f57da
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 25 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
{% if SURFACE_SINGLE_POINT_TIME_SERIES %}
{% for model_field in SURFACE_MODEL_FIELDS %}
{% for equivalent_field in restructure_field_list(SURFACE_MODEL_FIELDS) %}
{% for model_number, field in equivalent_field.items() %}
[runtime]
[[pre_process_surface_single_point_time_series_{{model_field}}]]
inherit = PARALLEL
[[generic_surface_single_point_time_series_m{{model_number}}_{{sanitise_task_name(field)}}]]
inherit = PROCESS
[[[environment]]]
CSET_RECIPE_NAME = "generic_surface_single_point_time_series.yaml"
CSET_ADDOPTS = "--VARNAME={{model_field}} --LONGITUDE_POINT={{LONGITUDE_POINT}} --LATITUDE_POINT={{LATITUDE_POINT}} --SINGLE_POINT_METHOD={{SINGLE_POINT_METHOD}}"

[[collate_surface_single_point_time_series_{{model_field}}]]
inherit = COLLATE
[[[environment]]]
CSET_RECIPE_NAME = "generic_surface_single_point_time_series.yaml"
CSET_ADDOPTS = "--VARNAME={{model_field}} --LONGITUDE_POINT={{LONGITUDE_POINT}} --LATITUDE_POINT={{LATITUDE_POINT}} --SINGLE_POINT_METHOD={{SINGLE_POINT_METHOD}}"
CSET_ADDOPTS = """
--VARNAME='{{field}}'
--MODEL_NAME='{{models[model_number-1]["name"]}}'
--LONGITUDE_POINT='{{LONGITUDE_POINT}}'
--LATITUDE_POINT='{{LATITUDE_POINT}}'
--SINGLE_POINT_METHOD='{{SINGLE_POINT_METHOD}}'
"""
MODEL_NUMBER = {{model_number}}
{% endfor %}
{% endfor %}
{% endif %}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
category: Quick Look
title: Domain mean surface $VARNAME time series
title: $MODEL_NAME Domain mean surface $VARNAME time series
description: Plots a time series of the domain mean surface $VARNAME.

steps:
Expand Down
15 changes: 1 addition & 14 deletions src/CSET/recipes/generic_surface_single_point_time_series.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
category: Quick Look
title: Time series of $VARNAME at $LATITUDE_POINT N, $LONGITUDE_POINT E
title: $MODEL_NAME Time series of $VARNAME at $LATITUDE_POINT N, $LONGITUDE_POINT E
description: Plots a time series of the surface $VARNAME at a selected gridpoint.

# Parallel steps.
Expand All @@ -14,25 +14,12 @@ parallel:
operator: constraints.generate_level_constraint
levels: []
coordinate: "pressure"
validity_time_constraint:
operator: constraints.generate_time_constraint
time_start: $VALIDITY_TIME

- operator: regrid.regrid_to_single_point
lat_pt: $LATITUDE_POINT
lon_pt: $LONGITUDE_POINT
method: $SINGLE_POINT_METHOD

# Save single-point variable to a file per validity time.
- operator: write.write_cube_to_nc
filename: intermediate/single_point_values

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

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

0 comments on commit 64f57da

Please sign in to comment.