psyclone.domain.lfric.lfric_invoke

This module implements the LFRic-specific implementation of the Invoke base class from psyGen.py.

Classes

  • LFRicInvoke: The LFRic-specific Invoke class. This passes the LFRic-specific

class psyclone.domain.lfric.lfric_invoke.LFRicInvoke(alg_invocation, idx, invokes)

The LFRic-specific Invoke class. This passes the LFRic-specific InvokeSchedule class to the base class so it creates the one we require. Also overrides the ‘gen_code’ method so that we generate dynamo specific invocation code.

Parameters:
Raises:

GenerationError – if integer reductions are required in the PSy-layer.

Inheritance

Inheritance diagram of LFRicInvoke
arg_for_funcspace(fspace)

Returns an argument object which is on the requested function space. Searches through all Kernel calls in this Invoke. Currently the first argument object that is found is used. Throws an exception if no argument exists.

Parameters:

fspace (psyclone.domain.lfric.FunctionSpace) – function space of the argument.

Returns:

an argument object which is on the requested function space.

Return type:

psyclone.dynamo0p3.DynKernelArgument

Raises:

GenerationError – if the argument object does not exist.

field_on_space(func_space)

If a field exists on this space for any kernel in this Invoke then return that field. Otherwise return ‘None’.

Parameters:

func_space (psyclone.domain.lfric.FunctionSpace) – the function space for which to find an argument.

gen_code(parent)

Generates LFRic-specific invocation code (the subroutine called by the associated Invoke call in the algorithm layer). This consists of the PSy invocation subroutine and the declaration of its arguments.

Parameters:

parent (psyclone.f2pygen.ModuleGen) – the parent node in the AST (of the code to be generated) to which the node describing the PSy subroutine will be added.

property operates_on_dofs_only
Returns:

whether or not this Invoke consists only of kernels that operate on DoFs.

Return type:

bool

unique_fss()
Returns:

the unique function space objects over all kernel calls in this Invoke.

Return type:

list of psyclone.domain.lfric.FunctionSpace