Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
ElmerCSC
GitHub Repository: ElmerCSC/elmerfem
Path: blob/devel/umfpack/demo/readhb_size.f
3196 views
1
c=======================================================================
2
c== readhb_size ========================================================
3
c=======================================================================
4
5
c-----------------------------------------------------------------------
6
c UMFPACK Version 4.4, Copyright (c) 2005 by Timothy A. Davis. CISE
7
c Dept, Univ. of Florida. All Rights Reserved. See ../Doc/License for
8
c License. web: http://www.cise.ufl.edu/research/sparse/umfpack
9
c-----------------------------------------------------------------------
10
11
c readhb_size:
12
c read a sparse matrix in the Harwell/Boeing format and output the
13
c size of the matrix (# rows, # columns, and # of entries)
14
c
15
c usage (for example):
16
c
17
c readhb_size < HB/arc130.rua > tmp/Asize
18
19
integer nz, totcrd, ptrcrd,
20
$ indcrd, valcrd, rhscrd, ncol, nrow, nrhs
21
character title*72, key*30, type*3, ptrfmt*16,
22
$ indfmt*16, valfmt*20, rhsfmt*20
23
character rhstyp*3
24
integer nzrhs, nel
25
26
c-----------------------------------------------------------------------
27
28
c read header information from Harwell/Boeing matrix
29
30
read (5, 10, err = 998)
31
$ title, key,
32
$ totcrd, ptrcrd, indcrd, valcrd, rhscrd,
33
$ type, nrow, ncol, nz, nel,
34
$ ptrfmt, indfmt, valfmt, rhsfmt
35
if (rhscrd .gt. 0) then
36
c new Harwell/Boeing format:
37
read (5, 20, err = 998) rhstyp,nrhs,nzrhs
38
endif
39
10 format (a72, a8 / 5i14 / a3, 11x, 4i14 / 2a16, 2a20)
40
20 format (a3, 11x, 2i14)
41
42
write (6, *) nrow, ncol, nz
43
stop
44
998 write (0, *) 'Read error'
45
stop
46
end
47
48
49