Reference Guide
2.5.0
|
Public Member Functions | |
def | __init__ (self, node=None, default_visibility=Symbol.Visibility.PUBLIC) |
def | find_or_create_integer_symbol (self, name, tag=None) |
def | find_or_create_array (self, array_name, num_dimensions, intrinsic_type, tag=None) |
def | add_lfric_precision_symbol (self, name) |
Sub-classes SymbolTable to provide a LFRic-specific implementation. :param node: reference to the Schedule or Container to which this \ symbol table belongs. :type node: :py:class:`psyclone.psyir.nodes.Schedule`, \ :py:class:`psyclone.psyir.nodes.Container` or NoneType :param default_visibility: optional default visibility value for this \ symbol table, if not provided it defaults to PUBLIC visibility. :type default_visibillity: \ :py:class:`psyclone.psyir.symbols.Symbol.Visibility`
Definition at line 54 of file lfric_symbol_table.py.
def psyclone.domain.lfric.lfric_symbol_table.LFRicSymbolTable.add_lfric_precision_symbol | ( | self, | |
name | |||
) |
If the named LFRic precision symbol is not already in the table then add it. Also ensure that the Container symbol from which it is imported is in the table. :param str name: name of the LFRic precision symbol to add to table. :returns: the specified LFRic precision symbol. :rtype: :py:class:`psyclone.psyir.symbols.DataSymbol` :raises ValueError: if the supplied name is not a recognised LFRic \ precision variable. :raises ValueError: if a symbol with the same name is already in the \ table but is not imported from the correct container.
Definition at line 210 of file lfric_symbol_table.py.
References psyclone.domain.lfric.lfric_symbol_table.LFRicSymbolTable._constants_mod, psyclone.f2pygen.IfThenGen.add(), psyclone.f2pygen.ProgUnitGen.add(), psyclone.f2pygen.DoGen.add(), psyclone.psyir.symbols.datatypes.StructureType.add(), psyclone.f2pygen.BaseGen.add(), psyclone.psyir.symbols.symbol_table.SymbolTable.add(), psyclone.psyir.symbols.datatypes.StructureType.lookup(), and psyclone.psyir.symbols.symbol_table.SymbolTable.lookup().
def psyclone.domain.lfric.lfric_symbol_table.LFRicSymbolTable.find_or_create_array | ( | self, | |
array_name, | |||
num_dimensions, | |||
intrinsic_type, | |||
tag = None |
|||
) |
This function returns a symbol for an ArrayReference. If the symbol does not exist, it is created. If a new array symbol is created, it gets the DEFERRED attribute, which in Fortran means it will be declared as an allocatable array. :param str array_name: the name and tag of the array. :param int num_dimensions: the number of dimensions of this array. :param intrinsic_type: the intrinsic type of the array. :type intrinsic_type: \ :py:class:`psyclone.psyir.symbols.datatypes.ScalarType.Intrinsic` :param tag: optional tag to be used in searching and defining. :type tag: Optional[str] :returns: the requested symbol :rtype: :py:class:`psyclone.psyir.symbols.Symbol` :raises TypeError: if the symbol exists, but is not a DataSymbol, \ or not an Array, or has different number of dimensions.
Definition at line 138 of file lfric_symbol_table.py.
References psyclone.psyir.symbols.datatypes.StructureType.lookup(), psyclone.psyir.symbols.symbol_table.SymbolTable.lookup(), psyclone.psyir.symbols.symbol_table.SymbolTable.lookup_with_tag(), and psyclone.psyir.symbols.symbol_table.SymbolTable.new_symbol().
def psyclone.domain.lfric.lfric_symbol_table.LFRicSymbolTable.find_or_create_integer_symbol | ( | self, | |
name, | |||
tag = None |
|||
) |
This function returns a symbol for an integer reference. If a tag is specified, it will be used to search for an existing symbol, otherwise the name will be used. If the symbol should not already exist in the symbol table, it will be returned, otherwise a new symbol will be created. :param str name: name of the integer variable to declare. :param tag: optional tag of the integer variable to declare. :type tag: Optional[str] :returns: the symbol for the variable. :rtype: :py:class:`psyclone.psyir.symbols.Symbol` :raises TypeError: TypeError if the symbol exists but is not \ a DataSymbol. :raises TypeError: TypeError if the symbol exists and is a \ DataSymbol, but not an Integer.
Definition at line 90 of file lfric_symbol_table.py.
References psyclone.psyir.symbols.datatypes.StructureType.lookup(), psyclone.psyir.symbols.symbol_table.SymbolTable.lookup(), psyclone.psyir.symbols.symbol_table.SymbolTable.lookup_with_tag(), and psyclone.psyir.symbols.symbol_table.SymbolTable.new_symbol().