CFPRIME INGV08                                                          INGV08      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 INGV08                                                 INGV08      3
CD                                                                      INGV08      4
CD    TO PERFORM INITIALIZATION AND DATA CHECK FOR GOVERNOR TYPE 8.     INGV08      5
CD                                                                      INGV08      6
CD    THE DATA STRUCTURE AFTER THE INITIALIZATION IS GIVEN BELOW.       INGV08      7
CD                                                                      INGV08      8
CD   9.6 Prime-mover turbine-governor model type 8                      INGV08      9
CD                                                                      INGV08     10
CD     Governor data                                                    INGV08     11
CD                                                                      INGV08     12
CD     DDAT(JGG+ 1)   = K1                                              INGV08     13
CD     DDAT(JGG+ 2)   = T1                                              INGV08     14
CD     DDAT(JGG+ 3)   = T2                                              INGV08     15
CD     DDAT(JGG+ 4)   = T3                                              INGV08     16
CD     DDAT(JGG+ 5)   = PMAX                                            INGV08     17
CD     DDAT(JGG+ 6)   = VMIN                                            INGV08     18
CD     DDAT(JGG+ 7)   = T4                                              INGV08     19
CD     DDAT(JGG+ 8)   = T5                                              INGV08     20
CD     DDAT(JGG+ 9)   = T6                                              INGV08     21
CD                                                                      INGV08     22
CD     Governor states                                                  INGV08     23
CD                                                                      INGV08     24
CD     XSTATE(JPS+ 1) = T1 block                    : compulsory        INGV08     25
CD     XSTATE(JPS+ 2) = T3 block                    : compulsory        INGV08     26
CD     XSTATE(JPS+ 3) = T4 block                    : compulsory        INGV08     27
CD     XSTATE(JPS+ 4) = T5 block                    : compulsory        INGV08     28
CD                                                                      INGV08     29
CD     Governor Y-variables                                             INGV08     30
CD                                                                      INGV08     31
CD     XLDREF(JYP+1)  = load reference signal                           INGV08     32
CD                                                                      INGV08     33
      INCLUDE 'PARX.INS'                                                INGV08     34
      INCLUDE 'CNB1.INS'                                                INGV08     35
      INCLUDE 'CNB3.INS'                                                INGV08     36
      INCLUDE 'CNB4.INS'                                                INGV08     37
      INCLUDE 'CNB8.INS'                                                INGV08     38
      INCLUDE 'CNB10.INS'                                               INGV08     39
      INCLUDE 'CNB19.INS'                                               INGV08     40
      INCLUDE 'CNPARX.INS'                                              INGV08     41
      INCLUDE 'CNXSTA.INS'                                              INGV08     42
      INCLUDE 'CNMDAT.INS'                                              INGV08     43
      INCLUDE 'CNMSTA.INS'                                              INGV08     44
      INCLUDE 'CNEXC.INS'                                               INGV08     45
      INCLUDE 'CNSTN.INS'                                               INGV08     46
      INCLUDE 'CNMYVA.INS'                                              INGV08     47
      INCLUDE 'CNYVAR.INS'                                              INGV08     48
      INCLUDE 'CNUNIT.INS'                                              INGV08     49
      INCLUDE 'CNPRGV.INS'                                              INGV08     50
      INCLUDE 'CNMSG.INS'                                               INGV08     51
C                                                                       INGV08     52
C   TYPE 8                                                              INGV08     53
C                                                                       INGV08     54
C                                                                       INGV08     55
C  INPUT TIME CONSTANTS CHECK AND RESET                                 INGV08     56
C                                                                       INGV08     57
      IF(DDAT(JGG+2).LT.TMIN.AND.IDDAT(JGG+4).NE.0)THEN                 INGV08     58
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),                INGV08     59
     *    INAME(KN),NDGC(N)                                             INGV08     60
         WRITE(MSG(2),9020) 'T1',DDAT(JGG+2)                            INGV08     61
         IF(MTFLAG.EQ.0) THEN                                           INGV08     62
            WRITE(MSG(3),9030) TMIN                                     INGV08     63
         ELSE                                                           INGV08     64
            WRITE(MSG(3),9030) TMIN,'T1',0.0                            INGV08     65
            DDAT(JGG+2)=0.0                                             INGV08     66
         ENDIF                                                          INGV08     67
         CALL PRTMSG(3)                                                 INGV08     68
      ENDIF                                                             INGV08     69
C                                                                       INGV08     70
      IF(DDAT(JGG+4).LT.TMIN.AND.IDDAT(JGG+4).NE.0)THEN                 INGV08     71
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),                INGV08     72
     *    INAME(KN),NDGC(N)                                             INGV08     73
         WRITE(MSG(2),9020) 'T3',DDAT(JGG+4)                            INGV08     74
         IF(MTFLAG.EQ.0) THEN                                           INGV08     75
            WRITE(MSG(3),9030) TMIN                                     INGV08     76
         ELSE                                                           INGV08     77
            WRITE(MSG(3),9030) TMIN,'T3',0.0                            INGV08     78
            DDAT(JGG+4)=0.0                                             INGV08     79
         ENDIF                                                          INGV08     80
         CALL PRTMSG(3)                                                 INGV08     81
      ENDIF                                                             INGV08     82
C                                                                       INGV08     83
      IF(DDAT(JGG+7).LT.TMIN.AND.IDDAT(JGG+7).NE.0)THEN                 INGV08     84
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),                INGV08     85
     *    INAME(KN),NDGC(N)                                             INGV08     86
         WRITE(MSG(2),9020) 'T4',DDAT(JGG+7)                            INGV08     87
         IF(MTFLAG.EQ.0) THEN                                           INGV08     88
            WRITE(MSG(3),9030) TMIN                                     INGV08     89
         ELSE                                                           INGV08     90
            WRITE(MSG(3),9030) TMIN,'T4',0.0                            INGV08     91
            DDAT(JGG+7)=0.0                                             INGV08     92
         ENDIF                                                          INGV08     93
         CALL PRTMSG(3)                                                 INGV08     94
      ENDIF                                                             INGV08     95
C                                                                       INGV08     96
      IF(DDAT(JGG+8).LT.TMIN.AND.IDDAT(JGG+8).NE.0)THEN                 INGV08     97
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),                INGV08     98
     *    INAME(KN),NDGC(N)                                             INGV08     99
         WRITE(MSG(2),9020) 'T5',DDAT(JGG+8)                            INGV08    100
         IF(MTFLAG.EQ.0) THEN                                           INGV08    101
            WRITE(MSG(3),9030) TMIN                                     INGV08    102
         ELSE                                                           INGV08    103
            WRITE(MSG(3),9030) TMIN,'T5',0.0                            INGV08    104
            DDAT(JGG+8)=0.0                                             INGV08    105
         ENDIF                                                          INGV08    106
         CALL PRTMSG(3)                                                 INGV08    107
      ENDIF                                                             INGV08    108
C                                                                       INGV08    109
      BASPRN=DDAT(JG+3)/BASPC                                           INGV08    110
      DDAT(JGG+5)=DDAT(JGG+5)*BASPRN                                    INGV08    111
      NXS=4                                                             INGV08    112
C                                                                       INGV08    113
C   STATE AND REFERENCE SIGNAL INITIALIZATION                           INGV08    114
C                                                                       INGV08    115
      PMX=TIN(JYG+1)/DDAT(JGG+5)                                        INGV08    116
      XSTATE(JSTATE+4)=PMX                                              INGV08    117
      XSTATE(JSTATE+3)=PMX                                              INGV08    118
      XSTATE(JSTATE+2)=PMX                                              INGV08    119
      XSTATE(JSTATE+1)=0.0                                              INGV08    120
C                                                                       INGV08    121
      XLDREF(JYP+1)=PMX                                                 INGV08    122
C                                                                       INGV08    123
      IF (XSTATE(JSTATE+2).GT.1.0) THEN                                 INGV08    124
         KX=2                                                           INGV08    125
         XMAX=1.0                                                       INGV08    126
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),                INGV08    127
     *    INAME(KN),NDGC(N)                                             INGV08    128
         WRITE(MSG(2),9100)                                             INGV08    129
         WRITE(MSG(3),9110) KX,XSTATE(JSTATE+KX),XMAX                   INGV08    130
         CALL PRTMSG(3)                                                 INGV08    131
      ENDIF                                                             INGV08    132
      IF (XSTATE(JSTATE+1).LT.DDAT(JGG+6)) THEN                         INGV08    133
         KX=2                                                           INGV08    134
         XMIN=DDAT(JGG+6)                                               INGV08    135
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),                INGV08    136
     *    INAME(KN),NDGC(N)                                             INGV08    137
         WRITE(MSG(2),9200)                                             INGV08    138
         WRITE(MSG(3),9110) KX,XSTATE(JSTATE+KX),XMIN                   INGV08    139
         CALL PRTMSG(3)                                                 INGV08    140
      ENDIF                                                             INGV08    141
C                                                                       INGV08    142
      JSTATE=JSTATE+NXS                                                 INGV08    143
      MSTATE(6,N)=JSTATE                                                INGV08    144
      JY=JY+1                                                           INGV08    145
      RETURN                                                            INGV08    146
C                                                                       INGV08    147
 9000 FORMAT(' *** WARNING GENERATOR AT BUS: ',I5,' STATION: ',3A4      INGV08    148
     *,' GID:',A4)                                                      INGV08    149
 9100 FORMAT(5X,'TYPE 8 (WSCC TYPE GG) GOVERNOR INITIAL CONDITION'      INGV08    150
     *,' VIOLATES UPPER LIMIT:')                                        INGV08    151
 9110 FORMAT(5X,'STATE NO =',I3,' STATE =',G12.5,' LIMIT =',G12.5)      INGV08    152
 9020 FORMAT(5X,'TYPE 8 (WSCC TYPE GG) GOVERNOR ',A,'=',F8.6            INGV08    153
     *,' IS BELOW THE LIMIT VALUE')                                     INGV08    154
 9030 FORMAT(5X,'OF',F5.2,'. ',:,A,' HAS BEEN SET TO ',F4.2)            INGV08    155
 9200 FORMAT(5X,'TYPE 8 (WSCC TYPE GG) GOVERNOR INITIAL CONDITION'      INGV08    156
     *,' VIOLATES LOWER LIMIT:')                                        INGV08    157
C                                                                       INGV08    158
      END                                                               INGV08    159
