From 17b89691ff994f7732caac97527b9b6622fc4343 Mon Sep 17 00:00:00 2001 From: Thomas Melvin Date: Tue, 6 Jan 2026 12:28:26 +0000 Subject: [PATCH 1/7] Merge of files from SRS lfric_apps#1070, except pointing to the relevant core branch --- .../opt/rose-app-suite_controlled.conf | 5 + rose-stem/app/plot/bin/baroclinic.py | 103 +++++++++--------- .../gungho_model/tasks_gungho_model.cylc | 43 +++++++- .../site/meto/groups/groups_gungho_model.cylc | 3 + ...MG-2panel_azspice_gnu_fast-debug-64bit.txt | 3 + ...MG-3panel_azspice_gnu_fast-debug-64bit.txt | 3 + ...ic-C48_MG_azspice_gnu_fast-debug-64bit.txt | 3 + ...linic-C48_MG_ex1a_gnu_fast-debug-64bit.txt | 3 + 8 files changed, 111 insertions(+), 55 deletions(-) create mode 100644 rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-2panel_azspice_gnu_fast-debug-64bit.txt create mode 100644 rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt create mode 100644 rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG_azspice_gnu_fast-debug-64bit.txt create mode 100644 rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-C48_MG_ex1a_gnu_fast-debug-64bit.txt diff --git a/rose-stem/app/gungho_model/opt/rose-app-suite_controlled.conf b/rose-stem/app/gungho_model/opt/rose-app-suite_controlled.conf index c3789d266..81be83085 100644 --- a/rose-stem/app/gungho_model/opt/rose-app-suite_controlled.conf +++ b/rose-stem/app/gungho_model/opt/rose-app-suite_controlled.conf @@ -24,6 +24,11 @@ use_xios_io=${USE_XIOS_IO} [namelist:logging] run_log_level='${LOG_LEVEL}' +[namelist:partitioning] +panel_decomposition='${PANEL_DECOMP}' +panel_xproc=${XPROC} +panel_yproc=${YPROC} + [namelist:time] timestep_end='${RESTART_STOP}' timestep_start='${RESTART_START}' diff --git a/rose-stem/app/plot/bin/baroclinic.py b/rose-stem/app/plot/bin/baroclinic.py index 305454901..56d05a32e 100755 --- a/rose-stem/app/plot/bin/baroclinic.py +++ b/rose-stem/app/plot/bin/baroclinic.py @@ -88,7 +88,7 @@ def make_figures(filein, plotpath, fields, vertical_spacing, formulation): else: combined_fields = [field] - interp_fig = plt.figure(figsize=(20, 10)) + fig1, ax = plt.subplots(figsize=(20, 10)) for cfield in combined_fields: cube = read_ugrid_data(filein, cfield) @@ -166,63 +166,58 @@ def make_figures(filein, plotpath, fields, vertical_spacing, formulation): kappa = rd/1005.0 plot_data[:, :, level] = 0.01*fi**(1.0/kappa) * p0 - nplots = 1 - nxplots = 1 - nyplots = 1 - - for iplot in range(nplots): - ax = interp_fig.add_subplot(nxplots, nyplots, iplot+1) - level = iplot - if (cfield == 'm_v' or cfield == 'm_cl'): - # Plot level 10 for mositure fields - level = 10 - cmap = magma.reversed() - else: - cmap = magma - ys = np.tile(yi, (n_levs, 1)) + if (cfield == 'm_v' or cfield == 'm_cl'): + # Plot level 10 for mositure fields + level = 10 + cmap = magma.reversed() + else: + level = 0 + cmap = magma + ys = np.tile(yi, (n_levs, 1)) - if direction == 'xz': - lon, height = np.meshgrid(xi, zi) - CS = plt.contourf(lon, height, - plot_data[:, plot_lat, :].T, - levels=levels, cmap=cmap) - plt.colorbar(cmap=cmap) - CL = plt.contour(lat, height, - plot_data[:, plot_lat, :].T, - levels=levels, linewidths=0.5, - colors='k') - plt.title(['lat = ', yi[plot_lat]*360./np.real(nx)]) - if direction == 'yz': - lat, height = np.meshgrid(yi, zi) - CS = plt.contourf(lat, height, - plot_data[:, plot_long, :].T, - levels=levels, cmap=cmap) - plt.colorbar(cmap=cmap) - CL = plt.contour(lat, height, - plot_data[:, plot_long, :].T, - levels=levels, linewidths=0.5, - colors='k') - plt.title(['long = ', xi[plot_long]*360./np.real(nx)]) - if direction == 'xy': - lat, lon = np.meshgrid(yi, xi) - if cfield == 'exner' and iplot == 0: - # Extrapolate data to the surface - dz = plot_data[:, :, 0] + (zi_f[0] - zi_h[0]) * \ + if direction == 'xz': + lon, height = np.meshgrid(xi, zi) + CS = ax.contourf(lon, height, + plot_data[:, plot_lat, :].T, + levels=levels, cmap=cmap) + fig1.colorbar(CS, cmap=cmap) + CL = ax.contour(lat, height, + plot_data[:, plot_lat, :].T, + levels=levels, linewidths=0.5, + colors='k') + ax.set_title(['lat = ', yi[plot_lat]*360./np.real(nx)]) + if direction == 'yz': + lat, height = np.meshgrid(yi, zi) + CS = ax.contourf(lat, height, + plot_data[:, plot_long, :].T, + levels=levels, cmap=cmap) + fig1.colorbar(CS, cmap=cmap) + CL = ax.contour(lat, height, + plot_data[:, plot_long, :].T, + levels=levels, linewidths=0.5, + colors='k') + ax.set_title(['long = ', xi[plot_long]*360./np.real(nx)]) + if direction == 'xy': + lat, lon = np.meshgrid(yi, xi) + if cfield == 'exner': + # Extrapolate data to the surface + dz = plot_data[:, :, 0] + (zi_f[0] - zi_h[0]) * \ (plot_data[:, :, 0] - plot_data[:, :, level]) \ / (zi_h[0] - zi_h[1]) - else: - dz = plot_data[:, :, level] - if cfield != 'exner': - CS = plt.contourf(lon, lat, - plot_data[:, :, level].T, - levels=levels, cmap=cmap) - plt.colorbar(cmap=cmap) - if cfield != 'theta': - CL = plt.contour(lon, lat, dz.T, levels=levels, - linewidths=1.0, colors='k') - plt.clabel(CL, CL.levels[1::2], fontsize=15, - inline=1, fmt='%3.1f') + else: + dz = plot_data[:, :, level] + + if cfield != 'exner': + CS = ax.contourf(lon, lat, + plot_data[:, :, level].T, + levels=levels, cmap=cmap) + fig1.colorbar(CS, cmap=cmap) + if cfield != 'theta': + CL = ax.contour(lon, lat, dz.T, levels=levels, + linewidths=1.0, colors='k') + ax.clabel(CL, CL.levels[1::2], fontsize=15, + inline=1, fmt='%3.1f') pngfile = '%s/baroclinic_plot-%s-time%s-%s.png' % \ (plotpath, cfield, time[t], direction) diff --git a/rose-stem/site/common/gungho_model/tasks_gungho_model.cylc b/rose-stem/site/common/gungho_model/tasks_gungho_model.cylc index 17c6843c5..224c9853f 100644 --- a/rose-stem/site/common/gungho_model/tasks_gungho_model.cylc +++ b/rose-stem/site/common/gungho_model/tasks_gungho_model.cylc @@ -34,6 +34,47 @@ "plot_str": "baroclinic.py $NODAL_DATA_DIR/lfric_diag.nc $PLOT_DIR dcmip dry surface_pressure_temperature", }) %} +{% elif task_ns.conf_name == "baroclinic-C48_MG" %} + + {% do task_dict.update({ + "opt_confs": ["baroclinic"], + "resolution": "C48_MG", + "DT": 3600, + "threads": 4, + "mpi_parts": 6, + "tsteps": 240, + "plot_str": "baroclinic.py $NODAL_DATA_DIR/lfric_diag.nc $PLOT_DIR dcmip dry surface_pressure_temperature", + }) %} +{% elif task_ns.conf_name == "baroclinic-C48_MG-3panel" %} + + {% do task_dict.update({ + "opt_confs": ["baroclinic"], + "resolution": "C48_MG", + "DT": 3600, + "threads": 2, + "mpi_parts": 12, + "panel_decomp": "custom", + "xproc": 2, + "yproc": 3, + "tsteps": 240, + "plot_str": "baroclinic.py $NODAL_DATA_DIR/lfric_diag.nc $PLOT_DIR dcmip dry surface_pressure_temperature", + }) %} + +{% elif task_ns.conf_name == "baroclinic-C48_MG-2panel" %} + + {% do task_dict.update({ + "opt_confs": ["baroclinic"], + "resolution": "C48_MG", + "DT": 3600, + "threads": 1, + "mpi_parts": 27, + "panel_decomp": "custom", + "xproc": 3, + "yproc": 3, + "tsteps": 240, + "plot_str": "baroclinic.py $NODAL_DATA_DIR/lfric_diag.nc $PLOT_DIR dcmip dry surface_pressure_temperature", + }) %} + {% elif task_ns.conf_name == "baroclinic-pert-C24_MG" %} {% do task_dict.update({ @@ -589,7 +630,7 @@ {# Set default values for Gungho Model tasks #} {% if task_dict %} - {% do task_dict.update({"application_dir": "lfric_apps/applications/gungho_model"}) %} + {% do task_dict.update({"application_dir": "apps/applications/gungho_model"}) %} {% if "app_name" not in task_dict %} {% do task_dict.update({"app_name": "gungho_model"}) %} {% endif %} diff --git a/rose-stem/site/meto/groups/groups_gungho_model.cylc b/rose-stem/site/meto/groups/groups_gungho_model.cylc index 0605786b9..0704f11ad 100644 --- a/rose-stem/site/meto/groups/groups_gungho_model.cylc +++ b/rose-stem/site/meto/groups/groups_gungho_model.cylc @@ -10,6 +10,9 @@ "gungho_model_azspice_developer": [ "gungho_model_agnesi_hyd_cart-BiP120x8-2000x2000_azspice_gnu_fast-debug-64bit", "gungho_model_baroclinic-C24_MG_azspice_gnu_fast-debug-64bit", + "gungho_model_baroclinic-C48_MG_azspice_gnu_fast-debug-64bit", + "gungho_model_baroclinic-C48_MG-2panel_azspice_gnu_fast-debug-64bit", + "gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit", "gungho_model_baroclinic-pert-C24_MG_azspice_gnu_fast-debug-64bit", "gungho_model_baroclinic-alt1-C24s_MG_azspice_gnu_fast-debug-64bit", "gungho_model_baroclinic-alt2-C24_MG_op_azspice_gnu_fast-debug-64bit", diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-2panel_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-2panel_azspice_gnu_fast-debug-64bit.txt new file mode 100644 index 000000000..fff7d09e8 --- /dev/null +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-2panel_azspice_gnu_fast-debug-64bit.txt @@ -0,0 +1,3 @@ +Inner product checksum rho = 4102EEF5FAAB93B4 +Inner product checksum theta = 423041DD82556056 +Inner product checksum u = 45017CE3BDE63034 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt new file mode 100644 index 000000000..060f81ae0 --- /dev/null +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt @@ -0,0 +1,3 @@ +Inner product checksum rho = 4102EEF5FAAB93B5 +Inner product checksum theta = 423041DD82556059 +Inner product checksum u = 45017CE3BDE63032 diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG_azspice_gnu_fast-debug-64bit.txt new file mode 100644 index 000000000..542074238 --- /dev/null +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG_azspice_gnu_fast-debug-64bit.txt @@ -0,0 +1,3 @@ +Inner product checksum rho = 4102EEF5FAAB93BA +Inner product checksum theta = 423041DD82556055 +Inner product checksum u = 45017CE3BDE63033 diff --git a/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-C48_MG_ex1a_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-C48_MG_ex1a_gnu_fast-debug-64bit.txt new file mode 100644 index 000000000..df436b1fe --- /dev/null +++ b/rose-stem/site/meto/kgos/gungho_model/ex1a/checksum_gungho_model_baroclinic-C48_MG_ex1a_gnu_fast-debug-64bit.txt @@ -0,0 +1,3 @@ +Inner product checksum rho = 4102EEF5FAB7BD35 +Inner product checksum theta = 423041DD82538AE9 +Inner product checksum u = 45017CE3BDC64744 From bf3af45fbf4261d73dbdbd1a16570874f4a2efdc Mon Sep 17 00:00:00 2001 From: thomasmelvin Date: Tue, 6 Jan 2026 15:13:16 +0000 Subject: [PATCH 2/7] Remove accidental mod of trunk code --- dependencies.yaml | 4 ++-- rose-stem/site/common/gungho_model/tasks_gungho_model.cylc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dependencies.yaml b/dependencies.yaml index caab36487..d1790884b 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -30,8 +30,8 @@ lfric_apps: ref: lfric_core: - source: git@github.com:MetOffice/lfric_core.git - ref: 2025.12.1 + source: git@github.com:thomasmelvin/lfric_core.git + ref: decompose_across_panels moci: source: git@github.com:MetOffice/moci.git diff --git a/rose-stem/site/common/gungho_model/tasks_gungho_model.cylc b/rose-stem/site/common/gungho_model/tasks_gungho_model.cylc index 224c9853f..b446910a0 100644 --- a/rose-stem/site/common/gungho_model/tasks_gungho_model.cylc +++ b/rose-stem/site/common/gungho_model/tasks_gungho_model.cylc @@ -630,7 +630,7 @@ {# Set default values for Gungho Model tasks #} {% if task_dict %} - {% do task_dict.update({"application_dir": "apps/applications/gungho_model"}) %} + {% do task_dict.update({"application_dir": "lfric_apps/applications/gungho_model"}) %} {% if "app_name" not in task_dict %} {% do task_dict.update({"app_name": "gungho_model"}) %} {% endif %} From 01e4f9c60d535e2eba33d077f668f571aaba778e Mon Sep 17 00:00:00 2001 From: thomasmelvin Date: Wed, 7 Jan 2026 10:20:49 +0000 Subject: [PATCH 3/7] Add in fix to local_build from #43 --- build/local_build.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/build/local_build.py b/build/local_build.py index 2c9d445e4..988efe3e6 100755 --- a/build/local_build.py +++ b/build/local_build.py @@ -17,6 +17,8 @@ import subprocess import argparse import yaml +from pathlib import Path +import shutil def subprocess_run(command): @@ -82,14 +84,11 @@ def determine_project_path(project, root_dir): ) -def clone_dependency(values, temp_dep): +def clone_dependency(source, ref, temp_dep): """ Clone the physics dependencies into a temporary directory """ - source = values["source"] - ref = values["ref"] - commands = ( f"git -C {temp_dep} init", f"git -C {temp_dep} remote add origin {source}", @@ -110,7 +109,10 @@ def get_lfric_core(core_source, working_dir): if core_source["source"].endswith(".git"): print("Cloning LFRic Core from Github") - lfric_core_loc = f"{working_dir}/scratch/core" + lfric_core_loc = Path(working_dir) / "scratch" / "core" + if lfric_core_loc.exists(): + shutil.rmtree(lfric_core_loc) + lfric_core_loc.mkdir(parents=True) clone_dependency(core_source["source"], core_source["ref"], lfric_core_loc) print("rsyncing the exported lfric_core source") else: From 618ee6753bfb196756d390a991f0d30e5b1361b9 Mon Sep 17 00:00:00 2001 From: thomasmelvin Date: Fri, 9 Jan 2026 09:37:56 +0000 Subject: [PATCH 4/7] Update to KGO --- ...aroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt index 060f81ae0..8e21a9491 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 4102EEF5FAAB93B5 -Inner product checksum theta = 423041DD82556059 -Inner product checksum u = 45017CE3BDE63032 +Inner product checksum rho = 4102EEF5FAE02CC6 +Inner product checksum theta = 423041DD824DCC27 +Inner product checksum u = 45017CE3C0A8EA58 From 306e1d1968a8fd01c9fba0e79833edbdc1da985b Mon Sep 17 00:00:00 2001 From: thomasmelvin Date: Wed, 14 Jan 2026 10:52:45 +0000 Subject: [PATCH 5/7] Update to incorrect KGO --- ...aroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt index 8e21a9491..060f81ae0 100644 --- a/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt +++ b/rose-stem/site/meto/kgos/gungho_model/azspice/checksum_gungho_model_baroclinic-C48_MG-3panel_azspice_gnu_fast-debug-64bit.txt @@ -1,3 +1,3 @@ -Inner product checksum rho = 4102EEF5FAE02CC6 -Inner product checksum theta = 423041DD824DCC27 -Inner product checksum u = 45017CE3C0A8EA58 +Inner product checksum rho = 4102EEF5FAAB93B5 +Inner product checksum theta = 423041DD82556059 +Inner product checksum u = 45017CE3BDE63032 From f577b0c9fdcc5efaff26c6c856269752df0ccfea Mon Sep 17 00:00:00 2001 From: thomasmelvin Date: Thu, 15 Jan 2026 09:56:06 +0000 Subject: [PATCH 6/7] Update contributers list --- CONTRIBUTORS.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index d0f7ae14d..709e5f35f 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -4,3 +4,4 @@ | ----------- | --------- | ----------- | ---- | | james-bruten-mo | James Bruten | Met Office | 2025-12-09 | | jennyhickson | Jenny Hickson | Met Office | 2025-12-10 | +| thomasmelvin | Thomas Melvin | Met Office | 2026-01-15 | From c9c065ea9d65c565635c811072051bccf2139b55 Mon Sep 17 00:00:00 2001 From: thomasmelvin Date: Fri, 16 Jan 2026 15:52:12 +0000 Subject: [PATCH 7/7] Update local_build.py --- build/local_build.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/build/local_build.py b/build/local_build.py index 988efe3e6..2c9d445e4 100755 --- a/build/local_build.py +++ b/build/local_build.py @@ -17,8 +17,6 @@ import subprocess import argparse import yaml -from pathlib import Path -import shutil def subprocess_run(command): @@ -84,11 +82,14 @@ def determine_project_path(project, root_dir): ) -def clone_dependency(source, ref, temp_dep): +def clone_dependency(values, temp_dep): """ Clone the physics dependencies into a temporary directory """ + source = values["source"] + ref = values["ref"] + commands = ( f"git -C {temp_dep} init", f"git -C {temp_dep} remote add origin {source}", @@ -109,10 +110,7 @@ def get_lfric_core(core_source, working_dir): if core_source["source"].endswith(".git"): print("Cloning LFRic Core from Github") - lfric_core_loc = Path(working_dir) / "scratch" / "core" - if lfric_core_loc.exists(): - shutil.rmtree(lfric_core_loc) - lfric_core_loc.mkdir(parents=True) + lfric_core_loc = f"{working_dir}/scratch/core" clone_dependency(core_source["source"], core_source["ref"], lfric_core_loc) print("rsyncing the exported lfric_core source") else: