-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLoad_Linear_System.f90
28 lines (26 loc) · 975 Bytes
/
Load_Linear_System.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
!==============================================================================!
subroutine Load_Linear_System(IO, name_in, n, a, b)
!------------------------------------------------------------------------------!
implicit none
!---------------------------------[Arguments]----------------------------------!
class(In_Out_Type) :: IO
character(len=*) :: name_in
integer :: n
real, allocatable :: a(:,:)
real, allocatable :: b(:)
!-----------------------------------[Locals]-----------------------------------!
integer :: row, col
!------------------------[Avoid unused parent warning]-------------------------!
Unused(IO)
!==============================================================================!
! Read the system from the file system
open(9, file=name_in)
read(9, *) n
allocate(a(n,n))
do row = 1, n
read(9, *) (a(row,col), col=1,n)
end do
allocate(b(n))
read(9, *) (b(row), row=1,n)
close(9)
end subroutine