|
def | create (call, parent=None) |
|
Creates the necessary framework for a call to an LFRic built-in,
This consists of the operation itself and the loop over unique
DoFs.
Definition at line 89 of file lfric_builtins.py.
◆ create()
def psyclone.domain.lfric.lfric_builtins.LFRicBuiltInCallFactory.create |
( |
|
call, |
|
|
|
parent = None |
|
) |
| |
|
static |
Create the objects needed for a call to the built-in described in
the call (BuiltInCall) object.
:param call: details of the call to this built-in in the \
Algorithm layer.
:type call: :py:class:`psyclone.parse.algorithm.BuiltInCall`
:param parent: the schedule instance to which the built-in call \
belongs.
:type parent: :py:class:`psyclone.domain.lfric.LFRicInvokeSchedule`
:raises ParseError: if the name of the function being called is \
not a recognised built-in.
:raises InternalError: if the built-in does not iterate over DoFs.
Definition at line 100 of file lfric_builtins.py.
100 def create(call, parent=None):
102 Create the objects needed for a call to the built-in described in
103 the call (BuiltInCall) object.
105 :param call: details of the call to this built-in in the \
107 :type call: :py:class:`psyclone.parse.algorithm.BuiltInCall`
108 :param parent: the schedule instance to which the built-in call \
110 :type parent: :py:class:`psyclone.domain.lfric.LFRicInvokeSchedule`
112 :raises ParseError: if the name of the function being called is \
113 not a recognised built-in.
114 :raises InternalError: if the built-in does not iterate over DoFs.
117 if call.func_name
not in BUILTIN_MAP:
119 f
"Unrecognised built-in call in LFRic API: found "
120 f
"'{call.func_name}' but expected one of "
121 f
"{list(BUILTIN_MAP_CAPITALISED.keys())}.")
125 builtin = BUILTIN_MAP[call.func_name]()
132 if call.ktype.iterates_over ==
"dof":
136 f
"An LFRic built-in must iterate over DoFs but kernel "
137 f
"'{call.func_name}' iterates over "
138 f
"'{call.ktype.iterates_over}'")
139 dofloop = LFRicLoop(parent=parent, loop_type=loop_type)
143 builtin.load(call, parent=dofloop.loop_body)
146 dofloop.load(builtin)
150 dofloop.loop_body.addchild(builtin)
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/psyclone-ref/checkouts/latest/src/psyclone/domain/lfric/lfric_builtins.py