gfortran error: Statement order error: declaration after DATA

Tobias Burnus burnus@net-b.de
Wed Sep 12 06:30:00 GMT 2012


David N. Bradley wrote:
> I am trying to compile the cactuscode package and can not get past the
> error :
>     Statement order error: declaration after DATA

Somehow the whole is very odd.

a) I tried your program with gfortran 4.1 to 4.8, g95 and g77 - and none 
of them prints this error - all compile the program even with -std=f95 
without any error.

b) The code looks perfectly valid to me - the Fortran standard doesn't 
mandate that after DATA no other declaration comes. (Even having DATA 
after the first execution statement is valid, albeit obsolescent.)


Your email lacks important pieces of information, in particular, which 
compiler in which version you are using under which operating system.


Note that GCC (gcc.gnu.org) only develops/supports gfortran but no other 
compiler. (g77 was the predecessor but is no longer maintained.)

Additionally, gcc@ is the mailing list for GCC development, please send 
usage questions to gcc-help@ (or gfortran's fortran@) but not to gcc@.


Tobias



More information about the Gcc mailing list