error #6099: An ENDDO statement occurred without a corresponding DO or DO WHILE statement

error #6099: An ENDDO statement occurred without a corresponding DO or DO WHILE statement

My module:

module m3
 contains
subroutine pk(iter,c4)
integer,intent(in) ::iter
integer,intent(in) ::c4
real,dimension(:),allocatable  :: b11,b22
integer :: n,i,id1,id2
character(10) :: tfile="  .mtf"
character(10) :: pfile="  .log"

allocate(b11(c4))
allocate(b22(c4))
  id1=iter/10
  id2=iter-10*id1
  tfile(1:2)=CHAR(id1+48)//CHAR(id2+48)
  pfile(1:2)=CHAR(id1+48)//CHAR(id2+48)
open(20,file=tfile)
open(21,file=pfile)
 do i=1,c4,1
read(21,50)b11(i),b22(i)
50 format(19x,f11.4,4x,f11.4)
 if (mod(i,4)==0) then
 b11(i)=b11(i)+180
write(20,51)b11(i),b22(i)
51 format(f11.4,4x,f11.4)
 end do
deallocate(b11)
deallocate(b22)

end subroutine
end module

SO I really do net understand what is happening here?

3 Beiträge / 0 neu
Letzter Beitrag
Nähere Informationen zur Compiler-Optimierung finden Sie in unserem Optimierungshinweis.

An endif is missing

BTW try to use internal I/O viz Write(tfile(1:2),"(I2.2)") iter    !!!!

Bild des Benutzers jimdempseyatthecove

Your IF statement (after DO) has no corrisponding ENDIF (before END DO).

Jim Dempsey

www.quickthreadprogramming.com

Melden Sie sich an, um einen Kommentar zu hinterlassen.