Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28457 Discussions

error #5149: Illegal character in statement label field

htkang
Beginner
8,595 Views

Why I have these errors?
Almost all lines in the programare generate errors.
My Complier: Intel visual fortran 11.1 professional, 64 bit
My system: Window XP 64bit

*********************Error Messages***************************************************
: error #5149: Illegal character in statement label field


: error #5149: Illegal character in statement label field
: error #5149: Illegal character in statement label field
: error #5149: Illegal character in statement label field
: error #5149: Illegal character in statement label field
: error #5118: First statement in file must not be continued
mean.for<7>: error #5149:Illegal character in statement label field
---IMPLICT NONE
.
.
.





*********************Fortran Example Code*************************************************
! ----------------------------------------------------------

! This program contains one subroutine for computing the

! arithmetic, geometric and harmonic means of three REALs.

! ----------------------------------------------------------

PROGRAM Mean6

IMPLICIT NONE

REAL :: u, v, w

REAL :: ArithMean, GeoMean, HarmMean

READ(*,*) u, v, w

CALL Means(u, v, w, ArithMean, GeoMean, HarmMean)

WRITE(*,*) "Arithmetic Mean = ", ArithMean

WRITE(*,*) "Geometric Mean = ", GeoMean

WRITE(*,*) "Harmonic Mean = ", HarmMean

CONTAINS

! ----------------------------------------------------------

! SUBROUTINE Means():

! This subroutine receives three REAL values and computes

! their arithmetic, geometric, and harmonic means.

! ----------------------------------------------------------

SUBROUTINE Means(a, b, c, Am, Gm, Hm)

IMPLICIT NONE

REAL, INTENT(IN) :: a, b, c

REAL, INTENT(OUT) :: Am, Gm, Hm

Am = (a + b + c)/3.0

Gm = (a * b * c)**(1.0/3.0)

Hm = 3.0/(1.0/a + 1.0/b + 1.0/c)

END SUBROUTINE Means

END PROGRAM Mean6

0 Kudos
1 Solution
TimP
Honored Contributor III
8,595 Views
Apparently, you have attempted to process current standard free form format as f77 fixed form. You can set the free form option, or engage it by default by naming your file with .f90 suffix.

View solution in original post

0 Kudos
4 Replies
IanH
Honored Contributor II
8,595 Views
The compiler looks at the extension on the source file (.for) and then thinks that the file is in fixed source form (column 1 for comment indicator, columns 2:5 for statement labels, column six for continuation, statements start in column seven, etc). I believe this source form was first developed by the ancient Sumerians in order to allow Fortran source to be recorded in cuneiform script (though originally limited to uppercase cuneiform only) on stone tablets.

The file is most likely in what is known as free source form. Try again after changing the file extension to ".f90" and see what happens.

Have a look in the index for the help for the compiler under "Source forms" and also at the help for the associated compiler options /free and /fixed for more information.
0 Kudos
TimP
Honored Contributor III
8,596 Views
Apparently, you have attempted to process current standard free form format as f77 fixed form. You can set the free form option, or engage it by default by naming your file with .f90 suffix.
0 Kudos
htkang
Beginner
8,595 Views
Quoting - IanH
The compiler looks at the extension on the source file (.for) and then thinks that the file is in fixed source form (column 1 for comment indicator, columns 2:5 for statement labels, column six for continuation, statements start in column seven, etc). I believe this source form was first developed by the ancient Sumerians in order to allow Fortran source to be recorded in cuneiform script (though originally limited to uppercase cuneiform only) on stone tablets.

The file is most likely in what is known as free source form. Try again after changing the file extension to ".f90" and see what happens.

Have a look in the index for the help for the compiler under "Source forms" and also at the help for the associated compiler options /free and /fixed for more information.

THANK YOU.
0 Kudos
htkang
Beginner
8,595 Views
Quoting - tim18
Apparently, you have attempted to process current standard free form format as f77 fixed form. You can set the free form option, or engage it by default by naming your file with .f90 suffix.

THANK YOU.
0 Kudos
Reply