CFPRIME FLTDAT                                                          FLTDAT      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 FLTDAT(IEBK)                                           FLTDAT      3
CD                                                                      FLTDAT      4
CD    THIS SUBROUTINE READS THE UNDER FREQUENCY LINE TRIPPING RELAY     FLTDAT      5
CD    DATA CARD.                                                        FLTDAT      6
CD                                                                      FLTDAT      7
CD                                                                      FLTDAT      8
CD     LUFLTR          Starting position of IDATPT array  of UFLT       FLTDAT      9
CD                     relay scheme, LUFLTR is in the common labelled   FLTDAT     10
CD                     PT of include file CNPT.                         FLTDAT     11
CD                                                                      FLTDAT     12
CD     NUFLTR          Finishing position of IDATPT array of UFLT       FLTDAT     13
CD                     relay scheme, NUFLTR is in common labelled AUTO  FLTDAT     14
CD                     of include file CNAUTO.                          FLTDAT     15
CD                                                                      FLTDAT     16
CD     let k = k-th UFLT RELAY                                          FLTDAT     17
CD                                                                      FLTDAT     18
CD     N = IDATPT(k)    IDATPT is the array that stores the start       FLTDAT     19
CD                      position of the K-TH UFLT relay scheme data     FLTDAT     20
CD                                                                      FLTDAT     21
CD                                                                      FLTDAT     22
CD  IADATA(K+1)=ICD1RU  LOCAL RELAY TRIP STATUS                         FLTDAT     23
CD                      = 1 RELAY NOT TRIPPED                           FLTDAT     24
CD                      = 2 RELAY TRIPPED BREAKER STILL CLOSED          FLTDAT     25
CD                      = 3 RELAY TRIPPED BREAKER TRIPPED,REMOTE        FLTDAT     26
CD                          TRIPPING AND RECLOSING TIMER STARTED        FLTDAT     27
CD                      = 4 LOCAL AND REMOTE TRIPPING COMPLETED,        FLTDAT     28
CD                          LOCAL LINE NOT RECLOSED YET.                FLTDAT     29
CD                      = 5 ALL TRIP AND RECLOSING ACTIVITIES COMPLETED FLTDAT     30
CD                                                                      FLTDAT     31
CD  IADATA(K+2)=IBUSRU  LEFT HAND SIDE BUS NUMBER                       FLTDAT     32
CD                                                                      FLTDAT     33
CD  IADATA(K+3)=JBUSRU  RIGHT HAND SIDE BUS NUMBER                      FLTDAT     34
CD                                                                      FLTDAT     35
CD  IADATA(K+4)=IPARRU  PARALLEL IDENTIFICATION FOR THE LINE            FLTDAT     36
CD                                                                      FLTDAT     37
CD  IADATA(K+5)=ICD3RU  =1 USE SIGNAL TO TRIP THE LINE                  FLTDAT     38
CD                      =C OR 2 DO NOT TRIP THE LINE ;                  FLTDAT     39
CD                         SIGNAL IS USED FOR REMOTE TRIPPING           FLTDAT     40
CD                                                                      FLTDAT     41
CD  IADATA(K+6)=ICD4RU  NUMBER OF REMOTE RELAY ATTACHED TO THE LOCAL    FLTDAT     42
CD                      RELAY                                           FLTDAT     43
CD                                                                      FLTDAT     44
CD  IADATA(K+7)=NJSELI  FLAG FOR LINE MODEL                             FLTDAT     45
CD                                                                      FLTDAT     46
CD  ADATA(K+8)=FTRPRU   THRESHOLD VALUE OF THE BUS FREQUENCY IN HZ.     FLTDAT     47
CD                                                                      FLTDAT     48
CD  ADATA(K+9)=TRLYRU   REQUIRED DURATION FOR BUS FREQUENCY TO REMAIN   FLTDAT     49
CD                      BELOW THRESHOLD VALUE OF A TRIP (IN CYCLES)     FLTDAT     50
CD                                                                      FLTDAT     51
CD  ADATA(K+10)=TIMERU  UNDER FREQUENCY RELAY TIMER                     FLTDAT     52
CD                                                                      FLTDAT     53
CD  ADATA(K+11)=TRPCRU  TIME DELAY FOR COMMUNICATION AND BREAKER        FLTDAT     54
CD                                                                      FLTDAT     55
CD  ADATA(K+12)=TRIPRU  REMOTE RELAY TRIP STATUS                        FLTDAT     56
CD                                                                      FLTDAT     57
CD  ADATA(K+13)=TRCLSE  TIME DELAY FOR RECLOSING                        FLTDAT     58
CD                                                                      FLTDAT     59
CD  ADATA(K+14)=RTIMER  TIMER FOR RECLOSING                             FLTDAT     60
CD                                                                      FLTDAT     61
CD  ADATA(K+15)=WNOWRU  BUS FREQUENCY DEVIATION                         FLTDAT     62
CD                      NOTE: BUS FREQUENCY IS CALCULATED USING THE     FLTDAT     63
CD                            LEFT HAND SIDE BUS INFORMATION.           FLTDAT     64
CD                                                                      FLTDAT     65
CD  ADATA(K+16)=EIRU    REAL PART OF THE BUS VOLTAGE AT THE PREVIOUS    FLTDAT     66
CD                      TIME STEP                                       FLTDAT     67
CD                                                                      FLTDAT     68
CD  ADATA(K+17)=FIRU    IMAGINARY PART OF THE BUS VOLTAGE AT THE        FLTDAT     69
CD                      PREVIOUS TIME STEP                              FLTDAT     70
CD                                                                      FLTDAT     71
CD                                                                      FLTDAT     72
      INCLUDE 'PARX.INS'                                                FLTDAT     73
      INCLUDE 'CNPT.INS'                                                FLTDAT     74
      INCLUDE 'CNMNEW.INS'                                              FLTDAT     75
      INCLUDE 'CNAUTO.INS'                                              FLTDAT     76
      INCLUDE 'CNFLAG.INS'                                              FLTDAT     77
      INCLUDE 'CNPARX.INS'                                              FLTDAT     78
      INCLUDE 'CNREN.INS'                                               FLTDAT     79
      INCLUDE 'CNUNIT.INS'                                              FLTDAT     80
      INCLUDE 'CNMSG.INS'                                               FLTDAT     81
C                                                                       FLTDAT     82
      CHARACTER*80 CARD1,CARD                                           FLTDAT     83
      CHARACTER*12 BNAME1,BNAME2                                        FLTDAT     84
      CHARACTER*2 CID2                                                  FLTDAT     85
      CHARACTER*1 TFLAG,C                                               FLTDAT     86
      INTEGER*4 ICID                                                    FLTDAT     87
      CHARACTER*5 EDATA                                                 FLTDAT     88
      CHARACTER*3 ESC,MPI                                               FLTDAT     89
      DATA EDATA/'EDATA'/,C/'C'/,ESC/'ESC'/,MPI/'MPI'/                  FLTDAT     90
C                                                                       FLTDAT     91
C     READ UNDER FREQUENCY RELAY DATA CARDS                             FLTDAT     92
C                                                                       FLTDAT     93
      LDEB=(JDEB(17).NE.0)                                              FLTDAT     94
C                                                                       FLTDAT     95
  110 CONTINUE                                                          FLTDAT     96
      CALL GETLIN(IU54,CARD1)                                           FLTDAT     97
      IF(CARD1(1:5).EQ.EDATA)THEN                                       FLTDAT     98
         IF(LRTEMP.NE.LUFLTR)THEN                                       FLTDAT     99
            LUFLTR=LUFLTR+1                                             FLTDAT    100
            NUFLTR=LRTEMP                                               FLTDAT    101
         ELSE                                                           FLTDAT    102
            LUFLTR=0                                                    FLTDAT    103
            NUFLTR=0                                                    FLTDAT    104
         ENDIF                                                          FLTDAT    105
         IF(IEBK.EQ.0) RETURN                                           FLTDAT    106
         CALL ASTOP(MSG(1),0)                                           FLTDAT    107
      ENDIF                                                             FLTDAT    108
C                                                                       FLTDAT    109
      IF(KLFO.EQ.0)THEN                                                 FLTDAT    110
         READ (CARD1,2010) NLFI,NLFJ,CID2,TFLAG                         FLTDAT    111
      ELSE                                                              FLTDAT    112
         READ (CARD1,2020) BNAME1,BNAME2,CID2,TFLAG                     FLTDAT    113
         CALL CHKBUS(BNAME1,NLFI)                                       FLTDAT    114
         CALL CHKBUS(BNAME2,NLFJ)                                       FLTDAT    115
      ENDIF                                                             FLTDAT    116
      IF(NLFI.EQ.0.OR.NLFJ.EQ.0.OR.                                     FLTDAT    117
     *   MNEW(NLFI).EQ.0.OR.MNEW(NLFJ).EQ.0)THEN                        FLTDAT    118
         WRITE(MSG(1),2030)                                             FLTDAT    119
         GOTO 135                                                       FLTDAT    120
      ENDIF                                                             FLTDAT    121
C                                                                       FLTDAT    122
C     STORE THE DATA INTO THE PERMANENT ARRAY                           FLTDAT    123
C                                                                       FLTDAT    124
      IF(NAUT.GE.MAXSET)THEN                                            FLTDAT    125
         WRITE(MSG(1),2040) MXASCH                                      FLTDAT    126
         GOTO 135                                                       FLTDAT    127
      ENDIF                                                             FLTDAT    128
C                                                                       FLTDAT    129
      LDSTAT=0                                                          FLTDAT    130
      NPROG=MNEW(NLFI)                                                  FLTDAT    131
      IF(JBSTAT(NPROG).GT.2)LDSTAT=10                                   FLTDAT    132
      IF(LDSTAT.EQ.0)THEN                                               FLTDAT    133
      NPROG=MNEW(NLFJ)                                                  FLTDAT    134
      IF(JBSTAT(NPROG).GT.2)LDSTAT=10                                   FLTDAT    135
      ENDIF                                                             FLTDAT    136
      NAUT=NAUT+1                                                       FLTDAT    137
      NAUTB=NAUTB+2                                                     FLTDAT    138
      NAUBUS(NAUTB-1)=NLFI                                              FLTDAT    139
      NAUBUS(NAUTB)=NLFJ                                                FLTDAT    140
      LRTEMP=LRTEMP+1                                                   FLTDAT    141
      IDATPT(LRTEMP)=JLNA                                               FLTDAT    142
C                                                                       FLTDAT    143
      IADATA(JLNA+1)=LDSTAT                                             FLTDAT    144
      IADATA(JLNA+2)=NLFI                                               FLTDAT    145
      IADATA(JLNA+3)=NLFJ                                               FLTDAT    146
      CALL PACK(CID2,0,ICID)                                            FLTDAT    147
      IADATA(JLNA+4)=ICID                                               FLTDAT    148
      IADATA(JLNA+5)=1                                                  FLTDAT    149
      IF(TFLAG.EQ.C)IADATA(JLNA+5)=2                                    FLTDAT    150
C                                                                       FLTDAT    151
      CALL GETLIN(IU54,CARD)                                            FLTDAT    152
      READ(CARD,2050) ADATA(JLNA+8),ADATA(JLNA+9),ADATA(JLNA+11)        FLTDAT    153
     &               ,ADATA(JLNA+13)                                    FLTDAT    154
      JSWITC=JLNA+6                                                     FLTDAT    155
      JLNA=JLNA+17                                                      FLTDAT    156
      KSWITC=0                                                          FLTDAT    157
C                                                                       FLTDAT    158
C    READ IN THE REMOTE RELAYS                                          FLTDAT    159
C                                                                       FLTDAT    160
 150  CALL GETLIN(IU54,CARD)                                            FLTDAT    161
      IF(CARD(1:3).EQ.ESC)THEN                                          FLTDAT    162
         IADATA(JSWITC)=KSWITC                                          FLTDAT    163
      ELSE                                                              FLTDAT    164
         IF(CARD(1:3).EQ.MPI) CALL GETLIN(IU54,CARD1)                   FLTDAT    165
         CALL SWIDAT(CARD,CARD1,KSWITC,IEBK)                            FLTDAT    166
         GOTO 150                                                       FLTDAT    167
      ENDIF                                                             FLTDAT    168
      GOTO 110                                                          FLTDAT    169
C                                                                       FLTDAT    170
  135 IEBK=1                                                            FLTDAT    171
      MSG(2)=CARD1                                                      FLTDAT    172
      CALL PRTMSG(2)                                                    FLTDAT    173
  115 CALL GETLIN(IU54,CARD)                                            FLTDAT    174
      IF(CARD(1:3).EQ.ESC) GOTO 110                                     FLTDAT    175
      GOTO 115                                                          FLTDAT    176
C                                                                       FLTDAT    177
 2020 FORMAT(2A12,A2,3X,A1)                                             FLTDAT    178
 2010 FORMAT(2I5,A2,3X,A1)                                              FLTDAT    179
 2030 FORMAT(1X                                                         FLTDAT    180
     *,'*** ERROR UNDER FREQUENCY LINE TRIPPING RELAY BUS NOT FOUND')   FLTDAT    181
 2040 FORMAT(' *** ERROR RELAY SCHEME EXCEEDS THE LIMIT OF',I4)         FLTDAT    182
 2050 FORMAT(6F10.5)                                                    FLTDAT    183
C                                                                       FLTDAT    184
      END                                                               FLTDAT    185
