psyclone.domain.lfric.kern_stub_arg_list#

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

Classes#

  • KernStubArgList: Creates the argument list required to create and declare the

class psyclone.domain.lfric.kern_stub_arg_list.KernStubArgList(kern)[source]#

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.

Parameters:

kern (psyclone.domain.lfric.LFRicKern) – Kernel for which to create argument list.

Raises:
  • NotImplementedError – if the kernel is inter-grid.

  • NotImplementedError – if the kernel requires properties of the reference element.

Inheritance

Inheritance diagram of KernStubArgList
basis(function_space, var_accesses=None)[source]#

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.

Parameters:
  • function_space (psyclone.domain.lfric.FunctionSpace) – the function space for which to provide the basis functions

  • var_accesses (psyclone.core.VariablesAccessMap) – optional VariablesAccessMap instance to store the information about variable accesses.

Raises:

InternalError – if the evaluator shape is not recognised.

cell_position(var_accesses=None)[source]#

Adds a cell argument to the argument list and if supplied stores this access in var_accesses.

Parameters:

var_accesses (psyclone.core.VariablesAccessMap) – optional VariablesAccessMap instance to store the information about variable accesses.

cma_operator(arg, var_accesses=None)[source]#

Add the CMA operator and associated scalars to the argument list and optionally add them to the variable access information.

Parameters:
diff_basis(function_space, var_accesses=None)[source]#

Add differential basis information for the function space to the argument list. If supplied it also stores this access in var_accesses.

Parameters:
  • function_space (psyclone.domain.lfric.FunctionSpace) – the function space for which the differential basis functions are required.

  • var_accesses (psyclone.core.VariablesAccessMap) – optional VariablesAccessMap instance to store the information about variable accesses.

Raises:

InternalError – if the evaluator shape is not recognised.

field(arg, var_accesses=None)[source]#

Add the field array associated with the argument ‘arg’ to the argument list. If supplied it also stores this access in var_accesses.

Parameters:
field_bcs_kernel(function_space, var_accesses=None)[source]#

Implement the boundary_dofs array fix for a field. If supplied it also stores this access in var_accesses.

Parameters:
  • function_space (psyclone.domain.lfric.FunctionSpace) – the function space for which boundary dofs are required.

  • var_accesses (psyclone.core.VariablesAccessMap) – optional VariablesAccessMap instance to store the information about variable accesses.

field_vector(argvect, var_accesses=None)[source]#

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.

Parameters:
fs_compulsory_field(function_space, var_accesses=None)[source]#

Provide compulsory arguments if there is a field on this function space. If supplied it also stores this access in var_accesses.

Parameters:
  • function_space (psyclone.domain.lfric.FunctionSpace) – the function space for which the compulsory arguments are added.

  • var_accesses (psyclone.core.VariablesAccessMap) – optional VariablesAccessMap instance to store the information about variable accesses.

indirection_dofmap(function_space, operator=None, var_accesses=None)[source]#

Add indirection dofmap required when applying a CMA operator. If supplied it also stores this access in var_accesses.

Parameters:
  • function_space (psyclone.domain.lfric.FunctionSpace) – the function space for which the indirect dofmap is required.

  • operator (psyclone.lfric.LFRicKernelArgument) – the CMA operator.

  • var_accesses (Optional[VariablesAccessMap]) – optional VariablesAccessMap instance to store the information about variable accesses.

Raises:
mesh_height(var_accesses=None)[source]#

Add mesh height (nlayers) to the argument list and if supplied stores this access in var_accesses.

Parameters:

var_accesses (psyclone.core.VariablesAccessMap) – optional VariablesAccessMap instance to store the information about variable accesses.

mesh_properties(var_accesses=None)[source]#

Provide the kernel arguments required for the mesh properties specified in the kernel metadata. If supplied it also stores this access in var_accesses.

Parameters:

var_accesses (psyclone.core.VariablesAccessMap) – optional VariablesAccessMap instance to store the information about variable accesses.

operator(arg, var_accesses=None)[source]#

Add the operator arguments to the argument list. If supplied it also stores this access in var_accesses.

Parameters:
operator_bcs_kernel(function_space, var_accesses=None)[source]#

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.

Parameters:
  • function_space (psyclone.lfric.FunctionSpace) – the ‘to’ function space of the operator.

  • var_accesses (psyclone.core.VariablesAccessMap) – optional VariablesAccessMap instance to store the information about variable accesses.

quad_rule(var_accesses=None)[source]#

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.

Parameters:

var_accesses (psyclone.core.VariablesAccessMap) – optional VariablesAccessMap instance to store the information about variable accesses.

scalar(scalar_arg, var_accesses=None)[source]#

Add the name associated with the scalar argument to the argument list and optionally add this scalar to the variable access information.

Parameters:
  • scalar_arg (LFRicKernelArgument) – the kernel argument.

  • var_accesses (Optional[VariablesAccessMap]) – optional VariablesAccessMap instance that stores information about variable accesses.

Raises:

InternalError – if the argument is not a recognised scalar type.

stencil(arg, var_accesses=None)[source]#

Add general stencil information associated with the argument ‘arg’ to the argument list. If supplied it also stores this access in var_accesses.

Parameters:
stencil_2d(arg, var_accesses=None)[source]#

Add general 2D stencil information associated with the argument ‘arg’ to the argument list. If supplied it also stores this access in var_accesses.

Parameters:
stencil_2d_max_extent(arg, var_accesses=None)[source]#

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.

Parameters:
stencil_2d_unknown_extent(arg, var_accesses=None)[source]#

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.

Parameters:
stencil_unknown_direction(arg, var_accesses=None)[source]#

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.

Parameters:
stencil_unknown_extent(arg, var_accesses=None)[source]#

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.

Parameters: