Hi this is code given in Chapman's book Fortran 95-2003 for scientists and engineers(3ed) on page 195
WRITE (*,100) index, time, depth, amplitude, phase
100 FORMAT('1',t20,'results for the test number ',i3,///,&
1x,'time = ',f7.0/, &
1x,'depth = ',f7.1,' meters',/, &
1x,'amplitude = ',f8.2/ &,
1x,'phase = ',f7.1)
To run it, I completed rest of the statements
program test
implicit none
INTEGER :: index = 10
real:: time=300.0,depth=330.0,amplitude=850.65,phase=30.0
WRITE (*,100) index, time, depth, amplitude, phase
100 FORMAT('1',t20,'results for the test number ',i3,///,&
1x,'time = ',f7.0/, &
1x,'depth = ',f7.1,' meters',/, &
1x,'amplitude = ',f8.2/ &,
1x,'phase = ',f7.1)
end program test
When i compile it with gfortran, I get following errors..
test.f90:12.31:
1x,'amplitude = ',f8.2/ &,
1
Error: Unexpected element '&' in format string at (1)
test.f90:13.8:
1x,'phase = ',f7.1)
1
Error: Non-numeric character in statement label at (1)
test.f90:13.9:
1x,'phase = ',f7.1)
1
Error: Invalid character in name at (1)
test.f90:7.12:
WRITE (*,100) index, time, depth, amplitude, phase
1
Error: FORMAT label 100 at (1) not defined
whats happening here ? I have seen another thread here at stackoverflow, where the question was about the control characters in fortran. Chapman discusses it in his book without mentioning that the feature of control characters has been deleted in Fortran 2003. So I am wondering if this is similar old thing not recognized by gfortran ?