1. Can anyone tell me why the ouput of the array content a in testGSolver
is different from that of the array content a in dgeco.
2. I also appreciate if you can tell me what difference there is between
double precision a(lda,1)
and
double precision a(lda,n)
Thanks.
========= calling program testSolver.f90 in fortran 90 =========
!! In this program, we are solving the following system
!! Ax = b
!! using Gaussian Elimination
program testGSolver
implicit none
integer, parameter :: dp = kind(1.0d0), &!
d = 2
real(kind=dp),dimension(d,d) :: a
real(kind=dp),dimension(d) :: extras
real(kind=dp) :: cond_num
integer,dimension(d) :: pivot_info
integer :: nrow
a = reshape((/1,2,3,5/),(/2,2/)) ! initialization of the array
nrow = d
call dgeco(at,nrow,nrow,pivot_info,cond_num,extras)
print *, a(1,:)
print *, a(2,:)
print *, "pivot information: ", pivot_info
print *, "condition number : ", cond_num
end program testGSolver
=========== called program dgeco.f in fortran 77 ===============
subroutine dgeco(a,lda,n,ipvt,rcond,z)
integer lda,n,ipvt(1)
! double precision a(lda,1),z(1)
double precision a(lda,n),z(1)
double precision rcond
print *,"dgeco : lda = ", lda
print *,"dgeco : n = ", n
print *,"dgeco : shape of a =: ",shape(a)
a = 10
a(1,1) = 11
print *,"dgeco : ",a(1,:)
print *,"dgeco : ",a(2,:)
return
end
=========== output result ====================
dgeco : lda = 2
dgeco : n = 2
dgeco : shape of a = 2 2
dgeco : 11.0 10.0
dgeco : 10.0 10.0
1.0 3.0
2.0 5.0
pivot information: 0 0
condition number : 0.0
-----------------------------------------------------------
Jaehoon,Seol e-mail : [log in to unmask]
www : http://www.math.uiowa.edu/~seol
Only the person born without mother can be free.
-----------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|