-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sign2CodeTrans generates invalid code for an array argument #2768
Comments
The code PSyclone currently generates for this is:
and the problem is that |
What we should generate is:
|
Alternatively, could we apply
to get:
and then
At which point, the Sign2CodeTransformation should work OK? |
The transformation itself had a comment saying we assume that the argument is a real scalar because we can't query the datatype (with a reference to an old issue). I've closed that old issue (#658) and am proceeding to do better. However, I immediately hit the fact that we don't know what the return type of MAX or ABS is and so the datatype of the argument to SIGN comes back as UnresolvedType. We hit this situation because we can't get the datatype of MAX and ABS as they are Calls. |
It turns out that ABS2CodeTrans made the same assumption about operating on a scalar, real argument so I've generalised my fix (validation really) so that it is used there too. |
Simon has reported that
Sign2CodeTrans
produces invalid code when applied to a SIGN that has an array as argument. One of the examples of this is from src/OCE/SBC/sbcblk_algo_andreas.F90 in NEMO from which I've constructed the following:The text was updated successfully, but these errors were encountered: