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
- 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:
function_space (
psyclone.domain.lfric.FunctionSpace
) – the function space for which to provide the basis functionsvar_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- 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:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the CMA operator argument.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- 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:
function_space (
psyclone.domain.lfric.FunctionSpace
) – the function space for which the differential basis functions are required.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- 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:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the field to be added.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- 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:
function_space (
psyclone.domain.lfric.FunctionSpace
) – the function space for which boundary dofs are required.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- 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:
argvect (
psyclone.dynamo0p3.DynKernelArgument
) – the field vector to add.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- 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:
function_space (
psyclone.domain.lfric.FunctionSpace
) – the function space for which the compulsory arguments are added.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- 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:
function_space (
psyclone.domain.lfric.FunctionSpace
) – the function space for which the indirect dofmap is required.operator (
psyclone.dynamo0p3.DynKernelArgument
) – the CMA operator.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- Raises:
InternalError – if no kernel argument is supplied.
InternalError – if the supplied kernel argument is not a CMA operator.
- 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:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the meta-data description of the operator.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- 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:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the meta-data description of the kernel argument with which the stencil is associated.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- 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:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the meta-data description of the kernel argument with which the stencil is associated.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- 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:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the kernel argument with which the stencil is associated.var_accesses (
psyclone.core.SingleVariableAccessInfo
) – optional SingleVariableAccessInfo instance to store the information about variable accesses.
- 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:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the kernel argument with which the stencil is associated.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- 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:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the kernel argument with which the stencil is associated.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.
- 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:
arg (
psyclone.dynamo0p3.DynKernelArgument
) – the kernel argument with which the stencil is associated.var_accesses (
psyclone.core.VariablesAccessInfo
) – optional VariablesAccessInfo instance to store the information about variable accesses.