PSyclone icon indicating copy to clipboard operation
PSyclone copied to clipboard

psyad error when there is a unary minus

Open rupertford opened this issue 3 years ago • 2 comments

If there is a unary minus on the rhs of an active assignment then PSyclone does not find the active variables on the RHS. For example:

> cat tmp.f90
program tmp
    real :: x, active, active2
    active = -x * active2
end program tmp
> psyad tmp.f90 -a active active2
TangentLinearError: Each term on the RHS of the assignment 'active = -x * active2
' must be linear with respect to the active variable, but found '-x * active2'.

If the unary minus is removed then psyad works OK.

rupertford avatar Jan 23 '22 01:01 rupertford

Created branch 1583_psyad_unary_minus

rupertford avatar Jun 30 '22 10:06 rupertford

The error is raised in the validation, but the actual transformation seems to work. I therefore need to update the validation check.

rupertford avatar Jun 30 '22 14:06 rupertford