Changes adapting code to be successfully compiled with gfortran.