CFPRIME RCPDAT                                                          RCPDAT      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
C                                                                       RCPDAT      3
      SUBROUTINE RCPDAT(IEBK)                                           RCPDAT      4
CD                                                                      RCPDAT      5
CD   THIS SUBROUTINE READS IN THE RATE OF CHANGE OF POWER RELAY DATA    RCPDAT      6
CD   FROM A GIVEN FILE.                                                 RCPDAT      7
CD                                                                      RCPDAT      8
CD   ROUTINE OUTPUT:                                                    RCPDAT      9
CD                                                                      RCPDAT     10
CD   IEBK = 0 NO ERROR                                                  RCPDAT     11
CD   IEBK = 1 WHEN                                                      RCPDAT     12
CD                                                                      RCPDAT     13
CD   1. RATE OF CHANGE OF POWER RELAY BUS NOT FOUND                     RCPDAT     14
CD   2. RELAY SCHEME EXCEEDS THE PROGRAM LIMIT                          RCPDAT     15
CD   3. MODEL FOR THE RATE OF CHANGE OF POWER RELAY IS NOT SPECIFIED    RCPDAT     16
CD                                                                      RCPDAT     17
CD                                                                      RCPDAT     18
CD     LRCRPA          Starting position of IDATPT array  of RCPR relay RCPDAT     19
CD                     scheme, LRCRPA is in the common labelled PT of   RCPDAT     20
CD                     include file CNPT.                               RCPDAT     21
CD                                                                      RCPDAT     22
CD     NRCPRA          Finishing position of IDATPT array of RCPR relay RCPDAT     23
CD                     scheme, NRCPRA is in common labelled AUTO of     RCPDAT     24
CD                     include file CNAUTO.                             RCPDAT     25
CD                                                                      RCPDAT     26
CD     let k = k-th RCPR RELAY                                          RCPDAT     27
CD                                                                      RCPDAT     28
CD     N = IDATPT(k)    IDATPT is the array that stores the start       RCPDAT     29
CD                      position of the K-TH RCPR relay scheme data     RCPDAT     30
CD                                                                      RCPDAT     31
CD       IADATA(N+1)=ICD1R1  LOCAL RELAY TRIP STATUS                    RCPDAT     32
CD                           = 1 RELAY NOT TRIP                         RCPDAT     33
CD                           = 2 LOCAL RELAY TRIPPED, REMOTE RELAY IN   RCPDAT     34
CD                               PROGRESS                               RCPDAT     35
CD                           = 3 BOTH LOCAL AND REMOTE RELAY TRIPPED.   RCPDAT     36
CD                           = 4 BOTH LOCAL AND REMOTE RELAY            RCPDAT     37
CD                               TRIPPED,LOCAL LINE BRK RECLOSED.       RCPDAT     38
CD                                                                      RCPDAT     39
CD       IADATA(N+2)=IBUSR1  LEFT HAND SET BUS NO.                      RCPDAT     40
CD                                                                      RCPDAT     41
CD       IADATA(N+3)=JBUSR1  RIGHT HAND SIDE BUS NO.                    RCPDAT     42
CD                                                                      RCPDAT     43
CD       IADATA(N+4)=IPARR1  PARALLEL IDENTIFICATION FOR THE LINE       RCPDAT     44
CD                                                                      RCPDAT     45
CD       IADATA(N+5)=ICD2R1  TYPE OF RELAY MODEL                        RCPDAT     46
CD                           = 5  R1 MODEL                              RCPDAT     47
CD                           = 6  R2 MODEL                              RCPDAT     48
CD                           = 7  R3 MODEL                              RCPDAT     49
CD                                                                      RCPDAT     50
CD       IADATA(N+6)=ICD3R1  =1 USE SIGNAL TO TRIP THE LINE             RCPDAT     51
CD                           =2 DO NOT TRIP THE LINE, SIGNAL IS         RCPDAT     52
CD                              USED FOR REMOTE TRIPPING.               RCPDAT     53
CD                                                                      RCPDAT     54
CD       IADATA(N+7)=ICD4R1   NO. OF REMOTE RELAY ATTACHED TO THE LOCAL RCPDAT     55
CD                            RELAY                                     RCPDAT     56
CD                                                                      RCPDAT     57
CD       ADATA(N+8)=RBR1      R1 & R2 MODELS: RATE SETTLING (MW/SEC)    RCPDAT     58
CD                 =RMAXR1    R3 MODEL: UPPER RATE LIMIT       (MW/SEC) RCPDAT     59
CD                                                                      RCPDAT     60
CD       ADATA(N+9)=RMINR1    R1 & R2 MODELS: UPPER RATE LIMIT (MW/SEC) RCPDAT     61
CD                            LOWER = - UPPER                           RCPDAT     62
CD                            R3 MODEL: LOWER RATE LIMIT (MW/SEC)       RCPDAT     63
CD                                                                      RCPDAT     64
CD       ADATA(N+10)=RSR1     RATE SETTING (COMMON TO ALL MODELS)       RCPDAT     65
CD                            (MW/SEC)                                  RCPDAT     66
CD                                                                      RCPDAT     67
CD       ADATA(N+11)=BIASR1   FOR R1 & R2 MODELS: BAIS SETTING          RCPDAT     68
CD                            FOR R3 MODEL: LEAVE BLANK                 RCPDAT     69
CD                                                                      RCPDAT     70
CD       ADATA(N+12)=PSR1     POWER LEVEL SETTING (MW)                  RCPDAT     71
CD                                                                      RCPDAT     72
CD       ADATA(N+13)=TCR1     INTEGRATOR TIME CONSTANT (SEC)            RCPDAT     73
CD                                                                      RCPDAT     74
CD       ADATA(N+14)=TDR1     FOR R1 & R2 MODELS: BLOCK RATE TIME       RCPDAT     75
CD                            DELAY (CYCLES)                            RCPDAT     76
CD                  =TER1     FOR R3 MODEL: ENABLE HOLD TIME DELAY      RCPDAT     77
CD                            (CYCLES)                                  RCPDAT     78
CD                                                                      RCPDAT     79
CD       ADATA(N+15)=THR1     FOR R1 & R2 MODEL: BLANK                  RCPDAT     80
CD                            FOR R3 MODEL: AUX RELAY TIME DELAY        RCPDAT     81
CD                            (CYCLES)                                  RCPDAT     82
CD                                                                      RCPDAT     83
CD       ADATA(N+16)=T1R1     TIMER FOR LOCAL RELAY                     RCPDAT     84
CD                                                                      RCPDAT     85
CD       ADATA(N+17)=T2R1     TIMER FOR LOCAL RELAY                     RCPDAT     86
CD                                                                      RCPDAT     87
CD       IADATA(N+18)         REMOTE RELAY TRIP STATUS                  RCPDAT     88
CD                                                                      RCPDAT     89
CD       ADATA(N+19)=PIODR1   PAST VALUE OF TIE LINE POWER              RCPDAT     90
CD                                                                      RCPDAT     91
CD       ADATA(N+20)=PIIR1    PAST VALUE OF BLOCK 'A' OUTPUT            RCPDAT     92
CD                                                                      RCPDAT     93
CD       ADATA(N+21)=PIIIR1   PAST VALUE OF BLOCK 'B' OUTPUT            RCPDAT     94
CD                                                                      RCPDAT     95
CD       ADATA(N+22)=RIR1     OUTPUT OF THE RS BLOCK                    RCPDAT     96
CD                                                                      RCPDAT     97
CD       ADATA(N+23)=RIIR1    OUTPUT OF THE TC BLOCK FOR R1 & R2 MODELS RCPDAT     98
CD                  =QOLDR1   OUTPUT OF THE TC BLOCK FOR R3 MODEL       RCPDAT     99
CD                                                                      RCPDAT    100
CD       ADATA(N+24)=TRCLSE   TIME DELAY FOR RECLOSING                  RCPDAT    101
CD                                                                      RCPDAT    102
CD       ADATA(N+25)=RTIMER   TIMER FOR RECLOSING                       RCPDAT    103
CD                                                                      RCPDAT    104
CD                                                                      RCPDAT    105
CD                                                                      RCPDAT    106
CD    LINE PARAMETER IN PI-CIRCUIT FORM                                 RCPDAT    107
CD                                                                      RCPDAT    108
CD       ADATA(N+26)=GIJR1    GKM                                       RCPDAT    109
CD       ADATA(N+27)=BIJR1    BKM                                       RCPDAT    110
CD       ADATA(N+28)=GIOR1    GK1                                       RCPDAT    111
CD       ADATA(N+29)=BIOR1    BK1                                       RCPDAT    112
CD       ADATA(N+30)=GJOR1    GK2                                       RCPDAT    113
CD       ADATA(N+31)=BJOR1    BK2                                       RCPDAT    114
CD       IADATA(N+32)=NJSELI  FLAG FOR THE LINE TYPE                    RCPDAT    115
CD                                                                      RCPDAT    116
CD                                                                      RCPDAT    117
CD       ADATA(N+33)=TAR1     TIME CONSTANT FOR 'A' BLOCK               RCPDAT    118
CD       ADATA(N+34)=TBR1     TIME CONSTANT FOR 'B' BLOCK               RCPDAT    119
CD                                                                      RCPDAT    120
CD                                                                      RCPDAT    121
      INCLUDE 'PARX.INS'                                                RCPDAT    122
      INCLUDE 'CNPT.INS'                                                RCPDAT    123
      INCLUDE 'CNMNEW.INS'                                              RCPDAT    124
      INCLUDE 'CNAUTO.INS'                                              RCPDAT    125
      INCLUDE 'CNLFDA.INS'                                              RCPDAT    126
      INCLUDE 'CNB19.INS'                                               RCPDAT    127
      INCLUDE 'CNFLAG.INS'                                              RCPDAT    128
      INCLUDE 'CNPARX.INS'                                              RCPDAT    129
      INCLUDE 'CNREN.INS'                                               RCPDAT    130
      INCLUDE 'CNUNIT.INS'                                              RCPDAT    131
      INCLUDE 'CNMSG.INS'                                               RCPDAT    132
C                                                                       RCPDAT    133
      CHARACTER*80 CARD1,CARD                                           RCPDAT    134
      CHARACTER*12 BNAME1,BNAME2                                        RCPDAT    135
      CHARACTER*2 CID2                                                  RCPDAT    136
      CHARACTER*1 TFLAG,RTYPE,C,ONE,TWO,THREE,BLK                       RCPDAT    137
      CHARACTER*5 EDATA                                                 RCPDAT    138
      CHARACTER*3 ESC,MPI                                               RCPDAT    139
      DATA EDATA/'EDATA'/,C/'C'/,ONE/'1'/,                              RCPDAT    140
     &     TWO/'2'/,THREE/'3'/,BLK/' '/,ESC/'ESC'/,MPI/'MPI'/           RCPDAT    141
C                                                                       RCPDAT    142
      LDEB=.FALSE.                                                      RCPDAT    143
C                                                                       RCPDAT    144
C     READ SERIES CAPACITOR RELAY DATA CARDS                            RCPDAT    145
C                                                                       RCPDAT    146
  110 CONTINUE                                                          RCPDAT    147
      CALL GETLIN(IU54,CARD1)                                           RCPDAT    148
      IF(CARD1(1:5).NE.EDATA)THEN                                       RCPDAT    149
       IF(KLFO.EQ.0)THEN                                                RCPDAT    150
        READ (CARD1,2010) NLFI,NLFJ,CID2,TFLAG,RTYPE                    RCPDAT    151
           IF(NLFI.GT.N99999.OR.NLFJ.GT.N99999)THEN                     RCPDAT    152
            IEBK=1                                                      RCPDAT    153
            WRITE(MSG(1),2070) N99999                                   RCPDAT    154
            MSG(2)=CARD1                                                RCPDAT    155
            CALL PRTMSG(2)                                              RCPDAT    156
 112        CALL GETLIN(IU54,CARD)                                      RCPDAT    157
            IF(CARD(1:3).EQ.ESC)THEN                                    RCPDAT    158
             GOTO 110                                                   RCPDAT    159
            ELSE                                                        RCPDAT    160
             GOTO 112                                                   RCPDAT    161
            ENDIF                                                       RCPDAT    162
           ENDIF                                                        RCPDAT    163
           IF(MNEW(NLFI).EQ.0.OR.MNEW(NLFJ).EQ.0)THEN                   RCPDAT    164
            IEBK=1                                                      RCPDAT    165
            WRITE(MSG(1),2030)                                          RCPDAT    166
            MSG(2)=CARD1                                                RCPDAT    167
            CALL PRTMSG(2)                                              RCPDAT    168
 115        CALL GETLIN(IU54,CARD)                                      RCPDAT    169
            IF(CARD(1:3).EQ.ESC)THEN                                    RCPDAT    170
             GOTO 110                                                   RCPDAT    171
            ELSE                                                        RCPDAT    172
             GOTO 115                                                   RCPDAT    173
            ENDIF                                                       RCPDAT    174
           ENDIF                                                        RCPDAT    175
       ELSE                                                             RCPDAT    176
        READ (CARD1,2020) BNAME1,BNAME2,CID2,TFLAG,RTYPE                RCPDAT    177
        CALL CHKBUS(BNAME1,NLFI)                                        RCPDAT    178
        CALL CHKBUS(BNAME2,NLFJ)                                        RCPDAT    179
           IF(NLFI.EQ.0.OR.NLFJ.EQ.0)THEN                               RCPDAT    180
            IEBK=1                                                      RCPDAT    181
            WRITE(MSG(1),2030)                                          RCPDAT    182
            MSG(2)=CARD1                                                RCPDAT    183
            CALL PRTMSG(2)                                              RCPDAT    184
 125        CALL GETLIN(IU54,CARD)                                      RCPDAT    185
            IF(CARD(1:3).EQ.ESC)THEN                                    RCPDAT    186
             GOTO 110                                                   RCPDAT    187
            ELSE                                                        RCPDAT    188
             GOTO 125                                                   RCPDAT    189
            ENDIF                                                       RCPDAT    190
           ENDIF                                                        RCPDAT    191
      ENDIF                                                             RCPDAT    192
C                                                                       RCPDAT    193
C     STORE THE DATA INTO THE PERMANENT ARRAY                           RCPDAT    194
C                                                                       RCPDAT    195
      IF(NAUT.LT.MAXSET)THEN                                            RCPDAT    196
C                                                                       RCPDAT    197
       NAUT=NAUT+1                                                      RCPDAT    198
C                                                                       RCPDAT    199
       NAUTB=NAUTB+2                                                    RCPDAT    200
       LDSTAT=0                                                         RCPDAT    201
       NPROG=MNEW(NLFI)                                                 RCPDAT    202
       IF(JBSTAT(NPROG).GT.2)LDSTAT=10                                  RCPDAT    203
       IF(LDSTAT.EQ.0)THEN                                              RCPDAT    204
       NPROG=MNEW(NLFJ)                                                 RCPDAT    205
       IF(JBSTAT(NPROG).GT.2)LDSTAT=10                                  RCPDAT    206
       ENDIF                                                            RCPDAT    207
       NAUBUS(NAUTB-1)=NLFI                                             RCPDAT    208
       NAUBUS(NAUTB)=NLFJ                                               RCPDAT    209
       LRTEMP=LRTEMP+1                                                  RCPDAT    210
       IDATPT(LRTEMP)=JLNA                                              RCPDAT    211
C                                                                       RCPDAT    212
       IADATA(JLNA+1)=LDSTAT                                            RCPDAT    213
       IADATA(JLNA+2)=NLFI                                              RCPDAT    214
       IADATA(JLNA+3)=NLFJ                                              RCPDAT    215
       CALL PACK(CID2,0,ITFK)                                           RCPDAT    216
       IADATA(JLNA+4)=ITFK                                              RCPDAT    217
       IF(RTYPE.EQ.BLK)THEN                                             RCPDAT    218
        IEBK=1                                                          RCPDAT    219
        WRITE(MSG(1),2060)                                              RCPDAT    220
        CALL PRTMSG(1)                                                  RCPDAT    221
       ELSE                                                             RCPDAT    222
        IF(RTYPE.EQ.ONE)IADATA(JLNA+5)=5                                RCPDAT    223
        IF(RTYPE.EQ.TWO)IADATA(JLNA+5)=6                                RCPDAT    224
        IF(RTYPE.EQ.THREE)IADATA(JLNA+5)=7                              RCPDAT    225
       ENDIF                                                            RCPDAT    226
       IADATA(JLNA+6)=1                                                 RCPDAT    227
       IF(TFLAG.EQ.C)IADATA(JLNA+6)=2                                   RCPDAT    228
C                                                                       RCPDAT    229
       CALL GETLIN(IU54,CARD)                                           RCPDAT    230
       READ(CARD,2050) ADATA(JLNA+8),ADATA(JLNA+9),ADATA(JLNA+10)       RCPDAT    231
     & ,ADATA(JLNA+11),ADATA(JLNA+12),ADATA(JLNA+13)                    RCPDAT    232
C                                                                       RCPDAT    233
       CALL GETLIN(IU54,CARD)                                           RCPDAT    234
       READ(CARD,2050) ADATA(JLNA+14),ADATA(JLNA+15),ADATA(JLNA+24)     RCPDAT    235
       JSWITC=JLNA+7                                                    RCPDAT    236
       JLNA=JLNA+32                                                     RCPDAT    237
       KSWITC=0                                                         RCPDAT    238
C                                                                       RCPDAT    239
C    READ IN THE REMOTE RELAYS                                          RCPDAT    240
C                                                                       RCPDAT    241
 150  CALL GETLIN(IU54,CARD)                                            RCPDAT    242
      IF(CARD(1:3).EQ.ESC)THEN                                          RCPDAT    243
       IADATA(JSWITC)=KSWITC                                            RCPDAT    244
      ELSE                                                              RCPDAT    245
       IF(CARD(1:3).EQ.MPI)THEN                                         RCPDAT    246
        CALL GETLIN(IU54,CARD1)                                         RCPDAT    247
       ENDIF                                                            RCPDAT    248
       CALL SWIDAT(CARD,CARD1,KSWITC,IEBK)                              RCPDAT    249
       GOTO 150                                                         RCPDAT    250
      ENDIF                                                             RCPDAT    251
C                                                                       RCPDAT    252
      GOTO 110                                                          RCPDAT    253
C                                                                       RCPDAT    254
C                                                                       RCPDAT    255
      ELSE                                                              RCPDAT    256
      WRITE(MSG(1),2040) MXASCH                                         RCPDAT    257
      MSG(2)=CARD1                                                      RCPDAT    258
      CALL PRTMSG(2)                                                    RCPDAT    259
 135       CALL GETLIN(IU54,CARD)                                       RCPDAT    260
           IF(CARD(1:3).EQ.ESC)THEN                                     RCPDAT    261
            GOTO 110                                                    RCPDAT    262
           ELSE                                                         RCPDAT    263
            GOTO 135                                                    RCPDAT    264
           ENDIF                                                        RCPDAT    265
      ENDIF                                                             RCPDAT    266
      ENDIF                                                             RCPDAT    267
C                                                                       RCPDAT    268
      IF(LRTEMP.NE.LRCPRA)THEN                                          RCPDAT    269
      LRCPRA=LRCPRA+1                                                   RCPDAT    270
      NRCPRA=LRTEMP                                                     RCPDAT    271
      ELSE                                                              RCPDAT    272
      LRCPRA=0                                                          RCPDAT    273
      NRCPRA=0                                                          RCPDAT    274
      ENDIF                                                             RCPDAT    275
C                                                                       RCPDAT    276
C                                                                       RCPDAT    277
 2020 FORMAT(2A12,A2,3X,A1,1X,A1)                                       RCPDAT    278
 2010 FORMAT(2I5,A2,3X,A1,1X,A1)                                        RCPDAT    279
 2030 FORMAT(' *** ERROR RATE OF CHANGE OF POWER RELAY BUS NOT FOUND')  RCPDAT    280
 2040 FORMAT(' *** ERROR RELAY SCHEME EXCEEDS THE LIMIT OF ',I3)        RCPDAT    281
 2050 FORMAT(8F10.5)                                                    RCPDAT    282
 2060 FORMAT(' *** ERROR MODEL FOR THE RATE OF CHANGE OF POWER RELAY ', RCPDAT    283
     &'IS NOT SPECIFIED')                                               RCPDAT    284
 2070 FORMAT(' *** ERROR POWER RELAY BUS NUMBER EXCEEDED ',I5)          RCPDAT    285
C                                                                       RCPDAT    286
      END                                                               RCPDAT    287
