CFPRIME DISDAT                                                          DISDAT      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 DISDAT(IEBK)                                           DISDAT      3
CD                                                                      DISDAT      4
CD    THIS SUBROUTINE READS IN THE IMPEDANCE/DEFAULT DISTANT RELAY DATA.DISDAT      5
CD                                                                      DISDAT      6
CD     LDISTR          Starting position of IDATPT array  of DIST relay DISDAT      7
CD                     scheme, LDISTR is in the common labelled PT of   DISDAT      8
CD                     include file CNPT.                               DISDAT      9
CD                                                                      DISDAT     10
CD     NDISTR          Finishing position of IDATPT array of DIST relay DISDAT     11
CD                     scheme, NDISTR is in common labelled AUTO of     DISDAT     12
CD                     include file CNAUTO.                             DISDAT     13
CD                                                                      DISDAT     14
CD     let k = k-th DIST RELAY                                          DISDAT     15
CD                                                                      DISDAT     16
CD     N = IDATPT(k)    IDATPT is the array that stores the start       DISDAT     17
CD                      position of the K-TH DIST relay scheme data     DISDAT     18
CD                                                                      DISDAT     19
CD     IADATA(N+1)=ICD1RD   LOCAL RELAY STATUS                          DISDAT     20
CD                          = 1 RELAY NOT TRIPPED                       DISDAT     21
CD                          = 2 LOCAL TRIPPING COMPLETED,REMOTE         DISDAT     22
CD                              TRIPPING STARTED                        DISDAT     23
CD                          = 3 BOTH LOCAL AND REMOTE TRIPPING HAVE     DISDAT     24
CD                              BEEN COMPLETED.                         DISDAT     25
CD                                                                      DISDAT     26
CD     IADATA(N+2)=IBUSRD   LEFT HAND SIDE BUS NO.                      DISDAT     27
CD                                                                      DISDAT     28
CD     IADATA(N+3)=JBUSRD   RIGHT HAND SIDE BUS NO.                     DISDAT     29
CD                                                                      DISDAT     30
CD     IADATA(N+4)=IPARRD   PARALLEL IDENTIFICATION FOR THE LINE        DISDAT     31
CD                                                                      DISDAT     32
CD     IADATA(N+5)=ICD3RD   =1      USE SIGNAL TO TRIP THE LINE         DISDAT     33
CD                          =C OR 2 DO NOT TRIP THE LINE; SIGNAL        DISDAT     34
CD                                  IS USED FOR REMOTE TRIPPING.        DISDAT     35
CD                                                                      DISDAT     36
CD     IADATA(N+6)=ICD2RD   RELAY TYPE OPTION                           DISDAT     37
CD                          =1 IMPEDANCE RELAY (T1)                     DISDAT     38
CD                          =2 DEFAULT DISTANT RELAY (T2)               DISDAT     39
CD                                                                      DISDAT     40
CD     IADATA(N+7)=ICD4RD   NUMBER OF REMOTE RELAY ATTACH TO THE LOCAL  DISDAT     41
CD                          RELAY                                       DISDAT     42
CD                                                                      DISDAT     43
CD     IADATA(N+8)          REMOTE RELAY TRIP FLAG                      DISDAT     44
CD                                                                      DISDAT     45
CD                                                                      DISDAT     46
CD     ADATA(N+9) =TRCRD    T1 :READ IN AS THE Tcenter, INITIALIZED AS  DISDAT     47
CD                              Tcenter*COS(TANGLE) FOR CIRCLE T.       DISDAT     48
CD                          T2 :USER SUPPLIED R/X RATIO                 DISDAT     49
CD                                                                      DISDAT     50
CD                                                                      DISDAT     51
CD     ADATA(N+10)=TXCRD    T1 :READ IN AS THE TORQUE ANGLE, INITIALIZEDDISDAT     52
CD                              AS Tcenter*SIN(TANGLE) FOR CIRCLE T.    DISDAT     53
CD                          T2 :ZONE ONE REACH (DEFAULT=0.8)            DISDAT     54
CD                                                                      DISDAT     55
CD     ADATA(N+11)=TRD2RD   T1 :READ IN AS THE DIAMETER OF THE CIRCLE T;DISDAT     56
CD                              STORE AS THE RADIUS SQUARE OF CIRCLE T. DISDAT     57
CD                          T2 :ZONE TWO REACH (DEFAULT=1.2)            DISDAT     58
CD                                                                      DISDAT     59
CD                                                                      DISDAT     60
CD     ADATA(N+12)=TTRPRD   T1 :CIRCLE T TRIP TIME IN CIRCLE            DISDAT     61
CD                          T2 :MIN TORQUE ANGLE OVER WHICH THE RELAY   DISDAT     62
CD                              LOGIC WILL BE ACTIVIATED.(DEFAULT=60)   DISDAT     63
CD                                                                      DISDAT     64
CD     ADATA(N+13)=TZDYRD   T1 :ZONE 1 (CIRCLE T)  TIMER                DISDAT     65
CD                          T2 :NOT USED                                DISDAT     66
CD                                                                      DISDAT     67
CD                                                                      DISDAT     68
CD     ADATA(N+14)=BRCRD    T1 :READ IN AS THE Bcenter, INITIALIZED     DISDAT     69
CD                              AS Bcenter*COS(BANGLE) FOR CIRCLE B.    DISDAT     70
CD                          T2 : MAX TORQUE ANGLE (DEFAULT=75)          DISDAT     71
CD                                                                      DISDAT     72
CD     ADATA(N+15)=BXCRD    T1 :READ IN AS THE TORQUE ANGLE, INITIALIZEDDISDAT     73
CD                              AS Bcenter*SIN(BANGLE) FOR CIRCLE B.    DISDAT     74
CD                          T2 :NOT USED                                DISDAT     75
CD                                                                      DISDAT     76
CD     ADATA(N+16)=BRD2RD   T1 :READ IN AS THE DIAMETER OF THE CIRCLE B;DISDAT     77
CD                              STORE AS THE RADIUS SQUARE OF CIRCLE B. DISDAT     78
CD                          T2 :NOT USED                                DISDAT     79
CD                                                                      DISDAT     80
CD     ADATA(N+17)=BTRPRD   T1 :CYCLE B  TRIP TIME IN CYCLES            DISDAT     81
CD                          T2 :NOT USED                                DISDAT     82
CD                                                                      DISDAT     83
CD     ADATA(N+18)=BZDYRD   T1 :ZONE 2 (CYCLE B) TIMER                  DISDAT     84
CD                          T2 :RELAY TIMER                             DISDAT     85
CD                                                                      DISDAT     86
CD     ADATA(N+19)=TRCLSE   T1,T2 :RECLOSING TIME DELAY.                DISDAT     87
CD                                                                      DISDAT     88
CD     ADATA(N+20)=RTIMER   T1,T2 :RECLOSING TIMER                      DISDAT     89
CD                                                                      DISDAT     90
CD                                                                      DISDAT     91
CD     FOR T1: LINE PARAMETER IN PI-CIRCUIT FORM                        DISDAT     92
CD                                                                      DISDAT     93
CD                                                                      DISDAT     94
CD     ADATA(N+21)=GIJRD    GKM                                         DISDAT     95
CD     ADATA(N+22)=BIJRD    BKM                                         DISDAT     96
CD     ADATA(N+23)=GIORD    GK1                                         DISDAT     97
CD     ADATA(N+24)=BIORD    BK1                                         DISDAT     98
CD     ADATA(N+25)=GJORD    GK2                                         DISDAT     99
CD     ADATA(N+26)=BJORD    BK2                                         DISDAT    100
CD                                                                      DISDAT    101
CD                                                                      DISDAT    102
CD     FOR T2:                                                          DISDAT    103
CD                                                                      DISDAT    104
CD                                                                      DISDAT    105
CD     ADATA(N+21)         TAN60                                        DISDAT    106
CD     ADATA(N+22)         A1                                           DISDAT    107
CD     ADATA(N+23)         B1                                           DISDAT    108
CD     ADATA(N+24)         A2                                           DISDAT    109
CD     ADATA(N+25)         B2                                           DISDAT    110
CD     ADATA(N+26)         NOT USED                                     DISDAT    111
CD                                                                      DISDAT    112
CD     IADATA(N+27)        NJSELI        FLAG FOR PI-LINE WITH UNEQUAL  DISDAT    113
CD                                       SHUNTS.                        DISDAT    114
CD                                                                      DISDAT    115
CD                                                                      DISDAT    116
      INCLUDE 'PARX.INS'                                                DISDAT    117
      INCLUDE 'CNPT.INS'                                                DISDAT    118
      INCLUDE 'CNMNEW.INS'                                              DISDAT    119
      INCLUDE 'CNAUTO.INS'                                              DISDAT    120
      INCLUDE 'CNLFDA.INS'                                              DISDAT    121
      INCLUDE 'CNB19.INS'                                               DISDAT    122
      INCLUDE 'CNFLAG.INS'                                              DISDAT    123
      INCLUDE 'CNPARX.INS'                                              DISDAT    124
      INCLUDE 'CNREN.INS'                                               DISDAT    125
      INCLUDE 'CNUNIT.INS'                                              DISDAT    126
      INCLUDE 'CNMSG.INS'                                               DISDAT    127
C                                                                       DISDAT    128
      CHARACTER*80 CARD1,CARD                                           DISDAT    129
      CHARACTER*12 BNAME1,BNAME2                                        DISDAT    130
      CHARACTER*2 CID2                                                  DISDAT    131
      CHARACTER*1 TFLAG,ROPT,C,D                                        DISDAT    132
      INTEGER*4 ICID                                                    DISDAT    133
      CHARACTER*5 EDATA                                                 DISDAT    134
      CHARACTER*3 ESC,MPI                                               DISDAT    135
      DATA ESC/'ESC'/,MPI/'MPI'/                                        DISDAT    136
      DATA EDATA/'EDATA'/,C/'C'/,D/'D'/                                 DISDAT    137
C                                                                       DISDAT    138
      LDEB=.FALSE.                                                      DISDAT    139
C                                                                       DISDAT    140
C     READ IN THE RELAY DATA CARDS                                      DISDAT    141
C                                                                       DISDAT    142
  110 CONTINUE                                                          DISDAT    143
      CALL GETLIN(IU54,CARD1)                                           DISDAT    144
      IF(CARD1(1:5).EQ.EDATA) GOTO 300                                  DISDAT    145
      IF(KLFO.EQ.0)THEN                                                 DISDAT    146
            READ (CARD1,2010) NLFI,NLFJ,CID2,TFLAG,ROPT                 DISDAT    147
      ELSE                                                              DISDAT    148
            READ (CARD1,2020) BNAME1,BNAME2,CID2,TFLAG,ROPT             DISDAT    149
            CALL CHKBUS(BNAME1,NLFI)                                    DISDAT    150
            CALL CHKBUS(BNAME2,NLFJ)                                    DISDAT    151
      ENDIF                                                             DISDAT    152
      IF(NLFI.EQ.0.OR.NLFJ.EQ.0.OR.                                     DISDAT    153
     *   MNEW(NLFI).EQ.0.OR.MNEW(NLFJ).EQ.0)THEN                        DISDAT    154
         WRITE(MSG(1),2030)                                             DISDAT    155
         GOTO 200                                                       DISDAT    156
      ENDIF                                                             DISDAT    157
C                                                                       DISDAT    158
C     STORE THE DATA INTO THE PERMANENT ARRAY                           DISDAT    159
C                                                                       DISDAT    160
      IF(NAUT.GE.MAXSET)THEN                                            DISDAT    161
         WRITE(MSG(1),2040) MXASCH                                      DISDAT    162
         GOTO 200                                                       DISDAT    163
      ENDIF                                                             DISDAT    164
C                                                                       DISDAT    165
      LDSTAT=0                                                          DISDAT    166
      NPROG=MNEW(NLFI)                                                  DISDAT    167
      IF(JBSTAT(NPROG).GT.2)LDSTAT=10                                   DISDAT    168
      IF(LDSTAT.EQ.0)THEN                                               DISDAT    169
      NPROG=MNEW(NLFJ)                                                  DISDAT    170
      IF(JBSTAT(NPROG).GT.2)LDSTAT=10                                   DISDAT    171
      ENDIF                                                             DISDAT    172
      IADATA(JLNA+1)=LDSTAT                                             DISDAT    173
C                                                                       DISDAT    174
      NAUT=NAUT+1                                                       DISDAT    175
      NAUTB=NAUTB+2                                                     DISDAT    176
      NAUBUS(NAUTB-1)=NLFI                                              DISDAT    177
      NAUBUS(NAUTB)=NLFJ                                                DISDAT    178
      LRTEMP=LRTEMP+1                                                   DISDAT    179
      IDATPT(LRTEMP)=JLNA                                               DISDAT    180
C                                                                       DISDAT    181
      IADATA(JLNA+2)=NLFI                                               DISDAT    182
      IADATA(JLNA+3)=NLFJ                                               DISDAT    183
      CALL PACK(CID2,0,ICID)                                            DISDAT    184
      IADATA(JLNA+4)=ICID                                               DISDAT    185
      IADATA(JLNA+5)=1                                                  DISDAT    186
      IF(TFLAG.EQ.C)IADATA(JLNA+5)=2                                    DISDAT    187
      IADATA(JLNA+6)=1                                                  DISDAT    188
      IF(ROPT.EQ.D)IADATA(JLNA+6)=2                                     DISDAT    189
C                                                                       DISDAT    190
      CALL GETLIN(IU54,CARD)                                            DISDAT    191
      READ(CARD,2050) ADATA(JLNA+9),ADATA(JLNA+10),ADATA(JLNA+11)       DISDAT    192
     &,ADATA(JLNA+12)                                                   DISDAT    193
      CALL GETLIN(IU54,CARD)                                            DISDAT    194
      READ(CARD,2050) ADATA(JLNA+14),ADATA(JLNA+15),ADATA(JLNA+16)      DISDAT    195
     &,ADATA(JLNA+17),ADATA(JLNA+19)                                    DISDAT    196
      JSWITC=JLNA+7                                                     DISDAT    197
      JLNA=JLNA+27                                                      DISDAT    198
      KSWITC=0                                                          DISDAT    199
C                                                                       DISDAT    200
C    READ IN THE REMOTE RELAYS                                          DISDAT    201
C                                                                       DISDAT    202
 150  CALL GETLIN(IU54,CARD)                                            DISDAT    203
      IF(CARD(1:3).EQ.ESC)THEN                                          DISDAT    204
         IADATA(JSWITC)=KSWITC                                          DISDAT    205
      ELSE                                                              DISDAT    206
         IF(CARD(1:3).EQ.MPI) CALL GETLIN(IU54,CARD1)                   DISDAT    207
         CALL SWIDAT(CARD,CARD1,KSWITC,IEBK)                            DISDAT    208
         GOTO 150                                                       DISDAT    209
      ENDIF                                                             DISDAT    210
      GOTO 110                                                          DISDAT    211
C                                                                       DISDAT    212
 200  IEBK=1                                                            DISDAT    213
      MSG(2)=CARD1                                                      DISDAT    214
      CALL PRTMSG(2)                                                    DISDAT    215
      KSWITC=0                                                          DISDAT    216
 115  CALL GETLIN(IU54,CARD)                                            DISDAT    217
      IF(CARD(1:3).EQ.ESC) GOTO 110                                     DISDAT    218
      GOTO 115                                                          DISDAT    219
C                                                                       DISDAT    220
 300  CONTINUE                                                          DISDAT    221
      IF(LRTEMP.NE.LDISTR)THEN                                          DISDAT    222
         LDISTR=LDISTR+1                                                DISDAT    223
         NDISTR=LRTEMP                                                  DISDAT    224
      ELSE                                                              DISDAT    225
         LDISTR=0                                                       DISDAT    226
         NDISTR=0                                                       DISDAT    227
      ENDIF                                                             DISDAT    228
C                                                                       DISDAT    229
      IF(IEBK.EQ.0)RETURN                                               DISDAT    230
C                                                                       DISDAT    231
 2020 FORMAT(2A12,A2,3X,A1,1X,A1)                                       DISDAT    232
 2010 FORMAT(2I5,A2,3X,A1,1X,A1)                                        DISDAT    233
 2030 FORMAT(' *** ERROR  IMPEDANCE RELAY TRIPPING BUS NOT FOUND.')     DISDAT    234
 2040 FORMAT(' *** ERROR   RELAY SCHEME EXCEEDS THE LIMIT OF ',I3)      DISDAT    235
 2050 FORMAT(6F10.5)                                                    DISDAT    236
C                                                                       DISDAT    237
      END                                                               DISDAT    238
