psyclone.domain.lfric.lfric_arg_descriptor

This module contains the LFRicArgDescriptor class and related constants and properties.

Classes

  • LFRicArgDescriptor: This class captures the information specified in one of LFRic API argument

class psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor(arg_type, operates_on, metadata_index)

This class captures the information specified in one of LFRic API argument descriptors (scalars, fields and operators).

Parameters:
  • arg_type (psyclone.expression.FunctionVar or psyclone.expression.BinaryOperator) – LFRic API valid argument type (scalar, field or operator).

  • operates_on (str) – value of operates_on from the parsed kernel metadata (used for validation).

  • metadata_index (int) – 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.

  • ParseError – if the first argument of a ‘meta_arg’ entry is not one of LFRic API valid argument types.

  • ParseError – if the second argument of a ‘meta_arg’ entry is not one of LFRic API valid data types.

  • ParseError – if a ‘meta_arg’ entry has fewer than 3 args.

  • ParseError – if the third ‘meta_arg’ entry is not a valid access descriptor.

  • InternalError – if the operates_on from the parsed kernel metadata is not ‘cell_column’ or ‘dof’.

  • InternalError – if all the metadata checks fail to catch an invalid argument type.

Inheritance

Inheritance diagram of LFRicArgDescriptor
property data_type
Returns:

intrinsic Fortran (primitive) type of the argument data.

Return type:

str

property function_space

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).

Return type:

str or NoneType

Raises:

InternalError – if an invalid argument type is passed in.

property function_space_from

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.

Return type:

str

Raises:

InternalError – if this is not an operator.

property function_space_to

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.

Return type:

str

Raises:

InternalError – if this is not an operator.

property function_spaces

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.

Return type:

list of str

Raises:

InternalError – if an invalid argument type is passed in.

property vector_size

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.

Return type:

int