PGI compiler bug
I believe to have found a bug in pgfortran occurring in versions 19.10, 20.7, 20.9 and 21.1. I have found it during testing for !107 (merged) in the Langevin part.
Edit: In the chosen design of the Hamiltonian structure, the bug doesn't apply any more.
The attached file contains a minimal example.pgi_bug.F90
Edited by Jonas Schwab