-
Notifications
You must be signed in to change notification settings - Fork 29
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
[LFRic] [PSyAD] Integer assignments related to active variables are in wrong order in adjoint #2764
Comments
Thanks for reporting this Terry. @LonelyCat124 will the new DA you're working on enable us to look backwards and find the earliest point to which we could move the assignment |
It would be able to find the previous dependency to k (which in this case would either be the loop or the call inside the loop, maybe both) I think but you'd then have to do something with that information. |
Great - it was only the information I was after. We'd just have to modify the current code that moves the assignment all the way to the top. |
I have a question for @DrTVockerodtMO: I thought we didn't support constructing the adjoint of code with |
This is just a conceptual example, not fed to PSyAD. |
Suppose we have some forward code of the form
When PSyAD generates the adjoint of this code, the
k
assignments are treated as passive, so they all precipitate up to the top which yieldsWhen it should be
The text was updated successfully, but these errors were encountered: