INTEGER :: IR, NR, IST, NV
REAL, ALLOCATABLE : KV(:,:) ! or
! DOUBLE PRECISION, ALLOCATABLE: KV(:,:)
:
OPEN (111,File="basename\_CMAT.bin", FORM='UNFORMATTED')
Read(111) NR
ALLOCATE(KV(2,NR))
DO IR=1,NR
READ(111) IST,NV,KV(IST:2,1:NV)
. . .
ENDDO
CLOSE (111)
The matrices are written row-wise. If the whole row is present, IST is 2,
NV will equal IR and KV(2, 1:IR) will contain all ( IR) values up to the diagonal.
Otherwise, IST is 1, NV will be less than IR and specifies how many values are known, non-zero.
KV(1, 1:NV) will contain the column numbers for the values in KV(2, 1:NV) in order with
KV(1, NV) being equal to IR. Since these matrices are potentially huge,
the values are written in single precision (REAL*4), double precision (REAL*8) if !DOUBLE is specified.
A second file, basename _CaEqnOrder.bin, holding the permutated order of the equations is also written with
!CAMAT and !CPMAT.
INTEGER NR, EO(1:100000)
OPEN(112,FILE="basename\_CaEqnOrder.bin",FORM="UNFORMATTED")
READ(112) NR, EO(1:NR)
CLOSE(112)