Reference Guide  2.5.0
psyclone.gocean1p0.GOKernelGridArgument Class Reference
Inheritance diagram for psyclone.gocean1p0.GOKernelGridArgument:
Collaboration diagram for psyclone.gocean1p0.GOKernelGridArgument:

Public Member Functions

def __init__ (self, arg, kernel_call)
 
def name (self)
 
def psyir_expression (self)
 
def dereference (self, fld_name)
 
def argument_type (self)
 
def intrinsic_type (self)
 
def is_scalar (self)
 
def text (self)
 
def forward_dependence (self)
 
def backward_dependence (self)
 
- Public Member Functions inherited from psyclone.psyGen.Argument
def __init__ (self, call, arg_info, access)
 
def infer_datatype (self)
 
def __str__ (self)
 
def form (self)
 
def is_literal (self)
 
def access (self)
 
def access (self, value)
 
def precision (self)
 
def data_type (self)
 
def module_name (self)
 
def call (self)
 
def call (self, value)
 
def forward_write_dependencies (self, ignore_halos=False)
 
def backward_write_dependencies (self, ignore_halos=False)
 
def forward_read_dependencies (self)
 

Detailed Description

Describes arguments that supply grid properties to a kernel.
These arguments are provided by the PSy layer rather than in
the Algorithm layer.

:param arg: the meta-data entry describing the required grid property.
:type arg: :py:class:`psyclone.gocean1p0.GO1p0Descriptor`
:param kernel_call: the kernel call node that this Argument belongs to.
:type kernel_call: :py:class:`psyclone.gocean1p0.GOKern`

:raises GenerationError: if the grid property is not recognised.

Definition at line 1562 of file gocean1p0.py.

Member Function Documentation

◆ argument_type()

def psyclone.gocean1p0.GOKernelGridArgument.argument_type (   self)
 The type of this argument. We have this for compatibility with
    GOKernelArgument objects since, for this class, it will always be
    "grid_property". 

Reimplemented from psyclone.psyGen.Argument.

Definition at line 1644 of file gocean1p0.py.

1644  def argument_type(self):
1645  ''' The type of this argument. We have this for compatibility with
1646  GOKernelArgument objects since, for this class, it will always be
1647  "grid_property". '''
1648  return self._argument_type
1649 

References psyclone.domain.lfric.lfric_arg_descriptor.LFRicArgDescriptor._argument_type, psyclone.dynamo0p3.DynKernelArgument._argument_type, psyclone.gocean1p0.GOKernelGridArgument._argument_type, psyclone.gocean1p0.GO1p0Descriptor._argument_type, and psyclone.parse.kernel.Descriptor._argument_type.

Here is the caller graph for this function:

◆ backward_dependence()

def psyclone.gocean1p0.GOKernelGridArgument.backward_dependence (   self)
A grid-property argument is read-only and supplied by the
PSy layer so has no dependencies

:returns: None to indicate no dependencies
:rtype: NoneType

Reimplemented from psyclone.psyGen.Argument.

Definition at line 1688 of file gocean1p0.py.

1688  def backward_dependence(self):
1689  '''
1690  A grid-property argument is read-only and supplied by the
1691  PSy layer so has no dependencies
1692 
1693  :returns: None to indicate no dependencies
1694  :rtype: NoneType
1695  '''
1696  return None
1697 
1698 
Here is the caller graph for this function:

◆ dereference()

def psyclone.gocean1p0.GOKernelGridArgument.dereference (   self,
  fld_name 
)
Returns a Fortran string to dereference a grid property of the
specified field. It queries the current config file settings for
getting the proper dereference string, which is a format string
where {0} represents the field name.

:param str fld_name: The name of the field which is used to \
    dereference a grid property.

:returns: the dereference string required to access a grid property
    in a dl_esm field (e.g. "subdomain%internal%xstart"). The name
    must contains a "{0}" which is replaced by the field name.
:rtype: str

Definition at line 1626 of file gocean1p0.py.

1626  def dereference(self, fld_name):
1627  '''Returns a Fortran string to dereference a grid property of the
1628  specified field. It queries the current config file settings for
1629  getting the proper dereference string, which is a format string
1630  where {0} represents the field name.
1631 
1632  :param str fld_name: The name of the field which is used to \
1633  dereference a grid property.
1634 
1635  :returns: the dereference string required to access a grid property
1636  in a dl_esm field (e.g. "subdomain%internal%xstart"). The name
1637  must contains a "{0}" which is replaced by the field name.
1638  :rtype: str'''
1639  api_config = Config.get().api_conf("gocean1.0")
1640  deref_name = api_config.grid_properties[self._property_name].fortran
1641  return deref_name.format(fld_name)
1642 

References psyclone.gocean1p0.GOKernelGridArgument._property_name.

Here is the caller graph for this function:

◆ forward_dependence()

def psyclone.gocean1p0.GOKernelGridArgument.forward_dependence (   self)
A grid-property argument is read-only and supplied by the
PSy layer so has no dependencies

:returns: None to indicate no dependencies
:rtype: NoneType

Reimplemented from psyclone.psyGen.Argument.

Definition at line 1678 of file gocean1p0.py.

1678  def forward_dependence(self):
1679  '''
1680  A grid-property argument is read-only and supplied by the
1681  PSy layer so has no dependencies
1682 
1683  :returns: None to indicate no dependencies
1684  :rtype: NoneType
1685  '''
1686  return None
1687 
Here is the caller graph for this function:

◆ intrinsic_type()

def psyclone.gocean1p0.GOKernelGridArgument.intrinsic_type (   self)
:returns: the intrinsic_type of this argument.
:rtype: str

Reimplemented from psyclone.psyGen.Argument.

Definition at line 1651 of file gocean1p0.py.

1651  def intrinsic_type(self):
1652  '''
1653  :returns: the intrinsic_type of this argument.
1654  :rtype: str
1655 
1656  '''
1657  api_config = Config.get().api_conf("gocean1.0")
1658  return api_config.grid_properties[self._property_name].intrinsic_type
1659 

References psyclone.gocean1p0.GOKernelGridArgument._property_name.

Here is the caller graph for this function:

◆ is_scalar()

def psyclone.gocean1p0.GOKernelGridArgument.is_scalar (   self)
:returns: if this variable is a scalar variable or not.
:rtype: bool

Definition at line 1661 of file gocean1p0.py.

1661  def is_scalar(self):
1662  '''
1663  :returns: if this variable is a scalar variable or not.
1664  :rtype: bool
1665  '''
1666  # The constructor guarantees that _property_name is a valid key!
1667  api_config = Config.get().api_conf("gocean1.0")
1668  return api_config.grid_properties[self._property_name].type \
1669  == "scalar"
1670 

References psyclone.gocean1p0.GOKernelGridArgument._property_name.

Here is the caller graph for this function:

◆ name()

◆ psyir_expression()

def psyclone.gocean1p0.GOKernelGridArgument.psyir_expression (   self)
:returns: the PSyIR expression represented by this Argument.
:rtype: :py:class:`psyclone.psyir.nodes.Node`

Reimplemented from psyclone.psyGen.Argument.

Definition at line 1609 of file gocean1p0.py.

1609  def psyir_expression(self):
1610  '''
1611  :returns: the PSyIR expression represented by this Argument.
1612  :rtype: :py:class:`psyclone.psyir.nodes.Node`
1613 
1614  '''
1615  # Find field from which to access grid properties
1616  base_field = self._call.arguments.find_grid_access().name
1617  tag = "AlgArgs_" + base_field
1618  symbol = self._call.scope.symbol_table.find_or_create_tag(tag)
1619 
1620  # Get aggregate grid type accessors without the base name
1621  access = self.dereference(base_field).split('%')[1:]
1622 
1623  # Construct the PSyIR reference
1624  return StructureReference.create(symbol, access)
1625 

References psyclone.f2pygen.CallGen._call, psyclone.gocean1p0.GOKernelGridArgument._call, psyclone.psyGen.DataAccess._call, psyclone.psyGen.Argument._call, and psyclone.gocean1p0.GOKernelGridArgument.dereference().

Here is the call graph for this function:

◆ text()

def psyclone.gocean1p0.GOKernelGridArgument.text (   self)
 The raw text used to pass data from the algorithm layer
    for this argument. Grid properties are not passed from the
    algorithm layer so None is returned.

Reimplemented from psyclone.psyGen.Argument.

Definition at line 1672 of file gocean1p0.py.

1672  def text(self):
1673  ''' The raw text used to pass data from the algorithm layer
1674  for this argument. Grid properties are not passed from the
1675  algorithm layer so None is returned.'''
1676  return None
1677 

The documentation for this class was generated from the following file: