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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

WRITE statement debug

Status
Not open for further replies.

manueleo

Technical User
Joined
Feb 10, 2007
Messages
3
Location
US
Help !!!

Could any one tell if the write statement below
is correct

write(1) nmax
write(1) ( ( ni(n), nj(n), 1 ), n=1,nmax )
do 10 n = 1, nmax
write(1) ( ( x(i,j,n), i=1,ni(n) ), j=1,nj(n) ),
& ( ( y(i,j,n), i=1,ni(n) ), j=1,nj(n) ),
& ( ( z(i,j,n), i=1,ni(n) ), j=1,nj(n) )
10 continue

I try to compile this code, but it's no working. I am
using f90 compiler. The error seems to be in the character
'&' used for continuing the write statement. In the above
statement, I am actually trying to continue the write statement in another line, and I am doing it twice.

Please help
 
Put the & on the previous line i.e.
Code:
write(1) nmax
write(1) ( ( ni(n), nj(n), 1 ), n=1,nmax )
do  n = 1, nmax
write(1) ( ( x(i,j,n), i=1,ni(n) ), j=1,nj(n) ), &
 ( ( y(i,j,n), i=1,ni(n) ), j=1,nj(n) ), &
 ( ( z(i,j,n), i=1,ni(n) ), j=1,nj(n) )
end do
You can also use the do.. enddo construct. Saves having to make up labels with a continue statement.
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top