CFPRIME EPEXCV                                                          EPEXCV      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                                                                       EPEXCV      3
      SUBROUTINE EPEXCV (EPEXC,IEX,EXCBUF,IEEEX6)                       EPEXCV      4
CD                                                                      EPEXCV      5
CD    TO CONVERT BPA/WSCC/EPRI(OLD) EXCITER MODELS TO EPRI(NEW) MODELS. EPEXCV      6
CD                                                                      EPEXCV      7
      INCLUDE 'PARX.INS'                                                EPEXCV      8
      INCLUDE 'CNFLAG.INS'                                              EPEXCV      9
      INCLUDE 'CNUNIT.INS'                                              EPEXCV     10
      INCLUDE 'CNMSG.INS'                                               EPEXCV     11
C                                                                       EPEXCV     12
      CHARACTER*80 EXCBUF                                               EPEXCV     13
      DIMENSION EPEXC(*)                                                EPEXCV     14
C                                                                       EPEXCV     15
      LDEB=(JDEB(93).NE.0)                                              EPEXCV     16
C                                                                       EPEXCV     17
            READ(EXCBUF,1020) TR,RKA,TA,TA1,VRMIN,RKE,TE,               EPEXCV     18
     1      SE,SEMAX,EFDMIN,EFDMAX,RKF,TF,EXL,TF1                       EPEXCV     19
C...................................................................    EPEXCV     20
C : ALL EXCITER MODELS ARE READ IN UNDER THE ABOVE VARIABLES.       :   EPEXCV     21
C : RKA    --> KA,KV                                                :   EPEXCV     22
C : TA     --> TA,TRH                                               :   EPEXCV     23
C : SE     --> SE.75MX, KI,KC                                       :   EPEXCV     24
C : SEMAX  --> SEMAX, KP                                            :   EPEXCV     25
C : EFDMAX --> EFDMAX, VBMAX                                        :   EPEXCV     26
C : RKF    --> KF,K'A                                               :   EPEXCV     27
C : EXL    --> XL                                                   :   EPEXCV     28
C :.................................................................:   EPEXCV     29
C                                                                       EPEXCV     30
C                                                                       EPEXCV     31
C                                                                       EPEXCV     32
C                                                                       EPEXCV     33
            IF(LDEB)WRITE(IUD6,1000) EXCBUF(1:2),EXCBUF(4:15),TR,RKA,   EPEXCV     34
     1      TA,TA1,VRMIN,RKE,TE,SE,SEMAX,EFDMIN,EFDMAX,RKF,TF,EXL,TF1   EPEXCV     35
C                                                                       EPEXCV     36
            CALL FMOVE(0,EPEXC,EPEXC,J9E1D)                             EPEXCV     37
            IEEEX6=0                                                    EPEXCV     38
C                                                                       EPEXCV     39
C           ------------------------------------                        EPEXCV     40
C           - EPRI TYPE A --> OH TYPE IEX 1 OR 2                        EPEXCV     41
C               DEPENDING ON KE                                         EPEXCV     42
C           ------------------------------------                        EPEXCV     43
C                                                                       EPEXCV     44
            IF(EXCBUF(2:2).EQ.'A')THEN                                  EPEXCV     45
               IEX=1                                                    EPEXCV     46
C                                                                       EPEXCV     47
C              PROCESS OTHER DATA AS PER IEX 1                          EPEXCV     48
C                                                                       EPEXCV     49
               EPEXC(1)=RKA                                             EPEXCV     50
               EPEXC(2)=TA1                                             EPEXCV     51
               IF(RKE.NE.0.0)THEN                                       EPEXCV     52
               EPEXC(3)=RKE                                             EPEXCV     53
               ELSE                                                     EPEXCV     54
               IEX=2                                                    EPEXCV     55
               ENDIF                                                    EPEXCV     56
               EPEXC(4)=TE                                              EPEXCV     57
               EPEXC(5)=SEMAX                                           EPEXCV     58
               EPEXC(6)=SE                                              EPEXCV     59
               EPEXC(7)=EFDMAX                                          EPEXCV     60
               EPEXC(9)=RKF                                             EPEXCV     61
               EPEXC(10)=TF                                             EPEXCV     62
               EPEXC(11)=0.0                                            EPEXCV     63
               EPEXC(12)=TA                                             EPEXCV     64
               VRMAX=(SEMAX+RKE)*EFDMAX                                 EPEXCV     65
               EPEXC(13)=VRMAX                                          EPEXCV     66
               EPEXC(14)=VRMAX*VRMIN                                    EPEXCV     67
               EPEXC(15)=0.                                             EPEXCV     68
               EPEXC(16)=0.                                             EPEXCV     69
               EPEXC(17)=TR                                             EPEXCV     70
               EPEXC(18)=0.                                             EPEXCV     71
               EPEXC(19)=0.                                             EPEXCV     72
C                                                                       EPEXCV     73
               GOTO 500                                                 EPEXCV     74
            ENDIF                                                       EPEXCV     75
C                                                                       EPEXCV     76
C                                                                       EPEXCV     77
C           ------------------------------------                        EPEXCV     78
C           - EPRI TYPE B --> OH TYPE IEX 10 -                          EPEXCV     79
C           ------------------------------------                        EPEXCV     80
C                                                                       EPEXCV     81
            IF(EXCBUF(2:2).EQ.'B')THEN                                  EPEXCV     82
               IEX=10                                                   EPEXCV     83
C                                                                       EPEXCV     84
C              PROCESS OTHER DATA AS PER IEX 10                         EPEXCV     85
C                                                                       EPEXCV     86
               EPEXC(1)=RKA                                             EPEXCV     87
               EPEXC(2)=TA1                                             EPEXCV     88
               EPEXC(3)=RKE                                             EPEXCV     89
               EPEXC(4)=TE                                              EPEXCV     90
               EPEXC(5)=SEMAX                                           EPEXCV     91
               EPEXC(6)=SE                                              EPEXCV     92
               EPEXC(7)=EFDMAX                                          EPEXCV     93
               EPEXC(8)=0.0                                             EPEXCV     94
               EPEXC(9)=RKF                                             EPEXCV     95
               EPEXC(10)=TF                                             EPEXCV     96
               EPEXC(11)=0.0                                            EPEXCV     97
               EPEXC(12)=TA                                             EPEXCV     98
               EPEXC(13)=0.0                                            EPEXCV     99
               EPEXC(14)=TF1                                            EPEXCV    100
               VRMAX=(SEMAX+RKE)*EFDMAX                                 EPEXCV    101
               VRMIN=VRMIN*VRMAX                                        EPEXCV    102
               EPEXC(15)=VRMAX                                          EPEXCV    103
               EPEXC(16)=VRMIN                                          EPEXCV    104
               EPEXC(17)=TR                                             EPEXCV    105
C                                                                       EPEXCV    106
               GOTO 500                                                 EPEXCV    107
            ENDIF                                                       EPEXCV    108
C                                                                       EPEXCV    109
C                                                                       EPEXCV    110
C           -----------------------------------------------             EPEXCV    111
C           - EPRI TYPE C --> OH TYPE IEX 6 (IEEE AC1) -                EPEXCV    112
C           -----------------------------------------------             EPEXCV    113
C                                                                       EPEXCV    114
            IF(EXCBUF(2:2).EQ.'C')THEN                                  EPEXCV    115
               IEX=6                                                    EPEXCV    116
               IEEEX6=1                                                 EPEXCV    117
C                                                                       EPEXCV    118
C              PROCESS OTHER DATA AS PER IEX 5                          EPEXCV    119
C                                                                       EPEXCV    120
               EPEXC(1)=RKA                                             EPEXCV    121
               EPEXC(2)=TA1                                             EPEXCV    122
               EPEXC(3)=RKE                                             EPEXCV    123
               EPEXC(4)=TE                                              EPEXCV    124
               EPEXC(5)=SEMAX                                           EPEXCV    125
               EPEXC(6)=SE                                              EPEXCV    126
               EPEXC(7)=EFDMAX                                          EPEXCV    127
               EPEXC(8)=0.0                                             EPEXCV    128
               EPEXC(9)=RKF                                             EPEXCV    129
               EPEXC(10)=TF                                             EPEXCV    130
               EPEXC(11)=0.0                                            EPEXCV    131
               EPEXC(12)=TA                                             EPEXCV    132
               VRMAX=(SEMAX+RKE)*EFDMAX                                 EPEXCV    133
               VRMIN=VRMIN*VRMAX                                        EPEXCV    134
               EPEXC(13)=VRMAX                                          EPEXCV    135
               EPEXC(14)=VRMIN                                          EPEXCV    136
               EPEXC(15)=0.0                                            EPEXCV    137
               EPEXC(22)=1.0                                            EPEXCV    138
C                                                                       EPEXCV    139
               GOTO 500                                                 EPEXCV    140
            ENDIF                                                       EPEXCV    141
C                                                                       EPEXCV    142
C                                                                       EPEXCV    143
C           ----------------------------------------------              EPEXCV    144
C           - EPRI TYPE D --> OH TYPE IEX 7  IEEE ST2 -                 EPEXCV    145
C           ----------------------------------------------              EPEXCV    146
C                                                                       EPEXCV    147
            IF(EXCBUF(2:2).EQ.'D')THEN                                  EPEXCV    148
               IEX=7                                                    EPEXCV    149
C                                                                       EPEXCV    150
C              PROCESS OTHER DATA AS PER IEX 7                          EPEXCV    151
C                                                                       EPEXCV    152
               EPEXC(1)=RKA                                             EPEXCV    153
               EPEXC(2)=TA1                                             EPEXCV    154
               EPEXC(3)=RKE                                             EPEXCV    155
               EPEXC(4)=TE                                              EPEXCV    156
               EPEXC(5)=1.0                                             EPEXCV    157
               EPEXC(8)=0.78*EXL                                        EPEXCV    158
               EPEXC(9)=RKF                                             EPEXCV    159
               EPEXC(10)=TF                                             EPEXCV    160
               EPEXC(11)=0.0                                            EPEXCV    161
               EPEXC(12)=TA                                             EPEXCV    162
               EPEXC(14)=-VRMIN                                         EPEXCV    163
               EPEXC(15)=VRMIN                                          EPEXCV    164
               EPEXC(16)=EFDMAX                                         EPEXCV    165
               EPEXC(17)=TR                                             EPEXCV    166
               EPEXC(18)=0.                                             EPEXCV    167
               EPEXC(19)=0.                                             EPEXCV    168
               EPEXC(20)=SEMAX                                          EPEXCV    169
               EPEXC(21)=SE                                             EPEXCV    170
               GOTO 500                                                 EPEXCV    171
            ENDIF                                                       EPEXCV    172
C                                                                       EPEXCV    173
C                                                                       EPEXCV    174
C           --------------------------------------------------          EPEXCV    175
C           - EPRI TYPE E --> OH TYPE IEX 1 IF(TRH <> 0) -              EPEXCV    176
C           -             --> OH TYPE IEX 9 IF(TRH= 0) -                EPEXCV    177
C           --------------------------------------------------          EPEXCV    178
C                                                                       EPEXCV    179
            IF(EXCBUF(2:2).EQ.'E')THEN                                  EPEXCV    180
               IF(TA.NE.0.0)THEN                                        EPEXCV    181
                  IEX=1                                                 EPEXCV    182
C                                                                       EPEXCV    183
C                 PROCESS OTHER DATA AS PER IEX 1                       EPEXCV    184
C                                                                       EPEXCV    185
                  EPEXC(1)=RKF                                          EPEXCV    186
                  EPEXC(2)=TA                                           EPEXCV    187
                  EPEXC(3)=RKE                                          EPEXCV    188
                  EPEXC(4)=TE                                           EPEXCV    189
                  EPEXC(5)=SEMAX                                        EPEXCV    190
                  EPEXC(6)=SE                                           EPEXCV    191
                  EPEXC(7)=EFDMAX                                       EPEXCV    192
               ELSE                                                     EPEXCV    193
                  IEX=9                                                 EPEXCV    194
C                                                                       EPEXCV    195
C                 PROCESS OTHER DATA AS PER IEX 1                       EPEXCV    196
C                                                                       EPEXCV    197
                  EPEXC(3)=RKE                                          EPEXCV    198
                  EPEXC(4)=TE                                           EPEXCV    199
                  EPEXC(5)=SEMAX                                        EPEXCV    200
                  EPEXC(6)=SE                                           EPEXCV    201
                  EPEXC(7)=EFDMAX                                       EPEXCV    202
                  EPEXC(9)=RKA                                          EPEXCV    203
C        EPEXC(13)=(RKF*RKA)+1.0                                        EPEXCV    204
C        EPEXC(14)=-1.0                                                 EPEXCV    205
                  EPEXC(13)=(SEMAX+RKE)*EFDMAX                          EPEXCV    206
                  EPEXC(14)=EPEXC(13)*VRMIN                             EPEXCV    207
                  EPEXC(10)=(EPEXC(13)-EPEXC(14))/(RKA*RKF)             EPEXCV    208
               ENDIF                                                    EPEXCV    209
C                                                                       EPEXCV    210
C               IF(ISTUDY.EQ.0)THEN                                     EPEXCV    211
C               GOTO 400                                                EPEXCV    212
C               ELSE                                                    EPEXCV    213
               GOTO 500                                                 EPEXCV    214
C               ENDIF                                                   EPEXCV    215
            ENDIF                                                       EPEXCV    216
C                                                                       EPEXCV    217
C                                                                       EPEXCV    218
C                                                                       EPEXCV    219
C           ----------------------------------------------              EPEXCV    220
C           - EPRI TYPE G --> OH TYPE IEX 30             -              EPEXCV    221
C           ----------------------------------------------              EPEXCV    222
C                                                                       EPEXCV    223
            IF(EXCBUF(2:2).EQ.'G')THEN                                  EPEXCV    224
               IEX=30                                                   EPEXCV    225
               IEEEX6=1                                                 EPEXCV    226
C                                                                       EPEXCV    227
C              PROCESS OTHER DATA AS PER IEX 30                         EPEXCV    228
C                                                                       EPEXCV    229
               EPEXC(1)=RKA                                             EPEXCV    230
               EPEXC(2)=TA1                                             EPEXCV    231
               EPEXC(3)=0.0                                             EPEXCV    232
               EPEXC(4)=TA                                              EPEXCV    233
               EPEXC(5)=RKF                                             EPEXCV    234
               EPEXC(6)=TF                                              EPEXCV    235
               EPEXC(9)=EFDMAX                                          EPEXCV    236
               EPEXC(10)=EFDMIN                                         EPEXCV    237
C                                                                       EPEXCV    238
               GOTO 500                                                 EPEXCV    239
            ENDIF                                                       EPEXCV    240
C                                                                       EPEXCV    241
C           ------------------------------------                        EPEXCV    242
C           - EPRI TYPE K --> OH TYPE IEX 1 -                           EPEXCV    243
C           ------------------------------------                        EPEXCV    244
C                                                                       EPEXCV    245
            IF(EXCBUF(2:2).EQ.'K')THEN                                  EPEXCV    246
               IEX=1                                                    EPEXCV    247
C                                                                       EPEXCV    248
C              PROCESS OTHER DATA AS PER IEX 1                          EPEXCV    249
C                                                                       EPEXCV    250
               EPEXC(1)=RKA                                             EPEXCV    251
               EPEXC(2)=TA1                                             EPEXCV    252
               EPEXC(3)=RKE                                             EPEXCV    253
               EPEXC(4)=TE                                              EPEXCV    254
               EPEXC(5)=SEMAX                                           EPEXCV    255
               EPEXC(6)=SE                                              EPEXCV    256
               EPEXC(7)=EFDMAX                                          EPEXCV    257
               EPEXC(9)=RKF                                             EPEXCV    258
               EPEXC(10)=TF                                             EPEXCV    259
               EPEXC(11)=0.0                                            EPEXCV    260
               EPEXC(12)=TA                                             EPEXCV    261
               VRMAX=(SEMAX+RKE)*EFDMAX                                 EPEXCV    262
               EPEXC(13)=VRMAX                                          EPEXCV    263
               EPEXC(14)=VRMIN*VRMAX                                    EPEXCV    264
               GOTO 500                                                 EPEXCV    265
            ENDIF                                                       EPEXCV    266
C                                                                       EPEXCV    267
C           ------------------------------------                        EPEXCV    268
C           - EPRI TYPE J --> OH TYPE IEX 11 -                          EPEXCV    269
C           ------------------------------------                        EPEXCV    270
C                                                                       EPEXCV    271
            IF(EXCBUF(2:2).EQ.'J')THEN                                  EPEXCV    272
               IEX=15                                                   EPEXCV    273
C                                                                       EPEXCV    274
C              PROCESS OTHER DATA AS PER IEX 1                          EPEXCV    275
C                                                                       EPEXCV    276
               EPEXC(1)=RKA                                             EPEXCV    277
               EPEXC(2)=TA1                                             EPEXCV    278
               EPEXC(3)=RKF                                             EPEXCV    279
               EPEXC(4)=TF                                              EPEXCV    280
               EPEXC(9)=TA                                              EPEXCV    281
               EPEXC(10)=-VRMIN                                         EPEXCV    282
               EPEXC(11)=VRMIN                                          EPEXCV    283
               EPEXC(12)=EFDMAX                                         EPEXCV    284
               EPEXC(13)=EFDMIN                                         EPEXCV    285
               EPEXC(17)=TR                                             EPEXCV    286
               EPEXC(18)=0.0                                            EPEXCV    287
               EPEXC(19)=0.0                                            EPEXCV    288
               GOTO 500                                                 EPEXCV    289
            ENDIF                                                       EPEXCV    290
C                                                                       EPEXCV    291
C                                                                       EPEXCV    292
C 400  CONTINUE                                                         EPEXCV    293
C                                                                       EPEXCV    294
C           -------------------------------------                       EPEXCV    295
C           - NO CONVERSION POSSIBLE SET IEX=0  -                       EPEXCV    296
C           -------------------------------------                       EPEXCV    297
C                                                                       EPEXCV    298
            WRITE(MSG(1),1010)                                          EPEXCV    299
            MSG(2)=EXCBUF                                               EPEXCV    300
            CALL PRTMSG(2)                                              EPEXCV    301
            IEX=0                                                       EPEXCV    302
C                                                                       EPEXCV    303
 500  CONTINUE                                                          EPEXCV    304
C                                                                       EPEXCV    305
      RETURN                                                            EPEXCV    306
C                                                                       EPEXCV    307
 1000 FORMAT(1X,'! DEBUG (EPEXCV) EXCITER TYPE ',A2,' BUS :',A12,       EPEXCV    308
     &/,1X,15(1X,F7.3))                                                 EPEXCV    309
 1010 FORMAT(' *** WARNING EPRI EXCITER MODEL IS NOT AVAILABLE')        EPEXCV    310
 1020 FORMAT(BZ,T17,F4.3,T21,F5.2,T26,F4.2,T30,F4.3,T34,F4.2,           EPEXCV    311
     &       T38,F4.3,T42,F4.3,T46,F4.3,T50,F4.3,T54,F5.3,              EPEXCV    312
     &       T59,F4.3,T63,F4.3,T67,F4.3,T71,F5.4,T76,F5.4)              EPEXCV    313
C                                                                       EPEXCV    314
      END                                                               EPEXCV    315
