Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ values='planar', 'spherical'
[namelist:lfric2lfric=destination_mesh_name]
compulsory=true
description=Tag-name for destination-mesh
fail-if=this == namelist:lfric2lfric=source_mesh_name ;
help=Mesh topologies are held in UGRID conformant NetCDF files which
=may contain more than one mesh topology. This tag-name identifies
=the mesh topology to use from the mesh file namelist:lfric2lfric=destination_meshfile_prefix.
Expand Down Expand Up @@ -183,7 +182,6 @@ values='planar', 'spherical'
[namelist:lfric2lfric=source_mesh_name]
compulsory=true
description=Tag-name for source-mesh
fail-if=this == namelist:lfric2lfric=destination_mesh_name ;
help=Mesh topologies are held in UGRID conformant NetCDF files which
=may contain more than one mesh topology. This tag-name identifies
=the mesh topology to use from the mesh file namelist:lfric2lfric=source_meshfile_prefix.
Expand All @@ -194,7 +192,6 @@ type=character
[namelist:lfric2lfric=source_meshfile_prefix]
compulsory=true
description=Location of source 2D mesh input file(s) (prefix).
fail-if=namelist:lfric2lfric=regrid_method == "'map'" and this != namelist:lfric2lfric=destination_meshfile_prefix ;
help=Input files for 2D meshes are in NetCDF file format. The mesh topologies in the file should
=be conformant to UGRID convention.
=
Expand Down Expand Up @@ -240,8 +237,6 @@ type=character
compulsory=true
description=The domain type that the source data will be regridded to.
!enumeration=true
fail-if=this == "'LBC'" and namelist:lfric2lfric=origin_domain == "'LAM'" # LAM cannot provide source values for LBC creation
=this == "'global'" and namelist:lfric2lfric=origin_domain == "'LAM'" # LAM cannot currently be regrid into global
help=Target domains currently not supported include:
=
= origin => target
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,13 @@ def upgrade(self, config, meta_config=None):
# Add settings
return config, self.reports
"""

class vn32_t655(MacroUpgrade):
# Upgrade macro for #655 by Christine Johnson

BEFORE_TAG = "vn3.2"
AFTER_TAG = "vn3.2_t655"

def upgrade(self, config, meta_config=None):
# Add settings
return config, self.reports
9 changes: 0 additions & 9 deletions rose-stem/app/lfric2lfric/opt/rose-app-C128-lam.conf

This file was deleted.

19 changes: 0 additions & 19 deletions rose-stem/app/lfric2lfric/opt/rose-app-C12_C16_lam.conf

This file was deleted.

20 changes: 0 additions & 20 deletions rose-stem/app/lfric2lfric/opt/rose-app-clim_gal9_ral_seuk.conf

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
[namelist:lfric2lfric]
destination_mesh_name='C24'
destination_meshfile_prefix='${MESH_DIR}/C24_C12/mesh_C24_C12'
source_mesh_name='C12'
source_meshfile_prefix='${MESH_DIR}/C24_C12/mesh_C24_C12'
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[namelist:lfric2lfric]
destination_mesh_name='multigrid_l1'
destination_meshfile_prefix='${MESH_DIR}/seuk_MG/mesh_seuk_MG'
source_meshfile_prefix='${MESH_DIR}/seuk_MG/mesh_seuk_MG'
destination_topology='non_periodic'
target_domain='LAM'

[namelist:partitioning(destination)]
partitioner='planar'

[namelist:partitioning(source)]
partitioner='planar'
8 changes: 8 additions & 0 deletions rose-stem/app/lfric2lfric/opt/rose-app-dst_seuk.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[namelist:lfric2lfric]
destination_mesh_name='dynamics'
destination_meshfile_prefix='${MESH_DIR}/seuk_MG/mesh_seuk_MG'
destination_topology='non_periodic'
target_domain='LAM'

[namelist:partitioning(destination)]
partitioner='planar'
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ stretching_method='smooth'
[namelist:files]
checkpoint_stem_name='restart_lfric2lfric_clim_gal9_C12_MG'
start_dump_filename='lfric2lfric_clim_gal9_C12_MG'

[namelist:lfric2lfric]
source_mesh_name='C12'
source_meshfile_prefix='${MESH_DIR}/C24_C12/mesh_C24_C12'
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ coord_order=2
coord_order_nonprime=2

[namelist:lfric2lfric]
destination_topology='non_periodic'
origin_domain='LAM'
source_mesh_name='dynamics'
source_meshfile_prefix='${MESH_DIR}/seuk_MG/mesh_seuk_MG'
source_topology='non_periodic'
target_domain='LAM'

[namelist:orography]
orography_order=2
2 changes: 0 additions & 2 deletions rose-stem/app/mesh/opt/rose-app-C12_C16_lam.conf

This file was deleted.

44 changes: 22 additions & 22 deletions rose-stem/site/common/lfric2lfric/tasks_lfric2lfric.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
{# The file LICENCE, distributed with this code, contains details of the terms #}
{# under which the code may be used. #}
{# ########################################################################### #}
{% do LOG.debug("Entered site/common/lfric2lfric/tasks_solver.cylc") %}
{% do LOG.debug("Entered site/common/lfric2lfric/tasks_lfric2lfric.cylc") %}

{% if task_ns.conf_name == "ral_seuk-C32_lam_MG_1cpu" %}

{% do task_dict.update({
"opt_confs": ["ral_seuk"],
"opt_confs": ["src_seuk_L70","dst_seuk-coarse"],
"resolution": "seuk_MG",
"dst_mesh": "",
"dst_name": "",
Expand All @@ -21,7 +21,7 @@
{% elif task_ns.conf_name == "ral_seuk-C32_lam_MG_4cpu" %}

{% do task_dict.update({
"opt_confs": ["ral_seuk"],
"opt_confs": ["src_seuk_L70","dst_seuk-coarse"],
"resolution": "seuk_MG",
"dst_mesh": "",
"dst_name": "",
Expand All @@ -35,7 +35,7 @@
{% elif task_ns.conf_name == "oasis_ral_seuk-C32_lam_MG_1cpu" %}

{% do task_dict.update({
"opt_confs": ["ral_seuk","oasis"],
"opt_confs": ["oasis","src_seuk_L70","dst_seuk-coarse"],
"resolution": "seuk_MG",
"dst_mesh": "seuk_MG",
"dst_name": "multigrid_l1",
Expand All @@ -48,7 +48,7 @@
{% elif task_ns.conf_name == "oasis_ral_seuk-C32_lam_MG_4cpu" %}

{% do task_dict.update({
"opt_confs": ["ral_seuk","oasis"],
"opt_confs": ["oasis","src_seuk_L70","dst_seuk-coarse"],
"resolution": "seuk_MG",
"dst_mesh": "seuk_MG",
"dst_name": "multigrid_l1",
Expand All @@ -62,7 +62,7 @@
{% elif task_ns.conf_name == "ral3-seuk" %}

{% do task_dict.update({
"opt_confs": ["ral3"],
"opt_confs": ["ral3","ral3_seuk"],
"resolution": "ral3_seuk",
"dst_mesh": "",
"dst_name": "",
Expand All @@ -75,7 +75,7 @@
{% elif task_ns.conf_name == "ral3-uk" %}

{% do task_dict.update({
"opt_confs": ["ral3"],
"opt_confs": ["ral3","ral3_uk"],
"resolution": "ral3_uk",
"dst_mesh": "",
"dst_name": "",
Expand All @@ -88,7 +88,7 @@
{% elif task_ns.conf_name == "ral3-ukv" %}

{% do task_dict.update({
"opt_confs": ["ral3"],
"opt_confs": ["ral3","ral3_ukv"],
"resolution": "ral3_ukv",
"dst_mesh": "",
"dst_name": "",
Expand All @@ -101,7 +101,7 @@
{% elif task_ns.conf_name == "clim_gal9-C24_C12_1cpu" %}

{% do task_dict.update({
"opt_confs": ["clim_gal9"],
"opt_confs": ["src_C12_L70","dst_C24"],
"resolution": "C24_C12",
"dst_mesh": "",
"dst_name": "",
Expand All @@ -114,7 +114,7 @@
{% elif task_ns.conf_name == "clim_gal9-C24_C12_6cpu" %}

{% do task_dict.update({
"opt_confs": ["clim_gal9"],
"opt_confs": ["src_C12_L70","dst_C24"],
"resolution": "C24_C12",
"dst_mesh": "",
"dst_name": "",
Expand All @@ -127,7 +127,7 @@
{% elif task_ns.conf_name == "oasis_clim_gal9-C24_C12_1cpu" %}

{% do task_dict.update({
"opt_confs": ["clim_gal9","oasis"],
"opt_confs": ["oasis","src_C12_L70","dst_C24"],
"resolution": "C24_C12",
"dst_mesh": "C24_C12",
"dst_name": "C24",
Expand All @@ -140,7 +140,7 @@
{% elif task_ns.conf_name == "oasis_clim_gal9-C24_C12_6cpu" %}

{% do task_dict.update({
"opt_confs": ["clim_gal9","oasis"],
"opt_confs": ["oasis","src_C12_L70","dst_C24"],
"resolution": "C24_C12",
"dst_mesh": "C24_C12",
"dst_name": "C24",
Expand All @@ -154,8 +154,8 @@
{% elif task_ns.conf_name == "oasis_clim_gal9_C12-ral_seuk_C16_lam_1cpu" %}

{% do task_dict.update({
"opt_confs": ["clim_gal9_ral_seuk","oasis"],
"resolution": "C12_C16_lam",
"opt_confs": ["oasis","src_C12_L70","dst_seuk"],
"resolution": ["C24_C12", "seuk_MG"],
"dst_mesh": "seuk_MG",
"dst_name": "dynamics",
"dst_type": "regional",
Expand All @@ -167,8 +167,8 @@
{% elif task_ns.conf_name == "oasis_clim_gal9_C12-ral_seuk_C16_lam_4cpu" %}

{% do task_dict.update({
"opt_confs": ["clim_gal9_ral_seuk","oasis", "multi-cpu"],
"resolution": "C12_C16_lam",
"opt_confs": [ "oasis","src_C12_L70","dst_seuk","multi-cpu"],
"resolution": ["C24_C12", "seuk_MG"],
"dst_mesh": "seuk_MG",
"dst_name": "dynamics",
"dst_type": "regional",
Expand All @@ -181,8 +181,8 @@
{% elif task_ns.conf_name == "oasis_clim_gal9_C12-ral_seuk_C16_lam-lbc_1cpu" %}

{% do task_dict.update({
"opt_confs": ["clim_gal9_ral_seuk","oasis","lbc"],
"resolution": "C12_C16_lam",
"opt_confs": ["oasis","src_C12_L70","dst_seuk","lbc"],
"resolution": ["C24_C12", "seuk_MG"],
"dst_mesh": "seuk_MG",
"dst_name": "dynamics-lbc",
"dst_type": "regional",
Expand All @@ -194,8 +194,8 @@
{% elif task_ns.conf_name == "oasis_clim_gal9_C12-ral_seuk_C16_lam-lbc_4cpu" %}

{% do task_dict.update({
"opt_confs": ["clim_gal9_ral_seuk","oasis","lbc", "multi-cpu"],
"resolution": "C12_C16_lam",
"opt_confs": ["oasis","src_C12_L70","dst_seuk","lbc","multi-cpu"],
"resolution": ["C24_C12", "seuk_MG"],
"dst_mesh": "seuk_MG",
"dst_name": "dynamics-lbc",
"dst_type": "regional",
Expand Down Expand Up @@ -227,7 +227,7 @@

{% endif %}

{# Set default values for Solver tasks #}
{# Set default values for Lfric2lfric tasks #}
{% if task_dict %}
{% do task_dict.update({"application_dir": "lfric_apps/applications/lfric2lfric"}) %}
{% if "app_name" not in task_dict %}
Expand All @@ -238,4 +238,4 @@
{% endif %}
{% endif %}

{% do LOG.debug("Finished in site/common/lfric2lfric/tasks_solver.cylc") %}
{% do LOG.debug("Finished in site/common/lfric2lfric/tasks_lfric2lfric.cylc") %}
58 changes: 43 additions & 15 deletions rose-stem/templates/graph/populate_gen_weights_graph.cylc
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,53 @@
{% do tasks_to_run.update({mesh_build_weights_platform: {} }) %}
{% endif %}

{# Set mesh generate task for weights platform #}
{% set mesh_run_weights_platform = "run_mesh_"~
task_values["resolution"]~"_"~
site_vars["scripts_platform"]~"_"~
site_vars["mesh_build"][site_vars["scripts_platform"]] %}
{% if mesh_run_weights_platform not in tasks_to_run %}
{% do tasks_to_run.update({mesh_run_weights_platform: {} }) %}
{% endif %}

{% do graph_sections.append([
export_task_weights_platform, mesh_build_weights_platform
]) %}

{% do graph_sections.append([
mesh_build_weights_platform, mesh_run_weights_platform
]) %}
{% do graph_sections.append([
mesh_run_weights_platform, generate_weights_task~"?"
]) %}
{% if task_values["resolution"] is iterable and task_values["resolution"] is not string %}
{% set resolutions = task_values["resolution"] %}
{% else %}
{% set resolutions = [task_values["resolution"]] %}
{% endif %}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{% if task_values["resolution"] is iterable and task_values["resolution"] is not string %}
{% set resolutions = task_values["resolution"] %}
{% else %}
{% set resolutions = [task_values["resolution"]] %}
{% endif %}
{% if task_values["resolution"] is string %}
{% set resolutions = [task_values["resolution"]] %}
{% endif %}

I think you can simplify this by just checking whether it's a string

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I could just check for a string. But I'll still need to have both parts, because sometimes its a string (for cases with 2 meshes) and sometimes its not (for cases with 1 mesh).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've now implemented the same solution as lfric core. As you say, testing for a string. Thanks.


{% set previous_graph_task = mesh_build_weights_platform %}

{% for res in resolutions %}

{# Set mesh generate task for weights platform #}
{% set mesh_run_weights_platform = "run_mesh_"~
res~"_"~
site_vars["scripts_platform"]~"_"~
site_vars["mesh_build"][site_vars["scripts_platform"]] %}

{% if mesh_run_weights_platform not in tasks_to_run %}
{% do tasks_to_run.update({mesh_run_weights_platform: {} }) %}
{% endif %}

{# Define the previous task (i.e. the resolution in the list before) #}
{% if not loop.first %}
{% set prev_res = resolutions[loop.index0 -1] %}
{% set previous_graph_task = "run_mesh_"~
prev_res~"_"~
site_vars["scripts_platform"]~"_"~
site_vars["mesh_build"][site_vars["scripts_platform"]] %}
{% endif %}

{# Trigger the current mesh from the previous mesh (unless they are the same) #}
{% if mesh_run_weights_platform != previous_graph_task %}
{% do graph_sections.append([
previous_graph_task, mesh_run_weights_platform
]) %}
{% endif %}

{# Trigger the weights generation if this is the last mesh #}
{% if loop.last %}
{% do graph_sections.append([
mesh_run_weights_platform, generate_weights_task
]) %}
{% endif %}
{% endfor %}

{% do graph_sections.append([
generate_weights_task~":finish", export_weights_task
Expand Down
Loading
Loading