Skip to content

Commit f486648

Browse files
author
joshua.dendy
committed
#2779 Modify occurrences of 'get_fs', 'element_order' and 'function_space_type' outside of src/psyclone to reflect new split element orders
1 parent edf86ca commit f486648

31 files changed

+205
-113
lines changed

doc/user_guide/psyclone_kern.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
.. POSSIBILITY OF SUCH DAMAGE.
3333
.. -----------------------------------------------------------------------------
3434
.. Written by R. W. Ford and A. R. Porter, STFC Daresbury Lab
35-
.. Modified by I. Kavcic and L. Turner, Met Office
35+
.. Modified by I. Kavcic, L. Turner and J. Dendy, Met Office
3636
3737
PSyclone Kernel Tools
3838
=====================
@@ -558,14 +558,15 @@ gives the following algorithm layer code:
558558
use mesh_mod, only : mesh_type
559559
use simple_mod, only : simple_type
560560
use constants_mod, only : i_def, r_def
561-
integer(kind=i_def), parameter :: element_order = 1_i_def
561+
integer(kind=i_def), parameter :: element_order_h = 1_i_def
562+
integer(kind=i_def), parameter :: element_order_v = 1_i_def
562563
type(mesh_type), pointer, intent(in) :: mesh
563564
type(field_type), dimension(3), intent(in), optional :: chi
564565
type(field_type), intent(in), optional :: panel_id
565566
TYPE(function_space_type), POINTER :: vector_space_w1_ptr
566567
type(field_type) :: field_1
567568
568-
vector_space_w1_ptr => function_space_collection % get_fs(mesh, element_order, w1)
569+
vector_space_w1_ptr => function_space_collection % get_fs(mesh, element_order_h, element_order_v, w1)
569570
call field_1 % initialise(vector_space=vector_space_w1_ptr, name='field_1')
570571
call invoke(setval_c(field_1, 1.0_r_def), simple_type(field_1))
571572

doc/user_guide/transformations.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ process, optional parameters for the transformation are also
112112
provided this way. A simple example::
113113

114114
kctrans = Dynamo0p3KernelConstTrans()
115-
kctrans.apply(kernel, {"element_order": 0, "quadrature": True})
115+
kctrans.apply(kernel, {"element_order_h": 0, "element_order_v": 0, "quadrature": True})
116116

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

@@ -188,19 +188,19 @@ can be found in the API-specific sections).
188188
.. autoclass:: psyclone.psyir.transformations.AllArrayAccess2LoopTrans
189189
:members: apply
190190
:noindex:
191-
191+
192192
####
193193

194194
.. autoclass:: psyclone.psyir.transformations.ArrayAccess2LoopTrans
195195
:members: apply
196196
:noindex:
197-
197+
198198
####
199199

200200
.. autoclass:: psyclone.psyir.transformations.ArrayAssignment2LoopsTrans
201201
:members: apply
202202
:noindex:
203-
203+
204204
####
205205

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

911911
OpenCL

examples/lfric/code/gw_mixed_schur_preconditioner_alg_mod.x90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
! -----------------------------------------------------------------------------
3939
! Modified by I. Kavcic, Met Office
4040
! Modified by R. W. Ford, STFC Daresbury Lab
41+
! Modified by J. Dendy, Met Office
4142

4243
!>@brief Preconditioner for the gravity-wave system
4344
module gw_mixed_schur_preconditioner_alg_mod
@@ -125,7 +126,6 @@ contains
125126
result(self)
126127

127128
use function_space_mod, only: function_space_type
128-
use finite_element_config_mod, only: element_order
129129
use quadrature_xyoz_mod, only: quadrature_xyoz_type
130130
use quadrature_rule_gaussian_mod, only: quadrature_rule_gaussian_type
131131
use matrix_vector_kernel_mod, only: matrix_vector_kernel_type

examples/lfric/eg13/kernel_constants.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
# POSSIBILITY OF SUCH DAMAGE.
3333
# -----------------------------------------------------------------------------
3434
# Authors: R. W. Ford, N. Nobre and S. Siso, STFC Daresbury Lab
35+
# Modified by: J. Dendy, Met Office
3536

3637

3738
'''An example PSyclone transformation script which makes ndofs, nqp*
@@ -62,10 +63,11 @@
6263
# associated kernel value constant (rather than passing it in by
6364
# argument).
6465
NUMBER_OF_LAYERS = 20
65-
# The element order to use when modifying a kernel to make the
66+
# The element orders to use when modifying a kernel to make the
6667
# associated degrees of freedom values constant (rather than passing
6768
# them in by argument).
68-
ELEMENT_ORDER = 0
69+
ELEMENT_ORDER_H = 0
70+
ELEMENT_ORDER_V = 0
6971
# Whether or not to make the number of quadrature points constant in a
7072
# kernel (rather than passing them in by argument).
7173
CONSTANT_QUADRATURE = True
@@ -86,7 +88,8 @@ def trans(psyir):
8688
try:
8789
const_trans.apply(kernel,
8890
{"number_of_layers": NUMBER_OF_LAYERS,
89-
"element_order": ELEMENT_ORDER,
91+
"element_order_h": ELEMENT_ORDER_H,
92+
"element_order_v": ELEMENT_ORDER_V,
9093
"quadrature": CONSTANT_QUADRATURE})
9194
except TransformationError:
9295
print(f" Failed to modify kernel '{kernel.name}'")

examples/lfric/eg14/main.x90

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
! -----------------------------------------------------------------------------
3131
! Author: J. Henrichs, Bureau of Meteorology
3232
! Modifications: A. R. Porter, STFC Daresbury Laboratory
33+
! J. Dendy, Met Office
3334

3435
program main
3536

@@ -57,7 +58,8 @@ program main
5758
procedure (partitioner_interface), pointer :: partitioner_ptr
5859
type(field_type) :: field1, field2
5960
integer(kind=i_def) :: lfric_fs = W0 ! W0
60-
integer(kind=i_def) :: element_order = 1
61+
integer(kind=i_def) :: element_order_h = 1
62+
integer(kind=i_def) :: element_order_v = 1
6163
integer(kind=i_def) :: ndata_sz, istp
6264
real(kind=r_def) :: chksm
6365

@@ -84,9 +86,10 @@ program main
8486
mesh = mesh_type(global_mesh_ptr, partition, extrusion_ptr)
8587
write (*,*) "Mesh has", mesh%get_nlayers(), "layers."
8688
ndata_sz = 1
87-
vector_space = function_space_type( mesh, &
88-
element_order, &
89-
lfric_fs, &
89+
vector_space = function_space_type( mesh, &
90+
element_order_h, &
91+
element_order_v, &
92+
lfric_fs, &
9093
ndata_sz)
9194
vector_space_ptr => vector_space
9295
call field1%initialise( vector_space = vector_space_ptr, name="field1" )

examples/lfric/eg17/full_example/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The following steps are required for this (using simplified code examples):
99
```fortran
1010
global_mesh = global_mesh_type()
1111
```
12-
12+
1313
2) A 1x1 planar partition for one process is created:
1414
```fortran
1515
partitioner_ptr => partitioner_planar
@@ -34,9 +34,10 @@ The following steps are required for this (using simplified code examples):
3434
3535
5) Create a function/vector space:
3636
```fortran
37-
vector_space = function_space_type( mesh, &
38-
element_order, &
39-
lfric_fs, &
37+
vector_space = function_space_type( mesh, &
38+
element_order_h, &
39+
element_order_v, &
40+
lfric_fs, &
4041
ndata_sz)
4142
```
4243

examples/lfric/eg17/full_example/main.x90

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ program main
5757
procedure (partitioner_interface), pointer :: partitioner_ptr
5858
type(field_type) :: field1, field2
5959
integer(kind=i_def) :: lfric_fs = W0 ! W0
60-
integer(kind=i_def) :: element_order = 1
60+
integer(kind=i_def) :: element_order_h = 1
61+
integer(kind=i_def) :: element_order_v = 1
6162
integer(kind=i_def) :: ndata_sz
6263

6364
! Use the unit-testing constructor:
@@ -81,9 +82,10 @@ program main
8182
mesh = mesh_type(global_mesh_ptr, partition, extrusion_ptr)
8283
write (*,*) "Mesh has", mesh%get_nlayers(), "layers."
8384
ndata_sz = 1
84-
vector_space = function_space_type( mesh, &
85-
element_order, &
86-
lfric_fs, &
85+
vector_space = function_space_type( mesh, &
86+
element_order_h, &
87+
element_order_v, &
88+
lfric_fs, &
8789
ndata_sz)
8890
vector_space_ptr => vector_space
8991
call field1%initialise( vector_space = vector_space_ptr, name="field1" )

examples/lfric/eg17/full_example_extract/main.X90

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ program main
7070
type(field_type) :: field1, field2
7171
type(field_type) :: chi(3)
7272
integer(kind=i_def) :: lfric_fs = W0 ! W0
73-
integer(kind=i_def) :: element_order = 1
73+
integer(kind=i_def) :: element_order_h = 1
74+
integer(kind=i_def) :: element_order_v = 1
7475
integer(kind=i_def) :: ndata_sz
7576
real(kind=r_def) :: one
7677
logical(kind=l_def) :: some_logical
@@ -101,9 +102,10 @@ program main
101102
mesh = mesh_type(global_mesh_ptr, partition, extrusion_ptr)
102103
write (*,*) "Mesh has", mesh%get_nlayers(), "layers."
103104
ndata_sz = 1
104-
vector_space = function_space_type( mesh, &
105-
element_order, &
106-
lfric_fs, &
105+
vector_space = function_space_type( mesh, &
106+
element_order_h, &
107+
element_order_v, &
108+
lfric_fs, &
107109
ndata_sz)
108110
vector_space_ptr => vector_space
109111
do i=1, 3

examples/lfric/eg17/full_example_netcdf/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ steps are required for this (using simplified code examples):
99
```fortran
1010
global_mesh = global_mesh_type("mesh_BiP128x16-400x100.nc", "dynamics")
1111
```
12-
12+
1313
2) A 1x1 planar partition for one process is created:
1414
```fortran
1515
partitioner_ptr => partitioner_planar
@@ -34,9 +34,10 @@ steps are required for this (using simplified code examples):
3434
3535
5) Create a function/vector space:
3636
```fortran
37-
vector_space = function_space_type( mesh, &
38-
element_order, &
39-
lfric_fs, &
37+
vector_space = function_space_type( mesh, &
38+
element_order_h, &
39+
element_order_v, &
40+
lfric_fs, &
4041
ndata_sz)
4142
```
4243
@@ -61,7 +62,7 @@ steps are required for this (using simplified code examples):
6162
6263
## Compilation
6364
64-
A simple makefile is provided to compile the example. It needs
65+
A simple makefile is provided to compile the example. It needs
6566
a full installation of NetCDF, since it is using ``nf-config`` to
6667
query the required compiler and linker flags, and the
6768
infrastructure library ``liblfric_netcdf.a`` provided in

examples/lfric/eg17/full_example_netcdf/main.x90

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
! -----------------------------------------------------------------------------
3131
! Author: J. Henrichs, Bureau of Meteorology
3232
! Modifications: A. R. Porter, STFC Daresbury Laboratory
33+
! J. Dendy, Met Office
3334

3435
program main
3536

@@ -58,7 +59,8 @@ program main
5859
procedure (partitioner_interface), pointer :: partitioner_ptr
5960
type(field_type) :: field1, field2
6061
integer(kind=i_def) :: lfric_fs = W0 ! W0
61-
integer(kind=i_def) :: element_order = 1
62+
integer(kind=i_def) :: element_order_h = 1
63+
integer(kind=i_def) :: element_order_v = 1
6264
integer(kind=i_def) :: ndata_sz
6365

6466
! Use the unit-testing constructor:
@@ -82,9 +84,10 @@ program main
8284
mesh = mesh_type(global_mesh_ptr, partition, extrusion_ptr)
8385
write (*,*) "Mesh has", mesh%get_nlayers(), "layers."
8486
ndata_sz = 1
85-
vector_space = function_space_type( mesh, &
86-
element_order, &
87-
lfric_fs, &
87+
vector_space = function_space_type( mesh, &
88+
element_order_h, &
89+
element_order_v, &
90+
lfric_fs, &
8891
ndata_sz)
8992
vector_space_ptr => vector_space
9093
call field1%initialise( vector_space = vector_space_ptr, name="field1" )

0 commit comments

Comments
 (0)