Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
bf523ba
#1312: create initial ScalarArray example
mo-alistairp Jul 24, 2025
dc1ec4a
#1312: start adding code generation for ScalarArrays
mo-alistairp Aug 19, 2025
862f368
Merge branch 'master' into 1312_scalararray_code_gen
mo-alistairp Aug 19, 2025
1a07148
#1312: lint fix
mo-alistairp Aug 19, 2025
decf6c1
#1312: condense the scalar_array functionality into the scalar function
mo-alistairp Aug 19, 2025
6d74811
#1312L lint fix
mo-alistairp Aug 19, 2025
71c7d0c
#1312: fix the scalar type check logic
mo-alistairp Aug 19, 2025
fa6a7e6
#1312: remove the empty test file for now
mo-alistairp Aug 19, 2025
ae9ba03
#1312: fix the failing test
mo-alistairp Aug 19, 2025
4961046
#1312: actually fix the failing test
mo-alistairp Aug 19, 2025
bc8260f
#1312: lint fix
mo-alistairp Aug 19, 2025
8e2b3de
#1312: Add initial test implementation of ScalarArrays
mo-alistairp Aug 21, 2025
5b8c42d
#1312: fix tests to check that gh_scalar_array is being assigned prop…
mo-alistairp Aug 21, 2025
ea0e8f7
1312: add TODO to check whether is_scalar references need updating
mo-alistairp Aug 21, 2025
3b6ad7d
Merge branch 'master' into 1312_scalararray_code_gen
mo-alistairp Aug 21, 2025
33caeac
#1312: lint fix
mo-alistairp Aug 21, 2025
605d9ab
#1312: create a loose structure for acc access
mo-alistairp Aug 21, 2025
c9a5598
#1312: Code gen and stub gen for ScalarArrays
mo-alistairp Oct 21, 2025
bbb37b7
#1312: lint fix
mo-alistairp Oct 21, 2025
9f3cfb5
Merge branch 'master' into 1312_scalararray_code_gen
mo-alistairp Oct 21, 2025
8e311c2
#1312: lint fix
mo-alistairp Oct 21, 2025
ea6ae8d
#1312: lint fixes
mo-alistairp Oct 22, 2025
136d89e
#1312: move dimension array to lfric_scalar_args
mo-alistairp Oct 23, 2025
fd0d546
#1312: add declarations for ScalarArray
mo-alistairp Oct 24, 2025
50a2c09
#1312: Move ScalarArray declarations to its own file
mo-alistairp Nov 3, 2025
f4c685b
#1312: correct the type checking in declarations
mo-alistairp Nov 3, 2025
cc53390
#1312: return lfric_scalar_args to original state
mo-alistairp Nov 3, 2025
f3ee59e
#1312: fix if statement to exclude ScalarArray
mo-alistairp Nov 3, 2025
140b022
#1312: Add LFRicScalarArrayArga to paths
mo-alistairp Nov 4, 2025
8527d01
#1312: Alter ScalarArray declaration
mo-alistairp Nov 4, 2025
39f96fb
#1312: Lint fix
mo-alistairp Nov 4, 2025
3360be3
#1312: Lint fix
mo-alistairp Nov 4, 2025
02a42b2
#1312: Remove ScalarArrays from is_scalar
mo-alistairp Nov 4, 2025
6cf25bc
#1312: Fix is_scalar statement in lfric_loop
mo-alistairp Nov 5, 2025
a9dc367
Merge branch 'master' into 1312_scalararray_code_gen
mo-alistairp Nov 10, 2025
75692cc
#1312: reintroduce ScalarArray if statement in arg_ordering
mo-alistairp Nov 10, 2025
6edd5f3
#1312: add super scalar call to kern_stub_arg_list
mo-alistairp Nov 10, 2025
12b4a74
#1312: lint fix
mo-alistairp Nov 10, 2025
c455482
#1312: fix arg_ordering to include ScalarArrays in assertion
mo-alistairp Nov 10, 2025
184a624
#1312: Fix lfric_test to check ScalarArray rather than field
mo-alistairp Nov 10, 2025
20ecf84
#1312: change INTEGER_TYPE to LFRic equivalent
mo-alistairp Nov 10, 2025
35bc15a
#1312: add dims_array dimensions to ScalarArray declarations
mo-alistairp Nov 11, 2025
3a6ddc6
#1312: change find_or_create to lookup to fix code generation
mo-alistairp Nov 12, 2025
e92ca50
#1312: lint fix
mo-alistairp Nov 12, 2025
a21d57e
#1312: lint fix
mo-alistairp Nov 12, 2025
1d6b212
#1312: copy ScalarArray creation into the stub list
mo-alistairp Nov 13, 2025
1301f11
Merge branch 'master' into 1312_scalararray_code_gen
mo-alistairp Nov 13, 2025
a73d33b
#1312: Remove the temporary KernStubArgList code
mo-alistairp Nov 13, 2025
39b7cb9
#1312: Alter test cases to have 5 args in testkern to avoid error
mo-alistairp Nov 13, 2025
9556c2b
#1312: Try comment out changes to see if it fixes errors
mo-alistairp Nov 14, 2025
4052702
Merge branch 'master' into 1312_scalararray_code_gen
mo-alistairp Nov 14, 2025
86d3231
#1312: lint fix
mo-alistairp Nov 14, 2025
03c600a
#1312: add conditional to differentiate between code gen and stub gen
mo-alistairp Nov 14, 2025
b8c358f
#1312: Add partial stub generation code
mo-alistairp Nov 14, 2025
2216993
#1312: lint fix
mo-alistairp Nov 14, 2025
0d6874b
#1312: lint fix
mo-alistairp Nov 14, 2025
06fbf55
#1312: reinstate standard scalar behaviour in ArgOrdering
mo-alistairp Nov 17, 2025
aa7e39b
#1312: Fix the dimensions pf the ScalarArray stub gen
mo-alistairp Nov 21, 2025
0dcd904
#1312: add correct stub gen test
mo-alistairp Nov 21, 2025
13bcee0
#1312: Fix the stub gen to have the correct number of ScalarArray inputs
mo-alistairp Nov 21, 2025
0cc2463
#1312: lint fix
mo-alistairp Nov 21, 2025
531e181
#1312: Fix test in test to pass lint
mo-alistairp Nov 21, 2025
40aaf0e
#1312: remove code in KernCallArgList to fix the call in code generation
mo-alistairp Nov 24, 2025
18be0df
#1312: fix lint
mo-alistairp Nov 25, 2025
388d45e
#1312: remove print statement from stub_gen test
mo-alistairp Nov 25, 2025
f8d1a8a
#1312: lint fix
mo-alistairp Nov 25, 2025
502b618
#1312: tidy LFRicScalarArrayArgs
mo-alistairp Nov 25, 2025
da0a8d1
#1312: fix indentation in stub gen test
mo-alistairp Nov 25, 2025
013463c
#1312: Add error message to KernStubArgList because it no longer has …
mo-alistairp Nov 25, 2025
8249ade
#1312: Add stub declaration data type exception
mo-alistairp Nov 25, 2025
4d503fa
#1312: lint fix
mo-alistairp Nov 25, 2025
42ff5b7
#1312: Add test for ScalarArray intrinsic type
mo-alistairp Nov 26, 2025
662ac2e
#1312: remove print statements
mo-alistairp Nov 26, 2025
bfc3e47
#1312: Remove the KernCallAccArgList empty if statement to appease Co…
mo-alistairp Nov 26, 2025
463fcff
#1312: Test whether an exception is raised when a ScalarArray is call…
mo-alistairp Nov 26, 2025
9828122
#1312: remove todo
mo-alistairp Nov 26, 2025
05b2725
#1312: Tidy LFRicScalarArrayArgs
mo-alistairp Nov 26, 2025
abbed54
#1312: Add consideration for ScalarArrays in lfric.py
mo-alistairp Nov 26, 2025
ec15259
#1312: tidy scalar_array_invoke.f90
mo-alistairp Nov 26, 2025
f78a894
#1312: improve the multikernel_invokes_scalar_array_invalid description
mo-alistairp Nov 26, 2025
dc1bce9
#1312: Add authorship to relevant files
mo-alistairp Nov 26, 2025
5133a3c
Merge branch 'master' into 1312_scalararray_code_gen
mo-alistairp Nov 28, 2025
7338d2a
Merge branch 'master' into 1312_scalararray_code_gen
arporter Dec 1, 2025
6b265e2
#1312: Add NotImplementedError to KernCallACCArgList
mo-alistairp Dec 2, 2025
0d1b97a
#1312: Revert requested files
mo-alistairp Dec 2, 2025
01f507c
#1312: Create test to check for NotImplementedError for ScalarArrays …
mo-alistairp Dec 2, 2025
afaebb6
#1312: miscellaneous style changes
mo-alistairp Dec 2, 2025
cd61f83
#1312: lint fix
mo-alistairp Dec 2, 2025
eca5ad1
#1312: lint fix
mo-alistairp Dec 2, 2025
0566cce
Merge branch 'master' into 1312_scalararray_code_gen
mo-alistairp Dec 2, 2025
6269aab
#1312: revert typehints temporarily to try identify error
mo-alistairp Dec 3, 2025
5e48f74
#1312: lint fix
mo-alistairp Dec 3, 2025
53111a9
#1312: change imports to try find culprit
mo-alistairp Dec 3, 2025
279f882
This reverts commit 0d1b97ab94e8de67a46d57e883b5e03a1a2c8257.
mo-alistairp Dec 3, 2025
b4d2647
#1312: revert KernCallArgList and LFRicScalarArgs to original state
mo-alistairp Dec 3, 2025
7be0fa6
#1312: potentially fix LFRicScalarArrayArgs doc build error
mo-alistairp Dec 3, 2025
72b3026
#1312: add typehint to KernStubArgList
mo-alistairp Dec 4, 2025
699aeac
#1312: remove typehint from KernStubArgList
mo-alistairp Dec 4, 2025
d10b34f
#1312: potential fix for import build failure
mo-alistairp Dec 4, 2025
cee1d48
#1312: continuing the potential fix
mo-alistairp Dec 4, 2025
cc61781
#1312: continue trying to fix circular import
mo-alistairp Dec 5, 2025
c58d7cf
#1312: continue trying to fix circular import
mo-alistairp Dec 5, 2025
c2f572a
#1312: lint fix
mo-alistairp Dec 5, 2025
8bdf4d1
#1312: continue trying to fix circular import
mo-alistairp Dec 5, 2025
efca80b
#1312: continue trying to fix circular import
mo-alistairp Dec 5, 2025
553a610
#1312: continue trying to fix circular import
mo-alistairp Dec 5, 2025
8cd4dbb
#1312: revert the splitting of imports
mo-alistairp Dec 5, 2025
03ea2f8
#1312: Fix the typehinting in KernStubArgList
mo-alistairp Dec 5, 2025
d546841
#1312: test inverting the if statement
mo-alistairp Dec 5, 2025
8b46182
#1312: change typehinting in KernStubArgList to be a comment
mo-alistairp Dec 5, 2025
a1e5111
#1312: hopefully fix the typehinting
mo-alistairp Dec 5, 2025
5ccffee
#1312: correct the import
mo-alistairp Dec 5, 2025
bd82d29
#1312: Cut down LFRicScalarArrayArgs to do multiple types at once
mo-alistairp Dec 9, 2025
3b167fc
#1312: Use intrinsic_type rather than intent in LFRicScalarArrayArgs …
mo-alistairp Dec 9, 2025
889fefa
#1312: Condense argument dictionaries into one where possible
mo-alistairp Dec 9, 2025
58ba124
#1312: Improve comments to distinguish between scal and decl_scal
mo-alistairp Dec 9, 2025
e9c7b77
#1312: Include the dimensions array in the kernel call list
mo-alistairp Dec 10, 2025
3febeb7
#1312: remove old todo
mo-alistairp Dec 11, 2025
6af9a55
#1312: Change the _array_ndims to be >=1
mo-alistairp Dec 11, 2025
a7f3e98
#1312: Add comment to _array_ndims
mo-alistairp Dec 11, 2025
9c8499d
#1312: change the test codegen to use get_invoke
mo-alistairp Dec 18, 2025
49d89e5
#1312: add field related parameters to the testkern
mo-alistairp Dec 18, 2025
5d92498
Merge branch 'master' into 1312_scalararray_code_gen
mo-alistairp Dec 18, 2025
2741a4b
#1312: Swap the order of dims_array and ScalarArray declarations
mo-alistairp Jan 15, 2026
444d99a
#1312: Update ScalarArray tests to match declaration order
mo-alistairp Jan 15, 2026
b2d4553
#1312: Add GH_SCALAR_ARRAY as an LFRic argument
mo-alistairp Jan 16, 2026
adcdb37
#1312: lint fix
mo-alistairp Jan 16, 2026
d2a7ef9
Merge branch 'master' into 1312_scalararray_code_gen
mo-alistairp Jan 16, 2026
f187466
Merge branch 'master' into 1312_scalararray_code_gen
arporter Jan 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ module argument_mod
integer, public, parameter :: GH_FIELD = 507
integer, public, parameter :: GH_OPERATOR = 735
integer, public, parameter :: GH_COLUMNWISE_OPERATOR = 841
integer, public, parameter :: GH_SCALAR_ARRAY = 973
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

@mo-alistairp mo-alistairp Jan 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a draft PR ready in MetOffice/lfric_core - MetOffice/lfric_core#223. It'll need to go through review, but it's currently waiting for the PSyclone PR to be implemented.

I'm not entirely sure the process you take to get it into external/ so let me know if you need me to make a PR in stfc/lfric_core too

!> @}

!> @defgroup data_type Enumeration of argument data type property descriptors.
Expand Down
4 changes: 3 additions & 1 deletion src/psyclone/domain/lfric/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
# Author J. Henrichs, Bureau of Meteorology
# Modified: I. Kavcic, L. Turner and O. Brunt, Met Office
# Modified: I. Kavcic, L. Turner, O. Brunt and A. Pirrie, Met Office
# R. W. Ford and A. R. Porter, STFC Daresbury Lab

'''Module for the LFRic domain.
Expand Down Expand Up @@ -71,6 +71,7 @@
from psyclone.domain.lfric.lfric_run_time_checks import LFRicRunTimeChecks
from psyclone.domain.lfric.lfric_invokes import LFRicInvokes
from psyclone.domain.lfric.lfric_scalar_args import LFRicScalarArgs
from psyclone.domain.lfric.lfric_scalar_array_args import LFRicScalarArrayArgs
from psyclone.domain.lfric.lfric_loop_bounds import LFRicLoopBounds
from psyclone.domain.lfric.lfric_kern_metadata import LFRicKernMetadata
from psyclone.domain.lfric.lfric_psy import LFRicPSy
Expand Down Expand Up @@ -105,5 +106,6 @@
'LFRicPSy',
'LFRicRunTimeChecks',
'LFRicScalarArgs',
'LFRicScalarArrayArgs',
'LFRicStencils',
'LFRicSymbolTable']
13 changes: 7 additions & 6 deletions src/psyclone/domain/lfric/arg_ordering.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
# POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
# Authors R. W. Ford, A. R. Porter and S. Siso, STFC Daresbury Lab
# Modified I. Kavcic, A. Coughtrie and L. Turner, Met Office
# Modified I. Kavcic, A. Coughtrie, L. Turner, and A. Pirrie, Met Office
# Modified J. Henrichs, Bureau of Meteorology

'''This module implements the base class for managing arguments to
Expand Down Expand Up @@ -459,7 +459,7 @@ def generate(self, var_accesses=None):
self.operator(arg, var_accesses=var_accesses)
elif arg.argument_type == "gh_columnwise_operator":
self.cma_operator(arg, var_accesses=var_accesses)
elif arg.is_scalar:
elif arg.is_scalar or arg.is_scalar_array:
self.scalar(arg, var_accesses=var_accesses)
else:
raise GenerationError(
Expand Down Expand Up @@ -770,11 +770,11 @@ def scalar(self, scalar_arg, var_accesses=None):

'''
const = LFRicConstants()
if not scalar_arg.is_scalar:
if not (scalar_arg.is_scalar or scalar_arg.is_scalar_array):
raise InternalError(
f"Expected argument type to be one of "
f"{const.VALID_SCALAR_NAMES} but got "
f"'{scalar_arg.argument_type}'")
f"{const.VALID_SCALAR_NAMES + const.VALID_ARRAY_NAMES}"
f" but got '{scalar_arg.argument_type}'")

if scalar_arg.is_literal:
# If we have a literal, do not add it to the variable access
Expand All @@ -785,7 +785,8 @@ def scalar(self, scalar_arg, var_accesses=None):
var_accesses.add_access(Signature(scalar_arg.precision),
AccessType.CONSTANT, self._kern)
else:
self.append(scalar_arg.name, var_accesses, mode=scalar_arg.access,
self.append(scalar_arg.name, var_accesses,
mode=scalar_arg.access,
metadata_posn=scalar_arg.metadata_index)

def fs_common(self, function_space, var_accesses=None):
Expand Down
10 changes: 9 additions & 1 deletion src/psyclone/domain/lfric/kern_call_acc_arg_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ def fs_intergrid(self, function_space, var_accesses=None):
def scalar(self, scalar_arg, var_accesses=None):
'''
Override the default implementation as there's no need to specify
scalars for an OpenACC data region.
scalar values for an OpenACC data region. But there is a need for
ScalarArrays.

:param scalar_arg: the kernel argument.
:type scalar_arg: :py:class:`psyclone.lfric.LFRicKernelArgument`
Expand All @@ -271,6 +272,13 @@ def scalar(self, scalar_arg, var_accesses=None):
:py:class:`psyclone.core.VariablesAccessMap`]

'''
# TODO: Add implementation of OpenACC data region for ScalarArrays
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest adding a check here and if we have a ScalarArray, raise a NotImplementedError. You'll need an associated test too I'm afraid.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove the TODO as otherwise our rule is that you need an associated Issue and I don't think we want another Issue :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, please document the NotImplementedError as a ":raises ...." in the docstring.

# If the argument is a simple scalar value then doesn't need values
# added to OpenACC region
if scalar_arg.is_scalar_array:
raise NotImplementedError(
"OpenACC data regions are not currently supported for arrays"
" of scalars.")


# ============================================================================
Expand Down
5 changes: 5 additions & 0 deletions src/psyclone/domain/lfric/kern_call_arg_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,11 @@ def scalar(self, scalar_arg,
if scalar_arg.is_literal:
self.psyir_append(scalar_arg.psyir_expression())
else:
if scalar_arg.is_scalar_array:
# If it's a ScalarArray we need to add the dimensions
# array to the call
dims_sym = self._symtab.lookup("dims_" + scalar_arg.name)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably safer to use "dims_"+scalar_arg.name as a tag and then do lookup_with_tag here.

self.psyir_append(Reference(dims_sym))
sym = self._symtab.lookup(scalar_arg.name)
self.psyir_append(Reference(sym))

Expand Down
34 changes: 32 additions & 2 deletions src/psyclone/domain/lfric/kern_stub_arg_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,18 @@
# POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
# Authors R. W. Ford, A. R. Porter and S. Siso, STFC Daresbury Lab
# Modified I. Kavcic, A. Coughtrie and L. Turner, Met Office
# Modified I. Kavcic, A. Coughtrie, L. Turner and A. Pirrie, Met Office
# Modified J. Henrichs, Bureau of Meteorology

'''This module implements a class that creates the argument list
for a kernel subroutine.
'''

from typing import Optional
from typing import Optional, TYPE_CHECKING

from psyclone.core import VariablesAccessMap
if TYPE_CHECKING:
from psyclone.lfric import LFRicKernelArgument
from psyclone.domain.lfric.arg_ordering import ArgOrdering
from psyclone.domain.lfric.lfric_constants import LFRicConstants
from psyclone.errors import InternalError
Expand Down Expand Up @@ -133,6 +135,34 @@ def cma_operator(self, arg, var_accesses=None):
_local_args += [bandwidth, alpha, beta, gamma_m, gamma_p]
self.extend(_local_args, var_accesses)

def scalar(self,
scalar_arg: 'LFRicKernelArgument',
var_accesses: Optional[VariablesAccessMap] = None):
'''Add the name associated with the scalar argument to the argument
list and optionally add this scalar to the variable access
information.

:param scalar_arg: the kernel argument.
:param var_accesses: optional VariablesAccessMap instance that
stores information about variable accesses.

:raises InternalError: if the argument is not a recognised scalar type.

'''
const = LFRicConstants()
if not (scalar_arg.is_scalar or scalar_arg.is_scalar_array):
raise InternalError(
f"Expected argument type to be one of "
f"{const.VALID_SCALAR_NAMES + const.VALID_ARRAY_NAMES}"
f" but got '{scalar_arg.argument_type}'")

if scalar_arg.is_scalar:
self.append(scalar_arg.name, var_accesses)
else:
# ScalarArray
self.append("dims_" + scalar_arg.name, var_accesses)
self.append(scalar_arg.name, var_accesses)

def field_vector(self, argvect, var_accesses=None):
'''Add the field vector associated with the argument 'argvect' to the
argument list. If supplied it also stores these accesses to the
Expand Down
11 changes: 8 additions & 3 deletions src/psyclone/domain/lfric/lfric_invoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
# POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
# Authors R. W. Ford, A. R. Porter and S. Siso, STFC Daresbury Lab
# Modified I. Kavcic, A. Coughtrie, L. Turner and O. Brunt, Met Office
# Modified I. Kavcic, A. Coughtrie, L. Turner, O. Brunt
# and A. Pirrie, Met Office
# Modified J. Henrichs, Bureau of Meteorology
# Modified A. B. G. Chalk and N. Nobre, STFC Daresbury Lab

Expand Down Expand Up @@ -93,10 +94,13 @@ def __init__(self, alg_invocation, idx, invokes):
from psyclone.domain.lfric import (
LFRicCellIterators, LFRicHaloDepths, LFRicLoopBounds,
LFRicRunTimeChecks,
LFRicScalarArgs, LFRicFields, LFRicDofmaps, LFRicStencils)
LFRicScalarArgs, LFRicScalarArrayArgs, LFRicFields, LFRicDofmaps,
LFRicStencils)

self.scalar_args = LFRicScalarArgs(self)

self.scalar_array_args = LFRicScalarArrayArgs(self)

# Initialise our Invoke stencil information
self.stencil = LFRicStencils(self)

Expand Down Expand Up @@ -274,7 +278,8 @@ def setup_psy_layer_symbols(self):

'''
# Declare all quantities required by this PSy routine (Invoke)
for entities in [self.scalar_args, self.fields, self.lma_ops,
for entities in [self.scalar_args, self. scalar_array_args,
self.fields, self.lma_ops,
self.stencil, self.meshes,
self.function_spaces, self.dofmaps, self.cma_ops,
self.boundary_conditions, self.evaluators,
Expand Down
18 changes: 12 additions & 6 deletions src/psyclone/domain/lfric/lfric_kern.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
# POSSIBILITY OF SUCH DAMAGE.
# -----------------------------------------------------------------------------
# Authors R. W. Ford, A. R. Porter and S. Siso, STFC Daresbury Lab
# Modified I. Kavcic, A. Coughtrie, L. Turner and O. Brunt, Met Office
# Modified I. Kavcic, A. Coughtrie, L. Turner, O. Brunt
# and A. Pirrie, Met Office
# Modified J. Henrichs, Bureau of Meteorology
# Modified A. B. G. Chalk and N. Nobre, STFC Daresbury Lab

Expand Down Expand Up @@ -196,7 +197,8 @@ def load_meta(self, ktype):
elif descriptor.argument_type.lower() == "gh_field":
pre = "field_"
elif (descriptor.argument_type.lower() in
const.VALID_SCALAR_NAMES):
(const.VALID_SCALAR_NAMES +
const.VALID_ARRAY_NAMES)):
if descriptor.data_type.lower() == "gh_real":
pre = "rscalar_"
elif descriptor.data_type.lower() == "gh_integer":
Expand All @@ -208,6 +210,9 @@ def load_meta(self, ktype):
f"Expected one of {const.VALID_SCALAR_DATA_TYPES} "
f"data types for a scalar argument but found "
f"'{descriptor.data_type}'.")
if (descriptor.argument_type.lower() in
const.VALID_ARRAY_NAMES):
pre += "array_"
else:
raise GenerationError(
f"LFRicKern.load_meta() expected one of "
Expand Down Expand Up @@ -773,15 +778,16 @@ def gen_stub(self) -> Container:
# Import here to avoid circular dependency
# pylint: disable=import-outside-toplevel
from psyclone.domain.lfric import (
LFRicCellIterators, LFRicScalarArgs, LFRicFields,
LFRicDofmaps, LFRicStencils)
LFRicCellIterators, LFRicScalarArgs, LFRicScalarArrayArgs,
LFRicFields, LFRicDofmaps, LFRicStencils)
from psyclone.lfric import (
LFRicFunctionSpaces, LFRicCMAOperators, LFRicBoundaryConditions,
LFRicLMAOperators, LFRicMeshProperties, LFRicBasisFunctions,
LFRicReferenceElement)
for entities in [LFRicCellIterators, LFRicDofmaps, LFRicFunctionSpaces,
LFRicCMAOperators, LFRicScalarArgs, LFRicFields,
LFRicLMAOperators, LFRicStencils, LFRicBasisFunctions,
LFRicCMAOperators, LFRicScalarArgs,
LFRicScalarArrayArgs, LFRicFields, LFRicLMAOperators,
LFRicStencils, LFRicBasisFunctions,
LFRicBoundaryConditions, LFRicReferenceElement,
LFRicMeshProperties]:
entities(self).stub_declarations()
Expand Down
2 changes: 1 addition & 1 deletion src/psyclone/domain/lfric/lfric_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def _halo_read_access(self, arg):

'''
const = LFRicConstants()
if arg.is_scalar or arg.is_operator:
if arg.is_scalar or arg.is_operator or arg.is_scalar_array:
# Scalars and operators do not have halos
return False
if arg.is_field:
Expand Down
Loading
Loading