diff --git a/applications/solver/rose-meta/lfric-solver/versions.py b/applications/solver/rose-meta/lfric-solver/versions.py index 01e65a2b91..539346aba5 100644 --- a/applications/solver/rose-meta/lfric-solver/versions.py +++ b/applications/solver/rose-meta/lfric-solver/versions.py @@ -31,3 +31,148 @@ def upgrade(self, config, meta_config=None): # Add settings return config, self.reports """ + +class vn32_t551(MacroUpgrade): + """Upgrade macro for ticket #551 by Christine Johnson.""" + + BEFORE_TAG = "vn3.2" + AFTER_TAG = "vn3.2_t551" + + def upgrade(self, config, meta_config=None): + # Commands From: rose-meta/lfric-gungho + partitioner = self.get_setting_value( + config, ["namelist:partitioning", "partitioner"] + ) + multigrid_chain_nitems = self.get_setting_value( + config, ["namelist:multigrid", "multigrid_chain_nitems"] + ) + if partitioner == "'planar'": + self.add_setting( + config, + ["namelist:base_mesh", "prime_mesh_name"], + "'l0_planar'", + forced=True, + ) + if multigrid_chain_nitems == "4": + self.add_setting( + config, + ["namelist:multigrid", "chain_mesh_tags"], + "'l0_planar','l1_planar','l2_planar','l3_planar'", + forced=True, + ) + elif multigrid_chain_nitems == "3": + self.add_setting( + config, + ["namelist:multigrid", "chain_mesh_tags"], + "'l0_planar','l1_planar','l2_planar'", + forced=True, + ) + elif multigrid_chain_nitems == "2": + self.add_setting( + config, + ["namelist:multigrid", "chain_mesh_tags"], + "'l0_planar','l1_planar'", + forced=True, + ) + else: + self.add_setting( + config, + ["namelist:base_mesh", "prime_mesh_name"], + "'l0_cubedsphere'", + forced=True, + ) + if multigrid_chain_nitems == "4": + self.add_setting( + config, + ["namelist:multigrid", "chain_mesh_tags"], + "'l0_cubedsphere','l1_cubedsphere','l2_cubedsphere','l3_cubedsphere'", + forced=True, + ) + elif multigrid_chain_nitems == "3": + self.add_setting( + config, + ["namelist:multigrid", "chain_mesh_tags"], + "'l0_cubedsphere','l1_cubedsphere','l2_cubedsphere'", + forced=True, + ) + elif multigrid_chain_nitems == "2": + self.add_setting( + config, + ["namelist:multigrid", "chain_mesh_tags"], + "'l0_cubedsphere','l1_cubedsphere'", + forced=True, + ) + partitioner_dest = self.get_setting_value( + config, ["namelist:partitioning(destination)", "partitioner"] + ) + destination_mesh_name = self.get_setting_value( + config, ["namelist:lfric2lfric", "destination_mesh_name"] + ) + if partitioner_dest == "'planar'": + if destination_mesh_name == "'dynamics'": + self.add_setting( + config, + ["namelist:lfric2lfric", "destination_mesh_name"], + "'l0_planar", + forced=True, + ) + elif destination_mesh_name == "'multigrid_l1'": + self.add_setting( + config, + ["namelist:lfric2lfric", "destination_mesh_name"], + "'l1_planar", + forced=True, + ) + elif partitioner_dest == "'cubedsphere'": + if destination_mesh_name == "'dynamics'": + self.add_setting( + config, + ["namelist:lfric2lfric", "destination_mesh_name"], + "'l0_planar", + forced=True, + ) + elif destination_mesh_name == "'multigrid_l1'": + self.add_setting( + config, + ["namelist:lfric2lfric", "destination_mesh_name"], + "'l1_cubedsphere", + forced=True, + ) + partitioner_source = self.get_setting_value( + config, ["namelist:partitioning(source)", "partitioner"] + ) + source_mesh_name = self.get_setting_value( + config, ["namelist:lfric2lfric", "source_mesh_name"] + ) + if partitioner_source == "'planar'": + if source_mesh_name == "'dynamics'": + self.add_setting( + config, + ["namelist:lfric2lfric", "source_mesh_name"], + "'l0_planar", + forced=True, + ) + elif source_mesh_name == "'multigrid_l1'": + self.add_setting( + config, + ["namelist:lfric2lfric", "source_mesh_name"], + "'l1_planar", + forced=True, + ) + elif partitioner_source == "'cubedsphere'": + if source_mesh_name == "'dynamics'": + self.add_setting( + config, + ["namelist:lfric2lfric", "source_mesh_name"], + "'l0_cubedsphere", + forced=True, + ) + elif source_mesh_name == "'multigrid_l1'": + self.add_setting( + config, + ["namelist:lfric2lfric", "source_mesh_name"], + "'l1_cubedsphere", + forced=True, + ) + + return config, self.reports diff --git a/rose-stem/app/lfric2lfric/opt/rose-app-C24_C12.conf b/rose-stem/app/lfric2lfric/opt/rose-app-C24_C12.conf index 1da248c8cf..ad4daa1250 100644 --- a/rose-stem/app/lfric2lfric/opt/rose-app-C24_C12.conf +++ b/rose-stem/app/lfric2lfric/opt/rose-app-C24_C12.conf @@ -1,5 +1,5 @@ [namelist:lfric2lfric] -destination_mesh_name='C24' +destination_mesh_name='l0_cubedsphere' destination_meshfile_prefix='${MESH_DIR}/C24_C12/mesh_C24_C12' -source_mesh_name='C12' +source_mesh_name='l1_cubedsphere' source_meshfile_prefix='${MESH_DIR}/C24_C12/mesh_C24_C12' diff --git a/rose-stem/app/lfric2lfric/opt/rose-app-clim_gal9_ral_seuk.conf b/rose-stem/app/lfric2lfric/opt/rose-app-clim_gal9_ral_seuk.conf index c9a2536321..31306e3532 100644 --- a/rose-stem/app/lfric2lfric/opt/rose-app-clim_gal9_ral_seuk.conf +++ b/rose-stem/app/lfric2lfric/opt/rose-app-clim_gal9_ral_seuk.conf @@ -13,6 +13,7 @@ checkpoint_stem_name='restart_lfric2lfric_ral_seuk_MG' start_dump_filename='lfric2lfric_clim_gal9_C12_MG' [namelist:lfric2lfric] +destination_mesh_name='l0_planar' destination_topology='non_periodic' target_domain='LAM' diff --git a/rose-stem/site/common/lfric2lfric/tasks_lfric2lfric.cylc b/rose-stem/site/common/lfric2lfric/tasks_lfric2lfric.cylc index 535f735232..53f549de84 100644 --- a/rose-stem/site/common/lfric2lfric/tasks_lfric2lfric.cylc +++ b/rose-stem/site/common/lfric2lfric/tasks_lfric2lfric.cylc @@ -38,10 +38,10 @@ "opt_confs": ["ral_seuk","oasis"], "resolution": "seuk_MG", "dst_mesh": "seuk_MG", - "dst_name": "multigrid_l1", + "dst_name": "l1_planar", "dst_type": "regional", "src_mesh": "seuk_MG", - "src_name": "dynamics", + "src_name": "l0_planar", "src_type": "regional", }) %} @@ -51,10 +51,10 @@ "opt_confs": ["ral_seuk","oasis"], "resolution": "seuk_MG", "dst_mesh": "seuk_MG", - "dst_name": "multigrid_l1", + "dst_name": "l1_planar", "dst_type": "regional", "src_mesh": "seuk_MG", - "src_name": "dynamics", + "src_name": "l0_planar", "src_type": "regional", "mpi_parts": 4, }) %} @@ -130,10 +130,10 @@ "opt_confs": ["clim_gal9","oasis"], "resolution": "C24_C12", "dst_mesh": "C24_C12", - "dst_name": "C24", + "dst_name": "l0_cubedsphere", "dst_type": "global", "src_mesh": "C24_C12", - "src_name": "C12", + "src_name": "l1_cubedsphere", "src_type": "global", }) %} @@ -143,10 +143,10 @@ "opt_confs": ["clim_gal9","oasis"], "resolution": "C24_C12", "dst_mesh": "C24_C12", - "dst_name": "C24", + "dst_name": "l0_cubedsphere", "dst_type": "global", "src_mesh": "C24_C12", - "src_name": "C12", + "src_name": "l1_cubedsphere", "src_type": "global", "mpi_parts": 6, }) %} @@ -157,10 +157,10 @@ "opt_confs": ["clim_gal9_ral_seuk","oasis"], "resolution": "C12_C16_lam", "dst_mesh": "seuk_MG", - "dst_name": "dynamics", + "dst_name": "l0_planar", "dst_type": "regional", "src_mesh": "C24_C12", - "src_name": "C12", + "src_name": "l1_cubedsphere", "src_type": "global", }) %} @@ -170,10 +170,10 @@ "opt_confs": ["clim_gal9_ral_seuk","oasis", "multi-cpu"], "resolution": "C12_C16_lam", "dst_mesh": "seuk_MG", - "dst_name": "dynamics", + "dst_name": "l0_planar", "dst_type": "regional", "src_mesh": "C24_C12", - "src_name": "C12", + "src_name": "l1_cubedsphere", "src_type": "global", "mpi_parts": 4, }) %} @@ -184,10 +184,10 @@ "opt_confs": ["clim_gal9_ral_seuk","oasis","lbc"], "resolution": "C12_C16_lam", "dst_mesh": "seuk_MG", - "dst_name": "dynamics-lbc", + "dst_name": "l0_planar-lbc", "dst_type": "regional", "src_mesh": "C24_C12", - "src_name": "C12", + "src_name": "l1_cubedsphere", "src_type": "global", }) %} @@ -197,10 +197,10 @@ "opt_confs": ["clim_gal9_ral_seuk","oasis","lbc", "multi-cpu"], "resolution": "C12_C16_lam", "dst_mesh": "seuk_MG", - "dst_name": "dynamics-lbc", + "dst_name": "l0_planar-lbc", "dst_type": "regional", "src_mesh": "C24_C12", - "src_name": "C12", + "src_name": "l1_cubedsphere", "src_type": "global", "mpi_parts": 4, }) %} diff --git a/rose-stem/site/common/lfricinputs/tasks_lfric2um.cylc b/rose-stem/site/common/lfricinputs/tasks_lfric2um.cylc index f8269da615..764d7e1a42 100644 --- a/rose-stem/site/common/lfricinputs/tasks_lfric2um.cylc +++ b/rose-stem/site/common/lfricinputs/tasks_lfric2um.cylc @@ -10,7 +10,7 @@ {% do task_dict.update({ "opt_confs": [], "resolution": "C48", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "C48", "source_grid_levs": "38", "source_grid_type": "global", @@ -26,7 +26,7 @@ {% do task_dict.update({ "opt_confs": ["performance"], "resolution": "C224", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "C224", "source_grid_levs": "70", "source_grid_type": "global", @@ -43,7 +43,7 @@ {% do task_dict.update({ "opt_confs": ["um_lam"], "resolution": "C48", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "C48", "source_grid_levs": "70", "source_grid_type": "global", diff --git a/rose-stem/site/common/lfricinputs/tasks_scintelapi.cylc b/rose-stem/site/common/lfricinputs/tasks_scintelapi.cylc index aa959d75b6..ca7faf3285 100644 --- a/rose-stem/site/common/lfricinputs/tasks_scintelapi.cylc +++ b/rose-stem/site/common/lfricinputs/tasks_scintelapi.cylc @@ -10,7 +10,7 @@ {% do task_dict.update({ "opt_confs": ["basic"], "resolution": "C48", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "C48", "source_grid_levs": "38", "source_grid_type": "global", @@ -25,7 +25,7 @@ {% do task_dict.update({ "opt_confs": ["mixingratio"], "resolution": "C12", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "C12", "source_grid_levs": "70", "source_grid_type": "global", diff --git a/rose-stem/site/common/lfricinputs/tasks_um2lfric.cylc b/rose-stem/site/common/lfricinputs/tasks_um2lfric.cylc index 530d5061b1..e731fc03b7 100644 --- a/rose-stem/site/common/lfricinputs/tasks_um2lfric.cylc +++ b/rose-stem/site/common/lfricinputs/tasks_um2lfric.cylc @@ -10,7 +10,7 @@ {% do task_dict.update({ "opt_confs": ["aquaplanet"], "resolution": "C48", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "N48", "source_grid_levs": "38", "source_grid_type": "global", @@ -27,7 +27,7 @@ {% do task_dict.update({ "opt_confs": ["aquaplanet"], "resolution": "C96", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "N48", "source_grid_levs": "38", "source_grid_type": "global", @@ -44,7 +44,7 @@ {% do task_dict.update({ "opt_confs": ["aquaplanet"], "resolution": "C12", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "N48", "source_grid_levs": "38", "source_grid_type": "global", @@ -61,7 +61,7 @@ {% do task_dict.update({ "opt_confs": ["basicgal"], "resolution": "C12", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "N96", "source_grid_levs": "70", "source_grid_type": "global", @@ -78,7 +78,7 @@ {% do task_dict.update({ "opt_confs": ["basicgal"], "resolution": "C96", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "N96", "source_grid_levs": "70", "source_grid_type": "global", @@ -95,7 +95,7 @@ {% do task_dict.update({ "opt_confs": ["nwp_gal9"], "resolution": "C12", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "N320", "source_grid_levs": "70", "source_grid_type": "global", @@ -112,7 +112,7 @@ {% do task_dict.update({ "opt_confs": ["nwp_gal9"], "resolution": "C48", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "N320", "source_grid_levs": "70", "source_grid_type": "global", @@ -129,7 +129,7 @@ {% do task_dict.update({ "opt_confs": ["nwp_gal9"], "resolution": "C224", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "N320", "source_grid_levs": "70", "source_grid_type": "global", @@ -148,7 +148,7 @@ {% do task_dict.update({ "opt_confs": ["protogal"], "resolution": "C48", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "N320", "source_grid_levs": "70", "source_grid_type": "global", @@ -165,7 +165,7 @@ {% do task_dict.update({ "opt_confs": ["protogal"], "resolution": "C12", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "N320", "source_grid_levs": "70", "source_grid_type": "global", @@ -182,7 +182,7 @@ {% do task_dict.update({ "opt_confs": ["protogal_chem"], "resolution": "C48", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "N48", "source_grid_levs": "70", "source_grid_type": "global", @@ -199,7 +199,7 @@ {% do task_dict.update({ "opt_confs": ["protogal_chem"], "resolution": "C12", - "mesh_name": "dynamics", + "mesh_name": "l0_cubedsphere", "source_grid_res": "N48", "source_grid_levs": "70", "source_grid_type": "global", @@ -219,7 +219,7 @@ {% do task_dict.update({ "opt_confs": ["aquaplanet_lam"], "resolution": "aquaplanet_lam", - "mesh_name": "dynamics", + "mesh_name": "l0_planar", "source_grid_res": "", "source_grid_levs": "70", "source_grid_type": "regional", @@ -236,7 +236,7 @@ {% do task_dict.update({ "opt_confs": ["aquaplanet_lbc"], "resolution": "aquaplanet_lam", - "mesh_name": "dynamics", + "mesh_name": "l0_planar", "source_grid_res": "", "source_grid_levs": "70", "source_grid_type": "regional", @@ -254,7 +254,7 @@ {% do task_dict.update({ "opt_confs": ["falklands_lam"], "resolution": "falklands", - "mesh_name": "gungho", + "mesh_name": "l0_planar", "panel_decomp": "custom", "source_grid_res": "", "source_grid_levs": "70", @@ -273,7 +273,7 @@ {% do task_dict.update({ "opt_confs": ["var_seuk_lam"], "resolution": "var_seuk", - "mesh_name": "dynamics", + "mesh_name": "l0_planar", "source_grid_res": "", "source_grid_levs": "70", "source_grid_type": "regional", diff --git a/science/gungho/rose-meta/lfric-gungho/versions.py b/science/gungho/rose-meta/lfric-gungho/versions.py index 01e65a2b91..234fc1d6d3 100644 --- a/science/gungho/rose-meta/lfric-gungho/versions.py +++ b/science/gungho/rose-meta/lfric-gungho/versions.py @@ -31,3 +31,193 @@ def upgrade(self, config, meta_config=None): # Add settings return config, self.reports """ + +class vn32_t551(MacroUpgrade): + """Upgrade macro for ticket #551 by Christine Johnson.""" + + BEFORE_TAG = "vn3.2_t386" + AFTER_TAG = "vn3.2_t551" + + def upgrade(self, config, meta_config=None): + # Commands From: rose-meta/lfric-gungho + partitioner = self.get_setting_value( + config, ["namelist:partitioning", "partitioner"] + ) + multigrid_chain_nitems = self.get_setting_value( + config, ["namelist:multigrid", "multigrid_chain_nitems"] + ) + if partitioner == "'planar'": + if multigrid_chain_nitems == "4": + self.add_setting( + config, + ["namelist:multigrid", "chain_mesh_tags"], + "'l0_planar','l1_planar','l2_planar','l3_planar'", + forced=True, + ) + elif multigrid_chain_nitems == "3": + self.add_setting( + config, + ["namelist:multigrid", "chain_mesh_tags"], + "'l0_planar','l1_planar','l2_planar'", + forced=True, + ) + elif multigrid_chain_nitems == "2": + self.add_setting( + config, + ["namelist:multigrid", "chain_mesh_tags"], + "'l0_planar','l1_planar'", + forced=True, + ) + else: + if multigrid_chain_nitems == "4": + self.add_setting( + config, + ["namelist:multigrid", "chain_mesh_tags"], + "'l0_cubedsphere','l1_cubedsphere','l2_cubedsphere','l3_cubedsphere'", + forced=True, + ) + elif multigrid_chain_nitems == "3": + self.add_setting( + config, + ["namelist:multigrid", "chain_mesh_tags"], + "'l0_cubedsphere','l1_cubedsphere','l2_cubedsphere'", + forced=True, + ) + elif multigrid_chain_nitems == "2": + self.add_setting( + config, + ["namelist:multigrid", "chain_mesh_tags"], + "'l0_cubedsphere','l1_cubedsphere'", + forced=True, + ) + partitioner_dest = self.get_setting_value( + config, ["namelist:partitioning(destination)", "partitioner"] + ) + destination_mesh_name = self.get_setting_value( + config, ["namelist:lfric2lfric", "destination_mesh_name"] + ) + if partitioner_dest == "'planar'": + if destination_mesh_name == "'dynamics'": + self.add_setting( + config, + ["namelist:lfric2lfric", "destination_mesh_name"], + "'l0_planar", + forced=True, + ) + elif destination_mesh_name == "'multigrid_l1'": + self.add_setting( + config, + ["namelist:lfric2lfric", "destination_mesh_name"], + "'l1_planar", + forced=True, + ) + elif partitioner_dest == "'cubedsphere'": + if destination_mesh_name == "'dynamics'": + self.add_setting( + config, + ["namelist:lfric2lfric", "destination_mesh_name"], + "'l0_planar", + forced=True, + ) + elif destination_mesh_name == "'multigrid_l1'": + self.add_setting( + config, + ["namelist:lfric2lfric", "destination_mesh_name"], + "'l1_cubedsphere", + forced=True, + ) + partitioner_source = self.get_setting_value( + config, ["namelist:partitioning(source)", "partitioner"] + ) + source_mesh_name = self.get_setting_value( + config, ["namelist:lfric2lfric", "source_mesh_name"] + ) + if partitioner_source == "'planar'": + if source_mesh_name == "'dynamics'": + self.add_setting( + config, + ["namelist:lfric2lfric", "source_mesh_name"], + "'l0_planar", + forced=True, + ) + elif source_mesh_name == "'multigrid_l1'": + self.add_setting( + config, + ["namelist:lfric2lfric", "source_mesh_name"], + "'l1_planar", + forced=True, + ) + elif partitioner_source == "'cubedsphere'": + if source_mesh_name == "'dynamics'": + self.add_setting( + config, + ["namelist:lfric2lfric", "source_mesh_name"], + "'l0_cubedsphere", + forced=True, + ) + elif source_mesh_name == "'multigrid_l1'": + self.add_setting( + config, + ["namelist:lfric2lfric", "source_mesh_name"], + "'l1_cubedsphere", + forced=True, + ) + if source_mesh_name == "'C12'": + self.add_setting( + config, + ["namelist:lfric2lfric", "source_mesh_name"], + "'l1_cubedsphere", + forced=True, + ) + + aerosol_mesh_name = self.get_setting_value( + config, ["namelist:multires_coupling", "aerosol_mesh_name"]) + if aerosol_mesh_name == "'multigrid_l2'": + self.add_setting( + config, + ["namelist:multires_coupling", "aerosol_mesh_name"], + "'l2_cubedsphere", + forced=True, + ) + multires_coupling_mesh_tags = self.get_setting_value( + config, ["namelist:multires_coupling", "multires_coupling_mesh_tags"]) + if multires_coupling_mesh_tags == "'dynamics','multigrid_l2'": + self.add_setting( + config, + ["namelist:multires_coupling", "multires_coupling_mesh_tags"], + "'l0_cubedsphere','l2_cubedsphere'", + forced=True, + ) + orography_mesh_name = self.get_setting_value( + config, ["namelist:multires_coupling", "orography_mesh_name"]) + if orography_mesh_name == "'dynamics'": + self.add_setting( + config, + ["namelist:multires_coupling", "orography_mesh_name"], + "'l0_cubedsphere", + forced=True, + ) + + physics_mesh_name = self.get_setting_value( + config, ["namelist:multires_coupling", "physics_mesh_name"]) + + if physics_mesh_name == "'dynamics'": + self.add_setting( + config, + ["namelist:multires_coupling", "physics_mesh_name"], + "'l0_cubedsphere", + forced=True, + ) + + blpert_mesh_name = self.get_setting_value( + config, ["namelist:stochastic_physics", "blpert_mesh_name"]) + + if blpert_mesh_name == "'multigrid_l3'": + self.add_setting( + config, + ["namelist:stochastic_physics", "blpert_mesh_name"], + "'l3_planar", + forced=True, + ) + + return config, self.reports