Google
 

Trailing-Edge - PDP-10 Archives - decus_20tap2_198111 - decus/20-0026/matin.sss
There are 2 other files named matin.sss in the archive. Click here to see a list.
C                                                                       MATI  10
C     ..................................................................MATI  20
C                                                                       MATI  30
C        SUBROUTINE MATIN                                               MATI  40
C                                                                       MATI  50
C        PURPOSE                                                        MATI  60
C           READS CONTROL CARD AND MATRIX DATA ELEMENTS FROM LOGICAL    MATI  70
C           UNIT 5                                                      MATI  80
C                                                                       MATI  90
C        USAGE                                                          MATI 100
C           CALL MATIN(ICODE,A,ISIZE,IROW,ICOL,IS,IER)                  MATI 110
C                                                                       MATI 120
C        DESCRIPTION OF PARAMETERS                                      MATI 130
C           ICODE-UPON RETURN, ICODE WILL CONTAIN FOUR DIGIT            MATI 140
C                 IDENTIFICATION CODE FROM MATRIX PARAMETER CARD        MATI 150
C           A    -DATA AREA FOR INPUT MATRIX                            MATI 160
C           ISIZE-NUMBER OF ELEMENTS DIMENSIONED BY USER FOR AREA A     MATI 170
C           IROW -UPON RETURN, IROW WILL CONTAIN ROW DIMENSION FROM     MATI 180
C                 MATRIX PARAMETER CARD                                 MATI 190
C           ICOL -UPON RETURN, ICOL WILL CONTAIN COLUMN DIMENSION FROM  MATI 200
C                 MATRIX PARAMETER CARD                                 MATI 210
C           IS   -UPON RETURN, IS WILL CONTAIN STORAGE MODE CODE FROM   MATI 220
C                 MATRIX PARAMETER CARD WHERE                           MATI 230
C                 IS=0 GENERAL MATRIX                                   MATI 240
C                 IS=1 SYMMETRIC MATRIX                                 MATI 250
C                 IS=2 DIAGONAL MATRIX                                  MATI 260
C           IER  -UPON RETURN, IER WILL CONTAIN AN ERROR CODE WHERE     MATI 270
C                 IER=0   NO ERROR                                      MATI 280
C                 IER=1   ISIZE IS LESS THAN NUMBER OF ELEMENTS IN      MATI 290
C                         INPUT MATRIX                                  MATI 300
C                 IER=2   INCORRECT NUMBER OF DATA CARDS                MATI 310
C                                                                       MATI 320
C        REMARKS                                                        MATI 330
C           NONE                                                        MATI 340
C                                                                       MATI 350
C        SUBROUTINES AND FUNCTION SUBPROGRAMS REQUIRED                  MATI 360
C           LOC                                                         MATI 370
C                                                                       MATI 380
C        METHOD                                                         MATI 390
C           SUBROUTINE ASSUMES THAT INPUT MATRIX CONSISTS OF PARAMETER  MATI 400
C           CARD FOLLOWED BY DATA CARDS                                 MATI 410
C           PARAMETER CARD HAS THE FOLLOWING FORMAT                     MATI 420
C             COL. 1- 2 BLANK                                           MATI 430
C             COL. 3- 6 UP TO FOUR DIGIT IDENTIFICATION CODE            MATI 440
C             COL. 7-10 NUMBER OF ROWS IN MATRIX                        MATI 450
C             COL.11-14 NUMBER OF COLUMNS IN MATRIX                     MATI 460
C             COL.15-16 STORAGE MODE OF MATRIX WHERE                    MATI 470
C                 0 - GENERAL MATRIX                                    MATI 480
C                 1 - SYMMETRIC MATRIX                                  MATI 490
C                 2 - DIAGONAL MATRIX                                   MATI 500
C           DATA CARDS ARE ASSUMED TO HAVE SEVEN FIELDS OF TEN COLUMNS  MATI 510
C           EACH.  DECIMAL POINT MAY APPEAR ANYWHERE IN A FIELD.  IF NO MATI 520
C           DECIMAL POINT IS INCLUDED, IT IS ASSUMED THAT THE DECIMAL   MATI 530
C           POINT IS AT THE END OF THE 10 COLUMN FIELD. NUMBER IN EACH  MATI 540
C           FIELD MAY BE PRECEDED BY BLANKS.  DATA ELEMENTS MUST BE     MATI 550
C           PUNCHED BY ROW.  A ROW MAY CONTINUE FROM CARD TO CARD.      MATI 560
C           HOWEVER EACH NEW ROW MUST START IN THE FIRST FIELD OF THE   MATI 570
C           NEXT CARD.  ONLY THE UPPER TRIANGULAR PORTION OF A SYMMETRICMATI 580
C           OR THE DIAGONAL ELEMENTS OF A DIAGONAL MATRIX ARE CONTAINED MATI 590
C           ON DATA CARDS.  THE FIRST ELEMENT OF EACH NEW ROW WILL BE   MATI 600
C           THE DIAGONAL ELEMENT FOR A MATRIX WITH  SYMMETRIC OR        MATI 610
C           DIAGONAL STORAGE MODE. COLUMNS 71-80 OF DATA CARDS MAY BE   MATI 620
C           USED FOR IDENTIFICATION, SEQUENCE NUMBERING, ETC..          MATI 630
C           THE LAST DATA CARD FOR ANY MATRIX MUST BE FOLLOWED BY A CARDMATI 640
C           WITH A 9 PUNCH IN COLUMN 1.                                 MATI 650
C                                                                       MATI 660
C.......................................................................MATI 670
C                                                                       MATI 680
      SUBROUTINE MATIN(ICODE,   A,ISIZE,IROW,ICOL,IS,IER)               MATI 690
      DIMENSION A(1)                                                    MATI 700
      DIMENSION CARD(8)                                                 MATI 710
    1 FORMAT(7F10.0)                                                    MATI 720
    2 FORMAT(I6,2I4,I2)                                                 MATI 730
C                                                                       MATI 740
      IDC=7                                                             MATI 750
      IER=0                                                             MATI 760
      READ( 5,2,END=999)ICODE,IROW,ICOL,IS                              MATI 770
      CALL LOC(IROW,ICOL,ICNT,IROW,ICOL,IS)                             MATI 780
      IF(ISIZE-ICNT)6,7,7                                               MATI 790
    6 IER=1                                                             MATI 800
    7 IF (ICNT)38,38,8                                                  MATI 810
    8 ICOLT=ICOL                                                        MATI 820
      IROCR=1                                                           MATI 830
C                                                                       MATI 840
C        COMPUTE NUMBER OF CARDS FOR THIS ROW                           MATI 850
C                                                                       MATI 860
   11 IRCDS=(ICOLT-1)/IDC+1                                             MATI 870
      IF(IS-1)15,15,12                                                  MATI 880
   12 IRCDS=1                                                           MATI 890
C                                                                       MATI 900
C        SET UP LOOP FOR NUMBER OF CARDS IN ROW                         MATI 910
C                                                                       MATI 920
   15 DO 31 K=1,IRCDS                                                   MATI 930
      READ(5,1)(CARD(I),I=1,IDC)                                        MATI 940
C                                                                       MATI 950
C        SKIP THROUGH DATA CARDS IF INPUT AREA TOO SMALL                MATI 960
C                                                                       MATI 970
      IF(IER)16,16,31                                                   MATI 980
   16 L=0                                                               MATI 990
C                                                                       MATI1000
C        COMPUTE COLUMN NUMBER FOR FIRST FIELD IN CURRENT CARD          MATI1010
C                                                                       MATI1020
      JS=(K-1)*IDC+ICOL-ICOLT+1                                         MATI1030
      JE=JS+IDC-1                                                       MATI1040
      IF(IS-1)19,19,17                                                  MATI1050
   17 JE=JS                                                             MATI1060
C                                                                       MATI1070
C        SET UP LOOP FOR DATA ELEMENTS  WITHIN CARD                     MATI1080
C                                                                       MATI1090
   19 DO 30 J=JS,JE                                                     MATI1100
      IF(J-ICOL)20,20,31                                                MATI1110
   20 CALL LOC(IROCR ,J,IJ,IROW,ICOL,IS)                                MATI1120
      L=L+1                                                             MATI1130
   30 A(IJ)=CARD(L)                                                     MATI1140
   31 CONTINUE                                                          MATI1150
      IROCR=IROCR+1                                                     MATI1160
      IF(IROW-IROCR) 38,35,35                                           MATI1170
   35 IF(IS-1)37,36,36                                                  MATI1180
   36 ICOLT=ICOLT-1                                                     MATI1190
   37 GO TO 11                                                          MATI1200
   38 READ(5,1,END=999) CARD(1)                                         MATI1210
      IF(CARD(1)-9.E9)39,40,39                                          MATI1220
   39 IER=2                                                             MATI1230
   40 RETURN                                                            MATI1240
999	STOP
      END                                                               MATI1250