CFPRIME READPT                                                          READPT      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 READPT(IUX,IUY)                                        READPT      3
CD                                                                      READPT      4
CD    THIS ROUTINE READS DYNAMIC MODEL DATA IN PTI FORMAT. THESE DATA   READPT      5
CD    ARE THEN TRANSLATED INTO THE EPRI(NEW) BUS NUMBER FORMAT AND      READPT      6
CD    STORED IN THE PROGRAM ARRAYS.                                     READPT      7
CD                                                                      READPT      8
      INCLUDE 'PARX.INS'                                                READPT      9
      INCLUDE 'CNLSTA.INS'                                              READPT     10
      INCLUDE 'CNMNEW.INS'                                              READPT     11
      INCLUDE 'CNUNIT.INS'                                              READPT     12
      INCLUDE 'CNPT.INS'                                                READPT     13
      INCLUDE 'CNLUN.INS'                                               READPT     14
      INCLUDE 'CNGSRC.INS'                                              READPT     15
      INCLUDE 'CNCPT1.INS'                                              READPT     16
      INCLUDE 'CNCPT2.INS'                                              READPT     17
      INCLUDE 'CNFLAG.INS'                                              READPT     18
      INCLUDE 'CNMSG.INS'                                               READPT     19
C                                                                       READPT     20
      CHARACTER*132 RECARD,FCARD                                        READPT     21
      CHARACTER*80 LINE,PMSG,STRING                                     OHV3-1      1
      CHARACTER*12 FILNAM                                               OHV3-1      2
      CHARACTER*7  SUBPMT                                               READPT     23
      CHARACTER*6  FRMODL(20),TOMODL(20),IMODEL                         READPT     24
      CHARACTER*4  CBUF(50)                                             READPT     25
      CHARACTER*1  IMAC                                                 READPT     26
      CHARACTER*2  IMAC2                                                READPT     27
C                                                                       READPT     28
      DIMENSION BUF(50)                                                 READPT     29
      EQUIVALENCE (BUF(1),CBUF(1))                                      READPT     30
C                                                                       READPT     31
      LDEB=.FALSE.                                                      READPT     32
C                                                                       READPT     33
C                                                                       READPT     34
C SCRATCH AREAS AVAILABLE ARE:                                          READPT     35
C                                                                       READPT     36
C                                                                       READPT     37
C     SCRAT2   480000 BYTES                                             READPT     38
C     SCRAT3   964040 BYTES                                             READPT     39
C     SCRAT4   196612 BYTES                                             READPT     40
C     SCRAT8   173000 BYTES                                             READPT     41
C                                                                       READPT     42
C                                                                       READPT     43
      JLENG=50                                                          READPT     44
      IKEY=4                                                            READPT     45
      CALL OPENRE(IU31,FILNAM,JLENG,IKEY,ISTAT,0)                       READPT     46
C                                                                       READPT     47
      ILF=-1                                                            READPT     48
C                                                                       READPT     49
      NMODL=0                                                           READPT     50
C                                                                       READPT     51
C                                                                       READPT     52
CD   NGSREC IS THE TOTAL NUMBER OF REPRESENTED GENERATOR IN LOADFLOW    READPT     53
C     NOBUS WILL BE THE NUMBER OF LOADFLOW BUS                          READPT     54
C                                                                       READPT     55
      IF(NGSREC.EQ.0.AND.IBGSTA.LT.0)THEN                               READPT     56
        NGSREC=-IBGSTA                                                  READPT     57
        IBGSTA=0                                                        READPT     58
        MSG(1)=' *** WARNING - GENERATOR ID WILL BE CHECKED AND'        READPT     59
        MSG(2)='               UNIT GENERATION WILL BE ASSIGNED '//     READPT     60
     +         'FROM LOAD FLOW DATA'                                    READPT     61
        CALL PRTMSG(2)                                                  READPT     62
      ENDIF                                                             READPT     63
C                                                                       READPT     64
      JIREC=1                                                           READPT     65
C                                                                       READPT     66
CD                                                                      READPT     67
CD  STEP 1.  READ PTI DYNAMIC DATA JUST FOR GENERATORS AND SVCS         READPT     68
CD                                                                      READPT     69
C                                                                       READPT     70
      CALL MOVE(0,JDREC,JDREC,NB/3)                                     READPT     71
      CALL MOVE(0,ITYPE,ITYPE,NGSREC)                                   READPT     72
      CALL MOVE(0,IEX,IEX,NGSREC)                                       READPT     73
      CALL MOVE(0,ISTAB,ISTAB,NGSREC)                                   READPT     74
      CALL MOVE(0,IGV,IGV,NGSREC)                                       READPT     75
      CALL MOVE(0,IEVC,IEVC,NGSREC)                                     READPT     76
C                                                                       READPT     77
      NGEN=NGSREC                                                       READPT     78
      NEXC=0                                                            READPT     79
      LEXC=0                                                            READPT     80
C                                                                       READPT     81
  100 CONTINUE                                                          READPT     82
      IMAG=0                                                            READPT     83
      CALL REPTRE(IUX,NLF,IMODEL,IMAC,BUF,KXUSER,IMAG,NEXC,FCARD,*1200) READPT     84
C                                                                       READPT     85
      IF(NLF.LE.0)THEN                                                  READPT     86
        WRITE(MSG(1),4200)                                              READPT     87
        WRITE(MSG(2),4300) NLF                                          READPT     88
        MSG(3)=FCARD                                                    READPT     89
        CALL PRTMSG(3)                                                  READPT     90
        GOTO 100                                                        READPT     91
      ENDIF                                                             READPT     92
C                                                                       READPT     93
C     GET TABLE OF CON SAVING MODELS FOR CONVERSION                     READPT     94
C                                                                       READPT     95
      IF(KXUSER.NE.0.AND.NMODL.EQ.0)THEN                                READPT     96
        SUBPMT='READPT '                                                READPT     97
        PMSG='ENTER CON SAVING MODEL (;FROM_NAME;TO_NAME,'//            READPT     98
     +       ' END TO FINISH THE LIST): '                               READPT     99
 120    CALL REDLIN (LOUT,LIN,IOERR,69,PMSG,SUBPMT,'XXX',STRING,        READPT    100
     +               RECORD,IREC,KLAYER,KEND,KREAD,PLAYBA)              READPT    101
        IF(IOERR.LT.0)THEN                                              READPT    102
        IF(PLAYBA)CALL PSTOP                                            READPT    103
        GOTO 120                                                        READPT    104
        ENDIF                                                           READPT    105
        IQF1=INDEX(STRING,';')+1                                        READPT    106
        IQT1=INDEX(STRING(IQF1:),';')+IQF1                              READPT    107
        IF(IQF1.NE.IQT1)THEN                                            READPT    108
          IF(NMODL.LT.20)THEN                                           READPT    109
            NMODL=NMODL+1                                               READPT    110
            IQF2=IQF1+5                                                 READPT    111
            IF(IQF2.GT.IQT1-2)IQF2=IQT1-2                               READPT    112
            FRMODL(NMODL)=STRING(IQF1:IQF2)                             READPT    113
            TOMODL(NMODL)=STRING(IQT1:IQT1+5)                           READPT    114
            GOTO 120                                                    READPT    115
          ELSE                                                          READPT    116
            WRITE(MSG(1),7900)                                          READPT    117
            WRITE(MSG(2),8000)                                          READPT    118
            CALL PRTMSG(2)                                              READPT    119
            GOTO 130                                                    READPT    120
          ENDIF                                                         READPT    121
        ELSE                                                            READPT    122
          IF(INDEX(STRING,'END').EQ.0)GOTO 120                          READPT    123
        ENDIF                                                           READPT    124
      ENDIF                                                             READPT    125
C                                                                       READPT    126
 130  IMAC2=' '//IMAC                                                   READPT    127
C                                                                       READPT    128
C     MATCH GENERATOR MODEL AND SVC MODEL OTHERWISE SKIP (GOTO 170)     READPT    129
C                                                                       READPT    130
      CALL ADFGEN(1,KFOUND,NGEN,NLF,IMAC2,LFGEN,XGEID,NSORDE)           READPT    131
C                                                                       READPT    132
      IF(KFOUND.LE.0)THEN                                               READPT    133
         GOTO 200                                                       READPT    134
      ELSE                                                              READPT    135
         JGEN=NSORDE(KFOUND)                                            READPT    136
         IF(JDREC(JGEN).EQ.0)THEN                                       READPT    137
         JDREC(JGEN)=JIREC                                              READPT    138
         JIREC=JIREC+6                                                  READPT    139
         ENDIF                                                          READPT    140
      ENDIF                                                             READPT    141
      IIREC=JDREC(JGEN)                                                 READPT    142
C                                                                       READPT    143
      IF(KXUSER.NE.0.AND.NMODL.GT.0)THEN                                READPT    144
        DO 150 IJ=1,NMODL                                               READPT    145
          IF(IMODEL.EQ.FRMODL(IJ))THEN                                  READPT    146
            IMODEL=TOMODL(IJ)                                           READPT    147
            GOTO 160                                                    READPT    148
          ENDIF                                                         READPT    149
150     CONTINUE                                                        READPT    150
      ENDIF                                                             READPT    151
C                                                                       READPT    152
 160  CALL WHICHM(IMODEL,MGROUP,MODEL)                                  READPT    153
      IF(KXUSER.NE.0)MODEL=MODEL+1000                                   READPT    154
C                                                                       READPT    155
C              1    2    3    4    5    6    7                          READPT    156
C            GEN  EXC  COM  STA  GOV  SVC UNKN                          READPT    157
      GOTO ( 400, 500, 900, 600, 800, 300, 200) MGROUP                  READPT    158
C                                                                       READPT    159
C     MODELS NOT CONVERTABLE                                            READPT    160
C                                                                       READPT    161
  200 CONTINUE                                                          READPT    162
      IF(ILF.EQ.-1)THEN                                                 READPT    163
         I1=1                                                           READPT    164
         I2=1                                                           READPT    165
         IL=61                                                          READPT    166
         WRITE(LOUT,6000)                                               READPT    167
         ILF=0                                                          READPT    168
      ENDIF                                                             READPT    169
      IF(IL.GE.59)THEN                                                  READPT    170
         IPAGE=IPAGE+1                                                  READPT    171
         WRITE(IU16,6200) IPAGE                                         READPT    172
         WRITE(IU16,6100)                                               READPT    173
         IL=9                                                           READPT    174
      ENDIF                                                             READPT    175
      WRITE(RECARD(I1:),'(I7,1X,A6,A3,1X)') NLF,IMODEL,IMAC             READPT    176
      WRITE(LINE(I2:),'(I7,1X,A6,A3,1X)') NLF,IMODEL,IMAC               READPT    177
      I1=I1+19                                                          READPT    178
      I2=I2+19                                                          READPT    179
      IF(I1.GT.110)THEN                                                 READPT    180
         WRITE(IU16,'(A)') RECARD                                       READPT    181
         IL=IL+1                                                        READPT    182
         I1=1                                                           READPT    183
      ENDIF                                                             READPT    184
      IF(I2.GT.70)THEN                                                  READPT    185
         WRITE(LOUT,'(A)') LINE                                         READPT    186
         I2=1                                                           READPT    187
      ENDIF                                                             READPT    188
      GOTO 100                                                          READPT    189
C                                                                       READPT    190
  300 CONTINUE                                                          READPT    191
      MODEL=MODEL+4                                                     READPT    192
C                                                                       READPT    193
  400 CONTINUE                                                          READPT    194
      ITYPE(JGEN)=MODEL                                                 READPT    195
      JRECA=IIREC                                                       READPT    196
      GOTO 1000                                                         READPT    197
C                                                                       READPT    198
  500 CONTINUE                                                          READPT    199
C                                                                       READPT    200
C     EXCITER MODEL                                                     READPT    201
C                                                                       READPT    202
      IEX(JGEN)=MODEL                                                   READPT    203
      JRECA=IIREC+3                                                     READPT    204
      GOTO 1000                                                         READPT    205
C                                                                       READPT    206
  600 CONTINUE                                                          READPT    207
C                                                                       READPT    208
C     STABILIZER MODEL                                                  READPT    209
C                                                                       READPT    210
      ISTAB(JGEN)=MODEL                                                 READPT    211
      JRECA=IIREC+4                                                     READPT    212
      GOTO 1000                                                         READPT    213
C                                                                       READPT    214
  800 CONTINUE                                                          READPT    215
C                                                                       READPT    216
C     GOVERNOR MODEL                                                    READPT    217
C                                                                       READPT    218
      IF(KXUSER.NE.0.AND.IFIX(BUF(1)).EQ.11)GOTO 200                    READPT    219
C                                                                       READPT    220
      IGV(JGEN)=MODEL                                                   READPT    221
      JRECA=IIREC+5                                                     READPT    222
      GOTO 1000                                                         READPT    223
C                                                                       READPT    224
  900 CONTINUE                                                          READPT    225
C                                                                       READPT    226
C     COMPENSATOR MODEL                                                 READPT    227
C                                                                       READPT    228
      JRECA=IIREC+2                                                     READPT    229
      IEVC(JGEN)=MODEL                                                  READPT    230
C                                                                       READPT    231
 1000 CONTINUE                                                          READPT    232
      WRITE (IU31,REC=JRECA) (BUF(J),J=1,50)                            READPT    233
      LEXC=LEXC+1                                                       READPT    234
      GOTO 100                                                          READPT    235
C                                                                       READPT    236
C  ALL PTI DYNAMIC DATA HAVE BEEN READ                                  READPT    237
C                                                                       READPT    238
 1200 CONTINUE                                                          READPT    239
      WRITE (IU31,REC=JIREC) (BUF(J),J=1,50)                            READPT    240
      IF(I1.GT.1)THEN                                                   READPT    241
         WRITE(IU16,'(A)') RECARD                                       READPT    242
         I1=0                                                           READPT    243
      ENDIF                                                             READPT    244
      IF(I2.GT.1)THEN                                                   READPT    245
         WRITE(LOUT,'(A)') LINE                                         READPT    246
         I2=0                                                           READPT    247
      ENDIF                                                             READPT    248
CD                                                                      READPT    249
CD STEP 2. WRITE (USRMDL) MODEL WITHOUT AVAILABLE TRANSLATION MESSAGE   READPT    250
CD                                                                      READPT    251
      LSORE=0                                                           READPT    252
      ILF=-1                                                            READPT    253
      DO 1700 I=1,NGEN                                                  READPT    254
         K=NSORDE(I)                                                    READPT    255
         NLF=LFGEN(K)                                                   READPT    256
C                                                                       READPT    257
         IF(ITYPE(K).GT.0)THEN                                          READPT    258
            LSORE=LSORE+1                                               READPT    259
            GOTO 1700                                                   READPT    260
         ENDIF                                                          READPT    261
         IF(IEX(K).NE.0)THEN                                            READPT    262
            IJ=IEX(K)                                                   READPT    263
            IF(IJ.GT.1000)IJ=IJ-1000                                    READPT    264
            IMODEL=EXCMOD(IJ)                                           READPT    265
            IEX(K)=0                                                    READPT    266
            ASSIGN 1300 TO I1030                                        READPT    267
            GOTO 1600                                                   READPT    268
         ENDIF                                                          READPT    269
 1300    CONTINUE                                                       READPT    270
         IF(ISTAB(K).NE.0)THEN                                          READPT    271
            IJ=ISTAB(K)                                                 READPT    272
            IF(IJ.GT.1000)IJ=IJ-1000                                    READPT    273
            IMODEL=STBMOD(IJ)                                           READPT    274
            ISTAB(K)=0                                                  READPT    275
            ASSIGN 1400 TO I1030                                        READPT    276
            GOTO 1600                                                   READPT    277
         ENDIF                                                          READPT    278
 1400    CONTINUE                                                       READPT    279
         IF(IGV(K).NE.0)THEN                                            READPT    280
            IJ=IGV(K)                                                   READPT    281
            IF(IJ.GT.1000)IJ=IJ-1000                                    READPT    282
            IMODEL=GOVMOD(IJ)                                           READPT    283
            IGV(K)=0                                                    READPT    284
            ASSIGN 1500 TO I1030                                        READPT    285
            GOTO 1600                                                   READPT    286
         ENDIF                                                          READPT    287
 1500    CONTINUE                                                       READPT    288
         IF(IEVC(K).NE.0)THEN                                           READPT    289
            IJ=IEVC(K)                                                  READPT    290
            IF(IJ.GT.1000)IJ=IJ-1000                                    READPT    291
            IMODEL=EVCMOD(IJ)                                           READPT    292
            IEVC(K)=0                                                   READPT    293
            ASSIGN 1700 TO I1030                                        READPT    294
            GOTO 1600                                                   READPT    295
         ENDIF                                                          READPT    296
         GOTO 1700                                                      READPT    297
 1600    CONTINUE                                                       READPT    298
         IF(ILF.EQ.-1)THEN                                              READPT    299
            I1=1                                                        READPT    300
            I2=1                                                        READPT    301
            IL=61                                                       READPT    302
            WRITE(LOUT,6300)                                            READPT    303
            ILF=0                                                       READPT    304
         ENDIF                                                          READPT    305
         IF(IL.GE.59)THEN                                               READPT    306
            IPAGE=IPAGE+1                                               READPT    307
            WRITE(IU16,6200) IPAGE                                      READPT    308
            WRITE(IU16,6400)                                            READPT    309
            IL=9                                                        READPT    310
         ENDIF                                                          READPT    311
         WRITE(RECARD(I1:),'(I7,1X,A6,A3,1X)') LFGEN(K),IMODEL,XGEID(K) READPT    312
         WRITE(LINE(I2:),'(I7,1X,A6,A3,1X)') LFGEN(K),IMODEL,XGEID(K)   READPT    313
         I1=I1+19                                                       READPT    314
         I2=I2+19                                                       READPT    315
         IF(I1.GT.110)THEN                                              READPT    316
            WRITE(IU16,'(A)') RECARD                                    READPT    317
            IL=IL+1                                                     READPT    318
            I1=1                                                        READPT    319
         ENDIF                                                          READPT    320
         IF(I2.GT.70)THEN                                               READPT    321
            WRITE(LOUT,'(A)') LINE                                      READPT    322
            I2=1                                                        READPT    323
         ENDIF                                                          READPT    324
         GOTO I1030                                                     READPT    325
 1700 CONTINUE                                                          READPT    326
      IF(I1.GT.1)THEN                                                   READPT    327
         WRITE(IU16,'(A)') RECARD                                       READPT    328
         I1=0                                                           READPT    329
      ENDIF                                                             READPT    330
      IF(I2.GT.1)THEN                                                   READPT    331
         WRITE(LOUT,'(A)') LINE                                         READPT    332
         I2=0                                                           READPT    333
      ENDIF                                                             READPT    334
C                                                                       READPT    335
      WRITE(LOUT,6500) NEXC,LEXC                                        READPT    336
      WRITE(IU6,6500) NEXC,LEXC                                         READPT    337
C                                                                       READPT    338
CD                                                                      READPT    339
CD  STEP 4. SET GOVERNOR POINTERS FOR LP UNITS                          READPT    340
CD                                                                      READPT    341
      DO 2200 II=1,NGEN                                                 READPT    342
        KK=NSORDE(II)                                                   READPT    343
        IF(IGV(KK).EQ.1.OR.IGV(KK).EQ.4)THEN                            READPT    344
          KGVREC=JDREC(KK)+5                                            READPT    345
          READ(IU31,REC=KGVREC)(BUF(K),K=1,50)                          READPT    346
          LPGLFN=IFIX(BUF(1))                                           READPT    347
          IF(LPGLFN.EQ.0)GOTO 2200                                      READPT    348
          IMAC2=' '//CBUF(2)(4:4)                                       READPT    349
          CALL ADFGEN(1,KFOUND,NGEN,LPGLFN,IMAC2,LFGEN,XGEID,NSORDE)    READPT    350
          IF(KFOUND.LE.0)THEN                                           READPT    351
            WRITE(MSG(1),6600)LFGEN(KK),XGEID(KK)                       READPT    352
            WRITE(MSG(2),6700)LPGLFN,IMAC2                              READPT    353
            CALL PRTMSG(2)                                              READPT    354
          ELSE                                                          READPT    355
            JJ=NSORDE(KFOUND)                                           READPT    356
            IGV(JJ)=-KK                                                 READPT    357
          ENDIF                                                         READPT    358
        ENDIF                                                           READPT    359
 2200 CONTINUE                                                          READPT    360
C                                                                       READPT    361
      WRITE(IU6,5900) NGEN,LSORE                                        READPT    362
C                                                                       READPT    363
      RETURN                                                            READPT    364
C                                                                       READPT    365
 4200 FORMAT(' *** ERROR THE FOLLOWING DYNAMIC DATA CARD CONTAINS AN'   READPT    366
     *,' INVALID BUS')                                                  READPT    367
 4300 FORMAT(5X,'NUMBER - ',I6)                                         READPT    368
 5900 FORMAT (/,4X,69('-'),/,4X,'NO.OF SOURCE IMPED RECD READ =',I5,    READPT    369
     1 ', NO. OF MATCHED GENERATORS =',I5,/,4X,69('-'))                 READPT    370
 6000 FORMAT(//,15X,'PSS/E MODELS NOT CONVERTED',/,15X,27('='),//       READPT    371
     *,4('   BUS# MODEL  GID '),/,4('  ----- ------ --- '))             READPT    372
 6100 FORMAT(//,34X,'PSS/E MODELS NOT CONVERTED',/,34X,27('='),//       READPT    373
     *,6('   BUS# MODEL  GID '),/,6('  ----- ------ --- '))             READPT    374
 6200 FORMAT('1 WARNING AND ERROR MESSAGES REPORT',T120,'PAGE:',I4,//)  READPT    375
 6300 FORMAT(//,20X,'PSS/E MODELS WITHOUT MATCHING GENERATOR',/,20X     READPT    376
     *,39('='),//,4('   BUS# MODEL  GID '),/,4('  ----- ------ --- '))  READPT    377
 6400 FORMAT(//,45X,'PSS/E MODELS WITHOUT MATCHING GENERATOR',/,45X     READPT    378
     *,39('='),//,6('   BUS# MODEL  GID '),/,6('  ----- ------ --- '))  READPT    379
 6500 FORMAT(/,4X,69('-'),/4X,'NO. OF DYNAMIC DATA SET READ =',I5,      READPT    380
     1 ', NO. OF MATCHED DATA SETS  =',I5/4X,69('-'))                   READPT    381
 6600 FORMAT(' *** ERROR - FOR THE HP UNIT ',I6,' GID: ',A2)            READPT    382
 6700 FORMAT('     SPECIFIED LP UNIT ',I6,' GID: ',A2,                  READPT    383
     +       ' DOES NOT EXIST')                                         READPT    384
 7900 FORMAT(' *** ERROR - MAXIMUM NUMBER OF CON SAVING MODELS ')       READPT    385
 8000 FORMAT('             ALLOWED IS CURRENTLY 20.')                   READPT    386
      END                                                               READPT    387
C-----------------------------------------------------------------------READPT    388
      SUBROUTINE REPTRE(IUX,NLF,IMODEL,IMAC,BUF,KXUSER,IMAG,NEXC,       READPT    389
     +                   FCARD,*)                                       READPT    390
CD                                                                      READPT    391
CD     TO READ PTI DYDA DATA FOR EACH DYNAMIC DEVICE AND LOAD INTO      READPT    392
CD     A TEMPORARY BUFFER                                               READPT    393
CD                                                                      READPT    394
      INCLUDE 'CNMSG.INS'                                               READPT    395
C                                                                       READPT    396
      CHARACTER*132 RECORD,BLANK,FCARD                                  READPT    397
      CHARACTER*700 CARRAY                                              READPT    398
      CHARACTER*50 COMMAS                                               READPT    399
      CHARACTER*6   IMODEL,JMODEL                                       READPT    400
      CHARACTER*4   C                                                   READPT    401
      CHARACTER*1   PIP,SLASH,IMAC,IMAC1,CH                             READPT    402
C                                                                       READPT    403
      DIMENSION BUF(50)                                                 READPT    404
C                                                                       READPT    405
      EQUIVALENCE (C,CK)                                                READPT    406
C                                                                       READPT    407
                                                                        READPT    408
      DATA COMMAS                                                       READPT    409
     +    /',,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,'/        READPT    410
      DATA NLF1,JMODEL,IMAC1/0,'      ',' '/                            READPT    411
      DATA PIP,SLASH/'''','/'/                                          READPT    412
      DATA BLANK/' '/                                                   READPT    413
C                                                                       READPT    414
   1  CONTINUE                                                          READPT    415
C                                                                       READPT    416
      K=0                                                               READPT    417
      KERR=0                                                            OHV3-1      3
      IBLK=0                                                            READPT    418
      IPOS1=0                                                           READPT    419
      KXUSER=0                                                          READPT    420
      CALL FMOVE(0,BUF,BUF,50)                                          READPT    421
C                                                                       READPT    422
    5 READ(IUX,'(A)',IOSTAT=IOS) RECORD                                 READPT    423
      II=IFNBLK(RECORD,132)                                             READPT    424
      IF(II.EQ.0.OR.RECORD(II:II).EQ.SLASH)GOTO 5                       READPT    425
      GOTO 9                                                            READPT    426
C                                                                       READPT    427
   10 CONTINUE                                                          READPT    428
      READ(IUX,'(A)',IOSTAT=IOS) RECORD                                 READPT    429
C                                                                       READPT    430
    9 IF(IOS.NE.0.OR.RECORD(1:5).EQ.'EDATA')THEN                        READPT    431
         RETURN 1                                                       READPT    432
      ENDIF                                                             READPT    433
      IPOS=0                                                            READPT    434
   11 IPOS=IPOS+1                                                       READPT    435
      IF(IPOS.GT.132) GOTO 10                                           READPT    436
      CH=RECORD(IPOS:IPOS)                                              READPT    437
      IF(CH.EQ.',') CH=' '                                              READPT    438
      IF(CH.EQ.' ')THEN                                                 READPT    439
        IF(IBLK.NE.0) GOTO 11                                           READPT    440
        IBLK=1                                                          READPT    441
      ENDIF                                                             READPT    442
      IF(CH.NE.'/')THEN                                                 READPT    443
         IPOS1=IPOS1+1                                                  READPT    444
         IF(IPOS1.GT.700)THEN                                           READPT    445
            WRITE(MSG(1),1000) NLF                                      READPT    446
            WRITE(MSG(2),1010)                                          READPT    447
            MSG(3)=RECORD                                               READPT    448
            CALL PRTMSG(3)                                              READPT    449
            KERR=1                                                      READPT    450
         ELSE                                                           READPT    451
            CARRAY(IPOS1:IPOS1)=CH                                      READPT    452
            IF(CH.NE.' ') IBLK=0                                        READPT    453
         ENDIF                                                          READPT    454
         GOTO 11                                                        READPT    455
      ENDIF                                                             READPT    456
C                                                                       READPT    457
C                                                                       READPT    458
C                                                                       READPT    459
      I1=700-IPOS1                                                      READPT    460
      IF(I1.GT.0)THEN                                                   READPT    461
        IF(I1.GT.50)I1=50                                               READPT    462
        CARRAY(IPOS1+1:)=COMMAS(1:I1)                                   READPT    463
      ENDIF                                                             READPT    464
      IF(KERR.NE.0) GOTO 1                                              READPT    465
C                                                                       READPT    466
      FCARD=CARRAY(1:132)                                               READPT    467
      READ(CARRAY,*,IOSTAT=IOS) NLF,IMODEL                              READPT    468
      IF(IOS.NE.0.OR.NLF.GT.99998) RETURN 1                             READPT    469
C                                                                       READPT    470
      IPOS=INDEX(CARRAY,PIP)                                            READPT    471
      IPOS=INDEX(CARRAY(IPOS+1:),PIP)+IPOS+2                            READPT    472
C                                                                       READPT    473
      IF(CARRAY(IPOS:IPOS).EQ.PIP) IPOS=IPOS+1                          READPT    474
      IMAC=CARRAY(IPOS:IPOS)                                            READPT    475
      IPOS=IPOS+2                                                       READPT    476
C                                                                       READPT    477
C     IF IT IS AN USER DEFINED MODEL THEN                               READPT    478
C                                                                       READPT    479
      J=1                                                               READPT    480
      IF(IMODEL.EQ.'USRMDL')THEN                                        READPT    481
         READ(CARRAY(IPOS:),*) IMODEL                                   READPT    482
         IPOS=INDEX(CARRAY(IPOS:),PIP)+IPOS                             READPT    483
         IPOS=INDEX(CARRAY(IPOS:),PIP)+IPOS                             READPT    484
C                                                                       READPT    485
         IF(IMODEL.EQ.'OEX3'.OR.                                        READPT    486
     +      IMODEL.EQ.'OEX12'.OR.                                       READPT    487
     +      IMODEL.EQ.'OSTAB2'.OR.                                      READPT    488
     +      IMODEL.EQ.'OSTAB5') GOTO 200                                READPT    489
C                                                                       READPT    490
         KXUSER=1                                                       READPT    491
C                                                                       READPT    492
         DO 100 IK=1,7                                                  READPT    493
           IPOS=INDEX(CARRAY(IPOS:),' ')+IPOS                           READPT    494
           READ(CARRAY(IPOS:),*) BUF(IK)                                READPT    495
100      CONTINUE                                                       READPT    496
C                                                                       READPT    497
         IPOS=INDEX(CARRAY(IPOS:),' ')+IPOS                             READPT    498
         C='   '//CARRAY(IPOS:IPOS)                                     READPT    499
         BUF(8)=CK                                                      READPT    500
         IPOS=IPOS+2                                                    READPT    501
         J=9                                                            READPT    502
C                                                                       READPT    503
C     FOR HP/LP GOVERNOR MODELS                                         READPT    504
C                                                                       READPT    505
      ELSEIF(IMODEL.EQ.'IEEEG1'.OR.IMODEL.EQ.'CRCMGV')THEN              READPT    506
         IF(CARRAY(IPOS:IPOS).EQ.' ') IPOS=IPOS+1                       READPT    507
         READ(CARRAY(IPOS:),*) BUF(1)                                   READPT    508
         IPOS=INDEX(CARRAY(IPOS:),' ')+IPOS                             READPT    509
         IF(CARRAY(IPOS:IPOS).EQ.PIP) IPOS=IPOS+1                       READPT    510
         C='   '//CARRAY(IPOS:IPOS)                                     READPT    511
         BUF(2)=CK                                                      READPT    512
         IPOS=IPOS+2                                                    READPT    513
         J=3                                                            READPT    514
      ENDIF                                                             READPT    515
 200  CARRAY(1:IPOS-1)=BLANK(1:IPOS-1)                                  READPT    516
      READ(CARRAY,*,IOSTAT=IOS) (BUF(I),I=J,50)                         READPT    517
      NEXC=NEXC+1                                                       READPT    518
      RETURN                                                            READPT    519
C                                                                       READPT    520
 1000 FORMAT(' *** ERROR IN READING DYNAMIC DATA FILE FOR BUS#',I6)     READPT    521
 1010 FORMAT(5X,'THE FOLLOWING CARRAY WILL BE DISREGARDED')             READPT    522
      END                                                               READPT    523
C-----------------------------------------------------------------------READPT    524
      SUBROUTINE WHICHM(IMODEL,MGROUP,MODEL)                            READPT    525
CD                                                                      READPT    526
CD    THIS ROUTINE CLASSIFIES IMODEL WITH MGROUP AND MODEL NUMBER       READPT    527
CD                                                                      READPT    528
CD    MGROUP = GROUP NUMBER                                             READPT    529
CD    IMODEL = MODEL NAME                                               READPT    530
CD    MODEL  = MODEL NUMBER                                             READPT    531
CD                                                                      READPT    532
      INCLUDE 'PARX.INS'                                                READPT    533
      INCLUDE 'CNCPT2.INS'                                              READPT    534
C                                                                       READPT    535
      CHARACTER*(*) IMODEL                                              READPT    536
C                                                                       READPT    537
C     GENERATOR                                                         READPT    538
      MGROUP=1                                                          READPT    539
      DO 100 MODEL=1,NMODGN                                             READPT    540
  100 IF(IMODEL.EQ.GENMOD(MODEL)) RETURN                                READPT    541
C                                                                       READPT    542
C     EXCITER                                                           READPT    543
      MGROUP=2                                                          READPT    544
      DO 200 MODEL=1,NMODEX                                             READPT    545
  200 IF(IMODEL.EQ.EXCMOD(MODEL)) RETURN                                READPT    546
C                                                                       READPT    547
C     TERMINAL VOLTAGE COMPENSATOR                                      READPT    548
      MGROUP=3                                                          READPT    549
      DO 300 MODEL=1,NMODVC                                             READPT    550
  300 IF(IMODEL.EQ.EVCMOD(MODEL)) RETURN                                READPT    551
C                                                                       READPT    552
C     STABILIZER                                                        READPT    553
      MGROUP=4                                                          READPT    554
      DO 400 MODEL=1,NMODST                                             READPT    555
  400 IF(IMODEL.EQ.STBMOD(MODEL)) RETURN                                READPT    556
C                                                                       READPT    557
C     GOVERNOR                                                          READPT    558
      MGROUP=5                                                          READPT    559
      DO 500 MODEL=1,NMODGV                                             READPT    560
  500 IF(IMODEL.EQ.GOVMOD(MODEL)) RETURN                                READPT    561
C                                                                       READPT    562
C     SVC                                                               READPT    563
      MGROUP=6                                                          READPT    564
      DO 600 MODEL=1,NMODSV                                             READPT    565
  600 IF(IMODEL.EQ.SVCMOD(MODEL)) RETURN                                READPT    566
C                                                                       READPT    567
C     UNKNOWN MODELS                                                    READPT    568
      MGROUP=7                                                          READPT    569
      MODEL=-1                                                          READPT    570
      RETURN                                                            READPT    571
      END                                                               READPT    572
C-----------------------------------------------------------------------READPT    573
      SUBROUTINE COVPTD                                                 READPT    574
CD                                                                      READPT    575
CD THIS ROUTINE COVERTS THE PTI DYNAMIC DATA AND STORES THEM IN THE     READPT    576
CD PROGRAM ARRAYS                                                       READPT    577
CD                                                                      READPT    578
      INCLUDE 'PARX.INS'                                                READPT    579
      INCLUDE 'CNMNEW.INS'                                              READPT    580
      INCLUDE 'CNGSRC.INS'                                              READPT    581
      INCLUDE 'CNCPT1.INS'                                              READPT    582
      INCLUDE 'CNLSTA.INS'                                              READPT    583
      INCLUDE 'CNB19.INS'                                               READPT    584
      INCLUDE 'CNLFDA.INS'                                              READPT    585
      INCLUDE 'CNIPTR.INS'                                              READPT    586
      INCLUDE 'CNUNIT.INS'                                              READPT    587
      INCLUDE 'CNLUN.INS'                                               READPT    588
      INCLUDE 'CNFLAG.INS'                                              READPT    589
      INCLUDE 'CNMSG.INS'                                               READPT    590
      INCLUDE 'CNCPT2.INS'                                              READPT    591
      INCLUDE 'CNCPT3.INS'                                              READPT    592
      INCLUDE 'CNSVCD.INS'                                              READPT    593
C                                                                       READPT    594
      CHARACTER*4  CNAME(2),CBUF(50),CVCBUF(50),LPGID                   READPT    595
      CHARACTER*2  IMAC2                                                READPT    596
      CHARACTER*1  HPCCT                                                READPT    597
C                                                                       READPT    598
      INTEGER INAME(2)                                                  READPT    599
      DIMENSION BUF(50),VCBUF(50)                                       READPT    600
      EQUIVALENCE (INAME(1),CNAME(1))                                   READPT    601
      EQUIVALENCE (CBUF(1),BUF(1))                                      READPT    602
      EQUIVALENCE (CVCBUF(1),VCBUF(1))                                  READPT    603
      EQUIVALENCE (LPGID,ILPGID)                                        READPT    604
C                                                                       READPT    605
      LDEB=(JDEB(2).NE.0)                                               READPT    606
C                                                                       READPT    607
C                                                                       READPT    608
CD                                                                      READPT    609
CD STEP 1.0 COVERT AND STORE GENERATOR DATA                             READPT    610
CD                                                                      READPT    611
      UL=0.8                                                            READPT    612
      UH=99.0                                                           READPT    613
      IVTN=0                                                            READPT    614
      IMAC2=' '                                                         READPT    615
C                                                                       READPT    616
      DO 1000 L=1,NGEN                                                  READPT    617
C                                                                       READPT    618
      KGNUSR=0                                                          READPT    619
C                                                                       READPT    620
      K=NSORDE(L)                                                       READPT    621
      KTYPE=ITYPE(K)                                                    READPT    622
C                                                                       READPT    623
      IF(KTYPE.GT.1000)THEN                                             READPT    624
        KGNUSR=1                                                        READPT    625
        KTYPE=KTYPE-1000                                                READPT    626
      ENDIF                                                             READPT    627
C                                                                       READPT    628
      IF(KTYPE.EQ.0.OR.KTYPE.GT.4) GOTO 1000                            READPT    629
C                                                                       READPT    630
      IGEN=0                                                            READPT    631
      LPBUS=0                                                           READPT    632
C                                                                       READPT    633
      NLF=LFGEN(K)                                                      READPT    634
      ISAT=0                                                            READPT    635
      JEXC=0                                                            READPT    636
      JSTAB=0                                                           READPT    637
      JFLTN=0                                                           READPT    638
      JGOV=0                                                            READPT    639
C                                                                       READPT    640
      INTNUM=MNEW(NLF)                                                  READPT    641
      IF(INTNUM.EQ.0)THEN                                               READPT    642
        KFOUND=0                                                        READPT    643
      ELSE                                                              READPT    644
        INT8=INTNUM*8                                                   READPT    645
        KFOUND=1                                                        READPT    646
      ENDIF                                                             READPT    647
C                                                                       READPT    648
      IF(KFOUND.LE.0)THEN                                               READPT    649
        BUSNAM='            '                                           READPT    650
      ELSE                                                              READPT    651
        INAME(1)=NAMES(INT8-2)                                          READPT    652
        INAME(2)=NAMES(INT8-1)                                          READPT    653
        BUSNAM=CNAME(1)//CNAME(2)//'    '                               READPT    654
      ENDIF                                                             READPT    655
      NGRI=' '                                                          READPT    656
      KCCT=XGEID(K)(2:2)                                                READPT    657
C                                                                       READPT    658
      KREC=JDREC(K)                                                     READPT    659
      READ (IU31,REC=KREC) (BUF(LK),LK=1,50)                            READPT    660
C                                                                       READPT    661
      IF(KGNUSR.NE.0)THEN                                               READPT    662
        NLFO=IFIX(BUF(7))                                               READPT    663
        IMAC2=' '//CBUF(8)(4:4)                                         READPT    664
        CALL ADFGEN(1,KFOUND,NGEN,NLFO,IMAC2,LFGEN,XGEID,NSORDE)        READPT    665
        IF(KFOUND.LE.0)THEN                                             READPT    666
          WRITE(MSG(1),7200) NLF,KCCT                                   READPT    667
          WRITE(MSG(2),7300) NLFO,IMAC2(2:2)                            READPT    668
          CALL PRTMSG(2)                                                READPT    669
          GOTO 1000                                                     READPT    670
        ELSE                                                            READPT    671
          KK=NSORDE(KFOUND)                                             READPT    672
          KRECU=JDREC(KK)                                               READPT    673
          READ (IU31,REC=KRECU) (BUF(LK),LK=1,50)                       READPT    674
        ENDIF                                                           READPT    675
      ENDIF                                                             READPT    676
C                                                                       READPT    677
      GOTO (100,200,300,400), KTYPE                                     READPT    678
C                                                                       READPT    679
C  GENERATOR TYPE GENCLS                                                READPT    680
C                                                                       READPT    681
  100 CONTINUE                                                          READPT    682
C                                                                       READPT    683
      HM=BUF(1)                                                         READPT    684
      IF(HM.LT.1.0E-6)THEN                                              READPT    685
         WRITE(MSG(1),7000) NLF,KCCT                                    READPT    686
         CALL PRTMSG(1)                                                 READPT    687
         GOTO 1000                                                      READPT    688
      ENDIF                                                             READPT    689
      DAMP=BUF(2)                                                       READPT    690
      XPD=GSRCD(5,K)                                                    READPT    691
      BASPR=GSRCD(3,K)                                                  READPT    692
      BASVR=GSRCD(8,K)                                                  READPT    693
C                                                                       READPT    694
      IF((BASPR.EQ.0.).OR.(BASVR.EQ.0.))THEN                            READPT    695
         WRITE(MSG(1),3900)NLF,KCCT                                     READPT    696
         WRITE(MSG(2),4000)                                             READPT    697
         CALL PRTMSG(2)                                                 READPT    698
         GOTO 1000                                                      READPT    699
      ENDIF                                                             READPT    700
      IGEN=3                                                            READPT    701
      GOTO 600                                                          READPT    702
C                                                                       READPT    703
C  GENERATOR TYPE GENROU                                                READPT    704
C                                                                       READPT    705
  200 CONTINUE                                                          READPT    706
      TPDO=BUF(1)                                                       READPT    707
      TPPDO=BUF(2)                                                      READPT    708
      TPQO=BUF(3)                                                       READPT    709
      TPPQO=BUF(4)                                                      READPT    710
      XD=BUF(7)                                                         READPT    711
      XQ=BUF(8)                                                         READPT    712
      XPD=BUF(9)                                                        READPT    713
      XPQ=BUF(10)                                                       READPT    714
      XPPD=BUF(11)                                                      READPT    715
      XPPQ=BUF(11)                                                      READPT    716
      XL=BUF(12)                                                        READPT    717
      HM=BUF(5)                                                         READPT    718
      DAMP=BUF(6)                                                       READPT    719
      SE1=BUF(13)                                                       READPT    720
      SE2=BUF(14)*1.2                                                   READPT    721
      IF(SE1.GT.0.0.AND.SE2.GT.0) ISAT=2                                READPT    722
      GOTO 500                                                          READPT    723
C                                                                       READPT    724
C  GENERATOR TYPE GENSAL                                                READPT    725
C                                                                       READPT    726
  300 CONTINUE                                                          READPT    727
      TPDO=BUF(1)                                                       READPT    728
      TPQO=BUF(3)                                                       READPT    729
      TPPDO=BUF(2)                                                      READPT    730
      TPPQO=0.0                                                         READPT    731
      XD=BUF(6)                                                         READPT    732
      XQ=BUF(7)                                                         READPT    733
      XPD=BUF(8)                                                        READPT    734
      XPQ=BUF(9)                                                        READPT    735
C/*                                                                     READPT    736
C FOR GENSAL: IN  PTI X"Q=X"D = X'Q (OH) => SET X"Q & X"D = 0.0         READPT    737
      XPPD=BUF(9)                                                       READPT    738
      XPPQ=0.0                                                          READPT    739
C*/                                                                     READPT    740
      XL=BUF(10)                                                        READPT    741
      HM=BUF(4)                                                         READPT    742
      DAMP=BUF(5)                                                       READPT    743
      SE1=BUF(11)                                                       READPT    744
      SE2=BUF(12)*1.2                                                   READPT    745
      IF(SE1.GT.0.0.AND.SE2.GT.0) ISAT=1                                READPT    746
      GOTO 500                                                          READPT    747
C                                                                       READPT    748
C  GENERATOR TYPE GENTRA                                                READPT    749
C                                                                       READPT    750
  400 CONTINUE                                                          READPT    751
      WRITE(MSG(1),6900) NLF,KCCT                                       READPT    752
      CALL PRTMSG(1)                                                    READPT    753
      TPPDO=0.0                                                         READPT    754
      TPPQO=0.0                                                         READPT    755
      TPQO=0.0                                                          READPT    756
      TPDO=BUF(1)                                                       READPT    757
      XD=BUF(4)                                                         READPT    758
      XQ=BUF(5)                                                         READPT    759
      XPD=BUF(6)                                                        READPT    760
      XPQ=0.0                                                           READPT    761
      XPPD=0.0                                                          READPT    762
      XPPQ=0.0                                                          READPT    763
      HM=BUF(2)                                                         READPT    764
      DAMP=BUF(3)                                                       READPT    765
      XL=XPD/2                                                          READPT    766
      SE1=BUF(7)                                                        READPT    767
      SE2=BUF(8)*1.2                                                    READPT    768
      IF(SE1.GT.0.0.AND.SE2.GT.0) ISAT=2                                READPT    769
C                                                                       READPT    770
  500 CONTINUE                                                          READPT    771
      IF(HM.LT.1.0E-6)THEN                                              READPT    772
         WRITE(MSG(1),7000) NLF,KCCT                                    READPT    773
         CALL PRTMSG(1)                                                 READPT    774
         GOTO 1000                                                      READPT    775
      ENDIF                                                             READPT    776
C                                                                       READPT    777
      BASVR=GSRCD(8,K)                                                  READPT    778
C/*                                                                     READPT    779
C DO NOT ADD XT TO X"D AND X"Q FOR GENSAL                               READPT    780
C*/                                                                     READPT    781
      RA=GSRCD(4,K)                                                     READPT    782
      BASPR=GSRCD(3,K)                                                  READPT    783
      IF(ISAT.GT.0)THEN                                                 READPT    784
         ASAT=SE1*SE1/SE2                                               READPT    785
         BSAT=5.0*ALOG(SE2/SE1)                                         READPT    786
      ENDIF                                                             READPT    787
C                                                                       READPT    788
C     PREPARE EXCITER RECORD                                            READPT    789
C                                                                       READPT    790
      IEXK=IEX(K)                                                       READPT    791
      IF(IEXK.EQ.0)GOTO 600                                             READPT    792
C                                                                       READPT    793
      KREC1=KREC+3                                                      READPT    794
      READ (IU31,REC=KREC1) (BUF(LK),LK=1,50)                           READPT    795
C                                                                       READPT    796
      IF(IEXK.GT.1000)THEN                                              READPT    797
        IEXK=IEXK-1000                                                  READPT    798
        NLFO=IFIX(BUF(7))                                               READPT    799
        IMAC2=' '//CBUF(8)(4:4)                                         READPT    800
        CALL ADFGEN(1,KFOUND,NGEN,NLFO,IMAC2,LFGEN,XGEID,NSORDE)        READPT    801
        IF(KFOUND.LE.0)THEN                                             READPT    802
          WRITE(MSG(1),7400) NLF,KCCT                                   READPT    803
          WRITE(MSG(2),7500) NLFO,IMAC2(2:2)                            READPT    804
          CALL PRTMSG(2)                                                READPT    805
          GOTO 600                                                      READPT    806
        ELSE                                                            READPT    807
          KK=NSORDE(KFOUND)                                             READPT    808
          KRECU=JDREC(KK)+3                                             READPT    809
          READ (IU31,REC=KRECU) (BUF(LK),LK=1,50)                       READPT    810
        ENDIF                                                           READPT    811
      ENDIF                                                             READPT    812
C                                                                       READPT    813
      IVCK=IEVC(K)                                                      READPT    814
      IF(IVCK.NE.0)THEN                                                 READPT    815
        KREC1=KREC+2                                                    READPT    816
        READ (IU31,REC=KREC1) (VCBUF(LK),LK=1,50)                       READPT    817
        IF(IVCK.GT.1000)THEN                                            READPT    818
          IVCK=IVCK-1000                                                READPT    819
          NLFO=IFIX(VCBUF(7))                                           READPT    820
          IMAC2=' '//CVCBUF(8)(4:4)                                     READPT    821
          CALL ADFGEN(1,KFOUND,NGEN,NLFO,IMAC2,LFGEN,XGEID,NSORDE)      READPT    822
          IF(KFOUND.LE.0)THEN                                           READPT    823
            WRITE(MSG(1),7600) NLF,KCCT                                 READPT    824
            WRITE(MSG(2),7700) NLFO,IMAC2(2:2)                          READPT    825
            CALL PRTMSG(2)                                              READPT    826
            IVCK=0                                                      READPT    827
          ELSE                                                          READPT    828
            KK=NSORDE(KFOUND)                                           READPT    829
            KRECU=JDREC(KK)+2                                           READPT    830
            READ (IU31,REC=KRECU) (VCBUF(LK),LK=1,50)                   READPT    831
          ENDIF                                                         READPT    832
        ENDIF                                                           READPT    833
        IF(IVCK.EQ.2)THEN                                               READPT    834
          VCBUF(2)=-VCBUF(1)                                            READPT    835
          VCBUF(1)=0.0                                                  READPT    836
        ENDIF                                                           READPT    837
      ENDIF                                                             READPT    838
C                                                                       READPT    839
      IF(IVCK.LE.0) CALL FMOVE(0,VCBUF,VCBUF,50)                        READPT    840
C                                                                       READPT    841
      CALL FMOVE(0,EXC,EXC,32)                                          READPT    842
      CALL EXCITE(IEXK,JEXC,IERR,EXC,BUF,VCBUF,NLF,KCCT)                READPT    843
C                                                                       READPT    844
C     PREPARE STABILIZER RECORD                                         READPT    845
C                                                                       READPT    846
      KSTAB=ISTAB(K)                                                    READPT    847
      IF(KSTAB.EQ.0)GOTO 600                                            READPT    848
C                                                                       READPT    849
      KREC2=KREC+4                                                      READPT    850
      READ (IU31,REC=KREC2) (BUF(LK),LK=1,50)                           READPT    851
C                                                                       READPT    852
      IF(KSTAB.GT.1000)THEN                                             READPT    853
        KSTAB=KSTAB-1000                                                READPT    854
        NLFO=IFIX(BUF(7))                                               READPT    855
        IMAC2=' '//CBUF(8)(4:4)                                         READPT    856
        CALL ADFGEN(1,KFOUND,NGEN,NLFO,IMAC2,LFGEN,XGEID,NSORDE)        READPT    857
        IF(KFOUND.LE.0)THEN                                             READPT    858
          WRITE(MSG(1),7800) NLF,KCCT                                   READPT    859
          WRITE(MSG(2),7900) NLFO,IMAC2(2:2)                            READPT    860
          CALL PRTMSG(2)                                                READPT    861
          GOTO 600                                                      READPT    862
        ELSE                                                            READPT    863
          KK=NSORDE(KFOUND)                                             READPT    864
          KRECU=JDREC(KK)+4                                             READPT    865
          READ (IU31,REC=KRECU) (BUF(LK),LK=1,50)                       READPT    866
        ENDIF                                                           READPT    867
      ENDIF                                                             READPT    868
C                                                                       READPT    869
      CALL FMOVE(0,EXS,EXS,32)                                          READPT    870
      CALL STABIL(KSTAB,JSTAB,JFLTN,NLF,KCCT,IERR,EXS,EXF,BUF)          READPT    871
C                                                                       READPT    872
  600 CONTINUE                                                          READPT    873
C                                                                       READPT    874
C       PREPARE GOVERNOR RECORD                                         READPT    875
C                                                                       READPT    876
      KGOV=IGV(K)                                                       READPT    877
      IF(KGOV.EQ.0)GOTO 800                                             READPT    878
C                                                                       READPT    879
      CALL FMOVE(0,EXG,EXG,24)                                          READPT    880
      IF(KGOV.LT.0)THEN                                                 READPT    881
        KKK=-KGOV                                                       READPT    882
        KREC3=JDREC(KKK)+5                                              READPT    883
        READ(IU31,REC=KREC3)(BUF(LK),LK=1,50)                           READPT    884
        KGOV=IGV(KKK)                                                   READPT    885
        NLFHP=LFGEN(KKK)                                                READPT    886
        HPCCT=XGEID(KKK)(2:2)                                           READPT    887
        BASPRH=GSRCD(3,KKK)                                             READPT    888
        CALL GOVERN(KGOV,JGOV,NLFHP,HPCCT,IERR,BASPRH,BASPR,EXG,BUF)    READPT    889
        IF(IERR.EQ.2)THEN                                               READPT    890
          JGOV=0                                                        READPT    891
        ELSE                                                            READPT    892
          JGOV=5                                                        READPT    893
        ENDIF                                                           READPT    894
      ELSE                                                              READPT    895
        KREC3=KREC+5                                                    READPT    896
        READ (IU31,REC=KREC3) (BUF(LK),LK=1,50)                         READPT    897
C                                                                       READPT    898
        IF(KGOV.EQ.1.OR.KGOV.EQ.4)THEN                                  READPT    899
          BASPRL=-999.0                                                 READPT    900
          LPGLFN=IFIX(BUF(1))                                           READPT    901
          IMAC2=' '//CBUF(2)(4:4)                                       READPT    902
          IF(LPGLFN.NE.0)THEN                                           READPT    903
            CALL ADFGEN (1,KFOUND,NGEN,LPGLFN,IMAC2,LFGEN,XGEID,NSORDE) READPT    904
            IF(KFOUND.GT.0)THEN                                         READPT    905
              KKK=NSORDE(KFOUND)                                        READPT    906
              BASPRL=GSRCD(3,KKK)                                       READPT    907
              IEXG(1)=LPGLFN                                            READPT    908
              LPGID=' '                                                 READPT    909
              LPGID(3:4)=IMAC2                                          READPT    910
              IEXG(2)=ILPGID                                            READPT    911
            ENDIF                                                       READPT    912
          ENDIF                                                         READPT    913
        ELSE                                                            READPT    914
          IF(KGOV.GT.1000)THEN                                          READPT    915
            KGOV=KGOV-1000                                              READPT    916
            NLFO=IFIX(BUF(7))                                           READPT    917
            IMAC2=' '//CBUF(8)(4:4)                                     READPT    918
            CALL ADFGEN(1,KFOUND,NGEN,NLFO,IMAC2,LFGEN,XGEID,NSORDE)    READPT    919
            IF(KFOUND.LE.0)THEN                                         READPT    920
              WRITE(MSG(1),8000) NLF,KCCT                               READPT    921
              WRITE(MSG(2),8100) NLFO,IMAC2(2:2)                        READPT    922
              CALL PRTMSG(2)                                            READPT    923
              GOTO 800                                                  READPT    924
            ELSE                                                        READPT    925
              KK=NSORDE(KFOUND)                                         READPT    926
              KRECU=JDREC(KK)+5                                         READPT    927
              READ (IU31,REC=KRECU) (BUF(LK),LK=1,50)                   READPT    928
            ENDIF                                                       READPT    929
          ENDIF                                                         READPT    930
        ENDIF                                                           READPT    931
        CALL GOVERN(KGOV,JGOV,NLF,KCCT,IERR,BASPR,BASPRL,EXG,BUF)       READPT    932
        IF((KGOV.EQ.1.OR.KGOV.EQ.4).AND.LPGLFN.NE.0.AND.JGOV.EQ.4)THEN  READPT    933
          IF(IGEN.EQ.3)THEN                                             READPT    934
            IGEN=7                                                      READPT    935
          ELSE                                                          READPT    936
            IGEN=4                                                      READPT    937
          ENDIF                                                         READPT    938
        ENDIF                                                           READPT    939
      ENDIF                                                             READPT    940
C                                                                       READPT    941
  800 CONTINUE                                                          READPT    942
C                                                                       READPT    943
         IF(LDEB)THEN                                                   READPT    944
         WRITE (IUD6,6300) NLF,KCCT,IPFA,IQFA,NLF,BUSNAM                READPT    945
         WRITE (IUD6,6200) IGEN,ISAT,JEXC,IVTN,JSTAB,JGOV,0,0,          READPT    946
     +                  0,JFLTN,0,0                                     READPT    947
         WRITE (IUD6,3200) RA,XD,XQ,XL,XPD,XPQ,XPPD,XPPQ                READPT    948
         WRITE (IUD6,3200) TPDO,TPQO,TPPDO,TPPQO                        READPT    949
         IF(ISAT.NE.0) WRITE (IUD6,3200) ASAT,BSAT,UL                   READPT    950
         WRITE (IUD6,3300) HM,DAMP,BASPR,BASVR                          READPT    951
         ENDIF                                                          READPT    952
      IF(JEXC.EQ.0)GOTO 900                                             READPT    953
         IF(LDEB)WRITE (IUD6,3200) (EXC(LK),LK=1,24)                    READPT    954
C        New STABP model formats                                        READPT    955
         IF((JEXC.EQ.3).OR.                                             READPT    956
     1      (JEXC.EQ.4).OR.                                             READPT    957
     2      (JEXC.EQ.5).OR.                                             READPT    958
     3      (JEXC.EQ.6).OR.                                             READPT    959
     4      (JEXC.EQ.8).OR.                                             READPT    960
     5      (JEXC.EQ.30).OR.                                            READPT    961
     6      (JEXC.EQ.32))THEN                                           READPT    962
             IF(LDEB)WRITE(IUD6,3200) (EXC(LK),LK=25,32)                READPT    963
         ENDIF                                                          READPT    964
         IF(JEXC.EQ.32)THEN                                             READPT    965
            IF(LDEB)WRITE(IUD6,3200) (EXC(LK),LK=33,34)                 READPT    966
         ENDIF                                                          READPT    967
      IF(JSTAB.EQ.0)GOTO 900                                            READPT    968
C                                                                       READPT    969
      IRMBUS=0                                                          READPT    970
      IOHTYP=0                                                          READPT    971
C                                                                       READPT    972
C     POSSIBLE STAB TYPES ARE 1,2,5 AND 12                              READPT    973
C                                                                       READPT    974
      IF(JSTAB.LE.5)THEN                                                READPT    975
        IOHTYP=IFIX(EXS(31))                                            READPT    976
        IRMBUS=IFIX(EXS(32))                                            READPT    977
        IF(LDEB)WRITE(IUD6,'(2I5)')IRMBUS,IOHTYP                        READPT    978
      ELSEIF(JSTAB.EQ.12)THEN                                           READPT    979
        IOHTYP=IFIX(EXS(29))                                            READPT    980
        IRMBUS=IFIX(EXS(30))                                            READPT    981
        IOHTY1=IFIX(EXS(31))                                            READPT    982
        IRMBU1=IFIX(EXS(32))                                            READPT    983
        IF(LDEB)WRITE(IUD6,'(4I5)')IRMBUS,IOHTYP,IRMBU1,IOHTY1          READPT    984
      ENDIF                                                             READPT    985
C                                                                       READPT    986
      IF(LDEB)THEN                                                      READPT    987
        WRITE (IUD6,3200) (EXS(LK),LK=1,8)                              READPT    988
        WRITE (IUD6,3200) (EXS(LK),LK=9,16)                             READPT    989
      ENDIF                                                             READPT    990
C                                                                       READPT    991
      IF((JSTAB.EQ.2).OR.                                               READPT    992
     +   (JSTAB.EQ.5).OR.                                               READPT    993
     +   (JSTAB.EQ.12))THEN                                             READPT    994
        IF(LDEB)WRITE(IUD6,3200) (EXS(LK),LK=17,24)                     READPT    995
      ENDIF                                                             READPT    996
      IF(JFLTN.EQ.0)GOTO 900                                            READPT    997
      IF(LDEB)WRITE(IUD6,3200) (EXF(LK),LK=1,7)                         READPT    998
C                                                                       READPT    999
C  GOVERNORS                                                            READPT   1000
C                                                                       READPT   1001
  900 CONTINUE                                                          READPT   1002
      IF(JGOV.EQ.0)GOTO 950                                             READPT   1003
      IF(JGOV.EQ.5)THEN                                                 READPT   1004
            IF(LDEB)WRITE(IUD6,3200) (EXG(LK),LK=17,20)                 READPT   1005
      ELSEIF(JGOV.EQ.6)THEN                                             READPT   1006
            IF(LDEB)WRITE(IUD6,3200) (EXG(LK),LK=1,7)                   READPT   1007
      ELSE                                                              READPT   1008
            IF(LDEB)WRITE(IUD6,3200) (EXG(LK),LK=1,16)                  READPT   1009
            IF(JGOV.EQ.20.AND.LDEB)WRITE(IUD6,3200) 0.,0.,0.,0.,0.      READPT   1010
            IF(JGOV.EQ.53.AND.LDEB)WRITE(IUD6,3200) EXG(17),EXG(18)     READPT   1011
      ENDIF                                                             READPT   1012
CD                                                                      READPT   1013
CD   STORE THE DATA INTO TDDAT AND THE ALIAS ARRAYS                     READPT   1014
CD                                                                      READPT   1015
 950  CALL STGEND                                                       READPT   1016
C                                                                       READPT   1017
 1000 CONTINUE                                                          READPT   1018
C                                                                       READPT   1019
C     ------------------------                                          READPT   1020
C     END OF GENERATOR DO LOOP                                          READPT   1021
C     ------------------------                                          READPT   1022
C                                                                       READPT   1023
CD                                                                      READPT   1024
CD  STEP 2. COVERT AND STORE SVC DATA                                   READPT   1025
CD                                                                      READPT   1026
      ISDIV=0                                                           READPT   1027
      ISVC=1                                                            READPT   1028
      IQF=0                                                             READPT   1029
      MT1=0                                                             READPT   1030
      MT2=0                                                             READPT   1031
      NVSEN1=0                                                          READPT   1032
      NVSEN2=0                                                          READPT   1033
      LCKT=' '                                                          READPT   1034
      GENCKT=' '                                                        READPT   1035
C                                                                       READPT   1036
      DO 1600 L=1,NGEN                                                  READPT   1037
        KSVUSR=0                                                        READPT   1038
        K=NSORDE(L)                                                     READPT   1039
        JJSVC=ITYPE(K)                                                  READPT   1040
C                                                                       READPT   1041
        IF(JJSVC.GT.1000)THEN                                           READPT   1042
          JJSVC=JJSVC-1000                                              READPT   1043
          KSVUSR=1                                                      READPT   1044
        ENDIF                                                           READPT   1045
C                                                                       READPT   1046
        JJSVC=JJSVC-4                                                   READPT   1047
        IF(JJSVC.LE.0) GOTO 1600                                        READPT   1048
C                                                                       READPT   1049
        LSTATK=IGENST(K)                                                READPT   1050
        NLFSV=LFGEN(K)                                                  READPT   1051
        INTNUM=MNEW(NLFSV)                                              READPT   1052
        IF(INTNUM.EQ.0)THEN                                             READPT   1053
          LSTATK=5                                                      READPT   1054
          KFOUND=0                                                      READPT   1055
        ELSE                                                            READPT   1056
          IF(JBSTAT(INTNUM).EQ.4)LSTATK=4                               READPT   1057
          INT8=INTNUM                                                   READPT   1058
          KFOUND=1                                                      READPT   1059
        ENDIF                                                           READPT   1060
C                                                                       READPT   1061
        IF(KFOUND.LE.0)THEN                                             READPT   1062
          SVCNAM='            '                                         READPT   1063
        ELSE                                                            READPT   1064
          INAME(1)=NAMES(INT8-2)                                        READPT   1065
          INAME(2)=NAMES(INT8-1)                                        READPT   1066
          SVCNAM=CNAME(1)//CNAME(2)//'    '                             READPT   1067
        ENDIF                                                           READPT   1068
        SVCKT=XGEID(K)                                                  READPT   1069
C                                                                       READPT   1070
        KREC=JDREC(K)                                                   READPT   1071
        READ(IU31,REC=KREC) (BUF(LK),LK=1,50)                           READPT   1072
C                                                                       READPT   1073
        IF(KSVUSR.NE.0)THEN                                             READPT   1074
          NLFO=IFIX(BUF(7))                                             READPT   1075
          IMAC2=' '//CBUF(8)(4:4)                                       READPT   1076
          CALL ADFGEN(1,KFOUND,NGEN,NLFO,IMAC2,LFGEN,XGEID,NSORDE)      READPT   1077
          IF(KFOUND.LE.0)THEN                                           READPT   1078
            WRITE(MSG(1),8200) NLFSV,SVCKT(2:2)                         READPT   1079
            WRITE(MSG(2),8300) NLFO,IMAC2(2:2)                          READPT   1080
            CALL PRTMSG(2)                                              READPT   1081
            GOTO 1600                                                   READPT   1082
          ELSE                                                          READPT   1083
            KK=NSORDE(KFOUND)                                           READPT   1084
            KRECU=JDREC(KK)                                             READPT   1085
            READ (IU31,REC=KRECU) (BUF(LK),LK=1,50)                     READPT   1086
          ENDIF                                                         READPT   1087
        ENDIF                                                           READPT   1088
C                                                                       READPT   1089
        IF(IEVC(K).EQ.3.OR.IEVC(K).EQ.1003)THEN                         READPT   1090
          KREC=KREC+2                                                   READPT   1091
          READ(IU31,REC=KREC) (VCBUF(LK),LK=1,8)                        READPT   1092
          IF(IEVC(K).EQ.3)THEN                                          READPT   1093
            NVSENX=IFIX(VCBUF(1))                                       READPT   1094
          ELSE                                                          READPT   1095
            NLFO=IFIX(VCBUF(7))                                         READPT   1096
            IMAC2=' '//CBUF(8)(4:4)                                     READPT   1097
            IF(KFOUND.LE.0)THEN                                         READPT   1098
              WRITE(MSG(1),7600) NLFSV,SVCKT(2:2)                       READPT   1099
              WRITE(MSG(2),7700) NLFO,IMAC2(2:2)                        READPT   1100
              CALL PRTMSG(2)                                            READPT   1101
              NVSENX=0                                                  READPT   1102
            ELSE                                                        READPT   1103
              KK=NSORDE(KFOUND)                                         READPT   1104
              KRECU=JDREC(KK)+2                                         READPT   1105
              READ (IU31,REC=KRECU)VCBUF(1)                             READPT   1106
              NVSENX=IFIX(VCBUF(1))                                     READPT   1107
            ENDIF                                                       READPT   1108
          ENDIF                                                         READPT   1109
        ELSE                                                            READPT   1110
          NVSENX=0                                                      READPT   1111
        ENDIF                                                           READPT   1112
C                                                                       READPT   1113
        RBASE=GSRCD(3,K)                                                READPT   1114
        CALL SVCCON(JJSVC,RBASE,BUF)                                    READPT   1115
        CALL STSVCD                                                     READPT   1116
        IGENST(K)=LSTATK*I16B                                           READPT   1117
 1600 CONTINUE                                                          READPT   1118
C                                                                       READPT   1119
      RETURN                                                            READPT   1120
C                                                                       READPT   1121
 3200 FORMAT (8F10.5)                                                   READPT   1122
 3300 FORMAT (3F10.5,4F10.5)                                            READPT   1123
 3900 FORMAT(' *** WARNING - BUS#',I6,1X,'CID',A1                       READPT   1124
     *,' CLASSICAL GENERATOR HAS BASE KV OR BASE MVA EQUAL TO ZERO.')   READPT   1125
 4000 FORMAT ('    GENERATOR IS IGNORED.')                              READPT   1126
 6200 FORMAT(16I5)                                                      READPT   1127
 6300 FORMAT (I5,A5,2I5,T81,'@',I5,1X,A12)                              READPT   1128
 6900 FORMAT(' *** WARNING - BUS#',I6,' CID ',A,                        READPT   1129
     +' GENERATOR TYPE GENTRA - XL IS SET TO X''D/2')                   READPT   1130
 7000 FORMAT(' *** WARNING - BUS#',I6,' CID ',A,' GENERATOR WITH HM'    READPT   1131
     *,' EQUALS 0.0, MACHINE IS IGNORED')                               READPT   1132
 7200 FORMAT(' *** ERROR - CANNOT FIND CON SAVING MODEL FOR GENERATOR', READPT   1133
     +I6,' CID: ',A1)                                                   READPT   1134
 7300 FORMAT('     GENERATOR ',I6,' CID: ',A1,'    DOES NOT EXIST')     READPT   1135
 7400 FORMAT(' *** ERROR - CANNOT FIND CON SAVING MODEL FOR EXCITER',   READPT   1136
     +I6,' CID: ',A1)                                                   READPT   1137
 7500 FORMAT('     EXCITER ',I6,' CID: ',A1,'    DOES NOT EXIST')       READPT   1138
 7600 FORMAT(' *** ERROR - CANNOT FIND CON SAVING MODEL FOR ',          READPT   1139
     +'COMPENSATOR',I6,' CID: ',A1)                                     READPT   1140
 7700 FORMAT('     COMPENSATOR ',I6,' CID: ',A1,'    DOES NOT EXIST')   READPT   1141
 7800 FORMAT(' *** ERROR - CANNOT FIND CON SAVING MODEL FOR STABILIZER',READPT   1142
     +I6,' CID: ',A1)                                                   READPT   1143
 7900 FORMAT('     STABILIZER ',I6,' CID: ',A1,'    DOES NOT EXIST')    READPT   1144
 8000 FORMAT(' *** ERROR - CANNOT FIND CON SAVING MODEL FOR GOVERNOR',  READPT   1145
     +I6,' CID: ',A1)                                                   READPT   1146
 8100 FORMAT('     GOVERNOR ',I6,' CID: ',A1,'    DOES NOT EXIST')      READPT   1147
 8200 FORMAT(' *** ERROR - CANNOT FIND CON SAVING MODEL FOR SVC',       READPT   1148
     +I6,' CID: ',A1)                                                   READPT   1149
 8300 FORMAT('     SVC ',I6,' CID: ',A1,'    DOES NOT EXIST')           READPT   1150
       END                                                              READPT   1151
C-----------------------------------------------------------------------READPT   1152
      SUBROUTINE EXCITE(IEXK,JEXC,IER,EXC,BUF,VCBUF,NLF,KCCT)           READPT   1153
CD                                                                      READPT   1154
CD     TO CONVERT EXCITER MODEL DATA FROM PTI DYDA FORMAT               READPT   1155
CD     TO PSAPAC FORMAT.                                                READPT   1156
CD                                                                      READPT   1157
      INCLUDE 'PARX.INS'                                                READPT   1158
      INCLUDE 'CNMSG.INS'                                               READPT   1159
C                                                                       READPT   1160
      DIMENSION BUF(*)                                                  READPT   1161
      DIMENSION VCBUF(*)                                                READPT   1162
      DIMENSION EXC(*)                                                  READPT   1163
      CHARACTER*1 KCCT                                                  READPT   1164
C                                                                       READPT   1165
      IER=0                                                             READPT   1166
      JEXC=0                                                            READPT   1167
C                                                                       READPT   1168
      CALL FMOVE (0,EXC,EXC,J9E1D)                                      READPT   1169
C                                                                       READPT   1170
C             EXAC1,OEX3,EXST1,IEEET1,IEEET3,IEEET4,IEEEX1,IEEEX4,SCRX, READPT   1171
      GO TO (  660, 665,  670,   680,   690,   700,   710,   705,  720, READPT   1172
C        SEXS, OEX12,EXDC2,IEEET5,EXAC3,EXST2,IEEX2A,IEET5A,IEEEX3,     READPT   1173
     +    730,  735,  737,   738, 7730, 7735,  7740,  7745,  7750,      READPT   1174
C       MNEXL1  EXST3 EXAC4 IEET1S EXAC2 IEEET2 IEEEX2 EXAC1A EXST2A    READPT   1175
     +    7760, 7770, 7780, 7790, 7800,  7810,  7820,   7830, 7735,     READPT   1176
C       IEET1A                                                          READPT   1177
     +     800),IEXK                                                    READPT   1178
C       IEET1A                                                          READPT   1179
C                                                                       READPT   1180
 500  CONTINUE                                                          READPT   1181
C    ........................................................           READPT   1182
C    : If falls into here, Not translatable. Set error code :           READPT   1183
      MSG(1)=' *** WARNING - BUS        GID:   PSS/E EXCITER '//        READPT   1184
     +       'MODEL NOT CONVERTED'                                      READPT   1185
      WRITE(MSG(1)(20:25),'(I6)') NLF                                   READPT   1186
      MSG(1)(32:32)=KCCT                                                READPT   1187
      CALL PRTMSG(1)                                                    READPT   1188
      IER=-1                                                            READPT   1189
      RETURN                                                            READPT   1190
C     :......................................................:          READPT   1191
C                                                                       READPT   1192
 660  CONTINUE                                                          READPT   1193
C                                                                       READPT   1194
C  EXCITER TYPE EXAC1                                                   READPT   1195
      JEXC=5                                                            READPT   1196
      IEPTR=14                                                          READPT   1197
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1198
      EXC(1)=BUF(4)                                                     READPT   1199
      EXC(2)=BUF(5)                                                     READPT   1200
      EXC(3)=BUF(13)                                                    READPT   1201
      EXC(4)=BUF(8)                                                     READPT   1202
      EXC(8)=BUF(11)                                                    READPT   1203
      EXC(9)=BUF(9)                                                     READPT   1204
      EXC(10)=BUF(10)                                                   READPT   1205
      EXC(11)=BUF(3)                                                    READPT   1206
      EXC(12)=BUF(2)                                                    READPT   1207
      EXC(13)=BUF(6)                                                    READPT   1208
      EXC(14)=BUF(7)                                                    READPT   1209
      EXC(17)=BUF(1)                                                    READPT   1210
      EXC(18)=VCBUF(1)                                                  READPT   1211
      EXC(19)=VCBUF(2)                                                  READPT   1212
      EXC(20)=BUF(12)                                                   READPT   1213
C                                                                       READPT   1214
      RETURN                                                            READPT   1215
C                                                                       READPT   1216
 665  CONTINUE                                                          READPT   1217
C                                                                       READPT   1218
C  EXCITER TYPE OEX3                                                    READPT   1219
C                                                                       READPT   1220
      JEXC=3                                                            READPT   1221
      IEPTR=23                                                          READPT   1222
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1223
      EXC(1)=1.0                                                        READPT   1224
      EXC(2)=BUF(13)                                                    READPT   1225
      EXC(3)=BUF(22)                                                    READPT   1226
      EXC(4)=BUF(17)                                                    READPT   1227
      EXC(8)=BUF(20)                                                    READPT   1228
      EXC(9)=BUF(18)                                                    READPT   1229
      EXC(10)=BUF(19)                                                   READPT   1230
      EXC(11)=BUF(9)                                                    READPT   1231
      EXC(12)=BUF(8)                                                    READPT   1232
      EXC(13)=BUF(15)                                                   READPT   1233
      EXC(14)=BUF(16)                                                   READPT   1234
      EXC(16)=BUF(14)                                                   READPT   1235
      EXC(17)=BUF(7)                                                    READPT   1236
      EXC(18)=VCBUF(1)                                                  READPT   1237
      EXC(19)=VCBUF(2)                                                  READPT   1238
      EXC(20)=BUF(21)                                                   READPT   1239
      EXC(22)=BUF(11)                                                   READPT   1240
      EXC(23)=BUF(12)                                                   READPT   1241
C                                                                       READPT   1242
      RETURN                                                            READPT   1243
C                                                                       READPT   1244
 670  CONTINUE                                                          READPT   1245
C                                                                       READPT   1246
C  EXCITER TYPE EXST1                                                   READPT   1247
C                                                                       READPT   1248
C IGNORE LIMITER OF VIMAX & VIMIN                                       READPT   1249
C                                                                       READPT   1250
      JEXC=30                                                           READPT   1251
      EXC(1)=BUF(6)                                                     READPT   1252
      EXC(2)=BUF(7)                                                     READPT   1253
      EXC(3)=BUF(4)                                                     READPT   1254
      EXC(4)=BUF(5)                                                     READPT   1255
      EXC(5)=BUF(11)                                                    READPT   1256
      EXC(6)=BUF(12)                                                    READPT   1257
      EXC(9)=BUF(8)                                                     READPT   1258
      EXC(10)=BUF(9)                                                    READPT   1259
      EXC(11)=1.0                                                       READPT   1260
      EXC(12)=BUF(10)                                                   READPT   1261
      EXC(17)=BUF(1)                                                    READPT   1262
      EXC(18)=VCBUF(1)                                                  READPT   1263
      EXC(19)=VCBUF(2)                                                  READPT   1264
C                                                                       READPT   1265
      RETURN                                                            READPT   1266
C                                                                       READPT   1267
 680  CONTINUE                                                          READPT   1268
C                                                                       READPT   1269
C        IEEET1  89/09/12                                               READPT   1270
C                                                                       READPT   1271
C KE OFFSET = 6                                                         READPT   1272
      IF(BUF(6).EQ.0.0)THEN                                             READPT   1273
        JEXC=2                                                          READPT   1274
      ELSE                                                              READPT   1275
        JEXC=1                                                          READPT   1276
      ENDIF                                                             READPT   1277
      IEPTR=11                                                          READPT   1278
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1279
C VRMAX OFFSET = 4                                                      READPT   1280
      IF (BUF(4).EQ.0.0) THEN                                           READPT   1281
        IKEPTR=6                                                        READPT   1282
        CALL VRCAL(BUF,VRMAX,VRMIN,IKEPTR,IEHI,'IEEET1',NLF,KCCT)       READPT   1283
        EXC(13)=VRMAX                                                   READPT   1284
        EXC(14)=VRMIN                                                   READPT   1285
      ELSE                                                              READPT   1286
        EXC(13)=BUF(4)                                                  READPT   1287
        EXC(14)=BUF(5)                                                  READPT   1288
      ENDIF                                                             READPT   1289
      EXC(1)=BUF(2)                                                     READPT   1290
      EXC(2)=BUF(3)                                                     READPT   1291
      EXC(3)=BUF(6)                                                     READPT   1292
      EXC(4)=BUF(7)                                                     READPT   1293
      EXC(9)=BUF(8)                                                     READPT   1294
      EXC(10)=BUF(9)                                                    READPT   1295
      EXC(17)=BUF(1)                                                    READPT   1296
      EXC(18)=VCBUF(1)                                                  READPT   1297
      EXC(19)=VCBUF(2)                                                  READPT   1298
C                                                                       READPT   1299
      RETURN                                                            READPT   1300
C                                                                       READPT   1301
 690  CONTINUE                                                          READPT   1302
C                                                                       READPT   1303
C          IEEET3                                                       READPT   1304
C                                                                       READPT   1305
      JEXC=7                                                            READPT   1306
      EXC(1)=BUF(2)                                                     READPT   1307
      EXC(2)=BUF(3)                                                     READPT   1308
      EXC(3)=BUF(12)                                                    READPT   1309
      EXC(4)=BUF(6)                                                     READPT   1310
      EXC(5)=1.0                                                        READPT   1311
      EXC(9)=BUF(7)                                                     READPT   1312
      EXC(10)=BUF(8)                                                    READPT   1313
      EXC(14)=BUF(4)                                                    READPT   1314
      EXC(15)=BUF(5)                                                    READPT   1315
      EXC(16)=BUF(11)                                                   READPT   1316
      EXC(17)=BUF(1)                                                    READPT   1317
      EXC(18)=VCBUF(1)                                                  READPT   1318
      EXC(19)=VCBUF(2)                                                  READPT   1319
      EXC(20)=BUF(9)                                                    READPT   1320
      EXC(21)=BUF(10)                                                   READPT   1321
C                                                                       READPT   1322
      RETURN                                                            READPT   1323
C                                                                       READPT   1324
 700  CONTINUE                                                          READPT   1325
C                                                                       READPT   1326
C           IEEET4                                                      READPT   1327
C                                                                       READPT   1328
      JEXC=9                                                            READPT   1329
      IEPTR=8                                                           READPT   1330
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1331
C VRMAX OFFSET = 4                                                      READPT   1332
      IF (BUF(4).EQ.0.0) THEN                                           READPT   1333
        IKEPTR=7                                                        READPT   1334
        CALL VRCAL(BUF,VRMAX,VRMIN,IKEPTR,IEHI,'IEEET4',NLF,KCCT)       READPT   1335
        EXC(13)=VRMAX                                                   READPT   1336
        EXC(14)=VRMIN                                                   READPT   1337
      ELSE                                                              READPT   1338
        EXC(13)=BUF(4)                                                  READPT   1339
        EXC(14)=BUF(5)                                                  READPT   1340
      ENDIF                                                             READPT   1341
      EXC(3)=BUF(7)                                                     READPT   1342
      EXC(4)=BUF(6)                                                     READPT   1343
      EXC(9)=BUF(3)                                                     READPT   1344
      EXC(10)=(EXC(13)-EXC(14))/EXC(9)*BUF(2)                           READPT   1345
      EXC(18)=VCBUF(1)                                                  READPT   1346
      EXC(19)=VCBUF(2)                                                  READPT   1347
      MSG(1)=' *** WARNING - BUS        GID:   EXCITER MODEL IEEET4 '   READPT   1348
     +       //'WAS CONVERTED'                                          READPT   1349
      MSG(2)='     WITHOUT THE DEADBAND'                                READPT   1350
      WRITE(MSG(1)(20:25),'(I6)') NLF                                   READPT   1351
      MSG(1)(32:32)=KCCT                                                READPT   1352
      CALL PRTMSG(2)                                                    READPT   1353
C                                                                       READPT   1354
      RETURN                                                            READPT   1355
C                                                                       READPT   1356
 705  CONTINUE                                                          READPT   1357
C                                                                       READPT   1358
C           IEEEX4                                                      READPT   1359
C                                                                       READPT   1360
      JEXC=9                                                            READPT   1361
      IEPTR=8                                                           READPT   1362
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1363
C VRMAX OFFSET = 4                                                      READPT   1364
      IF (BUF(4).EQ.0.0) THEN                                           READPT   1365
        IKEPTR=7                                                        READPT   1366
        CALL VRCAL(BUF,VRMAX,VRMIN,IKEPTR,IEHI,'IEEEX4',NLF,KCCT)       READPT   1367
        EXC(13)=VRMAX                                                   READPT   1368
        EXC(14)=VRMIN                                                   READPT   1369
      ELSE                                                              READPT   1370
        EXC(13)=BUF(4)                                                  READPT   1371
        EXC(14)=BUF(5)                                                  READPT   1372
      ENDIF                                                             READPT   1373
      EXC(17)=BUF(1)                                                    READPT   1374
      EXC(3)=BUF(7)                                                     READPT   1375
      EXC(4)=BUF(6)                                                     READPT   1376
      EXC(9)=BUF(3)                                                     READPT   1377
      EXC(10)=BUF(2)                                                    READPT   1378
      EXC(18)=VCBUF(1)                                                  READPT   1379
      EXC(19)=VCBUF(2)                                                  READPT   1380
C                                                                       READPT   1381
      RETURN                                                            READPT   1382
C                                                                       READPT   1383
 710  CONTINUE                                                          READPT   1384
C                                                                       READPT   1385
C       IEEEX1                                                          READPT   1386
C                                                                       READPT   1387
      IF(BUF(8).EQ.0.0) THEN                                            READPT   1388
        JEXC=2                                                          READPT   1389
      ELSE                                                              READPT   1390
        JEXC=1                                                          READPT   1391
      ENDIF                                                             READPT   1392
      IEPTR=13                                                          READPT   1393
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1394
C VRMAX OFFSET = 6                                                      READPT   1395
      IF (BUF(6).EQ.0.0) THEN                                           READPT   1396
        IKEPTR=8                                                        READPT   1397
        CALL VRCAL(BUF,VRMAX,VRMIN,IKEPTR,IEHI,'IEEEX1',NLF,KCCT)       READPT   1398
        EXC(13)=VRMAX                                                   READPT   1399
        EXC(14)=VRMIN                                                   READPT   1400
      ELSE                                                              READPT   1401
        EXC(13)=BUF(6)                                                  READPT   1402
        EXC(14)=BUF(7)                                                  READPT   1403
      ENDIF                                                             READPT   1404
      EXC(1)=BUF(2)                                                     READPT   1405
      EXC(2)=BUF(3)                                                     READPT   1406
      EXC(4)=BUF(9)                                                     READPT   1407
      EXC(9)=BUF(10)                                                    READPT   1408
      EXC(10)=BUF(11)                                                   READPT   1409
      EXC(11)=BUF(5)                                                    READPT   1410
      EXC(12)=BUF(4)                                                    READPT   1411
      EXC(17)=BUF(1)                                                    READPT   1412
      EXC(18)=VCBUF(1)                                                  READPT   1413
      EXC(19)=VCBUF(2)                                                  READPT   1414
C                                                                       READPT   1415
      RETURN                                                            READPT   1416
C                                                                       READPT   1417
 720  CONTINUE                                                          READPT   1418
C                                                                       READPT   1419
C        SCRX                                                           READPT   1420
C                                                                       READPT   1421
      JEXC=30                                                           READPT   1422
      EXC(1)=BUF(3)                                                     READPT   1423
      EXC(2)=BUF(4)                                                     READPT   1424
      EXC(4)=BUF(2)                                                     READPT   1425
      EXC(3)=BUF(1)*BUF(2)                                              READPT   1426
      EXC(9)=BUF(6)                                                     READPT   1427
      EXC(10)=BUF(5)                                                    READPT   1428
      IF (BUF(7).EQ.0.0) THEN                                           READPT   1429
        EXC(11)=1.0                                                     READPT   1430
      ELSE                                                              READPT   1431
        EXC(11)=0.0                                                     READPT   1432
      ENDIF                                                             READPT   1433
      EXC(18)=VCBUF(1)                                                  READPT   1434
      EXC(19)=VCBUF(2)                                                  READPT   1435
C                                                                       READPT   1436
C   ALTERNATOR FED EXC(11).NE.0 TO BE PROVIDED IN THIS                  READPT   1437
C   PROGRAM AT A LATER DATE.                                            READPT   1438
C                                                                       READPT   1439
      RETURN                                                            READPT   1440
C                                                                       READPT   1441
 730  CONTINUE                                                          READPT   1442
C                                                                       READPT   1443
C         SEXS                                                          READPT   1444
C                                                                       READPT   1445
      JEXC=30                                                           READPT   1446
      EXC(1)=BUF(3)                                                     READPT   1447
      EXC(2)=BUF(4)                                                     READPT   1448
      EXC(4)=BUF(2)                                                     READPT   1449
      EXC(3)=BUF(1)*BUF(2)                                              READPT   1450
      EXC(9)=BUF(6)                                                     READPT   1451
      EXC(10)=BUF(5)                                                    READPT   1452
      EXC(18)=VCBUF(1)                                                  READPT   1453
      EXC(19)=VCBUF(2)                                                  READPT   1454
C                                                                       READPT   1455
      RETURN                                                            READPT   1456
C                                                                       READPT   1457
 735  CONTINUE                                                          READPT   1458
C                                                                       READPT   1459
C  EXCITER TYPE OEX12                                                   READPT   1460
C                                                                       READPT   1461
      JEXC=32                                                           READPT   1462
      EXC(1)=BUF(12)                                                    READPT   1463
      EXC(2)=BUF(13)                                                    READPT   1464
      EXC(3)=BUF(10)                                                    READPT   1465
      EXC(4)=BUF(11)                                                    READPT   1466
      EXC(5)=BUF(17)                                                    READPT   1467
      EXC(6)=BUF(18)                                                    READPT   1468
      EXC(9)=BUF(14)                                                    READPT   1469
      EXC(10)=BUF(15)                                                   READPT   1470
      EXC(11)=1.0                                                       READPT   1471
      EXC(12)=BUF(16)                                                   READPT   1472
      EXC(13)=BUF(19)                                                   READPT   1473
      EXC(14)=BUF(28)                                                   READPT   1474
      EXC(15)=BUF(27)                                                   READPT   1475
      EXC(17)=BUF(7)                                                    READPT   1476
      EXC(18)=VCBUF(1)                                                  READPT   1477
      EXC(19)=VCBUF(2)                                                  READPT   1478
      EXC(20)=BUF(30)                                                   READPT   1479
      EXC(21)=BUF(31)                                                   READPT   1480
      EXC(22)=BUF(32)                                                   READPT   1481
      EXC(23)=BUF(29)                                                   READPT   1482
      IF(BUF(22).LT.0.5)THEN                                            READPT   1483
        EXC(24)=0.0                                                     READPT   1484
      ELSEIF(BUF(22).GT.1.5)THEN                                        READPT   1485
        EXC(24)=2.0                                                     READPT   1486
      ELSE                                                              READPT   1487
        EXC(24)=1.0                                                     READPT   1488
      ENDIF                                                             READPT   1489
      EXC(25)=BUF(8)                                                    READPT   1490
      EXC(26)=BUF(9)                                                    READPT   1491
      EXC(27)=BUF(20)                                                   READPT   1492
      EXC(28)=BUF(21)                                                   READPT   1493
      EXC(29)=BUF(33)                                                   READPT   1494
      EXC(30)=BUF(34)                                                   READPT   1495
      EXC(31)=BUF(23)                                                   READPT   1496
      EXC(32)=BUF(24)                                                   READPT   1497
      EXC(33)=BUF(25)                                                   READPT   1498
      EXC(34)=BUF(26)                                                   READPT   1499
C                                                                       READPT   1500
      RETURN                                                            READPT   1501
C                                                                       READPT   1502
C                                                                       READPT   1503
C                                                                       READPT   1504
 737  CONTINUE                                                          READPT   1505
C                                                                       READPT   1506
C       EXDC2       (NOT CONFIRMED)                                     READPT   1507
C                                                                       READPT   1508
      IF (BUF(8).EQ.0.0) THEN                                           READPT   1509
        JEXC=2                                                          READPT   1510
      ELSE                                                              READPT   1511
        JEXC=1                                                          READPT   1512
      ENDIF                                                             READPT   1513
      IEPTR=13                                                          READPT   1514
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1515
      EXC(1)=BUF(2)                                                     READPT   1516
      EXC(2)=BUF(3)                                                     READPT   1517
      EXC(3)=BUF(8)                                                     READPT   1518
      EXC(4)=BUF(9)                                                     READPT   1519
      EXC(9)=BUF(10)                                                    READPT   1520
      EXC(10)=BUF(11)                                                   READPT   1521
      EXC(11)=BUF(5)                                                    READPT   1522
      EXC(12)=BUF(4)                                                    READPT   1523
      EXC(13)=BUF(6)                                                    READPT   1524
      EXC(14)=BUF(7)                                                    READPT   1525
      EXC(17)=BUF(1)                                                    READPT   1526
      EXC(18)=VCBUF(1)                                                  READPT   1527
      EXC(19)=VCBUF(2)                                                  READPT   1528
C                                                                       READPT   1529
      RETURN                                                            READPT   1530
C                                                                       READPT   1531
 738  CONTINUE                                                          READPT   1532
C                                                                       READPT   1533
C       IEEET5                                                          READPT   1534
C                  (NOT CONFIRMED)                                      READPT   1535
      JEXC=9                                                            READPT   1536
      IEPTR=7                                                           READPT   1537
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1538
C VRMAX OFFSET = 3                                                      READPT   1539
      IF (BUF(3).EQ.0.0) THEN                                           READPT   1540
        IKEPTR=6                                                        READPT   1541
        CALL VRCAL(BUF,VRMAX,VRMIN,IKEPTR,IEHI,'IEEET5',NLF,KCCT)       READPT   1542
        EXC(13)=VRMAX                                                   READPT   1543
        EXC(14)=VRMIN                                                   READPT   1544
      ELSE                                                              READPT   1545
        EXC(13)=BUF(3)                                                  READPT   1546
        EXC(14)=BUF(4)                                                  READPT   1547
      ENDIF                                                             READPT   1548
      EXC(3)=BUF(6)                                                     READPT   1549
      EXC(4)=BUF(5)                                                     READPT   1550
      EXC(9)=BUF(2)                                                     READPT   1551
      EXC(10)=(EXC(13)-EXC(14))/EXC(9)*BUF(1)                           READPT   1552
      EXC(18)=VCBUF(1)                                                  READPT   1553
      EXC(19)=VCBUF(2)                                                  READPT   1554
      MSG(1)=' *** WARNING - BUS        GID:   EXCITER MODEL IEEET5 '   READPT   1555
     +       //'WAS CONVERTED'                                          READPT   1556
      MSG(2)='     WITHOUT THE DEADBAND'                                READPT   1557
      WRITE(MSG(1)(20:25),'(I6)') NLF                                   READPT   1558
      MSG(1)(32:32)=KCCT                                                READPT   1559
      CALL PRTMSG(2)                                                    READPT   1560
C                                                                       READPT   1561
      RETURN                                                            READPT   1562
C                                                                       READPT   1563
C IEET1A == TYPE 5            JUN-03-1992 DOY                           READPT   1564
C                                                                       READPT   1565
 800  CONTINUE                                                          READPT   1566
C                                                                       READPT   1567
      JEXC=5                                                            READPT   1568
      IEPTR=10                                                          READPT   1569
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1570
      IF (BUF(3).EQ.0.0) THEN                                           READPT   1571
        IKEPTR=5                                                        READPT   1572
        CALL VRCAL(BUF,VRMAX,VRMIN,IKEPTR,IEHI,'IEET1A',NLF,KCCT)       READPT   1573
        EXC(13)=VRMAX                                                   READPT   1574
        EXC(14)=VRMIN                                                   READPT   1575
      ELSE                                                              READPT   1576
        EXC(13)=BUF(3)                                                  READPT   1577
        EXC(14)=BUF(4)                                                  READPT   1578
      ENDIF                                                             READPT   1579
      EXC(1)=BUF(1)                                                     READPT   1580
      EXC(2)=BUF(2)                                                     READPT   1581
      EXC(3)=BUF(5)                                                     READPT   1582
      EXC(4)=BUF(6)                                                     READPT   1583
      EXC(9)=BUF(7)                                                     READPT   1584
      EXC(10)=BUF(8)                                                    READPT   1585
      EXC(15)=-99.0                                                     READPT   1586
      EXC(18)=VCBUF(1)                                                  READPT   1587
      EXC(19)=VCBUF(2)                                                  READPT   1588
      EXC(24)=BUF(12)                                                   READPT   1589
      EXC(32)=BUF(9)                                                    READPT   1590
      WRITE(MSG(1),1000) NLF,KCCT                                       READPT   1591
      WRITE(MSG(2),1010)                                                READPT   1592
      CALL PRTMSG(2)                                                    READPT   1593
C                                                                       READPT   1594
      RETURN                                                            READPT   1595
C                                                                       READPT   1596
 7730 CONTINUE                                                          READPT   1597
C                                                                       READPT   1598
C  EXAC3                                                                READPT   1599
C                                                                       READPT   1600
C         IEX4                                                          READPT   1601
C                                                                       READPT   1602
      JEXC=4                                                            READPT   1603
      IEPTR=19                                                          READPT   1604
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1605
      EXC(1)=BUF(4)                                                     READPT   1606
      EXC(2)=BUF(5)                                                     READPT   1607
      EXC(3)=BUF(17)                                                    READPT   1608
      EXC(4)=BUF(8)                                                     READPT   1609
      EXC(8)=BUF(15)                                                    READPT   1610
      EXC(9)=BUF(11)                                                    READPT   1611
      EXC(10)=BUF(12)                                                   READPT   1612
      EXC(11)=BUF(3)                                                    READPT   1613
      EXC(12)=BUF(2)                                                    READPT   1614
      EXC(13)=BUF(6)                                                    READPT   1615
      EXC(14)=BUF(7)                                                    READPT   1616
      EXC(16)=BUF(10)                                                   READPT   1617
      EXC(17)=BUF(1)                                                    READPT   1618
      EXC(18)=VCBUF(1)                                                  READPT   1619
      EXC(19)=VCBUF(2)                                                  READPT   1620
      EXC(20)=BUF(16)                                                   READPT   1621
      EXC(22)=BUF(13)                                                   READPT   1622
      EXC(23)=BUF(14)                                                   READPT   1623
      EXC(24)=BUF(9)                                                    READPT   1624
      EXC(25)=BUF(18)                                                   READPT   1625
      EXC(27)=1.0                                                       READPT   1626
C                                                                       READPT   1627
      RETURN                                                            READPT   1628
C                                                                       READPT   1629
 7735   CONTINUE                                                        READPT   1630
C                                                                       READPT   1631
C  EXST2 & EXST2A                                                       READPT   1632
C                                                                       READPT   1633
C         IEX7  (NOT CONFIRMED)                                         READPT   1634
C                                                                       READPT   1635
      JEXC=7                                                            READPT   1636
      EXC(1)=BUF(2)                                                     READPT   1637
      EXC(2)=BUF(3)                                                     READPT   1638
      EXC(3)=BUF(6)                                                     READPT   1639
      EXC(4)=BUF(7)                                                     READPT   1640
      IF(IEXK.EQ.15)EXC(5)=1.0                                          READPT   1641
      EXC(8)=BUF(12)                                                    READPT   1642
      EXC(9)=BUF(8)                                                     READPT   1643
      EXC(10)=BUF(9)                                                    READPT   1644
      EXC(11)=BUF(21)                                                   READPT   1645
      EXC(14)=BUF(4)                                                    READPT   1646
      EXC(15)=BUF(5)                                                    READPT   1647
      EXC(16)=BUF(13)                                                   READPT   1648
      EXC(17)=BUF(1)                                                    READPT   1649
      EXC(18)=VCBUF(1)                                                  READPT   1650
      EXC(19)=VCBUF(2)                                                  READPT   1651
      EXC(20)=BUF(10)                                                   READPT   1652
      EXC(21)=BUF(11)                                                   READPT   1653
C                                                                       READPT   1654
      RETURN                                                            READPT   1655
C                                                                       READPT   1656
C                                                                       READPT   1657
 7740   CONTINUE                                                        READPT   1658
C                                                                       READPT   1659
C  IEEX2A                                                               READPT   1660
C                                                                       READPT   1661
C         IEX5  (NOT CONFIRMED)                                         READPT   1662
C                                                                       READPT   1663
      JEXC=5                                                            READPT   1664
      IEPTR=12                                                          READPT   1665
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1666
C VRMAX OFFSET = 6                                                      READPT   1667
      IF (BUF(6).EQ.0.0) THEN                                           READPT   1668
        IKEPTR=8                                                        READPT   1669
        CALL VRCAL(BUF,VRMAX,VRMIN,IKEPTR,IEHI,'IEEX2A',NLF,KCCT)       READPT   1670
        EXC(13)=VRMAX                                                   READPT   1671
        EXC(14)=VRMIN                                                   READPT   1672
      ELSE                                                              READPT   1673
        EXC(13)=BUF(6)                                                  READPT   1674
        EXC(14)=BUF(7)                                                  READPT   1675
      ENDIF                                                             READPT   1676
      EXC(1)=BUF(2)                                                     READPT   1677
      EXC(2)=BUF(3)                                                     READPT   1678
      EXC(3)=BUF(8)                                                     READPT   1679
      EXC(4)=BUF(9)                                                     READPT   1680
      EXC(9)=BUF(10)                                                    READPT   1681
      EXC(10)=BUF(11)                                                   READPT   1682
      EXC(11)=BUF(5)                                                    READPT   1683
      EXC(12)=BUF(4)                                                    READPT   1684
      EXC(17)=BUF(1)                                                    READPT   1685
      EXC(18)=VCBUF(1)                                                  READPT   1686
      EXC(19)=VCBUF(2)                                                  READPT   1687
      EXC(20)=1.0                                                       READPT   1688
C                                                                       READPT   1689
      RETURN                                                            READPT   1690
C                                                                       READPT   1691
C                                                                       READPT   1692
 7745   CONTINUE                                                        READPT   1693
C                                                                       READPT   1694
C  IEET5A                                                               READPT   1695
C                                                                       READPT   1696
C         IEX1 FOR TRH.NE.0.AND.KE.NE.0                                 READPT   1697
C         IEX2 FOR TRH.NE.0.AND.KE.EQ.0                                 READPT   1698
C         IEX9 FOR TRH=0                                                READPT   1699
C                                                                       READPT   1700
      IEPTR=8                                                           READPT   1701
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1702
C VRMAX OFFSET = 4                                                      READPT   1703
      IF (BUF(4).EQ.0.0) THEN                                           READPT   1704
        IKEPTR=7                                                        READPT   1705
        CALL VRCAL(BUF,VRMAX,VRMIN,IKEPTR,IEHI,'IEET5A',NLF,KCCT)       READPT   1706
        EXC(13)=VRMAX                                                   READPT   1707
        EXC(14)=VRMIN                                                   READPT   1708
      ELSE                                                              READPT   1709
        EXC(13)=BUF(4)                                                  READPT   1710
        EXC(14)=BUF(5)                                                  READPT   1711
      ENDIF                                                             READPT   1712
       IF (BUF(2).EQ.0.0)THEN                                           READPT   1713
        JEXC=9                                                          READPT   1714
        EXC(3)=BUF(7)                                                   READPT   1715
        EXC(4)=BUF(6)                                                   READPT   1716
        EXC(9)=(BUF(4)-BUF(5))/BUF(1)                                   READPT   1717
        EXC(10)=1.0                                                     READPT   1718
        EXC(17)=BUF(1)                                                  READPT   1719
        EXC(18)=VCBUF(1)                                                READPT   1720
        EXC(19)=VCBUF(2)                                                READPT   1721
      ELSE                                                              READPT   1722
        JEXC=1                                                          READPT   1723
        IF (BUF(7).EQ.0.0)JEXC=2                                        READPT   1724
        EXC(1)=BUF(1)                                                   READPT   1725
        EXC(2)=BUF(2)                                                   READPT   1726
        EXC(3)=BUF(7)                                                   READPT   1727
        EXC(4)=BUF(6)                                                   READPT   1728
        EXC(18)=VCBUF(1)                                                READPT   1729
        EXC(19)=VCBUF(2)                                                READPT   1730
      ENDIF                                                             READPT   1731
C                                                                       READPT   1732
      RETURN                                                            READPT   1733
C                                                                       READPT   1734
C                                                                       READPT   1735
 7750   CONTINUE                                                        READPT   1736
C                                                                       READPT   1737
C  IEEEX3                                                               READPT   1738
C                                                                       READPT   1739
C         IEX7  NOTE : KV MAY NOT BE CORRECT.                           READPT   1740
C                                                                       READPT   1741
      JEXC=7                                                            READPT   1742
      EXC(1)=BUF(2)                                                     READPT   1743
      EXC(2)=BUF(3)                                                     READPT   1744
      EXC(3)=BUF(12)                                                    READPT   1745
      EXC(4)=BUF(6)                                                     READPT   1746
      EXC(5)=1.0                                                        READPT   1747
      EXC(8)=1.0                                                        READPT   1748
      EXC(9)=BUF(7)                                                     READPT   1749
      EXC(10)=BUF(8)                                                    READPT   1750
      EXC(14)=BUF(4)                                                    READPT   1751
      EXC(15)=BUF(5)                                                    READPT   1752
      EXC(17)=BUF(1)                                                    READPT   1753
      EXC(18)=VCBUF(1)                                                  READPT   1754
      EXC(19)=VCBUF(2)                                                  READPT   1755
      EXC(20)=BUF(9)                                                    READPT   1756
      EXC(21)=BUF(10)                                                   READPT   1757
C                                                                       READPT   1758
      RETURN                                                            READPT   1759
C                                                                       READPT   1760
 7760 CONTINUE                                                          READPT   1761
C                                                                       READPT   1762
C  MNEXL1                                                               READPT   1763
C                                                                       READPT   1764
C         IEX51, TO BE CREATED WHEN NECESSARY                           READPT   1765
C                                                                       READPT   1766
      GOTO 500                                                          READPT   1767
C                                                                       READPT   1768
 7770 CONTINUE                                                          READPT   1769
C                                                                       READPT   1770
C  EXST3               90/06/05 FLF/MMK                                 READPT   1771
C                                                                       READPT   1772
C                                                                       READPT   1773
      JEXC=8                                                            READPT   1774
      EXC(1)=BUF(7)                                                     READPT   1775
      EXC(2)=BUF(8)                                                     READPT   1776
      EXC(3)=BUF(4)                                                     READPT   1777
      EXC(4)=BUF(11)                                                    READPT   1778
      EXC(5)=BUF(17)                                                    READPT   1779
      EXC(6)=BUF(2)                                                     READPT   1780
      EXC(7)=BUF(3)                                                     READPT   1781
      EXC(8)=BUF(15)                                                    READPT   1782
      EXC(11)=BUF(5)                                                    READPT   1783
      EXC(12)=BUF(6)                                                    READPT   1784
      EXC(14)=BUF(9)                                                    READPT   1785
      EXC(15)=BUF(10)                                                   READPT   1786
      EXC(16)=BUF(14)                                                   READPT   1787
      EXC(17)=BUF(1)                                                    READPT   1788
      EXC(18)=VCBUF(1)                                                  READPT   1789
      EXC(19)=VCBUF(2)                                                  READPT   1790
      EXC(20)=BUF(16)                                                   READPT   1791
      EXC(21)=BUF(13)                                                   READPT   1792
      EXC(22)=BUF(12)                                                   READPT   1793
      EXC(23)=BUF(18)                                                   READPT   1794
C                                                                       READPT   1795
      RETURN                                                            READPT   1796
C                                                                       READPT   1797
 7780   CONTINUE                                                        READPT   1798
C                                                                       READPT   1799
C  EXAC4               90/06/05 FLF/MMK                                 READPT   1800
C                                                                       READPT   1801
C                                                                       READPT   1802
      JEXC=30                                                           READPT   1803
      EXC(1)=BUF(6)                                                     READPT   1804
      EXC(2)=BUF(7)                                                     READPT   1805
      EXC(3)=BUF(4)                                                     READPT   1806
      EXC(4)=BUF(5)                                                     READPT   1807
      EXC(9)=BUF(8)                                                     READPT   1808
      EXC(10)=BUF(9)                                                    READPT   1809
      EXC(12)=BUF(10)                                                   READPT   1810
      EXC(17)=BUF(1)                                                    READPT   1811
      EXC(18)=VCBUF(1)                                                  READPT   1812
      EXC(19)=VCBUF(2)                                                  READPT   1813
      EXC(27)=BUF(2)                                                    READPT   1814
      EXC(28)=BUF(3)                                                    READPT   1815
C                                                                       READPT   1816
      RETURN                                                            READPT   1817
C                                                                       READPT   1818
C                                                                       READPT   1819
 7790   CONTINUE                                                        READPT   1820
C                                                                       READPT   1821
C  IEET1S               90/06/05 FLF/MMK                                READPT   1822
C                                                                       READPT   1823
C                                                                       READPT   1824
      JEXC=30                                                           READPT   1825
      EXC(1)=BUF(2)                                                     READPT   1826
      EXC(2)=BUF(3)                                                     READPT   1827
      EXC(5)=BUF(7)                                                     READPT   1828
      EXC(6)=BUF(8)                                                     READPT   1829
      EXC(9)=BUF(5)                                                     READPT   1830
      EXC(10)=BUF(6)                                                    READPT   1831
      EXC(17)=BUF(1)                                                    READPT   1832
      EXC(18)=VCBUF(1)                                                  READPT   1833
      EXC(19)=VCBUF(2)                                                  READPT   1834
C                                                                       READPT   1835
      RETURN                                                            READPT   1836
C                                                                       READPT   1837
C                                                                       READPT   1838
 7800   CONTINUE                                                        READPT   1839
C                                                                       READPT   1840
C  EXAC2               90/06/05 FLF/MMK                                 READPT   1841
C                                                                       READPT   1842
C                                                                       READPT   1843
      JEXC=6                                                            READPT   1844
      IEPTR=20                                                          READPT   1845
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1846
      EXC(1)=BUF(4)                                                     READPT   1847
      EXC(2)=BUF(5)                                                     READPT   1848
      EXC(3)=BUF(18)                                                    READPT   1849
      EXC(4)=BUF(11)                                                    READPT   1850
      EXC(8)=BUF(16)                                                    READPT   1851
      EXC(9)=BUF(14)                                                    READPT   1852
      EXC(10)=BUF(15)                                                   READPT   1853
      EXC(11)=BUF(3)                                                    READPT   1854
      EXC(13)=BUF(6)                                                    READPT   1855
      EXC(14)=BUF(7)                                                    READPT   1856
      EXC(15)=BUF(9)                                                    READPT   1857
      EXC(16)=BUF(10)                                                   READPT   1858
      EXC(17)=BUF(1)                                                    READPT   1859
      EXC(18)=VCBUF(1)                                                  READPT   1860
      EXC(19)=VCBUF(2)                                                  READPT   1861
      EXC(20)=BUF(17)                                                   READPT   1862
      EXC(22)=BUF(8)                                                    READPT   1863
      EXC(23)=BUF(13)                                                   READPT   1864
      EXC(24)=BUF(12)                                                   READPT   1865
      EXC(25)=BUF(19)                                                   READPT   1866
C                                                                       READPT   1867
      RETURN                                                            READPT   1868
C                                                                       READPT   1869
 7810   CONTINUE                                                        READPT   1870
C                                                                       READPT   1871
C  IEEET2              90/06/27 FLF/MMK                                 READPT   1872
C                                                                       READPT   1873
C                                                                       READPT   1874
      JEXC=10                                                           READPT   1875
      IEPTR=11                                                          READPT   1876
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1877
C VRMAX OFFSET = 4                                                      READPT   1878
      IF (BUF(4).EQ.0.0) THEN                                           READPT   1879
        IKEPTR=6                                                        READPT   1880
        CALL VRCAL(BUF,VRMAX,VRMIN,IKEPTR,IEHI,'IEEET2',NLF,KCCT)       READPT   1881
        EXC(15)=VRMAX                                                   READPT   1882
        EXC(16)=VRMIN                                                   READPT   1883
      ELSE                                                              READPT   1884
        EXC(15)=BUF(4)                                                  READPT   1885
        EXC(16)=BUF(5)                                                  READPT   1886
      ENDIF                                                             READPT   1887
      EXC(1)=BUF(2)                                                     READPT   1888
      EXC(2)=BUF(3)                                                     READPT   1889
      EXC(3)=BUF(6)                                                     READPT   1890
      EXC(4)=BUF(7)                                                     READPT   1891
      EXC(9)=BUF(8)                                                     READPT   1892
      EXC(10)=BUF(9)                                                    READPT   1893
      EXC(14)=BUF(10)                                                   READPT   1894
      EXC(17)=BUF(1)                                                    READPT   1895
      EXC(18)=VCBUF(1)                                                  READPT   1896
      EXC(19)=VCBUF(2)                                                  READPT   1897
C                                                                       READPT   1898
      RETURN                                                            READPT   1899
C                                                                       READPT   1900
 7820   CONTINUE                                                        READPT   1901
C                                                                       READPT   1902
C  IEEEX2                                                               READPT   1903
C                                                                       READPT   1904
C                                                                       READPT   1905
      JEXC=10                                                           READPT   1906
      IEPTR=13                                                          READPT   1907
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1908
C VRMAX OFFSET = 6                                                      READPT   1909
      IF (BUF(6).EQ.0.0) THEN                                           READPT   1910
        IKEPTR=8                                                        READPT   1911
        CALL VRCAL(BUF,VRMAX,VRMIN,IKEPTR,IEHI,'IEEEX2',NLF,KCCT)       READPT   1912
        EXC(15)=VRMAX                                                   READPT   1913
        EXC(16)=VRMIN                                                   READPT   1914
      ELSE                                                              READPT   1915
        EXC(15)=BUF(6)                                                  READPT   1916
        EXC(16)=BUF(7)                                                  READPT   1917
      ENDIF                                                             READPT   1918
      EXC(1)=BUF(2)                                                     READPT   1919
      EXC(2)=BUF(3)                                                     READPT   1920
      EXC(3)=BUF(8)                                                     READPT   1921
      EXC(4)=BUF(9)                                                     READPT   1922
      EXC(9)=BUF(10)                                                    READPT   1923
      EXC(10)=BUF(11)                                                   READPT   1924
      EXC(11)=BUF(5)                                                    READPT   1925
      EXC(12)=BUF(4)                                                    READPT   1926
      EXC(14)=BUF(12)                                                   READPT   1927
      EXC(17)=BUF(1)                                                    READPT   1928
C                                                                       READPT   1929
      RETURN                                                            READPT   1930
C                                                                       READPT   1931
 7830 CONTINUE                                                          READPT   1932
C                                                                       READPT   1933
C  EXAC1A                                                               READPT   1934
C                                                                       READPT   1935
C                                                                       READPT   1936
      JEXC=3                                                            READPT   1937
      IEPTR=14                                                          READPT   1938
      CALL SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                      READPT   1939
      EXC(1)=BUF(4)                                                     READPT   1940
      EXC(2)=BUF(5)                                                     READPT   1941
      EXC(3)=BUF(13)                                                    READPT   1942
      EXC(4)=BUF(8)                                                     READPT   1943
      EXC(8)=BUF(11)                                                    READPT   1944
      EXC(9)=BUF(9)                                                     READPT   1945
      EXC(10)=BUF(10)                                                   READPT   1946
      EXC(13)=BUF(6)                                                    READPT   1947
      EXC(14)=BUF(7)                                                    READPT   1948
      EXC(17)=BUF(1)                                                    READPT   1949
      EXC(20)=BUF(12)                                                   READPT   1950
C                                                                       READPT   1951
      RETURN                                                            READPT   1952
C                                                                       READPT   1953
 1000 FORMAT(' *** PSS/E EXCITER MODEL IEET1A AT BUS ',I6,' CID ',A2)   READPT   1954
 1010 FORMAT(5X,'CONVERTED TO ETMSP/SSSP EXCITER MODEL TYPE 5 WITH'     READPT   1955
     *,' SOME APPROXIMATIONS')                                          READPT   1956
C                                                                       READPT   1957
        END                                                             READPT   1958
C-----------------------------------------------------------------------READPT   1959
      SUBROUTINE SATCAL(BUF,EXC,IEPTR,IEHI,IER,NLF,KCCT)                READPT   1960
CD                                                                      READPT   1961
CD     TO CALCULATE ASAT/BSAT GIVEN 2 POINTS ON THE SAT CURVE           READPT   1962
CD                                                                      READPT   1963
C                                                                       READPT   1964
C SUBROUTINE TO CALCULATE ASAT/BSAT GIVEN 2 POINTS ON THE SAT CURVE     READPT   1965
C                                                                       READPT   1966
C   E1,SE1 = POINT 1                                                    READPT   1967
C   E2,SE2 = POINT 2                                                    READPT   1968
C   IER < 0 = ERROR                                                     READPT   1969
C                                                                       READPT   1970
C   IEPTR = OFFSET OF SATURATION DATA (E1) IN PTI'S EXCITER MODEL       READPT   1971
C                                                                       READPT   1972
      INCLUDE 'CNMSG.INS'                                               READPT   1973
      DIMENSION BUF(*)                                                  READPT   1974
      DIMENSION EXC(*)                                                  READPT   1975
      CHARACTER*1 KCCT                                                  READPT   1976
C                                                                       READPT   1977
C         * SET HIGHER POINT = E1;  LOWER POINT = E2                    READPT   1978
C                                                                       READPT   1979
      IER=0                                                             READPT   1980
      TOL=0.02                                                          READPT   1981
      E1=BUF(IEPTR)                                                     READPT   1982
      E2=BUF(IEPTR+2)                                                   READPT   1983
      IF (E1.GT.E2) THEN                                                READPT   1984
        SE1=BUF(IEPTR+1)                                                READPT   1985
        SE2=BUF(IEPTR+3)                                                READPT   1986
        IEHI=IEPTR                                                      READPT   1987
      ELSE                                                              READPT   1988
        TMP=E1                                                          READPT   1989
        E1=E2                                                           READPT   1990
        E2=TMP                                                          READPT   1991
        SE1=BUF(IEPTR+3)                                                READPT   1992
        SE2=BUF(IEPTR+1)                                                READPT   1993
        IEHI=IEPTR+2                                                    READPT   1994
      ENDIF                                                             READPT   1995
      IF (SE1.EQ.0.0.OR.SE2.EQ.0.0.OR.E1.EQ.0.0.OR.E2.EQ.0.0) THEN      READPT   1996
         MSG(1)=' *** WARNING - BUS        GID:   EXCITER SATURATION'   READPT   1997
     +          //' ERROR: SE(E1)=0 OR SE(E2)=0'                        READPT   1998
         MSG(2)='     OR E1=0 OR E2=0, NO EXCITER SATURATION IS'        READPT   1999
     *      //' REPRESENTED.'                                           READPT   2000
         IER=-1                                                         READPT   2001
      ELSEIF (E2.EQ.E1) THEN                                            READPT   2002
         MSG(1)=' *** WARNING - BUS        GID:   EXCITER SATURATION'   READPT   2003
     +          //' ERROR: E1=E2'                                       READPT   2004
         MSG(2)='     NO EXCITER SATURATION IS REPRESENTED.'            READPT   2005
         IER=-1                                                         READPT   2006
      ELSEIF (SE2.GE.SE1) THEN                                          READPT   2007
         MSG(1)=' *** WARNING - BUS        GID:   EXCITER SATURATION'   READPT   2008
     +          //' ERROR: SE(E1)=SE(E2)'                               READPT   2009
         MSG(2)='     NO EXCITER SATURATION IS REPRESENTED.'            READPT   2010
         IER=-1                                                         READPT   2011
      ENDIF                                                             READPT   2012
      IF (IER.LT.0) THEN                                                READPT   2013
         WRITE(MSG(1)(20:25),'(I6)') NLF                                READPT   2014
         MSG(1)(32:32)=KCCT                                             READPT   2015
         EXC(5)=0.0                                                     READPT   2016
         EXC(6)=0.0                                                     READPT   2017
         EXC(7)=0.0                                                     READPT   2018
         CALL PRTMSG(2)                                                 READPT   2019
         RETURN                                                         READPT   2020
      ENDIF                                                             READPT   2021
      IF (ABS(E2/E1-0.75).GT.TOL) THEN                                  READPT   2022
        BEX=ALOG(SE1*E1/(SE2*E2))/(E1-E2)                               READPT   2023
        EXPON=EXP(BEX*E1)                                               READPT   2024
        AEX=SE1*E1/EXPON                                                READPT   2025
        EXC(5)=AEX                                                      READPT   2026
        EXC(6)=BEX                                                      READPT   2027
      ELSE                                                              READPT   2028
        EXC(5)=SE1                                                      READPT   2029
        EXC(6)=SE2                                                      READPT   2030
        EXC(7)=E1                                                       READPT   2031
      ENDIF                                                             READPT   2032
      RETURN                                                            READPT   2033
C                                                                       READPT   2034
      END                                                               READPT   2035
C-----------------------------------------------------------------------READPT   2036
      SUBROUTINE VRCAL(BUF,VRMAX,VRMIN,IKEPTR,IEHI,EXTYPE,NLF,KCCT)     READPT   2037
CD                                                                      READPT   2038
CD     TO CALCULATE KE, VRMAX AND VRMIN WHEN CONVERTING EXCITER MODEL   READPT   2039
CD     DATA FROM PTI DYDA FORMAT TO PSAPAC FORMAT                       READPT   2040
CD                                                                      READPT   2041
C                                                                       READPT   2042
C SUBROUTINE TO CALCULATE KE, VRMAX AND VRMIN,                          READPT   2043
C SEE PG 15-8 OF PSS/E PROGRAM APPLICATION GUIDE                        READPT   2044
C   IER < 0 = ERROR                                                     READPT   2045
C                                                                       READPT   2046
C   IEHI = OFFSET OF THE HIGHER E IN PTI'S EXCITER MODEL                READPT   2047
C   IKEPTR = OFFSET OF KE IN PTI'S EXCITER MODEL                        READPT   2048
C                                                                       READPT   2049
      DIMENSION BUF(*)                                                  READPT   2050
      CHARACTER*1 KCCT                                                  READPT   2051
      CHARACTER*6 EXTYPE                                                READPT   2052
      REAL*4 KE                                                         READPT   2053
C                                                                       READPT   2054
      IER=0                                                             READPT   2055
      KE=BUF(IKEPTR)                                                    READPT   2056
      E2=BUF(IEHI)                                                      READPT   2057
      SE2=BUF(IEHI+1)                                                   READPT   2058
      IF (KE.LE.0.0) THEN                                               READPT   2059
        VRMAX=SE2*E2                                                    READPT   2060
      ELSE                                                              READPT   2061
        VRMAX=(SE2+KE)*E2                                               READPT   2062
      ENDIF                                                             READPT   2063
      VRMIN=-VRMAX                                                      READPT   2064
C                                                                       READPT   2065
      RETURN                                                            READPT   2066
      END                                                               READPT   2067
C-----------------------------------------------------------------------READPT   2068
      SUBROUTINE STABIL(KSTAB,JSTAB,JFLTN,KBUS,KCCT,IERR,               READPT   2069
     1                      EXS,EXF,BUF)                                READPT   2070
CD                                                                      READPT   2071
CD     TO CONVERT STABILIZER MODEL DATA FROM PTI DYDA FORMAT            READPT   2072
CD     TO PSAPAC FORMAT.                                                READPT   2073
CD                                                                      READPT   2074
      INCLUDE 'PARX.INS'                                                READPT   2075
      INCLUDE 'CNMSG.INS'                                               READPT   2076
C                                                                       READPT   2077
      DIMENSION BUF(*)                                                  READPT   2078
      DIMENSION EXS(*)                                                  READPT   2079
      DIMENSION EXF(*)                                                  READPT   2080
C                                                                       READPT   2081
      CHARACTER*1 KCCT                                                  READPT   2082
C                                                                       READPT   2083
      IERR=0                                                            READPT   2084
      JSTAB=0                                                           READPT   2085
      JFLTN=0                                                           READPT   2086
C                                                                       READPT   2087
      CALL FMOVE (0,EXS,EXS,J9S1D)                                      READPT   2088
      CALL FMOVE (0,EXF,EXF,J9S2D)                                      READPT   2089
C                                                                       READPT   2090
C           STAB1 IEEEST OSTAB2 OSTAB5 ST2CUT  STAB3  STAB4             READPT   2091
      GO TO (1500,  1510,  1520,  1530,  1540,  1550,  1560,            READPT   2092
C          IEE2ST                                                       READPT   2093
     +       1540)  KSTAB                                               READPT   2094
C    ........................................................           READPT   2095
C    : If falls into here, Not translatable. Set error code :           READPT   2096
C                                                                       READPT   2097
      WRITE(MSG(1),1200) KBUS,KCCT                                      READPT   2098
      CALL PRTMSG(1)                                                    READPT   2099
      IERR=-1                                                           READPT   2100
      RETURN                                                            READPT   2101
C     :......................................................:          READPT   2102
C                                                                       READPT   2103
C     STABILIZER STAB1                                                  READPT   2104
C                                                                       READPT   2105
1500  CONTINUE                                                          READPT   2106
      JSTAB=1                                                           READPT   2107
      EXS(31)=1.0                                                       READPT   2108
      EXS(1)=BUF(1)                                                     READPT   2109
      EXS(2)=BUF(2)                                                     READPT   2110
      EXS(4)=BUF(4)                                                     READPT   2111
      EXS(3)=BUF(3)*BUF(4)                                              READPT   2112
      EXS(6)=BUF(6)                                                     READPT   2113
      EXS(5)=BUF(5)*BUF(6)                                              READPT   2114
      EXS(7)=BUF(7)                                                     READPT   2115
      EXS(8)=-BUF(7)                                                    READPT   2116
C                                                                       READPT   2117
      RETURN                                                            READPT   2118
C                                                                       READPT   2119
C     STABILIZER IEEEST                                                 READPT   2120
C                                                                       READPT   2121
C!   UPDATED 89/06/26                                                   READPT   2122
C                                                                       READPT   2123
C                                                                       READPT   2124
 1510 CONTINUE                                                          READPT   2125
      JSTAB=1                                                           READPT   2126
      ICON=IFIX(BUF(1))                                                 READPT   2127
      IRMBUS=IFIX(BUF(2))                                               READPT   2128
C                                                                       READPT   2129
      IF (ICON.EQ.1) OHTYP=1.                                           READPT   2130
      IF (ICON.EQ.2) OHTYP=3.                                           READPT   2131
      IF (ICON.EQ.3) OHTYP=4.                                           READPT   2132
      IF (ICON.EQ.4) OHTYP=2.                                           READPT   2133
      IF (ICON.EQ.5) OHTYP=5.                                           READPT   2134
      IF ((ICON.GE.6).OR.(ICON.LE.0)) THEN                              READPT   2135
         IOHTYP=0                                                       READPT   2136
         WRITE(MSG(1),1100) KBUS,KCCT,ICON                              READPT   2137
         CALL PRTMSG(1)                                                 READPT   2138
         IERR=1                                                         READPT   2139
      END IF                                                            READPT   2140
C     STORE ITYPE AND REMOTE BUS NUMBER TO (15),16) FOR PRINTING        READPT   2141
      EXS(32)=BUF(2)                                                    READPT   2142
      EXS(31)=OHTYP                                                     READPT   2143
      EXS(1)=BUF(15)*BUF(13)/BUF(14)                                    READPT   2144
      EXS(2)=BUF(14)                                                    READPT   2145
      EXS(3)=BUF(9)                                                     READPT   2146
      EXS(4)=BUF(10)                                                    READPT   2147
      EXS(5)=BUF(11)                                                    READPT   2148
      EXS(6)=BUF(12)                                                    READPT   2149
      EXS(7)=BUF(16)                                                    READPT   2150
      EXS(8)=BUF(17)                                                    READPT   2151
                                                                        READPT   2152
                                                                        READPT   2153
      IF((BUF(3).EQ.0.).AND.                                            READPT   2154
     1   (BUF(4).EQ.0.).AND.                                            READPT   2155
     1   (BUF(5).EQ.0.).AND.                                            READPT   2156
     1   (BUF(2).EQ.0.) ) RETURN                                        READPT   2157
                                                                        READPT   2158
      JFLTN=1                                                           READPT   2159
      EXF(2)=BUF(7)                                                     READPT   2160
      EXF(3)=BUF(5)                                                     READPT   2161
      EXF(4)=BUF(8)                                                     READPT   2162
      EXF(5)=BUF(6)                                                     READPT   2163
      EXF(6)=BUF(3)                                                     READPT   2164
      EXF(7)=BUF(4)                                                     READPT   2165
      IF((BUF(5).EQ.0).AND.                                             READPT   2166
     1   (BUF(6).EQ.0).AND.                                             READPT   2167
     2   (BUF(7).NE.0).AND.                                             READPT   2168
     3   (BUF(4).NE.0))THEN                                             READPT   2169
        EXF(3)=BUF(3)                                                   READPT   2170
        EXF(4)=BUF(4)                                                   READPT   2171
        EXF(6)=0.0                                                      READPT   2172
        EXF(7)=0.0                                                      READPT   2173
      END IF                                                            READPT   2174
C                                                                       READPT   2175
      RETURN                                                            READPT   2176
C                                                                       READPT   2177
C     STABILIZER OSTAB2                                                 READPT   2178
C                                                                       READPT   2179
1520  CONTINUE                                                          READPT   2180
      JSTAB=2                                                           READPT   2181
      EXS(31)=1.0                                                       READPT   2182
      EXS(1)=BUF(7)                                                     READPT   2183
      EXS(2)=BUF(8)                                                     READPT   2184
      EXS(3)=BUF(9)*BUF(10)                                             READPT   2185
      EXS(4)=BUF(10)                                                    READPT   2186
      EXS(5)=BUF(11)*BUF(12)                                            READPT   2187
      EXS(6)=BUF(12)                                                    READPT   2188
      EXS(7)=BUF(21)                                                    READPT   2189
      EXS(8)=BUF(22)                                                    READPT   2190
      IF(EXS(8).LT.-99.0) EXS(8)=-99.0                                  READPT   2191
      EXS(13)=BUF(15)                                                   READPT   2192
      EXS(14)=BUF(16)                                                   READPT   2193
      EXS(15)=BUF(23)                                                   READPT   2194
      EXS(16)=BUF(24)                                                   READPT   2195
      EXS(17)=BUF(13)                                                   READPT   2196
      EXS(18)=BUF(14)                                                   READPT   2197
      EXS(19)=BUF(17)                                                   READPT   2198
      EXS(20)=BUF(18)                                                   READPT   2199
C                                                                       READPT   2200
      RETURN                                                            READPT   2201
C     STABILIZER ISTAB5                                                 READPT   2202
C                                                                       READPT   2203
1530  CONTINUE                                                          READPT   2204
      JSTAB=5                                                           READPT   2205
      JSTAB=2                                                           READPT   2206
      EXS(31)=1.0                                                       READPT   2207
      EXS(1)=BUF(7)                                                     READPT   2208
      EXS(2)=BUF(8)                                                     READPT   2209
      EXS(3)=BUF(9)                                                     READPT   2210
      EXS(4)=BUF(10)                                                    READPT   2211
      EXS(5)=BUF(11)*BUF(12)                                            READPT   2212
      EXS(6)=BUF(12)                                                    READPT   2213
      EXS(7)=BUF(21)                                                    READPT   2214
      EXS(8)=BUF(22)                                                    READPT   2215
      IF(EXS(8).LT.-99.0) EXS(8)=-99.0                                  READPT   2216
      EXS(13)=BUF(15)                                                   READPT   2217
      EXS(14)=BUF(16)                                                   READPT   2218
      EXS(15)=BUF(23)                                                   READPT   2219
      EXS(16)=BUF(24)                                                   READPT   2220
      EXS(17)=BUF(13)                                                   READPT   2221
      EXS(18)=BUF(14)                                                   READPT   2222
      EXS(19)=BUF(17)                                                   READPT   2223
      EXS(20)=BUF(18)                                                   READPT   2224
C                                                                       READPT   2225
      RETURN                                                            READPT   2226
C                                                                       READPT   2227
 1540 CONTINUE                                                          READPT   2228
C                                                                       READPT   2229
C     ST2CUT                                                            READPT   2230
C                                                                       READPT   2231
      JSTAB=12                                                          READPT   2232
      ICON=IFIX(BUF(1))                                                 READPT   2233
      RB1=0                                                             READPT   2234
      IRMBUS=IFIX(BUF(2))                                               READPT   2235
      ICON1=IFIX(BUF(3))                                                READPT   2236
      RB2=0                                                             READPT   2237
      IRMBU1=IFIX(BUF(4))                                               READPT   2238
      IF((ICON.GE.6).OR.(ICON.LE.0))THEN                                READPT   2239
         IOHTYP=0                                                       READPT   2240
         WRITE(MSG(1),1100) KBUS,KCCT,ICON                              READPT   2241
         CALL PRTMSG(1)                                                 READPT   2242
         IERR=1                                                         READPT   2243
         RETURN                                                         READPT   2244
      ELSE                                                              READPT   2245
         IF(ICON.EQ.1) OHTYP=1.                                         READPT   2246
         IF(ICON.EQ.2) OHTYP=3.                                         READPT   2247
         IF(ICON.EQ.3) OHTYP=4.                                         READPT   2248
         IF(ICON.EQ.4) OHTYP=2.                                         READPT   2249
         IF(ICON.EQ.5) OHTYP=5.                                         READPT   2250
         IF(IRMBUS.NE.0) RB1=BUF(2)                                     READPT   2251
      ENDIF                                                             READPT   2252
                                                                        READPT   2253
      IF((ICON1.GE.6).OR.(ICON1.LE.0))THEN                              READPT   2254
         IOHTYP=0                                                       READPT   2255
         WRITE(MSG(1),1100) KBUS,KCCT,ICON1                             READPT   2256
         CALL PRTMSG(1)                                                 READPT   2257
         IERR=1                                                         READPT   2258
         RETURN                                                         READPT   2259
      ELSE                                                              READPT   2260
         IF(ICON1.EQ.1) OHTYP1=1.                                       READPT   2261
         IF(ICON1.EQ.2) OHTYP1=3.                                       READPT   2262
         IF(ICON1.EQ.3) OHTYP1=4.                                       READPT   2263
         IF(ICON1.EQ.4) OHTYP1=2.                                       READPT   2264
         IF(ICON1.EQ.5) OHTYP1=5.                                       READPT   2265
         IF(IRMBU1.NE.0) RB2=BUF(4)                                     READPT   2266
      ENDIF                                                             READPT   2267
C                                                                       READPT   2268
C     STORE ITYPE AND REMOTE BUS NUMBER  FOR PRINTING                   READPT   2269
C                                                                       READPT   2270
      EXS(29)=OHTYP                                                     READPT   2271
      EXS(30)=RB1                                                       READPT   2272
      EXS(31)=OHTYP1                                                    READPT   2273
      EXS(32)=RB2                                                       READPT   2274
c                                                                       READPT   2275
      EXS(1)=BUF(5)                                                     READPT   2276
      EXS(2)=BUF(7)                                                     READPT   2277
      EXS(3)=BUF(6)                                                     READPT   2278
      EXS(4)=BUF(8)                                                     READPT   2279
      EXS(5)=BUF(9)                                                     READPT   2280
      EXS(6)=BUF(10)                                                    READPT   2281
      EXS(7)=BUF(11)                                                    READPT   2282
      EXS(8)=BUF(12)                                                    READPT   2283
      EXS(9)=BUF(13)                                                    READPT   2284
      EXS(10)=BUF(14)                                                   READPT   2285
      EXS(11)=BUF(15)                                                   READPT   2286
      EXS(12)=BUF(16)                                                   READPT   2287
      EXS(13)=BUF(17)                                                   READPT   2288
      EXS(14)=BUF(18)                                                   READPT   2289
      EXS(20)=99.0                                                      READPT   2290
      EXS(21)=-99.0                                                     READPT   2291
C                                                                       READPT   2292
      RETURN                                                            READPT   2293
C                                                                       READPT   2294
1550  CONTINUE                                                          READPT   2295
C                                                                       READPT   2296
C      STAB3                                                            READPT   2297
C                                                                       READPT   2298
      JSTAB=1                                                           READPT   2299
      EXS(31)=4.0                                                       READPT   2300
      EXS(1)=-BUF(4)/BUF(3)                                             READPT   2301
      EXS(2)=BUF(3)                                                     READPT   2302
      EXS(4)=BUF(1)                                                     READPT   2303
      EXS(6)=BUF(2)                                                     READPT   2304
      EXS(7)=BUF(5)                                                     READPT   2305
      EXS(8)=-BUF(5)                                                    READPT   2306
C                                                                       READPT   2307
      RETURN                                                            READPT   2308
C                                                                       READPT   2309
1560  CONTINUE                                                          READPT   2310
C                                                                       READPT   2311
C      STAB4                                                            READPT   2312
C                                                                       READPT   2313
      CH=BUF(2)*BUF(8)*BUF(9)                                           READPT   2314
      IF(CH.EQ.0.0)THEN                                                 READPT   2315
        TNZ1=0.0                                                        READPT   2316
        TNZ2=0.0                                                        READPT   2317
        IF(BUF(2).GT.0.0)THEN                                           READPT   2318
           TNZ1=BUF(2)                                                  READPT   2319
           IF(BUF(8).GT.0.0) TNZ2=BUF(8)                                READPT   2320
           IF(BUF(9).GT.0.0) TNZ2=BUF(9)                                READPT   2321
        ELSE                                                            READPT   2322
           TNZ1=BUF(8)                                                  READPT   2323
           TNZ2=BUF(9)                                                  READPT   2324
        ENDIF                                                           READPT   2325
        JSTAB=12                                                        READPT   2326
        EXS(31)=4.0                                                     READPT   2327
        EXS(2)=TNZ1                                                     READPT   2328
        EXS(1)=BUF(1)/BUF(4)                                            READPT   2329
        EXS(5)=BUF(4)                                                   READPT   2330
        EXS(6)=BUF(4)                                                   READPT   2331
        EXS(7)=BUF(5)                                                   READPT   2332
        EXS(8)=BUF(3)                                                   READPT   2333
        EXS(9)=BUF(6)                                                   READPT   2334
        EXS(10)=BUF(7)                                                  READPT   2335
        EXS(12)=TNZ2                                                    READPT   2336
        EXS(13)=BUF(11)                                                 READPT   2337
        EXS(14)=BUF(10)                                                 READPT   2338
        EXS(20)=99.0                                                    READPT   2339
        EXS(21)=-99.0                                                   READPT   2340
      ELSE                                                              READPT   2341
        WRITE(MSG(1),1200) KBUS,KCCT                                    READPT   2342
        CALL PRTMSG(1)                                                  READPT   2343
        IERR=-1                                                         READPT   2344
      ENDIF                                                             READPT   2345
      RETURN                                                            READPT   2346
C                                                                       READPT   2347
 1100 FORMAT(' *** WARNING - BUS ',I6,' GID: ',A1,                      READPT   2348
     +       ' STABILIZER INPUT-CODE =',I2,' CONVERSION NOT EXACT')     READPT   2349
 1200 FORMAT(' *** WARNING - BUS ',I6,' GID: ',A1,                      READPT   2350
     +       ' STABILIZER CANNOT BE CONVERTED')                         READPT   2351
      END                                                               READPT   2352
C-----------------------------------------------------------------------READPT   2353
      SUBROUTINE GOVERN(KGOV,JGOV,KBUS,KCCT,IERR,BMVAHP,BMVALP,EXG,BUF) READPT   2354
CD                                                                      READPT   2355
CD     TO CONVERT GOVERNOR MODEL DATA FROM PTI DYDA FORMAT              READPT   2356
CD     TO PSAPAC FORMAT.                                                READPT   2357
CD                                                                      READPT   2358
      INCLUDE 'PARX.INS'                                                READPT   2359
      INCLUDE 'CNMSG.INS'                                               READPT   2360
C                                                                       READPT   2361
      DIMENSION BUF(*)                                                  READPT   2362
      DIMENSION EXG(*)                                                  READPT   2363
C                                                                       READPT   2364
      CHARACTER*1 KCCT                                                  READPT   2365
C                                                                       READPT   2366
      IERR=0                                                            READPT   2367
      JGOV=0                                                            READPT   2368
C                                                                       READPT   2369
        GO TO (    10,   20,   200,    40,    50,    60,    70,         READPT   2370
C              CRCMGV,HYGOV,HYGOV2,IEEEG1,IEEEG2,IEEEG3,IEESGO          READPT   2371
C                                                                       READPT   2372
     +            80,   90,  100, 110),KGOV                             READPT   2373
C              TGOV1,TGOV2,TGOV3,GAST                                   READPT   2374
C                                                                       READPT   2375
C                                                                       READPT   2376
10      CONTINUE                                                        READPT   2377
C                                                                       READPT   2378
        IF(BUF(5).NE.BUF(13)) THEN                                      READPT   2379
           WRITE(MSG(2),402) 3,11                                       READPT   2380
           GOTO 11                                                      READPT   2381
        ENDIF                                                           READPT   2382
        IF(BUF(6).NE.BUF(14)) THEN                                      READPT   2383
           WRITE(MSG(2),402) 4,12                                       READPT   2384
           GOTO 11                                                      READPT   2385
        ENDIF                                                           READPT   2386
        IF(BUF(7).NE.BUF(15)) THEN                                      READPT   2387
           WRITE(MSG(2),402) 5,13                                       READPT   2388
           GOTO 11                                                      READPT   2389
        ENDIF                                                           READPT   2390
        IF(BUF(8).NE.BUF(16)) THEN                                      READPT   2391
           WRITE(MSG(2),402) 6,14                                       READPT   2392
           GOTO 11                                                      READPT   2393
        ENDIF                                                           READPT   2394
C                                                                       READPT   2395
        IF(BUF(3).EQ.0.0) THEN                                          READPT   2396
           WRITE(MSG(2),403) 1                                          READPT   2397
           GOTO 11                                                      READPT   2398
        ENDIF                                                           READPT   2399
        IF(BUF(4).EQ.0.0) THEN                                          READPT   2400
           WRITE(MSG(2),403) 2                                          READPT   2401
           GOTO 11                                                      READPT   2402
        ENDIF                                                           READPT   2403
        IF(BUF(11).EQ.0.0) THEN                                         READPT   2404
           WRITE(MSG(2),403) 9                                          READPT   2405
           GOTO 11                                                      READPT   2406
        ENDIF                                                           READPT   2407
        IF(BUF(12).EQ.0.0) THEN                                         READPT   2408
           WRITE(MSG(2),403) 10                                         READPT   2409
           GOTO 11                                                      READPT   2410
        ENDIF                                                           READPT   2411
        IF((BMVAHP.EQ.0.0).AND.(BMVALP.EQ.0.0)) THEN                    READPT   2412
           WRITE(MSG(2),405)                                            READPT   2413
           GOTO 11                                                      READPT   2414
        ENDIF                                                           READPT   2415
        OK=ABS(BUF(3)*BUF(4) - BUF(11)*BUF(12))                         READPT   2416
        IF(OK.GT.0.02) THEN                                             READPT   2417
           WRITE(MSG(1),401) KBUS,KCCT                                  READPT   2418
           WRITE(MSG(2),404) OK                                         READPT   2419
           WRITE(MSG(3),406)                                            READPT   2420
           CALL PRTMSG(3)                                               READPT   2421
           IERR=2                                                       READPT   2422
           RETURN                                                       READPT   2423
        ENDIF                                                           READPT   2424
        PGVMAX=(BUF(3)*BMVAHP)+(BUF(11)*BMVALP)                         READPT   2425
        RH=(BUF(3)*BMVAHP)/PGVMAX                                       READPT   2426
        RL=1.0-RH                                                       READPT   2427
        JGOV=4                                                          READPT   2428
        EXG(1)=1.0/(BUF(3)*BUF(4))                                      READPT   2429
        EXG(2)=BUF(5)                                                   READPT   2430
        EXG(4)=BUF(6)                                                   READPT   2431
        EXG(5)=99.0                                                     READPT   2432
        EXG(6)=-99.0                                                    READPT   2433
        EXG(7)=PGVMAX/BMVAHP                                            READPT   2434
        EXG(10)=BUF(7)                                                  READPT   2435
        EXG(11)=BUF(8)                                                  READPT   2436
        EXG(14)=BUF(9)*RH                                               READPT   2437
        EXG(15)=RH-BUF(9)*RH                                            READPT   2438
        EXG(17)=BUF(17)*RL                                              READPT   2439
        EXG(18)=RL-BUF(17)*RL                                           READPT   2440
C                                                                       READPT   2441
        RETURN                                                          READPT   2442
C                                                                       READPT   2443
20      CONTINUE                                                        READPT   2444
C                                                                       READPT   2445
C          HYGOV  89/06/15 JGOV10 NOW JGOV20 WITH 3 CARDS !!            READPT   2446
C                                                                       READPT   2447
        JGOV=20                                                         READPT   2448
        EXG(1)=1.0/(BUF(4)*BUF(2)*BUF(7))                               READPT   2449
        EXG(2)=BUF(1)*BUF(7)                                            READPT   2450
        EXG(3)=(1.0-BUF(4)/BUF(3))*BUF(2)*BUF(7)                        READPT   2451
        EXG(4)=BUF(9)                                                   READPT   2452
        EXG(5)=BUF(3)                                                   READPT   2453
        EXG(6)=BUF(5)                                                   READPT   2454
        EXG(7)=BUF(7)                                                   READPT   2455
        EXG(8)=1.0                                                      READPT   2456
        EXG(9)=(1.0+BUF(12))/BUF(10)                                    READPT   2457
        EXG(10)=BUF(12)/BUF(10)                                         READPT   2458
        EXG(11)=BUF(6)/BUF(7)                                           READPT   2459
        EXG(12)=-BUF(6)/BUF(7)                                          READPT   2460
        IF (ABS(BUF(11)-1.0).LT.1.0E-5) RETURN                          READPT   2461
        IF (ABS(BUF(11)).LT.1.0E-5) RETURN                              READPT   2462
        WRITE(MSG(1),510) KBUS,KCCT,BUF(11)                             READPT   2463
        WRITE(MSG(2),511)                                               READPT   2464
        CALL PRTMSG(2)                                                  READPT   2465
        IERR=1                                                          READPT   2466
C                                                                       READPT   2467
        RETURN                                                          READPT   2468
C                                                                       READPT   2469
40      CONTINUE                                                        READPT   2470
C                                                                       READPT   2471
C          IEEEG1                                                       READPT   2472
C                                                                       READPT   2473
        IF(BMVALP.EQ.0.0) THEN                                          READPT   2474
           WRITE(MSG(1),410)KBUS,KCCT                                   READPT   2475
           WRITE(MSG(2),411)                                            READPT   2476
           CALL PRTMSG(2)                                               READPT   2477
           IERR=2                                                       READPT   2478
           RETURN                                                       READPT   2479
        ENDIF                                                           READPT   2480
        JGOV=4                                                          READPT   2481
        EXG(1)=BUF(3)/BUF(9)                                            READPT   2482
        EXG(2)=BUF(4)                                                   READPT   2483
        EXG(3)=BUF(5)                                                   READPT   2484
        EXG(4)=BUF(6)                                                   READPT   2485
        EXG(5)=BUF(7)                                                   READPT   2486
        EXG(6)=BUF(8)                                                   READPT   2487
        EXG(7)=BUF(9)                                                   READPT   2488
        EXG(9)=BUF(11)                                                  READPT   2489
        EXG(10)=BUF(14)                                                 READPT   2490
        EXG(11)=BUF(17)                                                 READPT   2491
        EXG(12)=BUF(20)                                                 READPT   2492
        EXG(13)=BUF(12)                                                 READPT   2493
        EXG(14)=BUF(15)                                                 READPT   2494
        EXG(15)=BUF(18)                                                 READPT   2495
        EXG(17)=BUF(16)+BUF(13)                                         READPT   2496
        EXG(18)=BUF(19)                                                 READPT   2497
        EXG(19)=BUF(22)                                                 READPT   2498
C                                     90/06/27                          READPT   2499
        EXG(20)=BUF(9)*BMVAHP/BMVALP                                    READPT   2500
        RETURN                                                          READPT   2501
C                                                                       READPT   2502
50      CONTINUE                                                        READPT   2503
C                                                                       READPT   2504
C          IEEEG2                                                       READPT   2505
C                                                                       READPT   2506
        JGOV=4                                                          READPT   2507
        EXG(1)=BUF(1)/BUF(5)                                            READPT   2508
        EXG(2)=BUF(2)                                                   READPT   2509
        EXG(3)=BUF(3)                                                   READPT   2510
        EXG(4)=BUF(4)                                                   READPT   2511
        EXG(5)=99.                                                      READPT   2512
        EXG(6)=-99.                                                     READPT   2513
        EXG(7)=BUF(5)                                                   READPT   2514
        EXG(10)=BUF(7)/2.0                                              READPT   2515
        EXG(13)=-2.0                                                    READPT   2516
        EXG(14)= 3.0                                                    READPT   2517
        RETURN                                                          READPT   2518
60      CONTINUE                                                        READPT   2519
C                                                                       READPT   2520
C          IEEEG3       89/06/15 JGOV10 NOW JGOV20 WITH 3 CARDS !!      READPT   2521
C                       92/05/01 JGOV21 IF A11/(A11-A13*A21/A23) =-0.5  READPT   2522
C                                                                       READPT   2523
        TOL=0.02                                                        READPT   2524
        FACTOR=BUF(11)-BUF(12)*BUF(13)/BUF(14)                          READPT   2525
        RATIO=BUF(11)/FACTOR                                            READPT   2526
        IF (ABS(-0.5-RATIO).LE.TOL) THEN                                READPT   2527
          JGOV=21                                                       READPT   2528
          EXG(1)=BUF(14)                                                READPT   2529
          EXG(2)=BUF(7)                                                 READPT   2530
          EXG(3)=BUF(1)                                                 READPT   2531
          EXG(4)=BUF(2)                                                 READPT   2532
          EXG(5)=BUF(9)                                                 READPT   2533
          EXG(6)=BUF(8)                                                 READPT   2534
          EXG(7)=BUF(5)                                                 READPT   2535
          EXG(8)=BUF(6)                                                 READPT   2536
          EXG(9)=-FACTOR*BUF(10)                                        READPT   2537
          EXG(10)=BUF(3)                                                READPT   2538
          EXG(11)=BUF(4)                                                READPT   2539
        ELSE                                                            READPT   2540
          JGOV=20                                                       READPT   2541
          EXG(1)=1.0/(BUF(1)*BUF(5))                                    READPT   2542
          EXG(2)=BUF(7)*BUF(5)                                          READPT   2543
          EXG(3)=BUF(8)*BUF(5)                                          READPT   2544
          EXG(4)=BUF(10)                                                READPT   2545
          EXG(5)=BUF(9)                                                 READPT   2546
          EXG(6)=BUF(2)                                                 READPT   2547
          EXG(7)=BUF(5)                                                 READPT   2548
          EXG(8)=1.0                                                    READPT   2549
          EXG(10)= 3.0*BUF(11)/BUF(14)-                                 READPT   2550
     &          BUF(12)*BUF(13)/(BUF(14)*BUF(14))                       READPT   2551
          EXG(9)=EXG(10) + 1.0/(BUF(14)*BUF(5))                         READPT   2552
          EXG(11)=BUF(3)                                                READPT   2553
          EXG(12)=BUF(4)                                                READPT   2554
          IF(EXG(9).GT.1.0) THEN                                        READPT   2555
            WRITE(MSG(1),530) KBUS,KCCT,EXG(9)                          READPT   2556
            CALL PRTMSG(1)                                              READPT   2557
            IERR=1                                                      READPT   2558
          ENDIF                                                         READPT   2559
        ENDIF                                                           READPT   2560
C                                                                       READPT   2561
        RETURN                                                          READPT   2562
C                                                                       READPT   2563
70      CONTINUE                                                        READPT   2564
C                                                                       READPT   2565
C          IEESGO                                                       READPT   2566
C                                                                       READPT   2567
        JGOV=4                                                          READPT   2568
        EXG(1)=BUF(7)/BUF(10)                                           READPT   2569
        EXG(2)=BUF(1)                                                   READPT   2570
        EXG(3)=BUF(2)                                                   READPT   2571
        EXG(4)=BUF(3)                                                   READPT   2572
        EXG(5)= 99.                                                     READPT   2573
        EXG(6)=-99.                                                     READPT   2574
        EXG(7)=BUF(10)                                                  READPT   2575
        EXG(9)=BUF(4)                                                   READPT   2576
        EXG(10)=BUF(5)                                                  READPT   2577
        EXG(11)=BUF(6)                                                  READPT   2578
        EXG(13)=1.0 - BUF(8)                                            READPT   2579
        EXG(14)=BUF(8)*(1.0-BUF(9))                                     READPT   2580
        EXG(15)=BUF(9)*BUF(8)                                           READPT   2581
C                                                                       READPT   2582
        RETURN                                                          READPT   2583
C                                                                       READPT   2584
80      CONTINUE                                                        READPT   2585
C                                                                       READPT   2586
C          TGOV1   NEW ETMSP/SSSPMODEL                                  READPT   2587
C                                                                       READPT   2588
        JGOV=6                                                          READPT   2589
        EXG(1)=BUF(1)*BUF(3)                                            READPT   2590
        EXG(2)=BUF(2)                                                   READPT   2591
        EXG(3)=BUF(5)                                                   READPT   2592
        EXG(4)=BUF(6)                                                   READPT   2593
        EXG(5)=BUF(3)                                                   READPT   2594
        EXG(6)=BUF(4)/BUF(3)                                            READPT   2595
        EXG(7)=BUF(7)/BUF(3)                                            READPT   2596
C                                                                       READPT   2597
        RETURN                                                          READPT   2598
C                                                                       READPT   2599
90      CONTINUE                                                        READPT   2600
C                                                                       READPT   2601
C          TGOV2                                                        READPT   2602
C                                                                       READPT   2603
        JGOV=4                                                          READPT   2604
        WRITE(MSG(1),501) KBUS,KCCT                                     READPT   2605
        CALL PRTMSG(1)                                                  READPT   2606
        EXG(1)=1.0/(BUF(1)*BUF(3))                                      READPT   2607
        EXG(4)=BUF(2)                                                   READPT   2608
        EXG(5)= 99.                                                     READPT   2609
        EXG(6)=-99.                                                     READPT   2610
        EXG(7)=BUF(3)                                                   READPT   2611
        EXG(10)=BUF(6)                                                  READPT   2612
        EXG(11)=BUF(8)                                                  READPT   2613
        EXG(13)=BUF(5)                                                  READPT   2614
        EXG(15)=1.0-BUF(5)                                              READPT   2615
C                                                                       READPT   2616
        RETURN                                                          READPT   2617
C                                                                       READPT   2618
100     CONTINUE                                                        READPT   2619
C                                                                       READPT   2620
C          TGOV3                                                        READPT   2621
C                                                                       READPT   2622
        JGOV=4                                                          READPT   2623
        EXG(1)=BUF(1)/BUF(7)                                            READPT   2624
        EXG(2)=BUF(2)                                                   READPT   2625
        EXG(3)=BUF(3)                                                   READPT   2626
        EXG(4)=BUF(4)                                                   READPT   2627
        EXG(5)=BUF(5)                                                   READPT   2628
        EXG(6)=BUF(6)                                                   READPT   2629
        EXG(7)=BUF(7)                                                   READPT   2630
        EXG(9)=BUF(9)                                                   READPT   2631
        EXG(10)=BUF(11)                                                 READPT   2632
        EXG(11)=BUF(13)                                                 READPT   2633
        EXG(13)=BUF(10)                                                 READPT   2634
        EXG(14)=BUF(12)                                                 READPT   2635
        EXG(15)=1-(BUF(10)+BUF(12))                                     READPT   2636
C                                                                       READPT   2637
        WRITE(MSG(1),502) KBUS,KCCT                                     READPT   2638
        WRITE(MSG(2),503)                                               READPT   2639
        CALL PRTMSG(2)                                                  READPT   2640
C                                                                       READPT   2641
        RETURN                                                          READPT   2642
C                                                                       READPT   2643
110     CONTINUE                                                        READPT   2644
C                                                                       READPT   2645
C          GAST   UPDATED ETMSP/SSSPFORMAT # 7    89/06/07 89/07/05     READPT   2646
C                                                                       READPT   2647
        JGOV=7                                                          READPT   2648
        EXG(1)=BUF(1)*BUF(7)                                            READPT   2649
        EXG(2)=BUF(2)                                                   READPT   2650
        EXG(3)=0.0                                                      READPT   2651
        EXG(4)=BUF(3)                                                   READPT   2652
        EXG(8)=BUF(4)                                                   READPT   2653
        EXG(5)=BUF(7)                                                   READPT   2654
        EXG(6)=BUF(8)                                                   READPT   2655
        EXG(7)=BUF(9)/BUF(7)                                            READPT   2656
        EXG(9)=BUF(6)                                                   READPT   2657
        EXG(10)=BUF(5)/BUF(7)                                           READPT   2658
C                                                                       READPT   2659
        RETURN                                                          READPT   2660
C                                                                       READPT   2661
200     CONTINUE                                                        READPT   2662
C                                                                       READPT   2663
C        NO TRANSLATION AVAILABLE                                       READPT   2664
C                                                                       READPT   2665
        WRITE(MSG(1),500) KBUS,KCCT                                     READPT   2666
        CALL PRTMSG(1)                                                  READPT   2667
        IERR=2                                                          READPT   2668
C                                                                       READPT   2669
        RETURN                                                          READPT   2670
C                                                                       READPT   2671
 11     CONTINUE                                                        READPT   2672
        WRITE(MSG(1),401) KBUS,KCCT                                     READPT   2673
        CALL PRTMSG(2)                                                  READPT   2674
        IERR=2                                                          READPT   2675
C                                                                       READPT   2676
        RETURN                                                          READPT   2677
C                                                                       READPT   2678
  401 FORMAT(' *** WARNING - BUS ',I6,' GID ',A1                        READPT   2679
     *,' CONVERSION PROBLEMS WITH GOVERNOR TYPE CRCMGV')                READPT   2680
  402 FORMAT(5X,'JCON',I3,' SHOULD EQUAL JCON',I3                       READPT   2681
     *,'. MODEL NOT CONVERTED')                                         READPT   2682
  403 FORMAT(5X,'JCON',I3,' SHOULD BE GREATER THAN 0.0')                READPT   2683
  404 FORMAT(5X,'ABS[R(hp)*Pmax(hp) - R(lp)*Pmax(lp)] =',F8.2)          READPT   2684
  406 FORMAT(5X,'ANYTHING > 0.02 IS NOT CONVERTED.')                    READPT   2685
  405 FORMAT(5X,'BOTH HP AND LP BASE MVA =0.0')                         READPT   2686
  410 FORMAT(' *** WARNING - BUS ',I6,' GID ',A1                        READPT   2687
     *,'CONVERSION PROBLEMS WITH GOVERNOR TYPE IEEEG1')                 READPT   2688
  411 FORMAT(5X,'LP MVA RATING =0.0')                                   READPT   2689
  500 FORMAT(' *** WARNING - BUS ',I6,' GID ',A1                        READPT   2690
     *,'NO CONVERSION AVAILABLE FOR GOVERNOR HYGOV2')                   READPT   2691
  501 FORMAT(' *** WARNING - BUS ',I6,' GID ',A1                        READPT   2692
     *,' GOVERNOR TGOV2 CONVERTED WITHOUT FAST VALVING')                READPT   2693
  502 FORMAT(' *** WARNING - BUS ',I6,' GID ',A1)                       READPT   2694
  503 FORMAT(5X                                                         READPT   2695
     *,'GOVERNOR TGOV3 CONVERTED WITHOUT FAST VALVING CONTROLS')        READPT   2696
  510 FORMAT(' *** WARNING - BUS ',I6,' GID ',A1                        READPT   2697
     *,' TURBINE DAMPING',F8.3,' IN HYGOV NOT CONVERTED.')              READPT   2698
  511 FORMAT(5X,'SOME SPEED DAMPING IS INHERENT IN'                     READPT   2699
     *,' THE ETMSP/SSSP MODEL')                                         READPT   2700
  530 FORMAT(' *** BUS ',I6,' GID ',A1                                  READPT   2701
     *,'CALCULATED GFL =',F9.3,' IN HYGOV')                             READPT   2702
      END                                                               READPT   2703
C-----------------------------------------------------------------------READPT   2704
      SUBROUTINE SVCCON(JJSVC,RBASE,BUF)                                READPT   2705
CD                                                                      READPT   2706
CD     TO CONVERT SVC MODEL DATA FROM PTI DYDA FORMAT                   READPT   2707
CD     TO PSAPAC FORMAT.                                                READPT   2708
CD                                                                      READPT   2709
      INCLUDE 'CNMSG.INS'                                               READPT   2710
      INCLUDE 'CNSVCD.INS'                                              READPT   2711
C                                                                       READPT   2712
      REAL BUF(*)                                                       READPT   2713
C                                                                       READPT   2714
      DATA IFIRST/0/                                                    READPT   2715
C                                                                       READPT   2716
      CALL FMOVE(0,SVCDA,SVCDA,24)                                      READPT   2717
C                                                                       READPT   2718
      IF(JJSVC.GE.3) THEN                                               READPT   2719
      IF(IFIRST.EQ.0)THEN                                               READPT   2720
         MSG(1)=' *** WARNING OVERRIDE VOLTAGE BLOCK IN SVC MODEL'      READPT   2721
     *        //' CSVGN3, TSVGN3,'                                      READPT   2722
         MSG(2)='     CSVGN4 AND TSVGN4 WAS NOT CONVERTED.'             READPT   2723
         CALL PRTMSG(2)                                                 READPT   2724
         IFIRST=1                                                       READPT   2725
      ENDIF                                                             READPT   2726
      ENDIF                                                             READPT   2727
C                                                                       READPT   2728
C          CSVGN1 TSVGN1 CSVGN4 TSVGN4 CSVGN3 TSVGN3                    READPT   2729
      GOTO( 200,   200,   300,   300,   200,   200   ),JJSVC            READPT   2730
C                                                                       READPT   2731
C.........................................................              READPT   2732
C                                                                       READPT   2733
 200  CONTINUE                                                          READPT   2734
      SVCDA(1)=BUF(1)                                                   READPT   2735
      SVCDA(2)=RBASE                                                    READPT   2736
      SVCDA(3)=BUF(10)                                                  READPT   2737
      SVCDA(4)=BUF(2)                                                   READPT   2738
      SVCDA(5)=BUF(3)                                                   READPT   2739
      SVCDA(6)=BUF(4)                                                   READPT   2740
      SVCDA(7)=BUF(5)                                                   READPT   2741
      SVCDA(8)=BUF(6)                                                   READPT   2742
      GOTO 400                                                          READPT   2743
C                                                                       READPT   2744
C.........................................................              READPT   2745
 300  CONTINUE                                                          READPT   2746
C                                                                       READPT   2747
      NVSENX=IFIX(BUF(1))                                               READPT   2748
      SVCDA(1)=BUF(2)                                                   READPT   2749
      SVCDA(2)=RBASE                                                    READPT   2750
      SVCDA(3)=BUF(11)                                                  READPT   2751
      SVCDA(4)=BUF(3)                                                   READPT   2752
      SVCDA(5)=BUF(4)                                                   READPT   2753
      SVCDA(6)=BUF(5)                                                   READPT   2754
      SVCDA(7)=BUF(6)                                                   READPT   2755
      SVCDA(8)=BUF(7)                                                   READPT   2756
C.........................................................              READPT   2757
 400  CONTINUE                                                          READPT   2758
      RETURN                                                            READPT   2759
      END                                                               READPT   2760
