psyclone.domain.lfric.kernel.inter_grid_arg_metadata

Module containing the InterGridArgMetadata class which captures the metadata associated with an intergrid argument. Supports the creation, modification and Fortran output of an intergrid argument.

Classes

class psyclone.domain.lfric.kernel.inter_grid_arg_metadata.InterGridArgMetadata(datatype, access, function_space, mesh_arg, stencil=None)

Class to capture LFRic kernel metadata information for an intergrid argument.

Parameters:
  • datatype (str) – the datatype of this InterGrid argument (GH_INTEGER, …).

  • access (str) – the way the kernel accesses this intergrid argument (GH_WRITE, …).

  • function_space (str) – the function space that this InterGrid is on (W0, …).

  • mesh_arg (str) – the type of mesh that this InterGrid arg is on (coarse or fine).

  • stencil (Optional[str]) – the type of stencil used by the kernel when accessing this InterGrid arg.

Inheritance

Inheritance diagram of InterGridArgMetadata
fortran_string()
Returns:

the metadata represented by this class as Fortran.

Return type:

str

fparser2_class

alias of Structure_Constructor

static get_mesh_arg(fparser2_tree, mesh_arg_index)

Retrieves the mesh_arg metadata value from the supplied fparser2 tree.

Parameters:
  • fparser2_tree (fparser.two.Fortran2003.Structure_Constructor) – fparser2 tree capturing the metadata for an InterGrid argument.

  • mesh_arg_index (int) – the index at which to find the metadata.

Returns:

the metadata mesh value extracted from the fparser2 tree.

Return type:

str

raises ValueError: if the metadata is not in the form ‘mesh_arg = <value>’.

property mesh_arg
Returns:

the mesh type for this intergrid argument.

Return type:

str