BruceJohnJennerLawso
Programmer
Okay, so Im working through some basic stuff with learning fortran, but Im running up against an issue with format statements.
Using gfortran 4.7.2.1, I try to compile this example program from a tutorial pdf Im reading:
when I try to compile, I get
The issue only pops up when trying to use format statements. Are format statements not supported by gfortran, or am I writing them in an outdated syntax version?
Using gfortran 4.7.2.1, I try to compile this example program from a tutorial pdf Im reading:
Code:
PROGRAM FORMAT
implicit none
integer:: i, j
real:: x
character(len=10):: mychars
write(*,*)' Enter digits 0 to 9 twice in succession '
100 FORMAT(1x, a5, i5, f6.2, i3)
read(*,100)mychars, i, x, j
write(*,*)mychars, i, j, x
stop
end program FORMAT
when I try to compile, I get
gfortran said:bruce@bruce:~/development/fortran$ gfortran -o format format.f
format.f:11.7:
100 format(1x, a5, i5, f6.2, i3)
1
Error: Invalid character in name at (1)
format.f:10.16:
read(*,100)mychars, i, x, j
1
Error: FORMAT label 100 at (1) not defined
bruce@bruce:~/development/fortran$
The issue only pops up when trying to use format statements. Are format statements not supported by gfortran, or am I writing them in an outdated syntax version?