37 '''Module containing the LFRic-specific Container class for a Kernel.
44 '''An LFRic-specific Container. This specialises the generic Container
45 node and adds in any domain-specific information.
47 :param str name: the name of the container.
48 :param metadata: the metadata object.
50 :py:class:`psyclone.domain.lfric.kernel.LFRicKernelMetadata`
51 :param kwargs: additional keyword arguments to pass to parent \
53 :type kwargs: unwrapped dict
56 def __init__(self, name, metadata, **kwargs):
57 super().__init__(name, **kwargs)
62 def create(cls, name, metadata, symbol_table, children):
63 '''Create an LFRic Container instance given a name, metadata, a symbol
64 table and a list of child nodes. An LFRic-specific kernel is
65 created with the metadata describing the kernel interface for
66 a single kernel routine within the container.
68 :param str name: the name of the Container.
69 :param metadata: the metadata object.
71 :py:class:`psyclone.domain.lfric.kernel.LFRicKernelMetadata`
72 :param symbol_table: the symbol table associated with this \
74 :type symbol_table: :py:class:`psyclone.psyir.symbols.SymbolTable`
75 :param children: a list of PSyIR nodes contained in the \
76 Container. These must be Containers or Routines.
77 :type children: List[:py:class:`psyclone.psyir.nodes.Container` \
78 | :py:class:`psyclone.psyir.nodes.Routine`]
80 :returns: an instance of `cls`.
81 :rtype: :py:class:`psyclone.psyir.nodes.Container` or subclass
85 return cls(name, metadata, children=children,
86 symbol_table=symbol_table.detach())
91 :returns the LFRic metadata object.
92 :rtype: :py:class:`psyclone.domain.lfric.kernel.psyir.\
98 '''Lower this LFRic-specific container to language level psyir.
100 :returns: the lowered version of this node.
101 :rtype: :py:class:`psyclone.psyir.node.Node`
106 data_symbol = self.
metadatametadata.lower_to_psyir()
107 self.symbol_table.add(data_symbol)
110 children = self.pop_all_children()
111 generic_container = Container.create(
112 self.name, self.symbol_table.detach(), children)
113 self.replace_with(generic_container)
114 return generic_container
117 __all__ = [
"LFRicKernelContainer"]
def create(cls, name, metadata, symbol_table, children)
def lower_to_language_level(self)