Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Cake Fortran

jdavis2112
Beginner
947 Views

Anyone know whats wrong with this program for F95?

integer n, W, icount

real(8) Sig_tr, Sig_a, vSig_f, S, Lambda_tr, D, L, dx, k, S_o

real(8), allocatable :: A(:,:), B(:), Y(:,:), Z(:)

write(*,*) 'Input the number of nodes (n)'

read(*,*) n

write(*,*) 'Input the length of the slab(W)'

read(*,*) W

Sig_tr = 23;

Sig_a = 100;

vSig_f = 101;

S_o = 10e8;

Lambda_tr = 1/Sig_tr ;

D = Lambda_tr/3;

L = sqrt(D/Sig_a);

dx = W / (n-1);

k = S*L/(2*D);

allocate(A(n-1,n-1))

allocate(B(n-1))

A= Y(1:n-1 , 1:n-1);

B = Z(1:n-1);

allocate(Y(n,n))

Y = 0

allocate(Z(n))

Z = 0

Y(1,1) = ((D/dx)+(Sig_a*dx/2));

Y(1,2) = -D/dx;

Z(1) = S_o/2;

do icount = 2,n-1

Y(icount,icount) = (2*D)/dx+Sig_a*dx;

Y(icount,icount+1) = -D/dx;

Y(icount,icount-1) = -D/dx;

Z(icount) = 0;

enddo



!AAA = inv(A)*B;

!AAA(n) = 0

!print AAA

0 Kudos
2 Replies
Steven_L_Intel1
Employee
947 Views
Other than a missing END statement? I don't see a problem. What problem do you see?
0 Kudos
jimdempseyatthecove
Honored Contributor III
947 Views
You are using the array Y and Zbefore you allocate them.

Jim Dempsey
0 Kudos
Reply