Reference Guide  2.5.0
psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList Class Reference
Inheritance diagram for psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList:
Collaboration diagram for psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList:

Public Member Functions

def __init__ (self, kern)
 
def cell_position (self, var_accesses=None)
 
def mesh_height (self, var_accesses=None)
 
def cma_operator (self, arg, var_accesses=None)
 
def field_vector (self, argvect, var_accesses=None)
 
def field (self, arg, var_accesses=None)
 
def stencil_unknown_extent (self, arg, var_accesses=None)
 
def stencil_unknown_direction (self, arg, var_accesses=None)
 
def stencil (self, arg, var_accesses=None)
 
def stencil_2d_max_extent (self, arg, var_accesses=None)
 
def stencil_2d_unknown_extent (self, arg, var_accesses=None)
 
def stencil_2d (self, arg, var_accesses=None)
 
def operator (self, arg, var_accesses=None)
 
def fs_compulsory_field (self, function_space, var_accesses=None)
 
def basis (self, function_space, var_accesses=None)
 
def diff_basis (self, function_space, var_accesses=None)
 
def field_bcs_kernel (self, function_space, var_accesses=None)
 
def operator_bcs_kernel (self, function_space, var_accesses=None)
 
def mesh_properties (self, var_accesses=None)
 
def quad_rule (self, var_accesses=None)
 
def indirection_dofmap (self, function_space, operator=None, var_accesses=None)
 
- Public Member Functions inherited from psyclone.domain.lfric.arg_ordering.ArgOrdering
def psyir_append (self, node)
 
def append (self, var_name, var_accesses=None, var_access_name=None, mode=AccessType.READ, metadata_posn=None)
 
def extend (self, list_var_name, var_accesses=None, mode=AccessType.READ, list_metadata_posn=None)
 
def append_integer_reference (self, name, tag=None)
 
def get_array_reference (self, array_name, indices, intrinsic_type, tag=None, symbol=None)
 
def append_array_reference (self, array_name, indices, intrinsic_type, tag=None, symbol=None)
 
def num_args (self)
 
def arglist (self)
 
def psyir_arglist (self)
 
def metadata_index_from_actual_index (self, idx)
 
def generate (self, var_accesses=None)
 
def cell_map (self, var_accesses=None)
 
def scalar (self, scalar_arg, var_accesses=None)
 
def fs_common (self, function_space, var_accesses=None)
 
def fs_intergrid (self, function_space, var_accesses=None)
 
def banded_dofmap (self, function_space, var_accesses=None)
 
def ref_element_properties (self, var_accesses=None)
 

Detailed Description

Creates the argument list required to create and declare the
required arguments for a kernel subroutine.  The ordering and type
of the arguments is captured by the base class.

:param kern: Kernel for which to create argument list.
:type kern: :py:class:`psyclone.domain.lfric.LFRicKern`

:raises NotImplementedError: if the kernel is inter-grid.
:raises NotImplementedError: if the kernel requires properties of the \
                             reference element.

Definition at line 46 of file kern_stub_arg_list.py.

Member Function Documentation

◆ basis()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.basis (   self,
  function_space,
  var_accesses = None 
)
Add basis function information for this function space to the
argument list and optionally to the variable access information.
There can be more than one if this is an evaluator and/or multiple
'gh_shape's have been requested in the kernel metadata. If supplied
it also stores these accesses in var_accesses.

:param function_space: the function space for which to provide \
                       the basis functions
:type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

:raises InternalError: if the evaluator shape is not recognised.

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 331 of file kern_stub_arg_list.py.

331  def basis(self, function_space, var_accesses=None):
332  '''Add basis function information for this function space to the
333  argument list and optionally to the variable access information.
334  There can be more than one if this is an evaluator and/or multiple
335  'gh_shape's have been requested in the kernel metadata. If supplied
336  it also stores these accesses in var_accesses.
337 
338  :param function_space: the function space for which to provide \
339  the basis functions
340  :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
341  :param var_accesses: optional VariablesAccessInfo instance to store \
342  the information about variable accesses.
343  :type var_accesses: \
344  :py:class:`psyclone.core.VariablesAccessInfo`
345 
346  :raises InternalError: if the evaluator shape is not recognised.
347 
348  '''
349  const = LFRicConstants()
350  for shape in self._kern.eval_shapes:
351  if shape in const.VALID_QUADRATURE_SHAPES:
352  # A kernel stub won't have a name for the corresponding
353  # quadrature argument so we create one by appending the last
354  # part of the shape name to "qr_".
355  basis_name = function_space.get_basis_name(
356  qr_var="qr_"+shape.split("_")[-1])
357  self.append(basis_name, var_accesses)
358 
359  elif shape in const.VALID_EVALUATOR_SHAPES:
360  # Need a basis array for each target space upon which the basis
361  # functions have been evaluated. _kern.eval_targets is a dict
362  # where the values are 2-tuples of (FunctionSpace, argument).
363  for _, target in self._kern.eval_targets.items():
364  basis_name = \
365  function_space.get_basis_name(on_space=target[0])
366  self.append(basis_name, var_accesses)
367  else:
368  raise InternalError(
369  f"Unrecognised evaluator shape ('{shape}'). Expected one "
370  f"of: {const.VALID_EVALUATOR_SHAPES}")
371 

References psyclone.domain.common.psylayer.psyloop.PSyLoop._kern, psyclone.domain.lfric.arg_ordering.ArgOrdering._kern, psyclone.domain.lfric.lfric_loop.LFRicLoop._kern, psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cell_position()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.cell_position (   self,
  var_accesses = None 
)
Adds a cell argument to the argument list and if supplied stores
this access in var_accesses.

:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 67 of file kern_stub_arg_list.py.

67  def cell_position(self, var_accesses=None):
68  '''Adds a cell argument to the argument list and if supplied stores
69  this access in var_accesses.
70 
71  :param var_accesses: optional VariablesAccessInfo instance to store \
72  the information about variable accesses.
73  :type var_accesses: \
74  :py:class:`psyclone.core.VariablesAccessInfo`
75 
76  '''
77  self.append("cell", var_accesses)
78 

References psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cma_operator()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.cma_operator (   self,
  arg,
  var_accesses = None 
)
Add the CMA operator and associated scalars to the argument
list and optionally add them to the variable access
information.

:param arg: the CMA operator argument.
:type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 103 of file kern_stub_arg_list.py.

103  def cma_operator(self, arg, var_accesses=None):
104  '''Add the CMA operator and associated scalars to the argument
105  list and optionally add them to the variable access
106  information.
107 
108  :param arg: the CMA operator argument.
109  :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
110  :param var_accesses: optional VariablesAccessInfo instance to store \
111  the information about variable accesses.
112  :type var_accesses: \
113  :py:class:`psyclone.core.VariablesAccessInfo`
114 
115  '''
116  # The CMA operator itself
117  self.append(arg.name, var_accesses)
118  # Associated scalar parameters
119  nrow = arg.name + "_nrow"
120  _local_args = [nrow]
121  if arg.function_space_to.orig_name != \
122  arg.function_space_from.orig_name:
123  # If the to- and from-spaces are different then so are ncol and
124  # nrow so we pass both of them. If they are the same then we
125  # could pass either but choose to pass nrow and not ncol.
126  ncol = arg.name + "_ncol"
127  _local_args.append(ncol)
128  bandwidth = arg.name + "_bandwidth"
129  alpha = arg.name + "_alpha"
130  beta = arg.name + "_beta"
131  gamma_m = arg.name + "_gamma_m"
132  gamma_p = arg.name + "_gamma_p"
133  _local_args += [bandwidth, alpha, beta, gamma_m, gamma_p]
134  self.extend(_local_args, var_accesses)
135 

References psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), psyclone.domain.lfric.arg_ordering.ArgOrdering.append(), psyclone.psyir.nodes.node.ChildrenList.extend(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.extend().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ diff_basis()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.diff_basis (   self,
  function_space,
  var_accesses = None 
)
Add differential basis information for the function space to the
argument list. If supplied it also stores this access in
var_accesses.

:param function_space: the function space for which the differential \
    basis functions are required.
:type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

:raises InternalError: if the evaluator shape is not recognised.

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 372 of file kern_stub_arg_list.py.

372  def diff_basis(self, function_space, var_accesses=None):
373  '''Add differential basis information for the function space to the
374  argument list. If supplied it also stores this access in
375  var_accesses.
376 
377  :param function_space: the function space for which the differential \
378  basis functions are required.
379  :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
380  :param var_accesses: optional VariablesAccessInfo instance to store \
381  the information about variable accesses.
382  :type var_accesses: \
383  :py:class:`psyclone.core.VariablesAccessInfo`
384 
385  :raises InternalError: if the evaluator shape is not recognised.
386 
387  '''
388  const = LFRicConstants()
389  for shape in self._kern.eval_shapes:
390  if shape in const.VALID_QUADRATURE_SHAPES:
391  # We need differential basis functions for quadrature. A
392  # kernel stub won't have a name for the corresponding
393  # quadrature argument so we create one by appending the
394  # last part of the shape name to "qr_".
395  diff_basis_name = function_space.get_diff_basis_name(
396  qr_var="qr_"+shape.split("_")[-1])
397  self.append(diff_basis_name, var_accesses)
398 
399  elif shape in const.VALID_EVALUATOR_SHAPES:
400  # We need differential basis functions for an evaluator,
401  # potentially for multiple target spaces. _kern.eval_targets is
402  # a dict where the values are 2-tuples of
403  # (FunctionSpace, argument).
404  for _, target in self._kern.eval_targets.items():
405  diff_basis_name = function_space.get_diff_basis_name(
406  on_space=target[0])
407  self.append(diff_basis_name, var_accesses)
408  else:
409  raise InternalError(f"Unrecognised evaluator shape "
410  f"('{shape}'). Expected one of: "
411  f"{const.VALID_EVALUATOR_SHAPES}")
412 

References psyclone.domain.common.psylayer.psyloop.PSyLoop._kern, psyclone.domain.lfric.arg_ordering.ArgOrdering._kern, psyclone.domain.lfric.lfric_loop.LFRicLoop._kern, psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ field()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.field (   self,
  arg,
  var_accesses = None 
)
Add the field array associated with the argument 'arg' to the
argument list. If supplied it also stores this access in var_accesses.

:param arg: the field to be added.
:type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 158 of file kern_stub_arg_list.py.

158  def field(self, arg, var_accesses=None):
159  '''Add the field array associated with the argument 'arg' to the
160  argument list. If supplied it also stores this access in var_accesses.
161 
162  :param arg: the field to be added.
163  :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
164  :param var_accesses: optional VariablesAccessInfo instance to store \
165  the information about variable accesses.
166  :type var_accesses: \
167  :py:class:`psyclone.core.VariablesAccessInfo`
168 
169  '''
170  text = arg.name + "_" + arg.function_space.mangled_name
171  self.append(text, var_accesses, mode=arg.access)
172 

References psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ field_bcs_kernel()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.field_bcs_kernel (   self,
  function_space,
  var_accesses = None 
)
Implement the boundary_dofs array fix for a field. If supplied it
also stores this access in var_accesses.

:param function_space: the function space for which boundary dofs \
    are required.
:type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 413 of file kern_stub_arg_list.py.

413  def field_bcs_kernel(self, function_space, var_accesses=None):
414  '''Implement the boundary_dofs array fix for a field. If supplied it
415  also stores this access in var_accesses.
416 
417  :param function_space: the function space for which boundary dofs \
418  are required.
419  :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
420  :param var_accesses: optional VariablesAccessInfo instance to store \
421  the information about variable accesses.
422  :type var_accesses: \
423  :py:class:`psyclone.core.VariablesAccessInfo`
424 
425  '''
426  arg = self._kern.arguments.get_arg_on_space(function_space)
427  name = "boundary_dofs_"+arg.name
428  self.append(name, var_accesses)
429 

References psyclone.domain.common.psylayer.psyloop.PSyLoop._kern, psyclone.domain.lfric.arg_ordering.ArgOrdering._kern, psyclone.domain.lfric.lfric_loop.LFRicLoop._kern, psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ field_vector()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.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
var_access object.

:param argvect: the field vector to add.
:type argvect: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 136 of file kern_stub_arg_list.py.

136  def field_vector(self, argvect, var_accesses=None):
137  '''Add the field vector associated with the argument 'argvect' to the
138  argument list. If supplied it also stores these accesses to the
139  var_access object.
140 
141  :param argvect: the field vector to add.
142  :type argvect: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
143  :param var_accesses: optional VariablesAccessInfo instance to store \
144  the information about variable accesses.
145  :type var_accesses: \
146  :py:class:`psyclone.core.VariablesAccessInfo`
147 
148  '''
149  # the range function below returns values from
150  # 1 to the vector size which is what we
151  # require in our Fortran code
152  for idx in range(1, argvect.vector_size+1):
153  text = (argvect.name + "_" +
154  argvect.function_space.mangled_name +
155  "_v" + str(idx))
156  self.append(text, var_accesses)
157 

References psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fs_compulsory_field()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.fs_compulsory_field (   self,
  function_space,
  var_accesses = None 
)
 Provide compulsory arguments if there is a field on this
function space. If supplied it also stores this access in
var_accesses.

:param function_space: the function space for which the compulsory \
    arguments are added.
:type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 314 of file kern_stub_arg_list.py.

314  def fs_compulsory_field(self, function_space, var_accesses=None):
315  ''' Provide compulsory arguments if there is a field on this
316  function space. If supplied it also stores this access in
317  var_accesses.
318 
319  :param function_space: the function space for which the compulsory \
320  arguments are added.
321  :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
322  :param var_accesses: optional VariablesAccessInfo instance to store \
323  the information about variable accesses.
324  :type var_accesses: \
325  :py:class:`psyclone.core.VariablesAccessInfo`
326 
327  '''
328  self.append(function_space.undf_name, var_accesses)
329  self.append(function_space.map_name, var_accesses)
330 

References psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ indirection_dofmap()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.indirection_dofmap (   self,
  function_space,
  operator = None,
  var_accesses = None 
)
Add indirection dofmap required when applying a CMA operator. If
supplied it also stores this access in var_accesses.

:param function_space: the function space for which the indirect \
    dofmap is required.
:type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
:param operator: the CMA operator.
:type operator: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

:raises InternalError: if no kernel argument is supplied.
:raises InternalError: if the supplied kernel argument is not a \
    CMA operator.

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 477 of file kern_stub_arg_list.py.

478  var_accesses=None):
479  '''Add indirection dofmap required when applying a CMA operator. If
480  supplied it also stores this access in var_accesses.
481 
482  :param function_space: the function space for which the indirect \
483  dofmap is required.
484  :type function_space: :py:class:`psyclone.domain.lfric.FunctionSpace`
485  :param operator: the CMA operator.
486  :type operator: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
487  :param var_accesses: optional VariablesAccessInfo instance to store \
488  the information about variable accesses.
489  :type var_accesses: \
490  :py:class:`psyclone.core.VariablesAccessInfo`
491 
492  :raises InternalError: if no kernel argument is supplied.
493  :raises InternalError: if the supplied kernel argument is not a \
494  CMA operator.
495 
496  '''
497  if not operator:
498  raise InternalError("No CMA operator supplied.")
499  if operator.argument_type != "gh_columnwise_operator":
500  raise InternalError(
501  f"A CMA operator (gh_columnwise_operator) must "
502  f"be supplied but got '{operator.argument_type}'.")
503  super().indirection_dofmap(function_space, operator, var_accesses)
504 
505 
506 # ============================================================================
507 # For automatic documentation creation:
Here is the caller graph for this function:

◆ mesh_height()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.mesh_height (   self,
  var_accesses = None 
)
Add mesh height (nlayers) to the argument list and if supplied
stores this access in var_accesses.

:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 79 of file kern_stub_arg_list.py.

79  def mesh_height(self, var_accesses=None):
80  '''Add mesh height (nlayers) to the argument list and if supplied
81  stores this access in var_accesses.
82 
83  :param var_accesses: optional VariablesAccessInfo instance to store \
84  the information about variable accesses.
85  :type var_accesses: \
86  :py:class:`psyclone.core.VariablesAccessInfo`
87 
88  '''
89  self.append("nlayers", var_accesses)
90 

References psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mesh_properties()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.mesh_properties (   self,
  var_accesses = None 
)
Provide the kernel arguments required for the mesh properties
specified in the kernel metadata. If supplied it also stores this
access in var_accesses.

:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 445 of file kern_stub_arg_list.py.

445  def mesh_properties(self, var_accesses=None):
446  '''Provide the kernel arguments required for the mesh properties
447  specified in the kernel metadata. If supplied it also stores this
448  access in var_accesses.
449 
450  :param var_accesses: optional VariablesAccessInfo instance to store \
451  the information about variable accesses.
452  :type var_accesses: \
453  :py:class:`psyclone.core.VariablesAccessInfo`
454 
455  '''
456  if self._kern.mesh.properties:
457  # Avoid circular import
458  # pylint: disable=import-outside-toplevel
459  from psyclone.dynamo0p3 import LFRicMeshProperties
460  self.extend(LFRicMeshProperties(self._kern).
461  kern_args(stub=True, var_accesses=var_accesses))
462 

References psyclone.domain.common.psylayer.psyloop.PSyLoop._kern, psyclone.domain.lfric.arg_ordering.ArgOrdering._kern, psyclone.domain.lfric.lfric_loop.LFRicLoop._kern, psyclone.psyir.nodes.node.ChildrenList.extend(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.extend().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.operator (   self,
  arg,
  var_accesses = None 
)
Add the operator arguments to the argument list. If supplied it
also stores this access in var_accesses.

:param arg: the meta-data description of the operator.
:type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 298 of file kern_stub_arg_list.py.

298  def operator(self, arg, var_accesses=None):
299  '''Add the operator arguments to the argument list. If supplied it
300  also stores this access in var_accesses.
301 
302  :param arg: the meta-data description of the operator.
303  :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
304  :param var_accesses: optional VariablesAccessInfo instance to store \
305  the information about variable accesses.
306  :type var_accesses: \
307  :py:class:`psyclone.core.VariablesAccessInfo`
308 
309  '''
310  size = arg.name + "_ncell_3d"
311  self.append(size, var_accesses)
312  self.append(arg.name, var_accesses)
313 

References psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator_bcs_kernel()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.operator_bcs_kernel (   self,
  function_space,
  var_accesses = None 
)
Supply necessary additional arguments for the kernel that
applies boundary conditions to a LMA operator. If supplied it
also stores this access in var_accesses.

:param function_space: the 'to' function space of the operator.
:type function_space: :py:class:`psyclone.dynamo3.FunctionSpace`
:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 430 of file kern_stub_arg_list.py.

430  def operator_bcs_kernel(self, function_space, var_accesses=None):
431  '''Supply necessary additional arguments for the kernel that
432  applies boundary conditions to a LMA operator. If supplied it
433  also stores this access in var_accesses.
434 
435  :param function_space: the 'to' function space of the operator.
436  :type function_space: :py:class:`psyclone.dynamo3.FunctionSpace`
437  :param var_accesses: optional VariablesAccessInfo instance to store \
438  the information about variable accesses.
439  :type var_accesses: \
440  :py:class:`psyclone.core.VariablesAccessInfo`
441 
442  '''
443  self.field_bcs_kernel(function_space, var_accesses=var_accesses)
444 

References psyclone.domain.lfric.arg_ordering.ArgOrdering.field_bcs_kernel(), psyclone.domain.lfric.kern_call_arg_list.KernCallArgList.field_bcs_kernel(), psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.field_bcs_kernel(), and psyclone.domain.lfric.kernel_interface.KernelInterface.field_bcs_kernel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ quad_rule()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.quad_rule (   self,
  var_accesses = None 
)
Add quadrature-related information to the kernel argument list.
Adds the necessary arguments to the argument list, and optionally
adds variable access information to the var_accesses object.

:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 463 of file kern_stub_arg_list.py.

463  def quad_rule(self, var_accesses=None):
464  '''Add quadrature-related information to the kernel argument list.
465  Adds the necessary arguments to the argument list, and optionally
466  adds variable access information to the var_accesses object.
467 
468  :param var_accesses: optional VariablesAccessInfo instance to store \
469  the information about variable accesses.
470  :type var_accesses: \
471  :py:class:`psyclone.core.VariablesAccessInfo`
472 
473  '''
474  for rule in self._kern.qr_rules.values():
475  self.extend(rule.kernel_args, var_accesses)
476 

References psyclone.domain.common.psylayer.psyloop.PSyLoop._kern, psyclone.domain.lfric.arg_ordering.ArgOrdering._kern, psyclone.domain.lfric.lfric_loop.LFRicLoop._kern, psyclone.psyir.nodes.node.ChildrenList.extend(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.extend().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stencil()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.stencil (   self,
  arg,
  var_accesses = None 
)
Add general stencil information associated with the argument 'arg'
to the argument list. If supplied it also stores this access in
var_accesses.

:param arg: the meta-data description of the kernel \
    argument with which the stencil is associated.
:type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 211 of file kern_stub_arg_list.py.

211  def stencil(self, arg, var_accesses=None):
212  '''Add general stencil information associated with the argument 'arg'
213  to the argument list. If supplied it also stores this access in
214  var_accesses.
215 
216  :param arg: the meta-data description of the kernel \
217  argument with which the stencil is associated.
218  :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
219  :param var_accesses: optional VariablesAccessInfo instance to store \
220  the information about variable accesses.
221  :type var_accesses: \
222  :py:class:`psyclone.core.VariablesAccessInfo`
223 
224  '''
225  # Import here to avoid circular dependency
226  # pylint: disable=import-outside-toplevel
227  from psyclone.domain.lfric.lfric_stencils import LFRicStencils
228  var_name = LFRicStencils.dofmap_symbol(self._stub_symtab, arg).name
229  self.append(var_name, var_accesses)
230 

References psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList._stub_symtab, psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stencil_2d()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.stencil_2d (   self,
  arg,
  var_accesses = None 
)
Add general 2D stencil information associated with the argument
'arg' to the argument list. If supplied it also stores this access in
var_accesses.

:param arg: the meta-data description of the kernel \
    argument with which the stencil is associated.
:type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
:param var_accesses: optional `VariablesAccessInfo` instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 271 of file kern_stub_arg_list.py.

271  def stencil_2d(self, arg, var_accesses=None):
272  '''Add general 2D stencil information associated with the argument
273  'arg' to the argument list. If supplied it also stores this access in
274  var_accesses.
275 
276  :param arg: the meta-data description of the kernel \
277  argument with which the stencil is associated.
278  :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
279  :param var_accesses: optional `VariablesAccessInfo` instance to store \
280  the information about variable accesses.
281  :type var_accesses: \
282  :py:class:`psyclone.core.VariablesAccessInfo`
283 
284  '''
285  # The stencil_2D differs from the stencil in that the direction
286  # of the branch is baked into the stencil_dofmap array.
287  # The array dimensions are thus (dof_in_cell, cell_in_branch,
288  # branch_in_stencil) where the branch_in_stencil is always ordered
289  # West, South, East, North which is standard in LFRic. This allows
290  # for knowledge of what direction a stencil cell is in relation
291  # to the centre even when the stencil is truncated at boundaries.
292  # Import here to avoid circular dependency
293  # pylint: disable=import-outside-toplevel
294  from psyclone.domain.lfric.lfric_stencils import LFRicStencils
295  var_name = LFRicStencils.dofmap_symbol(self._stub_symtab, arg).name
296  self.append(var_name, var_accesses)
297 

References psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList._stub_symtab, psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stencil_2d_max_extent()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.stencil_2d_max_extent (   self,
  arg,
  var_accesses = None 
)
Add the maximum branch extent for a 2D stencil associated with the
argument 'arg' to the argument list. If supplied it also stores this
in var_accesses.

:param arg: the kernel argument with which the stencil is associated.
:type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
:param var_accesses: optional `SingleVariableAccessInfo` \
    instance to store the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.SingleVariableAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 231 of file kern_stub_arg_list.py.

231  def stencil_2d_max_extent(self, arg, var_accesses=None):
232  '''Add the maximum branch extent for a 2D stencil associated with the
233  argument 'arg' to the argument list. If supplied it also stores this
234  in var_accesses.
235 
236  :param arg: the kernel argument with which the stencil is associated.
237  :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
238  :param var_accesses: optional `SingleVariableAccessInfo` \
239  instance to store the information about variable accesses.
240  :type var_accesses: \
241  :py:class:`psyclone.core.SingleVariableAccessInfo`
242 
243  '''
244  # The maximum branch extent is not specified in the metadata so pass
245  # the value in.
246  # Import here to avoid circular dependency
247  # pylint: disable=import-outside-toplevel
248  from psyclone.domain.lfric.lfric_stencils import LFRicStencils
249  name = LFRicStencils.max_branch_length_name(self._stub_symtab, arg)
250  self.append(name, var_accesses)
251 

References psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList._stub_symtab, psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stencil_2d_unknown_extent()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.stencil_2d_unknown_extent (   self,
  arg,
  var_accesses = None 
)
Add 2D stencil information to the argument list associated with the
argument 'arg' if the extent is unknown. If supplied it also stores
this access in var_accesses.

:param arg: the kernel argument with which the stencil is associated.
:type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
:param var_accesses: optional `VariablesAccessInfo` instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 252 of file kern_stub_arg_list.py.

252  def stencil_2d_unknown_extent(self, arg, var_accesses=None):
253  '''Add 2D stencil information to the argument list associated with the
254  argument 'arg' if the extent is unknown. If supplied it also stores
255  this access in var_accesses.
256 
257  :param arg: the kernel argument with which the stencil is associated.
258  :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
259  :param var_accesses: optional `VariablesAccessInfo` instance to store \
260  the information about variable accesses.
261  :type var_accesses: \
262  :py:class:`psyclone.core.VariablesAccessInfo`
263 
264  '''
265  # Import here to avoid circular dependency
266  # pylint: disable=import-outside-toplevel
267  from psyclone.domain.lfric.lfric_stencils import LFRicStencils
268  name = LFRicStencils.dofmap_size_symbol(self._stub_symtab, arg).name
269  self.append(name, var_accesses)
270 

References psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList._stub_symtab, psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stencil_unknown_direction()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.stencil_unknown_direction (   self,
  arg,
  var_accesses = None 
)
Add stencil information to the argument list associated with the
argument 'arg' if the direction is unknown. If supplied it also stores
this access in var_accesses.

:param arg: the kernel argument with which the stencil is associated.
:type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 192 of file kern_stub_arg_list.py.

192  def stencil_unknown_direction(self, arg, var_accesses=None):
193  '''Add stencil information to the argument list associated with the
194  argument 'arg' if the direction is unknown. If supplied it also stores
195  this access in var_accesses.
196 
197  :param arg: the kernel argument with which the stencil is associated.
198  :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
199  :param var_accesses: optional VariablesAccessInfo instance to store \
200  the information about variable accesses.
201  :type var_accesses: \
202  :py:class:`psyclone.core.VariablesAccessInfo`
203 
204  '''
205  # Import here to avoid circular dependency
206  # pylint: disable=import-outside-toplevel
207  from psyclone.domain.lfric.lfric_stencils import LFRicStencils
208  name = LFRicStencils.direction_name(self._stub_symtab, arg)
209  self.append(name, var_accesses)
210 

References psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList._stub_symtab, psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stencil_unknown_extent()

def psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList.stencil_unknown_extent (   self,
  arg,
  var_accesses = None 
)
Add stencil information to the argument list associated with the
argument 'arg' if the extent is unknown. If supplied it also stores
this access in var_accesses.

:param arg: the kernel argument with which the stencil is associated.
:type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
:param var_accesses: optional VariablesAccessInfo instance to store \
    the information about variable accesses.
:type var_accesses: \
    :py:class:`psyclone.core.VariablesAccessInfo`

Reimplemented from psyclone.domain.lfric.arg_ordering.ArgOrdering.

Definition at line 173 of file kern_stub_arg_list.py.

173  def stencil_unknown_extent(self, arg, var_accesses=None):
174  '''Add stencil information to the argument list associated with the
175  argument 'arg' if the extent is unknown. If supplied it also stores
176  this access in var_accesses.
177 
178  :param arg: the kernel argument with which the stencil is associated.
179  :type arg: :py:class:`psyclone.dynamo0p3.DynKernelArgument`
180  :param var_accesses: optional VariablesAccessInfo instance to store \
181  the information about variable accesses.
182  :type var_accesses: \
183  :py:class:`psyclone.core.VariablesAccessInfo`
184 
185  '''
186  # Import here to avoid circular dependency
187  # pylint: disable=import-outside-toplevel
188  from psyclone.domain.lfric.lfric_stencils import LFRicStencils
189  name = LFRicStencils.dofmap_size_symbol(self._stub_symtab, arg).name
190  self.append(name, var_accesses)
191 

References psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList._stub_symtab, psyclone.psyir.nodes.node.ChildrenList.append(), psyclone.gocean1p0.GOKernelArguments.append(), psyclone.psyGen.Arguments.append(), and psyclone.domain.lfric.arg_ordering.ArgOrdering.append().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: