Closed ekluzek closed 1 year ago
This is because of the -C=alias option for the nag compiler. In the makefile we have -C=all, which turns it and other compiler checking options on.
I tried adding the "volatile" attribute and that still aborted the same way.
OK, it turns out the problem isn't the swap function itself, it's if the swap function is called with arguments that are the same (i.e. a==b). In this case the swap would be OK, but it doesn't really need to be done. So the change needed is to NOT call swap when a==b.
The NAG compiler on izumi complains about the following in nr_utils.f90
It complains about the change in a dummy argument changing another dummy argument at the same time.
There must be some way to override this protection or maybe there is an intrinsic that does this same thing?