Open Stagno opened 3 years ago
The work around to this is to first initialize the field like so:
@stencil
def temp_access_bug(
a: Field[K],
b: Field[Edge],
d: Field[Edge, K],
) -> None:
z: Field[Edge, K]
with domain.upward as k:
z = 0
if (a):
z = b
d = z
The following Dusk code
fails with the following error:
Dawn is not able to properly look inside the conditional to figure out that the temporary is written before being read. I encountered the problem when translating
mo_velocity_advection_stencil_19
using temporaries. This is the simplest reproducible I could write.