Reference Guide
2.5.0
|
Public Member Functions | |
def | __init__ (self, arg_type, operates_on, metadata_index) |
def | data_type (self) |
def | function_space_to (self) |
def | function_space_from (self) |
def | function_space (self) |
def | function_spaces (self) |
def | vector_size (self) |
def | __str__ (self) |
Public Member Functions inherited from psyclone.parse.kernel.Descriptor | |
def | __init__ (self, access, space, metadata_index, stencil=None, mesh=None, argument_type=None) |
def | access (self) |
def | metadata_index (self) |
def | stencil (self) |
def | mesh (self) |
def | argument_type (self) |
def | __repr__ (self) |
This class captures the information specified in one of LFRic API argument descriptors (scalars, fields and operators). :param arg_type: LFRic API valid argument type (scalar, \ field or operator). :type arg_type: :py:class:`psyclone.expression.FunctionVar` or \ :py:class:`psyclone.expression.BinaryOperator` :param str operates_on: value of operates_on from the parsed kernel \ metadata (used for validation). :param int metadata_index: position of this argument in the list of \ arguments specified in the metadata. :raises ParseError: if a 'meta_arg' entry is not of 'arg_type' type. :raises ParseError: if the first argument of a 'meta_arg' entry is not \ one of LFRic API valid argument types. :raises ParseError: if the second argument of a 'meta_arg' entry is not \ one of LFRic API valid data types. :raises ParseError: if a 'meta_arg' entry has fewer than 3 args. :raises ParseError: if the third 'meta_arg' entry is not a valid \ access descriptor. :raises InternalError: if the operates_on from the parsed kernel \ metadata is not 'cell_column' or 'dof'. :raises InternalError: if all the metadata checks fail to catch an \ invalid argument type.
Definition at line 61 of file lfric_arg_descriptor.py.
def psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor.__str__ | ( | self | ) |
Creates a string representation of the argument descriptor. This is type and access for scalars with the addition of function space(s) for fields and operators. :returns: string representation of the argument descriptor. :rtype: str :raises InternalError: if an invalid argument type is passed in.
Definition at line 716 of file lfric_arg_descriptor.py.
References psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._argument_type, psyclone.dynamo0p3.DynKernelArgument._argument_type, psyclone.gocean1p0.GOKernelGridArgument._argument_type, psyclone.gocean1p0.GO1p0Descriptor._argument_type, psyclone.parse.kernel.Descriptor._argument_type, psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._vector_size, and psyclone.dynamo0p3.DynKernelArgument._vector_size.
def psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor.data_type | ( | self | ) |
:returns: intrinsic Fortran (primitive) type of the argument data. :rtype: str
Definition at line 606 of file lfric_arg_descriptor.py.
References psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._data_type, psyclone.dynamo0p3.DynKernelArgument._data_type, and psyclone.psyGen.Argument._data_type.
def psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor.function_space | ( | self | ) |
Returns the function space name related to this kernel argument depending on the argument type: a single function space for a field, function_space_from for an operator and nothing for a scalar. :returns: function space relating to this kernel argument or \ None (for a scalar). :rtype: str or NoneType :raises InternalError: if an invalid argument type is passed in.
Reimplemented from psyclone.parse.kernel.Descriptor.
Definition at line 655 of file lfric_arg_descriptor.py.
References psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._argument_type, psyclone.dynamo0p3.DynKernelArgument._argument_type, psyclone.gocean1p0.GOKernelGridArgument._argument_type, psyclone.gocean1p0.GO1p0Descriptor._argument_type, psyclone.parse.kernel.Descriptor._argument_type, psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._function_space1, and psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._function_space2.
def psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor.function_space_from | ( | self | ) |
Returns the "from" function space for an operator. This is the second function space specified in the metadata. :returns: "from" function space for an operator. :rtype: str :raises InternalError: if this is not an operator.
Definition at line 635 of file lfric_arg_descriptor.py.
References psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._argument_type, psyclone.dynamo0p3.DynKernelArgument._argument_type, psyclone.gocean1p0.GOKernelGridArgument._argument_type, psyclone.gocean1p0.GO1p0Descriptor._argument_type, psyclone.parse.kernel.Descriptor._argument_type, and psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._function_space2.
def psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor.function_space_to | ( | self | ) |
Returns the "to" function space for an operator. This is the first function space specified in the metadata. :returns: "to" function space for an operator. :rtype: str :raises InternalError: if this is not an operator.
Definition at line 615 of file lfric_arg_descriptor.py.
References psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._argument_type, psyclone.dynamo0p3.DynKernelArgument._argument_type, psyclone.gocean1p0.GOKernelGridArgument._argument_type, psyclone.gocean1p0.GO1p0Descriptor._argument_type, psyclone.parse.kernel.Descriptor._argument_type, and psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._function_space1.
def psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor.function_spaces | ( | self | ) |
Returns the function space names related to this kernel argument as a list depending on the argument type: one function space for a field, both function spaces ("to"- and then "from"-) for an operator and an empty list for a scalar. :returns: function space names related to this kernel argument. :rtype: list of str :raises InternalError: if an invalid argument type is passed in.
Definition at line 679 of file lfric_arg_descriptor.py.
References psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._argument_type, psyclone.dynamo0p3.DynKernelArgument._argument_type, psyclone.gocean1p0.GOKernelGridArgument._argument_type, psyclone.gocean1p0.GO1p0Descriptor._argument_type, psyclone.parse.kernel.Descriptor._argument_type, psyclone.domain.lfric.kernel.field_arg_metadata.FieldArgMetadata.function_space, psyclone.domain.lfric.kernel.meta_funcs_arg_metadata.MetaFuncsArgMetadata.function_space, psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor.function_space(), psyclone.dynamo0p3.DynKernelArgument.function_space(), psyclone.gocean1p0.GOKernelArgument.function_space(), psyclone.parse.kernel.Descriptor.function_space(), psyclone.domain.lfric.kernel.operator_arg_metadata.OperatorArgMetadata.function_space_from, psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor.function_space_from(), psyclone.dynamo0p3.DynKernelArgument.function_space_from(), psyclone.domain.lfric.kernel.operator_arg_metadata.OperatorArgMetadata.function_space_to, psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor.function_space_to(), and psyclone.dynamo0p3.DynKernelArgument.function_space_to().
def psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor.vector_size | ( | self | ) |
Returns the vector size of the argument. This will be 1 if ``*n`` has not been specified for all argument types except scalars (their vector size is set to 0). :returns: vector size of the argument. :rtype: int
Definition at line 704 of file lfric_arg_descriptor.py.
References psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._vector_size, and psyclone.dynamo0p3.DynKernelArgument._vector_size.