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 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](/uploads/e909093c2eda494610f891eda1e09f3c/pgi_bug.F90)
issue