CFPRIME INE10                                                           INE10       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 INE10                                                  INE10       3
CD                                                                      INE10       4
CD    TO PERFORM INITIALIZATION AND DATA CHECK FOR EXCITER TYPE 10.     INE10       5
CD                                                                      INE10       6
CD    THE DATA STRUCTURE AFTER THE INITIALIZATION IS GIVEN BELOW.       INE10       7
CD                                                                      INE10       8
CD   3.9 Exciter type 10                                                INE10       9
CD                                                                      INE10      10
CD     Exciter data                                                     INE10      11
CD                                                                      INE10      12
CD     IDDAT(JE+ 1)   = IVTN         : sensing bus number               INE10      13
CD     DDAT(JE+ 2)    = KA                                              INE10      14
CD     DDAT(JE+ 3)    = TA                                              INE10      15
CD     DDAT(JE+ 4)    = KE                                              INE10      16
CD     DDAT(JE+ 5)    = TE                                              INE10      17
CD     DDAT(JE+ 6)    = SE(VSAT) or AEX                                 INE10      18
CD     DDAT(JE+ 7)    = SE(0.75VSAT) or BEX                             INE10      19
CD     DDAT(JE+ 8)    = VSAT                                            INE10      20
CD     DDAT(JE+ 9)    = (reserved for future use)                       INE10      21
CD     DDAT(JE+10)    = KF                                              INE10      22
CD     DDAT(JE+11)    = TF1                                             INE10      23
CD     DDAT(JE+12)    = TC                                              INE10      24
CD     DDAT(JE+13)    = TB                                              INE10      25
CD     DDAT(JE+14)    = TF3                                             INE10      26
CD     DDAT(JE+15)    = TF2                                             INE10      27
CD     DDAT(JE+16)    = VRMAX                                           INE10      28
CD     DDAT(JE+17)    = VRMIN                                           INE10      29
CD     DDAT(JE+18)    = TR                                              INE10      30
CD     DDAT(JE+19)    = RC                                              INE10      31
CD     DDAT(JE+20)    = XC                                              INE10      32
CD                                                                      INE10      33
CD     Exciter states                                                   INE10      34
CD                                                                      INE10      35
CD     XSTATE(JES+1)  = TR block     : compulsory                       INE10      36
CD     XSTATE(JES+2)  = TE block     : compulsory                       INE10      37
CD     XSTATE(JES+3)  = TA block     : compulsory                       INE10      38
CD     XSTATE(JES+4)  = TF2 block    : optional                         INE10      39
CD     XSTATE(JES+5)  = TF1 block    : optional                         INE10      40
CD     XSTATE(JES+6)  = TB block     : optional                         INE10      41
CD                                                                      INE10      42
CD     Exciter Y-variables                                              INE10      43
CD                                                                      INE10      44
CD     VREG(JYE+1)    = VC (input to the TR block)                      INE10      45
CD     VREF(JYE+2)    = reference value                                 INE10      46
CD     VRFIN(JYE+3)   = output of TA block                              INE10      47
CD                                                                      INE10      48
      INCLUDE 'PARX.INS'                                                INE10      49
      INCLUDE 'CNMDAT.INS'                                              INE10      50
      INCLUDE 'CNMSTA.INS'                                              INE10      51
      INCLUDE 'CNXSTA.INS'                                              INE10      52
      INCLUDE 'CNEXC.INS'                                               INE10      53
      INCLUDE 'CNMYVA.INS'                                              INE10      54
      INCLUDE 'CNYVAR.INS'                                              INE10      55
      INCLUDE 'CNFLAG.INS'                                              INE10      56
      INCLUDE 'CNUNIT.INS'                                              INE10      57
      INCLUDE 'CNSTN.INS'                                               INE10      58
      INCLUDE 'CNB1.INS'                                                INE10      59
      INCLUDE 'CNB4.INS'                                                INE10      60
      INCLUDE 'CNIMPR.INS'                                              INE10      61
      INCLUDE 'CNMSG.INS'                                               INE10      62
      INCLUDE 'CNXDOT.INS'                                              INE10      63
C                                                                       INE10      64
      LOGICAL LTIME                                                     INE10      65
C                                                                       INE10      66
      DATA BIG/99.9/                                                    INE10      67
C                                                                       INE10      68
      LDEB=(JDEB(69).NE.0)                                              INE10      69
C                                                                       INE10      70
C  IEX=10                                                               INE10      71
C                                                                       INE10      72
C                                                                       INE10      73
C  INPUT TIME CONSTANTS CHECK AND RESET                                 INE10      74
C                                                                       INE10      75
      IF (DDAT(JE+5).LE.0.0) THEN                                       INE10      76
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE10      77
     *                     ,NDGC(N)                                     INE10      78
         WRITE(MSG(2),9050) DDAT(JE+5)                                  INE10      79
         CALL PRTMSG(2)                                                 INE10      80
         CALL ASTOP('INE10: FATAL ERROR',18)                            INE10      81
      ELSE IF (DDAT(JE+5).LT.10.0*TMIN) THEN                            INE10      82
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE10      83
     *                     ,NDGC(N)                                     INE10      84
         WRITE(MSG(2),9020) 'TE',DDAT(JE+5),10.0*TMIN                   INE10      85
         IF(MTFLAG.EQ.0) THEN                                           INE10      86
            CALL PRTMSG(2)                                              INE10      87
         ELSE                                                           INE10      88
            WRITE(MSG(3),9030) 'TE',10.0*TMIN                           INE10      89
            CALL PRTMSG(3)                                              INE10      90
            DDAT(JE+5)=10.0*TMIN                                        INE10      91
         ENDIF                                                          INE10      92
      END IF                                                            INE10      93
C                                                                       INE10      94
      IF(DDAT(JE+11).LT.TMIN.AND.IDDAT(JE+11).NE.0)THEN                 INE10      95
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE10      96
     *                     ,NDGC(N)                                     INE10      97
         WRITE(MSG(2),9020) 'TF1',DDAT(JE+11),TMIN                      INE10      98
         IF(MTFLAG.EQ.0) THEN                                           INE10      99
            CALL PRTMSG(2)                                              INE10     100
         ELSE                                                           INE10     101
            WRITE(MSG(3),9030) 'TF1',0.0                                INE10     102
            CALL PRTMSG(3)                                              INE10     103
            DDAT(JE+11)=0.0                                             INE10     104
         ENDIF                                                          INE10     105
      ENDIF                                                             INE10     106
C                                                                       INE10     107
      IF(DDAT(JE+13).LT.TMIN.AND.IDDAT(JE+13).NE.0)THEN                 INE10     108
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE10     109
     *                     ,NDGC(N)                                     INE10     110
         WRITE(MSG(2),9020) 'TB',DDAT(JE+13),TMIN                       INE10     111
         IF(MTFLAG.EQ.0) THEN                                           INE10     112
            CALL PRTMSG(2)                                              INE10     113
         ELSE                                                           INE10     114
         WRITE(MSG(3),9030) 'TB',0.0                                    INE10     115
         CALL PRTMSG(3)                                                 INE10     116
         DDAT(JE+13)=0.0                                                INE10     117
         ENDIF                                                          INE10     118
      ENDIF                                                             INE10     119
C                                                                       INE10     120
      IF(DDAT(JE+15).LT.TMIN.AND.IDDAT(JE+15).NE.0)THEN                 INE10     121
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE10     122
     *                     ,NDGC(N)                                     INE10     123
         WRITE(MSG(2),9020) 'TF2',DDAT(JE+15),TMIN                      INE10     124
         IF(MTFLAG.EQ.0) THEN                                           INE10     125
            CALL PRTMSG(2)                                              INE10     126
         ELSE                                                           INE10     127
         WRITE(MSG(3),9030) 'TF2',0.0                                   INE10     128
         CALL PRTMSG(3)                                                 INE10     129
         DDAT(JE+15)=0.0                                                INE10     130
         ENDIF                                                          INE10     131
      ENDIF                                                             INE10     132
C                                                                       INE10     133
      LTIME=(IDDAT(JE+11).NE.0.AND.(IDDAT(JE+13).EQ.0.OR.               INE10     134
     *       ABS(DDAT(JE+12)-DDAT(JE+13)).LT.1.0E-4))                   INE10     135
      IF (DDAT(JE+3).LT.TMIN.AND.IDDAT(JE+3).NE.0.AND.LTIME) THEN       INE10     136
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE10     137
     *                     ,NDGC(N)                                     INE10     138
         WRITE(MSG(2),9020) 'TA',DDAT(JE+3),TMIN                        INE10     139
         IF(MTFLAG.EQ.0) THEN                                           INE10     140
            CALL PRTMSG(2)                                              INE10     141
         ELSE                                                           INE10     142
         WRITE(MSG(3),9030) 'TA',TMIN                                   INE10     143
         CALL PRTMSG(3)                                                 INE10     144
         DDAT(JE+3)=TMIN                                                INE10     145
         ENDIF                                                          INE10     146
      ELSE IF (DDAT(JE+3).LT.TMIN.AND.IDDAT(JE+3).NE.0.AND.             INE10     147
     *         .NOT.LTIME) THEN                                         INE10     148
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE10     149
     *                     ,NDGC(N)                                     INE10     150
         WRITE(MSG(2),9020) 'TA',DDAT(JE+3),TMIN                        INE10     151
         IF(MTFLAG.EQ.0) THEN                                           INE10     152
            CALL PRTMSG(2)                                              INE10     153
         ELSE                                                           INE10     154
         WRITE(MSG(3),9030) 'TA',0.0                                    INE10     155
         CALL PRTMSG(3)                                                 INE10     156
         DDAT(JE+3)=0.0                                                 INE10     157
         ENDIF                                                          INE10     158
      ELSE IF (IDDAT(JE+3).EQ.0.AND.LTIME) THEN                         INE10     159
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE10     160
     *                     ,NDGC(N)                                     INE10     161
         WRITE(MSG(2),9040)                                             INE10     162
         IF(MTFLAG.EQ.0) THEN                                           INE10     163
            CALL PRTMSG(2)                                              INE10     164
         ELSE                                                           INE10     165
         WRITE(MSG(3),9045) TMIN                                        INE10     166
         CALL PRTMSG(3)                                                 INE10     167
         DDAT(JE+3)=TMIN                                                INE10     168
         ENDIF                                                          INE10     169
      ENDIF                                                             INE10     170
C                                                                       INE10     171
      IF(DDAT(JE+18).LT.TMIN.AND.IDDAT(JE+18).NE.0)THEN                 INE10     172
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE10     173
     *                     ,NDGC(N)                                     INE10     174
         WRITE(MSG(2),9020) 'TR',DDAT(JE+18),TMIN                       INE10     175
         IF(MTFLAG.EQ.0) THEN                                           INE10     176
            CALL PRTMSG(2)                                              INE10     177
         ELSE                                                           INE10     178
         WRITE(MSG(3),9030) 'TR',0.0                                    INE10     179
         CALL PRTMSG(3)                                                 INE10     180
         DDAT(JE+18)=0.0                                                INE10     181
         ENDIF                                                          INE10     182
      ENDIF                                                             INE10     183
C                                                                       INE10     184
      IF (IDDAT(JE+16).EQ.0.AND.IDDAT(JE+17).EQ.0) THEN                 INE10     185
         DDAT(JE+16)=BIG                                                INE10     186
         DDAT(JE+17)=-BIG                                               INE10     187
      ENDIF                                                             INE10     188
      IF (IDDAT(JE+8).NE.0)THEN                                         INE10     189
      CALL EXSATF                                                       INE10     190
      ENDIF                                                             INE10     191
C                                                                       INE10     192
C     IDDAT(JE+21) THROUGH IDDAT(JE+23) ARE USED FOR SUBSCRIPTS         INE10     193
C     OF OPTIONAL BLOCK S                                               INE10     194
C                                                                       INE10     195
      IDDAT(JE+21)=0                                                    INE10     196
      IDDAT(JE+22)=0                                                    INE10     197
      IDDAT(JE+23)=0                                                    INE10     198
C                                                                       INE10     199
      VE=EFDN                                                           INE10     200
C                                                                       INE10     201
C   EXCITER SATURATION BLOCK FOR TYPE 10                                INE10     202
C                                                                       INE10     203
      SE=DDAT(JE+6)*EXP(DDAT(JE+7)*VE)/VE                               INE10     204
      SEKX=VE*(SE+DDAT(JE+4))                                           INE10     205
C                                                                       INE10     206
      VR=SEKX                                                           INE10     207
      IF (VR.GT.DDAT(JE+16).OR.VR.LT.DDAT(JE+17)) THEN                  INE10     208
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE10     209
     *                     ,NDGC(N)                                     INE10     210
         WRITE(MSG(2),1630)                                             INE10     211
         WRITE(MSG(3),1640) VR,DDAT(JE+16),DDAT(JE+17)                  INE10     212
         CALL PRTMSG(3)                                                 INE10     213
      ENDIF                                                             INE10     214
C                                                                       INE10     215
      XSTATE(JSTATE+3)=VR                                               INE10     216
C                                                                       INE10     217
      XDFACT(JSTATE+3)=DDAT(JE+2)                                       INE10     218
C                                                                       INE10     219
      NXS=3                                                             INE10     220
      IF (IDDAT(JE+15).NE.0) THEN                                       INE10     221
         NXS=NXS+1                                                      INE10     222
         XSTATE(JSTATE+NXS)=VR                                          INE10     223
         IDDAT(JE+21)=JSTATE+NXS-NSTATE                                 INE10     224
      ENDIF                                                             INE10     225
      IF (IDDAT(JE+11).NE.0) THEN                                       INE10     226
         NXS=NXS+1                                                      INE10     227
         XSTATE(JSTATE+NXS)=VR                                          INE10     228
         IDDAT(JE+22)=JSTATE+NXS-NSTATE                                 INE10     229
      ENDIF                                                             INE10     230
      IF (IDDAT(JE+13).NE.0) THEN                                       INE10     231
         NXS=NXS+1                                                      INE10     232
         XSTATE(JSTATE+NXS)=VR/DDAT(JE+2)                               INE10     233
         IDDAT(JE+23)=JSTATE+NXS-NSTATE                                 INE10     234
      ENDIF                                                             INE10     235
      XSTATE(JSTATE+2)=VE                                               INE10     236
      VREF(JYE+2)=XSTATE(JSTATE+1)+VR/DDAT(JE+2)                        INE10     237
      VRFIN(JYE+3)=VR                                                   INE10     238
C                                                                       INE10     239
      IF(LDEB)THEN                                                      INE10     240
      WRITE(IUD6,1010) (DDAT(JE+L),L=1,22)                              INE10     241
      WRITE(IUD6,1020) (XSTATE(JSTATE+L),L=1,NXS)                       INE10     242
      ENDIF                                                             INE10     243
C                                                                       INE10     244
      JSTATE=JSTATE+NXS                                                 INE10     245
      JY=JY+3                                                           INE10     246
C                                                                       INE10     247
C     DETERMINE THE LARGEST TIME STEP PERMITTED                         INE10     248
C                                                                       INE10     249
      TMAX=99.0                                                         INE10     250
      IF (IDDAT(JE+10).NE.0.AND.IDDAT(JE+11).NE.0) THEN                 INE10     251
         IDDAT(JE+24)=1                                                 INE10     252
         TMAX=DDAT(JE+11)/DDAT(JE+2)/DDAT(JE+10)                        INE10     253
         IF (IDDAT(JE+13).NE.0) THEN                                    INE10     254
            TMAX=TMAX*DDAT(JE+13)                                       INE10     255
            IF (IDDAT(JE+12).NE.0) TMAX=TMAX/(1.0+DDAT(JE+12))          INE10     256
         END IF                                                         INE10     257
         IF (IDDAT(JE+15).NE.0) THEN                                    INE10     258
            TMAX=TMAX*DDAT(JE+15)                                       INE10     259
            IF (IDDAT(JE+14).NE.0) TMAX=TMAX/(1.0+DDAT(JE+14))          INE10     260
         END IF                                                         INE10     261
         IF (IDDAT(JE+3).NE.0) THEN                                     INE10     262
            TMAX=TMAX*DDAT(JE+3)                                        INE10     263
         END IF                                                         INE10     264
         IF (TMAX.LT.DTMIN) TMAX=DTMIN                                  INE10     265
      ELSE                                                              INE10     266
         IDDAT(JE+24)=1                                                 INE10     267
      ENDIF                                                             INE10     268
      DDAT(JE+25)=TMAX                                                  INE10     269
C**                                                                     INE10     270
C                                                                       INE10     271
 9000 FORMAT(' *** WARNING GENERATOR AT BUS: ',I5,' STATION: ',3A4      INE10     272
     *,' GID:',A4)                                                      INE10     273
 1010 FORMAT(1X,'INE34-DB:DDAT ',/,(10X,10G12.5))                       INE10     274
 1020 FORMAT(1X,'INE34-DB:XSTATE ',10G12.5)                             INE10     275
 1630 FORMAT(5X,'VR-X2 VIOLATES LIMITS:')                               INE10     276
 1640 FORMAT(5X,'VR = ',G12.5,' VRMAX = ',G12.5,' VRMIN = ',G12.5)      INE10     277
 9020 FORMAT(5X,'TYPE 10 EXCITER ',A,'=',F8.6                           INE10     278
     *,' IS BELOW THE LIMIT VALUE OF ',F4.2)                            INE10     279
 9030 FORMAT(5X,A,' HAS BEEN SET TO ',F4.2)                             INE10     280
 9040 FORMAT(5X,'TA CAN NOT BE ZERO IF TB IS ZERO AND RATE FEEDBACK',   INE10     281
     *' EXISTS')                                                        INE10     282
 9045 FORMAT(5X,'TA HAS BEEN SET TO ',F4.2)                             INE10     283
 9050 FORMAT(5X,'TYPE 10 EXCITER  TE=',F8.6                             INE10     284
     *,' IS LESS THAN OR EQUAL TO ZERO.')                               INE10     285
C                                                                       INE10     286
      RETURN                                                            INE10     287
C                                                                       INE10     288
      END                                                               INE10     289
