CFPRIME EPTBCV                                                          EPTBCV      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
C                                                                       EPTBCV      3
      SUBROUTINE EPTBCV (EPGOV,ITB,TBB)                                 EPTBCV      4
CD                                                                      EPTBCV      5
CD    TO CONVERT BPA/WSCC/EPRI(OLD) TURBINE/GOVERNOR MODELS TO          EPTBCV      6
CD    EPRI(NEW) MODELS.                                                 EPTBCV      7
CD                                                                      EPTBCV      8
C     DEFLAG FLAG : 97                                                  EPTBCV      9
C                                                                       EPTBCV     10
      INCLUDE 'CNFLAG.INS'                                              EPTBCV     11
      INCLUDE 'CNUNIT.INS'                                              EPTBCV     12
      INCLUDE 'CNMSG.INS'                                               EPTBCV     13
C                                                                       EPTBCV     14
      CHARACTER*80 TBB                                                  EPTBCV     15
      DIMENSION EPGOV(*)                                                EPTBCV     16
C                                                                       EPTBCV     17
      LDEB=(JDEB(97).NE.0)                                              EPTBCV     18
C                                                                       EPTBCV     19
      READ(TBB,1000) TBT4,TBK1,TBK2,TBT5,TBK3,TBK4,TBT6,TBK5,TBK6,      EPTBCV     20
     1               TBT7,TBK7,TBK8                                     EPTBCV     21
      IF(LDEB)WRITE(IUD6,1010) TBB(1:2),TBB(4:15),TBT4,TBK1             EPTBCV     22
     &,TBK2,TBT5,TBK3,TBK4,TBT6,TBK5,TBK6,TBT7,TBK7,TBK8                EPTBCV     23
C      ..................................................               EPTBCV     24
C      : SUM OF K'S SHOULD BE <=1 ELSE NOT CONVERTABLE :                EPTBCV     25
C      :................................................:               EPTBCV     26
       SUMK=TBK1+TBK3+TBK5                                              EPTBCV     27
       IF(SUMK.GT.1.000001)THEN                                         EPTBCV     28
         WRITE(MSG(1),1030) TBB(2:2),TBB(4:16)                          EPTBCV     29
         CALL PRTMSG(1)                                                 EPTBCV     30
         GOTO 400                                                       EPTBCV     31
       ENDIF                                                            EPTBCV     32
CD                                                                      EPTBCV     33
CD    BPA/WSCC/EPRI(OLD) TYPE A --> EPRI(NEW) TYPE 4                    EPTBCV     34
CD                                                                      EPTBCV     35
       IF(TBB(2:2).EQ.'A')THEN                                          EPTBCV     36
          ITB=4                                                         EPTBCV     37
          EPGOV(9) =TBT4                                                EPTBCV     38
          GOTO 500                                                      EPTBCV     39
       ENDIF                                                            EPTBCV     40
CD                                                                      EPTBCV     41
CD    BPA/WSCC/EPRI(OLD) TYPE B --> EPRI(NEW) TYPE 4                    EPTBCV     42
CD                                                                      EPTBCV     43
       IF(TBB(2:2).EQ.'B')THEN                                          EPTBCV     44
          ITB=4                                                         EPTBCV     45
          EPGOV(9) =TBT4                                                EPTBCV     46
          EPGOV(10)=TBT5                                                EPTBCV     47
          EPGOV(11)=TBT6                                                EPTBCV     48
          EPGOV(12)=0.0                                                 EPTBCV     49
          EPGOV(13)=TBK1                                                EPTBCV     50
          EPGOV(14)=TBK3                                                EPTBCV     51
          EPGOV(15)=TBK5                                                EPTBCV     52
          GOTO 500                                                      EPTBCV     53
       ENDIF                                                            EPTBCV     54
CD                                                                      EPTBCV     55
CD    BPA/WSCC/EPRI(OLD) TYPE C --> EPRI(NEW) TYPE 4                    EPTBCV     56
CD                                                                      EPTBCV     57
       IF(TBB(2:2).EQ.'C')THEN                                          EPTBCV     58
          ITB=4                                                         EPTBCV     59
          EPGOV(9)=TBT4                                                 EPTBCV     60
          EPGOV(10)=TBT5                                                EPTBCV     61
          EPGOV(11)=TBT6                                                EPTBCV     62
          EPGOV(12)=TBT7                                                EPTBCV     63
          EPGOV(13)=TBK1                                                EPTBCV     64
          EPGOV(14)=TBK3                                                EPTBCV     65
          EPGOV(15)=TBK5                                                EPTBCV     66
          GOTO 500                                                      EPTBCV     67
       ENDIF                                                            EPTBCV     68
CD                                                                      EPTBCV     69
CD    BPA/WSCC/EPRI(OLD) TYPE D --> EPRI(NEW) TYPE 4                    EPTBCV     70
CD                                                                      EPTBCV     71
       IF(TBB(2:2).EQ.'D')THEN                                          EPTBCV     72
          ITB=5                                                         EPTBCV     73
          EPGOV(9)=TBT4                                                 EPTBCV     74
          EPGOV(10)=TBT5                                                EPTBCV     75
          EPGOV(11)=TBT6                                                EPTBCV     76
          EPGOV(13)=TBK1                                                EPTBCV     77
          EPGOV(15)=TBK5                                                EPTBCV     78
          EPGOV(17)=TBK4                                                EPTBCV     79
          EPGOV(18)=TBK6                                                EPTBCV     80
          GOTO 500                                                      EPTBCV     81
       ENDIF                                                            EPTBCV     82
CD                                                                      EPTBCV     83
CD    BPA/WSCC/EPRI(OLD) TYPE E --> EPRI(NEW) TYPE 4                    EPTBCV     84
CD                                                                      EPTBCV     85
       IF(TBB(2:2).EQ.'E')THEN                                          EPTBCV     86
          ITB=5                                                         EPTBCV     87
          EPGOV(9)=TBT4                                                 EPTBCV     88
          EPGOV(10)=TBT5                                                EPTBCV     89
          EPGOV(11)=TBT6                                                EPTBCV     90
          EPGOV(13)=TBK1                                                EPTBCV     91
          EPGOV(14)=TBK3                                                EPTBCV     92
          EPGOV(18)=TBK6                                                EPTBCV     93
          GOTO 500                                                      EPTBCV     94
       ENDIF                                                            EPTBCV     95
CD                                                                      EPTBCV     96
CD    BPA/WSCC/EPRI(OLD) TYPE F --> EPRI(NEW) TYPE 4                    EPTBCV     97
CD                                                                      EPTBCV     98
       IF(TBB(2:2).EQ.'F')THEN                                          EPTBCV     99
          ITB=5                                                         EPTBCV    100
          EPGOV(9)=TBT4                                                 EPTBCV    101
          EPGOV(10)=TBT5                                                EPTBCV    102
          EPGOV(11)=TBT6                                                EPTBCV    103
          EPGOV(12)=TBT7                                                EPTBCV    104
          EPGOV(13)=TBK1                                                EPTBCV    105
          EPGOV(15)=TBK5                                                EPTBCV    106
          EPGOV(17)=TBK4                                                EPTBCV    107
          EPGOV(18)=TBK6                                                EPTBCV    108
          EPGOV(19)=TBK8                                                EPTBCV    109
          GOTO 500                                                      EPTBCV    110
       ENDIF                                                            EPTBCV    111
CD                                                                      EPTBCV    112
CD    BPA/WSCC/EPRI(OLD) TYPE W --> EPRI(NEW) TYPE 22                   EPTBCV    113
CD                                                                      EPTBCV    114
CD    NOTE TYPE W TURBINE MUST HAVE A TYPE W GOVERNOR                   EPTBCV    115
CD                                                                      EPTBCV    116
          IF(TBB(2:2).EQ.'W')THEN                                       EPTBCV    117
          ITB=22                                                        EPTBCV    118
          EPGOV(9)=TBT5*2.0                                             EPTBCV    119
          EPGOV(10)=-2.0                                                EPTBCV    120
          EPGOV(11)=3.0                                                 EPTBCV    121
          GOTO 500                                                      EPTBCV    122
          ENDIF                                                         EPTBCV    123
C     ...................                                               EPTBCV    124
C     : NOT CONVERTABLE :                                               EPTBCV    125
C     :.................:                                               EPTBCV    126
 400  CONTINUE                                                          EPTBCV    127
      WRITE (MSG(1),1020) TBB(2:2),TBB(4:16)                            EPTBCV    128
      CALL PRTMSG(1)                                                    EPTBCV    129
      ITB=0                                                             EPTBCV    130
C     ..............................................                    EPTBCV    131
C     :NORMAL EXIST POINT FOR SUCCESSFUL CONVERSION:                    EPTBCV    132
C     :............................................:                    EPTBCV    133
 500  CONTINUE                                                          EPTBCV    134
      IF(LDEB)WRITE(IUD6,1040) TBB(2:2),TBB(4:16)                       EPTBCV    135
     &,(EPGOV(II),II=9,16)                                              EPTBCV    136
      RETURN                                                            EPTBCV    137
C                                                                       EPTBCV    138
 1000 FORMAT(BZ,T17,12F5.3)                                             EPTBCV    139
 1010 FORMAT(1X,'% DEBUG (EPTBCV) GOVERNOR TYPE ',A2,' BUS:', A12,      EPTBCV    140
     1       /1X,F10.3,13(1X,F7.3))                                     EPTBCV    141
 1020 FORMAT(' *** WARNING TYPE ',A,' TURBINE AT BUS: ',A               EPTBCV    142
     *,' IS NOT CONVERTABLE.')                                          EPTBCV    143
 1030 FORMAT(' *** WARNING TYPE ',A,' TURBINE AT BUS: ',A               EPTBCV    144
     *,' TOTAL K CONSTANTS > 1.')                                       EPTBCV    145
 1040 FORMAT(1X,'%DEBUG(EPTBCV) TYPE ',A1,' BUS : ',A13,                EPTBCV    146
     1       /' EPGOV(9:16) : ',8F10.4)                                 EPTBCV    147
C                                                                       EPTBCV    148
      END                                                               EPTBCV    149
