Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into nemo_v5
Browse files Browse the repository at this point in the history
  • Loading branch information
sergisiso committed Feb 11, 2025
2 parents 9f66641 + 6afc06a commit e7254b5
Show file tree
Hide file tree
Showing 64 changed files with 6,421 additions and 4,545 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,14 @@ on:
push

env:
CUDA_VERSION: 12.6.3
CUDA_VERSION: 12.8.0
GFORTRAN_VERSION: 14.2.0
HDF5_VERSION: 1.14.5
NETCDF_C_VERSION: 4.9.2
NETCDF_FORTRAN_VERSION: 4.6.1
NVFORTRAN_VERSION: 24.11
NVFORTRAN_VERSION: 25.1
OPENMPI_VERSION: 5.0.6
PYTHON_VERSION: 3.13.0
PYTHON_VERSION: 3.13.2

jobs:
run_if_on_mirror:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lfric_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
runs-on: self-hosted
env:
LFRIC_APPS_REV: 3269
PYTHON_VERSION: 3.13.0
PYTHON_VERSION: 3.13.2

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/nemo_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ jobs:
NETCDF_FORTRAN_VERSION: 4.6.1
NVFORTRAN_VERSION: 23.7
ONEAPI_VERSION: 2024.2.1
PERL_VERSION: 5.40.0
PYTHON_VERSION: 3.13.0
PERL_VERSION: 5.40.1
PYTHON_VERSION: 3.13.2

steps:
- uses: actions/checkout@v3
Expand Down
14 changes: 14 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,20 @@
16) PR #2857 for 2854. Excludes character assignments from ACC KERNELS
regions to avoid issues in NEMO.

17) PR #2829 for #2826. Adds a --config command-line argument to the
PSyAD script (to replicate that for psyclone).

18) PR #2280 for #2723. Add support for depencency analysis involving
array ranges.

19) PR #2885. Update integration test dependencies.

20) PR #2799 for #2779. Implement split finite-element order for
function spaces in the LFRic API and update Adjoint tests to use it.

21) PR #2883 for #2875. Fix issues cannonicalising WHEREs with elemental
functions.

release 3.0.0 6th of December 2024

1) PR #2477 for #2463. Add support for Fortran Namelist statements.
Expand Down
2 changes: 1 addition & 1 deletion doc/psyad/user_guide/implementation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ tangent-linear code it is first transformed into equivalent inline
code before the code is transformed to its adjoint form. The PSyIR
``DotProduct2CodeTrans`` or ``Matmul2CodeTrans`` transformations are
used to perform these manipulations. See the
:ref:`user_guide:available_trans` section of the user guide for more
:ref:`user_guide:sec_transformations_available` section of the user guide for more
information on these transformations.

.. note:: At the moment all ``dot_product`` and ``matmul`` intrinsics
Expand Down
12 changes: 11 additions & 1 deletion doc/psyad/user_guide/psyad_command.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ by the command:
.. parsed-literal::
>>> psyad -h
usage: psyad [-h] [-oad OAD] [-v] [-t] [-api API] [-coord-arg COORD_ARG] [-panel-id-arg PANEL_ID_ARG] [-otest TEST_FILENAME] -a ACTIVE [ACTIVE ...] -- filename
usage: psyad [-h] [-oad OAD] [-c CONFIG] [-v] [-t] [-api API] [-coord-arg COORD_ARG] [-panel-id-arg PANEL_ID_ARG] [-otest TEST_FILENAME] -a ACTIVE [ACTIVE ...] -- filename
Run the PSyclone adjoint code generator on a tangent-linear kernel file
Expand All @@ -73,6 +73,8 @@ by the command:
-h, --help show this help message and exit
-a ACTIVE [ACTIVE ...], --active ACTIVE [ACTIVE ...]
name of active variables
-c CONFIG, --config CONFIG
config file with PSyclone specific options
-v, --verbose increase the verbosity of the output
-t, --gen-test generate a standalone unit test for the adjoint code
-api API the PSyclone API that the TL kernel conforms to (if any)
Expand Down Expand Up @@ -207,3 +209,11 @@ internally you can specify the ``-v`` option. For example
::

> psyad -a var1 var2 -oad ad_kern.f90 -v tl_kern.f90

Configuration Options
---------------------

By default PSyAD uses the same configuration file used by PSyclone. To
use a custom configuration file use the ``--config`` command-line option.
Further documentation of the configuration options can be found in
:ref:`user_guide:configuration`.
7 changes: 4 additions & 3 deletions doc/user_guide/psyclone_kern.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
.. POSSIBILITY OF SUCH DAMAGE.
.. -----------------------------------------------------------------------------
.. Written by R. W. Ford and A. R. Porter, STFC Daresbury Lab
.. Modified by I. Kavcic and L. Turner, Met Office
.. Modified by I. Kavcic, L. Turner and J. Dendy, Met Office
PSyclone Kernel Tools
=====================
Expand Down Expand Up @@ -558,14 +558,15 @@ gives the following algorithm layer code:
use mesh_mod, only : mesh_type
use simple_mod, only : simple_type
use constants_mod, only : i_def, r_def
integer(kind=i_def), parameter :: element_order = 1_i_def
integer(kind=i_def), parameter :: element_order_h = 1_i_def
integer(kind=i_def), parameter :: element_order_v = 1_i_def
type(mesh_type), pointer, intent(in) :: mesh
type(field_type), dimension(3), intent(in), optional :: chi
type(field_type), intent(in), optional :: panel_id
TYPE(function_space_type), POINTER :: vector_space_w1_ptr
type(field_type) :: field_1
vector_space_w1_ptr => function_space_collection % get_fs(mesh, element_order, w1)
vector_space_w1_ptr => function_space_collection % get_fs(mesh, element_order_h, element_order_v, w1)
call field_1 % initialise(vector_space=vector_space_w1_ptr, name='field_1')
call invoke(setval_c(field_1, 1.0_r_def), simple_type(field_1))
Expand Down
11 changes: 6 additions & 5 deletions doc/user_guide/transformations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
.. Written by: R. W. Ford, A. R. Porter and S. Siso, STFC Daresbury Lab
.. A. B. G. Chalk and N. Nobre, STFC Daresbury Lab
.. I. Kavcic, Met Office
.. J. Dendy, Met Office
.. _transformations:

Expand Down Expand Up @@ -216,7 +217,7 @@ process, optional parameters for the transformation are also
provided this way. A simple example::

kctrans = Dynamo0p3KernelConstTrans()
kctrans.apply(kernel, {"element_order": 0, "quadrature": True})
kctrans.apply(kernel, {"element_order_h": 0, "element_order_v": 0, "quadrature": True})

The same ``options`` dictionary will be used when calling ``validate``.

Expand Down Expand Up @@ -287,19 +288,19 @@ can be found in the API-specific sections).
.. autoclass:: psyclone.psyir.transformations.AllArrayAccess2LoopTrans
:members: apply
:noindex:

####

.. autoclass:: psyclone.psyir.transformations.ArrayAccess2LoopTrans
:members: apply
:noindex:

####

.. autoclass:: psyclone.psyir.transformations.ArrayAssignment2LoopsTrans
:members: apply
:noindex:

####

.. autoclass:: psyclone.psyir.transformations.ChunkLoopTrans
Expand Down Expand Up @@ -802,7 +803,7 @@ PSyclone supports OpenMP Tasking, through the `OMPTaskloopTrans` and
transformations can be applied to loops, whilst the `OMPTaskwaitTrans`
operator is applied to an OpenMP Parallel Region, and computes the dependencies
caused by Taskloops, and adds OpenMP Taskwait statements to satisfy those
dependencies. An example of using OpenMP tasking is available in
dependencies. An example of using OpenMP tasking is available in
`PSyclone/examples/nemo/eg1/openmp_taskloop_trans.py`.

OpenCL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
! -----------------------------------------------------------------------------
! Modified by I. Kavcic, Met Office
! Modified by R. W. Ford, STFC Daresbury Lab
! Modified by J. Dendy, Met Office

!>@brief Preconditioner for the gravity-wave system
module gw_mixed_schur_preconditioner_alg_mod
Expand Down Expand Up @@ -125,7 +126,6 @@ contains
result(self)

use function_space_mod, only: function_space_type
use finite_element_config_mod, only: element_order
use quadrature_xyoz_mod, only: quadrature_xyoz_type
use quadrature_rule_gaussian_mod, only: quadrature_rule_gaussian_type
use matrix_vector_kernel_mod, only: matrix_vector_kernel_type
Expand Down
9 changes: 6 additions & 3 deletions examples/lfric/eg13/kernel_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
# POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
# Authors: R. W. Ford, N. Nobre and S. Siso, STFC Daresbury Lab
# Modified by: J. Dendy, Met Office


'''An example PSyclone transformation script which makes ndofs, nqp*
Expand Down Expand Up @@ -62,10 +63,11 @@
# associated kernel value constant (rather than passing it in by
# argument).
NUMBER_OF_LAYERS = 20
# The element order to use when modifying a kernel to make the
# The element orders to use when modifying a kernel to make the
# associated degrees of freedom values constant (rather than passing
# them in by argument).
ELEMENT_ORDER = 0
ELEMENT_ORDER_H = 0
ELEMENT_ORDER_V = 0
# Whether or not to make the number of quadrature points constant in a
# kernel (rather than passing them in by argument).
CONSTANT_QUADRATURE = True
Expand All @@ -86,7 +88,8 @@ def trans(psyir):
try:
const_trans.apply(kernel,
{"number_of_layers": NUMBER_OF_LAYERS,
"element_order": ELEMENT_ORDER,
"element_order_h": ELEMENT_ORDER_H,
"element_order_v": ELEMENT_ORDER_V,
"quadrature": CONSTANT_QUADRATURE})
except TransformationError:
print(f" Failed to modify kernel '{kernel.name}'")
11 changes: 7 additions & 4 deletions examples/lfric/eg14/main.x90
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
! -----------------------------------------------------------------------------
! Author: J. Henrichs, Bureau of Meteorology
! Modifications: A. R. Porter, STFC Daresbury Laboratory
! J. Dendy, Met Office

program main

Expand Down Expand Up @@ -57,7 +58,8 @@ program main
procedure (partitioner_interface), pointer :: partitioner_ptr
type(field_type) :: field1, field2
integer(kind=i_def) :: lfric_fs = W0 ! W0
integer(kind=i_def) :: element_order = 1
integer(kind=i_def) :: element_order_h = 1
integer(kind=i_def) :: element_order_v = 1
integer(kind=i_def) :: ndata_sz, istp
real(kind=r_def) :: chksm

Expand All @@ -84,9 +86,10 @@ program main
mesh = mesh_type(global_mesh_ptr, partition, extrusion_ptr)
write (*,*) "Mesh has", mesh%get_nlayers(), "layers."
ndata_sz = 1
vector_space = function_space_type( mesh, &
element_order, &
lfric_fs, &
vector_space = function_space_type( mesh, &
element_order_h, &
element_order_v, &
lfric_fs, &
ndata_sz)
vector_space_ptr => vector_space
call field1%initialise( vector_space = vector_space_ptr, name="field1" )
Expand Down
9 changes: 5 additions & 4 deletions examples/lfric/eg17/full_example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The following steps are required for this (using simplified code examples):
```fortran
global_mesh = global_mesh_type()
```
2) A 1x1 planar partition for one process is created:
```fortran
partitioner_ptr => partitioner_planar
Expand All @@ -34,9 +34,10 @@ The following steps are required for this (using simplified code examples):
5) Create a function/vector space:
```fortran
vector_space = function_space_type( mesh, &
element_order, &
lfric_fs, &
vector_space = function_space_type( mesh, &
element_order_h, &
element_order_v, &
lfric_fs, &
ndata_sz)
```
Expand Down
11 changes: 7 additions & 4 deletions examples/lfric/eg17/full_example/main.x90
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
! -----------------------------------------------------------------------------
! Author: J. Henrichs, Bureau of Meteorology
! Modifications: A. R. Porter, STFC Daresbury Laboratory
! J. Dendy, Met Office

program main

Expand Down Expand Up @@ -57,7 +58,8 @@ program main
procedure (partitioner_interface), pointer :: partitioner_ptr
type(field_type) :: field1, field2
integer(kind=i_def) :: lfric_fs = W0 ! W0
integer(kind=i_def) :: element_order = 1
integer(kind=i_def) :: element_order_h = 1
integer(kind=i_def) :: element_order_v = 1
integer(kind=i_def) :: ndata_sz

! Use the unit-testing constructor:
Expand All @@ -81,9 +83,10 @@ program main
mesh = mesh_type(global_mesh_ptr, partition, extrusion_ptr)
write (*,*) "Mesh has", mesh%get_nlayers(), "layers."
ndata_sz = 1
vector_space = function_space_type( mesh, &
element_order, &
lfric_fs, &
vector_space = function_space_type( mesh, &
element_order_h, &
element_order_v, &
lfric_fs, &
ndata_sz)
vector_space_ptr => vector_space
call field1%initialise( vector_space = vector_space_ptr, name="field1" )
Expand Down
11 changes: 7 additions & 4 deletions examples/lfric/eg17/full_example_extract/main.X90
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
! -----------------------------------------------------------------------------
! Author: J. Henrichs, Bureau of Meteorology
! Modifications: A. R. Porter, STFC Daresbury Laboratory
! J. Dendy, Met Office

program main
!> This program is a simple LFRic program that contains two invokes,
Expand Down Expand Up @@ -70,7 +71,8 @@ program main
type(field_type) :: field1, field2
type(field_type) :: chi(3)
integer(kind=i_def) :: lfric_fs = W0 ! W0
integer(kind=i_def) :: element_order = 1
integer(kind=i_def) :: element_order_h = 1
integer(kind=i_def) :: element_order_v = 1
integer(kind=i_def) :: ndata_sz
real(kind=r_def) :: one
logical(kind=l_def) :: some_logical
Expand Down Expand Up @@ -101,9 +103,10 @@ program main
mesh = mesh_type(global_mesh_ptr, partition, extrusion_ptr)
write (*,*) "Mesh has", mesh%get_nlayers(), "layers."
ndata_sz = 1
vector_space = function_space_type( mesh, &
element_order, &
lfric_fs, &
vector_space = function_space_type( mesh, &
element_order_h, &
element_order_v, &
lfric_fs, &
ndata_sz)
vector_space_ptr => vector_space
do i=1, 3
Expand Down
11 changes: 6 additions & 5 deletions examples/lfric/eg17/full_example_netcdf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ steps are required for this (using simplified code examples):
```fortran
global_mesh = global_mesh_type("mesh_BiP128x16-400x100.nc", "dynamics")
```
2) A 1x1 planar partition for one process is created:
```fortran
partitioner_ptr => partitioner_planar
Expand All @@ -34,9 +34,10 @@ steps are required for this (using simplified code examples):
5) Create a function/vector space:
```fortran
vector_space = function_space_type( mesh, &
element_order, &
lfric_fs, &
vector_space = function_space_type( mesh, &
element_order_h, &
element_order_v, &
lfric_fs, &
ndata_sz)
```
Expand All @@ -61,7 +62,7 @@ steps are required for this (using simplified code examples):
## Compilation
A simple makefile is provided to compile the example. It needs
A simple makefile is provided to compile the example. It needs
a full installation of NetCDF, since it is using ``nf-config`` to
query the required compiler and linker flags, and the
infrastructure library ``liblfric_netcdf.a`` provided in
Expand Down
Loading

0 comments on commit e7254b5

Please sign in to comment.