CFPRIME UFLINT                                                          UFLINT      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 UFLINT(IEBK)                                           UFLINT      3
CD                                                                      UFLINT      4
CD    TO INITIALIZE THE CF-1 RELAYS.                                    UFLINT      5
CD                                                                      UFLINT      6
CD                                                                      UFLINT      7
CD     LUFREQ           Starting position of IDATPT array  of CF-1      UFLINT      8
CD                      relay scheme. LUFREQ is in the common labelled  UFLINT      9
CD                      PT of include file CNPT.                        UFLINT     10
CD                                                                      UFLINT     11
CD     NUFREQ           Finishing position of IDATPT array of CF-1      UFLINT     12
CD                      relay scheme. NUFREQ is in common labelled AUTO UFLINT     13
CD                      of include file CNAUTO.                         UFLINT     14
CD                                                                      UFLINT     15
CD     let k = k-th UFLS RELAY                                          UFLINT     16
CD                                                                      UFLINT     17
CD     N = IDATPT(k)    IDATPT is the array that stores the start       UFLINT     18
CD                      position of the K-TH UFLS relay scheme data     UFLINT     19
CD                                                                      UFLINT     20
CD IADATA(N+1)=IRSBNO   BUS NUMBER                                      UFLINT     21
CD                                                                      UFLINT     22
CD IADATA(N+2)=IFLAG    = 0 : SIGNAL CONTROLS BOTH LOCAL AND REMOTE     UFLINT     23
CD                      = 1 : CONTROLS REMOTE ONLY                      UFLINT     24
CD                                                                      UFLINT     25
CD IADATA(N+3)=IRSTCD   TRIP CODE 1= NOT TRIPPED, 2= TRIPPED            UFLINT     26
CD                                                                      UFLINT     27
CD IADATA(N+4)=IDRRR    NO OF REMOTE RELAYS                             UFLINT     28
CD                                                                      UFLINT     29
CD IADATA(N+5)          REMOTE RELAY TRIP FLAG                          UFLINT     30
CD                                                                      UFLINT     31
CD ADATA(N+6)=RSVINT    MAGNITUDE OF INITIAL BUS VOLTAGE                UFLINT     32
CD                                                                      UFLINT     33
CD ADATA(N+7)=RSBTMR    BREAKER TIMER                                   UFLINT     34
CD                                                                      UFLINT     35
CD ADATA(N+8)=RSEYRO    REAL COMPONENT OF PRESENT BUS VOLTAGE           UFLINT     36
CD                                                                      UFLINT     37
CD ADATA(N+9)=RSEYIO    IMAGINARY COMPONENT OF PRESENT BUS VOLTAGE      UFLINT     38
CD                                                                      UFLINT     39
CD ADATA(N+10)=RSFEQO   PRESENT BUS FREQUENCY                           UFLINT     40
CD                                                                      UFLINT     41
CD ADATA(N+11)=RSCKR    INTEGRATOR GAIN--K                              UFLINT     42
CD                                                                      UFLINT     43
CD ADATA(N+12)=RSX1O    PAST VALUE OF STATE VARIABLE X1 INTEGRATOR      UFLINT     44
CD                      INPUT                                           UFLINT     45
CD                                                                      UFLINT     46
CD ADATA(N+13)=RSX2O    PAST VALUE OF STATE VARIABLE X2 INTEGRATOR      UFLINT     47
CD                      OUTPUT                                          UFLINT     48
CD                                                                      UFLINT     49
CD ADATA(N+14)=RSX1N    PRESENT VALUE OF X1                             UFLINT     50
CD                                                                      UFLINT     51
CD ADATA(N+15)=RSX2N    PRESENT VALUE OF X2                             UFLINT     52
CD                                                                      UFLINT     53
CD ADATA(N+16)=RSFEQ1   TRIPPING FREQUENCY (SPECIFIED IN CYCLES, STORED UFLINT     54
CD                      IN RADIANS/SEC INTERNALLY)                      UFLINT     55
CD                                                                      UFLINT     56
CD ADATA(N+17)=RSTLEV   TIME LEVER                                      UFLINT     57
CD                                                                      UFLINT     58
CD ADATA(N+18)=RSBDLY   BREAKER TIME DELAY (SPECIFIED IN CYCLES, STORED UFLINT     59
CD                      IN RADIANS/SEC INTERNALLY)                      UFLINT     60
CD                                                                      UFLINT     61
CD ADATA(N+19)=RSLDRP   PER CENT REAL POWER DROP FOR CONSTANT IMPEDANCE UFLINT     62
CD                      LOAD                                            UFLINT     63
CD                                                                      UFLINT     64
CD ADATA(N+20)=RSLDRP   PER CENT REACTIVE POWER DROP FOR CONSTANT       UFLINT     65
CD                      IMPEDANCE LOAD                                  UFLINT     66
CD                                                                      UFLINT     67
CD ADATA(N+21)=RSLDRP   PER CENT REAL POWER DROP FOR CONSTANT CURRENT   UFLINT     68
CD                      LOAD                                            UFLINT     69
CD                                                                      UFLINT     70
CD ADATA(N+22)=RSLDRP   PER CENT REACTIVE POWER DROP FOR CONSTANT       UFLINT     71
CD                      CURRENT LOAD                                    UFLINT     72
CD                                                                      UFLINT     73
CD ADATA(N+23)=RSLDRP   PER CENT REAL POWER DROP FOR CONSTANT MVA LOAD  UFLINT     74
CD                                                                      UFLINT     75
CD ADATA(N+24)=RSLDRP   PER CENT REACTIVE POWER DROP FOR CONSTANT MVA   UFLINT     76
CD                      LOAD                                            UFLINT     77
CD                                                                      UFLINT     78
CD ADATA(N+25)=RSLDRP   PER CENT REAL POWER DROP FOR CONSTANT MVA WITH  UFLINT     79
CD                      FREQUENCY DEPENDENCE                            UFLINT     80
CD                                                                      UFLINT     81
CD ADATA(N+26)=RSLDRP   PER CENT REACTIVE POWER DROP FOR CONSTANT MVA   UFLINT     82
CD                      WITH FREQUENCY DEPPENDCE                        UFLINT     83
CD                                                                      UFLINT     84
CD                                                                      UFLINT     85
      INCLUDE 'PARX.INS'                                                UFLINT     86
      INCLUDE 'CNPT.INS'                                                UFLINT     87
      INCLUDE 'CNVOLT.INS'                                              UFLINT     88
      INCLUDE 'CNIPTR.INS'                                              UFLINT     89
      INCLUDE 'CNAUTO.INS'                                              UFLINT     90
      INCLUDE 'CNB19.INS'                                               UFLINT     91
      INCLUDE 'CNPARX.INS'                                              UFLINT     92
      INCLUDE 'CNNNEW.INS'                                              UFLINT     93
C                                                                       UFLINT     94
      COMPLEX VOLTK                                                     UFLINT     95
      DIMENSION VOLTX(2)                                                UFLINT     96
      EQUIVALENCE (VOLTK,VOLTX(1)),(VREAL,VOLTX(1)),(VIMAG,VOLTX(2))    UFLINT     97
C                                                                       UFLINT     98
C                                                                       UFLINT     99
      DO 200 J=LUFREQ,NUFREQ                                            UFLINT    100
      K=IDATPT(J)                                                       UFLINT    101
      IF(IADATA(K+3).GT.9)GOTO 200                                      UFLINT    102
      NLF=IADATA(K+1)                                                   UFLINT    103
      IDRRR=IADATA(K+4)                                                 UFLINT    104
      NPROG=NNEW(NLF)                                                   UFLINT    105
      IADATA(K+1)=NPROG                                                 UFLINT    106
      IADATA(K+3)=0                                                     UFLINT    107
      IADATA(K+5)=0                                                     UFLINT    108
      VOLTK=VOLT(NPROG)                                                 UFLINT    109
      ADATA(K+8)=VREAL                                                  UFLINT    110
      ADATA(K+9)=VIMAG                                                  UFLINT    111
      ADATA(K+6)=CABS(VOLTK)                                            UFLINT    112
      FRELAY=ADATA(K+16)                                                UFLINT    113
      ADATA(K+16)=(FRELAY-FQBASE)*2.*PII/FQBASE                         UFLINT    114
      ADATA(K+11)=FQBASE/(2.0*PII*(2.3+0.125*(FRELAY-(FQBASE-1.))))     UFLINT    115
      ADATA(K+17)=ADATA(K+17)*FQBASE                                    UFLINT    116
      ADATA(K+12)=ADATA(K+16)                                           UFLINT    117
      ADATA(K+14)=ADATA(K+16)                                           UFLINT    118
      ADATA(K+7)=0.0                                                    UFLINT    119
      ADATA(K+10)=0.0                                                   UFLINT    120
      ADATA(K+13)=0.0                                                   UFLINT    121
      ADATA(K+15)=0.0                                                   UFLINT    122
      ADATA(K+18)=ADATA(K+18)/FQBASE                                    UFLINT    123
C                                                                       UFLINT    124
C    ITITIALIZE THE REMOTE RELAY                                        UFLINT    125
C                                                                       UFLINT    126
      IF(IDRRR.NE.0)THEN                                                UFLINT    127
       KOFF=K+26                                                        UFLINT    128
       CALL REMINT(KOFF,IDRRR)                                          UFLINT    129
      ENDIF                                                             UFLINT    130
C                                                                       UFLINT    131
 200  CONTINUE                                                          UFLINT    132
      RETURN                                                            UFLINT    133
      END                                                               UFLINT    134
