CFPRIME GPSOAP                                                          GPSOAP      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 GPSOAP(OP,IDEV,NXX,MARK)                               GPSOAP      3
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCGPSOAP      4
CD                                                                      GPSOAP      5
CD         THIS ROUTINE IS THE MAIN DRIVER FOR PLOT ROUTINES THAT       GPSOAP      6
CD         UTILIZES PROPRIETARY PLOTTING ROUTINES                       GPSOAP      7
CD                                                                      GPSOAP      8
CD         CALLING PARAMETERS :                                         GPSOAP      9
CD                                                                      GPSOAP     10
CD                      OP    - COMMAND KEYWORD                         GPSOAP     11
CD                      IDEV  - PLOTTING DEVICE TYPE                    GPSOAP     12
CD                      NXX   - NOT USED                                GPSOAP     13
CD                      MARK  - PLOT SYMBOL FLAG                        GPSOAP     14
CD                            > 0 : SYMBOL TYPE                         GPSOAP     15
CD                            < 0 : NO SYMBOL ON CURVE                  GPSOAP     16
CD                                                                      GPSOAP     17
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCGPSOAP     18
C                                                                       GPSOAP     19
C                                  MARK<0 means no symbol on curve      GPSOAP     20
      INCLUDE 'PARAM.INS'                                               GPSOAP     21
      INCLUDE 'XYARAY.INS'                                              GPSOAP     22
      INCLUDE 'GPINFO.INS'                                              GPSOAP     23
      INCLUDE 'SOAPC1.INS'                                              GPSOAP     24
      COMMON /SCFLAG/ IFLG                                              GPSOAP     25
      CHARACTER*8 OP                                                    GPSOAP     26
*IF LAHEY                                                               GPSOAP     27
*ENDIF                                                                  GPSOAP     31
*IF -WSGKS                                                              GPSOAP     32
*IF -WSX11                                                              GPSOAP     33
*ENDIF                                                                  GPSOAP     35
*ENDIF                                                                  GPSOAP     36
      ONEONE=.TRUE.                                                     GPSOAP     37
      XLEN=BXE-BXS                                                      GPSOAP     38
*IF WSX11                                                               GPSOAP     39
      IF(.NOT.GINIT)PFLAG=1                                             GPSOAP     40
      IF((GINIT).AND.(PFLAG.EQ.5))PFLAG=1                               GPSOAP     41
*ENDIF                                                                  GPSOAP     42
*IF WSGKS                                                               GPSOAP     43
*ENDIF                                                                  GPSOAP     46
      IF(USCALE) THEN                                                   GPSOAP     47
        AUTOSC=.FALSE.                                                  GPSOAP     48
      ELSE                                                              GPSOAP     49
        AUTOSC=.TRUE.                                                   GPSOAP     50
      ENDIF                                                             GPSOAP     51
*IF -WSGKS                                                              GPSOAP     52
*IF -WSX11                                                              GPSOAP     53
*IF LAHEY                                                               GPSOAP     54
*ENDIF                                                                  GPSOAP     62
*IF LAHEY                                                               GPSOAP     68
*ENDIF                                                                  GPSOAP     74
*IF LAHEY                                                               GPSOAP     77
*ENDIF                                                                  GPSOAP     79
*ENDIF                                                                  GPSOAP     83
*ENDIF                                                                  GPSOAP     84
C   ................................................. .............     GPSOAP     85
C   : PLOT FROM DATA READ FROM 1ST FILE                           :     GPSOAP     86
C   :                                                             :     GPSOAP     87
      IF(OP.EQ.'GPPLOT  ') THEN                                         GPSOAP     88
*IF -LAHEY                                                              GPSOAP     89
        IF(SSCALE)THEN                                                  GPSOAP     90
          IP1M1=IP1+1                                                   GPSOAP     91
          CALL SCALES(IP1M1,KCH(1),XARAY)                               GPSOAP     92
c          SSCALE=.FALSE.                                               GPSOAP     93
        ENDIF                                                           GPSOAP     94
*ENDIF                                                                  GPSOAP     95
        IF(GSCALE) SSCALE=.TRUE.                                        GPSOAP     96
        NPREV=IP1                                                       GPSOAP     97
        IP1=IP1+1                                                       GPSOAP     98
*IF WSX11                                                               GPSOAP     99
        IF(IP1.EQ.1.AND.PFLAG.EQ.1)CALL PAGSEL(NUMPLT)                  GPSOAP    100
*ENDIF                                                                  GPSOAP    101
*IF WSGKS                                                               GPSOAP    102
*ENDIF                                                                  GPSOAP    104
C        AUTOSC=.TRUE.                                                  GPSOAP    105
C                                                                       GPSOAP    106
*IF PINDEP                                                              GPSOAP    107
*ENDIF                                                                  GPSOAP    110
        IF(IP1.EQ.1) THEN                                               GPSOAP    111
C   INIT PLOTTING PAGE   :                                              GPSOAP    112
          CALL GPMAIN(1,IDEV,AUTOSC,0,IP1)                              GPSOAP    113
*IF -WSGKS                                                              GPSOAP    114
*IF -WSX11                                                              GPSOAP    115
*ENDIF                                                                  GPSOAP    118
*ENDIF                                                                  GPSOAP    119
        ENDIF                                                           GPSOAP    120
C   DO Y-AXIS AND PLOT  :                                               GPSOAP    121
        DO 100 IY=NPREV+1,KCH(1)                                        GPSOAP    122
           CALL GPMAIN(3,IDEV,AUTOSC,MARK,IP1)                          GPSOAP    123
           IP1=IP1+1                                                    GPSOAP    124
           IF(IFLG.EQ.2) GOTO 200                                       GPSOAP    125
  100   CONTINUE                                                        GPSOAP    126
  200   CONTINUE                                                        GPSOAP    127
*IF -LAHEY                                                              GPSOAP    128
        SSCALE=.FALSE.                                                  GPSOAP    129
        SSCALE=.FALSE.                                                  GPSOAP    130
*ENDIF                                                                  GPSOAP    131
C        ....................                                           GPSOAP    132
C        : WRITE PLOT TITLE :                                           GPSOAP    133
C        :...................                                           GPSOAP    134
*IF PINDEP                                                              GPSOAP    135
*ENDIF                                                                  GPSOAP    150
*IF WSX11                                                               GPSOAP    151
        IP1=IP1-1                                                       GPSOAP    152
        IF(IP1.EQ.6)IP1=0                                               GPSOAP    153
        GOTO 9999                                                       GPSOAP    154
*ENDIF                                                                  GPSOAP    155
*IF WSGKS                                                               GPSOAP    156
*ENDIF                                                                  GPSOAP    160
*IF -PINDEP                                                             GPSOAP    161
      ENDIF                                                             GPSOAP    162
*ENDIF                                                                  GPSOAP    163
C   .................................................                   GPSOAP    164
C   :                                               :                   GPSOAP    165
*IF -WSGKS                                                              GPSOAP    166
*IF -WSX11                                                              GPSOAP    167
*IF -LAHEY                                                              GPSOAP    169
*ENDIF                                                                  GPSOAP    172
*ENDIF                                                                  GPSOAP    177
*ENDIF                                                                  GPSOAP    178
*IF WSGKS                                                               GPSOAP    179
*ENDIF                                                                  GPSOAP    212
*IF WSX11                                                               GPSOAP    213
      IF(OP.EQ.'GPNEXT  ') THEN                                         GPSOAP    214
        IF(PFLAG.EQ.4.AND.NUMPLT.EQ.3)THEN                              GPSOAP    215
          PFLAG=5                                                       GPSOAP    216
          ONEPLT=.FALSE.                                                GPSOAP    217
          GINIT=.TRUE.                                                  GPSOAP    218
          GOTO 1000                                                     GPSOAP    219
        ENDIF                                                           GPSOAP    220
        IF(PFLAG.EQ.2.AND.NUMPLT.EQ.2)THEN                              GPSOAP    221
          PFLAG=5                                                       GPSOAP    222
          ONEPLT=.FALSE.                                                GPSOAP    223
          GINIT=.TRUE.                                                  GPSOAP    224
          GOTO 1000                                                     GPSOAP    225
        ENDIF                                                           GPSOAP    226
        IF(PFLAG.EQ.1.AND.NUMPLT.EQ.1)THEN                              GPSOAP    227
          PFLAG=5                                                       GPSOAP    228
          ONEPLT=.FALSE.                                                GPSOAP    229
          GINIT=.TRUE.                                                  GPSOAP    230
          GOTO 1000                                                     GPSOAP    231
        ENDIF                                                           GPSOAP    232
         ONEPLT=.TRUE.                                                  GPSOAP    233
         PFLAG=PFLAG+1                                                  GPSOAP    234
         GINIT=.TRUE.                                                   GPSOAP    235
C                                                                       GPSOAP    236
 1000    KCH(1)=0                                                       GPSOAP    237
         IFLG = 1                                                       GPSOAP    238
         IP1=0                                                          GPSOAP    239
         GOTO 9999                                                      GPSOAP    240
      ENDIF                                                             GPSOAP    241
*ENDIF                                                                  GPSOAP    242
                                                                        GPSOAP    243
C    :..............................................:                   GPSOAP    244
*IF PINDEP                                                              GPSOAP    245
*ENDIF                                                                  GPSOAP    256
*IF WSGKS                                                               GPSOAP    257
*ENDIF                                                                  GPSOAP    264
*IF WSX11                                                               GPSOAP    265
      IF(OP.EQ.'GPDEVICE')THEN                                          GPSOAP    266
        IF(.NOT.FILLED)THEN                                             GPSOAP    267
          WRITE(LOUT,1027)                                              GPSOAP    268
 1027     FORMAT(/,                                                     GPSOAP    269
     +    10X,'************************************',/,                 GPSOAP    270
     +    10X,'*    NO PLOTTING DATA !            *',/,                 GPSOAP    271
     +    10X,'*    USE "GETCHNL" FIRST           *',/,                 GPSOAP    272
     +    10X,'************************************')                   GPSOAP    273
          IP1=0                                                         GPSOAP    274
          GOTO 9999                                                     GPSOAP    275
        ENDIF                                                           GPSOAP    276
C                                                                       GPSOAP    277
        IF(.NOT.PINT)IPSPLT=1                                           GPSOAP    278
        CALL PSPRINT                                                    GPSOAP    279
        PINT=.TRUE.                                                     GPSOAP    280
        IPSPLT = IPSPLT+1                                               GPSOAP    281
        GOTO 9999                                                       GPSOAP    282
      ENDIF                                                             GPSOAP    283
*ENDIF                                                                  GPSOAP    284
                                                                        GPSOAP    285
C    ..................................                                 GPSOAP    286
C    : LAST CALL TO PLOTTING ROUTINES :                                 GPSOAP    287
C    :                                                                  GPSOAP    288
      IF(OP.EQ.'GPEND   ') THEN                                         GPSOAP    289
*IF PINDEP                                                              GPSOAP    290
*ENDIF                                                                  GPSOAP    292
*IF VERSAP                                                              GPSOAP    293
*ENDIF                                                                  GPSOAP    298
*IF CALCOM                                                              GPSOAP    299
*ENDIF                                                                  GPSOAP    304
*IF LAHEY                                                               GPSOAP    305
*ENDIF                                                                  GPSOAP    307
*IF WSGKS                                                               GPSOAP    308
*ENDIF                                                                  GPSOAP    310
*IF -WSGKS                                                              GPSOAP    311
*IF -WSX11                                                              GPSOAP    312
*ENDIF                                                                  GPSOAP    314
*ENDIF                                                                  GPSOAP    315
         IP1=0                                                          GPSOAP    316
         GOTO 9999                                                      GPSOAP    317
      ENDIF                                                             GPSOAP    318
C    :................................:                                 GPSOAP    319
                                                                        GPSOAP    320
 9999 CONTINUE                                                          GPSOAP    321
      RETURN                                                            GPSOAP    322
                                                                        GPSOAP    323
      END                                                               GPSOAP    324
                                                                        GPSOAP    325
*IF PINDEP                                                              GPSOAP    326
*ENDIF                                                                  GPSOAP    359
*IF WSGKS                                                               GPSOAP    360
*ENDIF                                                                  GPSOAP    391
*IF WSX11                                                               GPSOAP    392
      SUBROUTINE PAGSEL(IXX)                                            GPSOAP    393
      INCLUDE 'SOAPC1.INS'                                              GPSOAP    394
      CHARACTER*80 MSG,STRING                                           GPSOAP    395
      INTEGER IXX                                                       GPSOAP    396
C SELECT PLOTTING DEVICE                                                GPSOAP    397
  12  CONTINUE                                                          GPSOAP    398
      WRITE(LOUT,1240)                                                  GPSOAP    399
 1240 FORMAT(//,10X,'Choose an Option, Please ...',/,                   GPSOAP    400
     1          10X,'    1. One Plot per Page.',/,                      GPSOAP    401
     2          10X,'    2. Two Plots per Page.',/,                     GPSOAP    402
     3          10X,'    3. Four Plots per Page.',//)                   GPSOAP    403
      MSG=' Enter(1,2,or 3)'                                            GPSOAP    404
      CALL PMTRED(LOUT,LIN,JERR,18,MSG,'PTI',STRING)                    GPSOAP    405
      READ(STRING,*,IOSTAT=IOS) I1                                      GPSOAP    406
      IF(I1.GT.4.OR.IOS.NE.0) GOTO 12                                   GPSOAP    407
      IF(RECORD) WRITE(IREC,1231)I1                                     GPSOAP    408
      IF (I1.EQ.1) IXX=1                                                GPSOAP    409
      IF (I1.EQ.2) IXX=2                                                GPSOAP    410
      IF (I1.EQ.3) IXX=3                                                GPSOAP    411
 1231 FORMAT(I1)                                                        GPSOAP    412
      RETURN                                                            GPSOAP    413
      END                                                               GPSOAP    414
*ENDIF                                                                  GPSOAP    415
                                                                        GPSOAP    416
      SUBROUTINE VMSCAL(PARAM,LENPAR,JERR)                              GPSOAP    417
CD                                                                      GPSOAP    418
CD      THIS ROTINE IS A VAX SPECIFIC ROUTINE THAT ALLOWS               GPSOAP    419
CD      USER TO USE VAX/VMS COMMANDS                                    GPSOAP    420
CD                                                                      GPSOAP    421
CD      CALLING PARAMETERS :                                            GPSOAP    422
CD                                                                      GPSOAP    423
CD                  PARAM  - INPUT COMMAND                              GPSOAP    424
CD                  LENPAR - LENGTH OF THE CHARACTER STRING IN PARAM    GPSOAP    425
CD                  JERR   - ERROR STATUS IN READING PARAM              GPSOAP    426
CD                                                                      GPSOAP    427
      INCLUDE 'SOAPC1.INS'                                              GPSOAP    428
      CHARACTER*(*) PARAM                                               GPSOAP    429
*IF VAX                                                                 GPSOAP    430
*ENDIF                                                                  GPSOAP    453
         RETURN                                                         GPSOAP    454
         END                                                            GPSOAP    455
