CFPRIME EPIECV                                                          EPIECV      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 EPIECV (EPEXC,IEX,CARD1,                       EPIECV      3
     1                                CARD2,CARD3,                      EPIECV      4
     1                                CARD4,CARD5,IEEEX6)               EPIECV      5
CD                                                                      EPIECV      6
CD    TO CONVERT IEEE EXCITER MODELS FROM EPRI/IEEE FORMAT TO EPRI(NEW) EPIECV      7
CD    MODELS.                                                           EPIECV      8
CD                                                                      EPIECV      9
CD    READEP (EPCD GV) PASSS EXCITER DATA OVER IN 5 CARD IMAGES.        EPIECV     10
CD    CARD 1 CONTAINS BUS NAME, GEN ID, AND IEEE EXCITER TYPE.          EPIECV     11
CD    CARDS 2 TO 5 CONTAIN ACTUAL EXCITER DATA AS SPECIFIED BY IEEE.    EPIECV     12
CD                                                                      EPIECV     13
CD    READ BUS NAME, ID, IEEE EXCITER TYPE FROM CARD 1.                 EPIECV     14
CD    READ REST OF EXCITER DATA FROM CARDS 2 TO 5.                      EPIECV     15
CD    IF EXCITER TYPE = DC1, 2, 3, AC1, 2, 3 THEN                       EPIECV     16
CD       CALCULATE  SATURATION                                          EPIECV     17
CD    END IF                                                            EPIECV     18
CD    IF EXCITER TYPE = DC1 OR DC2 THEN                                 EPIECV     19
CD       IF KE=0 THEN OH EXCITER=IEX2                                   EPIECV     20
CD       IF KE <>0 THEN OH EXCITER=IEX4                                 EPIECV     21
CD       DO CONVERSION TO IEX2/4                                        EPIECV     22
CD    END IF                                                            EPIECV     23
CD                                                                      EPIECV     24
CD    FOR IEEE EXCITER TYPE(DC3) TRANSLATE TO PROGRAM IEX=9.            EPIECV     25
CD    FOR IEEE EXCITER TYPE(AC1) TRANSLATE TO PROGRAM IEX=5.            EPIECV     26
CD    FOR IEEE EXCITER TYPE(AC2) TRANSLATE TO PROGRAM IEX=6.            EPIECV     27
CD    FOR IEEE EXCITER TYPE(AC3) TRANSLATE TO PROGRAM IEX=4.            EPIECV     28
CD    FOR IEEE EXCITER TYPE(DC3) TRANSLATE TO PROGRAM IEX=9.            EPIECV     29
CD    FOR IEEE EXCITER TYPE(AC4 OR ST1  TRANSLATE TO PROGRAM IEX=30.    EPIECV     30
CD    FOR IEEE EXCITER TYPE(ST2)  TRANSLATE TO PROGRAM IEX7.            EPIECV     31
CD    FOR IEEE EXCITER TYPE(ST3)  TRANSLATE TO PROGRAM IEX8.            EPIECV     32
CD                                                                      EPIECV     33
CD    IF NO MATCH IS FOUND, PRINT "NO CONVERSION POSSIBLE" MESSAGE AND  EPIECV     34
CD    STOP.          OHV3-10    28                                      EPIECV     35
CD                                                                      EPIECV     36
      INCLUDE 'PARX.INS'                                                EPIECV     37
      INCLUDE 'CNFLAG.INS'                                              EPIECV     38
      INCLUDE 'CNUNIT.INS'                                              EPIECV     39
      INCLUDE 'CNMSG.INS'                                               EPIECV     40
C                                                                       EPIECV     41
      CHARACTER*80 CARD1,CARD2,CARD3,CARD4,CARD5                        EPIECV     42
      CHARACTER*60 ERRMSG                                               EPIECV     43
      CHARACTER*12 NAME,NAME2                                           EPIECV     44
      CHARACTER*8 BPA                                                   EPIECV     45
      CHARACTER*1  UIDBPA,CF,CZ,EXCBPA,UIDBP2,CHX                       EPIECV     46
      CHARACTER*4  UNITID                                               EPIECV     47
      CHARACTER*3  EXCTYP                                               EPIECV     48
      DIMENSION EPEXC(*)                                                EPIECV     49
      LOGICAL NOGO                                                      EPIECV     50
C                                                                       EPIECV     51
      LDEB=(JDEB(94).NE.0)                                              EPIECV     52
      NOGO=.FALSE.                                                      EPIECV     53
C                                                                       EPIECV     54
      IEEEX6=0                                                          EPIECV     55
      CALL FMOVE(0,EPEXC,EPEXC,J9E1D)                                   EPIECV     56
C                                                                       EPIECV     57
      AEX=0.0                                                           EPIECV     58
      BEX=0.0                                                           EPIECV     59
      VSAT=0.0                                                          EPIECV     60
C                                                                       EPIECV     61
      C21=0.0                                                           EPIECV     62
      C22=0.0                                                           EPIECV     63
      C23=0.0                                                           EPIECV     64
      C24=0.0                                                           EPIECV     65
      C25=0.0                                                           EPIECV     66
      C26=0.0                                                           EPIECV     67
      C27=0.0                                                           EPIECV     68
C                                                                       EPIECV     69
      C31=0.0                                                           EPIECV     70
      C32=0.0                                                           EPIECV     71
      C33=0.0                                                           EPIECV     72
      C34=0.0                                                           EPIECV     73
      C35=0.0                                                           EPIECV     74
      C36=0.0                                                           EPIECV     75
      C37=0.0                                                           EPIECV     76
C                                                                       EPIECV     77
      C41=0.0                                                           EPIECV     78
      C42=0.0                                                           EPIECV     79
      C43=0.0                                                           EPIECV     80
      C44=0.0                                                           EPIECV     81
      C45=0.0                                                           EPIECV     82
      C46=0.0                                                           EPIECV     83
      C47=0.0                                                           EPIECV     84
C                                                                       EPIECV     85
      C51=0.0                                                           EPIECV     86
      C52=0.0                                                           EPIECV     87
      C53=0.0                                                           EPIECV     88
      C54=0.0                                                           EPIECV     89
      C55=0.0                                                           EPIECV     90
      C56=0.0                                                           EPIECV     91
      C57=0.0                                                           EPIECV     92
C                                                                       EPIECV     93
C     Check if it is BPS-IEEE format :                                  EPIECV     94
C                                                                       EPIECV     95
      READ(CARD3(1:8),'(A8)') BPA                                       EPIECV     96
      IF(BPA.EQ.'BPA-IEEE') THEN                                        EPIECV     97
         READ(CARD1,1500) CF,EXCBPA,NAME,UIDBPA                         EPIECV     98
         IF(CF.NE.'F')THEN                                              EPIECV     99
            MSG(1)=' *** ERROR AT CARDS'                                EPIECV    100
            MSG(2)=CARD1                                                EPIECV    101
            MSG(3)=CARD2                                                EPIECV    102
            CALL PRTMSG(3)                                              EPIECV    103
            MSG(1)='EPIECV: ERROR EXCITER CARD #1 NOT F'                EPIECV    104
            CALL ASTOP(MSG(1),35)                                       EPIECV    105
         ENDIF                                                          EPIECV    106
         READ(CARD2,1500) CF,CZ,NAME2,UIDBP2                            EPIECV    107
         IF(CF.NE.'F') THEN                                             EPIECV    108
            MSG(1)=' *** ERROR AT CARDS'                                EPIECV    109
            MSG(2)=CARD1                                                EPIECV    110
            MSG(3)=CARD2                                                EPIECV    111
            CALL PRTMSG(3)                                              EPIECV    112
            MSG(1)='EPIVCE: ERROR EXCITER CARD #2 NOT F'                EPIECV    113
            CALL ASTOP(MSG(1),35)                                       EPIECV    114
         ENDIF                                                          EPIECV    115
 1500    FORMAT(T1,A1,T2,A1,T4,A12,T16,A1)                              EPIECV    116
 1510    FORMAT(BZ,T17,3F5.4,T32,4F5.3,T52,F5.2,T57,4F5.3,T77,F4.3)     EPIECV    117
 1520    FORMAT(BZ,T17,6F5.3,T47,2F5.4,T57,4F5.3,T79,A1)                EPIECV    118
                                                                        EPIECV    119
         IF((EXCBPA.EQ.'A').OR.(EXCBPA.EQ.'B'))THEN                     EPIECV    120
C           It's IEEE model DC1 or DC2                                  EPIECV    121
            IF(EXCBPA.EQ.'A')EXCTYP='DC1'                               EPIECV    122
            IF(EXCBPA.EQ.'B')EXCTYP='DC2'                               EPIECV    123
            READ(CARD1,1510)C52,C53,C51,XXX,XXX,C23,C24,C21,            EPIECV    124
     1      C22,C25,C26,C31,C32                                         EPIECV    125
            READ(CARD2,1520)C33,C35,XXX,C34,C41,C42,XXX,XXX,            EPIECV    126
     1      XXX,XXX,XXX,XXX,CHX                                         EPIECV    127
            C36=0.0                                                     EPIECV    128
            GOTO 900                                                    EPIECV    129
         ELSE IF(EXCBPA.EQ.'C')THEN                                     EPIECV    130
C           It's IEEE model AC1                                         EPIECV    131
            EXCTYP='AC1'                                                EPIECV    132
            READ(CARD1,1510)C52,C53,C51,XXX,XXX,C23,C24,C21,            EPIECV    133
     1      C22,C25,C26,C31,C32                                         EPIECV    134
            READ(CARD2,1520)C33,C35,XXX,C34,C41,C42,C54,C37,            EPIECV    135
     1      XXX,XXX,XXX,XXX,CHX                                         EPIECV    136
            C36=0.0                                                     EPIECV    137
            GOTO 900                                                    EPIECV    138
         ELSE IF(EXCBPA.EQ.'D')THEN                                     EPIECV    139
C           It's IEEE model ST2                                         EPIECV    140
            EXCTYP='ST2'                                                EPIECV    141
            READ(CARD1,1510)C52,C53,C51,XXX,XXX,XXX,XXX,C21,            EPIECV    142
     1      C22,C25,C26,C31,C32                                         EPIECV    143
            READ(CARD2,1520)C44,C43,XXX,C33,C41,C42,C54,XXX,            EPIECV    144
     1      XXX,XXX,XXX,XXX,CHX                                         EPIECV    145
            IF (C25.LT.0.2.AND.ABS(C26).GT.0.2) THEN                    EPIECV    146
               WRITE(MSG(1),1080) NAME,UIDBPA                           EPIECV    147
               WRITE(MSG(2),1090) C25,C26                               EPIECV    148
               WRITE(MSG(3),1100) ABS(C26)                              EPIECV    149
               CALL PRTMSG(3)                                           EPIECV    150
               C25=ABS(C26)                                             EPIECV    151
            END IF                                                      EPIECV    152
            GOTO 900                                                    EPIECV    153
         ELSE IF(EXCBPA.EQ.'E')THEN                                     EPIECV    154
C           It's IEEE model DC3                                         EPIECV    155
            EXCTYP='DC3'                                                EPIECV    156
            READ(CARD1,1510)C52,C53,C51,XXX,XXX,XXX,XXX,C21,            EPIECV    157
     1      C22,C25,C26,C31,C32                                         EPIECV    158
            READ(CARD2,1520)C33,C35,XXX,C34,XXX,XXX,XXX,XXX,            EPIECV    159
     1      XXX,XXX,XXX,XXX,CHX                                         EPIECV    160
            C36=0.0                                                     EPIECV    161
            GOTO 900                                                    EPIECV    162
         ELSE IF(EXCBPA.EQ.'F')THEN                                     EPIECV    163
C           It's IEEE model AC2                                         EPIECV    164
            EXCTYP='AC2'                                                EPIECV    165
            READ(CARD1,1510)C52,C53,C51,C25,C26,C23,C24,C21,            EPIECV    166
     1      C22,C46,C47,C31,C32                                         EPIECV    167
            READ(CARD2,1520)C33,C35,XXX,C34,C41,C42,C54,C37,            EPIECV    168
     1      C45,C44,C43,C55,CHX                                         EPIECV    169
            C36=0.0                                                     EPIECV    170
            GOTO 900                                                    EPIECV    171
         ELSE IF(EXCBPA.EQ.'G')THEN                                     EPIECV    172
C           It's IEEE model AC4                                         EPIECV    173
            EXCTYP='AC4'                                                EPIECV    174
            READ(CARD1,1510)C52,C53,C51,C31,C32,C23,C24,C21,            EPIECV    175
     1      C22,C25,C26,XXX,XXX                                         EPIECV    176
            READ(CARD2,1520)XXX,XXX,XXX,XXX,XXX,XXX,C54,XXX,            EPIECV    177
     1      XXX,XXX,XXX,XXX,CHX                                         EPIECV    178
            GOTO 900                                                    EPIECV    179
         ELSE IF(EXCBPA.EQ.'H')THEN                                     EPIECV    180
C           It's IEEE model AC3                                         EPIECV    181
            EXCTYP='AC3'                                                EPIECV    182
            READ(CARD1,1510)C52,C53,C51,XXX,XXX,C23,C24,C21,            EPIECV    183
     1      C22,C25,C26,C31,C32                                         EPIECV    184
            READ(CARD2,1520)C33,C35,C43,C34,C41,C44,C54,C37,            EPIECV    185
     1      C46,C45,C42,C27,CHX                                         EPIECV    186
            C36=0.0                                                     EPIECV    187
            GOTO 900                                                    EPIECV    188
         ELSE IF((EXCBPA.EQ.'J').OR.(EXCBPA.EQ.'K'))THEN                EPIECV    189
C           It's IEEE model ST1                                         EPIECV    190
            EXCTYP='ST1'                                                EPIECV    191
            READ(CARD1,1510)C52,C53,C51,C31,C32,C23,C24,C21,            EPIECV    192
     1      C22,C25,C26,XXX,XXX                                         EPIECV    193
            READ(CARD2,1520)XXX,XXX,XXX,XXX,C41,C42,C54,XXX,            EPIECV    194
     1      XXX,XXX,XXX,XXX,CHX                                         EPIECV    195
            GOTO 900                                                    EPIECV    196
         ELSE IF(EXCBPA.EQ.'L')THEN                                     EPIECV    197
C           It's IEEE model ST3                                         EPIECV    198
            EXCTYP='ST3'                                                EPIECV    199
            READ(CARD1,1510)C52,C53,C51,C32,C33,C23,C24,C21,            EPIECV    200
     1      C22,C25,C26,C31,XXX                                         EPIECV    201
            READ(CARD2,1520)C43,C41,C42,C36,C34,C35,C54,XXX,            EPIECV    202
     1      XXX,C44,XXX,XXX,CHX                                         EPIECV    203
            GOTO 900                                                    EPIECV    204
         ELSE                                                           EPIECV    205
            MSG(1)=' *** ERROR BPA-IEEE MODEL NOT SUPPORTED'            EPIECV    206
            MSG(2)=CARD1                                                EPIECV    207
            MSG(3)=CARD2                                                EPIECV    208
            CALL PRTMSG(3)                                              EPIECV    209
            MSG(1)='EPIECV: BPA-IEEE MODEL NOT SUPPORTED '              EPIECV    210
            CALL ASTOP(MSG(1),36)                                       EPIECV    211
         ENDIF                                                          EPIECV    212
 900     CONTINUE                                                       EPIECV    213
      ELSE                                                              EPIECV    214
C        IT'S REGULAR IEEE FORMAT                                       EPIECV    215
C        UNITID IN EPRI-IEEE IS CHARACTER*1, LEFT-JUSTIFIED .           EPIECV    216
C        IN IEEE FORMAT, IT'S CHARACTER*4. HERE, IT IS KEPT AS          EPIECV    217
C        CHARACTER*4 BECAUSE UNIT-ID IS NOT BEING USED HERE FOR         EPIECV    218
C        EPRI-IEEE FORMAT. THE UNITID HAS BEEN CHECKED IN THE CALLING   EPIECV    219
C        ROUTINE.                                                       EPIECV    220
C                                                                       EPIECV    221
         READ(CARD1,1000) NAME,UNITID,EXCTYP                            EPIECV    222
         READ(CARD2,1010) C21,C22,C23,C24,C25,C26,C27                   EPIECV    223
         READ(CARD3,1010) C31,C32,C33,C34,C35,C36,C37                   EPIECV    224
         READ(CARD4,1010) C41,C42,C43,C44,C45,C46,C47                   EPIECV    225
         READ(CARD5,1010) C51,C52,C53,C54,C55                           EPIECV    226
       ENDIF                                                            EPIECV    227
C                                                                       EPIECV    228
      IF(LDEB)THEN                                                      EPIECV    229
         WRITE(IUD6,1020)                                               EPIECV    230
         WRITE(IUD6,1000) NAME,UNITID,EXCTYP                            EPIECV    231
         WRITE(IUD6,1010) C21,C22,C23,C24,C25,C26,C27                   EPIECV    232
         WRITE(IUD6,1010) C31,C32,C33,C34,C35,C36,C37                   EPIECV    233
         WRITE(IUD6,1010) C41,C42,C43,C44,C45,C46,C47                   EPIECV    234
         WRITE(IUD6,1010) C51,C52,C53,C54,C55                           EPIECV    235
      ENDIF                                                             EPIECV    236
C                                                                       EPIECV    237
C      ...........................................................      EPIECV    238
C      :CALCULATE EXCITER SATUATION FOR TYPES DC1,2,3 AND AC1,2,3:      EPIECV    239
C      :.........................................................:      EPIECV    240
C                                                                       EPIECV    241
      IF(EXCTYP .EQ. 'DC1' .OR. EXCTYP .EQ. 'AC1' .OR.                  EPIECV    242
     1    EXCTYP .EQ. 'DC2' .OR. EXCTYP .EQ. 'AC2' .OR.                 EPIECV    243
     1    EXCTYP .EQ. 'DC3' .OR. EXCTYP .EQ. 'AC3')     THEN            EPIECV    244
C         * DETERMINE HIGHER POINT                                      EPIECV    245
          IF(C34.GT.C36)THEN                                            EPIECV    246
             EFDHI=C34                                                  EPIECV    247
             SEHI=C33                                                   EPIECV    248
             EFDLO=C36                                                  EPIECV    249
             SELO=C35                                                   EPIECV    250
          ELSE                                                          EPIECV    251
             EFDHI=C36                                                  EPIECV    252
             SEHI=C35                                                   EPIECV    253
             EFDLO=C34                                                  EPIECV    254
             SELO=C33                                                   EPIECV    255
          ENDIF                                                         EPIECV    256
C!        SATURATION BASED ON BPA FORMAT :                              EPIECV    257
          IF(BPA.EQ.'BPA-IEEE')THEN                                     EPIECV    258
            IF(C36.EQ.0.0)THEN                                          EPIECV    259
               VSAT=C34                                                 EPIECV    260
               AEX=C33                                                  EPIECV    261
               BEX=C35                                                  EPIECV    262
               GOTO 988                                                 EPIECV    263
            ENDIF                                                       EPIECV    264
          ENDIF                                                         EPIECV    265
C!                                                                      EPIECV    266
C         * CALCULATE BEX AND AEX                                       EPIECV    267
          BEX=LOG(SEHI*EFDHI/(SELO*EFDLO))/(EFDHI-EFDLO)                EPIECV    268
          AEX=SEHI*EFDHI/(EXP(BEX*EFDHI))                               EPIECV    269
          VSAT=0.0                                                      EPIECV    270
C         * ERROR CONDITION IFBEX IS NEGATIVE.                          EPIECV    271
          IF(BEX.LT.0)THEN                                              EPIECV    272
             NOGO=.TRUE.                                                EPIECV    273
             ERRMSG=' EXCITER SATURATION PROBLEM'                       EPIECV    274
             GOTO 500                                                   EPIECV    275
          ENDIF                                                         EPIECV    276
      ENDIF                                                             EPIECV    277
 988  CONTINUE                                                          EPIECV    278
C                                                                       EPIECV    279
C                                                                       EPIECV    280
C      ...........................................                      EPIECV    281
C      : IEEE TYPE DC1,DC2 --> OH TYPE IEX 1  :                         EPIECV    282
C      :.........................................:                      EPIECV    283
C      : RESTRICTIONS FOR IEX1 AND 2 : (TE .NE.0):                      EPIECV    284
C      :.........................................:                      EPIECV    285
C                                                                       EPIECV    286
C                                                                       EPIECV    287
      IF(EXCTYP.EQ.'DC1'.OR. EXCTYP.EQ.'DC2')THEN                       EPIECV    288
C                                                                       EPIECV    289
        IF(C32.EQ.0)THEN                                                EPIECV    290
           NOGO=.TRUE.                                                  EPIECV    291
           ERRMSG='DC1 OR DC2 CONVERSION FAILED, TE=0'                  EPIECV    292
        ENDIF                                                           EPIECV    293
C                                                                       EPIECV    294
        IF(C31.EQ.0.0)THEN                                              EPIECV    295
            IEX=2                                                       EPIECV    296
        ELSE                                                            EPIECV    297
            IEX=1                                                       EPIECV    298
        ENDIF                                                           EPIECV    299
C                                                                       EPIECV    300
C        PROCESS OTHER DATA AS PER IEX 1                                EPIECV    301
C        --                                                             EPIECV    302
C                                                                       EPIECV    303
        EPEXC(1)=C21                                                    EPIECV    304
        EPEXC(2)=C22                                                    EPIECV    305
        EPEXC(3)=C31                                                    EPIECV    306
        EPEXC(4)=C32                                                    EPIECV    307
        EPEXC(5)=AEX                                                    EPIECV    308
        EPEXC(6)=BEX                                                    EPIECV    309
        EPEXC(7)=VSAT                                                   EPIECV    310
        EPEXC(8)=0.0                                                    EPIECV    311
        EPEXC(9)=C41                                                    EPIECV    312
        EPEXC(10)=C42                                                   EPIECV    313
        EPEXC(11)=C24                                                   EPIECV    314
        EPEXC(12)=C23                                                   EPIECV    315
        EPEXC(13)=C25                                                   EPIECV    316
        EPEXC(14)=C26                                                   EPIECV    317
        IF(EXCTYP.EQ.'DC1')THEN                                         EPIECV    318
           EPEXC(15)=0.0                                                EPIECV    319
        ELSE                                                            EPIECV    320
           EPEXC(15)=1.0                                                EPIECV    321
        ENDIF                                                           EPIECV    322
        EPEXC(16)=0.0                                                   EPIECV    323
        EPEXC(17)=C51                                                   EPIECV    324
        EPEXC(18)=C52                                                   EPIECV    325
        EPEXC(19)=C53                                                   EPIECV    326
C                                                                       EPIECV    327
        GOTO 500                                                        EPIECV    328
      ENDIF                                                             EPIECV    329
C                                                                       EPIECV    330
C                                                                       EPIECV    331
C      ..............................................                   EPIECV    332
C      : IEEE TYPE DC3 --> OH TYPE IEX 9         :                      EPIECV    333
C      :............................................:                   EPIECV    334
C      :                                            :                   EPIECV    335
C      :  RESTRICTIONS FOR IEX 9:   TE,KRH,KV .NE. 0:                   EPIECV    336
C      :............................................:                   EPIECV    337
C                                                                       EPIECV    338
      IF(EXCTYP.EQ.'DC3')THEN                                           EPIECV    339
        IF(C32.EQ.0. .OR. C22 .EQ.0. .OR. C21.EQ.0.)THEN                EPIECV    340
           NOGO=.TRUE.                                                  EPIECV    341
           ERRMSG='#(EPIECV) EXCITER DC3 (TE,KRH,OR KV=0)'              EPIECV    342
        ENDIF                                                           EPIECV    343
C                                                                       EPIECV    344
        IEX=9                                                           EPIECV    345
        EPEXC(3)=C31                                                    EPIECV    346
        EPEXC(4)=C32                                                    EPIECV    347
        EPEXC(5)=AEX                                                    EPIECV    348
        EPEXC(6)=BEX                                                    EPIECV    349
        EPEXC(7)=VSAT                                                   EPIECV    350
        EPEXC(8)=0.0                                                    EPIECV    351
        EPEXC(9)=C21                                                    EPIECV    352
        EPEXC(10)=C22                                                   EPIECV    353
        EPEXC(13)=C25                                                   EPIECV    354
        EPEXC(14)=C26                                                   EPIECV    355
        EPEXC(17)=C51                                                   EPIECV    356
        EPEXC(18)=C52                                                   EPIECV    357
        EPEXC(19)=C53                                                   EPIECV    358
C                                                                       EPIECV    359
        GOTO 500                                                        EPIECV    360
      ENDIF                                                             EPIECV    361
C                                                                       EPIECV    362
C                                                                       EPIECV    363
C      ...........................................                      EPIECV    364
C      : IEEE TYPE AC1 --> OH TYPE IEX 5         :                      EPIECV    365
C      :.........................................:                      EPIECV    366
C      : RESTRICTIONS FOR IEX5 : (TE .NE.0)      :                      EPIECV    367
C      :.........................................:                      EPIECV    368
C                                                                       EPIECV    369
C                                                                       EPIECV    370
      IF(EXCTYP.EQ.'AC1')THEN                                           EPIECV    371
C                                                                       EPIECV    372
        IF(C32.EQ.0)THEN                                                EPIECV    373
           NOGO=.TRUE.                                                  EPIECV    374
           ERRMSG='AC1 CONVERSION FAILED, TE=0'                         EPIECV    375
        ENDIF                                                           EPIECV    376
C                                                                       EPIECV    377
        IEX=5                                                           EPIECV    378
        IEEEX6=1                                                        EPIECV    379
        EPEXC(1)=C21                                                    EPIECV    380
        EPEXC(2)=C22                                                    EPIECV    381
        EPEXC(3)=C31                                                    EPIECV    382
        EPEXC(4)=C32                                                    EPIECV    383
        EPEXC(5)=AEX                                                    EPIECV    384
        EPEXC(6)=BEX                                                    EPIECV    385
        EPEXC(7)=VSAT                                                   EPIECV    386
        EPEXC(8)=C54                                                    EPIECV    387
        EPEXC(9)=C41                                                    EPIECV    388
        EPEXC(10)=C42                                                   EPIECV    389
        EPEXC(11)=C24                                                   EPIECV    390
        EPEXC(12)=C23                                                   EPIECV    391
        EPEXC(13)=C25                                                   EPIECV    392
        EPEXC(14)=C26                                                   EPIECV    393
        EPEXC(15)=0.0                                                   EPIECV    394
        EPEXC(16)=0.0                                                   EPIECV    395
        EPEXC(17)=C51                                                   EPIECV    396
        EPEXC(18)=C52                                                   EPIECV    397
        EPEXC(19)=C53                                                   EPIECV    398
        EPEXC(20)=C37                                                   EPIECV    399
C                                                                       EPIECV    400
        GOTO 500                                                        EPIECV    401
      ENDIF                                                             EPIECV    402
C                                                                       EPIECV    403
C                                                                       EPIECV    404
C      ...........................................                      EPIECV    405
C      : IEEE TYPE AC2 --> OH TYPE IEX 6         :                      EPIECV    406
C      :.........................................:                      EPIECV    407
C      : RESTRICTIONS FOR IEX6 : (TE .NE.0)      :                      EPIECV    408
C      :.........................................:                      EPIECV    409
C                                                                       EPIECV    410
C                                                                       EPIECV    411
      IF(EXCTYP.EQ.'AC2')THEN                                           EPIECV    412
C                                                                       EPIECV    413
        IF(C32.EQ.0)THEN                                                EPIECV    414
           NOGO=.TRUE.                                                  EPIECV    415
           ERRMSG='AC2 CONVERSION FAILED, TE=0'                         EPIECV    416
        ENDIF                                                           EPIECV    417
C                                                                       EPIECV    418
        IEX=6                                                           EPIECV    419
        IEEEX6=1                                                        EPIECV    420
        EPEXC(1)=C21                                                    EPIECV    421
        EPEXC(2)=C22                                                    EPIECV    422
        EPEXC(3)=C31                                                    EPIECV    423
        EPEXC(4)=C32                                                    EPIECV    424
        EPEXC(5)=AEX                                                    EPIECV    425
        EPEXC(6)=BEX                                                    EPIECV    426
        EPEXC(7)=VSAT                                                   EPIECV    427
        EPEXC(8)=C54                                                    EPIECV    428
        EPEXC(9)=C41                                                    EPIECV    429
        EPEXC(10)=C42                                                   EPIECV    430
        EPEXC(11)=C24                                                   EPIECV    431
        EPEXC(12)=C23                                                   EPIECV    432
        EPEXC(13)=C25                                                   EPIECV    433
        EPEXC(14)=C26                                                   EPIECV    434
        EPEXC(15)=C46                                                   EPIECV    435
        EPEXC(16)=C47                                                   EPIECV    436
        EPEXC(17)=C51                                                   EPIECV    437
        EPEXC(18)=C52                                                   EPIECV    438
        EPEXC(19)=C53                                                   EPIECV    439
        EPEXC(20)=C37                                                   EPIECV    440
        EPEXC(22)=C45                                                   EPIECV    441
        EPEXC(23)=C43                                                   EPIECV    442
        EPEXC(24)=C44                                                   EPIECV    443
        EPEXC(25)=C55                                                   EPIECV    444
C                                                                       EPIECV    445
        GOTO 500                                                        EPIECV    446
      ENDIF                                                             EPIECV    447
C                                                                       EPIECV    448
C                                                                       EPIECV    449
C      ...........................................                      EPIECV    450
C      : IEEE TYPE AC3 --> OH TYPE IEX 4         :                      EPIECV    451
C      :.........................................:                      EPIECV    452
C      : RESTRICTIONS FOR IEX4 : (TE .NE.0)      :                      EPIECV    453
C      :.........................................:                      EPIECV    454
C                                                                       EPIECV    455
C                                                                       EPIECV    456
      IF(EXCTYP.EQ.'AC3')THEN                                           EPIECV    457
C                                                                       EPIECV    458
        IF(C32.EQ.0)THEN                                                EPIECV    459
           NOGO=.TRUE.                                                  EPIECV    460
           ERRMSG='AC3 CONVERSION FAILED, TE=0'                         EPIECV    461
        ENDIF                                                           EPIECV    462
C                                                                       EPIECV    463
        IEX=4                                                           EPIECV    464
        IEEEX6=1                                                        EPIECV    465
        EPEXC(1)=C21                                                    EPIECV    466
        EPEXC(2)=C22                                                    EPIECV    467
        EPEXC(3)=C31                                                    EPIECV    468
        EPEXC(4)=C32                                                    EPIECV    469
        EPEXC(5)=AEX                                                    EPIECV    470
        EPEXC(6)=BEX                                                    EPIECV    471
        EPEXC(7)=VSAT                                                   EPIECV    472
        EPEXC(8)=C54                                                    EPIECV    473
        EPEXC(9)=C41                                                    EPIECV    474
        EPEXC(10)=C44                                                   EPIECV    475
        EPEXC(11)=C24                                                   EPIECV    476
        EPEXC(12)=C23                                                   EPIECV    477
        EPEXC(13)=C25                                                   EPIECV    478
        EPEXC(14)=C26                                                   EPIECV    479
        EPEXC(15)=0.0                                                   EPIECV    480
        EPEXC(16)=C27                                                   EPIECV    481
        EPEXC(17)=C51                                                   EPIECV    482
        EPEXC(18)=C52                                                   EPIECV    483
        EPEXC(19)=C53                                                   EPIECV    484
        EPEXC(20)=C37                                                   EPIECV    485
        EPEXC(21)=0.0                                                   EPIECV    486
        EPEXC(22)=C42                                                   EPIECV    487
        EPEXC(23)=C43                                                   EPIECV    488
        EPEXC(24)=C45                                                   EPIECV    489
        EPEXC(25)=C46                                                   EPIECV    490
        EPEXC(26)=99.0                                                  EPIECV    491
        EPEXC(27)=1.0                                                   EPIECV    492
C                                                                       EPIECV    493
        GOTO 500                                                        EPIECV    494
      ENDIF                                                             EPIECV    495
C                                                                       EPIECV    496
C                                                                       EPIECV    497
C      ...............................................                  EPIECV    498
C      : IEEE TYPE AC4 AND ST1 --> OH TYPE IEX 30    :                  EPIECV    499
C      :.............................................:                  EPIECV    500
C      : RESTRICTIONS FOR IEX10 : NONE               :                  EPIECV    501
C      :.............................................:                  EPIECV    502
C                                                                       EPIECV    503
C                                                                       EPIECV    504
      IF(EXCTYP.EQ.'AC4' .OR. EXCTYP.EQ.'ST1')THEN                      EPIECV    505
C                                                                       EPIECV    506
        IEX=30                                                          EPIECV    507
        IEEEX6=1                                                        EPIECV    508
        IF (C25.GT.99.0) C25=99.0                                       EPIECV    509
        IF (C31.GT.99.0) C31=99.0                                       EPIECV    510
        IF (C26.LT.-99.0) C26=-99.0                                     EPIECV    511
        IF (C32.LT.-99.0) C32=-99.0                                     EPIECV    512
        EPEXC(1)=C21                                                    EPIECV    513
        EPEXC(2)=C22                                                    EPIECV    514
        EPEXC(3)=C24                                                    EPIECV    515
        EPEXC(4)=C23                                                    EPIECV    516
        IF(EXCTYP.EQ.'AC4') THEN                                        EPIECV    517
           EPEXC(5)=0.0                                                 EPIECV    518
           EPEXC(6)=0.0                                                 EPIECV    519
        ELSE                                                            EPIECV    520
           EPEXC(5)=C41                                                 EPIECV    521
           EPEXC(6)=C42                                                 EPIECV    522
        ENDIF                                                           EPIECV    523
        EPEXC(7)=0.0                                                    EPIECV    524
        EPEXC(8)=0.0                                                    EPIECV    525
        EPEXC(9)=C25                                                    EPIECV    526
        EPEXC(10)=C26                                                   EPIECV    527
        IF(EXCTYP.EQ.'AC4')THEN                                         EPIECV    528
           EPEXC(11)=0.0                                                EPIECV    529
        ELSE                                                            EPIECV    530
           EPEXC(11)=1.0                                                EPIECV    531
        ENDIF                                                           EPIECV    532
        EPEXC(12)=C54                                                   EPIECV    533
        EPEXC(17)=C51                                                   EPIECV    534
        EPEXC(18)=C52                                                   EPIECV    535
        EPEXC(19)=C53                                                   EPIECV    536
        EPEXC(24)=99.0                                                  EPIECV    537
        EPEXC(25)=99.0                                                  EPIECV    538
        EPEXC(26)=-99.0                                                 EPIECV    539
        EPEXC(27)=C31                                                   EPIECV    540
        EPEXC(28)=C32                                                   EPIECV    541
C                                                                       EPIECV    542
        GOTO 500                                                        EPIECV    543
      ENDIF                                                             EPIECV    544
C                                                                       EPIECV    545
C                                                                       EPIECV    546
C      ...........................................                      EPIECV    547
C      : IEEE TYPE ST2 --> OH TYPE IEX 7      :                         EPIECV    548
C      :.........................................:                      EPIECV    549
C      : RESTRICTIONS FOR IEX7 : NIL             :                      EPIECV    550
C      :.........................................:                      EPIECV    551
C                                                                       EPIECV    552
C                                                                       EPIECV    553
      IF(EXCTYP.EQ.'ST2')THEN                                           EPIECV    554
C                                                                       EPIECV    555
C                                                                       EPIECV    556
        IEX=7                                                           EPIECV    557
        IF (C25.GT.99.0) C25=99.0                                       EPIECV    558
        IF (C33.GT.99.0) C33=99.0                                       EPIECV    559
        IF (C26.LT.-99.0) C26=-99.0                                     EPIECV    560
        EPEXC(1)=C21                                                    EPIECV    561
        EPEXC(2)=C22                                                    EPIECV    562
        EPEXC(3)=C31                                                    EPIECV    563
        EPEXC(4)=C32                                                    EPIECV    564
        EPEXC(5)=1.0                                                    EPIECV    565
        EPEXC(8)=C54                                                    EPIECV    566
        EPEXC(9)=C41                                                    EPIECV    567
        EPEXC(10)=C42                                                   EPIECV    568
        EPEXC(11)=0.0                                                   EPIECV    569
        EPEXC(12)=0.0                                                   EPIECV    570
        EPEXC(13)=0.0                                                   EPIECV    571
        EPEXC(14)=C25                                                   EPIECV    572
        EPEXC(15)=C26                                                   EPIECV    573
        EPEXC(16)=C33                                                   EPIECV    574
        EPEXC(17)=C51                                                   EPIECV    575
        EPEXC(18)=C52                                                   EPIECV    576
        EPEXC(19)=C53                                                   EPIECV    577
        EPEXC(20)=C43                                                   EPIECV    578
        EPEXC(21)=C44                                                   EPIECV    579
C                                                                       EPIECV    580
        GOTO 500                                                        EPIECV    581
      ENDIF                                                             EPIECV    582
C                                                                       EPIECV    583
C                                                                       EPIECV    584
C      ...........................................                      EPIECV    585
C      : IEEE TYPE ST3 --> OH TYPE IEX 8         :                      EPIECV    586
C      :.........................................:                      EPIECV    587
C      : RESTRICTIONS FOR IEX8 : NIL             :                      EPIECV    588
C      :.........................................:                      EPIECV    589
C                                                                       EPIECV    590
C                                                                       EPIECV    591
      IF(EXCTYP.EQ.'ST3')THEN                                           EPIECV    592
C                                                                       EPIECV    593
C                                                                       EPIECV    594
        IEX=8                                                           EPIECV    595
        IEEEX6=1                                                        EPIECV    596
        IF (C25.GT.99.0) C25=99.0                                       EPIECV    597
        IF (C32.GT.99.0) C32=99.0                                       EPIECV    598
        IF (C35.GT.99.0) C35=99.0                                       EPIECV    599
        IF (C36.GT.99.0) C36=99.0                                       EPIECV    600
        IF (C26.LT.-99.0) C26=-99.0                                     EPIECV    601
        IF (C33.LT.-99.0) C33=-99.0                                     EPIECV    602
        EPEXC(1)=C21                                                    EPIECV    603
        EPEXC(2)=C22                                                    EPIECV    604
        EPEXC(3)=C31                                                    EPIECV    605
        EPEXC(4)=C34                                                    EPIECV    606
        EPEXC(5)=C35                                                    EPIECV    607
        EPEXC(6)=C32                                                    EPIECV    608
        EPEXC(7)=C33                                                    EPIECV    609
        EPEXC(8)=C54                                                    EPIECV    610
        EPEXC(9)=0.0                                                    EPIECV    611
        EPEXC(10)=0.0                                                   EPIECV    612
        EPEXC(11)=C24                                                   EPIECV    613
        EPEXC(12)=C23                                                   EPIECV    614
        EPEXC(13)=0.0                                                   EPIECV    615
        EPEXC(14)=C25                                                   EPIECV    616
        EPEXC(15)=C26                                                   EPIECV    617
        EPEXC(16)=C36                                                   EPIECV    618
        EPEXC(17)=C51                                                   EPIECV    619
        EPEXC(18)=C52                                                   EPIECV    620
        EPEXC(19)=C53                                                   EPIECV    621
        EPEXC(20)=C44                                                   EPIECV    622
        EPEXC(21)=C43                                                   EPIECV    623
        EPEXC(22)=C41                                                   EPIECV    624
        EPEXC(23)=C42                                                   EPIECV    625
        EPEXC(24)=99.0                                                  EPIECV    626
        EPEXC(25)=-99.0                                                 EPIECV    627
        EPEXC(26)=99.0                                                  EPIECV    628
C                                                                       EPIECV    629
        GOTO 500                                                        EPIECV    630
      ENDIF                                                             EPIECV    631
C                                                                       EPIECV    632
C                                                                       EPIECV    633
C     -------------------------                                         EPIECV    634
C     - NO CONVERSION POSSIBLE-                                         EPIECV    635
C     -------------------------                                         EPIECV    636
C                                                                       EPIECV    637
      WRITE (MSG(1),1030) EXCTYP                                        EPIECV    638
      CALL PRTMSG(1)                                                    EPIECV    639
      NOGO=.TRUE.                                                       EPIECV    640
C                                                                       EPIECV    641
 500  CONTINUE                                                          EPIECV    642
C                                                                       EPIECV    643
      IF(LDEB)THEN                                                      EPIECV    644
         WRITE(IUD6,1050) NAME,UNITID,EXCTYP,IEX                        EPIECV    645
         WRITE(IUD6,1070) (EPEXC(II),II=1,8)                            EPIECV    646
         WRITE(IUD6,1070) (EPEXC(II),II=9,16)                           EPIECV    647
         WRITE(IUD6,1070) (EPEXC(II),II=17,24)                          EPIECV    648
         WRITE(IUD6,1070) (EPEXC(II),II=25,32)                          EPIECV    649
      ENDIF                                                             EPIECV    650
C                                                                       EPIECV    651
      IF(NOGO)THEN                                                      EPIECV    652
         WRITE(MSG(1),1040)                                             EPIECV    653
         WRITE(MSG(2),1060) NAME,UNITID,EXCTYP                          EPIECV    654
         MSG(3)=ERRMSG                                                  EPIECV    655
         CALL PRTMSG(3)                                                 EPIECV    656
         MSG(1)='EPIECV: EPRI/BPA TO ETMSP EXCITER CONVERSION PROBLEM'  EPIECV    657
         CALL ASTOP(MSG(1),52)                                          EPIECV    658
      ENDIF                                                             EPIECV    659
C                                                                       EPIECV    660
      RETURN                                                            EPIECV    661
C                                                                       EPIECV    662
 1000 FORMAT(T7,A12,T20,A4,T25,A3)                                      EPIECV    663
 1010 FORMAT(BZ,T6,7F10.4)                                              EPIECV    664
 1020 FORMAT(1X,'--------------------------',                           EPIECV    665
     1      /1X,'*DEBUG(EPIECV)* IEEE EXCITER CONVERSION')              EPIECV    666
 1030 FORMAT(1X,'*** ERROR IEEE EXCITER TYPE ',A1,' NOT AVAILABLE')     EPIECV    667
 1050 FORMAT(1X,'#DEBUG(EPIECV) BUS NAME: ',A12,'. UNIT ID : ',A4,      EPIECV    668
     1      '. IEEE EXCITER TYPE : ',A3,'. ETMSP TYPE : ',I3)           EPIECV    669
 1040 FORMAT(1X,'*** ERROR EXCITER CONVERSION PROBLEM')                 EPIECV    670
 1060 FORMAT(11X,'AT BUS:',A12,' UNIT ID:',A4,' IEEE EXCITER TYPE:',A3) EPIECV    671
 1070 FORMAT(1X,8F10.4)                                                 EPIECV    672
 1080 FORMAT(' *** WARNING DETAILED GENERATOR AT BUS ',A12,'  GID ',A1) EPIECV    673
 1090 FORMAT(5X,'EXCITER TYPE FD HAS INCONSISTENT VRMAX (',F7.3,') '    EPIECV    674
     1,'AND VRMIN (',F7.3,').')                                         EPIECV    675
 1100 FORMAT(5X,'VRMAX HAS BEEN SET TO ',F7.3)                          EPIECV    676
      END                                                               EPIECV    677
