36 '''Module containing the MetaMeshMetadata class which captures
37 the values for the LFRic kernel meta_mesh metadata.
41 CommonDeclarationMetadata
47 '''Class to capture the values of the LFRic kernel
48 meta_mesh metadata. This class supports the creation,
49 modification and Fortran output of this metadata.
51 meta_mesh metadata specifies properties of the LFRic mesh object
52 that are required by a kernel.
54 :param meta_mesh_args: a list of meta_mesh arguments.
55 :type meta_mesh_args: List[:py:class:`psyclone.domain.lfric.kernel.\
59 def __init__(self, meta_mesh_args):
65 :returns: the meta_mesh metadata as Fortran.
73 '''Create an instance of MetaMeshMetadata from an fparser2
76 LFRic meta mesh metadata is in array form. Two
77 versions of the array form are supported:
79 type(mesh_data_type) :: meta_mesh(1) = (/ ... /)
80 type(mesh_data_type), dimension(1) :: meta_mesh = (/ ... /)
82 :param fparser2_tree: fparser2 tree capturing the meta \
85 :type fparser2_tree: :py:class:`fparser.two.Fortran2003.\
86 Data_Component_Def_Stmt`
88 :returns: an instance of MetaMeshMetadata.
89 :rtype: :py:class:`psyclone.domain.lfric.kernel.\
93 values_list = MetaMeshMetadata.get_derived_array_declaration(
94 fparser2_tree,
"MESH_DATA_TYPE",
"META_MESH")
96 for value
in values_list:
98 MetaMeshArgMetadata.create_from_fortran_string(value))
102 def meta_mesh_args(self):
104 :returns: a list of meta mesh argument objects.
105 :rtype: List[:py:class:`psyclone.domain.lfric.kernel.\
106 MetaMeshArgMetadata`]
110 @meta_mesh_args.setter
111 def meta_mesh_args(self, values):
113 :param values: set the meta_mesh metadata to the \
114 supplied list of values.
115 :type values: List[:py:class:`psyclone.domain.lfric.kernel.\
116 MetaMeshArgMetadata`]
125 __all__ = [
"MetaMeshMetadata"]
def type_declaration_string(datatype, name, values)
def validate_list(cls, values, expected_type)
def create_from_fparser2(fparser2_tree)
def meta_mesh_args(self, values)