psyclone.domain.lfric.lfric_builtins

This module implements the support for ‘built-in’ operations in the PSyclone LFRic (Dynamo 0.3) API. Each supported built-in is implemented as a different Python class, all inheriting from the LFRicBuiltIn class. The LFRicBuiltInCallFactory creates the Python object required for a given built-in call.

Classes

class psyclone.domain.lfric.lfric_builtins.LFRicBuiltInCallFactory

Creates the necessary framework for a call to an LFRic built-in, This consists of the operation itself and the loop over unique DoFs.

Inheritance

Inheritance diagram of LFRicBuiltInCallFactory
static create(call, parent=None)

Create the objects needed for a call to the built-in described in the call (BuiltInCall) object.

Parameters:
Raises:
  • ParseError – if the name of the function being called is not a recognised built-in.

  • InternalError – if the built-in does not iterate over DoFs.

class psyclone.domain.lfric.lfric_builtins.LFRicBuiltIn

Abstract base class for a node representing a call to an LFRic built-in.

Raises:

NotImplementedError – if a subclass of this abstract class does not set the value of ‘_datatype’.

Inheritance

Inheritance diagram of LFRicBuiltIn
property cma_operation

Built-ins do not perform operations with Column-Matrix-Assembly operators.

Returns:

None

Return type:

NoneType

property fs_descriptors
Returns:

a list of function space descriptor objects which contain information about the function spaces.

Return type:

list of psyclone.dynamo0p3.FSDescriptor

get_dof_loop_index_symbol()

Finds or creates the symbol representing the index in any loops over DoFs.

Returns:

symbol representing the DoF loop index.

Return type:

psyclone.psyir.symbols.DataSymbol

get_indexed_field_argument_references()

Creates a DoF-indexed StructureReference for each of the field arguments to this Built-In kernel. e.g. if the kernel has a field argument named ‘fld1’ then this routine will create an ArrayReference for ‘fld1_data(df)’ where ‘df’ is the DoF-loop variable and ‘fld1_data’ is the pointer to the data array within the fld1 object.

Returns:

a reference to the ‘df’th element of each kernel argument that is a field.

Return type:

List[psyclone.psyir.nodes.ArrayReference]

get_scalar_argument_references()

Finds or creates either a Reference (for a symbol) or PSyIR (for a literal expression) for any scalar arguments to this Built-In kernel.

Returns:

a Reference or PSyIR expression for each scalar kernel argument.

Return type:

list of subclasses of :py:class:`psyclone.psyir.nodes.Node

property is_intergrid

We don’t have any inter-grid built-ins.

Returns:

False

Return type:

bool

load(call, parent=None)

Populate the state of this object using the supplied call object.

Parameters:
abstract static metadata()

Must be overridden by subclass.

property qr_required

Built-ins do not currently require quadrature.

Returns:

False

Return type:

bool

reference_accesses(var_accesses)

Get all variable access information from this node. The assigned-to variable will be set to ‘WRITE’.

Parameters:

var_accesses (psyclone.core.VariablesAccessInfo) – VariablesAccessInfo instance that stores the information about variable accesses.

Raises:

InternalError – if an unsupported argument type is encountered.

property reference_element

Built-ins do not require reference-element properties.

Returns:

None

Return type:

NoneType

property undf_name

Dynamically looks up the name of the ‘undf’ variable for the space that this kernel updates.

Returns:

the name of the undf variable.

Return type:

str

class psyclone.domain.lfric.lfric_builtins.LFRicXPlusYKern

Add one, real-valued, field to another and return the result as a third, real-valued, field.

Inheritance

Inheritance diagram of LFRicXPlusYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This Built-In node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in. Implemented in a datatype-independent way to allow for re-use.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncXPlusYKern

Add the second, real-valued, field to the first field and return it.

Inheritance

Inheritance diagram of LFRicIncXPlusYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicAPlusXKern

Y = a + X where a is a real scalar and X and Y are real-valued fields (DoF-wise addition of a scalar value).

Inheritance

Inheritance diagram of LFRicAPlusXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncAPlusXKern

X = a + X where a is a real scalar and X is a real-valued field (DoF-wise addition of a scalar value).

Inheritance

Inheritance diagram of LFRicIncAPlusXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicAXPlusYKern

Z = a*X + Y where a is a real scalar and Z, X and Y are real-valued fields.

Inheritance

Inheritance diagram of LFRicAXPlusYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncAXPlusYKern

X = a*X + Y where a is a real scalar and X and Y are real-valued fields.

Inheritance

Inheritance diagram of LFRicIncAXPlusYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncXPlusBYKern

X = X + b*Y where b is a real scalar and X and Y are real-valued fields.

Inheritance

Inheritance diagram of LFRicIncXPlusBYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicAXPlusBYKern

Z = a*X + b*Y where a and b are real scalars and Z, X and Y are real-valued fields.

Inheritance

Inheritance diagram of LFRicAXPlusBYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncAXPlusBYKern

X = a*X + b*Y where a and b are real scalars and X and Y are real-valued fields.

Inheritance

Inheritance diagram of LFRicIncAXPlusBYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicAXPlusAYKern

Z = a*X + a*Y = a*(X + Y) where a is a real scalar and Z, X and Y are real-valued fields.

Inheritance

Inheritance diagram of LFRicAXPlusAYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicXMinusYKern

Subtract one, real-valued, field from another and return the result as a third, real-valued, field.

Inheritance

Inheritance diagram of LFRicXMinusYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncXMinusYKern

Subtract the second, real-valued, field from the first field and return it.

Inheritance

Inheritance diagram of LFRicIncXMinusYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicAMinusXKern

Y = a - X where a is a real scalar and X and Y are real-valued fields (DoF-wise subtraction of field elements from a scalar value).

Inheritance

Inheritance diagram of LFRicAMinusXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncAMinusXKern

X = a - X where a is a real scalar and X is a real-valued field (DoF-wise subtraction of field elements from a scalar value).

Inheritance

Inheritance diagram of LFRicIncAMinusXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicXMinusAKern

Y = X - a where a is a real scalar and X and Y are real-valued fields (DoF-wise subtraction of a scalar value from field elements).

Inheritance

Inheritance diagram of LFRicXMinusAKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncXMinusAKern

X = X - a where a is a real scalar and X is a real-valued field (DoF-wise subtraction of a scalar value from field elements).

Inheritance

Inheritance diagram of LFRicIncXMinusAKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicAXMinusYKern

Z = a*X - Y where a is a real scalar and Z, X and Y are real-valued fields.

Inheritance

Inheritance diagram of LFRicAXMinusYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicXMinusBYKern

Z = X - b*Y where b is a real scalar and Z, X and Y are real-valued fields.

Inheritance

Inheritance diagram of LFRicXMinusBYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncXMinusBYKern

X = X - b*Y where b is a real scalar and X and Y are real-valued fields.

Inheritance

Inheritance diagram of LFRicIncXMinusBYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicAXMinusBYKern

Z = a*X - b*Y where a and b are real scalars and Z, X and Y are real-valued fields.

Inheritance

Inheritance diagram of LFRicAXMinusBYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicXTimesYKern

DoF-wise product of one, real-valued, field with another with the result returned as a third, real-valued, field.

Inheritance

Inheritance diagram of LFRicXTimesYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncXTimesYKern

Multiply the first, real-valued, field by the second and return it.

Inheritance

Inheritance diagram of LFRicIncXTimesYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncAXTimesYKern

X = a*X*Y where a is a real scalar and X and Y are real-valued fields.

Inheritance

Inheritance diagram of LFRicIncAXTimesYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicATimesXKern

Multiply the first, real-valued, field by a real scalar and return the result as a second, real-valued, field (Y = a*X).

Inheritance

Inheritance diagram of LFRicATimesXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncATimesXKern

Multiply a real-valued field by a real scalar and return it.

Inheritance

Inheritance diagram of LFRicIncATimesXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicXDividebyYKern

Divide the first, real-valued, field by the second and return the result as a third, real-valued, field.

Inheritance

Inheritance diagram of LFRicXDividebyYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncXDividebyYKern

Divide the first, real-valued, field by the second and return it.

Inheritance

Inheritance diagram of LFRicIncXDividebyYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicXDividebyAKern

Divide a real-valued field by a real scalar and return the result in another, real-valued, field.

Inheritance

Inheritance diagram of LFRicXDividebyAKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncXDividebyAKern

Divide a real-valued field by a real scalar and return it.

Inheritance

Inheritance diagram of LFRicIncXDividebyAKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicADividebyXKern

DoF-wise division of a scalar value a by the elements of a real-valued field, X, storing the result in another, real-valued, field, Y (Y = a/X).

Inheritance

Inheritance diagram of LFRicADividebyXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncADividebyXKern

DoF-wise division of a scalar value a by the elements of a real-valued field, X, storing the result in the same field (X = a/X).

Inheritance

Inheritance diagram of LFRicIncADividebyXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncXPowrealAKern

Raise a real-valued field to a real power and return it.

Inheritance

Inheritance diagram of LFRicIncXPowrealAKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncXPowintNKern

Raise a real-valued field to an integer power and return it.

Inheritance

Inheritance diagram of LFRicIncXPowintNKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicSetvalCKern

Set a real-valued field equal to a real scalar value.

Inheritance

Inheritance diagram of LFRicSetvalCKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicSetvalXKern

Set a real-valued field equal to another, real-valued, field.

Inheritance

Inheritance diagram of LFRicSetvalXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicSetvalRandomKern

Fill a real-valued field with pseudo-random numbers.

Inheritance

Inheritance diagram of LFRicSetvalRandomKern
lower_to_language_level()

Lowers this LFRic built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an IntrinsicCall node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.IntrinsicCall

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicXInnerproductYKern

Calculates the inner product of two real-valued fields, innprod = SUM( X(:)*Y(:) ).

Inheritance

Inheritance diagram of LFRicXInnerproductYKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicXInnerproductXKern

Calculates the inner product of one real-valued field by itself, innprod = SUM( X(:)*X(:) ).

Inheritance

Inheritance diagram of LFRicXInnerproductXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicSumXKern

Computes the sum of the elements of a real-valued field.

Inheritance

Inheritance diagram of LFRicSumXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicSignXKern

Returns the sign of a real-valued field elements using the Fortran intrinsic sign function, Y = sign(a, X).

Inheritance

Inheritance diagram of LFRicSignXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicMaxAXKern

Returns the maximum of a real scalar and real-valued field elements. The result is stored as another, real-valued, field: Y = max(a, X).

Inheritance

Inheritance diagram of LFRicMaxAXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncMaxAXKern

Returns the maximum of a real scalar and real-valued field elements. The result is stored in the same, real-valued, field: X = max(a, X).

Inheritance

Inheritance diagram of LFRicIncMaxAXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicMinAXKern

Returns the minimum of a real scalar and real-valued field elements. The result is stored as another, real-valued, field: Y = min(a, X).

Inheritance

Inheritance diagram of LFRicMinAXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIncMinAXKern

Returns the minimum of a real scalar and real-valued field elements. The result is stored in the same, real-valued, field: X = min(a, X).

Inheritance

Inheritance diagram of LFRicIncMinAXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicRealToIntXKern

Converts real-valued field elements to integer-valued field elements using the Fortran intrinsic INT function, Y = INT(X, kind=i_<prec>). Here Y is an integer-valued field of precision i_<prec> and X is the real-valued field being converted.

Inheritance

Inheritance diagram of LFRicRealToIntXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicRealToRealXKern

Converts real-valued field elements to real-valued field elements of a different precision using the Fortran intrinsic REAL function, Y = REAL(X, kind=r_<prec>). Here Y is a real-valued field of precision kind=r_<prec> and X is the real-valued field whose values are to be converted from their defined precision.

Inheritance

Inheritance diagram of LFRicRealToRealXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata

class psyclone.domain.lfric.lfric_builtins.LFRicIntXPlusYKern

Add corresponding elements of two, integer-valued, fields, X and Y, and return the result as a third, integer-valued, field, Z. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicXPlusYKern.

Inheritance

Inheritance diagram of LFRicIntXPlusYKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntIncXPlusYKern

Add each element of an integer-valued field, X, to the corresponding element of another integer-valued field, Y, and store the result back in X. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicIncXPlusYKern.

Inheritance

Inheritance diagram of LFRicIntIncXPlusYKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntAPlusXKern

Add an integer scalar value, a, to each element of an integer-valued field, X, and return the result as a second, integer-valued, field, Y. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicAPlusXKern.

Inheritance

Inheritance diagram of LFRicIntAPlusXKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntIncAPlusXKern

Add an integer scalar value, a, to each element of an integer-valued field, X, and return the result in the same field. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicIncAPlusXKern.

Inheritance

Inheritance diagram of LFRicIntIncAPlusXKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntXMinusYKern

Subtract each element of an integer-valued field, Y, from the corresponding element of another, integer-valued, field, X, and return the result as a third, integer-valued, field, Z. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicXMinusYKern.

Inheritance

Inheritance diagram of LFRicIntXMinusYKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntIncXMinusYKern

Subtract each element of an integer-valued field, Y, from the corresponding element of another, integer-valued, field, X, and store the result back in X. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicIncXMinusYKern.

Inheritance

Inheritance diagram of LFRicIntIncXMinusYKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntAMinusXKern

Subtract each element of an integer-valued field, X, from an integer scalar value, a, and return the result as a second, integer-valued, field, Y. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicAMinusXKern.

Inheritance

Inheritance diagram of LFRicIntAMinusXKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntIncAMinusXKern

Subtract each element of an integer-valued field, X, from an integer scalar value, a, and return the result in the same field. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicIncAMinusXKern.

Inheritance

Inheritance diagram of LFRicIntIncAMinusXKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntXMinusAKern

Subtract an integer scalar value, a, from each element of an integer-valued field, X, and return the result as a second, integer-valued, field, Y. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicXMinusAKern.

Inheritance

Inheritance diagram of LFRicIntXMinusAKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntIncXMinusAKern

Subtract an integer scalar value, a, from each element of an integer-valued field, X, and return the result in the same field. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicIncXMinusAKern.

Inheritance

Inheritance diagram of LFRicIntIncXMinusAKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntXTimesYKern

Multiply each element of one, integer-valued, field, X, by the corresponding element of another, integer-valued, field, Y, and return the result as a third, integer-valued, field, Z. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicXTimesYKern.

Inheritance

Inheritance diagram of LFRicIntXTimesYKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntIncXTimesYKern

Multiply each element of one, integer-valued, field, X, by the corresponding element of another, integer-valued, field, Y, and store the result back in X. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicIncXTimesYKern.

Inheritance

Inheritance diagram of LFRicIntIncXTimesYKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntATimesXKern

Multiply each element of the first, integer-valued, field, X, by an integer scalar, a, and return the result as a second, integer-valued, field Y (Y = a*X). Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicATimesXKern.

Inheritance

Inheritance diagram of LFRicIntATimesXKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntIncATimesXKern

Multiply each element of an integer-valued field, X by an integer scalar, a, and store the result back in X. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicIncATimesXKern.

Inheritance

Inheritance diagram of LFRicIntIncATimesXKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntSetvalCKern

Assign a single constant integer scalar value, c, to all elements of an integer-valued field, X. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicSetvalCKern.

Inheritance

Inheritance diagram of LFRicIntSetvalCKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntSetvalXKern

Copy one element of an integer-valued field (second argument), X, to the corresponding element of another, integer-valued, field (first argument), Y. Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicSetvalXKern.

Inheritance

Inheritance diagram of LFRicIntSetvalXKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntSignXKern

Returns the sign of an integer-valued field elements using the Fortran intrinsic sign function, Y = sign(a, X). Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicSignXKern.

Inheritance

Inheritance diagram of LFRicIntSignXKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntMaxAXKern

Returns the maximum of an integer scalar and integer-valued field elements. The result is stored as another, integer-valued, field: Y = max(a, X). Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicMaxAXKern.

Inheritance

Inheritance diagram of LFRicIntMaxAXKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntIncMaxAXKern

Returns the maximum of an integer scalar and integer-valued field elements. The result is stored in the same, integer-valued, field: X = max(a, X). Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicIncMaxAXKern.

Inheritance

Inheritance diagram of LFRicIntIncMaxAXKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntMinAXKern

Returns the minimum of an integer scalar and integer-valued field elements. The result is stored as another, integer-valued, field: Y = min(a, X). Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicMinAXKern.

Inheritance

Inheritance diagram of LFRicIntMinAXKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntIncMinAXKern

Returns the minimum of an integer scalar and integer-valued field elements. The result is stored in the same, integer-valued, field: X = min(a, X). Inherits the lower_to_language_level method from the real-valued built-in equivalent LFRicIncMinAXKern.

Inheritance

Inheritance diagram of LFRicIntIncMinAXKern
class psyclone.domain.lfric.lfric_builtins.LFRicIntToRealXKern

Converts integer-valued field elements to real-valued field elements using the Fortran intrinsic REAL function, Y = REAL(X, kind=r_<prec>). Here Y is a real-valued field of precision r_<prec> and X is the integer-valued field being converted.

Inheritance

Inheritance diagram of LFRicIntToRealXKern
lower_to_language_level()

Lowers this LFRic-specific built-in kernel to language-level PSyIR. This BuiltIn node is replaced by an Assignment node.

Returns:

the lowered version of this node.

Return type:

psyclone.psyir.node.Node

classmethod metadata()

Returns the kernel metadata describing this built-in.

Returns:

kernel metadata describing this built-in.

Return type:

psyclone.domain.lfric.kernel.LFRicKernelMetadata