Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continuation lines

Status
Not open for further replies.

garynewport2

Instructor
Joined
Jun 16, 2011
Messages
9
Location
GB
I have the following line of code...

Code:
write(6,201) i, TIME, DTIME, CorM, CorR, CorL, accL + CorL, fluxM, corM / solmass

Due to it's length (and as an experiment in the use of continuation lines to confirm my understanding) I tried to spread this over two lines.

I have tried this...

Code:
write(6,201) i, TIME, DTIME, CorM, CorR, CorL, &
            & accL + CorL, fluxM, corM / solmass

...with the ampersands...
[ul]
[li]one character away from the first/last character[/li]
[li]at column 73 (first one) and column 6 (second one)[/li]
[/ul]

I have also tried this...

Code:
write(6,201) i, TIME, DTIME, CorM, CorR, CorL, &
                accL + CorL, fluxM, corM / solmass

With the ampersand being
[ul]
[li]at 73[/li]
[li]just after the final character[/li]
[li]at a distance from the final character (to keep things consistent and pretty)[/li]
[/ul]

No matter what I do I now get this error message...

Code:
  283 |             write(6,201) i, TIME, DTIME, CorM, CorR, CorL, &
      |                                                            1
Error: Expected expression in WRITE statement at (1)

I have just undertaken a fresh install of GNU Fortran, with the --version being reported as 11.1.0

Anyone any ideas where I am going wrong?
 
What file extension did you use? Normally .f and .for assume fixed format.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top