CFPRIME DPMAIN                                                          DPMAIN      1
C***********************************************************************RIGHTE      1
C*                                                                     *RIGHTE      2
C*               Output Analysis Program for ETMSP (OAP)               *RIGHTE      4
C*               =======================================               *RIGHTE      5
C*                                                                     *RIGHTE     11
C*        copyright @(1993) Electric Power Research Institute          *RIGHTE     12
C*                                                                     *RIGHTE     13
C* EPRI reserves all rights in the software and associated             *RIGHTE     14
C* documentation as delivered. The software and its associated         *RIGHTE     15
C* documention or any portion thereof may not be reproduced in any form*RIGHTE     16
C* whatsoever without the consent of EPRI, except as explicity provided*RIGHTE     17
C* for by license. Licensee shall submit a detailed description to EPRI*RIGHTE     18
C* of any changes or modifications to the software within two (2)      *RIGHTE     19
C* months after such changes or modifications are made. At EPRI's sole *RIGHTE     20
C* discretion, the software, as changed or modified, shall be given a  *RIGHTE     21
C* new designation sufficiently different from its then current        *RIGHTE     22
C* designation as to prevent mistake,confusion, or deception as between*RIGHTE     23
C* the current software as changed or modified.                        *RIGHTE     24
C*                                                                     *RIGHTE     25
C* A license under EPRI's rights in the software can be obtained       *RIGHTE     26
C* directly from EPRI.                                                 *RIGHTE     27
C*                                                                     *RIGHTE     28
C* This program and supporting materials may be independently available*RIGHTE     29
C* from Electric Power Software centre (EPSC) for an appropriate       *RIGHTE     30
C* distribution fee. The EPSC is a service of                          *RIGHTE     31
C*                                                                     *RIGHTE     32
C*                    Power Computing Company                          *RIGHTE     33
C*                    1930 Hi Line                                     *RIGHTE     34
C*                    Dallas, Tx 75207                                 *RIGHTE     35
C*                                                                     *RIGHTE     36
C* NEITHER EPRI, ANY MEMBER OF EPRI, NOR ANY PERSON OR  ORGANIZATION   *RIGHTE     37
C* ACTING ON BEHAVE OF THEM:                                           *RIGHTE     38
C*                                                                     *RIGHTE     39
C* 1. MAKE ANY WARRANTY OR REPRESENTATION WHATSOEVER, EXPRESS OR       *RIGHTE     40
C*    IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR FITNESS OR *RIGHTE     41
C*    ANY PURPOSE WITH RESPECT TO THE SOFTWARE OR ITS ASSOCIATED       *RIGHTE     42
C*    DOCUMENTATION; OR                                                *RIGHTE     43
C*                                                                     *RIGHTE     44
C* 2. ASSUMES ANY LIABILITY WHATSOEVER WITH RESPECT TO ANY USE OF THE  *RIGHTE     45
C*    SOFTWARE OR ITS ASSOCIATED DOCUMENTATION OR ANY PORTION THEREOF  *RIGHTE     46
C*    OR WITH RESPECT TO ANY DAMAGES WHICH MAY RESULT FROM SUCH USE.   *RIGHTE     47
C*                                                                     *RIGHTE     48
C* THIS NOTICE MAY NOT BE REMOVED FROM THE SOFTWARE BY ANY USER        *RIGHTE     49
C* THEREOF.                                                            *RIGHTE     50
C*                                                                     *RIGHTE     51
C***********************************************************************RIGHTE     52
       SUBROUTINE DPMAIN(IDO,NPLOT,ITERM,NOSCAX,NUS,NAX)                DPMAIN      3
CD                                                                      DPMAIN      4
CD         THIS IS THE MAIN FOR THE LINE PRINTER PLOT                   DPMAIN      5
CD                                                                      DPMAIN      6
CD         PARAMETERS :                                                 DPMAIN      7
CD                                                                      DPMAIN      8
CD         IDO - OPERATION CODES 1 = CLEAR PLOTTING PAGE.               DPMAIN      9
CD                               2 = DRAW GRID ON PLOTTING PAGE         DPMAIN     10
CD                               3 = PERFORM PLOTTING FROM XARAY/YARAY  DPMAIN     11
CD                               4 = COMPLETED CURRENT PLOT.            DPMAIN     12
CD                                                                      DPMAIN     13
CD         NPLOT - NUMBER OF VALID COLUMN IN THE 2 DIMENSIONAL YARAY    DPMAIN     14
CD                 EACH COLUMN IN THE YARAY(,) WILL GENERATE A CURVE    DPMAIN     15
CD                 THE PLOTTING PAGE.                                   DPMAIN     16
CD                                                                      DPMAIN     17
CD         NAX - 1,2,OR 3. COLUMN TO PRINT THE Y-AXIS TITLE AND SCALE   DPMAIN     18
CD               A MAXIMUN OF 3 DIFFERENT SCALES AND LABELS             DPMAIN     19
CD               NAX=1 IS THE FIRST COLUMN TO THE LEFT OF THE PLOT      DPMAIN     20
CD                       AREA.                                          DPMAIN     21
CD                                                                      DPMAIN     22
CD         ITERM = 0 => OUTPUT=132 COLUMNS ; ITERM=-1 = 80 COLUMNS      DPMAIN     23
CD                                                                      DPMAIN     24
CD         NOSCAX = -1 => DON'T SCALE X-AXIS (MULTI PLOT IS ACTIVE)     DPMAIN     25
CD                                                                      DPMAIN     26
CD         NUS  = 0 => DO AUTO SCALE ON XARAY AND YARAY                 DPMAIN     27
CD                                                                      DPMAIN     28
CD         NAX  = CURRENT Y-AXIS NUMBER                                 DPMAIN     29
CD                                                                      DPMAIN     30
CD GENERAL DESCRIPTION:                                                 DPMAIN     31
CD -------------------                                                  DPMAIN     32
CD PLOTTING DATA ARE PASSED BY 2 ARRAY IN NAMED COMMON /DPPAGE/.        DPMAIN     33
CD   XARAY(MXPT,MPLOT) - X-AXIS DATA (USUALLY THE TIME SCALE)           DPMAIN     34
CD   YARAY(MXPT,MPLOT) - Y-AXIS DATA. MAXIMUM OF MPLOT NUMBER OF CURVES DPMAIN     35
CD                                                                      DPMAIN     36
CD THE PLOTTING PAGE IS AN AREA OF (IXSEND-IXSTRT) BY (IYEND-IYSTRT) :  DPMAIN     37
CD                                                                      DPMAIN     38
CD                  --------------------------------                    DPMAIN     39
CD  (55)   IYEND -->|                              |                    DPMAIN     40
CD                  |                              |                    DPMAIN     41
CD                  |                              |                    DPMAIN     42
CD                  |                              |                    DPMAIN     43
CD        -----------                              |                    DPMAIN     44
CD  (5)    IYINC    |                              |                    DPMAIN     45
CD        -----------                              |                    DPMAIN     46
CD                  |                              |                    DPMAIN     47
CD  (5)    IYSTRT-->------------|-----|------------|                    DPMAIN     48
CD                  \            \   /             \                    DPMAIN     49
CD                   IXSTRT       \ IXINC           IXEND               DPMAIN     50
CD                    (30)           (10)           (130)               DPMAIN     51
CD                                                                      DPMAIN     52
CD ALL POINTS ARE PLOTTED IN THIS AREA BEFORE THE PAGE IS PRINTED TO A  DPMAIN     53
CD FILE OR PRINTER. THE CURRENT SIZE IS DEFINED IN THIS SUBROUTINE, BUT DPMAIN     54
CD COULD BE PASSED FROM THE MAIN CALLING ROUTINE.                       DPMAIN     55
CD                                                                      DPMAIN     56
C                                                                       DPMAIN     57
      INCLUDE 'PARAM.INS'                                               DPMAIN     58
      INCLUDE 'XYARAY.INS'                                              DPMAIN     59
      INCLUDE 'DPPLOT.INS'                                              DPMAIN     60
                                                                        DPMAIN     61
      IF (IDO.EQ.1) THEN                                                DPMAIN     62
         CALL DPPAGE                                                    DPMAIN     63
      ELSE IF (IDO.EQ.2) THEN                                           DPMAIN     64
         CALL DPGRID(IXSTRT,IXEND,IXINC,IYSTRT,IYEND,IYINC)             DPMAIN     65
      ELSE IF (IDO.EQ.3)THEN                                            DPMAIN     66
C      ...........................................................      DPMAIN     67
C      : DO AUTO SCALE OF XARAY (only if it's first plot on page):      DPMAIN     68
C      :                                                         :      DPMAIN     69
         IF(NOSCAX.NE.-1) THEN                                          DPMAIN     70
C           IF(NUS.EQ.0) THEN                                           DPMAIN     71
C              CALL DPYMAM(XARAY,MXPT,MAXPT,XMIN,XMAX)                  DPMAIN     72
C             TYPE *,'MIN X, MAX X : ',XMIN,XMAX                        DPMAIN     73
C           ENDIF                                                       DPMAIN     74
           CALL DPXSCA (XMAX,XMIN,IXSTRT,IXEND,IXINC,XDIV,              DPMAIN     75
     1          XSCALE,XTITLE,XSTRT,IYSTRT,NUS)                         DPMAIN     76
         ENDIF                                                          DPMAIN     77
C      :..........................................................:     DPMAIN     78
C      ............................................................     DPMAIN     79
C      : DO AUTO SCALE OF YARAY                                   :     DPMAIN     80
C      :                                                          :     DPMAIN     81
C         IF(NUS.EQ.0) THEN                                             DPMAIN     82
C           CALL DPYMAM(YARAY,MXPT,MAXPT,YMIN,YMAX,MXPLOT,1,NPLOT)      DPMAIN     83
C          TYPE *,'MIN Y, MAX Y : ',YMIN,YMAX                           DPMAIN     84
C         ENDIF                                                         DPMAIN     85
         CALL DPYSCA (YMAX(NAX),YMIN(NAX),IYSTRT,IYEND,IYINC,YDIV,      DPMAIN     86
     1          YSCALE,YTITLE(NAX),YSTRT(NAX),IXSTRT,NAX,IX,NUS)        DPMAIN     87
C      :..........................................................:     DPMAIN     88
         CALL DPPLT(YARAY,XARAY,MXPT,MAXPT,MXPLOT,NPLOT,                DPMAIN     89
     1   YDIV,XDIV,IYSTRT,IXSTRT,YSTRT(NAX),XSTRT,NP,IX,IXEND,          DPMAIN     90
     1   IYEND,NAX)                                                     DPMAIN     91
         CALL DPEXTR(NAX)                                               DPMAIN     92
      ELSE                                                              DPMAIN     93
         IF(ITERM.EQ.0) WRITE(ROWCOL(1)(31:131),1230) PTITLE(1)         DPMAIN     94
         NLINES=IYEND+5                                                 DPMAIN     95
         CALL DPOUT(NLINES,IDPDEV,ITERM)                                DPMAIN     96
C        : ITERM=0 132 COLUMN. ITERM=-1 80 COLUMN)                      DPMAIN     97
      ENDIF                                                             DPMAIN     98
 1230 FORMAT(A)                                                         DPMAIN     99
      RETURN                                                            DPMAIN    100
      END                                                               DPMAIN    101
                                                                        DPMAIN    102
      SUBROUTINE DPPAGE                                                 DPMAIN    103
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    104
CD                                                                      DPMAIN    105
CD             THIS ROUTINE INITIALIZES THE PLOTTING PAGE WITH BLANKS   DPMAIN    106
CD             FOR THE LINE PRINTER PLOT                                DPMAIN    107
CD                                                                      DPMAIN    108
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    109
      CHARACTER*132 ROWCOL(120)                                         DPMAIN    110
      COMMON /PDPAGE/ ROWCOL                                            DPMAIN    111
      DO 10 IY=1,120                                                    DPMAIN    112
         ROWCOL(IY)=' '                                                 DPMAIN    113
 10   CONTINUE                                                          DPMAIN    114
      RETURN                                                            DPMAIN    115
      END                                                               DPMAIN    116
                                                                        DPMAIN    117
      SUBROUTINE DPGRID(IXSTRT,IXEND,IXINC,IYSTRT,IYEND,IYINC)          DPMAIN    118
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    119
CD                                                                      DPMAIN    120
CD            THIS ROUTINE PREPARES GRID ON THE PLOTTING PAGE FOR       DPMAIN    121
CD            A LINE PRINT PLOT                                         DPMAIN    122
CD                                                                      DPMAIN    123
CD            CALLING PARAMETERS:                                       DPMAIN    124
CD                                                                      DPMAIN    125
CD                 IXSTRT,IYSTRT: STARTING X AND Y POSITIONS ON         DPMAIN    126
CD                                PLOT PAGE                             DPMAIN    127
CD                 IXEND,IYEND  : ENDING X AND Y POSITIONS ON PLOT PAGE DPMAIN    128
CD                 IXINC,IYINC  : INCREMENT X AND Y                     DPMAIN    129
CD                                                                      DPMAIN    130
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    131
C                                                                       DPMAIN    132
      CHARACTER*132 ROWCOL(120)                                         DPMAIN    133
      COMMON /PDPAGE/ ROWCOL                                            DPMAIN    134
C     ..................................................................DPMAIN    135
C     : DRAW VERTICAL BAR. NOTE: IN SOME LINE PRINTERS THE VERTICAL BAR DPMAIN    136
C     : PRINTED AS A '/' CHARACTER.                                     DPMAIN    137
C     :.................................................................DPMAIN    138
      IF(IXSTRT.EQ.0)RETURN                                             DPMAIN    139
      DO 10 IX=IXSTRT,IXEND,IXINC                                       DPMAIN    140
         DO 20 IY=IYSTRT,IYEND                                          DPMAIN    141
            ROWCOL(IY)(IX:IX)='|'                                       DPMAIN    142
 20      CONTINUE                                                       DPMAIN    143
 10   CONTINUE                                                          DPMAIN    144
C     ............................                                      DPMAIN    145
C     : DRAW HORIZONAL LINE      :                                      DPMAIN    146
C     :..........................:                                      DPMAIN    147
      DO 40 IY=IYSTRT,IYEND,IYINC                                       DPMAIN    148
         DO 30 IX=IXSTRT,IXEND                                          DPMAIN    149
            ROWCOL(IY)(IX:IX)='-'                                       DPMAIN    150
 30      CONTINUE                                                       DPMAIN    151
 40   CONTINUE                                                          DPMAIN    152
C     .......................................................           DPMAIN    153
C     : DRAW VERTICAL AND HORIZONAL INTERSECTIONS WITH '+'  :           DPMAIN    154
C     :.....................................................:           DPMAIN    155
      IYP1=IYSTRT                                                       DPMAIN    156
      IYM1=IYEND-IYINC                                                  DPMAIN    157
      IXP1=IXSTRT+IXINC                                                 DPMAIN    158
      IXM1=IXEND-IXINC                                                  DPMAIN    159
      DO 50 IY=IYP1,IYM1,IYINC                                          DPMAIN    160
         DO 60 IX=IXP1,IXM1,IXINC                                       DPMAIN    161
            ROWCOL(IY)(IX:IX)='+'                                       DPMAIN    162
 60      CONTINUE                                                       DPMAIN    163
 50   CONTINUE                                                          DPMAIN    164
      RETURN                                                            DPMAIN    165
      END                                                               DPMAIN    166
                                                                        DPMAIN    167
      SUBROUTINE DPXAXI(IROW,ISTRT,IEND,INC,REALX,REALXI,TITLE)         DPMAIN    168
CD                                                                      DPMAIN    169
CD           THIS ROUTINE DRAWS X-AXIS AND X AXIS TITLE FOR THE         DPMAIN    170
CD           LINE PRINTER PLOT.                                         DPMAIN    171
CD                                                                      DPMAIN    172
CD           CALLING PARAMETERS :                                       DPMAIN    173
CD                                                                      DPMAIN    174
CD                         ROW   - Y LOCATION OF AXIS                   DPMAIN    175
CD                         ISTRT - X=0 LOCATION (IN RELATION ON         DPMAIN    176
CD                                     REAL 0 ON PAGE)                  DPMAIN    177
CD                         IEND  - MAXIMUM X LOCATION.                  DPMAIN    178
CD                         INC   - LABEL PRINTED AT INC SPACING         DPMAIN    179
CD                         REALX - STARTING X VALUE (IE PRINTS REALX    DPMAIN    180
CD                                 AT ISTRT),( PRINTS 0.0 AT IX=30)     DPMAIN    181
CD                         REALXI- INCREMENT OF REALX.                  DPMAIN    182
CD                         TITLE - TITLE OF X-AXIS                      DPMAIN    183
CD                                                                      DPMAIN    184
C                                                                       DPMAIN    185
      CHARACTER*(*) TITLE                                               DPMAIN    186
      CHARACTER*132 ROWCOL(120)                                         DPMAIN    187
      COMMON /PDPAGE/ ROWCOL                                            DPMAIN    188
      REAL*4 RVAL                                                       DPMAIN    189
      CHARACTER*6 CVAL                                                  DPMAIN    190
C     .................................................                 DPMAIN    191
C     : FIND LENGTH AND CENTRES THE TITLE ALONG X-AXIS:                 DPMAIN    192
C     :...............................................:                 DPMAIN    193
      LEN=LENSTR(TITLE,80)                                              DPMAIN    194
C!                                                                      DPMAIN    195
      IEMS=IEND-ISTRT                                                   DPMAIN    196
      IF(LEN.GT.IEMS) LEN=IEMS                                          DPMAIN    197
      LENCTR=(IEMS/2+ISTRT)-LEN/2                                       DPMAIN    198
C!                                                                      DPMAIN    199
C      LENCTR=((IEND-ISTRT)/2+ISTRT)-LEN/2                              DPMAIN    200
      LENEND=LENCTR+LEN                                                 DPMAIN    201
      ROWCOL(IROW-1)(LENCTR:LENEND)=TITLE(1:LEN)                        DPMAIN    202
C     ............................                                      DPMAIN    203
C     : PRINTS THE X-AXIS LABELS :                                      DPMAIN    204
C     :..........................:                                      DPMAIN    205
      RVAL=REALX                                                        DPMAIN    206
      DO 60 IX=ISTRT,IEND-INC,INC                                       DPMAIN    207
         WRITE(CVAL,100) RVAL                                           DPMAIN    208
         ROWCOL(IROW)(IX-3:IX+3)=CVAL                                   DPMAIN    209
         RVAL=RVAL+REALXI                                               DPMAIN    210
 60   CONTINUE                                                          DPMAIN    211
 100  FORMAT(F6.2)                                                      DPMAIN    212
      RETURN                                                            DPMAIN    213
      END                                                               DPMAIN    214
      INTEGER FUNCTION LENSTR (LINE,MAXLEN)                             DPMAIN    215
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    216
CD                                                                      DPMAIN    217
CD             THIS UTILITY FUNCTION IS TO DETERMINE LENGTH OF STRING   DPMAIN    218
CD                                                                      DPMAIN    219
CD             CALLING PARAMETER :                                      DPMAIN    220
CD                                                                      DPMAIN    221
CD                       LINE    : INCOMING CHARACTER STRING            DPMAIN    222
CD                       MAXLEN  : MAX. LENGHT OF THE INCOMING          DPMAIN    223
CD                                 CHARACTER STRING                     DPMAIN    224
CD                       LENSTR  : LENGTH OF THE STRING                 DPMAIN    225
CD                                                                      DPMAIN    226
      CHARACTER*(*) LINE                                                DPMAIN    227
      DO 10 I=MAXLEN,1,-1                                               DPMAIN    228
         IF (LINE(I:I).NE.' ') GOTO 20                                  DPMAIN    229
 10   CONTINUE                                                          DPMAIN    230
 20   CONTINUE                                                          DPMAIN    231
      LENSTR=I                                                          DPMAIN    232
      RETURN                                                            DPMAIN    233
      END                                                               DPMAIN    234
                                                                        DPMAIN    235
      SUBROUTINE DPYAXI(IX,ISTRT,IEND,INC,REALY,REALYI,TITLE)           DPMAIN    236
CD                                                                      DPMAIN    237
CD          THIS ROUTINE DRAWS Y-AXIS AND Y AXIS TITLE FOR              DPMAIN    238
CD          THE LINE PRINTER PLOT.                                      DPMAIN    239
CD                                                                      DPMAIN    240
CD          CALLING PARAMETERS :                                        DPMAIN    241
CD                                                                      DPMAIN    242
CD                        ISTRT - HARD FIRST ROW.                       DPMAIN    243
CD                        IEND  - HARD LAST ROW.                        DPMAIN    244
CD                        INC   - HARD INCREMENT.                       DPMAIN    245
CD                        REALY - FIRST VALUE OF Y.                     DPMAIN    246
CD                        REALYI- INCREMENT OF Y.                       DPMAIN    247
CD                        TITLE - Y-AXIS TITLE                          DPMAIN    248
CD                                                                      DPMAIN    249
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    250
C                                                                       DPMAIN    251
      CHARACTER*(*) TITLE                                               DPMAIN    252
      CHARACTER*132 ROWCOL(120)                                         DPMAIN    253
      COMMON /PDPAGE/ ROWCOL                                            DPMAIN    254
      REAL*4 RVAL                                                       DPMAIN    255
      CHARACTER*8 CVAL                                                  DPMAIN    256
C     .................................................                 DPMAIN    257
C     : FIND LENGTH AND CENTRES THE TITLE ALONG Y-AXIS:                 DPMAIN    258
C     :...............................................:                 DPMAIN    259
      LEN=LENSTR(TITLE,50)                                              DPMAIN    260
C!                                                                      DPMAIN    261
      IEMS=IEND-ISTRT                                                   DPMAIN    262
      IF(LEN.GT.IEMS) LEN=IEMS                                          DPMAIN    263
      LENCTR=(IEMS/2+ISTRT)-LEN/2                                       DPMAIN    264
C!                                                                      DPMAIN    265
      LENEND=LENCTR+LEN                                                 DPMAIN    266
C      TYPE*,'LEN,LENCTR,LENEND : ',LEN,LENCTR,LENEND                   DPMAIN    267
      IXT=IX-1                                                          DPMAIN    268
      IA=LEN+1                                                          DPMAIN    269
      DO 50 I=LENCTR,LENEND-1                                           DPMAIN    270
         IA=IA-1                                                        DPMAIN    271
         IF(IA.LE.0) GOTO 55                                            DPMAIN    272
         ROWCOL(I)(IXT:IXT)=TITLE(IA:IA)                                DPMAIN    273
 50   CONTINUE                                                          DPMAIN    274
 55   CONTINUE                                                          DPMAIN    275
C     ............................                                      DPMAIN    276
C     : PRINTS THE Y-AXIS LABELS :                                      DPMAIN    277
C     :..........................:                                      DPMAIN    278
      RVAL=REALY                                                        DPMAIN    279
      DO 60 IY=ISTRT,IEND,INC                                           DPMAIN    280
         IF((ABS(RVAL).GT.99.)) THEN                                    DPMAIN    281
            WRITE(CVAL,110) RVAL                                        DPMAIN    282
         ELSE                                                           DPMAIN    283
            WRITE(CVAL,100) RVAL                                        DPMAIN    284
         ENDIF                                                          DPMAIN    285
         ROWCOL(IY)(IX:IX+7)=CVAL                                       DPMAIN    286
         RVAL=RVAL+REALYI                                               DPMAIN    287
 60   CONTINUE                                                          DPMAIN    288
 100  FORMAT(F8.3)                                                      DPMAIN    289
 110  FORMAT(F8.1)                                                      DPMAIN    290
      RETURN                                                            DPMAIN    291
      END                                                               DPMAIN    292
      SUBROUTINE DPXMAM(XARAY,MXPT,XMIN,XMAX)                           DPMAIN    293
CD                                                                      DPMAIN    294
CD            THIS ROUTINE SCANS THE XARRAY TO DETERMINE MAX AND        DPMAIN    295
CD            MIN VALUES FOR THE LINE PRINTER PLOT.                     DPMAIN    296
CD                                                                      DPMAIN    297
CD            CALLING PARAMETERS :                                      DPMAIN    298
CD                                                                      DPMAIN    299
CD                   YARAY(MXPT) - ARRAY OF X VALUES                    DPMAIN    300
CD                   MXPT        - MAXIMUM # OF POINTS                  DPMAIN    301
CD                   XMIN,XMAX   - MAX/MIN VALUES RETURN TO             DPMAIN    302
CD                                 CALLING ROUTINE                      DPMAIN    303
CD                                                                      DPMAIN    304
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    305
      REAL XARAY(MXPT)                                                  DPMAIN    306
      XMIN=99999.99                                                     DPMAIN    307
      XMAX=-99999.99                                                    DPMAIN    308
C                                                                       DPMAIN    309
      DO 10 I=1,MXPT                                                    DPMAIN    310
         IF(XARAY(I).LT.XMIN) XMIN=XARAY(I)                             DPMAIN    311
         IF(XARAY(I).GT.XMAX) XMAX=XARAY(I)                             DPMAIN    312
 10   CONTINUE                                                          DPMAIN    313
      RETURN                                                            DPMAIN    314
      END                                                               DPMAIN    315
                                                                        DPMAIN    316
      SUBROUTINE DPXMAZ(XARAY,MXPT,MAXPT,X1,X2,IDX1,IDX2,               DPMAIN    317
     1MXPLOT,NF,NPLOT)                                                  DPMAIN    318
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    319
CD                                                                      DPMAIN    320
CD            THIS ROUTINE SCANS XARRAY TO DETERMINE THE MAX AND MIN    DPMAIN    321
CD            VALUES IN THE ARRAY. IT ALSO DETERMINES THE INDEX OF      DPMAIN    322
CD            START OF X1 AND THE END OF X2 FOR THE LINE PRINTER PLOT   DPMAIN    323
CD                                                                      DPMAIN    324
CD                                                                      DPMAIN    325
CD            CALLING PARAMETERS :                                      DPMAIN    326
CD                                                                      DPMAIN    327
CD                   XARAY  - ARRAY OF X VALUES                         DPMAIN    328
CD                   MAXPT  - MAXIMUM # OF POINTS                       DPMAIN    329
CD                   X1,X2  - RANGE LIMIT OF X VARIBLE                  DPMAIN    330
CD               IDX1,IDX2  - INDEX OF START OF X1, AND END OF X2       DPMAIN    331
CD                NF,NPLOT  - STARTING AND ENDING CURVE TO BE SCANNED   DPMAIN    332
CD                                                                      DPMAIN    333
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    334
      REAL XARAY(MXPT,MXPLOT)                                           DPMAIN    335
      INTEGER IDX1(MXPLOT),IDX2(MXPLOT)                                 DPMAIN    336
      INTEGER MAXPT(MXPLOT)                                             DPMAIN    337
      XMIN=99999.99                                                     DPMAIN    338
      XMAX=-99999.99                                                    DPMAIN    339
                                                                        DPMAIN    340
      DO 20 J=NF,NPLOT                                                  DPMAIN    341
      DO 5 IDX=1,MAXPT(J)                                               DPMAIN    342
        IF(XARAY(IDX,J).GE.X1)GOTO 6                                    DPMAIN    343
 5    CONTINUE                                                          DPMAIN    344
C     if ended here, it's an error. Set default to 1.                   DPMAIN    345
      IDX1(J)=1                                                         DPMAIN    346
                                                                        DPMAIN    347
 6    CONTINUE                                                          DPMAIN    348
      IDX1(J)=IDX                                                       DPMAIN    349
      DO 7 IDX=IDX1(J),MAXPT(J)                                         DPMAIN    350
        IF(XARAY(IDX,J).GE.X2)GOTO 8                                    DPMAIN    351
 7    CONTINUE                                                          DPMAIN    352
C     if ended here, it's an error. Set default to 1.                   DPMAIN    353
      IDX2(J)=MAXPT(J)                                                  DPMAIN    354
      GOTO 20                                                           DPMAIN    355
 8    CONTINUE                                                          DPMAIN    356
      IDX2(J)=IDX                                                       DPMAIN    357
 20     CONTINUE                                                        DPMAIN    358
      DO 30 J=NF,NPLOT                                                  DPMAIN    359
      DO 10 I=IDX1(J),IDX2(J)                                           DPMAIN    360
         IF(XARAY(I,J).LT.XMIN) XMIN=XARAY(I,J)                         DPMAIN    361
         IF(XARAY(I,J).GT.XMAX) XMAX=XARAY(I,J)                         DPMAIN    362
 10   CONTINUE                                                          DPMAIN    363
 30   CONTINUE                                                          DPMAIN    364
      X1=XMIN                                                           DPMAIN    365
      X2=XMAX                                                           DPMAIN    366
      RETURN                                                            DPMAIN    367
      END                                                               DPMAIN    368
                                                                        DPMAIN    369
      SUBROUTINE DPYMAZ(YARAY,MXPT,MAXPT,YMIN,YMAX,IX1,IX2,             DPMAIN    370
     1MXPLOT,NF,NPLOT)                                                  DPMAIN    371
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    372
CD                                                                      DPMAIN    373
CD                                                                      DPMAIN    374
CD            THIS ROUTINE SCANS YARRAY TO DETERMINE THE MAX AND MIN    DPMAIN    375
CD            VALUES IN THE ARRAY.                                      DPMAIN    376
CD                                                                      DPMAIN    377
CD            CALLING PARAMETERS :                                      DPMAIN    378
CD                                                                      DPMAIN    379
CD             YARAY(MXPT,MXPLOT)  - ARRAY OF Y VALUES                  DPMAIN    380
CD                          MAXPT  - MAXIMUM # OF POINTS                DPMAIN    381
CD                      YMIN,YMAX  - MAX/MIN VALUES RETURN TO CALLING   DPMAIN    382
CD                                   ROUTINE                            DPMAIN    383
CD                       IX1,IX2   - INDEX OF START OF X1 AND END OF X2 DPMAIN    384
CD                             NF  - STARING CURVE NUMBER               DPMAIN    385
CD                          NPLOT  - ACTUAL NUMBER OF COLUMNS IN YARAY  DPMAIN    386
CD                                                                      DPMAIN    387
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    388
      REAL YARAY(MXPT,MXPLOT)                                           DPMAIN    389
      INTEGER IX1(MXPLOT),IX2(MXPLOT)                                   DPMAIN    390
      INTEGER MAXPT(MXPLOT)                                             DPMAIN    391
      YMIN=99999.99                                                     DPMAIN    392
      YMAX=-99999.99                                                    DPMAIN    393
                                                                        DPMAIN    394
      DO 20 J=NF,NPLOT                                                  DPMAIN    395
        DO 10 I=IX1(J),IX2(J)                                           DPMAIN    396
           IF(YARAY(I,J).LT.YMIN) YMIN=YARAY(I,J)                       DPMAIN    397
           IF(YARAY(I,J).GT.YMAX) YMAX=YARAY(I,J)                       DPMAIN    398
 10     CONTINUE                                                        DPMAIN    399
 20   CONTINUE                                                          DPMAIN    400
      RETURN                                                            DPMAIN    401
      END                                                               DPMAIN    402
                                                                        DPMAIN    403
      SUBROUTINE DPYMAM(YARAY,MXPT,MAXPT,YMIN,YMAX,MXPLOT,NF,NPLOT)     DPMAIN    404
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    405
CD                                                                      DPMAIN    406
CD           THIS ROUTINE SCANS YARRAY TO DETERMINE MAX AND MIN         DPMAIN    407
CD           VALUES FOR THE LINE PRINTER PLOT.                          DPMAIN    408
CD                                                                      DPMAIN    409
CD           CALLING PARAMETERS :                                       DPMAIN    410
CD                                                                      DPMAIN    411
CD              YARAY(MXPT,MXPLOT) - ARRAY OF Y VALUES                  DPMAIN    412
CD                          MAXPT  - MAXIMUM # OF POINTS                DPMAIN    413
CD                      YMIN,YMAX  - THE DETERMINED MAX/MIN VALUES      DPMAIN    414
CD                             NF  - STARTING CURVE NUMBER              DPMAIN    415
CD                          NPLOT  - ACTUAL NUMBER OF COLUMNS IN YARAY  DPMAIN    416
CD                                                                      DPMAIN    417
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    418
      REAL YARAY(MXPT,MXPLOT)                                           DPMAIN    419
      INTEGER MAXPT(MXPLOT)                                             DPMAIN    420
      YMIN=99999.99                                                     DPMAIN    421
      YMAX=-99999.99                                                    DPMAIN    422
                                                                        DPMAIN    423
      DO 20 J=NF,NPLOT                                                  DPMAIN    424
        DO 10 I=1,MAXPT(J)                                              DPMAIN    425
           IF(YARAY(I,J).LT.YMIN) YMIN=YARAY(I,J)                       DPMAIN    426
           IF(YARAY(I,J).GT.YMAX) YMAX=YARAY(I,J)                       DPMAIN    427
 10     CONTINUE                                                        DPMAIN    428
 20   CONTINUE                                                          DPMAIN    429
      RETURN                                                            DPMAIN    430
      END                                                               DPMAIN    431
                                                                        DPMAIN    432
      SUBROUTINE DPOUT(ISIZE,IDPDEV,ITERM)                              DPMAIN    433
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    434
CD                                                                      DPMAIN    435
CD            THE ROUTINE OUTPUTS THE FINISHED LINE PRINTER PLOT.       DPMAIN    436
CD                                                                      DPMAIN    437
CD            CALLING PARAMETERS :                                      DPMAIN    438
CD                                                                      DPMAIN    439
CD                        ISIZE  - SIZE OF THE PLOT                     DPMAIN    440
CD                        IDPDEV - OUTPUT LOGICAL UNIT                  DPMAIN    441
CD                        ITERM  - FLAG FOR OUTPUT SIZE                 DPMAIN    442
CD                                 0 : 132 COLUMN                       DPMAIN    443
CD                                -1 : 80  COLUMN                       DPMAIN    444
CD                                                                      DPMAIN    445
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    446
      CHARACTER*132 ROWCOL(120)                                         DPMAIN    447
      COMMON /PDPAGE/ ROWCOL                                            DPMAIN    448
                                                                        DPMAIN    449
      IF(ITERM.EQ.0) THEN                                               DPMAIN    450
         DO 20 IY=119,61,-1                                             DPMAIN    451
            WRITE(IDPDEV,100)ROWCOL(IY)                                 DPMAIN    452
 20      CONTINUE                                                       DPMAIN    453
      ENDIF                                                             DPMAIN    454
                                                                        DPMAIN    455
      DO 10 IY=ISIZE,1,-1                                               DPMAIN    456
         IF (ITERM.EQ.-1)THEN                                           DPMAIN    457
            WRITE(IDPDEV,100)ROWCOL(IY)(1:80)                           DPMAIN    458
         ELSE                                                           DPMAIN    459
            WRITE(IDPDEV,100)ROWCOL(IY)                                 DPMAIN    460
         ENDIF                                                          DPMAIN    461
 10   CONTINUE                                                          DPMAIN    462
                                                                        DPMAIN    463
 100  FORMAT(A)                                                         DPMAIN    464
      RETURN                                                            DPMAIN    465
      END                                                               DPMAIN    466
                                                                        DPMAIN    467
      SUBROUTINE DPXSCA(XMAX,XMIN,IXSTRT,IXEND,IXINC,XDIV,XSCALE,XTIT,  DPMAIN    468
     1                  XSTRT,IYSTRT,NUS)                               DPMAIN    469
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    470
CD                                                                      DPMAIN    471
CD              THIS ROUTINE PREPARES THE X-AXIS SCALE.                 DPMAIN    472
CD                                                                      DPMAIN    473
CD              CALLING PARAMETERS :                                    DPMAIN    474
CD                                                                      DPMAIN    475
CD                       XMAX,XMIN - MAX/MIN VALUES OF THE X ARRAY      DPMAIN    476
CD              IXSTRT,IXEND,IXINC - START/END/INCREMENT OF X-AXIS      DPMAIN    477
CD                             XDIV - RETURNS VALUE/DIVISION ON X AXIS  DPMAIN    478
CD                           XSCALE - RETURNS SCALING FACTOR FOR X ARRAYDPMAIN    479
CD                                                                      DPMAIN    480
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    481
      CHARACTER*(*) XTIT                                                DPMAIN    482
      REAL XNICE(41)                                                    DPMAIN    483
      DATA XNICE /-8000.0, -5000.0, -2000.0, -1000.0,                   DPMAIN    484
     1             -800.0,  -500.0,  -200.0,  -100.0,                   DPMAIN    485
     1              -80.0,   -50.0,   -20.0,   -10.0,                   DPMAIN    486
     1               -8.0,    -5.0,    -2.0,    -1.0,                   DPMAIN    487
     1                -.8,     -.5,     -.2,     -.1,                   DPMAIN    488
     1                 0.0,                                             DPMAIN    489
     1                 .1,      .2,      .5,      .8,                   DPMAIN    490
     1                1.0,     2.0,     5.0,     8.0,                   DPMAIN    491
     1               10.0,    20.0,    50.0,    80.0,                   DPMAIN    492
     1              100.0,   200.0,   500.0,   800.0,                   DPMAIN    493
     1             1000.0,  2000.0,  5000.0,  8000.0   /                DPMAIN    494
      XMTOM=XMAX-XMIN                                                   DPMAIN    495
      IF(NUS.EQ.0) THEN                                                 DPMAIN    496
         XMTOM1=XMTOM+XMIN                                              DPMAIN    497
         DO 10 I=1,16                                                   DPMAIN    498
            IF (XMTOM1.LE.XNICE(I)) THEN                                DPMAIN    499
               XMTOM=XNICE(I)                                           DPMAIN    500
               GOTO 20                                                  DPMAIN    501
            ENDIF                                                       DPMAIN    502
  10     CONTINUE                                                       DPMAIN    503
      ENDIF                                                             DPMAIN    504
  20  CONTINUE                                                          DPMAIN    505
      XDIV=XMTOM/REAL(IXEND-IXSTRT)                                     DPMAIN    506
      XDIVSC=XDIV*REAL(IXINC)                                           DPMAIN    507
      XSTRT=XMIN                                                        DPMAIN    508
      XSCALE=REAL((IXEND-IXSTRT))/XMTOM                                 DPMAIN    509
C      TYPE *,'XMTOM,XDIV,XDIVSC,XSTRT = ',XMTOM,XDIV,XDIVSC,XSTRT      DPMAIN    510
      LOCAXI=IYSTRT-1                                                   DPMAIN    511
      CALL DPXAXI(LOCAXI, IXSTRT,IXEND,IXINC,XSTRT,XDIVSC, XTIT)        DPMAIN    512
      RETURN                                                            DPMAIN    513
      END                                                               DPMAIN    514
                                                                        DPMAIN    515
      SUBROUTINE DPYSCA(YMAX,YMIN,IYSTRT,IYEND,IYINC,YDIV,YSCALE,YTIT,  DPMAIN    516
     1                  YSTRT,IXSTRT,ICOL,IX,NUS)                       DPMAIN    517
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    518
CD                                                                      DPMAIN    519
CD              THIS ROUTINE PREPARES THE Y-AXIS SCALE.                 DPMAIN    520
CD                                                                      DPMAIN    521
CD              CALLING PARAMETERS :                                    DPMAIN    522
CD                                                                      DPMAIN    523
CD                       YMAX,YMIN - MAX/MIN VALUES OF THE Y ARRAYS     DPMAIN    524
CD              IYSTRT,IYEND,IYINC - START/END/INCREMENT OF Y-AXIS      DPMAIN    525
CD                            YDIV - RETURNS VALUE/DIVISION ON X AXIS   DPMAIN    526
CD                          YSCALE - RETURNS SCALING FACTOR FOR X ARRAY DPMAIN    527
CD                          IXSTRT - LOCATION OF SOFT X ORIGIN.         DPMAIN    528
CD                            ICOL - COLUMN LOCATION FOR WRITING THE    DPMAIN    529
CD                                   Y-AXIS LABEL (MAX 6)               DPMAIN    530
CD                                                                      DPMAIN    531
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    532
C                                                                       DPMAIN    533
      CHARACTER*(*) YTIT                                                DPMAIN    534
                                                                        DPMAIN    535
      REAL YINC(40)                                                     DPMAIN    536
      REAL YNICE(109)                                                   DPMAIN    537
      DATA YNICE /                                                      DPMAIN    538
     1-9000., -8000.,-7000.,-6000.,-5000.,-4000.,-3000.,-2000.,-1000.,  DPMAIN    539
     1 -900.,  -800., -700., -600., -500., -400., -300., -200., -100.,  DPMAIN    540
     1  -90.,   -80.,  -70.,  -60.,  -50.,  -40.,  -30.,  -20.,  -10.,  DPMAIN    541
     1   -9.,    -8.,   -7.,   -6.,   -5.,   -4.,   -3.,   -2.,   -1.,  DPMAIN    542
     1    -.9,    -.8,   -.7,   -.6,   -.5,   -.4,   -.3,   -.2,   -.1, DPMAIN    543
     1    -.09,   -.08,  -.07,  -.06,  -.05,  -.04,  -.03,  -.02, -.01, DPMAIN    544
     1      0.0,                                                        DPMAIN    545
     1    .01, .02,   .03,  .04,  .05,  .06,  .07,  .08,  .09,          DPMAIN    546
     1    .1,  .2,    .3,   .4,   .5,   .6,   .7,   .8,   .9,           DPMAIN    547
     1   1.,  2.,    3.,   4.,   5.,   6.,   7.,   8.,   9.,            DPMAIN    548
     1  10.,  20.,  30.,  40.,  50.,  60.,  70.,  80.,  90.,            DPMAIN    549
     1 100., 200., 300., 400., 500., 600., 700., 800., 900.,            DPMAIN    550
     11000.,2000.,3000.,4000.,5000.,6000.,7000.,8000.,9000  /           DPMAIN    551
                                                                        DPMAIN    552
      DATA YINC /                                                       DPMAIN    553
     1     .001,  .002,  .004,  .006,  .008,                            DPMAIN    554
     1     .01,   .02,   .04,   .06,   .08,                             DPMAIN    555
     1     .1,    .2,    .4,    .6,    .8,                              DPMAIN    556
     1    1.,    2.,    4.,    6.,    8.,                               DPMAIN    557
     1   10.,   20.,   40.,   60.,   80.,                               DPMAIN    558
     1  100.,  200.,  400.,  600.,  800.,                               DPMAIN    559
     1 1000., 2000., 4000., 5000., 8000.,                               DPMAIN    560
     110000.,20000.,40000.,50000.,60000./                               DPMAIN    561
C     .................................                                 DPMAIN    562
C     : DETERMINE MAX/MIN NICE NUMBER :                                 DPMAIN    563
C     :...............................:                                 DPMAIN    564
      IF(NUS.EQ.0) THEN                                                 DPMAIN    565
         DO 10 I=1,109                                                  DPMAIN    566
            IF (YMIN.LE.YNICE(I)) THEN                                  DPMAIN    567
               YLOW=YNICE(I-1)                                          DPMAIN    568
               GOTO 20                                                  DPMAIN    569
            ENDIF                                                       DPMAIN    570
  10     CONTINUE                                                       DPMAIN    571
  20     CONTINUE                                                       DPMAIN    572
         DO 30 I=1,35                                                   DPMAIN    573
            YYY=YLOW+YINC(I)                                            DPMAIN    574
            IF (YMAX.LE.YYY) THEN                                       DPMAIN    575
               YHI=YYY                                                  DPMAIN    576
               GOTO 40                                                  DPMAIN    577
            ENDIF                                                       DPMAIN    578
  30     CONTINUE                                                       DPMAIN    579
      ELSE                                                              DPMAIN    580
         YHI=YMAX                                                       DPMAIN    581
         YLOW=YMIN                                                      DPMAIN    582
      ENDIF                                                             DPMAIN    583
  40  CONTINUE                                                          DPMAIN    584
C     ............................                                      DPMAIN    585
C     : CALCULATE DIVISION/SCALE :                                      DPMAIN    586
C     ............................                                      DPMAIN    587
      YDIV=(YHI-YLOW)/REAL(IYEND-IYSTRT)                                DPMAIN    588
      YDIVSC=YDIV*REAL(IYINC)                                           DPMAIN    589
      YSTRT=YLOW                                                        DPMAIN    590
      YSCALE=REAL((IYEND-IYSTRT))/(YHI-YLOW)                            DPMAIN    591
C     ...................................................               DPMAIN    592
C     : DETERMINE LOCATION OF THE COLUMN TO WRITE LABEL :               DPMAIN    593
C     :.................................................:               DPMAIN    594
      IX=IXSTRT-(ICOL-1)*10-8                                           DPMAIN    595
      IF (IX.LT.2) IX=2                                                 DPMAIN    596
      CALL DPYAXI(IX, IYSTRT,IYEND,IYINC,YSTRT,YDIVSC, YTIT)            DPMAIN    597
      RETURN                                                            DPMAIN    598
      END                                                               DPMAIN    599
                                                                        DPMAIN    600
      SUBROUTINE DPPLT(YARAY,XARAY,MXPT,MAXPT,MXPLOT,NPLOT,             DPMAIN    601
     1     YDIV,XDIV,IYSTRT,IXSTRT,YSTRT,XSTRT,NP,IXL,IXEND,IYEND,NAX)  DPMAIN    602
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    603
CD                                                                      DPMAIN    604
CD            THIS ROUTINE PLOTS THE X,Y POINTS FOR THE PRINTER PLOT.   DPMAIN    605
CD                                                                      DPMAIN    606
CD            CALLING PARAMETERS :                                      DPMAIN    607
CD                                                                      DPMAIN    608
CD             XARAY(MXPT,MXPLOT) - X ARRAYS TO BE PLOTTED              DPMAIN    609
CD             YARAY(MXPT,MXPLOT) - Y ARRAYS TO BE PLOTTED              DPMAIN    610
CD                          MAXPT - NUMBER OF DATA POINTS IN X/Y ARRAYS.DPMAIN    611
CD                          NPLOT - NUMBER OF COLUMNS IN YARAY(XX,OO)   DPMAIN    612
CD                      XDIV,YDIV - X/Y DIVISIONS ON GRID.              DPMAIN    613
CD                  IXSTRT,IYSTRT - STARTING POINT OF X AND Y ON PAGE.  DPMAIN    614
CD                   XSTRT,YSTRT - SCALED VALUE AT IXSTRT AND IYSTRT    DPMAIN    615
CD                            NP - PLOT SYMBOL                          DPMAIN    616
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    617
C                                                                       DPMAIN    618
      REAL XARAY(MXPT,MXPLOT),YARAY(MXPT,MXPLOT)                        DPMAIN    619
      INTEGER MAXPT(MXPLOT)                                             DPMAIN    620
      CHARACTER*1 CNC                                                   DPMAIN    621
      CHARACTER*132 ROWCOL(120)                                         DPMAIN    622
      COMMON /PDPAGE/ ROWCOL                                            DPMAIN    623
*IF MIBM                                                                DPMAIN    624
*ENDIF                                                                  DPMAIN    629
      LASTIX=9999                                                       DPMAIN    630
C     ..............................................                    DPMAIN    631
C     : IXLAB -> X-COORDINATE ON Y-AXIS FOR SYMBOL :                    DPMAIN    632
C     : IYLAB -> Y-COORDINATE ON Y-AXIS FOR SYMBOL :                    DPMAIN    633
C     :............................................:                    DPMAIN    634
      IXLAB=IXL                                                         DPMAIN    635
      IYLAB=IYSTRT-1                                                    DPMAIN    636
C      TYPE *,'YDIV,YSTRT,IYSTRT: ',YDIV,YSTRT,IYSTRT                   DPMAIN    637
C      DO 20 NC=1,NPLOT                                                 DPMAIN    638
C         NP=NP+1                                                       DPMAIN    639
C         WRITE(CNC,100) NP                                             DPMAIN    640
*IF MIBM                                                                DPMAIN    641
*ENDIF                                                                  DPMAIN    643
*IF -MIBM                                                               DPMAIN    644
          CNC=CHAR(NAX+64)                                              DPMAIN    645
*ENDIF                                                                  DPMAIN    646
C         TYPE *,'*** NAX *** ',NAX                                     DPMAIN    647
C        ................................                               DPMAIN    648
C        : PLOT SYMBOL ON Y-AXIS FOR REF:                               DPMAIN    649
C        :..............................:                               DPMAIN    650
                                                                        DPMAIN    651
C         IF ((NC.EQ.4) .OR.                                            DPMAIN    652
C     1      (NC.EQ.10) .OR.                                            DPMAIN    653
C     1      (NC.EQ.16)) THEN                                           DPMAIN    654
C            IXLAB=IXL                                                  DPMAIN    655
C            IYLAB=IYLAB-1                                              DPMAIN    656
C         ENDIF                                                         DPMAIN    657
C         IF ((NC.EQ.7) .OR.                                            DPMAIN    658
C     1      (NC.EQ.13)) THEN                                           DPMAIN    659
C            IXLAB=IXL                                                  DPMAIN    660
C            IYLAB=IYLAB+1                                              DPMAIN    661
C         ENDIF                                                         DPMAIN    662
                                                                        DPMAIN    663
         ROWCOL(IYLAB)(IXLAB:IXLAB)=CNC                                 DPMAIN    664
C         CALL DPPUTT(CNC,NAX,NAX)                                      DPMAIN    665
         IXLAB=IXLAB+2                                                  DPMAIN    666
C        .......................................                        DPMAIN    667
C        : DO ACTUAL PLOTTING ON PLOTTING AREA :                        DPMAIN    668
C        :.....................................:                        DPMAIN    669
         DO 10 I=1,MAXPT(NAX)                                           DPMAIN    670
            IX=NINT((XARAY(I,NAX)-XSTRT)/XDIV)+IXSTRT                   DPMAIN    671
            IY=NINT((YARAY(I,NAX)-YSTRT)/YDIV)+IYSTRT                   DPMAIN    672
            IF (IX.NE.LASTIX) THEN                                      DPMAIN    673
C              ........................................                 DPMAIN    674
C              : FLAG IF ITS NOT WITHIN PLOTTING AREA :                 DPMAIN    675
                IF(IX.GT.IXEND) THEN                                    DPMAIN    676
                   IX=IXEND                                             DPMAIN    677
                   CNC='*'                                              DPMAIN    678
                ENDIF                                                   DPMAIN    679
                IF(IX.LT.IXSTRT) THEN                                   DPMAIN    680
                   IX=IXSTRT                                            DPMAIN    681
                   CNC='*'                                              DPMAIN    682
                ENDIF                                                   DPMAIN    683
                IF(IY.GT.IYEND) THEN                                    DPMAIN    684
                   IY=IYEND                                             DPMAIN    685
                   CNC='*'                                              DPMAIN    686
                ENDIF                                                   DPMAIN    687
                IF(IY.LT.IYSTRT) THEN                                   DPMAIN    688
                   IY=IYSTRT                                            DPMAIN    689
                   CNC='*'                                              DPMAIN    690
                ENDIF                                                   DPMAIN    691
C              :..........................................:             DPMAIN    692
                ROWCOL(IY)(IX:IX)=CNC                                   DPMAIN    693
C                WRITE(CNC,100) NAX                                     DPMAIN    694
*IF MIBM                                                                DPMAIN    695
*ENDIF                                                                  DPMAIN    697
*IF -MIBM                                                               DPMAIN    698
                 CNC=CHAR(NAX+64)                                       DPMAIN    699
*ENDIF                                                                  DPMAIN    700
            ENDIF                                                       DPMAIN    701
            LASTIX=IX                                                   DPMAIN    702
 10      CONTINUE                                                       DPMAIN    703
C 20    CONTINUE                                                        DPMAIN    704
C     TYPE *,'XARAY(I),IX,YARAY(I),IY : ',XARAY(I),IX,YARAY(I,NC),IY    DPMAIN    705
C 100   FORMAT(I1)                                                      DPMAIN    706
       RETURN                                                           DPMAIN    707
       END                                                              DPMAIN    708
                                                                        DPMAIN    709
      SUBROUTINE DPPUTT(CNC,N1,N2)                                      DPMAIN    710
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    711
CD                                                                      DPMAIN    712
CD          THE ROUTINE PUTS TITLES AND LABELS ON PLOTTING PAGE         DPMAIN    713
CD                                                                      DPMAIN    714
CD          CALLING PARAMETERS :                                        DPMAIN    715
CD                                                                      DPMAIN    716
CD                       CNC   - SYMBOL FOR THE PLOT                    DPMAIN    717
CD                       N1    - LOCATION OF THE TITLE                  DPMAIN    718
CD                       N2    - CURVE NUMBER                           DPMAIN    719
CD                                                                      DPMAIN    720
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCDPMAIN    721
C                                                                       DPMAIN    722
      CHARACTER*1 CNC                                                   DPMAIN    723
      INCLUDE 'PARAM.INS'                                               DPMAIN    724
      INCLUDE 'XYARAY.INS'                                              DPMAIN    725
      INCLUDE 'DPPLOT.INS'                                              DPMAIN    726
      INTEGER LLOC(18,2)                                                DPMAIN    727
      DATA LLOC(1,1),LLOC(1,2) /56,31/                                  DPMAIN    728
      DATA LLOC(2,1),LLOC(2,2) /57,31/                                  DPMAIN    729
      DATA LLOC(3,1),LLOC(3,2) /58,31/                                  DPMAIN    730
      DATA LLOC(4,1),LLOC(4,2) /59,31/                                  DPMAIN    731
      DATA LLOC(5,1),LLOC(5,2) /60,31/                                  DPMAIN    732
      DATA LLOC(6,1),LLOC(6,2) /56,56/                                  DPMAIN    733
      DATA LLOC(7,1),LLOC(7,2) /57,56/                                  DPMAIN    734
      DATA LLOC(8,1),LLOC(8,2) /58,56/                                  DPMAIN    735
      DATA LLOC(9,1),LLOC(9,2) /59,56/                                  DPMAIN    736
      DATA LLOC(10,1),LLOC(10,2) /60,56/                                DPMAIN    737
      DATA LLOC(11,1),LLOC(11,2) /56,81/                                DPMAIN    738
      DATA LLOC(12,1),LLOC(12,2) /57,81/                                DPMAIN    739
      DATA LLOC(13,1),LLOC(13,2) /58,81/                                DPMAIN    740
      DATA LLOC(14,1),LLOC(14,2) /59,81/                                DPMAIN    741
      DATA LLOC(15,1),LLOC(15,2) /60,81/                                DPMAIN    742
      DATA LLOC(16,1),LLOC(16,2) /56,105/                               DPMAIN    743
      DATA LLOC(17,1),LLOC(17,2) /57,105/                               DPMAIN    744
      DATA LLOC(18,1),LLOC(18,2) /58,105/                               DPMAIN    745
                                                                        DPMAIN    746
      N11=N1+1                                                          DPMAIN    747
      JR=LLOC(N11,1)                                                    DPMAIN    748
      JC1=LLOC(N11,2)                                                   DPMAIN    749
      JC2=JC1+2                                                         DPMAIN    750
      JC20=JC2+20                                                       DPMAIN    751
                                                                        DPMAIN    752
      ROWCOL(JR)(JC1:JC1)=CNC                                           DPMAIN    753
      ROWCOL(JR)(JC2:JC20)=LTITLE(N2)                                   DPMAIN    754
      RETURN                                                            DPMAIN    755
      END                                                               DPMAIN    756
                                                                        DPMAIN    757
      SUBROUTINE DPEXTR(LOC)                                            DPMAIN    758
CD                                                                      DPMAIN    759
CD         THE ROUTINE WRITES THE PLOT TILLE IN THE PLOT PAGE           DPMAIN    760
CD                                                                      DPMAIN    761
CD         CALLING PARAMETERS :                                         DPMAIN    762
CD                                                                      DPMAIN    763
CD                        LOC - LOCATION FOR THE TITLE                  DPMAIN    764
CD                                                                      DPMAIN    765
                                                                        DPMAIN    766
      INCLUDE 'PARAM.INS'                                               DPMAIN    767
      INCLUDE 'XYARAY.INS'                                              DPMAIN    768
      INCLUDE 'DPPLOT.INS'                                              DPMAIN    769
      JROW=(13-LOC)*9+5                                                 DPMAIN    770
      IF(LOC.EQ.1) THEN                                                 DPMAIN    771
        WRITE(ROWCOL(JROW+2),1230) PTITLE(1)                            DPMAIN    772
      ENDIF                                                             DPMAIN    773
      WRITE(ROWCOL(JROW),1200)LOC                                       DPMAIN    774
 1200 FORMAT(5X,'Y-AXIS #',I4)                                          DPMAIN    775
 1230 FORMAT(5X,A)                                                      DPMAIN    776
      JROW=JROW-1                                                       DPMAIN    777
      WRITE(ROWCOL(JROW),1230) YTITLE(LOC)                              DPMAIN    778
      JROW=JROW-2                                                       DPMAIN    779
      WRITE(ROWCOL(JROW),1230) CTITLE(LOC)                              DPMAIN    780
      JROW=JROW-1                                                       DPMAIN    781
      WRITE(ROWCOL(JROW),1230) CTITL2(LOC)                              DPMAIN    782
      JROW=JROW-1                                                       DPMAIN    783
      WRITE(ROWCOL(JROW),1230) LTITLE(LOC)                              DPMAIN    784
      JROW=JROW-1                                                       DPMAIN    785
      WRITE(ROWCOL(JROW),1230) LTITL2(LOC)                              DPMAIN    786
      RETURN                                                            DPMAIN    787
      END                                                               DPMAIN    788
                                                                        DPMAIN    789
