title: forrtl: severe (174): SIGSEGV, segmentation fault occurred
body: <p>I really need your help!!! I am wondering if it is because of the array coor.</p>
  
  <p>I compiled a fortran program using ifort msd.f90 -o msd.x</p>
  
  <p>After I ran ./msd.x it gave me segmentation fault </p>
  
  <p>My Fortrain code is:</p>
  
  <pre><code>program mean_square_displacement
    implicit none
    integer i,j,k,natom,mstep
    integer, parameter :: mmax=5000,nmax=1000,kmax=3 
    real*16 vector(3,3),d(3)
    real*16,dimension(kmax,nmax,mmax) :: coor
    real*16 msdtotal(mmax),msd(nmax,mmax)
  
  
    open(unit=8,file="vector")
    read(unit=8,fmt=*) (vector(k,1),k=1,3)
    read(unit=8,fmt=*) (vector(k,2),k=1,3)
    read(unit=8,fmt=*) (vector(k,3),k=1,3)
  
  
    do j=0,mmax
    do i=0,nmax
    do k=0,kmax
    coor(k,i,j)=0.d0  
    enddo
    enddo
    enddo
  
  
  
   open(unit=9,file="trace")
  
    i=0
    j=0
    10    continue
    read(unit=9,fmt=*,end=100) (d(k),k=1,3)
    i=i+1
  
       coor(1,i,j)=d(1)
       coor(2,i,j)=d(2)
       coor(3,i,j)=d(3)
  
      write(6,20), coor(1,i,j),coor(2,i,j),coor(3,i,j)
  
    goto 10
    100   continue
  
    natom=130
    mstep=j
  
  
    20    format(3(1x,f12.9))
  
    stop
    end 
  </code></pre>