mohamadmansouri
Programmer
Hey Guys
I face severals of "Error 17 error #6410: This name has not been declared as an array or a function. [A]" problem notification on the program below, is there anybody here who can give me a hint?
Regards
Program Impli
implicit none
integer :: n,i,j
real:: dx
real,parameter:i=3.14159228
ALLOCATABLE :: T,,B,,A,
print*,"enter numbers of n*n"
read*,n
ALLOCATE(T(n**2,1),A(n**2,n**2),B(n**2,1))
dx=1./(n+1)
do i=1,n*n
do j=1,n*n
A(i,j)=0
end do
end do
do i=1,n*n
B(i,1)=0
end do
!!!!!!!!!!!!!!!!!!!!!!!!!
!!!Setting Corner Nods!!!
A(1,1)=(-4./dx**2)
A(1,2)=1./dx**2
A(1,n+1)=1./dx**2
A(n,n)=(-4./dx**2)
A(n,n-1)=1./dx**2
A(n,2*n)=1./dx**2
A(n**2-n+1,n**2-n+1)=-4./dx**2
A(n**2-n+1,n**2-n+2)=1./dx**2
A(n**2-n+1,n**2-2*n+1)=1./dx**2
A(n**2,n**2)=-4./dx**2
A(n**2,n**2-1)=1./dx**2
A(n**2,n**2-n)=1./dx**2
B(n**2-n+1,1)=sin(Pi*dx)
B(n**2,1)=sin(Pi*n*dx)
!!!!!!!!!!!!!!!!!!!!!!!
!!Setting Inner Nods!!!
do i=2,n-1
A(i,i)=-4./dx**2
A(i,i+1)=1./dx**2
A(i,i-1)=1./dx**2
A(i,i+n)=1./dx**2
A(n*n-n+i,n*n-n+i)=-4./dx**2
A(n*n-n+i,n*n-n+i+1)=1./dx**2
A(n*n-n+i,n*n-n+i-1)=1./dx**2
A(n*n-n+i,n*n-2*n+i)=1./dx**2
B(n*n-n+i,1)=(-1./dx**2)*sin(Pi*i*dx)
end
do j=2,n-1
A(n*j,n*j)=-4./dx**2
A(n*j,n*j-1)=1./dx**2
A(n*j,n*j-n)=1./dx**2
A(n*j,n*j+n)=1./dx**2
A(n*j-n+1,n*j-n+1)=-4./dx**2
A(n*j-n+1,n*j-n+2)=1./dx**2
A(n*j-n+1,n*j+1)=1./dx**2
A(n*j-n+1,n*j-2*n+1)=1./dx**2
end
do i=2,n-1
do j=2,n-1
A(n*(j-1)+i,n*(j-1)+i+1)=1./dx**2
A(n*(j-1)+i,n*(j-1)+i)=-4./dx**2
A(n*(j-1)+i,n*(j-1)+i-1)=1./dx**2
A(n*(j-1)+i,n*j+i)=1./dx**2
A(n*(j-1)+i,n*(j-2)+i)=1./dx**2
end
end
end
I face severals of "Error 17 error #6410: This name has not been declared as an array or a function. [A]" problem notification on the program below, is there anybody here who can give me a hint?
Regards
Program Impli
implicit none
integer :: n,i,j
real:: dx
real,parameter:i=3.14159228
ALLOCATABLE :: T,,B,,A,
print*,"enter numbers of n*n"
read*,n
ALLOCATE(T(n**2,1),A(n**2,n**2),B(n**2,1))
dx=1./(n+1)
do i=1,n*n
do j=1,n*n
A(i,j)=0
end do
end do
do i=1,n*n
B(i,1)=0
end do
!!!!!!!!!!!!!!!!!!!!!!!!!
!!!Setting Corner Nods!!!
A(1,1)=(-4./dx**2)
A(1,2)=1./dx**2
A(1,n+1)=1./dx**2
A(n,n)=(-4./dx**2)
A(n,n-1)=1./dx**2
A(n,2*n)=1./dx**2
A(n**2-n+1,n**2-n+1)=-4./dx**2
A(n**2-n+1,n**2-n+2)=1./dx**2
A(n**2-n+1,n**2-2*n+1)=1./dx**2
A(n**2,n**2)=-4./dx**2
A(n**2,n**2-1)=1./dx**2
A(n**2,n**2-n)=1./dx**2
B(n**2-n+1,1)=sin(Pi*dx)
B(n**2,1)=sin(Pi*n*dx)
!!!!!!!!!!!!!!!!!!!!!!!
!!Setting Inner Nods!!!
do i=2,n-1
A(i,i)=-4./dx**2
A(i,i+1)=1./dx**2
A(i,i-1)=1./dx**2
A(i,i+n)=1./dx**2
A(n*n-n+i,n*n-n+i)=-4./dx**2
A(n*n-n+i,n*n-n+i+1)=1./dx**2
A(n*n-n+i,n*n-n+i-1)=1./dx**2
A(n*n-n+i,n*n-2*n+i)=1./dx**2
B(n*n-n+i,1)=(-1./dx**2)*sin(Pi*i*dx)
end
do j=2,n-1
A(n*j,n*j)=-4./dx**2
A(n*j,n*j-1)=1./dx**2
A(n*j,n*j-n)=1./dx**2
A(n*j,n*j+n)=1./dx**2
A(n*j-n+1,n*j-n+1)=-4./dx**2
A(n*j-n+1,n*j-n+2)=1./dx**2
A(n*j-n+1,n*j+1)=1./dx**2
A(n*j-n+1,n*j-2*n+1)=1./dx**2
end
do i=2,n-1
do j=2,n-1
A(n*(j-1)+i,n*(j-1)+i+1)=1./dx**2
A(n*(j-1)+i,n*(j-1)+i)=-4./dx**2
A(n*(j-1)+i,n*(j-1)+i-1)=1./dx**2
A(n*(j-1)+i,n*j+i)=1./dx**2
A(n*(j-1)+i,n*(j-2)+i)=1./dx**2
end
end
end