CFPRIME INE7N8                                                          INE7N8      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 INE7N8                                                 INE7N8      3
CD                                                                      INE7N8      4
CD    TO PERFORM INITIALIZATION AND DATA CHECK FOR EXCITER TYPES 7 AND 8INE7N8      5
CD                                                                      INE7N8      6
CD    THE DATA STRUCTURE AFTER THE INITIALIZATION IS GIVEN BELOW.       INE7N8      7
CD                                                                      INE7N8      8
CD   3.6 Exciter type 7                                                 INE7N8      9
CD                                                                      INE7N8     10
CD     Exciter data                                                     INE7N8     11
CD                                                                      INE7N8     12
CD     IDDAT(JE+ 1)   = IVTN         : sensing bus number               INE7N8     13
CD     DDAT(JE+ 2)    = KA                                              INE7N8     14
CD     DDAT(JE+ 3)    = TA                                              INE7N8     15
CD     DDAT(JE+ 4)    = KE                                              INE7N8     16
CD     DDAT(JE+ 5)    = TE                                              INE7N8     17
CD     DDAT(JE+ 6)    = LVI                                             INE7N8     18
CD     DDAT(JE+ 7)    = (reserved for future use)                       INE7N8     19
CD     DDAT(JE+ 8)    = (reserved for future use)                       INE7N8     20
CD     DDAT(JE+ 9)    = KC                                              INE7N8     21
CD     DDAT(JE+10)    = KF                                              INE7N8     22
CD     DDAT(JE+11)    = TF                                              INE7N8     23
CD     DDAT(JE+12)    = TC                                              INE7N8     24
CD     DDAT(JE+13)    = TB                                              INE7N8     25
CD     DDAT(JE+14)    = (reserved for future use)                       INE7N8     26
CD     DDAT(JE+15)    = VRMAX                                           INE7N8     27
CD     DDAT(JE+16)    = VRMIN                                           INE7N8     28
CD     DDAT(JE+17)    = EFDMAX                                          INE7N8     29
CD     DDAT(JE+18)    = TR                                              INE7N8     30
CD     DDAT(JE+19)    = RC                                              INE7N8     31
CD     DDAT(JE+20)    = XC                                              INE7N8     32
CD     DDAT(JE+21)    = KP                                              INE7N8     33
CD     DDAT(JE+22)    = KI                                              INE7N8     34
CD                                                                      INE7N8     35
CD     Exciter states                                                   INE7N8     36
CD                                                                      INE7N8     37
CD     XSTATE(JES+1)  = TR block     : compulsory                       INE7N8     38
CD     XSTATE(JES+2)  = TF block     : compulsory                       INE7N8     39
CD     XSTATE(JES+3)  = TB block     : compulsory                       INE7N8     40
CD     XSTATE(JES+4)  = TA block     : compulsory                       INE7N8     41
CD     XSTATE(JES+5)  = TE block     : compulsory                       INE7N8     42
CD                                                                      INE7N8     43
CD     Exciter Y-variables                                              INE7N8     44
CD                                                                      INE7N8     45
CD     VREG(JYE+1)    = VC (input to the TR block)                      INE7N8     46
CD     VREF(JYE+2)    = reference value                                 INE7N8     47
CD                                                                      INE7N8     48
CD   3.7 Exciter type 8                                                 INE7N8     49
CD                                                                      INE7N8     50
CD     Exciter data                                                     INE7N8     51
CD                                                                      INE7N8     52
CD     IDDAT(JE+ 1)   = IVTN         : sensing bus number               INE7N8     53
CD     DDAT(JE+ 2)    = KM                                              INE7N8     54
CD     DDAT(JE+ 3)    = TM                                              INE7N8     55
CD     DDAT(JE+ 4)    = KA                                              INE7N8     56
CD     DDAT(JE+ 5)    = KG                                              INE7N8     57
CD     DDAT(JE+ 6)    = VGMAX                                           INE7N8     58
CD     DDAT(JE+ 7)    = VIMAX                                           INE7N8     59
CD     DDAT(JE+ 8)    = VIMIN                                           INE7N8     60
CD     DDAT(JE+ 9)    = KC                                              INE7N8     61
CD     DDAT(JE+10)    = KF                                              INE7N8     62
CD     DDAT(JE+11)    = TF                                              INE7N8     63
CD     DDAT(JE+12)    = TC                                              INE7N8     64
CD     DDAT(JE+13)    = TB                                              INE7N8     65
CD     DDAT(JE+14)    = TA                                              INE7N8     66
CD     DDAT(JE+15)    = VMMAX                                           INE7N8     67
CD     DDAT(JE+16)    = VMMIN                                           INE7N8     68
CD     DDAT(JE+17)    = EFMAX                                           INE7N8     69
CD     DDAT(JE+18)    = TR                                              INE7N8     70
CD     DDAT(JE+19)    = RC                                              INE7N8     71
CD     DDAT(JE+20)    = XC                                              INE7N8     72
CD     DDAT(JE+21)    = XL                                              INE7N8     73
CD     DDAT(JE+22)    = K1                                              INE7N8     74
CD     DDAT(JE+23)    = KP                                              INE7N8     75
CD     DDAT(JE+24)    = THETAP                                          INE7N8     76
CD     DDAT(JE+25)    = VRMAX                                           INE7N8     77
CD     DDAT(JE+26)    = VRMIN                                           INE7N8     78
CD     DDAT(JE+27)    = VBMAX                                           INE7N8     79
CD                                                                      INE7N8     80
CD     Exciter states                                                   INE7N8     81
CD                                                                      INE7N8     82
CD     XSTATE(JES+1)  = TR block     : compulsory                       INE7N8     83
CD     XSTATE(JES+2)  = TF block     : compulsory                       INE7N8     84
CD     XSTATE(JES+3)  = TB block     : compulsory                       INE7N8     85
CD     XSTATE(JES+4)  = TA block     : compulsory                       INE7N8     86
CD     XSTATE(JES+5)  = TM block     : compulsory                       INE7N8     87
CD                                                                      INE7N8     88
CD     Exciter Y-variables                                              INE7N8     89
CD                                                                      INE7N8     90
CD     VREG(JYE+1)    = VC (input to the TR block)                      INE7N8     91
CD     VREF(JYE+2)    = reference value                                 INE7N8     92
CD                                                                      INE7N8     93
      INCLUDE 'PARX.INS'                                                INE7N8     94
      INCLUDE 'CNMDAT.INS'                                              INE7N8     95
      INCLUDE 'CNSTN.INS'                                               INE7N8     96
      INCLUDE 'CNMSTA.INS'                                              INE7N8     97
      INCLUDE 'CNXSTA.INS'                                              INE7N8     98
      INCLUDE 'CNB1.INS'                                                INE7N8     99
      INCLUDE 'CNB4.INS'                                                INE7N8    100
      INCLUDE 'CNB8.INS'                                                INE7N8    101
      INCLUDE 'CNEXC.INS'                                               INE7N8    102
      INCLUDE 'CNVOLT.INS'                                              INE7N8    103
      INCLUDE 'CNMYVA.INS'                                              INE7N8    104
      INCLUDE 'CNYVAR.INS'                                              INE7N8    105
      INCLUDE 'CNUNIT.INS'                                              INE7N8    106
      INCLUDE 'CNMSG.INS'                                               INE7N8    107
      INCLUDE 'CNXDOT.INS'                                              INE7N8    108
C                                                                       INE7N8    109
      DATA BIG/99.9/                                                    INE7N8    110
C                                                                       INE7N8    111
C  COMPOUND SOURCE VOLTAGE FOR TYPE 7 & 8 EXCITER                       INE7N8    112
C                                                                       INE7N8    113
C                                                                       INE7N8    114
C  INPUT TIME CONSTANTS CHECK AND RESET                                 INE7N8    115
C                                                                       INE7N8    116
      IF (IEXN.EQ.7) THEN                                               INE7N8    117
         IF(DDAT(JE+3).LT.TMIN.AND.IDDAT(JE+3).NE.0)THEN                INE7N8    118
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE7N8    119
     *            ,NDGC(N)                                              INE7N8    120
         WRITE(MSG(2),9010)                                             INE7N8    121
         IF(MTFLAG.EQ.0) THEN                                           INE7N8    122
            WRITE(MSG(3),9030) 'TA',DDAT(JE+3),TMIN                     INE7N8    123
            CALL PRTMSG(2)                                              INE7N8    124
         ELSE                                                           INE7N8    125
            WRITE(MSG(3),9030) 'TA',DDAT(JE+3),TMIN,'TA',0.0            INE7N8    126
            DDAT(JE+3)=0.0                                              INE7N8    127
         ENDIF                                                          INE7N8    128
         CALL PRTMSG(3)                                                 INE7N8    129
         ENDIF                                                          INE7N8    130
      ELSE IF (IEXN.EQ.8) THEN                                          INE7N8    131
         IF (DDAT(JE+3).LT.0.4.AND.IDDAT(JE+5).NE.0) THEN               INE7N8    132
            WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)    INE7N8    133
     *               ,NDGC(N)                                           INE7N8    134
            WRITE(MSG(2),9020)                                          INE7N8    135
            IF(MTFLAG.EQ.0) THEN                                        INE7N8    136
               WRITE(MSG(3),9030) 'TM',DDAT(JE+3),0.4                   INE7N8    137
            ELSE                                                        INE7N8    138
               WRITE(MSG(3),9030) 'TM',DDAT(JE+3),0.4,'TM',0.4          INE7N8    139
               DDAT(JE+3)=0.4                                           INE7N8    140
            ENDIF                                                       INE7N8    141
            CALL PRTMSG(3)                                              INE7N8    142
         ELSE IF (DDAT(JE+3).LT.TMIN) THEN                              INE7N8    143
            WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)    INE7N8    144
     *            ,NDGC(N)                                              INE7N8    145
            WRITE(MSG(2),9020)                                          INE7N8    146
            IF(MTFLAG.EQ.0) THEN                                        INE7N8    147
               WRITE(MSG(3),9030) 'TM',DDAT(JE+3),TMIN                  INE7N8    148
            ELSE                                                        INE7N8    149
               WRITE(MSG(3),9030) 'TM',DDAT(JE+3),TMIN,'TM',TMIN        INE7N8    150
               DDAT(JE+3)=TMIN                                          INE7N8    151
            ENDIF                                                       INE7N8    152
            CALL PRTMSG(3)                                              INE7N8    153
         END IF                                                         INE7N8    154
      END IF                                                            INE7N8    155
C                                                                       INE7N8    156
      IF (IEXN.EQ.7) THEN                                               INE7N8    157
         IF (DDAT(JE+5).LE.0.0) THEN                                    INE7N8    158
            WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)    INE7N8    159
     *                        ,NDGC(N)                                  INE7N8    160
            WRITE(MSG(2),9010)                                          INE7N8    161
            WRITE(MSG(3),9050) DDAT(JE+5)                               INE7N8    162
            CALL PRTMSG(3)                                              INE7N8    163
            CALL ASTOP('INE7N8: FATAL ERROR',19)                        INE7N8    164
         ELSE IF (DDAT(JE+5).LT.10.0*TMIN) THEN                         INE7N8    165
            WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)    INE7N8    166
     *            ,NDGC(N)                                              INE7N8    167
            WRITE(MSG(2),9010)                                          INE7N8    168
            IF(MTFLAG.EQ.0) THEN                                        INE7N8    169
               WRITE(MSG(3),9030) 'TE',DDAT(JE+5),10.0*TMIN             INE7N8    170
            ELSE                                                        INE7N8    171
               WRITE(MSG(3),9030) 'TE',DDAT(JE+5),10.0*TMIN,'TE'        INE7N8    172
     *            ,10.0*TMIN                                            INE7N8    173
               DDAT(JE+5)=10.0*TMIN                                     INE7N8    174
            ENDIF                                                       INE7N8    175
            CALL PRTMSG(3)                                              INE7N8    176
         END IF                                                         INE7N8    177
      ELSE                                                              INE7N8    178
         IF(DDAT(JE+14).LT.TMIN.AND.IDDAT(JE+14).NE.0)THEN              INE7N8    179
            WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)    INE7N8    180
     *            ,NDGC(N)                                              INE7N8    181
            WRITE(MSG(2),9020)                                          INE7N8    182
            IF(MTFLAG.EQ.0) THEN                                        INE7N8    183
               WRITE(MSG(3),9030) 'TA',DDAT(JE+14),TMIN                 INE7N8    184
            ELSE                                                        INE7N8    185
               WRITE(MSG(3),9030) 'TA',DDAT(JE+14),TMIN,'TA',0.0        INE7N8    186
               DDAT(JE+14)=0.0                                          INE7N8    187
            ENDIF                                                       INE7N8    188
            CALL PRTMSG(3)                                              INE7N8    189
         ENDIF                                                          INE7N8    190
      ENDIF                                                             INE7N8    191
C                                                                       INE7N8    192
      IF(DDAT(JE+11).LT.TMIN.AND.IDDAT(JE+11).NE.0)THEN                 INE7N8    193
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE7N8    194
     *            ,NDGC(N)                                              INE7N8    195
         IF (IEXN.EQ.7) THEN                                            INE7N8    196
            WRITE(MSG(2),9010)                                          INE7N8    197
         ELSE                                                           INE7N8    198
            WRITE(MSG(2),9020)                                          INE7N8    199
         ENDIF                                                          INE7N8    200
         IF(MTFLAG.EQ.0) THEN                                           INE7N8    201
            WRITE(MSG(3),9030) 'TF',DDAT(JE+5),TMIN                     INE7N8    202
         ELSE                                                           INE7N8    203
            WRITE(MSG(3),9030) 'TF',DDAT(JE+5),TMIN,'TF',0.0            INE7N8    204
            DDAT(JE+11)=0.0                                             INE7N8    205
         ENDIF                                                          INE7N8    206
         CALL PRTMSG(3)                                                 INE7N8    207
      ENDIF                                                             INE7N8    208
C                                                                       INE7N8    209
      IF(DDAT(JE+13).LT.TMIN.AND.IDDAT(JE+13).NE.0)THEN                 INE7N8    210
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE7N8    211
     *            ,NDGC(N)                                              INE7N8    212
         IF (IEXN.EQ.7) THEN                                            INE7N8    213
            WRITE(MSG(2),9010)                                          INE7N8    214
         ELSE                                                           INE7N8    215
            WRITE(MSG(2),9020)                                          INE7N8    216
         ENDIF                                                          INE7N8    217
         IF(MTFLAG.EQ.0) THEN                                           INE7N8    218
            WRITE(MSG(3),9030) 'TB',DDAT(JE+13),TMIN                    INE7N8    219
         ELSE                                                           INE7N8    220
            WRITE(MSG(3),9030) 'TB',DDAT(JE+13),TMIN,'TB',0.0           INE7N8    221
            DDAT(JE+13)=0.0                                             INE7N8    222
         ENDIF                                                          INE7N8    223
         CALL PRTMSG(3)                                                 INE7N8    224
      ENDIF                                                             INE7N8    225
C                                                                       INE7N8    226
      IF(DDAT(JE+18).LT.TMIN.AND.IDDAT(JE+18).NE.0)THEN                 INE7N8    227
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE7N8    228
     *            ,NDGC(N)                                              INE7N8    229
         IF (IEXN.EQ.7) THEN                                            INE7N8    230
            WRITE(MSG(2),9010)                                          INE7N8    231
         ELSE                                                           INE7N8    232
            WRITE(MSG(2),9020)                                          INE7N8    233
         ENDIF                                                          INE7N8    234
         IF(MTFLAG.EQ.0) THEN                                           INE7N8    235
            WRITE(MSG(3),9030) 'TR',DDAT(JE+18),TMIN                    INE7N8    236
            CALL PRTMSG(2)                                              INE7N8    237
         ELSE                                                           INE7N8    238
            WRITE(MSG(3),9030) 'TR',DDAT(JE+18),TMIN,'TR',0.0           INE7N8    239
            DDAT(JE+18)=0.0                                             INE7N8    240
         ENDIF                                                          INE7N8    241
         CALL PRTMSG(3)                                                 INE7N8    242
      ENDIF                                                             INE7N8    243
C                                                                       INE7N8    244
C  DATA PREPARATION AND INPUT DATA PRINTOUT                             INE7N8    245
C                                                                       INE7N8    246
      IF (IEXN.EQ.7) THEN                                               INE7N8    247
         IF(IDDAT(JE+15).EQ.0.AND.IDDAT(JE+16).EQ.0) THEN               INE7N8    248
            DDAT(JE+15)=BIG                                             INE7N8    249
            DDAT(JE+16)=-BIG                                            INE7N8    250
         ENDIF                                                          INE7N8    251
         IF(IDDAT(JE+17).EQ.0) DDAT(JE+17)=BIG                          INE7N8    252
      ELSE                                                              INE7N8    253
         IF(IDDAT(JE+15).EQ.0.AND.IDDAT(JE+16).EQ.0) THEN               INE7N8    254
            DDAT(JE+15)=BIG                                             INE7N8    255
            DDAT(JE+16)=-BIG                                            INE7N8    256
         ENDIF                                                          INE7N8    257
         IF(IDDAT(JE+17).EQ.0) DDAT(JE+17)=BIG                          INE7N8    258
         IF(IDDAT(JE+6).EQ.0) DDAT(JE+6)=BIG                            INE7N8    259
         IF(IDDAT(JE+7).EQ.0.AND.IDDAT(JE+8).EQ.0) THEN                 INE7N8    260
            DDAT(JE+7)=BIG                                              INE7N8    261
            DDAT(JE+8)=-BIG                                             INE7N8    262
         ENDIF                                                          INE7N8    263
         IF(IDDAT(JE+25).EQ.0.AND.IDDAT(JE+26).EQ.0) THEN               INE7N8    264
            DDAT(JE+25)=BIG                                             INE7N8    265
            DDAT(JE+26)=-BIG                                            INE7N8    266
         ENDIF                                                          INE7N8    267
         IF(IDDAT(JE+27).EQ.0) DDAT(JE+27)=BIG                          INE7N8    268
          DDAT(JE+21)=DDAT(JE+21)/BASPRN                                INE7N8    269
      ENDIF                                                             INE7N8    270
C                                                                       INE7N8    271
      DDAT(JE+22)=DDAT(JE+22)/BASPRN                                    INE7N8    272
      DDAT(JE+24)=DDAT(JE+24)*0.0174532                                 INE7N8    273
C                                                                       INE7N8    274
      VE=EFDN                                                           INE7N8    275
C                                                                       INE7N8    276
      IF(IEXN.EQ.7)THEN                                                 INE7N8    277
         VSC1=REAL(VOLT(IVTN))*DDAT(JE+21)-CQGN*DDAT(JE+22)             INE7N8    278
         VSC2=AIMAG(VOLT(IVTN))*DDAT(JE+21)+CDGN*DDAT(JE+22)            INE7N8    279
         VSC=SQRT(VSC1*VSC1+VSC2*VSC2)                                  INE7N8    280
         XIN=DDAT(JE+9)*EFDN/VSC                                        INE7N8    281
         IF (XIN.GT.0.750)THEN                                          INE7N8    282
         FIN=1.732*(1.0-XIN)                                            INE7N8    283
         ELSE IF (XIN.GT.0.433)THEN                                     INE7N8    284
         FIN=SQRT(0.75-XIN*XIN)                                         INE7N8    285
         ELSE                                                           INE7N8    286
         FIN=1.0-0.577*XIN                                              INE7N8    287
         ENDIF                                                          INE7N8    288
         VB=VSC*FIN                                                     INE7N8    289
         SEKX=VE*DDAT(JE+4)                                             INE7N8    290
         XSTATE(JSTATE+2)=EFDN                                          INE7N8    291
C                                                                       INE7N8    292
C     NOTE THAT BOTH THE SUMMATION (TYPE ST2) AND THE MULTIPLER         INE7N8    293
C     (TYPE ST2A) ARE SUPPORTED HERE                                    INE7N8    294
C                                                                       INE7N8    295
         IF (DDAT(JE+6).GT.0.5) THEN                                    INE7N8    296
            VR=SEKX-VB                                                  INE7N8    297
         ELSE                                                           INE7N8    298
            VR=SEKX/VB                                                  INE7N8    299
         END IF                                                         INE7N8    300
C                                                                       INE7N8    301
      ELSE                                                              INE7N8    302
         XKPR=DDAT(JE+23)*COS(DDAT(JE+24))                              INE7N8    303
         XKPI=DDAT(JE+23)*SIN(DDAT(JE+24))                              INE7N8    304
         VR=REAL(VOLT(IVTN))                                            INE7N8    305
         VIM=AIMAG(VOLT(IVTN))                                          INE7N8    306
         VSC1=VR*XKPR-VIM*XKPI-CQGN*(DDAT(JE+22)                        INE7N8    307
     &+XKPR*DDAT(JE+21))-CDGN*XKPI*DDAT(JE+21)                          INE7N8    308
         VSC2=VR*XKPI+VIM*XKPR+CDGN*(DDAT(JE+22)                        INE7N8    309
     &+XKPR*DDAT(JE+21))-CQGN*XKPI*DDAT(JE+21)                          INE7N8    310
         VSC=SQRT(VSC1*VSC1+VSC2*VSC2)                                  INE7N8    311
         XIN=DDAT(JE+9)*EFDN/VSC                                        INE7N8    312
         IF (XIN.GT.0.750)THEN                                          INE7N8    313
         FIN=1.732*(1.0-XIN)                                            INE7N8    314
         ELSE IF (XIN.GT.0.433)THEN                                     INE7N8    315
         FIN=SQRT(0.75-XIN*XIN)                                         INE7N8    316
         ELSE                                                           INE7N8    317
         FIN=1.0-0.577*XIN                                              INE7N8    318
         ENDIF                                                          INE7N8    319
         VB=VSC*FIN                                                     INE7N8    320
C                                                                       INE7N8    321
         IF (VB.GT.DDAT(JE+27))THEN                                     INE7N8    322
            WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)    INE7N8    323
     *            ,NDGC(N)                                              INE7N8    324
            WRITE(MSG(2),9020)                                          INE7N8    325
            WRITE(MSG(3),9100)                                          INE7N8    326
            WRITE(MSG(4),9110) VB,DDAT(JE+27)                           INE7N8    327
            CALL PRTMSG(4)                                              INE7N8    328
         ENDIF                                                          INE7N8    329
C                                                                       INE7N8    330
         VR=EFDN/VB                                                     INE7N8    331
         XSTATE(JSTATE+2)=EFDN                                          INE7N8    332
C                                                                       INE7N8    333
      ENDIF                                                             INE7N8    334
C                                                                       INE7N8    335
      IF(IEXN.EQ.7)THEN                                                 INE7N8    336
      XSTATE(JSTATE+3)=VR/DDAT(JE+2)                                    INE7N8    337
      XSTATE(JSTATE+4)=VR                                               INE7N8    338
C                                                                       INE7N8    339
      XDFACT(JSTATE+4)=DDAT(JE+2)                                       INE7N8    340
C                                                                       INE7N8    341
      XSTATE(JSTATE+5)=VE                                               INE7N8    342
      VREF(JYE+2)=XSTATE(JSTATE+1)+XSTATE(JSTATE+3)                     INE7N8    343
C                                                                       INE7N8    344
      IF (VR.GT.DDAT(JE+15).OR.VR.LT.DDAT(JE+16))THEN                   INE7N8    345
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE7N8    346
     *            ,NDGC(N)                                              INE7N8    347
         WRITE(MSG(2),9010)                                             INE7N8    348
         WRITE(MSG(3),9200)                                             INE7N8    349
         WRITE(MSG(4),9210) VR,DDAT(JE+15),DDAT(JE+16)                  INE7N8    350
         CALL PRTMSG(4)                                                 INE7N8    351
      ENDIF                                                             INE7N8    352
      IF (VE.GT.DDAT(JE+17).OR.VE.LT.0.0)THEN                           INE7N8    353
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE7N8    354
     *            ,NDGC(N)                                              INE7N8    355
         WRITE(MSG(2),9010)                                             INE7N8    356
         WRITE(MSG(3),9300)                                             INE7N8    357
         WRITE(MSG(4),9310) VE,DDAT(JE+17)                              INE7N8    358
         CALL PRTMSG(4)                                                 INE7N8    359
      ENDIF                                                             INE7N8    360
      ELSE                                                              INE7N8    361
      VG=EFDN*DDAT(JE+5)                                                INE7N8    362
      IF (VG.GT.DDAT(JE+6)) VG=DDAT(JE+6)                               INE7N8    363
      VM=VR                                                             INE7N8    364
      VR=VR/DDAT(JE+2)+VG                                               INE7N8    365
      XSTATE(JSTATE+4)=VR                                               INE7N8    366
      XSTATE(JSTATE+3)=XSTATE(JSTATE+4)                                 INE7N8    367
C                                                                       INE7N8    368
      XDFACT(JSTATE+3)=DDAT(JE+4)                                       INE7N8    369
C                                                                       INE7N8    370
      XSTATE(JSTATE+5)=VM                                               INE7N8    371
C                                                                       INE7N8    372
      XDFACT(JSTATE+5)=DDAT(JE+2)                                       INE7N8    373
C                                                                       INE7N8    374
      VREF(JYE+2)=XSTATE(JSTATE+1)+XSTATE(JSTATE+3)/DDAT(JE+4)          INE7N8    375
C                                                                       INE7N8    376
      IF (VR.GT.DDAT(JE+25).OR.VR.LT.DDAT(JE+26))THEN                   INE7N8    377
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE7N8    378
     *            ,NDGC(N)                                              INE7N8    379
         WRITE(MSG(2),9020)                                             INE7N8    380
         WRITE(MSG(3),9200)                                             INE7N8    381
         WRITE(MSG(4),9210) VR,DDAT(JE+25),DDAT(JE+26)                  INE7N8    382
         CALL PRTMSG(4)                                                 INE7N8    383
      ENDIF                                                             INE7N8    384
      IF(VM.GT.DDAT(JE+15).OR.VM.LT.DDAT(JE+16))THEN                    INE7N8    385
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE7N8    386
     *            ,NDGC(N)                                              INE7N8    387
         WRITE(MSG(2),9020)                                             INE7N8    388
         WRITE(MSG(3),9500)                                             INE7N8    389
         WRITE(MSG(4),9510) VM,DDAT(JE+15),DDAT(JE+16)                  INE7N8    390
         CALL PRTMSG(4)                                                 INE7N8    391
      ENDIF                                                             INE7N8    392
      IF(EFDN.GT.DDAT(JE+17))THEN                                       INE7N8    393
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE7N8    394
     *            ,NDGC(N)                                              INE7N8    395
         WRITE(MSG(2),9020)                                             INE7N8    396
         WRITE(MSG(3),9600)                                             INE7N8    397
         WRITE(MSG(4),9610) EFDN,DDAT(JE+17)                            INE7N8    398
         CALL PRTMSG(4)                                                 INE7N8    399
      ENDIF                                                             INE7N8    400
C                                                                       INE7N8    401
      ENDIF                                                             INE7N8    402
C                                                                       INE7N8    403
      JSTATE=JSTATE+5                                                   INE7N8    404
      JY=JY+2                                                           INE7N8    405
C                                                                       INE7N8    406
      RETURN                                                            INE7N8    407
C                                                                       INE7N8    408
 9000 FORMAT(' *** WARNING GENERATOR AT BUS: ',I5,' STATION: ',3A4      INE7N8    409
     *,' GID:',A4)                                                      INE7N8    410
 9010 FORMAT(5X,'TYPE 7 EXCITER (WSCC TYPE FD, IEEE TYPE ST2A)')        INE7N8    411
 9020 FORMAT(5X,'TYPE 8 EXCITER (WSCC TYPE FL, IEEE TYPE ST3A)')        INE7N8    412
 9030 FORMAT(5X,A,'=',F8.6,' IS BELOW THE LIMIT VALUE OF',F5.2,:,2X,A   INE7N8    413
     *,' HAS BEEN SET TO',F5.2)                                         INE7N8    414
 9050 FORMAT(5X,'TE=',F8.6,' IS LESS THAN OR EQUAL TO ZERO.')           INE7N8    415
 9100 FORMAT(5X,'VB VIOLATES UPPER LIMIT:')                             INE7N8    416
 9110 FORMAT(5X,'VB = ',G12.5,' VBMAX = ',G12.5)                        INE7N8    417
 9200 FORMAT(5X,'VR-X4 VIOLATES LIMITS:')                               INE7N8    418
 9210 FORMAT(5X,'VR = ',G12.5,' VRMAX = ',G12.5,' VRMIN = ',G12.5)      INE7N8    419
 9300 FORMAT(5X,'VE-X5 VIOLATES LIMITS:')                               INE7N8    420
 9310 FORMAT(5X,'VE = ',G12.5,' VEMAX = ',G12.5,' VEMIN = ',G12.5)      INE7N8    421
 9500 FORMAT(5X,'VM-X5 VIOLATES LIMITS:')                               INE7N8    422
 9510 FORMAT(5X,'VM = ',G12.5,' VMMAX = ',G12.5,' VMMIN = ',G12.5)      INE7N8    423
 9600 FORMAT(5X,'EFDN VIOLATES UPPER LIMIT:')                           INE7N8    424
 9610 FORMAT(5X,'EFDN = ',G12.5,' EFMAX = ',G12.5)                      INE7N8    425
C                                                                       INE7N8    426
      END                                                               INE7N8    427
