Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error #6410: This name has not been declared as an array or a function

Status
Not open for further replies.

mohamadmansouri

Programmer
Apr 21, 2013
4
IR
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::pi=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
 
You should specify the type of A.

instead of

ALLOCATABLE :: T:),:),B:),:),A:),:)

you should specify

real*4, ALLOCATABLE :: T:),:),B:),:),A:),:)

if real*4 is the proper type.

Norbert


The optimist believes we live in the best of all possible worlds - the pessimist fears this might be true.
 
I've tried "" real double precision" and now "real*4", but neither of them worked.
Thanks by the way
 
... then check your compiler's documents what the syntax of the typedeclaration should be. Fact is, the compiler does not recognise A to be an array and complains everytime when you reference A with subscripts.

Norbert


The optimist believes we live in the best of all possible worlds - the pessimist fears this might be true.
 
Your do loops need to end with enddo not end.

When you say none of them worked, can you show us what you changed it to. Also, which compiler are you using?
 
I've used "Real*4,ALLOCATABLE" and "double precision,ALLOCATABLE"
I am using intel-Fortran 2011 compiler
 
End all your END's with END DO's, except the one that ends the program (I can say this because you do not have any IF's).

Declare your allocatable arrays in the following manner:
Code:
REAL, DIMENSION(:, :), ALLOCATABLE :: T,A,B

Re-post source enclosing it in (code) (/code) markup except that instead of parenthesis shown, use square brackets '[' and ']'.

Post error messages...if any.

Germán
 
Thanks Guys, my problem's been solved. The problem was with writing just "end" at the end of some loops, I should have written "end do"
Thanks again from each one of you guys.
Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top