Use of spread intrinsic

Neilen Marais nmarais@gmail.com
Thu Jun 9 12:42:00 GMT 2005


Hi

In the code I'm trying to compile with gfortran, I came accross
something like this:

PROGRAM ding
  IMPLICIT NONE

  PRINT*, SPREAD(1.0,1,4)

END PROGRAM ding

Running this program when compiled with gfortran goes off into an
infinite loop, while the intel fortran compiled version gives:

$ ./ding
   1.000000       1.000000       1.000000       1.000000    

If I change the code to:

  PRINT*, SPREAD((/1.0/),1,4)

both ifort and gfortran produce identical output, as above.

Is the first case an extension of some sort, or should both work?

Thanks
Neilen



More information about the Fortran mailing list