loki.transformations.single_column.base

Classes

SCCBaseTransformation(horizontal)

A basic set of utilities used in the SCC transformation.

class SCCBaseTransformation(horizontal)

Bases: Transformation

A basic set of utilities used in the SCC transformation. These utilities can either be used as a transformation in their own right, or the contained class methods can be called directly.

Parameters:

horizontal (Dimension) – Dimension object describing the variable conventions used in code to define the horizontal data dimension and iteration space.

static rename_index_aliases(routine, dimension)

Rename index aliases: map all index aliases dimension.indices to dimension.index.

Parameters:
  • routine (Subroutine) – The subroutine to rename index aliases.

  • horizontal (Dimension) – Dimension object to rename the index aliases to the first/former index.

static is_elemental(routine)

Check whether Subroutine routine is an elemental routine. Need for distinguishing elemental and non-elemental function to transform those in a different way.

Parameters:

routine (Subroutine) – The subroutine to check whether elemental

transform_subroutine(routine, **kwargs)

Apply SCCBase utilities to a Subroutine.

Parameters:
  • routine (Subroutine) – Subroutine to apply this transformation to.

  • role (string) – Role of the subroutine in the call tree; should be "kernel"

process_kernel(routine, rename_indices=False)

Applies the SCCBase utilities to a “kernel”. This consists simply of resolving associations, masked statements and vector notation.

Parameters:

routine (Subroutine) – Subroutine to apply this transformation to.

process_driver(routine)

Applies the SCCBase utilities to a “driver”. This consists simply of resolving associations.

Parameters:

routine (Subroutine) – Subroutine to apply this transformation to.