CFPRIME GOTOS1                                                          GOTOS1      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 GOTOS1(IWHERE,PARAM,LENPAR,IOK,IGOTO)                  GOTOS1      3
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCGOTOS1      4
CD                                                                      GOTOS1      5
CD             THIS ROUTINE INTERFACES WITH OTHER PROPRIETARY PLOT      GOTOS1      6
CD             ROUTINES AND VAX Specific Routines                       GOTOS1      7
CD                                                                      GOTOS1      8
CD             CALLING PARAMETERS :                                     GOTOS1      9
CD                                                                      GOTOS1     10
CD                           IWHERE - INTEGER CODE FOR THE COMMAND      GOTOS1     11
CD                           COMMD  - COMMAND LINE                      GOTOS1     12
CD                           PARAM  - CHARACTER STRING STORING FILE NAMEGOTOS1     13
CD                           LENPAR - NO. OF CHARACTER IN PARAM         GOTOS1     14
CD                           IGOTO  - STATUS FLAG                       GOTOS1     15
CD                                                                      GOTOS1     16
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCGOTOS1     17
C                                                                       GOTOS1     18
      CHARACTER*50 PARAM                                                GOTOS1     19
C      CHARACTER*80 STRING,MSG                                          GOTOS1     20
      INCLUDE 'PARAM.INS'                                               GOTOS1     21
      INCLUDE 'XYARAY.INS'                                              GOTOS1     22
      INCLUDE 'SOAPC1.INS'                                              GOTOS1     23
      INCLUDE 'CHDISP.INS'                                              GOTOS1     24
      SAVE IPDEV                                                        GOTOS1     25
      COMMON /BSAVEM/ ISLAST                                            GOTOS1     26
      COMMON /SCFLAG/ IFLG                                              GOTOS1     27
*IF LAHEY                                                               GOTOS1     28
*ENDIF                                                                  GOTOS1     35
C                                                                       GOTOS1     36
C IWHERE=8  G3D      draw 3D plot                                       GOTOS1     37
C IWHERE=9  G3DMC    draw 3D multi-channel data                         GOTOS1     38
C IWHERE=11 GP3D     produce hard copy of the 3D plot                   GOTOS1     39
C IWHERE=12 GPCLOSE  close the current postscript file                  GOTOS1     40
C                                                                       GOTOS1     41
C IWHERE=13 GPDEVICE produce hard copy of the 2D plot                   GOTOS1     42
C IWHERE=14 GPNEXT   close the current X window 2D plot                 GOTOS1     43
C IWHERE=15 GPPLOT   draw 2D plot in X window                           GOTOS1     44
C                                                                       GOTOS1     45
      IOK=0                                                             GOTOS1     46
      IF(IWHERE.EQ.12)GOTO 240                                          GOTOS1     47
      IF(IWHERE.EQ.8)GOTO 250                                           GOTOS1     48
      IF(IWHERE.EQ.11)GOTO 260                                          GOTOS1     49
      IF(IWHERE.EQ.9)GOTO 270                                           GOTOS1     50
C  ......................................................               GOTOS1     51
C  :  PASS PROGRAM CONTROL TO PROPER ROUTINES           :               GOTOS1     52
C  :     160    180  190   210     220                                  GOTOS1     53
C  :   GPPLOT,GPNEXT,QUIT,VMSDCL,GPDEVICE                               GOTOS1     54
C  :                                                    :               GOTOS1     55
      IF (IWHERE.LE.15 .AND. IWHERE.GE.13) THEN                         GOTOS1     56
        GOTO(220,180,160),IWHERE-12                                     GOTOS1     57
      ELSEIF (IWHERE.EQ.26) THEN                                        GOTOS1     58
        GOTO 190                                                        GOTOS1     59
      ELSEIF (IWHERE.EQ.36) THEN                                        GOTOS1     60
        GOTO 210                                                        GOTOS1     61
      ELSE                                                              GOTOS1     62
        GOTO 9998                                                       GOTOS1     63
      ENDIF                                                             GOTOS1     64
C  :....................................................:               GOTOS1     65
                                                                        GOTOS1     66
C   .......................................................             GOTOS1     67
C   : GPPLOT                                              :             GOTOS1     68
C   :                                                     :             GOTOS1     69
C   : Call to plot whatever is stored in the buffer.      :             GOTOS1     70
C   : Scaling,axises,titles,labels are performed by this  :             GOTOS1     71
C   :  call.                                              :             GOTOS1     72
C   :                                                     :             GOTOS1     73
 160  CONTINUE                                                          GOTOS1     74
*IF WSX11                                                               GOTOS1     75
         IF(WFLAG2)CALL X2END                                           GOTOS1     76
         WFLAG2=.FALSE.                                                 GOTOS1     77
         GPINI2=.FALSE.                                                 GOTOS1     78
*ENDIF                                                                  GOTOS1     79
         IF(.NOT.FILLED)THEN                                            GOTOS1     80
            WRITE(LOUT,1027)                                            GOTOS1     81
 1027       FORMAT(/,                                                   GOTOS1     82
     1      10X,'*******************************',/,                    GOTOS1     83
     1      10X,'*  PLOTTING DATA NOT READ IN  *',/,                    GOTOS1     84
     1      10X,'*  USE GETCHNL FIRST          *',/,                    GOTOS1     85
     1      10X,'*******************************')                      GOTOS1     86
*IF WSX11                                                               GOTOS1     87
            IF(WFLAG)CALL XP_END                                        GOTOS1     88
            WFLAG=.FALSE.                                               GOTOS1     89
            GPINIT=.FALSE.                                              GOTOS1     90
            SCALX=.TRUE.                                                GOTOS1     91
            IFLG=0                                                      GOTOS1     92
            KCH(1)=0                                                    GOTOS1     93
            IP1=0                                                       GOTOS1     94
*ENDIF                                                                  GOTOS1     95
            GOTO 9999                                                   GOTOS1     96
         ENDIF                                                          GOTOS1     97
*IF -WSX11                                                              GOTOS1     98
*ENDIF                                                                  GOTOS1    108
C                                                                       GOTOS1    109
         IF(.NOT.GPINIT)THEN                                            GOTOS1    110
*IF WSX11                                                               GOTOS1    111
            CALL X11OAP(0)                                              GOTOS1    112
            WFLAG=.TRUE.                                                GOTOS1    113
            GPINIT=.TRUE.                                               GOTOS1    114
         ELSE                                                           GOTOS1    115
            CALL X11OAP(1)                                              GOTOS1    116
            WFLAG=.TRUE.                                                GOTOS1    117
            GPPLOT=.TRUE.                                               GOTOS1    118
            IF(USCALE)USCALE=.FALSE.                                    GOTOS1    119
            IOK=0                                                       GOTOS1    120
         ENDIF                                                          GOTOS1    121
         GOTO 9998                                                      GOTOS1    122
*ENDIF                                                                  GOTOS1    123
*IF PINDEP                                                              GOTOS1    124
*ENDIF                                                                  GOTOS1    146
*IF WSGKS                                                               GOTOS1    147
*ENDIF                                                                  GOTOS1    150
*IF -WSX11                                                              GOTOS1    151
*IF BPA                                                                 GOTOS1    156
*ENDIF                                                                  GOTOS1    159
*IF -BPA                                                                GOTOS1    160
*IF LAHEY                                                               GOTOS1    161
*ENDIF                                                                  GOTOS1    163
*IF LAHEY                                                               GOTOS1    167
*ENDIF                                                                  GOTOS1    169
*ENDIF                                                                  GOTOS1    170
*IF LAHEY                                                               GOTOS1    173
*ENDIF                                                                  GOTOS1    205
*ENDIF                                                                  GOTOS1    208
C   :.....................................................:             GOTOS1    209
C   .......................................................             GOTOS1    210
C   : GPNEXT                                              :             GOTOS1    211
C   :                                                     :             GOTOS1    212
C   : Complete the current plot. Get ready for the next   :             GOTOS1    213
C   : plot.                                               :             GOTOS1    214
C   :                                                     :             GOTOS1    215
 180  CONTINUE                                                          GOTOS1    216
*IF WSX11                                                               GOTOS1    217
      IF(.NOT. CFLRUN)THEN                                              GOTOS1    218
         IF(WFLAG)CALL XP_END                                           GOTOS1    219
         IF(WFLAG2)CALL X2END                                           GOTOS1    220
      ENDIF                                                             GOTOS1    221
         WFLAG2=.FALSE.                                                 GOTOS1    222
         GPINI2=.FALSE.                                                 GOTOS1    223
         WFLAG=.FALSE.                                                  GOTOS1    224
         GPPLOT=.FALSE.                                                 GOTOS1    225
         GPINIT=.FALSE.                                                 GOTOS1    226
         SCALX=.TRUE.                                                   GOTOS1    227
         SSCALE=.FALSE.                                                 GOTOS1    228
         FILLED=.FALSE.                                                 GOTOS1    229
         IFLG=0                                                         GOTOS1    230
         KCH(1)=0                                                       GOTOS1    231
         IP1=0                                                          GOTOS1    232
         IPLTYP=0                                                       GOTOS1    233
         GOTO 9999                                                      GOTOS1    234
*ENDIF                                                                  GOTOS1    235
*IF -WSX11                                                              GOTOS1    236
*ENDIF                                                                  GOTOS1    251
 1029       FORMAT(/,                                                   GOTOS1    252
     1      10X,'******************************',/,                     GOTOS1    253
     1      10X,'*  NOTHING ON PLOTTING PAGE  *',/,                     GOTOS1    254
     1      10X,'*  USE GPPLOT FIRST          *',/,                     GOTOS1    255
     1      10X,'******************************')                       GOTOS1    256
C   :.....................................................:             GOTOS1    257
C   .......................................................             GOTOS1    258
C   : QUIT                                                :             GOTOS1    259
C   :                                                     :             GOTOS1    260
C   : Completes all Plots. Do house keeping. Ask how many :             GOTOS1    261
C   : plots to be sent to hard copy devices.              :             GOTOS1    262
C   :                                                     :             GOTOS1    263
C   :                                                     :             GOTOS1    264
 190  CONTINUE                                                          GOTOS1    265
*IF WSX11                                                               GOTOS1    266
         IF(GPINIT) THEN                                                GOTOS1    267
            IF(WFLAG)CALL XP_END                                        GOTOS1    268
            WFLAG=.FALSE.                                               GOTOS1    269
            GPINIT=.FALSE.                                              GOTOS1    270
            GPPLOT=.FALSE.                                              GOTOS1    271
            SCALX=.TRUE.                                                GOTOS1    272
         ENDIF                                                          GOTOS1    273
         IOK=0                                                          GOTOS1    274
         IGOTO=1                                                        GOTOS1    275
         IF(PINT)CALL PS_END                                            GOTOS1    276
         IF(P3INT)CALL PS3_END                                          GOTOS1    277
         GOTO 9999                                                      GOTOS1    278
*ENDIF                                                                  GOTOS1    279
*IF -WSX11                                                              GOTOS1    280
*IF -LAHEY                                                              GOTOS1    282
*ENDIF                                                                  GOTOS1    284
*ENDIF                                                                  GOTOS1    291
C   :.....................................................:             GOTOS1    292
C   .......................................................             GOTOS1    293
C   : GPDEVICE                                            :             GOTOS1    294
C   :                                                     :             GOTOS1    295
C   : Redirect the plot to a different device. The routine:             GOTOS1    296
C   : will prompt the user to select from a list of       :             GOTOS1    297
C   : supported devices.                                  :             GOTOS1    298
C   :                                                     :             GOTOS1    299
 220  CONTINUE                                                          GOTOS1    300
*IF -LAHEY                                                              GOTOS1    301
         GPPLOT=.TRUE.                                                  GOTOS1    302
         IF(GPPLOT) THEN                                                GOTOS1    303
            CALL GPSOAP('GPDEVICE',IPDEV,1,0)                           GOTOS1    304
C            GPPLOT=.FALSE.                                             GOTOS1    305
         ELSE                                                           GOTOS1    306
            WRITE(LOUT,1029)                                            GOTOS1    307
         ENDIF                                                          GOTOS1    308
*ENDIF                                                                  GOTOS1    309
*IF LAHEY                                                               GOTOS1    310
*ENDIF                                                                  GOTOS1    319
         GOTO 9999                                                      GOTOS1    320
C   :.....................................................:             GOTOS1    321
C   .......................................................             GOTOS1    322
C   : VMSDCL                                              :             GOTOS1    323
C   :                                                     :             GOTOS1    324
C   : Call to let VMS do a DCL command                    :             GOTOS1    325
C   :                                                     :             GOTOS1    326
 210  CONTINUE                                                          GOTOS1    327
      CALL VMSCAL(PARAM,LENPAR,IOK)                                     GOTOS1    328
      RETURN                                                            GOTOS1    329
C   :.....................................................:             GOTOS1    330
*IF -WSX11                                                              GOTOS1    331
*IF -LAHEY                                                              GOTOS1    333
*ENDIF                                                                  GOTOS1    336
*IF LAHEY                                                               GOTOS1    337
*ENDIF                                                                  GOTOS1    348
*ENDIF                                                                  GOTOS1    362
*IF WSX11                                                               GOTOS1    363
 240    IF (PINT) THEN                                                  GOTOS1    364
         CALL PS_END                                                    GOTOS1    365
         PINT=.FALSE.                                                   GOTOS1    366
        ENDIF                                                           GOTOS1    367
        IF (P3INT) THEN                                                 GOTOS1    368
         CALL PS3_END                                                   GOTOS1    369
        P3INT=.FALSE.                                                   GOTOS1    370
        ENDIF                                                           GOTOS1    371
        GOTO 9998                                                       GOTOS1    372
 250        IF (WFLAG) THEN                                             GOTOS1    373
            CALL XP_END                                                 GOTOS1    374
            WFLAG =.FALSE.                                              GOTOS1    375
            GPINIT=.FALSE.                                              GOTOS1    376
            ENDIF                                                       GOTOS1    377
        IF(KCH(1).GE.4) THEN                                            GOTOS1    378
          WRITE (LOUT,1035)                                             GOTOS1    379
 1035       FORMAT(/,                                                   GOTOS1    380
     1      10X,'************************************',/,               GOTOS1    381
     1      10X,'*  TOO MANY CHANNELS               *',/,               GOTOS1    382
     1      10X,'*  USE "GETCHNL" TO RESELECT       *',/,               GOTOS1    383
     1      10X,'************************************')                 GOTOS1    384
            KCH(1)=0                                                    GOTOS1    385
            IFLG=0                                                      GOTOS1    386
            FILLED=.FALSE.                                              GOTOS1    387
            IP1=0                                                       GOTOS1    388
            IOK=0                                                       GOTOS1    389
            GOTO 9999                                                   GOTOS1    390
        ELSE IF(KCH(1).LT.2) THEN                                       GOTOS1    391
            WRITE(LOUT,1030)                                            GOTOS1    392
 1030       FORMAT(/,                                                   GOTOS1    393
     1      10X,'**********************************',/,                 GOTOS1    394
     1      10X,'* USE "GETCHNL" TO GET DATA OF   *',/,                 GOTOS1    395
     1      10X,'*   3 CHANNELS IN TURN OF X,Y,Z  *',/,                 GOTOS1    396
     1      10X,'* NOTE: if read only 2 channels, *',/,                 GOTOS1    397
     1      10X,'*   time would be X by default   *',/,                 GOTOS1    398
     1      10X,'**********************************')                   GOTOS1    399
            IOK=0                                                       GOTOS1    400
            IF (WFLAG2) CALL X2END                                      GOTOS1    401
            FILLED=.FALSE.                                              GOTOS1    402
            WFLAG2 =.FALSE.                                             GOTOS1    403
            GPINI2=.FALSE.                                              GOTOS1    404
            IFLG=0                                                      GOTOS1    405
            KCH(1)=0                                                    GOTOS1    406
            IP1=0                                                       GOTOS1    407
            GOTO 9999                                                   GOTOS1    408
        ELSE IF(.NOT.GPINI2) THEN                                       GOTOS1    409
               CALL X3DPLT(0,T)                                         GOTOS1    410
               WFLAG2=.TRUE.                                            GOTOS1    411
               GPINI2=.TRUE.                                            GOTOS1    412
        ELSE                                                            GOTOS1    413
        CALL X3DPLT(1,T)                                                GOTOS1    414
        IOK=0                                                           GOTOS1    415
        ENDIF                                                           GOTOS1    416
         GOTO 9998                                                      GOTOS1    417
 260    CONTINUE                                                        GOTOS1    418
         IF(GPINI2) THEN                                                GOTOS1    419
           IF(WFLAG2) THEN                                              GOTOS1    420
                CALL PS3PRT                                             GOTOS1    421
                P3INT=.TRUE.                                            GOTOS1    422
                GOTO 9998                                               GOTOS1    423
           ENDIF                                                        GOTOS1    424
         ELSE                                                           GOTOS1    425
            WRITE(LOUT,1040)                                            GOTOS1    426
 1040       FORMAT(/,                                                   GOTOS1    427
     1      10X,'************************************',/,               GOTOS1    428
     1      10X,'*     NO 3D PLOT                   *',/,               GOTOS1    429
     1      10X,'*       USE "G3D" FIRST            *',/,               GOTOS1    430
     1      10X,'************************************')                 GOTOS1    431
         ENDIF                                                          GOTOS1    432
         IOK=0                                                          GOTOS1    433
         GOTO 9999                                                      GOTOS1    434
 270    CONTINUE                                                        GOTOS1    435
            IFLG =4                                                     GOTOS1    436
            IF (WFLAG) CALL XP_END                                      GOTOS1    437
            WFLAG =.FALSE.                                              GOTOS1    438
            GPINIT=.FALSE.                                              GOTOS1    439
            IF(.NOT.GPINI2) THEN                                        GOTOS1    440
               CALL X3DPLT(0,T)                                         GOTOS1    441
               WFLAG2=.TRUE.                                            GOTOS1    442
               GPINI2=.TRUE.                                            GOTOS1    443
            ELSE                                                        GOTOS1    444
               CALL X3DPLT(1,T)                                         GOTOS1    445
               WFLAG2=.TRUE.                                            GOTOS1    446
               GPINI2=.TRUE.                                            GOTOS1    447
        IOK=0                                                           GOTOS1    448
        ENDIF                                                           GOTOS1    449
        GOTO 9999                                                       GOTOS1    450
*ENDIF                                                                  GOTOS1    451
                                                                        GOTOS1    452
 9998 CONTINUE                                                          GOTOS1    453
      IOK=-1                                                            GOTOS1    454
 9999 CONTINUE                                                          GOTOS1    455
      RETURN                                                            GOTOS1    456
      END                                                               GOTOS1    457
