loki.transformations.sanitise.sequence_associations
Functions
|
Check if an array argument, arg, is passed to an array dummy argument, dummy, using scalar syntax. |
|
Housekeeping routine to replace scalar syntax when passing arrays as arguments For example, a call like |
Classes
|
|
|
Transformer that resolves sequence association patterns in |
- class SequenceAssociationTransformation(resolve_sequence_associations=True)
Bases:
Transformation
Transformation
that resolves sequence association patterns inCallStatement
nodes.- Parameters:
resolve_sequence_associations (bool) – Flag to trigger or suppress resolution of sequence associations
- transform_subroutine(routine, **kwargs)
Defines the transformation to apply to
Subroutine
items.For transformations that modify
Subroutine
objects, this method should be implemented. It gets called via the dispatch methodapply()
.- Parameters:
routine (
Subroutine
) – The subroutine to be transformed.**kwargs (optional) – Keyword arguments for the transformation.
- do_resolve_sequence_association(routine)
Housekeeping routine to replace scalar syntax when passing arrays as arguments For example, a call like
real :: a(m,n) call myroutine(a(i,j))
where myroutine looks like
subroutine myroutine(a) real :: a(5) end subroutine myroutine
should be changed to
call myroutine(a(i:m,j)
- Parameters:
routine (
Subroutine
) – The subroutine where calls will be changed
- class SequenceAssociationTransformer(mapper=None, invalidate_source=True, inplace=False, rebuild_scopes=False)
Bases:
Transformer
Transformer that resolves sequence association patterns in
CallStatement
nodes.- visit_CallStatement(call, **kwargs)
Resolve sequence association patterns in arguments and return new
CallStatement
object if any were found.