CFPRIME INE9                                                            INE9        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 INE9                                                   INE9        3
CD                                                                      INE9        4
CD    TO PERFORM INITIALIZATION AND DATA CHECK FOR EXCITER TYPE 9.      INE9        5
CD                                                                      INE9        6
CD    THE DATA STRUCTURE AFTER THE INITIALIZATION IS GIVEN BELOW.       INE9        7
CD                                                                      INE9        8
CD   3.8 Exciter type 9                                                 INE9        9
CD                                                                      INE9       10
CD     Exciter data                                                     INE9       11
CD                                                                      INE9       12
CD     IDDAT(JE+ 1)   = IVTN         : sensing bus number               INE9       13
CD     DDAT(JE+ 2)    = (reserved for future use)                       INE9       14
CD     DDAT(JE+ 3)    = (reserved for future use)                       INE9       15
CD     DDAT(JE+ 4)    = KE                                              INE9       16
CD     DDAT(JE+ 5)    = TE                                              INE9       17
CD     DDAT(JE+ 6)    = SE(VSAT) or AEX                                 INE9       18
CD     DDAT(JE+ 7)    = SE(0.75VSAT) or BEX                             INE9       19
CD     DDAT(JE+ 8)    = VSAT                                            INE9       20
CD     DDAT(JE+ 9)    = (reserved for future use)                       INE9       21
CD     DDAT(JE+10)    = KV                                              INE9       22
CD     DDAT(JE+11)    = TRH                                             INE9       23
CD     DDAT(JE+12)    = (reserved for future use)                       INE9       24
CD     DDAT(JE+13)    = (reserved for future use)                       INE9       25
CD     DDAT(JE+14)    = VRMAX                                           INE9       26
CD     DDAT(JE+15)    = VRMIN                                           INE9       27
CD     DDAT(JE+16)    = (reserved for future use)                       INE9       28
CD     DDAT(JE+17)    = (reserved for future use)                       INE9       29
CD     DDAT(JE+18)    = TR                                              INE9       30
CD     DDAT(JE+19)    = RC                                              INE9       31
CD     DDAT(JE+20)    = XC                                              INE9       32
CD                                                                      INE9       33
CD     Exciter states                                                   INE9       34
CD                                                                      INE9       35
CD     XSTATE(JES+1)  = TR block     : compulsory                       INE9       36
CD     XSTATE(JES+2)  = TRH block    : compulsory                       INE9       37
CD     XSTATE(JES+3)  = TE block     : compulsory                       INE9       38
CD                                                                      INE9       39
CD     Exciter Y-variables                                              INE9       40
CD                                                                      INE9       41
CD     VREG(JYE+1)    = VC (input to the TR block)                      INE9       42
CD     VREF(JYE+2)    = reference value                                 INE9       43
CD                                                                      INE9       44
      INCLUDE 'PARX.INS'                                                INE9       45
      INCLUDE 'CNMDAT.INS'                                              INE9       46
      INCLUDE 'CNMSTA.INS'                                              INE9       47
      INCLUDE 'CNXSTA.INS'                                              INE9       48
      INCLUDE 'CNB8.INS'                                                INE9       49
      INCLUDE 'CNB19.INS'                                               INE9       50
      INCLUDE 'CNEXC.INS'                                               INE9       51
      INCLUDE 'CNMYVA.INS'                                              INE9       52
      INCLUDE 'CNYVAR.INS'                                              INE9       53
      INCLUDE 'CNUNIT.INS'                                              INE9       54
      INCLUDE 'CNSTN.INS'                                               INE9       55
      INCLUDE 'CNB1.INS'                                                INE9       56
      INCLUDE 'CNB4.INS'                                                INE9       57
      INCLUDE 'CNMSG.INS'                                               INE9       58
C                                                                       INE9       59
C                                                                       INE9       60
C   IEXN = 9                                                            INE9       61
C                                                                       INE9       62
C                                                                       INE9       63
C  INPUT TIME CONSTANTS CHECK AND RESET                                 INE9       64
C                                                                       INE9       65
      IF(DDAT(JE+5).LT.TMIN)THEN                                        INE9       66
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE9       67
     *                     ,NDGC(N)                                     INE9       68
         WRITE(MSG(2),9020)                                             INE9       69
         IF(MTFLAG.EQ.0) THEN                                           INE9       70
            WRITE(MSG(3),9030) 'TE',DDAT(JE+5),TMIN                     INE9       71
         ELSE                                                           INE9       72
            WRITE(MSG(3),9030) 'TE',DDAT(JE+5),TMIN,'TE',TMIN           INE9       73
            DDAT(JE+5)=TMIN                                             INE9       74
         ENDIF                                                          INE9       75
         CALL PRTMSG(3)                                                 INE9       76
      ENDIF                                                             INE9       77
C                                                                       INE9       78
      RCHECK=DDAT(JE+10)*DDAT(JE+11)                                    INE9       79
      IF(RCHECK.LT.TMIN)THEN                                            INE9       80
         IF(IDDAT(JE+10).EQ.0)THEN                                      INE9       81
            WRITE(MSG(1),9040) NLF,INAME(KN-2),INAME(KN-1)              INE9       82
     *            ,INAME(KN),NDGC(N)                                    INE9       83
            WRITE(MSG(2),9050)                                          INE9       84
            CALL PRTMSG(2)                                              INE9       85
            MSG(1)='EXCITER DATA ERROR'                                 INE9       86
            CALL ASTOP(MSG(1),18)                                       INE9       87
         ENDIF                                                          INE9       88
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE9       89
     *                     ,NDGC(N)                                     INE9       90
         WRITE(MSG(2),9020)                                             INE9       91
         IF(MTFLAG.EQ.0) THEN                                           INE9       92
            WRITE(MSG(3),9030) 'KV*TRH',RCHECK,TMIN                     INE9       93
         ELSE                                                           INE9       94
            WRITE(MSG(3),9030) 'KV*TRH',RCHECK,TMIN,'TRH'               INE9       95
     *         ,TMIN/DDAT(JE+10)                                        INE9       96
            DDAT(JE+11)=TMIN/DDAT(JE+10)                                INE9       97
         ENDIF                                                          INE9       98
         CALL PRTMSG(3)                                                 INE9       99
      ENDIF                                                             INE9      100
C                                                                       INE9      101
      IF(DDAT(JE+18).LT.TMIN.AND.IDDAT(JE+18).NE.0)THEN                 INE9      102
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE9      103
     *                     ,NDGC(N)                                     INE9      104
         WRITE(MSG(2),9020)                                             INE9      105
         IF(MTFLAG.EQ.0) THEN                                           INE9      106
            WRITE(MSG(3),9030) 'TR',DDAT(JE+18),TMIN                    INE9      107
         ELSE                                                           INE9      108
            WRITE(MSG(3),9030) 'TR',DDAT(JE+18),TMIN,'TR',0.0           INE9      109
            DDAT(JE+18)=0.0                                             INE9      110
         ENDIF                                                          INE9      111
         CALL PRTMSG(3)                                                 INE9      112
      ENDIF                                                             INE9      113
C                                                                       INE9      114
C   DATA PREPARATION AND INPUT DATA PRINTOUT                            INE9      115
C                                                                       INE9      116
      IF(IDDAT(JE+8).NE.0)CALL EXSATF                                   INE9      117
C                                                                       INE9      118
      VE=EFDN                                                           INE9      119
      IF (IDDAT(JE+4).EQ.0) THEN                                        INE9      120
         CALL CALKE1(SE)                                                INE9      121
      ELSE                                                              INE9      122
         SE=DDAT(JE+6)*EXP(DDAT(JE+7)*VE)/VE                            INE9      123
      END IF                                                            INE9      124
C                                                                       INE9      125
C   EXCITER SATURATION BLOCK                                            INE9      126
C                                                                       INE9      127
      SEKX=VE*(SE+DDAT(JE+4))                                           INE9      128
C                                                                       INE9      129
C  IEX = 9                                                              INE9      130
C                                                                       INE9      131
      XSTATE(JSTATE+2)=SEKX                                             INE9      132
      XSTATE(JSTATE+3)=VE                                               INE9      133
      VREF(JYE+2)=XSTATE(JSTATE+1)                                      INE9      134
C                                                                       INE9      135
C     IDDAT(JE+21) IS THE FLAG FOR DISCONTINUITY STATUS                 INE9      136
C                                                                       INE9      137
      IDDAT(JE+21)=1                                                    INE9      138
C                                                                       INE9      139
      JSTATE=JSTATE+3                                                   INE9      140
      JY=JY+2                                                           INE9      141
C                                                                       INE9      142
      IF(SEKX.GT.DDAT(JE+14).OR.SEKX.LT.DDAT(JE+15))THEN                INE9      143
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INE9      144
     *                     ,NDGC(N)                                     INE9      145
         WRITE(MSG(2),9200)                                             INE9      146
         WRITE(MSG(3),9210) SEKX,DDAT(JE+14),DDAT(JE+15)                INE9      147
         CALL PRTMSG(3)                                                 INE9      148
      ENDIF                                                             INE9      149
C                                                                       INE9      150
      RETURN                                                            INE9      151
 9000 FORMAT(' *** WARNING GENERATOR AT BUS: ',I5,' STATION: ',3A4      INE9      152
     *,' GID:',A4)                                                      INE9      153
 9020 FORMAT(5X,'TYPE 9 EXCITER (WSCC TYPE FE, IEEE TYPE DC3A)')        INE9      154
 9030 FORMAT(5X,A,'=',F8.6,' IS BELOW THE LIMIT VALUE OF',F5.2,:,2X,A   INE9      155
     *,' HAS BEEN SET TO',F11.6)                                        INE9      156
 9040 FORMAT(' *** DATA ERROR GENERATOR AT BUS: ',I5,' STATION: '       INE9      157
     *,3A4,' GID:',A4)                                                  INE9      158
 9050 FORMAT(5X,'TYPE 9 EXCITER (WSCC TYPE FE, IEEE TYPE DC3A)  KV=0.0')INE9      159
 9200 FORMAT(5X,'TYPE 9 EXCITER (WSCC TYPE FE, IEEE TYPE DC3A)  VRH-X2' INE9      160
     *,' VIOLATES LIMITS:')                                             INE9      161
 9210 FORMAT(5X,'VRH = ',G12.5,' VRMAX = ',G12.5,' VRMIN = ',G12.5)     INE9      162
C                                                                       INE9      163
      END                                                               INE9      164
