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)

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)

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:
Raises:

InternalError – if the evaluator shape is not recognised.

cell_position(var_accesses=None)

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

Parameters:

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

cma_operator(arg, var_accesses=None)

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)

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

Parameters:
Raises:

InternalError – if the evaluator shape is not recognised.

field(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.

Parameters:
field_bcs_kernel(function_space, var_accesses=None)

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

Parameters:
field_vector(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.

Parameters:
fs_compulsory_field(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.

Parameters:
indirection_dofmap(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.

Parameters:
Raises:
mesh_height(var_accesses=None)

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

Parameters:

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

mesh_properties(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.

Parameters:

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

operator(arg, var_accesses=None)

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)

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.dynamo3.FunctionSpace) – the ‘to’ function space of the operator.

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

quad_rule(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.

Parameters:

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

stencil(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.

Parameters:
stencil_2d(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.

Parameters:
stencil_2d_max_extent(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.

Parameters:
stencil_2d_unknown_extent(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.

Parameters:
stencil_unknown_direction(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.

Parameters:
stencil_unknown_extent(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.

Parameters: