Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
43 Views

Fortran error #8093: A do-variable within a DO body shall not appear in a variable definition context

DO M=1,8
    DO N=1,8
        DO I=1,3
            INTERVAL=0
            DO J=1,3
            INTERVAL = INTERVAL+CMAT(I,J)*BU(J,N)
            END DO
            KUU(M,N)= KUU(M,N)+BU(I,M)*INTERVAL*DJACB
        END DO
    END DO
END DO
 
 
i am facing an error when i complied following fortan code 
0 Kudos
2 Replies
Highlighted
Valued Contributor II
43 Views

The code that you show is only a fragment. Within that fragment there doesn't appear to be a reason for the compiler to complain, but as we do not see any of the declarations and the like, it is difficult to pinpoint the error. Please post a more complete, compilable fragment that allows us to reproduce the problem. Also, the compiler's error message should come with the line number of the offending line of code. This is missing from your post, so we are left to guess at it.

0 Kudos
Highlighted
Black Belt
43 Views

The small code fragment contains only INTERVAL as a possible DO index variable. Check if there was a DO INTERVAL = ... statement earlier in the program source. If so, and the corresponding END DO statement (or labeled terminal statement of the loop) was left out, that loop would still be active and trigger the error message that you showed.

As Arjen said, we need to see more details.

0 Kudos