Skip to content

Updates needed to support psyclone 3.3#545

Open
Sergi Siso (sergisiso) wants to merge 2 commits into
MetOffice:mainfrom
stfc:psyclone_3.3
Open

Updates needed to support psyclone 3.3#545
Sergi Siso (sergisiso) wants to merge 2 commits into
MetOffice:mainfrom
stfc:psyclone_3.3

Conversation

@sergisiso

@sergisiso Sergi Siso (sergisiso) commented Jun 9, 2026

Copy link
Copy Markdown

PR Summary

Sci/Tech Reviewer:
Code Reviewer:

These are the changes necessary to use the next release of psyclone.

To work this needs:

Andrew Coughtrie (@andrewcoughtrie) This is not ready to be merged until the above points are ready, but would it be possible to test this with rose-stem and your new environment to find if we need to fix something in psyclone before we do the release? (Note that it will only work with psyclone master, not the last psyclone release candidate)

Code Quality Checklist

  • I have performed a self-review of my own code
  • My code follows the project's style guidelines
  • Comments have been included that aid understanding and enhance the readability of the code
  • My changes generate no new warnings
  • All automated checks in the CI pipeline have completed successfully

Testing

  • I have tested this change locally, using the LFRic Apps rose-stem suite
  • If any tests fail (rose-stem or CI) the reason is understood and acceptable (e.g. kgo changes)
  • I have added tests to cover new functionality as appropriate (e.g. system tests, unit tests, etc.)
  • Any new tests have been assigned an appropriate amount of compute resource and have been allocated to an appropriate testing group (i.e. the developer tests are for jobs which use a small amount of compute resource and complete in a matter of minutes)

trac.log

Security Considerations

  • I have reviewed my changes for potential security issues
  • Sensitive data is properly handled (if applicable)
  • Authentication and authorisation are properly implemented (if applicable)

Performance Impact

  • Performance of the code has been considered and, if applicable, suitable performance measurements have been conducted

AI Assistance and Attribution

  • Some of the content of this change has been produced with the assistance of Generative AI tool name (e.g., Met Office Github Copilot Enterprise, Github Copilot Personal, ChatGPT GPT-4, etc) and I have followed the Simulation Systems AI policy (including attribution labels)

Documentation

  • Where appropriate I have updated documentation related to this change and confirmed that it builds correctly

PSyclone Approval

  • If you have edited any PSyclone-related code (e.g. PSyKAl-lite, Kernel interface, optimisation scripts, LFRic data structure code) then please contact the TCD Team

Sci/Tech Review

  • I understand this area of code and the changes being added
  • The proposed changes correspond to the pull request description
  • Documentation is sufficient (do documentation papers need updating)
  • Sufficient testing has been completed

(Please alert the code reviewer via a tag when you have approved the SR)

Code Review

  • All dependencies have been resolved
  • Related Issues have been properly linked and addressed
  • CLA compliance has been confirmed
  • Code quality standards have been met
  • Tests are adequate and have passed
  • Documentation is complete and accurate
  • Security considerations have been addressed
  • Performance impact is acceptable

Sergi Siso (sergisiso) and others added 2 commits June 9, 2026 09:40
Co-authored-by: Andrew Porter <andrew.porter@stfc.ac.uk>
Co-authored-by: Aidan Chalk <3043914+LonelyCat124@users.noreply.github.com>
Co-authored-by: Andrew Porter <andrew.porter@stfc.ac.uk>
Co-authored-by: Aidan Chalk <3043914+LonelyCat124@users.noreply.github.com>
Signed-off-by: Sergi Siso <sergiesg@gmail.com>
@TeranIvy

Iva Kavcic (TeranIvy) commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Testing with PSyclone master on Azure Spice

Changes made to test PSyclone master

diff --git a/dependencies.yaml b/dependencies.yaml
index e314999e..6dfadfbb 100644
--- a/dependencies.yaml
+++ b/dependencies.yaml
@@ -30,8 +30,10 @@ lfric_apps:
     ref:
 
 lfric_core:
-    source: git@github.com:MetOffice/lfric_core.git
-    ref: 70405b50bda5a86c8711a2cceae0ea69dd04c2bc
+#    source: git@github.com:MetOffice/lfric_core.git
+#    ref: 70405b50bda5a86c8711a2cceae0ea69dd04c2bc
+    source: git@github.com:stfc/lfric_core.git
+    ref: psyclone_next
 
 moci:
     source: git@github.com:MetOffice/moci.git
diff --git a/rose-stem/site/meto/common/suite_config_azspice.cylc b/rose-stem/site/meto/common/suite_config_azspice.cylc
index 07e72b22..fa304364 100644
--- a/rose-stem/site/meto/common/suite_config_azspice.cylc
+++ b/rose-stem/site/meto/common/suite_config_azspice.cylc
@@ -7,18 +7,23 @@
 
 {% set azspice_base = 'umask 0022 ; '~
                       'module purge ; '~
-                      'module use /home/users/lfricadmin/lmod ; ' %}
+                      'module use /home/users/lfricadmin/lmod ; '~
+                      'module use /home/users/lfricadmin/test_modules ; ' %}
 
-{% set azspice_compiler_gnu = 'module load lfric/vn3.1' %}
+{#% set azspice_compiler_gnu = 'module load lfric/vn3.1' %#}
+{% set azspice_compiler_gnu = 'module load lfric/vn3.2-rc1 ; '~
+                              'module load py-psyclone/master' %}
 
-{% set azspice_coupled_gnu = 'module load xios/2701-oasis ; '~
+{% set azspice_coupled_gnu = 'module load xios/2.2701-oasis ; '~
                              'module load oasis' %}
 
 {% set azspice_run = 'ulimit -s unlimited' %}
 
 {% set azspice_scitools = 'module load scitools/production-os47-1' %}
 
-{% set azspice_tech = 'module load lfric/vn3.1' %}
+{#% set azspice_tech = 'module load lfric/vn3.1' %#}
+{% set azspice_tech = 'module load lfric/vn3.2-rc1 ; '~
+                      'module load py-psyclone/master' %}
 
     [[AZSPICE_BASE]]
         platform = spice

I would recommend making these changes to facilitate testing until the full lfric/vn3.2 environment with PSyclone 3.3 is built. To adopt lfric/vn3.2, the relevant changes in rose-stem/site/meto/common/suite_config_azspice.cylc would be:

-{% set azspice_compiler_gnu = 'module load lfric/vn3.1' %}
+{% set azspice_compiler_gnu = 'module load lfric/vn3.2' %}
 
-{% set azspice_tech = 'module load lfric/vn3.1' %}
+{% set azspice_tech = 'module load lfric/vn3.2' %}
 
-{% set azspice_coupled_gnu = 'ml xios/2701-oasis ; '~
+{% set azspice_coupled_gnu = 'ml xios/2.2701-oasis ; '~
                                   'ml oasis/3-mct5.0' %}

Note that xios/2701-oasis changes to xios/2.2701-oasis to differentiate between XIOS2 r2701 used in LFRic, and an XIOS3 build with Oasis available in test modules.

Testing outcome

Checked out the stfc:psyclone_3.3 fork as test_545_apps. There are 15 test failures (internal Cylc page) in the Azure Spice tests (cylc vip -z group=azspice -n test_545_apps ./rose-stem).

10 of them fail due to current lack of Shumlib in the 3.2 release candidate modules, so I am not particularly worried about them.

build_lfric_atm_azspice_gnu_production-32bit
build_lfric_atm_azspice_gnu_fast-debug-64bit
build_lfric_atm_azspice_gnu_full-debug-32bit
build_lfric_atm_azspice_gnu_fast-debug-32bit
build_lfricinputs_um2lfric_azspice_gnu_full-debug-64bit
build_lfricinputs_scintelapi_azspice_gnu_fast-debug-64bit
build_lfricinputs_scintelapi_azspice_gnu_full-debug-64bit
build_lfricinputs_lfric2um_azspice_gnu_full-debug-64bit
build_lfricinputs_lfric2um_azspice_gnu_fast-debug-64bit
build_lfricinputs_um2lfric_azspice_gnu_fast-debug-64bit

The other 5 are in adjoint and JEDI-LFRic tests:

build_jedi_lfric_tests_azspice_gnu_fast-debug-64bit
build_adjoint_tests_azspice_gnu_fast-debug-64bit-rsolver64
build_jedi_lfric_tests_azspice_gnu_full-debug-64bit
build_jedi_lfric_tests_azspice_gnu_fast-debug-64bit-rsolver64
build_adjoint_tests_azspice_gnu_full-debug-64bit-rsolver64

From the error reports, they seem to be related to changes in adjoint kernels and patches that are applied to kernels that PSyAD generates. See e.g. error for build_jedi_lfric_tests_azspice_gnu_fast-debug-64bit:

make[2]: *** [~/cylc-run/test_545_apps/run2/share/source/lfric_apps/science/adjoint/build/post_patch.mk:126: /var/tmp/test_545_apps/run2/jedi_lfric_tests/gnu_fast-debug-64bit/jedi_lfric_tests/kernel/transport/mol/atl_poly1d_vert_adv_kernel_mod.F90] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [~/cylc-run/test_545_apps/run2/share/source/lfric_apps/science/adjoint/build/import.mk:17: import-adjoint] Error 2
make: *** [Makefile:123: build] Error 2

A DA person familiar with these kernels would be helpful here. For command-line testing of what PSyAD on PSyclone master generates, use

module use /home/users/lfricadmin/test_modules
module load lfric/vn3.2-rc1
module load py-psyclone/master

P.S. I checked the "PSyclone Approval" tick box as a TCD Team representative.

@ss421 Steven Sandbach (ss421) requested a review from a team June 12, 2026 13:55
@ss421

Copy link
Copy Markdown
Contributor

We will need to apply an update in the DA/JEDI build to include the new version of PSyClone. Please coordinate this change with Matt Shin (@matthewrmshin) @MetOffice/r2o-systems.

@ss421 Steven Sandbach (ss421) added the Linked Jedi This PR is linked to a Jedi PR - this will be managed by the DA team label Jun 12, 2026
@DrTVockerodtMO

Copy link
Copy Markdown
Contributor

I believe I have now successfully generated the adjoint patches needed, just awaiting further testing.

@TeranIvy

Copy link
Copy Markdown
Contributor

I believe I have now successfully generated the adjoint patches needed, just awaiting further testing.

Thanks for sending over the patch upgrades, DrTVockerodtMO! They are attached PSy3.3PatchUpgrades.zip.

Sergi Siso (@sergisiso), the locations of modified patches are below.

science/adjoint/patches/kernel/adj_w3v_advective_update_kernel_mod.patch
science/adjoint/patches/kernel/atl_poly1d_vert_adv_kernel_mod.patch
science/adjoint/patches/algorithm/atlt_kinetic_energy_gradient_alg_mod.patch
science/adjoint/patches/algorithm/atlt_project_eos_pressure_alg_mod.patch
science/adjoint/patches/algorithm/atlt_rhs_project_eos_alg_mod.patch
science/adjoint/patches/algorithm/atlt_vorticity_advection_alg_mod.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The CLA has been signed as part of this PR - added by GA Linked Jedi This PR is linked to a Jedi PR - this will be managed by the DA team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants