From eb5d8b219852e37f8857ab78d560153e094d63da Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Tue, 26 May 2026 11:48:07 +0100 Subject: [PATCH 01/10] Update and test fparser --- .github/workflows/python-package.yml | 4 ++-- external/fparser | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index bc4c65ab2a..36f6f969b1 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -102,10 +102,10 @@ jobs: python -m pip install --upgrade pip # Some of the examples use Jupyter. pip install jupyter - # We need to install sphinx to get correct doc testing # Uncomment the below to use the submodule version of fparser rather # than the latest release from pypi. - # pip install external/fparser + pip install external/fparser + # We need to install sphinx to get correct doc testing pip install .[doc] pip install .[test,treesitter] - name: Lint with flake8 diff --git a/external/fparser b/external/fparser index d93d18de65..869c01ca4c 160000 --- a/external/fparser +++ b/external/fparser @@ -1 +1 @@ -Subproject commit d93d18de6526a09b5bb301d55d3ba6f52a55e6b9 +Subproject commit 869c01ca4c19c1e1466b54506d5a26bc21c13494 From 840f1799586b0ef77a1e86a75091e13c58977970 Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Wed, 27 May 2026 10:19:28 +0100 Subject: [PATCH 02/10] Update fparser --- external/fparser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/fparser b/external/fparser index 869c01ca4c..4e3df505f4 160000 --- a/external/fparser +++ b/external/fparser @@ -1 +1 @@ -Subproject commit 869c01ca4c19c1e1466b54506d5a26bc21c13494 +Subproject commit 4e3df505f4aee340a1f9e3be98b60344bb1c1f0b From d87d8bc3b219757f05d017dd99c276beaf29e660 Mon Sep 17 00:00:00 2001 From: LonelyCat124 <3043914+LonelyCat124@users.noreply.github.com.> Date: Fri, 29 May 2026 15:01:52 +0100 Subject: [PATCH 03/10] Update faprser to the 505 fix --- external/fparser | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/external/fparser b/external/fparser index 4e3df505f4..ab843b5456 160000 --- a/external/fparser +++ b/external/fparser @@ -1 +1 @@ -Subproject commit 4e3df505f4aee340a1f9e3be98b60344bb1c1f0b +Subproject commit ab843b54560ae649ef179148ee9d747f866d4f9e From 2d6effbc27617a02e5139c9bb3a76a8c67509952 Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Tue, 9 Jun 2026 10:01:36 +0100 Subject: [PATCH 04/10] Update fparser and fix invalid Fortran --- external/fparser | 2 +- src/psyclone/tests/psyad/domain/lfric/test_lfric_adjoint.py | 4 ++-- .../tests/psyir/frontend/fparser2_where_handler_test.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/external/fparser b/external/fparser index ab843b5456..267eb9031c 160000 --- a/external/fparser +++ b/external/fparser @@ -1 +1 @@ -Subproject commit ab843b54560ae649ef179148ee9d747f866d4f9e +Subproject commit 267eb9031c3d96c189db8da6d1b8304c584ded48 diff --git a/src/psyclone/tests/psyad/domain/lfric/test_lfric_adjoint.py b/src/psyclone/tests/psyad/domain/lfric/test_lfric_adjoint.py index 89b4ddf0cd..dc19ac3079 100644 --- a/src/psyclone/tests/psyad/domain/lfric/test_lfric_adjoint.py +++ b/src/psyclone/tests/psyad/domain/lfric/test_lfric_adjoint.py @@ -123,9 +123,9 @@ def test_generate_lfric_adjoint_no_routines_error(fortran_reader): MULTI_ROUTINE_CODE = ( f"module test_mod\n" - f" implicit none\n" f" use kernel_mod\n" f" use argument_mod\n" + f" implicit none\n" f"{METADATA}" f" public test_code\n" f" interface test_code\n" @@ -187,9 +187,9 @@ def test_generate_lfric_adjoint_multi_routine_logging(fortran_reader, caplog): SINGLE_ROUTINE_CODE = ( "module test_mod\n" - " implicit none\n" " use kernel_mod\n" " use argument_mod\n" + " implicit none\n" " type, extends(kernel_type) :: test_type\n" " type(arg_type), dimension(2) :: meta_args = (/ &\n" " arg_type(gh_field, gh_real, gh_inc, w0), &\n" diff --git a/src/psyclone/tests/psyir/frontend/fparser2_where_handler_test.py b/src/psyclone/tests/psyir/frontend/fparser2_where_handler_test.py index 9483fa4e17..6011df9f55 100644 --- a/src/psyclone/tests/psyir/frontend/fparser2_where_handler_test.py +++ b/src/psyclone/tests/psyir/frontend/fparser2_where_handler_test.py @@ -914,8 +914,8 @@ def test_import_in_where_clause(fortran_reader): ''' code = ''' program where_test - implicit none use some_module, only: a, b, c, d + implicit none where(a(:) + b > 1) b = c + d @@ -927,8 +927,8 @@ def test_import_in_where_clause(fortran_reader): code2 = ''' program where_test - implicit none use some_module, only: c, d + implicit none integer, dimension(100) :: a, b where(a(:) + b > 1) From f64fd1be256bb37dd4757bd9d58f9464eade6421 Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Thu, 11 Jun 2026 14:45:14 +0100 Subject: [PATCH 05/10] Update to fparser 0.2.3 --- external/fparser | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/external/fparser b/external/fparser index 267eb9031c..beffc28924 160000 --- a/external/fparser +++ b/external/fparser @@ -1 +1 @@ -Subproject commit 267eb9031c3d96c189db8da6d1b8304c584ded48 +Subproject commit beffc28924d558ce87660eb8e54e3e9e2e3c081a diff --git a/pyproject.toml b/pyproject.toml index 7d2ee07ede..15f9cf3a12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,7 +66,7 @@ classifiers = [ ] dependencies = [ "pyparsing", - "fparser==0.2.2", + "fparser==0.2.3", "configparser", "sympy", "Jinja2", From e4597f8263ada56dbd2d2a9e980165af91adc4db Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Fri, 12 Jun 2026 15:36:50 +0100 Subject: [PATCH 06/10] Set failing test as free_form --- src/psyclone/tests/psyir/nodes/codeblock_test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/psyclone/tests/psyir/nodes/codeblock_test.py b/src/psyclone/tests/psyir/nodes/codeblock_test.py index 39fb4640aa..30eb62f643 100644 --- a/src/psyclone/tests/psyir/nodes/codeblock_test.py +++ b/src/psyclone/tests/psyir/nodes/codeblock_test.py @@ -186,11 +186,11 @@ def test_codeblock_get_fortran_lines(): frontends) ''' code = "\nsubroutine mytest\nend subroutine" - tree = Fparser2Reader().generate_parse_tree_from_source(code) + tree = Fparser2Reader(free_form=True).generate_parse_tree_from_source(code) block = Fparser2CodeBlock(tree.children, CodeBlock.Structure.STATEMENT) assert isinstance(block.get_fortran_lines(), list) - assert "subroutine mytest" in block.get_fortran_lines() - assert "end subroutine" in block.get_fortran_lines() + assert "SUBROUTINE mytest" in block.get_fortran_lines() + assert "END SUBROUTINE" in block.get_fortran_lines() tree = FortranTreeSitterReader().generate_parse_tree_from_source(code) block = TreeSitterCodeBlock(tree, CodeBlock.Structure.STATEMENT) From 39d49e8a106915e71cf414d46b4ece8f2d48ae54 Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Fri, 19 Jun 2026 11:43:27 +0100 Subject: [PATCH 07/10] Test with a new fparser --- external/fparser | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/external/fparser b/external/fparser index beffc28924..fd6da0db04 160000 --- a/external/fparser +++ b/external/fparser @@ -1 +1 @@ -Subproject commit beffc28924d558ce87660eb8e54e3e9e2e3c081a +Subproject commit fd6da0db0481f2813728cdf7541b62ed84211d89 diff --git a/pyproject.toml b/pyproject.toml index 15f9cf3a12..70930bc389 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,7 +66,7 @@ classifiers = [ ] dependencies = [ "pyparsing", - "fparser==0.2.3", + # "fparser==0.2.3", "configparser", "sympy", "Jinja2", From 6df8f276a882b05c01369e97ccaeea5d3c112147 Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Fri, 19 Jun 2026 12:29:27 +0100 Subject: [PATCH 08/10] Update documentation and extraction tests to use submodule fparser and stfc's lfric_apps --- .github/workflows/extraction_test.yml | 13 ++++--------- .github/workflows/python-package.yml | 6 +++++- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/extraction_test.yml b/.github/workflows/extraction_test.yml index 25f0b9e77c..9f410c705e 100644 --- a/.github/workflows/extraction_test.yml +++ b/.github/workflows/extraction_test.yml @@ -48,8 +48,7 @@ jobs: if: ${{ github.repository == 'stfc/PSyclone-mirror' }} runs-on: self-hosted env: - LFRIC_APPS_REV: 7536 - LFRIC_CORE_REV: 52054 + LFRIC_APPS_HASH: 299d4f786dd2d86a59a184c3e53384005a69eded PYTHON_VERSION: "3.13" steps: @@ -106,13 +105,9 @@ jobs: rm -rf lfric_extraction mkdir lfric_extraction cd lfric_extraction - fcm co --username ${{ secrets.UKMO_USER }} --password '${{ secrets.UKMO_PASSW }}' \ - -r ${LFRIC_APPS_REV} https://code.metoffice.gov.uk/svn/lfric_apps/main/trunk/ lfric_apps - fcm co --username ${{ secrets.UKMO_USER }} --password '${{ secrets.UKMO_PASSW }}' \ - -r ${LFRIC_CORE_REV} https://code.metoffice.gov.uk/svn/lfric/LFRic/trunk/ lfric_core - sed -i "s|lfric_core_rev=$LFRIC_CORE_REV|lfric_core_rev=|g" lfric_apps/dependencies.sh - sed -i "s|lfric_core_sources=|lfric_core_sources=$PWD/lfric_core|g" lfric_apps/dependencies.sh - sed -i "s|use_xios_io=.true.|use_xios_io=.false.|g" lfric_apps/applications/gungho_model/example/configuration.nml + git clone https://github.com/stfc/lfric_apps + cd lfric_apps + git checkout ${LFRIC_APPS_HASH} # Compile GungHo with extraction diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 36f6f969b1..25f25a64a6 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -68,7 +68,11 @@ jobs: python-version: '3.14' - run: sudo apt-get install -y graphviz doxygen - run: python -m pip install --upgrade pip - - run: pip install .[doc] + - run: | + # Uncomment the below to use the submodule version of fparser rather + # than the latest release from pypi. + pip install external/fparser + pip install .[doc] # Now we can check for warnings and broken links - run: cd doc; make html SPHINXOPTS="-W --keep-going" - run: cd doc; make linkcheck From cda546e1f6c5b6df1458e443647c45bd63794549 Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Fri, 19 Jun 2026 13:05:29 +0100 Subject: [PATCH 09/10] User recursive submodules and skip-ci in the build-documentation test --- .github/workflows/python-package.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 25f25a64a6..fa207b6d77 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -63,6 +63,17 @@ jobs: GITHUB_PR_NUMBER: ${{ github.event.number }} steps: - uses: actions/checkout@v4 + with: + submodules: recursive + # This is required to get the commit history for merge commits for + # the ci-skip check below. + fetch-depth: '0' + - name: Check for [skip ci] in commit message + uses: mstachniuk/ci-skip@v1 + with: + # This setting causes the tests to 'fail' if [skip ci] is specified + fail-fast: true + commit-filter: '[skip ci]' - uses: actions/setup-python@v5 with: python-version: '3.14' From dd0d59512115ebbd295929849c7fe9845ea8f4d2 Mon Sep 17 00:00:00 2001 From: Sergi Siso Date: Fri, 19 Jun 2026 14:28:58 +0100 Subject: [PATCH 10/10] Revert lfric extraction test --- .github/workflows/extraction_test.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/extraction_test.yml b/.github/workflows/extraction_test.yml index 9f410c705e..25f0b9e77c 100644 --- a/.github/workflows/extraction_test.yml +++ b/.github/workflows/extraction_test.yml @@ -48,7 +48,8 @@ jobs: if: ${{ github.repository == 'stfc/PSyclone-mirror' }} runs-on: self-hosted env: - LFRIC_APPS_HASH: 299d4f786dd2d86a59a184c3e53384005a69eded + LFRIC_APPS_REV: 7536 + LFRIC_CORE_REV: 52054 PYTHON_VERSION: "3.13" steps: @@ -105,9 +106,13 @@ jobs: rm -rf lfric_extraction mkdir lfric_extraction cd lfric_extraction - git clone https://github.com/stfc/lfric_apps - cd lfric_apps - git checkout ${LFRIC_APPS_HASH} + fcm co --username ${{ secrets.UKMO_USER }} --password '${{ secrets.UKMO_PASSW }}' \ + -r ${LFRIC_APPS_REV} https://code.metoffice.gov.uk/svn/lfric_apps/main/trunk/ lfric_apps + fcm co --username ${{ secrets.UKMO_USER }} --password '${{ secrets.UKMO_PASSW }}' \ + -r ${LFRIC_CORE_REV} https://code.metoffice.gov.uk/svn/lfric/LFRic/trunk/ lfric_core + sed -i "s|lfric_core_rev=$LFRIC_CORE_REV|lfric_core_rev=|g" lfric_apps/dependencies.sh + sed -i "s|lfric_core_sources=|lfric_core_sources=$PWD/lfric_core|g" lfric_apps/dependencies.sh + sed -i "s|use_xios_io=.true.|use_xios_io=.false.|g" lfric_apps/applications/gungho_model/example/configuration.nml # Compile GungHo with extraction