CFPRIME UFLDAT                                                          UFLDAT      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 UFLDAT(IEBK)                                           UFLDAT      3
CD                                                                      UFLDAT      4
CD    TO READ UNDER FREQUENCY LOAD SHEDDING RELAY (CF-1).               UFLDAT      5
CD                                                                      UFLDAT      6
CD                                                                      UFLDAT      7
CD     LUFREQ           Starting position of IDATPT array  of CF-1      UFLDAT      8
CD                      relay scheme. LUFREQ is in the common labelled  UFLDAT      9
CD                      PT of include file CNPT.                        UFLDAT     10
CD                                                                      UFLDAT     11
CD     NUFREQ           Finishing position of IDATPT array of CF-1      UFLDAT     12
CD                      relay scheme. NUFREQ is in common labelled AUTO UFLDAT     13
CD                      of include file CNAUTO.                         UFLDAT     14
CD                                                                      UFLDAT     15
CD     let k = k-th UFLS RELAY                                          UFLDAT     16
CD                                                                      UFLDAT     17
CD     N = IDATPT(k)    IDATPT is the array that stores the start       UFLDAT     18
CD                      position of the K-TH UFLS relay scheme data     UFLDAT     19
CD                                                                      UFLDAT     20
CD IADATA(N+1)=IRSBNO   BUS NUMBER                                      UFLDAT     21
CD                                                                      UFLDAT     22
CD IADATA(N+2)=IFLAG    = 0 : SIGNAL CONTROLS BOTH LOCAL AND REMOTE     UFLDAT     23
CD                      = 1 : CONTROLS REMOTE ONLY                      UFLDAT     24
CD                                                                      UFLDAT     25
CD IADATA(N+3)=IRSTCD   TRIP CODE 1= NOT TRIPPED, 2= TRIPPED            UFLDAT     26
CD                                                                      UFLDAT     27
CD IADATA(N+4)=IDRRR    NO OF REMOTE RELAYS                             UFLDAT     28
CD                                                                      UFLDAT     29
CD IADATA(N+5)          REMOTE RELAY TRIP FLAG                          UFLDAT     30
CD                                                                      UFLDAT     31
CD ADATA(N+6)=RSVINT    MAGNITUDE OF INITIAL BUS VOLTAGE                UFLDAT     32
CD                                                                      UFLDAT     33
CD ADATA(N+7)=RSBTMR    BREAKER TIMER                                   UFLDAT     34
CD                                                                      UFLDAT     35
CD ADATA(N+8)=RSEYRO    REAL COMPONENT OF PRESENT BUS VOLTAGE           UFLDAT     36
CD                                                                      UFLDAT     37
CD ADATA(N+9)=RSEYIO    IMAGINARY COMPONENT OF PRESENT BUS VOLTAGE      UFLDAT     38
CD                                                                      UFLDAT     39
CD ADATA(N+10)=RSFEQO   PRESENT BUS FREQUENCY                           UFLDAT     40
CD                                                                      UFLDAT     41
CD ADATA(N+11)=RSCKR    INTEGRATOR GAIN--K                              UFLDAT     42
CD                                                                      UFLDAT     43
CD ADATA(N+12)=RSX1O    PAST VALUE OF STATE VARIABLE X1 INTEGRATOR      UFLDAT     44
CD                      INPUT                                           UFLDAT     45
CD                                                                      UFLDAT     46
CD ADATA(N+13)=RSX2O    PAST VALUE OF STATE VARIABLE X2 INTEGRATOR      UFLDAT     47
CD                      OUTPUT                                          UFLDAT     48
CD                                                                      UFLDAT     49
CD ADATA(N+14)=RSX1N    PRESENT VALUE OF X1                             UFLDAT     50
CD                                                                      UFLDAT     51
CD ADATA(N+15)=RSX2N    PRESENT VALUE OF X2                             UFLDAT     52
CD                                                                      UFLDAT     53
CD ADATA(N+16)=RSFEQ1   TRIPPING FREQUENCY (SPECIFIED IN CYCLES, STORED UFLDAT     54
CD                      IN RADIANS/SEC INTERNALLY)                      UFLDAT     55
CD                                                                      UFLDAT     56
CD ADATA(N+17)=RSTLEV   TIME LEVER                                      UFLDAT     57
CD                                                                      UFLDAT     58
CD ADATA(N+18)=RSBDLY   BREAKER TIME DELAY (SPECIFIED IN CYCLES, STORED UFLDAT     59
CD                      IN RADIANS/SEC INTERNALLY)                      UFLDAT     60
CD                                                                      UFLDAT     61
CD ADATA(N+19)=RSLDRP   PER CENT REAL POWER DROP FOR CONSTANT IMPEDANCE UFLDAT     62
CD                      LOAD                                            UFLDAT     63
CD                                                                      UFLDAT     64
CD ADATA(N+20)=RSLDRP   PER CENT REACTIVE POWER DROP FOR CONSTANT       UFLDAT     65
CD                      IMPEDANCE LOAD                                  UFLDAT     66
CD                                                                      UFLDAT     67
CD ADATA(N+21)=RSLDRP   PER CENT REAL POWER DROP FOR CONSTANT CURRENT   UFLDAT     68
CD                      LOAD                                            UFLDAT     69
CD                                                                      UFLDAT     70
CD ADATA(N+22)=RSLDRP   PER CENT REACTIVE POWER DROP FOR CONSTANT       UFLDAT     71
CD                      CURRENT LOAD                                    UFLDAT     72
CD                                                                      UFLDAT     73
CD ADATA(N+23)=RSLDRP   PER CENT REAL POWER DROP FOR CONSTANT MVA LOAD  UFLDAT     74
CD                                                                      UFLDAT     75
CD ADATA(N+24)=RSLDRP   PER CENT REACTIVE POWER DROP FOR CONSTANT MVA   UFLDAT     76
CD                      LOAD                                            UFLDAT     77
CD                                                                      UFLDAT     78
CD ADATA(N+25)=RSLDRP   PER CENT REAL POWER DROP FOR CONSTANT MVA WITH  UFLDAT     79
CD                      FREQUENCY DEPENDENCE                            UFLDAT     80
CD                                                                      UFLDAT     81
CD ADATA(N+26)=RSLDRP   PER CENT REACTIVE POWER DROP FOR CONSTANT MVA   UFLDAT     82
CD                      WITH FREQUENCY DEPPENDCE                        UFLDAT     83
CD                                                                      UFLDAT     84
C                                                                       UFLDAT     85
C                                                                       UFLDAT     86
      INCLUDE 'PARX.INS'                                                UFLDAT     87
      INCLUDE 'CNPT.INS'                                                UFLDAT     88
      INCLUDE 'CNMNEW.INS'                                              UFLDAT     89
      INCLUDE 'CNAUTO.INS'                                              UFLDAT     90
      INCLUDE 'CNLFDA.INS'                                              UFLDAT     91
      INCLUDE 'CNB19.INS'                                               UFLDAT     92
      INCLUDE 'CNFLAG.INS'                                              UFLDAT     93
      INCLUDE 'CNPARX.INS'                                              UFLDAT     94
      INCLUDE 'CNREN.INS'                                               UFLDAT     95
      INCLUDE 'CNUNIT.INS'                                              UFLDAT     96
      INCLUDE 'CNMSG.INS'                                               UFLDAT     97
C                                                                       UFLDAT     98
      CHARACTER*80 CARD,CARD3                                           UFLDAT     99
      CHARACTER*3 ESC,MPI                                               UFLDAT    100
      CHARACTER*12 BUSNAM                                               UFLDAT    101
      CHARACTER*5 EDATA                                                 UFLDAT    102
      DATA EDATA/'EDATA'/,ESC/'ESC'/,MPI/'MPI'/                         UFLDAT    103
C                                                                       UFLDAT    104
      LDEB=(JDEB(13).NE.0)                                              UFLDAT    105
C                                                                       UFLDAT    106
      LUFREQ=LRTEMP                                                     UFLDAT    107
C                                                                       UFLDAT    108
C  READING UNDERFREQUENCY CF-1 LOAD SHEDDING RELAY DATA                 UFLDAT    109
C                                                                       UFLDAT    110
  110 CONTINUE                                                          UFLDAT    111
      CALL GETLIN(IU54,CARD)                                            UFLDAT    112
      IF(CARD(1:5).NE.EDATA)THEN                                        UFLDAT    113
      IF(KLFO.EQ.0)THEN                                                 UFLDAT    114
        READ (CARD,3000) NLF,IFLAG                                      UFLDAT    115
           IF(MNEW(NLF).EQ.0)THEN                                       UFLDAT    116
            IEBK=1                                                      UFLDAT    117
            WRITE(MSG(1),3010)                                          UFLDAT    118
            MSG(2)=CARD                                                 UFLDAT    119
            CALL PRTMSG(2)                                              UFLDAT    120
  115       CALL GETLIN(IU54,CARD)                                      UFLDAT    121
            IF(CARD(1:3).EQ.ESC)THEN                                    UFLDAT    122
             GOTO 110                                                   UFLDAT    123
            ELSE                                                        UFLDAT    124
             GOTO 115                                                   UFLDAT    125
            ENDIF                                                       UFLDAT    126
           ENDIF                                                        UFLDAT    127
      ELSE                                                              UFLDAT    128
       READ (CARD,3040) BUSNAM,IFLAG                                    UFLDAT    129
       CALL CHKBUS(BUSNAM,NLF)                                          UFLDAT    130
           IF(NLF.EQ.0)THEN                                             UFLDAT    131
            IEBK=1                                                      UFLDAT    132
            WRITE(MSG(1),3010)                                          UFLDAT    133
            MSG(2)=CARD                                                 UFLDAT    134
            CALL PRTMSG(2)                                              UFLDAT    135
  125       CALL GETLIN(IU54,CARD)                                      UFLDAT    136
            IF(CARD(1:3).EQ.ESC)THEN                                    UFLDAT    137
             GOTO 110                                                   UFLDAT    138
            ELSE                                                        UFLDAT    139
             GOTO 125                                                   UFLDAT    140
            ENDIF                                                       UFLDAT    141
           ENDIF                                                        UFLDAT    142
      ENDIF                                                             UFLDAT    143
C                                                                       UFLDAT    144
C     STORE THE DATA INTO THE PERMANENT ARRAY                           UFLDAT    145
C                                                                       UFLDAT    146
      IF(NAUT.LT.MAXSET)THEN                                            UFLDAT    147
C                                                                       UFLDAT    148
       NAUT=NAUT+1                                                      UFLDAT    149
C                                                                       UFLDAT    150
       NAUTB=NAUTB+1                                                    UFLDAT    151
       NAUBUS(NAUTB)=NLF                                                UFLDAT    152
       LRTEMP=LRTEMP+1                                                  UFLDAT    153
       IDATPT(LRTEMP)=JLNA                                              UFLDAT    154
       JLNA=JLNA+26                                                     UFLDAT    155
       LDSTAT=0                                                         UFLDAT    156
       NPROG=MNEW(NLF)                                                  UFLDAT    157
       IF(JBSTAT(NPROG).GT.2)LDSTAT=10                                  UFLDAT    158
       IADATA(JLNA-23)=LDSTAT                                           UFLDAT    159
       JSWITC=JLNA-22                                                   UFLDAT    160
       IADATA(JLNA-25)=NLF                                              UFLDAT    161
       IADATA(JLNA-24)=IFLAG                                            UFLDAT    162
       CALL GETLIN(IU54,CARD)                                           UFLDAT    163
       READ(CARD,3050) ADATA(JLNA-10),ADATA(JLNA-9),ADATA(JLNA-8)       UFLDAT    164
       CALL GETLIN(IU54,CARD)                                           UFLDAT    165
       READ(CARD,3050) (ADATA(JLNA-LL),LL=7,1,-1),ADATA(JLNA)           UFLDAT    166
C                                                                       UFLDAT    167
C   READ IN THE REMOTE RELAY IF ANY                                     UFLDAT    168
C                                                                       UFLDAT    169
 150   CALL GETLIN(IU54,CARD)                                           UFLDAT    170
       IF(CARD(1:3).EQ.ESC) GOTO 110                                    UFLDAT    171
       IF(CARD(1:3).EQ.MPI) CALL GETLIN(IU54,CARD3)                     UFLDAT    172
       CALL SWIDAT(CARD,CARD3,KSWITC,IEBK)                              UFLDAT    173
       IADATA(JSWITC)=KSWITC                                            UFLDAT    174
       GOTO 150                                                         UFLDAT    175
C                                                                       UFLDAT    176
      ELSE                                                              UFLDAT    177
            WRITE(MSG(1),3020) NAUT                                     UFLDAT    178
            MSG(2)=CARD                                                 UFLDAT    179
            CALL PRTMSG(2)                                              UFLDAT    180
       IEBK=1                                                           UFLDAT    181
  135  CALL GETLIN(IU54,CARD)                                           UFLDAT    182
        IF(CARD(1:3).EQ.ESC)THEN                                        UFLDAT    183
         GOTO 110                                                       UFLDAT    184
        ELSE                                                            UFLDAT    185
         GOTO 135                                                       UFLDAT    186
        ENDIF                                                           UFLDAT    187
       ENDIF                                                            UFLDAT    188
      ENDIF                                                             UFLDAT    189
C                                                                       UFLDAT    190
      IF(LRTEMP.NE.LUFREQ)THEN                                          UFLDAT    191
      LUFREQ=LUFREQ+1                                                   UFLDAT    192
      NUFREQ=LRTEMP                                                     UFLDAT    193
      ELSE                                                              UFLDAT    194
      LUFREQ=0                                                          UFLDAT    195
      NUFREQ=0                                                          UFLDAT    196
      ENDIF                                                             UFLDAT    197
C                                                                       UFLDAT    198
      IF(IEBK.EQ.0)RETURN                                               UFLDAT    199
C                                                                       UFLDAT    200
      CARD='UFLDAT: CF-1 LOAD SHEDDING RELAY DATA ERROR'                UFLDAT    201
      CALL ASTOP(CARD,43)                                               UFLDAT    202
C                                                                       UFLDAT    203
 3000 FORMAT(2I5)                                                       UFLDAT    204
 3010 FORMAT(' *** WARNING')                                            UFLDAT    205
 3020 FORMAT(' *** ERROR NO. OF RELAY SCHEME EXCEEDS ',I5)              UFLDAT    206
 3040 FORMAT(A12,I5)                                                    UFLDAT    207
 3050 FORMAT(8F10.5)                                                    UFLDAT    208
      END                                                               UFLDAT    209
