Skip to content

Commit 99d8d2b

Browse files
Add support for psyclone 3.3, nvfortran and amdflang (#338)
Co-authored-by: James Bruten <109733895+james-bruten-mo@users.noreply.github.com>
1 parent 5d6b2db commit 99d8d2b

18 files changed

Lines changed: 103 additions & 39 deletions

File tree

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
| mo-lucy-gordon | Lucy Gordon | Met Office | 2026-03-18 |
2727
| shreybh1 | Shrey Bhardwaj | Met Office | 2026-03-26 |
2828
| hiker | Joerg Henrichs | Bureau of Meteorology | 2026-02-11 |
29+
| sergisiso | Sergi Siso | UKRI-STFC | 2026-04-20 |
2930
| mattatmet | Matthew Walker | Met Office | 2026-04-21 |
3031
| timgraham-Met | Tim Graham | Met Office | 2026-05-20 |
3132
| tinyendian | Wolfgang Hayek | Earth Sciences New Zealand | 2026-05-04 |

applications/coupled/documentation/mainpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ operations which can be specified within an invoke call in the algorithm layer b
2626
directly by the infrastructure.
2727

2828
For more up-to-date information about the <b>LFRic-specific Built-ins</b> functionality (e.g. names, argument order) please refer to the
29-
<a href="https://github.com/stfc/PSyclone/blob/master/doc/dynamo0p3.rst#built-ins">dynamo 0.3 API Built-ins documentation</a>.
29+
<a href="https://github.com/stfc/PSyclone/blob/master/doc/user_guide/lfric.rst#built-ins">dynamo 0.3 API Built-ins documentation</a>.
3030

3131

applications/simple_diffusion/documentation/mainpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ operations which can be specified within an invoke call in the algorithm layer b
2626
directly by the infrastructure.
2727

2828
For more up-to-date information about the <b>LFRic-specific Built-ins</b> functionality (e.g. names, argument order) please refer to the
29-
<a href="https://github.com/stfc/PSyclone/blob/master/doc/dynamo0p3.rst#built-ins">dynamo 0.3 API Built-ins documentation</a>.
29+
<a href="https://github.com/stfc/PSyclone/blob/master/doc/user_guide/lfric.rst#built-ins">dynamo 0.3 API Built-ins documentation</a>.
3030

3131

applications/skeleton/documentation/mainpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@ operations which can be specified within an invoke call in the algorithm layer b
2626
directly by the infrastructure.
2727

2828
For more up-to-date information about the <b>LFRic-specific Built-ins</b> functionality (e.g. names, argument order) please refer to the
29-
<a href="https://github.com/stfc/PSyclone/blob/master/doc/dynamo0p3.rst#built-ins">dynamo 0.3 API Built-ins documentation</a>.
29+
<a href="https://github.com/stfc/PSyclone/blob/master/doc/user_guide/lfric.rst#built-ins">dynamo 0.3 API Built-ins documentation</a>.
3030

3131

components/driver/source/mesh/runtime_partition_lfric_mod.f90

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,35 @@ subroutine get_partition_parameters( partitioning_nml, &
6363
panel_xproc = partitioning_nml%panel_xproc()
6464
panel_yproc = partitioning_nml%panel_yproc()
6565

66+
! nvfortran does not properly support the polymorphic allocation, to fix it
67+
! deallocate the polymorphic class and allocate each concrete type inside
68+
! the select cases
69+
if (allocated(decomposition)) deallocate(decomposition)
70+
6671
select case (panel_decomposition)
6772

6873
case ( panel_decomposition_auto )
74+
allocate(auto_decomposition_type :: decomposition)
6975
decomposition = auto_decomposition_type()
7076

7177
case ( panel_decomposition_row )
78+
allocate(row_decomposition_type :: decomposition)
7279
decomposition = row_decomposition_type()
7380

7481
case ( panel_decomposition_column )
82+
allocate(column_decomposition_type :: decomposition)
7583
decomposition = column_decomposition_type()
7684

7785
case ( panel_decomposition_custom )
86+
allocate(custom_decomposition_type :: decomposition)
7887
decomposition = custom_decomposition_type( panel_xproc, panel_yproc )
7988

8089
case ( panel_decomposition_auto_nonuniform )
90+
allocate(auto_nonuniform_decomposition_type :: decomposition)
8191
decomposition = auto_nonuniform_decomposition_type()
8292

8393
case ( panel_decomposition_guided_nonuniform )
94+
allocate(guided_nonuniform_decomposition_type :: decomposition)
8495
decomposition = guided_nonuniform_decomposition_type( panel_xproc )
8596

8697
case default

components/science/source/algorithm/sci_map_inter_element_order_alg_mod.x90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
module sci_map_inter_element_order_alg_mod
1313

14-
use constants_mod, only: i_def
14+
use constants_mod, only: i_def, r_def
1515
use field_mod, only: field_type
1616
use integer_field_mod, only: integer_field_type
1717
use fs_continuity_mod, only: W3, Wtheta, W2

documentation/source/how_to_use_it/lfric_datamodel/field.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ rather than adopting the name of the original field.
7474
take advantage of any shared memory parallelism. Therefore, use of
7575
``copy_field_serial`` is not advised. If the data needs to be
7676
copied, then use the ``setval_x`` `built-in
77-
<https://psyclone.readthedocs.io/en/stable/dynamo0p3.html#setting-to-a-value>`_
77+
<https://psyclone.readthedocs.io/en/stable/user_guide/lfric.html#setting-to-a-value>`_
7878
after the field is initialised. Initialising new fields with
7979
``setval_x`` allows PSyclone to optimise the copy.
8080

@@ -270,7 +270,7 @@ The infrastructure supports 32-bit integer fields:
270270
``integer_field_type``. Their creation and usage is essentially the
271271
same as for real fields. One key difference is that real fields and
272272
integer fields have their own set of `PSyclone built-in operations
273-
<https://psyclone.readthedocs.io/en/stable/dynamo0p3.html#built-in-operations-on-integer-valued-fields>`_.
273+
<https://psyclone.readthedocs.io/en/stable/user_guide/lfric.html#built-in-operations-on-integer-valued-fields>`_.
274274

275275
Currently, there is no known requirement for 64-bit integer fields, so
276276
a 64-bit integer field is not supported.

documentation/source/how_to_use_it/lfric_datamodel/function_space.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ version, and finally the next entity / argument.
5151

5252
The ``fs_type`` refers to one of a number of available function space
5353
types. A `high-level description
54-
<https://psyclone.readthedocs.io/en/stable/dynamo0p3.html#supported-function-spaces>`_
54+
<https://psyclone.readthedocs.io/en/stable/user_guide/lfric.html#supported-function-spaces>`_
5555
of supported function spaces can be found in the PSyclone
5656
documentation. Refer to GungHo documentation for a comprehensive
5757
description of each function space.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
##############################################################################
2+
# (c) Crown copyright Met Office. All rights reserved.
3+
# The file LICENCE, distributed with this code, contains details of the terms
4+
# under which the code may be used.
5+
##############################################################################
6+
7+
$(info ** Chosen AMD Clang C++ compiler)
8+
9+
CXX_RUNTIME_LIBRARY=stdc++
10+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
##############################################################################
2+
# (c) Crown copyright Met Office. All rights reserved.
3+
# The file LICENCE, distributed with this code, contains details of the terms
4+
# under which the code may be used.
5+
##############################################################################
6+
# Various things specific to the amdflang compiler.
7+
##############################################################################
8+
9+
$(info ** Chosen AMD Flang)
10+
11+
F_MOD_DESTINATION_ARG = -J
12+
F_MOD_SOURCE_ARG = -I
13+
14+
FFLAGS_OPENMP = -fopenmp
15+
LDFLAGS_OPENMP = -fopenmp
16+
17+
FFLAGS_COMPILER =
18+
FFLAGS_NO_OPTIMISATION = -O0
19+
FFLAGS_SAFE_OPTIMISATION = -O2
20+
FFLAGS_RISKY_OPTIMISATION = -Ofast
21+
FFLAGS_DEBUG = -g
22+
FFLAGS_WARNINGS =
23+
FFLAGS_UNIT_WARNINGS =
24+
FFLAGS_INIT =
25+
FFLAGS_RUNTIME =
26+
# fast-debug flags set separately as Intel compiler needs platform-specific control on them
27+
FFLAGS_FASTD_INIT = $(FFLAGS_INIT)
28+
FFLAGS_FASTD_RUNTIME = $(FFLAGS_RUNTIME)
29+
30+
# Option for checking code meets Fortran standard (flang only supports 2018)
31+
FFLAGS_FORTRAN_STANDARD = -std=f2018
32+
33+
LDFLAGS_COMPILER =
34+
35+
FPPFLAGS = -P

0 commit comments

Comments
 (0)