Hello everyone, I have the following subroutine code (it is a textual copy of a document):
1 subroutine contin(grid,nx,ny,dx,dy,dz,store)
2 dimension grid(nx*ny),store(2*nx*ny),nn(2)
3 real kx,ky,k
4 complex cgrid,cmplx
5 data pi/3.14159265/
6 index(i,j,ncol)=(j-l)*ncol+i
7 nn(1)=ny
8 nn(2)=nx
9 ndim=2
10 dkx=2.*pi/(nx*dx)
11 dky=2.*pi/(ny*dy)
12 do 10 j=l,nx
13 do 10 i=l,ny
14 ij=index(i,j,ny)
15 store(2*ij-l)=grid(ij)
16 10 store(2*ij)=0.
My doubt is in line 5, with the INDEX function in the the [highlight #EF2929]index(i,j,ncol)=(j-l)*ncol+i[/highlight]. I have been checking and the INDEX is a fortran intrinsic function but in this case they are using it as a variable. I am using GFORTRAN to compile the subroutine.
Does anyone understand what they are trying to do whit the INDEX statement in line 5?
I appreciate any coments. Best regards.
1 subroutine contin(grid,nx,ny,dx,dy,dz,store)
2 dimension grid(nx*ny),store(2*nx*ny),nn(2)
3 real kx,ky,k
4 complex cgrid,cmplx
5 data pi/3.14159265/
6 index(i,j,ncol)=(j-l)*ncol+i
7 nn(1)=ny
8 nn(2)=nx
9 ndim=2
10 dkx=2.*pi/(nx*dx)
11 dky=2.*pi/(ny*dy)
12 do 10 j=l,nx
13 do 10 i=l,ny
14 ij=index(i,j,ny)
15 store(2*ij-l)=grid(ij)
16 10 store(2*ij)=0.
My doubt is in line 5, with the INDEX function in the the [highlight #EF2929]index(i,j,ncol)=(j-l)*ncol+i[/highlight]. I have been checking and the INDEX is a fortran intrinsic function but in this case they are using it as a variable. I am using GFORTRAN to compile the subroutine.
Does anyone understand what they are trying to do whit the INDEX statement in line 5?
I appreciate any coments. Best regards.