CFPRIME INE14                                                           INE14       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 INE14                                                  INE14       3
CD                                                                      INE14       4
CD    TO PERFORM INITIALIZATION AND DATA CHECK FOR EXCITER TYPE 14      INE14       5
CD                                                                      INE14       6
CD    THE DATA STRUCTURE AFTER THE INITIALIZATION IS GIVEN BELOW.       INE14       7
CD                                                                      INE14       8
CD   3.10 Exciter type 14                                               INE14       9
CD                                                                      INE14      10
CD     Exciter data                                                     INE14      11
CD                                                                      INE14      12
CD     IDDAT(JE+ 1)   = IVTN         : sensing bus number               INE14      13
CD     DDAT(JE+ 2)    = KA                                              INE14      14
CD     DDAT(JE+ 3)    = TA                                              INE14      15
CD     DDAT(JE+ 4)    = KE                                              INE14      16
CD     DDAT(JE+ 5)    = TE                                              INE14      17
CD     DDAT(JE+ 6)    = SE(VSAT) or AEX                                 INE14      18
CD     DDAT(JE+ 7)    = SE(0.75VSAT) or BEX                             INE14      19
CD     DDAT(JE+ 8)    = VSAT                                            INE14      20
CD     DDAT(JE+ 9)    = KC                                              INE14      21
CD     DDAT(JE+10)    = TJ                                              INE14      22
CD     DDAT(JE+11)    = TH                                              INE14      23
CD     DDAT(JE+12)    = TC                                              INE14      24
CD     DDAT(JE+13)    = TB                                              INE14      25
CD     DDAT(JE+14)    = VRMAX                                           INE14      26
CD     DDAT(JE+15)    = VRMIN                                           INE14      27
CD     DDAT(JE+16)    = VEMIN                                           INE14      28
CD     DDAT(JE+17)    = TD                                              INE14      29
CD     DDAT(JE+18)    = TR                                              INE14      30
CD     DDAT(JE+19)    = RC                                              INE14      31
CD     DDAT(JE+20)    = XC                                              INE14      32
CD     DDAT(JE+21)    = XDE                                             INE14      33
CD     DDAT(JE+22)    = X'DE                                            INE14      34
CD     DDAT(JE+23)    = KRB                                             INE14      35
CD     DDAT(JE+24)    = TRB                                             INE14      36
CD     DDAT(JE+25)    = VFELIM                                          INE14      37
CD     DDAT(JE+26)    = VAMAX                                           INE14      38
CD     DDAT(JE+27)    = VAMIN                                           INE14      39
CD     DDAT(JE+28)    = KH                                              INE14      40
CD     DDAT(JE+29)    = VHMAX                                           INE14      41
CD     DDAT(JE+30)    = VJMAX                                           INE14      42
CD     DDAT(JE+31)    = RAMP                                            INE14      43
CD     DDAT(JE+32)    = RMAX                                            INE14      44
CD     DDAT(JE+33)    = RMIN                                            INE14      45
CD                                                                      INE14      46
CD     Exciter states                                                   INE14      47
CD                                                                      INE14      48
CD     XSTATE(JES+1)  = TR block     : compulsory                       INE14      49
CD     XSTATE(JES+2)  = TH block     : compulsory                       INE14      50
CD     XSTATE(JES+3)  = TB block     : compulsory                       INE14      51
CD     XSTATE(JES+4)  = TA block     : compulsory                       INE14      52
CD     XSTATE(JES+5)  = TE block     : compulsory                       INE14      53
CD     XSTATE(JES+6)  = TRB block    : compulsory                       INE14      54
CD                                                                      INE14      55
CD     Exciter Y-variables                                              INE14      56
CD                                                                      INE14      57
CD     VREG(JYE+1)    = VC (input to the TR block)                      INE14      58
CD     VREF(JYE+2)    = reference value                                 INE14      59
CD                                                                      INE14      60
      INCLUDE 'PARX.INS'                                                INE14      61
      INCLUDE 'CNMDAT.INS'                                              INE14      62
      INCLUDE 'CNSTN.INS'                                               INE14      63
      INCLUDE 'CNB1.INS'                                                INE14      64
      INCLUDE 'CNB4.INS'                                                INE14      65
      INCLUDE 'CNMSTA.INS'                                              INE14      66
      INCLUDE 'CNXSTA.INS'                                              INE14      67
      INCLUDE 'CNB8.INS'                                                INE14      68
      INCLUDE 'CNEXC.INS'                                               INE14      69
      INCLUDE 'CNMYVA.INS'                                              INE14      70
      INCLUDE 'CNYVAR.INS'                                              INE14      71
      INCLUDE 'CNUNIT.INS'                                              INE14      72
      INCLUDE 'CNMSG.INS'                                               INE14      73
      INCLUDE 'CNXDOT.INS'                                              INE14      74
C                                                                       INE14      75
C  IEX = 14                                                             INE14      76
C                                                                       INE14      77
C                                                                       INE14      78
C  INPUT TIME CONSTANTS CHECK AND RESET                                 INE14      79
C                                                                       INE14      80
      IF(DDAT(JE+3).LT.TMIN.AND.IDDAT(JE+3).NE.0)THEN                   INE14      81
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE14      82
     *                     ,NDGC(N)                                     INE14      83
         WRITE(MSG(2),9020) 'TA',DDAT(JE+3),TMIN                        INE14      84
         IF(MTFLAG.EQ.0) THEN                                           INE14      85
            CALL PRTMSG(2)                                              INE14      86
         ELSE                                                           INE14      87
         WRITE(MSG(3),9030) 'TA',0.0                                    INE14      88
         CALL PRTMSG(3)                                                 INE14      89
         DDAT(JE+3)=0.0                                                 INE14      90
         ENDIF                                                          INE14      91
      ENDIF                                                             INE14      92
C                                                                       INE14      93
      IF (DDAT(JE+5).LE.0.0) THEN                                       INE14      94
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE14      95
     *                     ,NDGC(N)                                     INE14      96
         WRITE(MSG(2),9050) DDAT(JE+5)                                  INE14      97
         CALL PRTMSG(2)                                                 INE14      98
         CALL ASTOP('INE14: FATAL ERROR',18)                            INE14      99
      ELSE IF (DDAT(JE+5).LT.10.0*TMIN) THEN                            INE14     100
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE14     101
     *                     ,NDGC(N)                                     INE14     102
         WRITE(MSG(2),9020) 'TE',DDAT(JE+5),10.0*TMIN                   INE14     103
         IF(MTFLAG.EQ.0) THEN                                           INE14     104
            CALL PRTMSG(2)                                              INE14     105
         ELSE                                                           INE14     106
         WRITE(MSG(3),9030) 'TE',10.0*TMIN                              INE14     107
         CALL PRTMSG(3)                                                 INE14     108
         DDAT(JE+5)=10.0*TMIN                                           INE14     109
         ENDIF                                                          INE14     110
      END IF                                                            INE14     111
C                                                                       INE14     112
      IF(DDAT(JE+11).LT.TMIN.AND.IDDAT(JE+11).NE.0)THEN                 INE14     113
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE14     114
     *                     ,NDGC(N)                                     INE14     115
         WRITE(MSG(2),9020) 'TH',DDAT(JE+11),TMIN                       INE14     116
         IF(MTFLAG.EQ.0) THEN                                           INE14     117
            CALL PRTMSG(2)                                              INE14     118
         ELSE                                                           INE14     119
         WRITE(MSG(3),9030) 'TH',0.0                                    INE14     120
         CALL PRTMSG(3)                                                 INE14     121
         DDAT(JE+11)=0.0                                                INE14     122
         ENDIF                                                          INE14     123
      ENDIF                                                             INE14     124
C                                                                       INE14     125
      IF(DDAT(JE+13).LT.TMIN.AND.IDDAT(JE+13).NE.0)THEN                 INE14     126
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE14     127
     *                     ,NDGC(N)                                     INE14     128
         WRITE(MSG(2),9020) 'TB',DDAT(JE+13),TMIN                       INE14     129
         IF(MTFLAG.EQ.0) THEN                                           INE14     130
            CALL PRTMSG(2)                                              INE14     131
         ELSE                                                           INE14     132
         WRITE(MSG(3),9030) 'TB',0.0                                    INE14     133
         CALL PRTMSG(3)                                                 INE14     134
         DDAT(JE+13)=0.0                                                INE14     135
         ENDIF                                                          INE14     136
      ENDIF                                                             INE14     137
C                                                                       INE14     138
      IF(DDAT(JE+18).LT.TMIN.AND.IDDAT(JE+18).NE.0)THEN                 INE14     139
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE14     140
     *                     ,NDGC(N)                                     INE14     141
         WRITE(MSG(2),9020) 'TR',DDAT(JE+18),TMIN                       INE14     142
         IF(MTFLAG.EQ.0) THEN                                           INE14     143
            CALL PRTMSG(2)                                              INE14     144
         ELSE                                                           INE14     145
         WRITE(MSG(3),9030) 'TR',0.0                                    INE14     146
         CALL PRTMSG(3)                                                 INE14     147
         DDAT(JE+18)=0.0                                                INE14     148
         ENDIF                                                          INE14     149
      ENDIF                                                             INE14     150
C                                                                       INE14     151
      IF(DDAT(JE+24).LT.TMIN.AND.IDDAT(JE+24).NE.0)THEN                 INE14     152
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE14     153
     *                     ,NDGC(N)                                     INE14     154
         WRITE(MSG(2),9020) 'TRB',DDAT(JE+24),TMIN                      INE14     155
         IF(MTFLAG.EQ.0) THEN                                           INE14     156
            CALL PRTMSG(2)                                              INE14     157
         ELSE                                                           INE14     158
         WRITE(MSG(3),9030) 'TRB',0.0                                   INE14     159
         CALL PRTMSG(3)                                                 INE14     160
         DDAT(JE+24)=0.0                                                INE14     161
         ENDIF                                                          INE14     162
      ENDIF                                                             INE14     163
C                                                                       INE14     164
C                                                                       INE14     165
C  DATA PREPARATION AND INPUT DATA PRINTOUT                             INE14     166
C                                                                       INE14     167
         IF(IDDAT(JE+14).EQ.0.AND.IDDAT(JE+15).EQ.0) THEN               INE14     168
            DDAT(JE+14)=99.0                                            INE14     169
            DDAT(JE+15)=-99.0                                           INE14     170
         ENDIF                                                          INE14     171
         IF(IDDAT(JE+26).EQ.0.AND.IDDAT(JE+27).EQ.0) THEN               INE14     172
            DDAT(JE+26)=99.0                                            INE14     173
            DDAT(JE+27)=-99.0                                           INE14     174
         ENDIF                                                          INE14     175
         IF(IDDAT(JE+32).EQ.0.AND.IDDAT(JE+33).EQ.0) THEN               INE14     176
            DDAT(JE+32)=99.0                                            INE14     177
            DDAT(JE+33)=-99.0                                           INE14     178
         ENDIF                                                          INE14     179
         IF(IDDAT(JE+25).EQ.0) DDAT(JE+25)=99.0                         INE14     180
         IF(IDDAT(JE+29).EQ.0) DDAT(JE+29)=99.0                         INE14     181
         IF(IDDAT(JE+30).EQ.0) DDAT(JE+30)=99.0                         INE14     182
         IF(IDDAT(JE+31).EQ.0) DDAT(JE+31)=99.0                         INE14     183
C                                                                       INE14     184
         IF(IDDAT(JE+23).EQ.0.OR.IDDAT(JE+24).EQ.0)THEN                 INE14     185
            DDAT(JE+23)=0.0                                             INE14     186
            DDAT(JE+24)=1.0                                             INE14     187
         ENDIF                                                          INE14     188
C                                                                       INE14     189
         IF (IDDAT(JE+8).NE.0)CALL EXSATF                               INE14     190
C                                                                       INE14     191
      VE=EFDN                                                           INE14     192
C                                                                       INE14     193
C                                                                       INE14     194
C  RECTIFIER REGULATION FOR TYPE 14                                     INE14     195
C                                                                       INE14     196
      IF (IDDAT(JE+9).EQ.0)THEN                                         INE14     197
C                                                                       INE14     198
C   KC=0                                                                INE14     199
C                                                                       INE14     200
      VTH=EFDN                                                          INE14     201
C                                                                       INE14     202
C   KC NE 0                                                             INE14     203
C                                                                       INE14     204
      ELSE                                                              INE14     205
      CFKC=EFDN*DDAT(JE+9)                                              INE14     206
      VTH=EFDN+0.577*CFKC                                               INE14     207
      FACT=CFKC/VTH                                                     INE14     208
      IF (FACT.LT.0.433) GO TO 90                                       INE14     209
      VTH=EFDN/1.732+CFKC                                               INE14     210
      FACT=CFKC/VTH                                                     INE14     211
      IF (FACT.GT.0.75) GO TO 90                                        INE14     212
      VTH=(EFDN*EFDN+CFKC*CFKC)/0.75                                    INE14     213
      VTH=SQRT(VTH)                                                     INE14     214
      FACT=CFKC/VTH                                                     INE14     215
      IF (FACT.LE.0.75.AND.FACT.GE.0.433) GO TO 90                      INE14     216
      WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)          INE14     217
     *                  ,NDGC(N)                                        INE14     218
      WRITE(MSG(2),9010)                                                INE14     219
      CALL PRTMSG(2)                                                    INE14     220
      IEEXIN=1                                                          INE14     221
C                                                                       INE14     222
C    ENDIF KC.NE.0                                                      INE14     223
C                                                                       INE14     224
      ENDIF                                                             INE14     225
C                                                                       INE14     226
 90   VE=VTH+EFDN*DDAT(JE+22)                                           INE14     227
C                                                                       INE14     228
C   EXCITER SATURATION BLOCK FOR TYEP 14                                INE14     229
C                                                                       INE14     230
      SE=DDAT(JE+6)*EXP(DDAT(JE+7)*VE)/VE                               INE14     231
      SEKX=VE*(SE+DDAT(JE+4))                                           INE14     232
      SEKX=SEKX+EFDN*(DDAT(JE+21)-DDAT(JE+22))                          INE14     233
C                                                                       INE14     234
C     MODIFICATION MADE ON APRIL 20, 1990 TO RESET THE INITIAL          INE14     235
C     CONDITIONS                                                        INE14     236
C                                                                       INE14     237
      XSTATE(JSTATE+2)=0.0                                              INE14     238
      XSTATE(JSTATE+6)=SEKX-DDAT(JE+25)                                 INE14     239
C                                                                       INE14     240
      VR=SEKX                                                           INE14     241
C                                                                       INE14     242
      XSTATE(JSTATE+3)=VR/DDAT(JE+2)                                    INE14     243
      XSTATE(JSTATE+4)=VR                                               INE14     244
C                                                                       INE14     245
      XDFACT(JSTATE+4)=DDAT(JE+2)                                       INE14     246
C                                                                       INE14     247
      XSTATE(JSTATE+5)=VE                                               INE14     248
C                                                                       INE14     249
      VREF(JYE+2)=XSTATE(JSTATE+1)+XSTATE(JSTATE+3)                     INE14     250
C                                                                       INE14     251
      JSTATE=JSTATE+6                                                   INE14     252
C                                                                       INE14     253
      IF (VR.GT.DDAT(JE+14).OR.VR.LT.DDAT(JE+15))THEN                   INE14     254
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE14     255
     *                     ,NDGC(N)                                     INE14     256
         WRITE(MSG(2),9100)                                             INE14     257
         WRITE(MSG(3),9110) VR,DDAT(JE+14),DDAT(JE+15)                  INE14     258
         CALL PRTMSG(3)                                                 INE14     259
      ENDIF                                                             INE14     260
C                                                                       INE14     261
      JY=JY+2                                                           INE14     262
      RETURN                                                            INE14     263
C                                                                       INE14     264
 9000 FORMAT(' *** WARNING GENERATOR AT BUS: ',I5,' STATION: ',3A4      INE14     265
     *,' GID:',A4)                                                      INE14     266
 9010 FORMAT(5X,'TYPE 14 EXCITER  FEX FUNCTION OUT OF RANGE')           INE14     267
 9020 FORMAT(5X,'TYPE 14 EXCITER ',A,'=',F8.6                           INE14     268
     *,' IS BELOW THE LIMIT VALUE OF ',F4.2)                            INE14     269
 9030 FORMAT(5X,A,' HAS BEEN SET TO ',F4.2)                             INE14     270
 9050 FORMAT(5X,'TYPE 14 EXCITER  TE=',F8.6                             INE14     271
     *,' IS LESS THAN OR EQUAL TO ZERO.')                               INE14     272
 9100 FORMAT(5X,'VR-X4 VIOLATES LIMITS:')                               INE14     273
 9110 FORMAT(5X,'VR = ',G12.5,' VRMAX = ',G12.5,' VRMIN = ',G12.5)      INE14     274
C                                                                       INE14     275
      END                                                               INE14     276
