CFPRIME GOTOS                                                           GOTOS       1
C***********************************************************************RIGHTE      1
C*                                                                     *RIGHTE      2
C*        Extended Transient-Midterm Stability Program (ETMSP)         *RIGHTE      3
C*        ====================================================         *RIGHTE      4
C*                                                                     *RIGHTE      5
C*       Copyright (C) (1993) Electric Power Research Institute        *RIGHTE      6
C*                                                                     *RIGHTE      7
C* EPRI reserves all rights in the software and associated             *RIGHTE      8
C* documentation as delivered. The software and its associated         *RIGHTE      9
C* documention or any portion thereof may not be reproduced in any form*RIGHTE     10
C* whatsoever without the consent of EPRI, except as explicity provided*RIGHTE     11
C* for by license. Licensee shall submit a detailed description to EPRI*RIGHTE     12
C* of any changes or modifications to the software within two (2)      *RIGHTE     13
C* months after such changes or modifications are made. At EPRI's sole *RIGHTE     14
C* discretion, the software, as changed or modified, shall be given a  *RIGHTE     15
C* new designation sufficiently different from its then current        *RIGHTE     16
C* designation as to prevent mistake,confusion, or deception as between*RIGHTE     17
C* the current software as changed or modified.                        *RIGHTE     18
C*                                                                     *RIGHTE     19
C* A license under EPRI's rights in the software can be obtained       *RIGHTE     20
C* directly from EPRI.                                                 *RIGHTE     21
C*                                                                     *RIGHTE     22
C* This program and supporting materials may be independently available*RIGHTE     23
C* from Electric Power Software centre (EPSC) for an appropriate       *RIGHTE     24
C* distribution fee. The EPSC is a service of                          *RIGHTE     25
C*                                                                     *RIGHTE     26
C*                    Power Computing Company                          *RIGHTE     27
C*                    1930 Hi Line                                     *RIGHTE     28
C*                    Dallas, Tx 75207                                 *RIGHTE     29
C*                                                                     *RIGHTE     30
C* NEITHER EPRI, ANY MEMBER OF EPRI, NOR ANY PERSON OR  ORGANIZATION   *RIGHTE     31
C* ACTING ON BEHAVE OF THEM:                                           *RIGHTE     32
C*                                                                     *RIGHTE     33
C* 1. MAKE ANY WARRANTY OR REPRESENTATION WHATSOEVER, EXPRESS OR       *RIGHTE     34
C*    IMPLIED, INCLUDING ANY WARRANTY OF MERCHANTABILITY OR FITNESS OR *RIGHTE     35
C*    ANY PURPOSE WITH RESPECT TO THE SOFTWARE OR ITS ASSOCIATED       *RIGHTE     36
C*    DOCUMENTATION; OR                                                *RIGHTE     37
C*                                                                     *RIGHTE     38
C* 2. ASSUMES ANY LIABILITY WHATSOEVER WITH RESPECT TO ANY USE OF THE  *RIGHTE     39
C*    SOFTWARE OR ITS ASSOCIATED DOCUMENTATION OR ANY PORTION THEREOF  *RIGHTE     40
C*    OR WITH RESPECT TO ANY DAMAGES WHICH MAY RESULT FROM SUCH USE.   *RIGHTE     41
C*                                                                     *RIGHTE     42
C* THIS NOTICE MAY NOT BE REMOVED FROM THE SOFTWARE BY ANY USER        *RIGHTE     43
C* THEREOF.                                                            *RIGHTE     44
C*                                                                     *RIGHTE     45
C***********************************************************************RIGHTE     46
      SUBROUTINE GOTOS(IWHERE,COMMD,PARAM,LENPAR,IGOTO)                 GOTOS       3
CD                                                                      GOTOS       4
CD    THIS SUBROUTINE DIRECTS PROGRAM CONTROL TO INDIVIDUAL SUBROUTINES GOTOS       5
CD    BASED ON THE INTERACTIVE COMMANDS INPUT BY THE USER.              GOTOS       6
CD                                                                      GOTOS       7
CD                                                                      GOTOS       8
CD                 ACTIVITY COMMANDS AND FUNCTIONS                      GOTOS       9
CD                                                                      GOTOS      10
CD                                                                      GOTOS      11
CD      ACTIVITY COMMAND                                                GOTOS      12
CD      COMMAND  NUMBER   FUNCTION                                      GOTOS      13
CD      -------  ------   ----------------------------------------      GOTOS      14
CD       QUIT       1     EXIT FROM THE PROGRAM                         GOTOS      15
CD                                                                      GOTOS      16
CD       HELP       2     ACTIVATE ON-LINE HELP                         GOTOS      17
CD                                                                      GOTOS      18
CD       RECORD     3     CREATE A RESPONSE FILE TO RECORD INTERACTIVE  GOTOS      19
CD                        COMMANDS OF A SESSION                         GOTOS      20
CD                                                                      GOTOS      21
CD       STOPREC    4     END THE CURRENT RECORDING SESSION             GOTOS      22
CD                                                                      GOTOS      23
CD       PLAYBACK   5     REPEAT A PREVIOUSLY RECORDED ETMSP SESSION    GOTOS      24
CD                                                                      GOTOS      25
CD       VMSDCL     6     (VAX/VMS VERSION ONLY) PASS THE COMMAND LINE  GOTOS      26
CD                        PARAMETERS DIRECTLY TO THE VAX/VMS OPERATING  GOTOS      27
CD                        SYSTEM                                        GOTOS      28
CD                                                                      GOTOS      29
CD       MENU       7     TOGGLE BETWEEN THE MENU MODE AND COMMAND MODE GOTOS      30
CD                        INTERACTIVITY                                 GOTOS      31
CD                                                                      GOTOS      32
CD       CDYNDATA   8     CONVERT THE DYNAMIC MODEL DATA FROM PREVIOUS  GOTOS      33
CD                        PROGRAM VERSION FORMAT TO THE CURRENT FORMAT  GOTOS      34
CD                                                                      GOTOS      35
CD       SETSIM     9     PROGRAM GUIDES THE USER THROUGH EACH STEP IN  GOTOS      36
CD                        SETTING UP A CASE TO PERFORM A SIMULATION RUN GOTOS      37
CD                                                                      GOTOS      38
CD       CASE      10     ENABLE THE USER TO ENTER STUDY DESCRIPTION ANDGOTOS      39
CD                        DEFAULT SIMULATION CONTROL PARAMETERS         GOTOS      40
CD                                                                      GOTOS      41
CD       LOADFLOW  11     READ IN THE LOADFLOW DATA                     GOTOS      42
CD                                                                      GOTOS      43
CD       WDYNDATA  12     WRITE THE AC DYNAMIC MODEL DATA TO A USER     GOTOS      44
CD                        SPECIFIED FILE                                GOTOS      45
CD                                                                      GOTOS      46
CD       DYNDATA   13     READ IN THE DYNAMIC MODEL DATA FROM A PREPAREDGOTOS      47
CD                        FILE                                          GOTOS      48
CD                                                                      GOTOS      49
CD       MDYNDAT   14     READ IN THE DYNAMIC MODEL DATA FROM OTHER     GOTOS      50
CD                        PREPARED FILES, ADD AND MODIFY DYNAMIC MODEL  GOTOS      51
CD                        DATA                                          GOTOS      52
CD                                                                      GOTOS      53
CD       LDYNDAT   15     LOAD ALL DYNAMIC MODEL DATA FROM TEMPORARY    GOTOS      54
CD                        ARRAYS TO THE PERMANENT ARRAYS AND PREPARE    GOTOS      55
CD                        THE DATA INTERNAL FORM FOR EFFICIENT          GOTOS      56
CD                        REPETITIVE COMPUTATION.                       GOTOS      57
CD                                                                      GOTOS      58
CD       RELADATA  17     ENABLE THE PROGRAM TO READ IN A PREPARED      GOTOS      59
CD                        AUTOMATIC SWITCHING RELAY DATA FILE.          GOTOS      60
CD                                                                      GOTOS      61
CD       RRESDAT   18     ENABLE THE PROGRAM TO READ IN THE USER DEFINEDGOTOS      62
CD                        OUTPUT ANALYSIS DATA FROM A PREPARED FILE OR  GOTOS      63
CD                        KEYBOARD                                      GOTOS      64
CD                                                                      GOTOS      65
CD       SWITDATA  20     ENABLE THE PROGRAM TO READ IN THE SIMULATION  GOTOS      66
CD                        SPECIFICATION FROM A PREPARED FILE OR CREATE  GOTOS      67
CD                        THE FILE INTERACTIVELY                        GOTOS      68
CD                                                                      GOTOS      69
CD       MSWITDA   21     ENABLE THE USER TO EDIT THE SIMULATION        GOTOS      70
CD                        SPECIFICATION FILE INTERACTIVELY              GOTOS      71
CD                                                                      GOTOS      72
CD       LSWITDA   22     LOAD AND PRINT A SUMMARY OF THE SIMULATION    GOTOS      73
CD                        SPECIFICATION DATA                            GOTOS      74
CD                                                                      GOTOS      75
CD       TADATA    24     PRINT THE MODEL DATA OF ALL DEVICES AND       GOTOS      76
CD                        CHANNELS OF THE USER DEFINED OUTPUT ANALYSIS  GOTOS      77
CD                        FILE                                          GOTOS      78
CD                                                                      GOTOS      79
CD       INITIAL   26     INITIALIZE THE SYSTEM (SET UP THE PRE-FAULT   GOTOS      80
CD                        CONDITION)                                    GOTOS      81
CD                                                                      GOTOS      82
CD       TAINIT    27     PRINT THE INITIAL CONDITIONS OF ALL DEVICES   GOTOS      83
CD                                                                      GOTOS      84
CD       SIMULAT   29     START THE SIMULATION FOR THE STUDY PERIOD     GOTOS      85
CD                        ENTERED IN THE SIMULATION SPECIFICATION FILE  GOTOS      86
CD                                                                      GOTOS      87
CD       TEFMARGI  30     START THE SIMULATION TO CALCULATE THE         GOTOS      88
CD                        TRANSIENT STABILITY MARGIN                    GOTOS      89
CD                                                                      GOTOS      90
      INCLUDE 'PARX.INS'                                                GOTOS      91
      INCLUDE 'CNPT.INS'                                                GOTOS      92
      INCLUDE 'CNUNIT.INS'                                              GOTOS      93
      INCLUDE 'CNLSTA.INS'                                              GOTOS      94
      INCLUDE 'CNKEYW.INS'                                              GOTOS      95
      INCLUDE 'CNTMDA.INS'                                              GOTOS      96
      INCLUDE 'CNMSG.INS'                                               GOTOS      97
      INCLUDE 'CNFLAG.INS'                                              GOTOS      98
C                                                                       GOTOS      99
C                                                                       GOTOS     100
      CHARACTER*80 COMMD                                                GOTOS     101
      CHARACTER*50 PARAM                                                GOTOS     102
      LOGICAL SWIDAT,SWITCH,LLDYND                                      GOTOS     103
      DATA SWIDAT/.FALSE./                                              GOTOS     104
      DATA LLDYND/.FALSE./,SWITCH/.FALSE./                              GOTOS     105
C                                                                       GOTOS     106
      LDEB=.FALSE.                                                      GOTOS     107
C   ....................................................................GOTOS     108
C   : SEND PROGRAM  CONTROL TO THE PROPER ROUTINE                      :GOTOS     109
C   :                                                                  :GOTOS     110
      IF((IWHERE.LT.1).OR.(IWHERE.GT.INSTAL)) GOTO 3900                 GOTOS     111
C                                                               16 17   GOTOS     112
C                                                                       GOTOS     113
C       /'QUIT    ',  'HELP    ',  'RECORD  ',  'STOPREC ',  'PLAYBACK',GOTOS     114
        GOTO(   10 ,         60 ,         50 ,        40  ,        20  ,GOTOS     115
C        'VMSDCL  ',  'MENU    ',  'CDYNDATA',  'SETSIM  ',  'CASE    ',GOTOS     116
     &        420  ,         80 ,         90 ,        130 ,       100  ,GOTOS     117
C        'LOADFLOW',  'WDYNDATA',  'DYNDATA ',  'MDYNDATA',  'LDYNDATA',GOTOS     118
     &        110  ,        120 ,        140 ,        150 ,       160  ,GOTOS     119
C        '        ',  'RELADATA',  'RRESDAT ',  '        ',  'SWITDATA',GOTOS     120
     &        160  ,        290 ,        170 ,        190 ,       180  ,GOTOS     121
C        'MSWITDA ',  'LSWITDA ',  '        ',  'TADATA  ',  '        ',GOTOS     122
     &        200  ,        190 ,        230 ,        340 ,       250  ,GOTOS     123
C        'INITIAL ',  'TAINIT  ',  '        ',  'SIMULA  ',  'TEFMARGIN'GOTOS     124
     &        300  ,        360 ,        280 ,        440 ,       460   GOTOS     125
     &), IWHERE                                                         GOTOS     126
C                                                                       GOTOS     127
C   :..................................................................:GOTOS     128
C   ...........................                                         GOTOS     129
C   : QUIT                    :                                         GOTOS     130
C   : ENDPROG                 :                                         GOTOS     131
C   :                         :                                         GOTOS     132
 10   CONTINUE                                                          GOTOS     133
      IGOTO=1                                                           GOTOS     134
      RETURN                                                            GOTOS     135
C   :.........................:                                         GOTOS     136
C   ....................................                                GOTOS     137
C   : PLAYBACK                         :                                GOTOS     138
C   :                                  :                                GOTOS     139
 20   CONTINUE                                                          GOTOS     140
      CALL SWTERM(IS,PARAM,LENPAR,KLAYER)                               GOTOS     141
      IF(KLAYER.EQ.-2) MENUM=.FALSE.                                    GOTOS     142
      IGOTO=0                                                           GOTOS     143
      RETURN                                                            GOTOS     144
C   :..................................:                                GOTOS     145
C   .............................................                       GOTOS     146
C   : OPENCASE                                  :                       GOTOS     147
C   :                                           :                       GOTOS     148
C 30   CONTINUE                                                         GOTOS     149
C      IGOTO=0                                                          GOTOS     150
C      RETURN                                                           GOTOS     151
C   :...........................................:                       GOTOS     152
C   .............................                                       GOTOS     153
C   : STOPREC                   :                                       GOTOS     154
C   :                           :                                       GOTOS     155
 40   CONTINUE                                                          GOTOS     156
      CALL ENDREC                                                       GOTOS     157
      IGOTO=-1                                                          GOTOS     158
      RETURN                                                            GOTOS     159
C   :...........................:                                       GOTOS     160
C   .............................                                       GOTOS     161
C   : RECORD                    :                                       GOTOS     162
C   :                           :                                       GOTOS     163
 50   CONTINUE                                                          GOTOS     164
      CALL BEGREC(PARAM,LENPAR)                                         GOTOS     165
      IGOTO=-1                                                          GOTOS     166
      RETURN                                                            GOTOS     167
C   :...........................:                                       GOTOS     168
C   .............................................                       GOTOS     169
C   : HELP                                      :                       GOTOS     170
C   :                                           :                       GOTOS     171
 60   CONTINUE                                                          GOTOS     172
      CALL HELPSC(PARAM,LENPAR)                                         GOTOS     173
      IGOTO=0                                                           GOTOS     174
      RETURN                                                            GOTOS     175
C   :...........................................:                       GOTOS     176
C   .............................                                       GOTOS     177
C   : SAVE BUFFER TO ASCII FILE :                                       GOTOS     178
C   :                           :                                       GOTOS     179
C 70   CONTINUE                                                         GOTOS     180
c      CALL SAVEIT(PARAM,LENPAR)                                        GOTOS     181
C      IGOTO=-1                                                         GOTOS     182
C      RETURN                                                           GOTOS     183
C   :...........................:                                       GOTOS     184
C   .............................                                       GOTOS     185
C   : MENU SWITCH               :                                       GOTOS     186
C   :                           :                                       GOTOS     187
 80   CONTINUE                                                          GOTOS     188
         IF(MENUM) THEN                                                 GOTOS     189
           MENUM=.FALSE.                                                GOTOS     190
         ELSE                                                           GOTOS     191
           MENUM=.TRUE.                                                 GOTOS     192
         ENDIF                                                          GOTOS     193
         IGOTO=-1                                                       GOTOS     194
      RETURN                                                            GOTOS     195
C   :...........................:                                       GOTOS     196
C   .............................                                       GOTOS     197
C   : CDYNDATA                  :                                       GOTOS     198
C   :                           :                                       GOTOS     199
 90   CONTINUE                                                          GOTOS     200
      IF(LFREAD)THEN                                                    GOTOS     201
C                                                                       GOTOS     202
        IF(.NOT.DYREAD)THEN                                             GOTOS     203
        DYREAD=.TRUE.                                                   GOTOS     204
        JTLN=0                                                          GOTOS     205
        ENDIF                                                           GOTOS     206
C                                                                       GOTOS     207
      CALL CDYNDA(PARAM,LENPAR,IUY,KLAYER)                              GOTOS     208
C                                                                       GOTOS     209
      IBGSTA=-NGSREC                                                    GOTOS     210
      IF(IBGSTA.EQ.0)IBGSTA=1                                           GOTOS     211
      NGSREC=0                                                          GOTOS     212
      MSG(1)=' *** WARNING - THE CONVERTED CASE MUST BE RUN'            GOTOS     213
      MSG(2)='               1. WITHOUT CHECKING FOR GENERATOR '//      GOTOS     214
     +       'UNIT ID AND'                                              GOTOS     215
      MSG(3)='               2. ASSIGNING GENERATION FOR '//            GOTOS     216
     +       'INDIVIDUAL UNITS'                                         GOTOS     217
      MSG(4)='                  IN TERMS OF PERCENT OF TOTAL '//        GOTOS     218
     +       'BUS GENERATION'                                           GOTOS     219
      CALL PRTMSG(4)                                                    GOTOS     220
C                                                                       GOTOS     221
      CALL WDYNDA(PARAM,LENPAR,IUY,KLAYER)                              GOTOS     222
      IGOTO=1                                                           GOTOS     223
C                                                                       GOTOS     224
      ELSE                                                              GOTOS     225
C                                                                       GOTOS     226
      MSG(1)=' *** WARNING LOAD FLOW DATA HAS NOT BEEN READ'            GOTOS     227
      CALL PRTMSG(1)                                                    GOTOS     228
      IGOTO=0                                                           GOTOS     229
C                                                                       GOTOS     230
      ENDIF                                                             GOTOS     231
C                                                                       GOTOS     232
      RETURN                                                            GOTOS     233
C   :...........................:                                       GOTOS     234
C   .............................................                       GOTOS     235
C   : CASE                                      :                       GOTOS     236
C   :                                           :                       GOTOS     237
 100  CONTINUE                                                          GOTOS     238
      CALL CASE(PARAM,LENPAR,LDUMP,NCAS,KDEB,LFEPRI,KLAYER)             GOTOS     239
      IF(KLAYER.EQ.-2) MENUM=.FALSE.                                    GOTOS     240
      IGOTO=0                                                           GOTOS     241
      RETURN                                                            GOTOS     242
C   :...........................................:                       GOTOS     243
C   .............................................                       GOTOS     244
C   : LOADFLOW                                  :                       GOTOS     245
C   :                                           :                       GOTOS     246
 110  CONTINUE                                                          GOTOS     247
      CALL LOADFL(PARAM,LENPAR,LDUMP,NCAS,KDEB,LFEPRI,KLAYER,LEBK)      GOTOS     248
      IF(LEBK.EQ.0) LFREAD=.TRUE.                                       GOTOS     249
      IF(KLAYER.EQ.-2) MENUM=.FALSE.                                    GOTOS     250
      IGOTO=0                                                           GOTOS     251
      RETURN                                                            GOTOS     252
C   :...........................................:                       GOTOS     253
C   .............................................                       GOTOS     254
C   : WDYNDATA                                  :                       GOTOS     255
C   :                                           :                       GOTOS     256
 120  CONTINUE                                                          GOTOS     257
      IF(LLDYND)THEN                                                    GOTOS     258
      MSG(1)=' *** WARNING EXPORTING DYNAMIC DATA IS CURRENTLY NOT'     GOTOS     259
      MSG(2)='     ALLOWED ONCE THE DATA HAS BEEN LOADED'               GOTOS     260
      CALL PRTMSG(2)                                                    GOTOS     261
      ELSE                                                              GOTOS     262
C                                                                       GOTOS     263
      CALL WDYNDA(PARAM,LENPAR,IUY,KLAYER)                              GOTOS     264
C                                                                       GOTOS     265
      ENDIF                                                             GOTOS     266
      RETURN                                                            GOTOS     267
C   :...........................................:                       GOTOS     268
C   .............................................                       GOTOS     269
C   : DYNDATA                                   :                       GOTOS     270
C   :                                           :                       GOTOS     271
 140  CONTINUE                                                          GOTOS     272
      IF(LLDYND)THEN                                                    GOTOS     273
      MSG(1)=' *** WARNING READING DYNAMIC DATA IS NOT ALLOWED ONCE'    GOTOS     274
      MSG(2)='     THE DATA HAS BEEN LOADED'                            GOTOS     275
      CALL PRTMSG(2)                                                    GOTOS     276
      ELSEIF(LFREAD)THEN                                                GOTOS     277
C                                                                       GOTOS     278
        IF(.NOT.DYREAD)THEN                                             GOTOS     279
           DYREAD=.TRUE.                                                GOTOS     280
           JTLN=0                                                       GOTOS     281
        ENDIF                                                           GOTOS     282
C                                                                       GOTOS     283
        CALL DYNDAT(PARAM,LENPAR,IUY,KLAYER)                            GOTOS     284
      ELSE                                                              GOTOS     285
      MSG(1)=' *** WARNING READING DYNAMIC DATA IS NOT ALLOWED BEFORE'  GOTOS     286
      MSG(2)='     THE LOAD FLOW DATA IS READ'                          GOTOS     287
      CALL PRTMSG(2)                                                    GOTOS     288
      ENDIF                                                             GOTOS     289
      IGOTO=0                                                           GOTOS     290
      RETURN                                                            GOTOS     291
C   :...........................................:                       GOTOS     292
C   .............................................                       GOTOS     293
C   : MDYNDATA                                  :                       GOTOS     294
C   :                                           :                       GOTOS     295
 150  CONTINUE                                                          GOTOS     296
C                                                                       GOTOS     297
      IF(LLDYND)THEN                                                    GOTOS     298
      MSG(1)=' *** WARNING MODIFYING DYNAMIC DATA IS CURRENTLY NOT'     GOTOS     299
      MSG(2)='     ALLOWED ONCE THE DATA HAS BEEN LOADED'               GOTOS     300
      CALL PRTMSG(2)                                                    GOTOS     301
      ELSEIF(LFREAD)THEN                                                GOTOS     302
C                                                                       GOTOS     303
         IF(.NOT.DYREAD)THEN                                            GOTOS     304
            DYREAD=.TRUE.                                               GOTOS     305
            JTLN=0                                                      GOTOS     306
         ENDIF                                                          GOTOS     307
C                                                                       GOTOS     308
         CALL MDYNDA(PARAM,LENPAR,IUY,KLAYER)                           GOTOS     309
      ELSE                                                              GOTOS     310
      MSG(1)=                                                           GOTOS     311
     *   ' *** WARNING MODIFYING DYNAMIC DATA IS NOT ALLOWED BEFORE'    GOTOS     312
      MSG(2)='     THE LOAD FLOW DATA IS READ'                          GOTOS     313
      CALL PRTMSG(2)                                                    GOTOS     314
      ENDIF                                                             GOTOS     315
      IGOTO=0                                                           GOTOS     316
      RETURN                                                            GOTOS     317
C   :...........................................:                       GOTOS     318
C   .............................................                       GOTOS     319
C   : LDYNDATA                                  :                       GOTOS     320
C   :                                           :                       GOTOS     321
 160  CONTINUE                                                          GOTOS     322
      IF(DYREAD)THEN                                                    GOTOS     323
        CALL LDYNDA(IUY,IEBK)                                           GOTOS     324
        LLDYND=.TRUE.                                                   GOTOS     325
      ELSE                                                              GOTOS     326
      MSG(1)=' *** WARNING LOADING DYNAMIC DATA IS NOT ALLOWED BEFORE'  GOTOS     327
      MSG(2)='     THE DATA IS READ'                                    GOTOS     328
      CALL PRTMSG(2)                                                    GOTOS     329
      ENDIF                                                             GOTOS     330
      IGOTO=0                                                           GOTOS     331
      RETURN                                                            GOTOS     332
C   :...........................................:                       GOTOS     333
C   .............................................                       GOTOS     334
C   : RRESDAT                                   :                       GOTOS     335
C   :                                           :                       GOTOS     336
 170  CONTINUE                                                          GOTOS     337
      IF(LLDYND)THEN                                                    GOTOS     338
      CALL RRESDA(PARAM,LENPAR,IUX,IUY)                                 GOTOS     339
      LRRESD=.TRUE.                                                     GOTOS     340
      CALL REBUS                                                        GOTOS     341
      CALL HEAD                                                         GOTOS     342
      CALL YSELF                                                        GOTOS     343
      CALL RENET                                                        GOTOS     344
      IF(NAUT.NE.0)CALL ASWINT                                          GOTOS     345
      IF(KCDC.NE.0) CALL DCCONT                                         GOTOS     346
      IGOTO=0                                                           GOTOS     347
      ELSE                                                              GOTOS     348
      MSG(1)=                                                           GOTOS     349
     *' *** WARNING DYNAMIC DATA MUST BE LOADED PRIOR TO THIS COMMAND'  GOTOS     350
      CALL PRTMSG(1)                                                    GOTOS     351
      ENDIF                                                             GOTOS     352
      RETURN                                                            GOTOS     353
C   :...........................................:                       GOTOS     354
C   .............................................                       GOTOS     355
C   : SWITDATA                                  :                       GOTOS     356
C   :                                           :                       GOTOS     357
 180  CONTINUE                                                          GOTOS     358
      IF(LRRESD)THEN                                                    GOTOS     359
      CALL SWITDA(PARAM,LENPAR,IUX,IUY,IEBK)                            GOTOS     360
      IF(IEBK.EQ.0.OR.IEBK.EQ.100)SWIDAT=.TRUE.                         GOTOS     361
      IGOTO=0                                                           GOTOS     362
      ELSE                                                              GOTOS     363
      MSG(1)=' *** WARNING OUTPUT ANALYSIS DATA MUST BE SPECIFIED'      GOTOS     364
      MSG(2)='     PRIOR TO THIS COMMAND'                               GOTOS     365
      CALL PRTMSG(2)                                                    GOTOS     366
      ENDIF                                                             GOTOS     367
      RETURN                                                            GOTOS     368
C   :...........................................:                       GOTOS     369
C   .............................................                       GOTOS     370
C   : LSWITDA                                   :                       GOTOS     371
C   :                                           :                       GOTOS     372
 190  CONTINUE                                                          GOTOS     373
      IF (SWIDAT) THEN                                                  GOTOS     374
         LSWIT=.TRUE.                                                   GOTOS     375
         SWITCH=.FALSE.                                                 GOTOS     376
         CALL LSWITD(IEBK,IPSWIT,IUY)                                   GOTOS     377
         IF (IPSWIT.NE.0) CALL PSWITS(IUY)                              GOTOS     378
         IF (IEBK.EQ.0) THEN                                            GOTOS     379
            SWITCH=.TRUE.                                               GOTOS     380
         ELSE                                                           GOTOS     381
            MSG(1)=' SWITCHING DATA ERROR'                              GOTOS     382
            CALL ASTOP(MSG(1),41)                                       GOTOS     383
         END IF                                                         GOTOS     384
         CALL ACHAN                                                     GOTOS     385
      ELSE                                                              GOTOS     386
         MSG(1)=                                                        GOTOS     387
     *   ' *** WARNING NO SIMULATION SPECIFICATION DATA HAS BEEN READ'  GOTOS     388
         CALL PRTMSG(1)                                                 GOTOS     389
         IGOTO=0                                                        GOTOS     390
         RETURN                                                         GOTOS     391
      END IF                                                            GOTOS     392
      IGOTO=0                                                           GOTOS     393
      CALL YBRAN                                                        GOTOS     394
      RETURN                                                            GOTOS     395
C   :...........................................:                       GOTOS     396
C   .............................................                       GOTOS     397
C   :                                           :                       GOTOS     398
C   :                                           :                       GOTOS     399
 200  CONTINUE                                                          GOTOS     400
      IF(SWIDAT)THEN                                                    GOTOS     401
         CALL EDTFIL(IU52,IU31)                                         GOTOS     402
      ELSE                                                              GOTOS     403
         MSG(1)=                                                        GOTOS     404
     *' *** WARNING SIMULATION SPECIFICATION DATA HAS NOT BEEN READ'    GOTOS     405
         CALL PRTMSG(1)                                                 GOTOS     406
      ENDIF                                                             GOTOS     407
      IGOTO=0                                                           GOTOS     408
      RETURN                                                            GOTOS     409
C   :...........................................:                       GOTOS     410
C   .............................................                       GOTOS     411
C   :                                           :                       GOTOS     412
C   :                                           :                       GOTOS     413
 230  CONTINUE                                                          GOTOS     414
      IGOTO=0                                                           GOTOS     415
      RETURN                                                            GOTOS     416
C   :...........................................:                       GOTOS     417
C   .............................................                       GOTOS     418
C   :                                           :                       GOTOS     419
C   :                                           :                       GOTOS     420
 250  CONTINUE                                                          GOTOS     421
      IGOTO=0                                                           GOTOS     422
      RETURN                                                            GOTOS     423
C   :...........................................:                       GOTOS     424
C   .............................................                       GOTOS     425
C   :                                           :                       GOTOS     426
C   :                                           :                       GOTOS     427
 280  CONTINUE                                                          GOTOS     428
      IGOTO=0                                                           GOTOS     429
      RETURN                                                            GOTOS     430
C   :...........................................:                       GOTOS     431
C   .............................................                       GOTOS     432
C   : RELADATA                                  :                       GOTOS     433
C   :                                           :                       GOTOS     434
 290  CONTINUE                                                          GOTOS     435
      IF(.NOT.LRRESD)THEN                                               GOTOS     436
      CALL RELADA(PARAM,LENPAR,IUX,IUY)                                 GOTOS     437
      ELSE                                                              GOTOS     438
      MSG(1)=' *** WARNING RELAY DATA MUST BE SPECIFIED PRIOR'          GOTOS     439
      MSG(2)='     TO COMMAND RRESDAT'                                  GOTOS     440
      CALL PRTMSG(2)                                                    GOTOS     441
      ENDIF                                                             GOTOS     442
      IGOTO=0                                                           GOTOS     443
      RETURN                                                            GOTOS     444
C   :...........................................:                       GOTOS     445
C   .............................................                       GOTOS     446
C   : INITIALIZATION                            :                       GOTOS     447
C   :                                           :                       GOTOS     448
 300  CONTINUE                                                          GOTOS     449
      IF(SWITCH)THEN                                                    GOTOS     450
      CALL INITIA                                                       GOTOS     451
      LINIT=.TRUE.                                                      GOTOS     452
      ELSE                                                              GOTOS     453
      MSG(1)=                                                           GOTOS     454
     *' *** WARNING SIMULATION SPECIFICATION DATA MUST BE LOADED'       GOTOS     455
      MSG(2)='     PRIOR TO THIS COMMAND'                               GOTOS     456
      CALL PRTMSG(2)                                                    GOTOS     457
      ENDIF                                                             GOTOS     458
      IGOTO=0                                                           GOTOS     459
      RETURN                                                            GOTOS     460
C   :...........................................:                       GOTOS     461
C   .............................                                       GOTOS     462
C   : TADATA                    :                                       GOTOS     463
C   :                           :                                       GOTOS     464
 340  CONTINUE                                                          GOTOS     465
      IF (.NOT.LSWIT) THEN                                              GOTOS     466
         MSG(1)=' *** WARNING DATA TABULATION IS NOT ALLOWED BEFORE'    GOTOS     467
         MSG(2)='     LOADING THE SIMULATION SPECIFICATION DATA'        GOTOS     468
         CALL PRTMSG(2)                                                 GOTOS     469
      ELSE IF (LINIT) THEN                                              GOTOS     470
         MSG(1)=' *** WARNING DATA TABULATION IS NOT ALLOWED AFTER'     GOTOS     471
         MSG(2)='     THE INITIALIZATION'                               GOTOS     472
         CALL PRTMSG(2)                                                 GOTOS     473
      ELSE                                                              GOTOS     474
         CALL TABDAT                                                    GOTOS     475
      END IF                                                            GOTOS     476
      IGOTO=-1                                                          GOTOS     477
      RETURN                                                            GOTOS     478
C   :...........................:                                       GOTOS     479
C   .............................                                       GOTOS     480
C   :                           :                                       GOTOS     481
C   :TAINIT                     :                                       GOTOS     482
 360  CONTINUE                                                          GOTOS     483
      IF(LINIT)THEN                                                     GOTOS     484
      CALL TABINI(PARAM,LENPAR)                                         GOTOS     485
      ELSE                                                              GOTOS     486
      MSG(1)=' *** WARNING INITIALIZATION MUST BE PERFORMED'            GOTOS     487
      MSG(2)='     PRIOR TO THIS COMMAND'                               GOTOS     488
      CALL PRTMSG(2)                                                    GOTOS     489
      ENDIF                                                             GOTOS     490
      IGOTO=-1                                                          GOTOS     491
      RETURN                                                            GOTOS     492
C   :...........................:                                       GOTOS     493
C   ....................................                                GOTOS     494
C   : VMSDCL                           :                                GOTOS     495
C   : CALL TO LET VMS DO A DCL COMMAND :                                GOTOS     496
C                                                                       GOTOS     497
 420  CONTINUE                                                          GOTOS     498
      WRITE(LOUT,5040)                                                  GOTOS     499
      JERR=0                                                            GOTOS     500
      J=LENS(COMMD)                                                     GOTOS     501
      PARAM(1:50)=COMMD(J+2:J+51)                                       GOTOS     502
      LENPAR=LENSB(PARAM,50)                                            GOTOS     503
      CALL VMSCAL(PARAM,LENPAR,JERR)                                    GOTOS     504
      IF(JERR.LT.0)THEN                                                 GOTOS     505
      WRITE(LOUT,5050)                                                  GOTOS     506
      ELSE                                                              GOTOS     507
      WRITE(LOUT,5040)                                                  GOTOS     508
      ENDIF                                                             GOTOS     509
      RETURN                                                            GOTOS     510
C   :...........................:                                       GOTOS     511
C   .............................                                       GOTOS     512
C   : SIMULAT                   :                                       GOTOS     513
C   :                           :                                       GOTOS     514
 440  CONTINUE                                                          GOTOS     515
      IF(LINIT)THEN                                                     GOTOS     516
          IF(SWITCH)THEN                                                GOTOS     517
          CALL SIMULA                                                   GOTOS     518
          ELSE                                                          GOTOS     519
          MSG(1)=                                                       GOTOS     520
     *' *** WARNING NO SIMULATION SPECIFICATION DATA HAS BEEN LOADED'   GOTOS     521
          CALL PRTMSG(1)                                                GOTOS     522
          ENDIF                                                         GOTOS     523
      ELSE                                                              GOTOS     524
      MSG(1)=' *** WARNING INITIALIZATION HAS NOT BEEN PERFORMED'       GOTOS     525
      CALL PRTMSG(1)                                                    GOTOS     526
      ENDIF                                                             GOTOS     527
      IGOTO=0                                                           GOTOS     528
      RETURN                                                            GOTOS     529
C   :...........................:                                       GOTOS     530
C   .............................                                       GOTOS     531
C   : TEFMARGIN                 :                                       GOTOS     532
C   :                           :                                       GOTOS     533
 460  CONTINUE                                                          GOTOS     534
      CALL TEFMAR                                                       GOTOS     535
      IGOTO=0                                                           GOTOS     536
      RETURN                                                            GOTOS     537
C   .............................................                       GOTOS     538
C   : SETSIM                                    :                       GOTOS     539
C   :                                           :                       GOTOS     540
 130  CONTINUE                                                          GOTOS     541
      IF(RECORD)BACKSPACE IREC                                          GOTOS     542
      CALL SETSIM(PARAM,LENPAR,IUY,KLAYER)                              GOTOS     543
      IGOTO=-1                                                          GOTOS     544
      RETURN                                                            GOTOS     545
C   :...........................................:                       GOTOS     546
C   ...................................................                 GOTOS     547
C   : COMMAND OUT OF RANGE                            :                 GOTOS     548
C   :                                                 :                 GOTOS     549
 3900 CONTINUE                                                          GOTOS     550
      WRITE(LOUT,5000)                                                  GOTOS     551
C   :.................................................:                 GOTOS     552
      RETURN                                                            GOTOS     553
 5000 FORMAT(/,' *** ERROR COMMAND NOT YET INSTALLED',/)                GOTOS     554
 5020 FORMAT(/,' ** DEBUG(GOTOS) ** ',A8,2X,A)                          GOTOS     555
 5040 FORMAT(/,79('+'),/)                                               GOTOS     556
 5050 FORMAT(/,' *** ERROR VAX/VMS DCL COMMAND NOT FOUND',/)            GOTOS     557
      END                                                               GOTOS     558
