I'm trying to compile some old fortran77 programs with gfortran and getting error with allocatable arrays. If I define arrays in f90-style, like:
REAL*8,allocatable::somearray(:)
everything is fine, but in those old programs arrays defined as:
REAL*8 somearray[ALLOCATABLE](:)
which cause gfortran error output:
REAL*8,allocatable::somearray[ALLOCATABLE](:)
1
Fatal Error: Coarrays disabled at (1), use -fcoarray= to enable
I really wish to avoid rewriting whole programs to f90 style, so, could you please tell me, is there any way to force gfortran to compile it? Thanks a lot.
I'd probably go for search and replace. For example,
where sed is available.
Of course, be careful with sed :).
In any case, as it seems your code was written in some non-standard version of old Fortran, you'll probably need to make changes in any case.
For what it's worth the Intel Fortran compiler (v13.something) compiles the following micro-program without complaint. This executes and writes
10
to the terminal:Given the history of the Intel compiler I suspect that the strange declaration is an extension provided by DEC Fortran, possibly an early implementation of what was later standardised in Fortran 90.
For standard checking you can use -std flag
To "force"
gfortran
to compile your code, you have to use syntax it recognizes