Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29276 Discussions

'Compilation Aborted (code 3) ' Error

nikhilnair
Beginner
1,444 Views
I am new to Fortran and everytime I run my code, I get a 'Compilation Aborted (code 3)' error but cannot figure out how to rectify it. I am writing my F90 code using Visual Studio 2005 and am using an Intel Fortran Compiler 10.1.001.
I have included my program for your referece.
Thanks,
- Nikhil
PROGRAM Advection_Diffusion
IMPLICIT NONE
REAL , DIMENSION(:,:) ,ALLOCATABLE:: phi , R
REAL , DIMENSION(:) ,ALLOCATABLE:: tempx , tempy , U , a ,b , c , d
REAL :: phi_left , phi_top , phi_btm , H , L , Uin , dx , &
dy ,density , F , sum , L2NORM , dx2 , dy2 , x, y
REAL :: iteration , iter_max=10000 , tol=1E-06
REAL :: TDMA
INTEGER :: i , j, n , m
WRITE(*,*) 'ENTER THE HEIGHT OF INLET'
READ(*,*) H
WRITE(*,*) 'ENTER THE NUMBER OF VOLUMES IN X DIRECTION'
READ(*,*) n
WRITE(*,*) 'ENTER THE NUMBER OF VOLUMES IN Y DIRECTION'
READ(*,*) m
WRITE(*,*) 'ENTER THE VALUE OF DIFFUSION COEFFICIENT'
READ(*,*) F
WRITE(*,*) 'ENTER THE VALUE OF DENSITY'
READ(*,*) density
WRITE(*,*) 'ENTER THE AVERAGE INLET VELOCITY'
READ(*,*) Uin
WRITE(*,*) 'ENTER THE PHI VALUE FOR LEFT BOUNDARY'
READ(*,*) phi_left
WRITE(*,*) 'ENTER THE PHI VALUE FOR TOP BOUNDARY'
READ(*,*) phi_top
WRITE(*,*) 'ENTER THE PHI VALUE FOR BOTTOM BOUNDARY'
READ(*,*) phi_btm
ALLOCATE(phi(1:n,1:m))
ALLOCATE(R(1:n,1:m))
ALLOCATE(U(1:m))
ALLOCATE(tempx(1:n))
ALLOCATE(tempy(1:m))
ALLOCATE(a(1:m-1))
ALLOCATE(d(1:m))
ALLOCATE(c(1:m-1))
ALLOCATE(b(1:m))
L=10*H
dx=L/n
dy=H/m
dx2=dx*dx
dy2=dy*dy
phi(:,:)=phi_left
R(:,:)=0
DO j=1,m
y=(2*j-1)*dy/2
U(j) = (8*Uin*y)/H*(1-y/H)
END DO
OPEN(2,FILE = 'L2NORM.dat')
DO iteration=1,iter_max
! ADI SWEEP LEFT -> RIGHT
! LEFT COLUMN
i=1
a(1:m-2)= -F/dy2
a(m-1)= -(F/dy2 + F/(3*dy2))
j=1
d(j)= density*U(j)/dx + 3*F/dx2 + 3*F/dy2 + F/dx2 + F/dy2
DO j=2,m-1
d(j)= density*U(j)/dx + 3*F/dx2 + F/dx2 + F/dy2 + F/dy2
END DO
j=m
d(j)= density*U(j)/dx + 3*F/dx2 + 3*F/dy2 + F/dx2 + F/dy2
c(1)= -(F/dy2 + F/(3*dy2) )
c(2:m-1)= -F/dy2
j=1
b(j) = (density*U(j)/dx+(8*F)/(3*dx2))*phi_left + &
(8*F)/(3*dy2)*phi_btm + (F/dx2 + F/(3*dx2))*phi(i+1,j)
DO j=2,m-1
b(j) = (density*U(j)/dx+(8*F)/(3*dx2))*phi_left + &
(F/dx2 + F/(3*dx2))*phi(i+1,j)
END DO
j=m
b(j) = (density*U(j)/dx+(8*F)/(3*dx2))*phi_left + &
(8*F)/(3*dy2)*phi_top + (F/dx2 + F/(3*dx2))*phi(i+1,j)
phi(i,1:m)=TDMA(a,d,c,b,m)
! MIDDLE COLUMNS
DO i=2,n-1
a(1:m-2)= -F/dy2
a(m-1)= -(F/dy2 + F/(3*dy2))
j=1
d(j)= density*U(j)/dx + 3*F/dy2 + F/dx2 + F/dx2 + F/dy2
DO j=2,m-1
d(j)= density*U(j)/dx + F/dy2 + F/dx2 + F/dx2 + F/dy2
END DO
j=m
d(j)= density*U(j)/dx + 3*F/dy2 + F/dx2 + F/dx2 + F/dy2
c(1)= -(F/dy2 + F/(3*dy2) )
c(2:m-1)= -F/dy2
j=1
b(j) = (F/dx2+ density*U(j)/dx)*phi(i-1,j)+ (F/dx2)*phi(i+1,j)+ &
((8*F)/(3*dy2))*phi_btm
DO j=2,m-1
b(j) = (F/dx2+ density*U(j)/dx)*phi(i-1,j) + (F/dx2)*phi(i+1,j)
END DO
j=m
b(j) = (F/dx2+ density*U(j)/dx)*phi(i-1,j)+ (F/dx2)*phi(i+1,j)+ &
((8*F)/(3*dy2))*phi_top
phi(i,1:m)=TDMA(a,d,c,b,m)
END DO
! RIGHT COLUMN
i=1
a(1:m-2)= -F/dy2
a(m-1)= -(F/dy2 + F/(3*dy2))
j=1
d(j)= density*U(j)/dx + 3*F/dy2 + F/dx2 + F/dy2
DO j=2,m-1
d(j)= density*U(j)/dx + F/dx2 + F/dy2 + F/dy2
END DO
j=m
d(j)= density*U(j)/dx + 3*F/dy2 + F/dx2 + F/dy2
c(1)= -(F/dy2 + F/(3*dy2) )
c(2:m-1)= -F/dy2
j=1
b(j) = (density*U(j)/dx)*phi(i-1,j) + (8*F)/(3*dy2)*phi_btm
DO j=2,m-1
b(j) = (density*U(j)/dx)*phi(i-1,j)
END DO
j=m
b(j) = (density*U(j)/dx)*phi(i-1,j) + (8*F)/(3*dy2)*phi_top
phi(i,1:m)=TDMA(a,d,c,b,m)
! ADI SWEEP ENDS HERE
! CALCULATION OF THE RESIDUALS
! LEFT COLUMN
i=1
j=1 !Bottom Left Corner node
R(i,j)= (density*U(j)/dx+(8*F)/(3*dx2))*phi_left+(8*F)/(3*dy2)*phi_btm + &
(F/dx2 + F/(3*dx2))*phi(i+1,j) + (F/dy2 + F/(3*dy2))*phi(i,j+1) - &
(density*U(j)/dx + 3*F/dx2 + 3*F/dy2 + F/dx2 + F/dy2)*phi(i,j)
DO j=2,m-1
R(i,j)= (density*U(j)/dx+(8*F)/(3*dx2))*phi_left + (F/dx2 + F/(3*dx2))*phi(i+1,j) &
+ F/dy2*phi(i,j+1) + F/dy2*phi(i,j-1) - &
(density*U(j)/dx + 3*F/dx2 + 3*F/dy2 + F/dx2 + F/dy2)*phi(i,j)
END DO
j=m
R(i,j)= (density*U(j)/dx+(8*F)/(3*dx2))*phi_left+(8*F)/(3*dy2)*phi_top + &
(F/dx2 + F/(3*dx2))*phi(i+1,j) + (F/dy2 + F/(3*dy2))*phi(i,j-1) - &
(density*U(j)/dx + 3*F/dx2 + 3*F/dy2 + F/dx2 + F/dy2)*phi(i,j)
! MIDDLE COLUMNS
DO i=2,n-1
j=1
R(i,j)= ((8*F)/(3*dy2))*phi_btm + (F/dx2+ density*U(j)/dx)*phi(i-1,j)+ &
(F/dx2)*phi(i+1,j) + (F/dy2 + F/(3*dy2))*phi(i,j+1) - &
(density*U(j)/dx + 3*F/dy2 + F/dx2 + F/dx2 + F/dy2)*phi(i,j)
DO j=2,m-1
R(i,j)=F/dx2*phi(i-1,j)+F/dx2*phi(i+1,j)+F/dy2*phi(i,j-1)+F/dy2*phi(i,j+1) &
- (density*U(j)/dx + F/dy2 + F/dx2 + F/dx2 + F/dy2)*phi(i,j)
END DO
j=m
R(i,j)= ((8*F)/(3*dy2))*phi_top + (F/dx2+ density*U(j)/dx)*phi(i-1,j)+ &
(F/dx2)*phi(i+1,j) + (F/dy2 + F/(3*dy2))*phi(i,j-1) - &
(density*U(j)/dx + 3*F/dy2 + F/dx2 + F/dx2 + F/dy2)*phi(i,j)
END DO
! RIGHT COLUMN
i=n
j=1
R(i,j)=(8*F)/(3*dy2)*phi_btm + (density*U(j)/dx +F/dx2)*phi(i-1,j) + &
F/dy2*phi(i,j+1) - (density*U(j)/dx + F/dx2 + (3*F)/dy2 + F/dy2)*phi(i,j)
DO j=2,m-1
R(i,j)=(density*U(j)/dx + F/dx2)*phi(i-1,j) + F/dy2*phi(i,j+1) + F/dy2*phi(i,j-1) &
- (density*U(j)/dx + F/dx2 + F/dy2 + F/dy2)*phi(i,j)
END DO
j=m
R(i,j)=(8*F)/(3*dy2)*phi_top + (density*U(j)/dx +F/dx2)*phi(i-1,j) + &
F/dy2*phi(i,j-1) - (density*U(j)/dx + F/dx2 + (3*F)/dy2 + F/dy2)*phi(i,j)
! END OF RESIDUAL CALCULATIONS
!CALCULATING THE L2NORM
sum=0.0
DO i=1,n
DO j=1,m
sum=sum + R(i,j)**2
END DO
END DO
L2NORM = SQRT(sum)
WRITE(*,*) iteration , L2NORM
WRITE(2,*) iteration , L2NORM
IF (L2NORM < tol) EXIT
END DO !END OF ITERATION LOOP
END PROGRAM Advection_Diffusion
FUNCTION TDMA(A,D,C,B,M)
IMPLICIT NONE
INTEGER, INTENT(IN) :: M
REAL , DIMENSION(1:M), INTENT(IN):: A, C
REAL , DIMENSION(1:M)::TDMA ,D , B
REAL , DIMENSION(:),ALLOCATABLE ::X
INTEGER :: i
ALLOCATE(X(1:M))
DO i=2,M
D(i)=D(i)-A(i-1)/D(i-1)*C(i-1)
B(i)=B(i)-A(i-1)/D(i-1)*B(i-1)
END DO
X(M)=B(M)/D(M)
DO i=M-1,1,-1
X(i)=(B(i)-C(i)*X(i+1))/D(i);
END DO
TDMA = X
END FUNCTION TDMA
0 Kudos
1 Solution
TimP
Honored Contributor III
1,444 Views
I don't have such an old compiler available, You might note that gfortran points out you have discrepancies in your assertion of F90 source code:
Advection_Diffusion.f90:82.19:

phi(i,1:m)=TDMA(a,d,c,b,m)
1
Error: The reference to function 'tdma' at (1) either needs an explicit INTERFACE or the rank is incorrect
Advection_Diffusion.f90:110.23:

phi(i,1:m)=TDMA(a,d,c,b,m)
1
Error: The reference to function 'tdma' at (1) either needs an explicit INTERFACE or the rank is incorrect
Advection_Diffusion.f90:136.19:

phi(i,1:m)=TDMA(a,d,c,b,m)
1
Error: The reference to function 'tdma' at (1) either needs an explicit INTERFACE or the rank is incorrect
Advection_Diffusion.f90:53.7:

DO iteration=1,iter_max
1
Warning: Deleted feature: Loop variable at (1) must be integer
Advection_Diffusion.f90:53.19:

DO iteration=1,iter_max
1
Warning: Deleted feature: End expression in DO loop at (1) must be integer

The interface situation is easily fixed by making it an internal function, and the fix for your REAL typing of iteration and iter_max seems obvious.

While your ability to provoke an internal error by giving incorrect code to the old compiler does demonstrate a bug (which may have been fixed), it's good to pay attention to the rules. I had forgotten that option /warn:interface would be required for ifort to point out the TDMA syntax problem. I don't remember whether it worked by itself in 10.1.

View solution in original post

0 Kudos
5 Replies
Steven_L_Intel1
Employee
1,444 Views
That's quite an old compiler - don't you have access to something newer?

Please show the buildlog.htm from the Debug or Release folder. You can attach it as a file rather than posting inline. There are usually additional messages. There's nothing wrong with your source file.
0 Kudos
nikhilnair
Beginner
1,444 Views
I don't have access to the newer compilers. And here is the Buildlog.htm file.
BuildLog.htm
Thanks,
- Nikhil
0 Kudos
TimP
Honored Contributor III
1,445 Views
I don't have such an old compiler available, You might note that gfortran points out you have discrepancies in your assertion of F90 source code:
Advection_Diffusion.f90:82.19:

phi(i,1:m)=TDMA(a,d,c,b,m)
1
Error: The reference to function 'tdma' at (1) either needs an explicit INTERFACE or the rank is incorrect
Advection_Diffusion.f90:110.23:

phi(i,1:m)=TDMA(a,d,c,b,m)
1
Error: The reference to function 'tdma' at (1) either needs an explicit INTERFACE or the rank is incorrect
Advection_Diffusion.f90:136.19:

phi(i,1:m)=TDMA(a,d,c,b,m)
1
Error: The reference to function 'tdma' at (1) either needs an explicit INTERFACE or the rank is incorrect
Advection_Diffusion.f90:53.7:

DO iteration=1,iter_max
1
Warning: Deleted feature: Loop variable at (1) must be integer
Advection_Diffusion.f90:53.19:

DO iteration=1,iter_max
1
Warning: Deleted feature: End expression in DO loop at (1) must be integer

The interface situation is easily fixed by making it an internal function, and the fix for your REAL typing of iteration and iter_max seems obvious.

While your ability to provoke an internal error by giving incorrect code to the old compiler does demonstrate a bug (which may have been fixed), it's good to pay attention to the rules. I had forgotten that option /warn:interface would be required for ifort to point out the TDMA syntax problem. I don't remember whether it worked by itself in 10.1.
0 Kudos
nikhilnair
Beginner
1,444 Views
I got it to work .. Thank you for your help !!!
0 Kudos
Steven_L_Intel1
Employee
1,444 Views
I forgot to add /warn:interface when I compiled. That isn't on by default in 10.0. The Intel compiler gives:

Advection_Diffusion.f90(82): error #8502: The procedure has a result that is an
array. Required explicit interface is missing from original source. [TDMA]
phi(i,1:m)=TDMA(a,d,c,b,m)
-------------------^
0 Kudos
Reply