modified for use with pgfortran