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