CFPRIME PARSET                                                          PARSET      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 PARSET                                                 PARSET      3
CD                                                                      PARSET      4
CD    THIS ROUTINE INITIALIZES GLOBAL PARAMETERS IN THE COMMON BLOCK.   PARSET      5
CD                                                                      PARSET      6
      INCLUDE 'CNLSTA.INS'                                              PARSET      7
C                                                                       PARSET      8
      INCLUDE 'PARX.INS'                                                PARSET      9
      INCLUDE 'CNPT.INS'                                                PARSET     10
      INCLUDE 'CNFLAG.INS'                                              PARSET     11
      INCLUDE 'CNB4.INS'                                                PARSET     12
      INCLUDE 'CNB19.INS'                                               PARSET     13
      INCLUDE 'CNEXC.INS'                                               PARSET     14
      INCLUDE 'CNPARX.INS'                                              PARSET     15
      INCLUDE 'CNUNIT.INS'                                              PARSET     16
      INCLUDE 'CNLUN.INS'                                               PARSET     17
      INCLUDE 'CNULTC.INS'                                              PARSET     18
      INCLUDE 'CNJCOB.INS'                                              PARSET     19
C                                                                       PARSET     20
      INCLUDE 'CNKEYW.INS'                                              PARSET     21
      INCLUDE 'CNFRUN.INS'                                              PARSET     22
C                                                                       PARSET     23
      INCLUDE 'GRPDCS.INS'                                              PARSET     24
      DIMENSION IPTAY(108)                                              PARSET     25
      EQUIVALENCE (NT,IPTAY(1))                                         PARSET     26
C      INCLUDE 'CNTGED.INS/LIST'                                        PARSET     27
      INCLUDE 'CNJPT.INS'                                               PARSET     28
      DIMENSION JPTAY(11)                                               PARSET     29
      EQUIVALENCE (LJNT,JPTAY(1))                                       PARSET     30
      INCLUDE 'CNAUTO.INS'                                              PARSET     31
      DIMENSION KPTAY(20)                                               PARSET     32
      EQUIVALENCE (IASWCT,KPTAY(1))                                     PARSET     33
      INCLUDE 'CNB0.INS'                                                PARSET     34
      INCLUDE 'CNIMPR.INS'                                              PARSET     35
      CHARACTER*4 ITITLE,ITEXT,ICASID                                   PARSET     36
      INCLUDE 'UDCG.INS'                                                PARSET     37
       CHARACTER*12  CASEID                                             PARSET     38
       EQUIVALENCE   (CASEID, ICASID(1))                                PARSET     39
C                                                                       PARSET     40
      LDEB=.FALSE.                                                      PARSET     41
CD                                                                      PARSET     42
CD    1. PARAMETERS USED IN THE SOLUTION                                PARSET     43
CD                                                                      PARSET     44
        ISPEED=0                                                        PARSET     45
        KSALI=0                                                         PARSET     46
        MPRITE=5                                                        PARSET     47
        MAXIT=100                                                       PARSET     48
        ISKIP=0                                                         PARSET     49
        IPREDM=1                                                        PARSET     50
        KORDJB=0                                                        PARSET     51
        MAXNIT=10                                                       PARSET     52
        IJMCT=3                                                         PARSET     53
        RESTOL=0.01                                                     PARSET     54
        TVAPDC=50.0                                                     PARSET     55
        ZDTOL=0.01                                                      PARSET     56
        GVTMIN=0.7                                                      PARSET     57
        GVTMAX=1.2                                                      PARSET     58
        BUVMIN=0.5                                                      PARSET     59
        BUVMAX=1.2                                                      PARSET     60
        XMAXSD=0.1                                                      PARSET     61
        TMIN=0.01                                                       PARSET     62
        DTMIN=0.0005                                                    PARSET     63
        ERTOL=0.00005                                                   PARSET     64
        DBTOL=0.00005                                                   PARSET     65
        PNLI=0.2                                                        PARSET     66
        VTHZL=0.3                                                       PARSET     67
        VTHZH=0.5                                                       PARSET     68
        ZILTOL=.0001                                                    PARSET     69
        MULTSW=10                                                       PARSET     70
        NREFUC=1                                                        PARSET     71
        XCMMX=500.0                                                     PARSET     72
        BASPC=100.0                                                     PARSET     73
        FQBASE=60.0                                                     PARSET     74
        NSMTCL=1                                                        PARSET     75
        NSMULC=1                                                        PARSET     76
        IVERS=0                                                         PARSET     77
        NISBUS=0                                                        PARSET     78
        IBPAFL=0                                                        PARSET     79
        NIMLVT=10                                                       PARSET     80
        IHOOK=99                                                        PARSET     81
C                                                                       PARSET     82
      I16B=2**16                                                        PARSET     83
      I16B2=2*I16B                                                      PARSET     84
      I16B3=3*I16B                                                      PARSET     85
      I16BH=I16B/2                                                      PARSET     86
      DEADBD=0.01                                                       PARSET     87
      PI=1.0/(2.0*ATAN(1.0))                                            PARSET     88
      PI2=0.25*PI                                                       PARSET     89
      WOBASE=FQBASE*4.0/PI                                              PARSET     90
      PII=4.0*ATAN(1.0)                                                 PARSET     91
      MTFLAG=1                                                          PARSET     92
      IBGSTA=0                                                          PARSET     93
CD                                                                      PARSET     94
CD    2. PARAMTERS OF PROGRAM DIMENSIONS                                PARSET     95
CD                                                                      PARSET     96
      NXB=NB                                                            PARSET     97
      NXPL=NPL                                                          PARSET     98
      NXL2=2*NXPL                                                       PARSET     99
      NXL3=3*NXPL                                                       PARSET    100
      NXTR=NTR                                                          PARSET    101
      NXTR2=NTR*2                                                       PARSET    102
      MXP=MP                                                            PARSET    103
      NXM=NM                                                            PARSET    104
      NXG=NG                                                            PARSET    105
      NXDCL=NDCL                                                        PARSET    106
      NXMT=NMT                                                          PARSET    107
      NXSR=NSR                                                          PARSET    108
      NXZL=NZL                                                          PARSET    109
      NXZL1=NZL+1                                                       PARSET    110
      MNLBS=NZL                                                         PARSET    111
      NKLOAD=NZL                                                        PARSET    112
      NXDAT=NDAT-100                                                    PARSET    113
      NXDEV=NDEV                                                        PARSET    114
      NXSI=NSI                                                          PARSET    115
      NXSID=NSID                                                        PARSET    116
      MXMONL=MONL                                                       PARSET    117
      NXB=NB                                                            PARSET    118
      NXL=NPL                                                           PARSET    119
      NXTR=NTR                                                          PARSET    120
      NXTR1=NTR+1                                                       PARSET    121
      MXL=ML                                                            PARSET    122
      MXP=MP                                                            PARSET    123
      NXM=NM                                                            PARSET    124
      NXG=NG                                                            PARSET    125
      NXDCL=NDCL                                                        PARSET    126
      NXMT=NMT                                                          PARSET    127
      NXSR=NSR                                                          PARSET    128
      NXZL=NZL                                                          PARSET    129
      NXZL1=NZL+1                                                       PARSET    130
      MXADAT=MADATA                                                     PARSET    131
      MXASCH=MAXCHM                                                     PARSET    132
      N99999=99999                                                      PARSET    133
CD                                                                      PARSET    134
CD    3. DEFINITION OF LOGICAL UNITS OF SWITCHING FILES                 PARSET    135
CD                                                                      PARSET    136
      ISWF=IU11                                                         PARSET    137
      ISWFA=IU15                                                        PARSET    138
      IASWX=0                                                           PARSET    139
C---------------------------------------------------------------------  PARSET    140
C                                                                       PARSET    141
C               *****     DATA INITIALIZATION    *****                  PARSET    142
C                                                                       PARSET    143
C---------------------------------------------------------------------  PARSET    144
C                                                                       PARSET    145
C        PURPOSE:  Initializes the COMMON BLOCK data for the            PARSET    146
C                  Stability Program.                                   PARSET    147
C                                                                       PARSET    148
C---------------------------------------------------------------------  PARSET    149
C                                                                       PARSET    150
C                                                                       PARSET    151
C     KEY WORD OF ACTIVITIES                                            PARSET    152
C --------------------------------------------------------------------- PARSET    153
C                                                                       PARSET    154
CD                                                                      PARSET    155
CD    4. DEFINITION OF KEY WORDS OF PROGRAM INTERACTIVITIES             PARSET    156
CD                                                                      PARSET    157
       KEYW(1)='QUIT    '                                               PARSET    158
       KEYW(2)='HELP    '                                               PARSET    159
       KEYW(3)='RECORD  '                                               PARSET    160
       KEYW(4)='STOPREC '                                               PARSET    161
       KEYW(5)='PLAYBACK'                                               PARSET    162
       KEYW(6)='VMSDCL  '                                               PARSET    163
       KEYW(7)='MENU    '                                               PARSET    164
       KEYW(8)='CDYNDATA'                                               PARSET    165
       KEYW(9)='SETSIM  '                                               PARSET    166
      KEYW(10)='CASE    '                                               PARSET    167
      KEYW(11)='LOADFLOW'                                               PARSET    168
      KEYW(12)='WDYNDATA'                                               PARSET    169
      KEYW(13)='DYNDATA '                                               PARSET    170
      KEYW(14)='MDYNDATA'                                               PARSET    171
      KEYW(15)='LDYNDATA'                                               PARSET    172
      KEYW(16)='        '                                               PARSET    173
      KEYW(17)='RELADATA'                                               PARSET    174
      KEYW(18)='RRESDAT '                                               PARSET    175
      KEYW(19)='        '                                               PARSET    176
      KEYW(20)='SWITDATA'                                               PARSET    177
      KEYW(21)='MSWITDA '                                               PARSET    178
      KEYW(22)='LSWITDA '                                               PARSET    179
      KEYW(23)='        '                                               PARSET    180
      KEYW(24)='TADATA  '                                               PARSET    181
      KEYW(25)='        '                                               PARSET    182
      KEYW(26)='INITIAL '                                               PARSET    183
      KEYW(27)='TAINIT  '                                               PARSET    184
      KEYW(28)='        '                                               PARSET    185
      KEYW(29)='SIMULAT '                                               PARSET    186
      KEYW(30)='TEFMARGI'                                               PARSET    187
      KEYW(31)='        '                                               PARSET    188
      KEYW(32)='        '                                               PARSET    189
      KEYW(33)='        '                                               PARSET    190
      KEYW(34)='        '                                               PARSET    191
      KEYW(35)='        '                                               PARSET    192
      KEYW(36)='        '                                               PARSET    193
      KEYW(37)='        '                                               PARSET    194
      KEYW(38)='        '                                               PARSET    195
      KEYW(39)='        '                                               PARSET    196
      KEYW(40)='        '                                               PARSET    197
CD                                                                      PARSET    198
CD   5. INITIALIZATION OF LOGICAL VARIABLES                             PARSET    199
CD                                                                      PARSET    200
      CFLRUN = .FALSE.                                                  PARSET    201
      PRSWSM = .FALSE.                                                  PARSET    202
      LFREAD=.FALSE.                                                    PARSET    203
      DYREAD=.FALSE.                                                    PARSET    204
      LRRESD=.FALSE.                                                    PARSET    205
      LINIT=.FALSE.                                                     PARSET    206
      LSWIT=.FALSE.                                                     PARSET    207
      RECORD=.FALSE.                                                    PARSET    208
      KREAD=.TRUE.                                                      PARSET    209
      OPENED=.FALSE.                                                    PARSET    210
      PLAYBA=.FALSE.                                                    PARSET    211
      LU18=.FALSE.                                                      PARSET    212
      LU51=.FALSE.                                                      PARSET    213
C-------------------------------------------------------------------    PARSET    214
      MENUM=.FALSE.                                                     PARSET    215
      PROMPT=' ETMSP '                                                  PARSET    216
      INSTAL=30                                                         PARSET    217
CD                                                                      PARSET    218
CD   6. DEFINITION OF SCREEN AND OUTPUT UNITS                           PARSET    219
CD                                                                      PARSET    220
*IF PRIME                                                               PARSET    221
*ENDIF                                                                  PARSET    224
*IF -PRIME                                                              PARSET    225
      LIN=5                                                             PARSET    226
      LOUT=6                                                            PARSET    227
*ENDIF                                                                  PARSET    228
CD                                                                      PARSET    229
CD    7. INITIALIZATION OF LUNIT TO TRACK THE USAGE OF LOGICAL UNITS    PARSET    230
CD                                                                      PARSET    231
C--------------------------------------------------------------------   PARSET    232
      DO 10 I=1,100                                                     PARSET    233
 10   LUNITS(I)=.FALSE.                                                 PARSET    234
C                                                                       PARSET    235
C---------------------------------------------------------------------  PARSET    236
C  ARRAYS FOR DEBUG                                                     PARSET    237
C                                                                       PARSET    238
      DO 20 I=1,40                                                      PARSET    239
C      FILUNT(I)='                                                  '   PARSET    240
C      LOGUNT(I)=.FALSE.                                                PARSET    241
C      LUNTNO(I)=60+I                                                   PARSET    242
 20   CONTINUE                                                          PARSET    243
C                                                                       PARSET    244
      DO 30 I=1,500                                                     PARSET    245
      JDEB(I)=0                                                         PARSET    246
 30   CONTINUE                                                          PARSET    247
C------------------------------------------------------------------     PARSET    248
CD                                                                      PARSET    249
CD    8. INITIALIZATION OF COMMONS AND ARRAYS                           PARSET    250
CD                                                                      PARSET    251
CD       COMMON PT                                                      PARSET    252
CD                                                                      PARSET    253
      CALL MOVE(0,IPTAY,IPTAY,108)                                      PARSET    254
      NULTC=0                                                           PARSET    255
C                                                                       PARSET    256
CD       COMMON AUTO                                                    PARSET    257
CD                                                                      PARSET    258
      CALL MOVE(0,KPTAY,KPTAY,20)                                       PARSET    259
C                                                                       PARSET    260
CD       COMMON JPT                                                     PARSET    261
CD                                                                      PARSET    262
      CALL MOVE(0,JPTAY,JPTAY,11)                                       PARSET    263
C                                                                       PARSET    264
CD       DC CONVERTER INTERFACE                                         PARSET    265
CD                                                                      PARSET    266
        NINTF=0                                                         PARSET    267
        JTHDC=0                                                         PARSET    268
C                                                                       PARSET    269
CD       BLANK ARRAY ITITLE,ITEXT,ICASID                                PARSET    270
CD                                                                      PARSET    271
       DO 90 I=1,20                                                     PARSET    272
         DO 80 II=1,6                                                   PARSET    273
           ITITLE(II,I)=' '                                             PARSET    274
 80      CONTINUE                                                       PARSET    275
         ITEXT(I)=' '                                                   PARSET    276
 90    CONTINUE                                                         PARSET    277
       CASEID=' '                                                       PARSET    278
CD                                                                      PARSET    279
CD    9. OPEN SCRATCH FILES USED IN THE PROGRAM                         PARSET    280
CD                                                                      PARSET    281
C   FILE 3 STORE THE NETWORK DATA                                       PARSET    282
C                                                                       PARSET    283
      OPEN(IU3,STATUS='SCRATCH',FORM='UNFORMATTED')                     PARSET    284
      LUNITS(IU3)=.TRUE.                                                PARSET    285
C                                                                       PARSET    286
C   FILE 4 STORE THE NETWORK LINKNET AND OTHER DATA                     PARSET    287
C                                                                       PARSET    288
      OPEN(IU4,STATUS='SCRATCH',FORM='UNFORMATTED')                     PARSET    289
      LUNITS(IU4)=.TRUE.                                                PARSET    290
C                                                                       PARSET    291
C   FILE 7 STORE THE L & U MATRIX                                       PARSET    292
C                                                                       PARSET    293
      OPEN(IU7,STATUS='SCRATCH',FORM='UNFORMATTED')                     PARSET    294
      LUNITS(IU7)=.TRUE.                                                PARSET    295
C                                                                       PARSET    296
C   FILE 11 STORE THE NETWORK DATA                                      PARSET    297
C                                                                       PARSET    298
      OPEN(IU11,STATUS='SCRATCH',FORM='FORMATTED')                      PARSET    299
      LUNITS(IU11)=.TRUE.                                               PARSET    300
C                                                                       PARSET    301
C   FILE 12 STORE THE NETWORK DATA                                      PARSET    302
C                                                                       PARSET    303
      OPEN(IU12,STATUS='SCRATCH',FORM='FORMATTED')                      PARSET    304
      LUNITS(IU12)=.TRUE.                                               PARSET    305
C                                                                       PARSET    306
      RETURN                                                            PARSET    307
C                                                                       PARSET    308
      END                                                               PARSET    309
