forked from JackS9/phatpsy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
putone.f
62 lines (55 loc) · 1.6 KB
/
putone.f
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
SUBROUTINE PUTONE(ONEMAT,NBAS,IW)
IMPLICIT REAL*8(A-H,O,P,R-Z),LOGICAL*1(Q)
CHARACTER*1 QCC,QSKIP,QEJECT
C-----------------------------------------------------------------------
C
C PUTONE...
C
C THIS ROUTINE WRITES OUT A SYMMETRY PACKED MATRIX IN LOWER
C TRIANGULAR FORM WITH 10 COLUMNS PER PAGE.
C
C VARIABLE DEFINITIONS:
C
C ONEMAT(*)... PACKED MATRIX. (DIMENSIONED NBAS*(NBAS+1)/2).
C NBAS........ DIMENSION OF BASIS (NUMBER OF ROWS AND COLUMNS).
C IW.......... FORTRAN I/O UNIT FOR WRITING.
C
C ROUTINES CALLED: $PAGE($NLINE); MIN0, DABS
C
C-----------------------------------------------------------------------
DIMENSION ONEMAT(1),ROW(10)
DATA ZERO/0.0D0/,TOLER/5.0D-5/,MAXCOL/10/,LINECT/80/
DATA QSKIP/' '/,QEJECT/' '/
QCC=QSKIP
LAST=0
DO 30 IBEGIN=1,NBAS,MAXCOL
LAST=MIN0(LAST+MAXCOL,NBAS)
NCOL=LAST-IBEGIN+1
IJ=(IBEGIN*(IBEGIN-1))/2
WRITE (IW,1000) QCC,(I,I=IBEGIN,LAST)
WRITE (IW,2000)
IEND=0
DO 20 J=IBEGIN,NBAS
IEND=MIN0(IEND+1,NCOL)
IJ=IJ+J-1
QDELET=.TRUE.
DO 10 K=1,IEND
ROWK=ONEMAT(IJ+K)
IF (DABS(ROWK).LT.TOLER) ROWK=ZERO
IF (ROWK.NE.ZERO) QDELET=.FALSE.
ROW(K)=ROWK
10 CONTINUE
IF (QDELET) GO TO 20
WRITE (IW,2000) J,(ROW(K),K=1,IEND)
20 CONTINUE
C CALL $NLINE(LINES)
LINES = 0
LEFT=LINECT-LINES
NEED=NBAS-IBEGIN-MAXCOL+3
QCC=QSKIP
IF (NEED.GT.LEFT) QCC=QEJECT
30 CONTINUE
RETURN
1000 FORMAT(A1,I9,9I12)
2000 FORMAT(' ',I2,F10.4,9F12.4)
END