- #1
Diracster
- 3
- 0
I have a 3D ising model simulation, what i am trying to do is look up each column in the array and if all the values of that column are -1 then i wish to write the i and j coordinates of that column to a file. the section of code I am having problems with is:
OPEN (10, FILE='holes.dat')
DO i=1,x
DO j=1,y
DO k=1,z
IF (s(i,j,k)>0) THEN
EXIT
ELSE IF (k=10) THEN
WRITE (10,*) i, j
END IF
END DO
END DO
END DO
CLOSE (10)
My compiler is giving me the error:
isingmodel8.f95:163.19:
ELSE IF (k=10) THEN
1
Error: Unexpected junk after ELSE statement at (1)
Basically i would like to know why i am getting this error and also if you think that my code will do what i want it to or if there is a better way of doing it. Any help is much appreciated!
Thanks
OPEN (10, FILE='holes.dat')
DO i=1,x
DO j=1,y
DO k=1,z
IF (s(i,j,k)>0) THEN
EXIT
ELSE IF (k=10) THEN
WRITE (10,*) i, j
END IF
END DO
END DO
END DO
CLOSE (10)
My compiler is giving me the error:
isingmodel8.f95:163.19:
ELSE IF (k=10) THEN
1
Error: Unexpected junk after ELSE statement at (1)
Basically i would like to know why i am getting this error and also if you think that my code will do what i want it to or if there is a better way of doing it. Any help is much appreciated!
Thanks