fix to keep code optimised for PGI compiler