psyclone.domain.lfric.lfric_collection
This module implements PSyclone LFRic (Dynamo 0.3) API by specialising the base class for managing the declaration and initialisation of a group of related entities within an Invoke or Kernel stub.
Classes
LFRicCollection
: Base class for managing the declaration and initialisation of a
- class psyclone.domain.lfric.lfric_collection.LFRicCollection(node)
Base class for managing the declaration and initialisation of a group of related entities within an Invoke or Kernel stub
- Parameters:
node (
psyclone.domain.lfric.LFRicInvoke
orpsyclone.domain.lfric.LFRicKern
) – the Kernel or Invoke for which to manage variable declarations and initialisation.- Raises:
InternalError – if the supplied node is not an LFRicInvoke or an LFRicKern.
Inheritance
- declarations(parent)
Insert declarations for all necessary variables into the AST of the generated code. Simply calls either ‘_invoke_declarations()’ or ‘_stub_declarations()’ depending on whether we’re handling an Invoke or a Kernel stub.
- Parameters:
parent (
psyclone.f2pygen.SubroutineGen
) – the node in the f2pygen AST representing the routine in which to insert the declarations.- Raises:
InternalError – if neither ‘self._invoke’ nor ‘self._kernel’ are set.
- initialise(parent)
Add code to initialise the entities being managed by this class. We do nothing by default - it is up to the sub-class to override this method if initialisation is required.
- Parameters:
parent (
psyclone.f2pygen.SubroutineGen
) – the node in the f2pygen AST to which to add initialisation code.