CFPRIME IEOHGV                                                          IEOHGV      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 IEOHGV (EXG,IEXG,IGEN,JGOV,DAT,NLF,NGRI)               IEOHGV      3
CD                                                                      IEOHGV      4
CD    TO CONVERT IEEE GOVERNOR MODELS TO EPRI(NEW) MODELS.              IEOHGV      5
CD                                                                      IEOHGV      6
      INCLUDE 'PARX.INS'                                                IEOHGV      7
      INCLUDE 'CNUNIT.INS'                                              IEOHGV      8
      INCLUDE 'CNMSG.INS'                                               IEOHGV      9
      INCLUDE 'CNFLAG.INS'                                              IEOHGV     10
C                                                                       IEOHGV     11
      CHARACTER*80 DAT(4)                                               IEOHGV     12
      CHARACTER*12 AGV12,AGV16                                          IEOHGV     13
      CHARACTER*4 NGRI,ALPID,AHPID                                      IEOHGV     14
      DIMENSION EXG(*),IEXG(*)                                          IEOHGV     15
      EQUIVALENCE (ALPID,ILPID)                                         IEOHGV     16
      LDEB=(JDEB(105).NE.0)                                             IEOHGV     17
C                                                                       IEOHGV     18
      CALL FMOVE (0,EXG,EXG,J9V1D)                                      IEOHGV     19
C                                                                       IEOHGV     20
      READ(DAT(1),1000) IHPBS,AGV12,AHPID,MGV14,ILPBS,AGV16,ALPID       IEOHGV     21
      READ(DAT(2),1010) FGV21,FGV22,FGV23,FGV24,FGV25,FGV26,FGV27       IEOHGV     22
      READ(DAT(3),1010) FGV31,FGV32,FGV33,FGV34,FGV35,FGV36,FGV37       IEOHGV     23
      IF (MGV14.LT.3)                                                   IEOHGV     24
     1  READ(DAT(3),1010) FGV41,FGV42,FGV43,FGV44,FGV45,FGV46,FGV47     IEOHGV     25
      IF (LDEB) THEN                                                    IEOHGV     26
        WRITE(IUD6,2010)                                                IEOHGV     27
        WRITE(IUD6,1000) IHPBS,AGV12,AHPID,MGV14,ILPBS,AGV16,ALPID      IEOHGV     28
        WRITE(IUD6,1010) FGV21,FGV22,FGV23,FGV24,FGV25,FGV26,FGV27      IEOHGV     29
        WRITE(IUD6,1010) FGV31,FGV32,FGV33,FGV34,FGV35,FGV36,FGV37      IEOHGV     30
        IF (MGV14.LT.3)                                                 IEOHGV     31
     1    WRITE(IUD6,1010) FGV41,FGV42,FGV43,FGV44,FGV45,FGV46,FGV47    IEOHGV     32
      ENDIF                                                             IEOHGV     33
C                                                                       IEOHGV     34
      IF (MGV14.EQ.1) THEN                                              IEOHGV     35
         IF(NLF.EQ.IHPBS.AND.NGRI.EQ.AHPID) THEN                        IEOHGV     36
           JGOV =4                                                      IEOHGV     37
           EXG(1) = FGV21/FGV31                                         IEOHGV     38
           EXG(2) = FGV22                                               IEOHGV     39
           EXG(3) = FGV23                                               IEOHGV     40
           EXG(4) = FGV24                                               IEOHGV     41
           EXG(5) = FGV25                                               IEOHGV     42
           EXG(6) = FGV26                                               IEOHGV     43
           EXG(7) = FGV31                                               IEOHGV     44
           EXG(9) = FGV33                                               IEOHGV     45
           EXG(8) = 0.0                                                 IEOHGV     46
           EXG(10) = FGV34                                              IEOHGV     47
           EXG(11) = FGV35                                              IEOHGV     48
           EXG(12) = FGV36                                              IEOHGV     49
           EXG(13) = FGV37                                              IEOHGV     50
           EXG(14) = FGV42                                              IEOHGV     51
           EXG(15) = FGV44                                              IEOHGV     52
           EXG(16) = 0.0                                                IEOHGV     53
           IF(ILPBS.NE.0)THEN                                           IEOHGV     54
             IF(IGEN.EQ.0)THEN                                          IEOHGV     55
               IGEN=4                                                   IEOHGV     56
             ELSE                                                       IEOHGV     57
               IGEN=7                                                   IEOHGV     58
             ENDIF                                                      IEOHGV     59
             IEXG(1)=ILPBS                                              IEOHGV     60
             IEXG(2)=ILPID                                              IEOHGV     61
           ENDIF                                                        IEOHGV     62
         ELSE                                                           IEOHGV     63
           JGOV=5                                                       IEOHGV     64
           EXG(17) = FGV43                                              IEOHGV     65
           EXG(18) = FGV45                                              IEOHGV     66
           EXG(19) = FGV47                                              IEOHGV     67
         ENDIF                                                          IEOHGV     68
         WRITE(MSG(1),2030)                                             IEOHGV     69
         WRITE(MSG(2),2021)                                             IEOHGV     70
         WRITE(MSG(3),2031) FGV46                                       IEOHGV     71
         WRITE(MSG(4),2032) FGV41                                       IEOHGV     72
         CALL PRTMSG(4)                                                 IEOHGV     73
         GOTO 990                                                       IEOHGV     74
      ENDIF                                                             IEOHGV     75
C                                                                       IEOHGV     76
      IF (MGV14.EQ.2) THEN                                              IEOHGV     77
         JGOV = 22                                                      IEOHGV     78
         EXG(1) = FGV31                                                 IEOHGV     79
         EXG(2) = FGV31/FGV21                                           IEOHGV     80
         EXG(3) = FGV22                                                 IEOHGV     81
         EXG(4) = FGV23                                                 IEOHGV     82
         EXG(5) = FGV24                                                 IEOHGV     83
         EXG(6) = 0.0                                                   IEOHGV     84
         EXG(7) = 1.0                                                   IEOHGV     85
         EXG(8) = FGV32/FGV31                                           IEOHGV     86
         EXG(9) = FGV33                                                 IEOHGV     87
         EXG(10) = -2.0                                                 IEOHGV     88
         EXG(11) = 3.0                                                  IEOHGV     89
         GOTO 990                                                       IEOHGV     90
      ENDIF                                                             IEOHGV     91
C                                                                       IEOHGV     92
      IF (MGV14.EQ.3) THEN                                              IEOHGV     93
         JGOV = 21                                                      IEOHGV     94
         EXG(1) = 1.0                                                   IEOHGV     95
         EXG(2) = FGV23                                                 IEOHGV     96
         EXG(3) = FGV21                                                 IEOHGV     97
         EXG(4) = FGV22                                                 IEOHGV     98
         EXG(5) = FGV27                                                 IEOHGV     99
         EXG(6) = FGV24                                                 IEOHGV    100
         EXG(7) = FGV31                                                 IEOHGV    101
         EXG(8) = FGV32                                                 IEOHGV    102
         EXG(9) = FGV37                                                 IEOHGV    103
         EXG(10)= FGV25                                                 IEOHGV    104
         EXG(11)= FGV26                                                 IEOHGV    105
         WRITE(MSG(1),2020)                                             IEOHGV    106
         WRITE(MSG(2),2021)                                             IEOHGV    107
         WRITE(MSG(3),2022) FGV33                                       IEOHGV    108
         WRITE(MSG(4),2023) FGV34                                       IEOHGV    109
         WRITE(MSG(5),2024) FGV35                                       IEOHGV    110
         WRITE(MSG(6),2025) FGV36                                       IEOHGV    111
         CALL PRTMSG(6)                                                 IEOHGV    112
         GOTO 990                                                       IEOHGV    113
      ENDIF                                                             IEOHGV    114
C                                                                       IEOHGV    115
C      TRANSLATION NOT POSSIBLE SET JGOV=0 AND WRITE WARNING MESSAGE    IEOHGV    116
C                                                                       IEOHGV    117
       JGOV=0                                                           IEOHGV    118
       MSG(1)=' *** WARNING NO TRANSLATION FOR GOVERNOR'                IEOHGV    119
       WRITE(MSG(2),2000) IHPBS,AGV12,AHPID                             IEOHGV    120
       CALL PRTMSG(2)                                                   IEOHGV    121
C                                                                       IEOHGV    122
 990   CONTINUE                                                         IEOHGV    123
       RETURN                                                           IEOHGV    124
C                                                                       IEOHGV    125
 1000 FORMAT(T2,I4,T7,A12,T20,A4,T25,I2,T28,I4,T33,A12,T46,A4)          IEOHGV    126
 1010 FORMAT(5X,7F10.4)                                                 IEOHGV    127
 2000 FORMAT(14X,'AT BUS NO ',I4,' BUS NAME ',A12,' UNIT ID ',A4)       IEOHGV    128
 2010 FORMAT(1X,'% DEBUG(IEOHGV) GOVERNOR :')                           IEOHGV    129
 2020 FORMAT(' *** WARNING IEEE TYPE-3 SPEED GOVERNING SYSTEM')         IEOHGV    130
 2021 FORMAT(14X,'CONVERTED WITH FOLLOWING CONSRAINTS:')                IEOHGV    131
 2022 FORMAT(14X,'IEEE A11=',F10.5,'  CONVERTED TO A11=0.5')            IEOHGV    132
 2023 FORMAT(14X,'IEEE A13=',F10.5,'  CONVERTED TO A13=1.0')            IEOHGV    133
 2024 FORMAT(14X,'IEEE A21=',F10.5,'  CONVERTED TO A21=1.5')            IEOHGV    134
 2025 FORMAT(14X,'IEEE A23=',F10.5,'  CONVERTED TO A23=1.0')            IEOHGV    135
 2030 FORMAT(' *** WARNING IEEE TYPE-1 SPEED GOVERNING SYSTEM')         IEOHGV    136
 2031 FORMAT(14X,'IEEE K5=',F10.5                                       IEOHGV    137
     *,' NOT CONSIDERED BUT COMPUTED INTERNALLY')                       IEOHGV    138
 2032 FORMAT(14X,'IEEE K2=',F10.5                                       IEOHGV    139
     *,' NOT USED LP HAS ONLY IEEE(K4 K6 K8)')                          IEOHGV    140
C                                                                       IEOHGV    141
C                                                                       IEOHGV    142
       END                                                              IEOHGV    143
