title: Fortran subroutine doesn't return to python
body: <p>I'm using fortran subroutine in my python code, subroutine runs but don't seem to return anything to python. </p>
  
  <p>Here's my subroutine</p>
  
  <pre><code>subroutine gameo(N, matrix, newmat)
  
  integer :: N 
  integer :: matrix(10,10), maxit, newmat(10,10), naap
  
  
  do i=1,N
  do j=1,N
  
      naap = 0 !count neighbours
      do k=i-1,i+1
          do l=j-1,j+1
              if (k==i .AND. l==j) then
                  continue
              else if (k&gt;=N .OR. k&lt;0) then
                  continue
              else if (l&gt;=N .OR. l&lt;0) then
                  continue
              else if (matrix(k,l) == 1) then
                  naap = naap+1
              end if 
          end do
      end do
      if (matrix(i,j) ==1) then !update new array
          if (naap&gt;3) then
              newmat(i,j) = 0
          else if (naap &lt; 2) then
              newmat(i,j) = 0
          else 
              newmat(i,j)= 1
          end if
      else if (matrix(i,j) == 0) then
          if (naap==3) then
              newmat(i,j) = 1
          else 
              newmat(i,j) = 0
          end if
      end if          
  end do
  end do
  
  end subroutine gameo
  </code></pre>
  
  <p>And here is my python code</p>
  
  <pre><code>N = 10
  matrix = np.zeros((N,N))
  
  for i in range(N):
      for j in range(N):
          matrix[i,j]=np.random.randint(0,2)
  
  it = 0
  maxit = 10
  
  while it&lt;maxit:
      newmat = np.zeros((N,N))
  
      newmat = gameo.gameo(N,matrix,newmat) #calling Fortran subroutine
  
      matrix = newmat
      it += 1  
  </code></pre>
  
  <p>I also have problems on fortran arrays, I can't write 'matrix(N,N)', but have to assign it 'matrix(10,10)' instead.<br>
  I'm relatively new with python and with fortran i've been working for just few months.</p>