CFPRIME READBP                                                          READBP      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 READBP(IUX,IUY)                                        READBP      3
CD                                                                      READBP      4
CD    THIS ROUTINE READS DYNAMIC MODEL DATA IN BPA/WSCC(NEW)            READBP      5
CD    FORMAT. THESE DATA ARE THEN TRANSLATED INTO THE EPRI(NEW) BUS     READBP      6
CD    NUMBER FORMAT AND STORED IN THE PROGRAM ARRAYS.                   READBP      7
CD                                                                      READBP      8
CD    SECTION 1                                                         READBP      9
CD    ---------                                                         READBP     10
CD                                                                      READBP     11
CD    REPEAT...                                                         READBP     12
CD                                                                      READBP     13
CD      READ A CARD                                                     READBP     14
CD      IF CARD IS TYPE MX2,  -MACHINE                                  READBP     15
CD                            -SET FILE POINTER MX2()                   READBP     16
CD      IF CARD IS TYPE MCn,  -CLASSICAL MACHINE                        READBP     17
CD                            -SET FILE POINTER MC()                    READBP     18
CD                            -STORE BUS NAME IN MFNAME()               READBP     19
CD      IF CARD IS TYPE MFn,  -DETAIL MACHINE                           READBP     20
CD                            -SET FILE POINTER MF()                    READBP     21
CD                            -STORE BUS NAME IN MFNAME()               READBP     22
CD      IF CARD IS TYPE E,    -EXCITER                                  READBP     23
CD                            -SET FILE POINTER EXCEP()                 READBP     24
CD      IF CARD IS TYPE S,    -STABILIZER                               READBP     25
CD                            -SET FILE POINTER STAB()                  READBP     26
CD      IF CARD IS TYPE G,    -GOVERNOR                                 READBP     27
CD                            -SET FILE POINTER GOV()                   READBP     28
CD      IF CARD IS TYPE IEEE, -IEEE EXCITER                             READBP     29
CD                            -SET FILE POINTER IEEEX()                 READBP     30
CD      IF CARD IS TYPE T,    -TURBINE                                  READBP     31
CD                            -SET FILE POINTER TB()                    READBP     32
CD                                                                      READBP     33
CD    UNTIL AN 'EPEND' IS REACHED.                                      READBP     34
CD    SORT THE MFNAME(),MF() AND MC() ARRAYS.                           READBP     35
CD                                                                      READBP     36
CD    SECTION 2                                                         READBP     37
CD    ---------                                                         READBP     38
CD                                                                      READBP     39
CD    REPEAT...                                                         READBP     40
CD                                                                      READBP     41
CD      FOR EACH MACHINE IN ARRAY MFNAME(), POINTED TO BY MF()          READBP     42
CD      SEARCH IN FILE WITH RECORD=MX2()  TO PROCESS SUBTRANSIENT DATA  READBP     43
CD      SEARCH IN FILE WITH RECORD=EXCEP() TO PROCESS EXCITER DATA      READBP     44
CD      IF NO WSCC EXCITER FOR THIS MACHINE THEN                        READBP     45
CD         SEARCH FILE WITH RECORD=IEEEX() FOR IEEE TYPE EXCITER        READBP     46
CD      ENDIF                                                           READBP     47
CD      SEARCH IN FILE WITH RECORD=STAB() TO PROCESS STABILIZER DATA    READBP     48
CD      SEARCH IN FILE WITH RECORD=GOV() TO PROCESS GOVERNOR DATA       READBP     49
CD      IF JGOV=4 THEN                                                  READBP     50
CD         SEARCH IN FILE WITH RECORD=TB() TO PROCESS TURBINE MODELS    READBP     51
CD      ENDIF                                                           READBP     52
CD      ARRANGE DATA IN EPRI(NEW) FORMAT                                READBP     53
CD      CALL STGEND TO FILL UP THE TDDAT ARRAY                          READBP     54
CD      FOR CLASSICAL MACHINES ONLY GOVERNORS ARE ALLOWED               READBP     55
CD                                                                      READBP     56
CD    UNTIL ALL MACHINES HAVE BEEN PROCESSED.                           READBP     57
CD                                                                      READBP     58
C-----------------------------------------------------------------------READBP     59
C                                                                       READBP     60
      INCLUDE 'PARX.INS'                                                READBP     61
      INCLUDE 'CNLFDA.INS'                                              READBP     62
      INCLUDE 'CNMNEW.INS'                                              READBP     63
      INCLUDE 'CNPT.INS'                                                READBP     64
      INCLUDE 'CNPARX.INS'                                              READBP     65
      INCLUDE 'CNFLAG.INS'                                              READBP     66
      INCLUDE 'CNUNIT.INS'                                              READBP     67
      INCLUDE 'CNAUTO.INS'                                              READBP     68
      INCLUDE 'CNREN.INS'                                               READBP     69
      INCLUDE 'CNTMDA.INS'                                              READBP     70
      INCLUDE 'CNJDAT.INS'                                              READBP     71
      INCLUDE 'CNJPT.INS'                                               READBP     72
      INCLUDE 'CNIPTR.INS'                                              READBP     73
      INCLUDE 'CNTGED.INS'                                              READBP     74
      INCLUDE 'CNMSG.INS'                                               READBP     75
      INCLUDE 'CNLUN.INS'                                               READBP     76
      INCLUDE 'CNFRUN.INS'                                              READBP     77
      INCLUDE 'CNCPT3.INS'                                              READBP     78
      INCLUDE 'CNB19.INS'                                               READBP     79
      INCLUDE 'CNSVCD.INS'                                              READBP     80
      INCLUDE 'EPBUS.INS'                                               READBP     81
C                                                                       READBP     82
      CHARACTER*1  COL1(12),COL2U(6),COL2R(12),COL2S(6)                 READBP     83
      CHARACTER*1  COL34R(5),TFLAG,ROPT                                 READBP     84
      CHARACTER*2  CID2,GTYPE                                           READBP     85
      CHARACTER*4  LPGID                                                READBP     86
      CHARACTER*32 FILNAM                                               READBP     87
      CHARACTER*12 BSNAME,MANE,ARNAME,NOBUSS,ZNNAME                     READBP     88
      CHARACTER*13 JFNAME(20),MFNAME(NM)                                READBP     89
      CHARACTER*80 CARD1,CARD3,LINE,LINE1,MFB,MFB1,MFB2,MFB3            READBP     90
      CHARACTER*80 IEEEX1,IEEEX2,IEEEX3,IEEEX4,IEEEX5                   READBP     91
C                                                                       READBP     92
      INTEGER JBUS(3),JAREA(3),JZONE(3)                                 READBP     93
      EQUIVALENCE (JBUS(1),BSNAME),(JAREA(1),ARNAME),(JZONE(1),ZNNAME)  READBP     94
      EQUIVALENCE (LPGID,ILPGID)                                        READBP     95
C                                                                       READBP     96
      INTEGER MX2(NM),MC(NM),MF(NM),EXCEP(NM),EXCIE(NM),IEEEX(NM)       READBP     97
      INTEGER STAB(NM),GOV(NM),TB(NM)                                   READBP     98
C                                                                       READBP     99
      INTEGER NTHREL(NB/3)                                              READBP    100
      INTEGER RLBUS1(NB/3),RLBUS2(NB/3)                                 READBP    101
      INTEGER RELBUS                                                    READBP    102
      INTEGER NTHMOT(NMT),MOTBUS(NMT)                                   READBP    103
      INTEGER LSVCBN(NB),LSVC(NSR),LSVCZ(NSR),LSVCA(NSR),LSVCB(NSR)     READBP    104
      INTEGER LSVCC(NSR),LSVCD(NSR),LSVCE(NSR),LSVCF(NSR)               READBP    105
      INTEGER LFSVCO(NSR),LFSVCR(NSR),LFSAR(NSR),LFSBRF(NSR)            READBP    106
      INTEGER LFSBRT(NSR),LFSCR(NSR),ITHGEN(20)                         READBP    107
C                                                                       READBP    108
      LOGICAL IHPLP,JAUTB,RDMODS                                        READBP    109
C............................................                           READBP    110
C                                                                       READBP    111
C     PUT THESE LOCAL VARIABLES IN A COMMON SCRATCH AREA.               READBP    112
C                                                                       READBP    113
      COMMON/SCRAT2/ JFNAME,CARD1,CARD3,LINE,MFB,MFB1,MFB2,MFB3         READBP    114
     &              ,IEEEX1,IEEEX2,IEEEX3,IEEEX4,IEEEX5                 READBP    115
      COMMON/SCRAT8/ MFNAME                                             READBP    116
C                                                                       READBP    117
*IF -MI2                                                                READBP    118
      INTEGER*2 NTHGEL,NEXTG,NGSTAT,KRELTY,IFSLSD,INXLSD,ILSREC,        READBP    119
     +          IRRREC,IBSNLD,IZNNLD,IARNLD                             READBP    120
*ENDIF                                                                  READBP    121
      COMMON /SCRAT4/ NTHGEL(NB),NEXTG(NM)                              READBP    122
     &,NGSTAT(NM),KRELTY(NB/3)                                          READBP    123
C                                                                       READBP    124
      COMMON /SCRAT3/ MX2,MC,MF,EXCEP,EXCIE,IEEEX,STAB,GOV,TB           READBP    125
     +               ,NTHREL,RLBUS1,RLBUS2                              READBP    126
     +               ,IBSNLD(NB),IZNNLD(JZN),IARNLD(JAR),NTHMOT,MOTBUS  READBP    127
     +               ,LSVCBN,LSVC,LSVCZ,LSVCA,LSVCB,LSVCC,LSVCD,LSVCE   READBP    128
     +               ,LSVCF,LFSVCO,LFSVCR,LFSAR,LFSBRF                  READBP    129
     +               ,LFSBRT,LFSCR,ITHGEN                               READBP    130
     +               ,IFSLSD(NB),INXLSD(MAXSET),ILSREC(MAXSET)          READBP    131
     +               ,IRRREC(15*MAXSET)                                 READBP    132
C                                                                       READBP    133
C ------------------|                                                   READBP    134
      DATA NOBUSS/'            '/                                       READBP    135
C                                                                       READBP    136
      DATA COL1/'M','E','F','S','G','I','T','U','R','L','V','W'/        READBP    137
      DATA COL2U/'F','V','D','1','2','3'/                               READBP    138
      DATA COL2R/'A','D','G','L','M','O','U','R','Y','1','2','3'/       READBP    139
      DATA COL2S/'A','B','C','D','E','F'/                               READBP    140
      DATA COL34R/'M','D','R','B','G'/                                  READBP    141
      DATA ICO1                 /12/                                    READBP    142
      DATA ICO2U                /6/                                     READBP    143
      DATA ICO2R                /12/                                    READBP    144
      DATA ICO2S                /6/                                     READBP    145
      DATA ICO34R               /5/                                     READBP    146
C                                                                       READBP    147
C ----------------------------------------------------------------------READBP    148
C                        FIRST EXECUTABLE STATEMENT                     READBP    149
C ----------------------------------------------------------------------READBP    150
C                                                                       READBP    151
      LDEB=(JDEB(91).NE.0)                                              READBP    152
C                                                                       READBP    153
      CALL HMOVE(0,NTHGEL,NTHGEL,NLFBUS)                                READBP    154
      CALL HMOVE(0,NEXTG,NEXTG,NM)                                      READBP    155
      CALL MOVE(0,LSVCBN,LSVCBN,NB)                                     READBP    156
C                                                                       READBP    157
      CALL HMOVE(0,IFSLSD,IFSLSD,NLFBUS)                                READBP    158
      CALL HMOVE(0,INXLSD,INXLSD,MAXSET)                                READBP    159
      CALL HMOVE(0,IRRREC,IRRREC,15*MAXSET)                             READBP    160
C                                                                       READBP    161
      CALL HMOVE(0,IBSNLD,IBSNLD,NB)                                    READBP    162
      CALL HMOVE(0,IZNNLD,IZNNLD,JZN)                                   READBP    163
      CALL HMOVE(0,IARNLD,IARNLD,JAR)                                   READBP    164
      ITLNLD=0                                                          READBP    165
C                                                                       READBP    166
      RDMODS=.FALSE.                                                    READBP    167
      IBUSO2=0                                                          READBP    168
      IRELAY=0                                                          READBP    169
      JSCHEM=0                                                          READBP    170
      LGBUS=0                                                           READBP    171
      RELBUS=0                                                          READBP    172
      NGEN=0                                                            READBP    173
      NMOTBS=0                                                          READBP    174
      NSVCBS=0                                                          READBP    175
      NTLSD=0                                                           READBP    176
C                                                                       READBP    177
      LASTBU=0                                                          READBP    178
C                                                                       READBP    179
      JREC=0                                                            READBP    180
C                                                                       READBP    181
      JLENG=50                                                          READBP    182
      IKEY=4                                                            READBP    183
      CALL OPENRE(IU31,FILNAM,JLENG,IKEY,ISTAT,0)                       READBP    184
      LUNITS(IU31)=.TRUE.                                               READBP    185
C                                                                       READBP    186
      IF(IBPAFL.EQ.2)THEN                                               READBP    187
        IBPAFL=0                                                        READBP    188
        WRITE(MSG(1),7100)                                              READBP    189
        WRITE(MSG(2),7200)                                              READBP    190
        CALL PRTMSG(2)                                                  READBP    191
      ENDIF                                                             READBP    192
C                                                                       READBP    193
      IF(IBPAFL.GT.0)THEN                                               READBP    194
        LINE=' BPAW'                                                    READBP    195
        WRITE(IUY,7000)LINE                                             READBP    196
      ENDIF                                                             READBP    197
C                                                                       READBP    198
C                             ==============                            READBP    199
C                              :  SECTION 1 :                           READBP    200
C                             ==============                            READBP    201
C                                                                       READBP    202
 100  IF(.NOT.RDMODS)THEN                                               READBP    203
C                                                                       READBP    204
        CALL GETLIN(IUX,LINE)                                           READBP    205
        IF(LINE(1:5).EQ.'EDATA')THEN                                    READBP    206
          IF(CFLRUN.AND.IFSPTR(IBPADY).NE.0)THEN                        READBP    207
            KREC=IFSPTR(IBPADY)                                         READBP    208
            READ(IU56,REC=KREC)LINE                                     READBP    209
            IF(LINE(1:5).NE.' BPAW')THEN                                READBP    210
              MSG(1)=' *** KEYWORD BPAW MISSING IN THE FOLLOWING'       READBP    211
     +               //' DYN MOD CARD.'                                 READBP    212
              MSG(2)=LINE                                               READBP    213
              MSG(3)=' *** ALL DYN MOD CARDS WILL BE IGNORED'           READBP    214
              CALL PRTMSG(3)                                            READBP    215
              GOTO 450                                                  READBP    216
            ENDIF                                                       READBP    217
            KREC=INXPTR(KREC)                                           READBP    218
            RDMODS=.TRUE.                                               READBP    219
            GOTO 100                                                    READBP    220
          ELSE                                                          READBP    221
            GOTO 450                                                    READBP    222
          ENDIF                                                         READBP    223
        ENDIF                                                           READBP    224
C                                                                       READBP    225
      ELSE                                                              READBP    226
C                                                                       READBP    227
        IF(KREC.EQ.0)GOTO 450                                           READBP    228
        READ(IU56,REC=KREC)LINE                                         READBP    229
        IF(LINE(1:5).EQ.'EDATA')GOTO 450                                READBP    230
        KREC=INXPTR(KREC)                                               READBP    231
C                                                                       READBP    232
      ENDIF                                                             READBP    233
C                                                                       READBP    234
      IF(IBPAFL.GT.0)WRITE(IUY,7000)LINE                                READBP    235
C                                                                       READBP    236
      DO 110 I=1,ICO1                                                   READBP    237
        IF(LINE(1:1).EQ.COL1(I))THEN                                    READBP    238
          ICODE=I                                                       READBP    239
          GOTO 120                                                      READBP    240
        ENDIF                                                           READBP    241
  110 CONTINUE                                                          READBP    242
C                                                                       READBP    243
C-----------------------------------------------------------------------READBP    244
C     DOESN'T RECOGNIZE THIS KEY WORD IN COLUMN 1                       READBP    245
C                                                                       READBP    246
      WRITE(MSG(1),1000)                                                READBP    247
      MSG(2)=LINE                                                       READBP    248
      CALL PRTMSG(2)                                                    READBP    249
      IF(RDMODS)THEN                                                    READBP    250
        LINE='READBP:  CHECK COLUMN 1 IN DYN MOD CARDS'                 READBP    251
        CALL ASTOP(LINE,44)                                             READBP    252
      ELSE                                                              READBP    253
        LINE='READBP:  CHECK COLUMN 1 IN BPA/NEW DYNAMIC DATA CARDS'    READBP    254
        CALL ASTOP(LINE,53)                                             READBP    255
      ENDIF                                                             READBP    256
C                                                                       READBP    257
C-----------------------------------------------------------------------READBP    258
C                                                                       READBP    259
  120 CONTINUE                                                          READBP    260
C                                                                       READBP    261
C     KEY WORD MATCH. CHECK IF THE BUS NAME EXIST                       READBP    262
C     ICODE=6 IS IEEE KEYWORD. BUS NAME IS NOT INVOLVED IN THIS CARD    READBP    263
C                                                                       READBP    264
C           'M'  'E'  'F'  'S'  'G'  'I'  'T'  'U'  'R'  'L'            READBP    265
      GOTO (130, 130, 130, 130, 130, 130, 130, 340, 390, 430,           READBP    266
C           'V'  'W'                                                    READBP    267
     1      440, 447) ICODE                                             READBP    268
C                                                                       READBP    269
C     MACHINE DATA                                                      READBP    270
C                                                                       READBP    271
 130  CONTINUE                                                          READBP    272
C                                                                       READBP    273
C     CHECK IF THE CARD IS INDUCTION MOTOR CARD                         READBP    274
C                                                                       READBP    275
      IF(LINE(1:2).EQ.'MI') GOTO 435                                    READBP    276
C                                                                       READBP    277
C     CHECK RECORD IDENTIFIER                                           READBP    278
C                                                                       READBP    279
      IF(LINE(1:1).EQ.'S'.OR.LINE(1:1).EQ.'F')THEN                      READBP    280
        IF(LINE(3:3).NE.' '.AND.LINE(3:3).NE.'1') GOTO 9900             READBP    281
      ENDIF                                                             READBP    282
C                                                                       READBP    283
      IF(ICODE.EQ.6)THEN                                                READBP    284
        IF(RDMODS)THEN                                                  READBP    285
          MSG(1)=' *** IEEE EXCITERS ARE NOT ALLOWED IN DYN '//         READBP    286
     +           'MOD CARDS.'                                           READBP    287
          MSG(2)=LINE                                                   READBP    288
          CALL PRTMSG(2)                                                READBP    289
          LINE='READBP: IEEE EXCITERS MUST BE REMOVED.'                 READBP    290
          CALL ASTOP(LINE,38)                                           READBP    291
        ENDIF                                                           READBP    292
        CALL GETLIN(IUX,LINE)                                           READBP    293
C                                                                       READBP    294
        IF(IBPAFL.GT.0)WRITE(IUY,7000)LINE                              READBP    295
C                                                                       READBP    296
        IEEEX1=LINE                                                     READBP    297
        BSNAME=LINE(7:18)                                               READBP    298
        LINE(4:15)=BSNAME                                               READBP    299
        LINE(16:16)=LINE(20:20)                                         READBP    300
      ENDIF                                                             READBP    301
C                                                                       READBP    302
 140  BSNAME=LINE(4:15)                                                 READBP    303
      CALL CHKBUS(BSNAME,IBUSOK)                                        READBP    304
      IF(IBUSOK.LE.0)THEN                                               READBP    305
C                                                                       READBP    306
C     BUS NOT EXIST WRITE OUT WARNING MESSAGE AND SKIP THIS CARD        READBP    307
C                                                                       READBP    308
        WRITE(MSG(1),1190)                                              READBP    309
        MSG(2)=LINE                                                     READBP    310
        CALL PRTMSG(2)                                                  READBP    311
        IF(ICODE.EQ.6)THEN                                              READBP    312
          DO 150 I=1,4                                                  READBP    313
            IF(.NOT.RDMODS)THEN                                         READBP    314
              CALL GETLIN(IUX,LINE)                                     READBP    315
            ELSE                                                        READBP    316
              READ(IU56,REC=KREC)LINE                                   READBP    317
              KREC=INXPTR(KREC)                                         READBP    318
            ENDIF                                                       READBP    319
C                                                                       READBP    320
            IF(IBPAFL.GT.0)WRITE(IUY,7000)LINE                          READBP    321
C                                                                       READBP    322
            READ(LINE,1310) LINE                                        READBP    323
            WRITE(MSG(1),1190)                                          READBP    324
            MSG(2)=LINE                                                 READBP    325
            CALL PRTMSG(2)                                              READBP    326
 150      CONTINUE                                                      READBP    327
        ENDIF                                                           READBP    328
        GOTO 100                                                        READBP    329
C                                                                       READBP    330
C     BUS EXIST CHECK NTHGEL LIST                                       READBP    331
C                                                                       READBP    332
      ELSE                                                              READBP    333
C                                                                       READBP    334
        KTHGEN=NTHGEL(IBUSOK)                                           READBP    335
        IF(KTHGEN.EQ.0)THEN                                             READBP    336
          NGEN=NGEN+1                                                   READBP    337
          IF(NGEN.GT.NXM)THEN                                           READBP    338
            WRITE(MSG(1),1360)                                          READBP    339
            MSG(2)=LINE                                                 READBP    340
            CALL PRTMSG(2)                                              READBP    341
            LINE='READBP: YOU HAVE TOO MANY GENERATORS'                 READBP    342
            CALL ASTOP(LINE,36)                                         READBP    343
          ENDIF                                                         READBP    344
          KTHGEN=NGEN                                                   READBP    345
          NTHGEL(IBUSOK)=KTHGEN                                         READBP    346
          MFNAME(KTHGEN)=LINE(4:16)                                     READBP    347
          NGSTAT(KTHGEN)=0                                              READBP    348
          MX2(KTHGEN)=0                                                 READBP    349
          MC(KTHGEN)=0                                                  READBP    350
          MF(KTHGEN)=0                                                  READBP    351
          STAB(KTHGEN)=0                                                READBP    352
          IEEEX(KTHGEN)=0                                               READBP    353
          EXCEP(KTHGEN)=0                                               READBP    354
          EXCIE(KTHGEN)=0                                               READBP    355
          GOV(KTHGEN)=0                                                 READBP    356
          TB(KTHGEN)=0                                                  READBP    357
          IF(IBUSOK.GT.LGBUS)LGBUS=IBUSOK                               READBP    358
          GOTO 170                                                      READBP    359
        ELSE                                                            READBP    360
  160     IF(LINE(4:16).EQ.MFNAME(KTHGEN))THEN                          READBP    361
C                                                                       READBP    362
C EXISTING GENERATOR - REPLACE DATA                                     READBP    363
C                                                                       READBP    364
            GOTO 170                                                    READBP    365
          ENDIF                                                         READBP    366
          LTHGEN=KTHGEN                                                 READBP    367
          KTHGEN=NEXTG(KTHGEN)                                          READBP    368
          IF(KTHGEN.EQ.0)THEN                                           READBP    369
            NGEN=NGEN+1                                                 READBP    370
            IF(NGEN.GT.NXM)THEN                                         READBP    371
              WRITE(MSG(1),1360)                                        READBP    372
              MSG(2)=LINE                                               READBP    373
              CALL PRTMSG(2)                                            READBP    374
              LINE='READBP: YOU HAVE TOO MANY GENERATORS'               READBP    375
              CALL ASTOP(LINE,36)                                       READBP    376
            ENDIF                                                       READBP    377
            KTHGEN=NGEN                                                 READBP    378
            NEXTG(LTHGEN)=KTHGEN                                        READBP    379
            MFNAME(KTHGEN)=LINE(4:16)                                   READBP    380
            NGSTAT(KTHGEN)=0                                            READBP    381
            MX2(KTHGEN)=0                                               READBP    382
            MC(KTHGEN)=0                                                READBP    383
            MF(KTHGEN)=0                                                READBP    384
            STAB(KTHGEN)=0                                              READBP    385
            IEEEX(KTHGEN)=0                                             READBP    386
            EXCEP(KTHGEN)=0                                             READBP    387
            EXCIE(KTHGEN)=0                                             READBP    388
            GOV(KTHGEN)=0                                               READBP    389
            TB(KTHGEN)=0                                                READBP    390
            GOTO 170                                                    READBP    391
          ELSE                                                          READBP    392
            GOTO 160                                                    READBP    393
          ENDIF                                                         READBP    394
        ENDIF                                                           READBP    395
      ENDIF                                                             READBP    396
C                                                                       READBP    397
 170  CONTINUE                                                          READBP    398
C-----------------------------------------------------------------------READBP    399
C     BUS NAME CHECKED OUT OK                                           READBP    400
C                                                                       READBP    401
C     CARD CODE IS ONE OF : M-MACHINE, E-EXCITER, S-STABILIZER,G-GOVERNOREADBP    402
C                                        I-IEEE,U-USER DEFINED MODELS.  READBP    403
C             M    E    F    S    G    I    T                           READBP    404
      GOTO( 180, 240, 250, 260, 300, 310, 330) ICODE                    READBP    405
C                                                                       READBP    406
C-----------------------------------------------------------------------READBP    407
C     MACHINE DATA                                                      READBP    408
C                                                                       READBP    409
  180 CONTINUE                                                          READBP    410
      IF(LDEB) WRITE(IUD6,1040) LINE                                    READBP    411
C                                                                       READBP    412
      IF(LINE(2:2).EQ.'C'.OR.LINE(2:2).EQ.'F') GOTO 200                 READBP    413
C                                                                       READBP    414
C................................................................       READBP    415
C     DOESN'T RECOGNIZE COLUMN 2 KEY WORD FOR MACHINE CARD              READBP    416
C                                                                       READBP    417
      WRITE(MSG(1),1010)                                                READBP    418
      MSG(2)=LINE                                                       READBP    419
      CALL PRTMSG(2)                                                    READBP    420
      LINE='READBP: CHECK COLUMN 2 IN MACHINE DATA CARDS'               READBP    421
      CALL ASTOP(LINE,44)                                               READBP    422
C                                                                       READBP    423
C.................................................................      READBP    424
C                                                                       READBP    425
  200 CONTINUE                                                          READBP    426
C                                                                       READBP    427
C     MACHINE COULD BE CLASSICAL (C) , OR DETAILED (F) MODEL            READBP    428
C                                                                       READBP    429
      IF(LINE(3:3).EQ.'2') GOTO 210                                     READBP    430
      IF(LINE(2:2).EQ.'C')THEN                                          READBP    431
        IF(LINE(3:3).EQ.' '.OR.LINE(3:3).EQ.'1') GOTO 220               READBP    432
      ELSE                                                              READBP    433
        IF(LINE(3:3).EQ.' '.OR.LINE(3:3).EQ.'1') GOTO 230               READBP    434
      ENDIF                                                             READBP    435
C                                                                       READBP    436
      GOTO 9900                                                         READBP    437
C                                                                       READBP    438
C..................................................................     READBP    439
C     BLANK IN COLUMN 2 , MACHINE CARD                                  READBP    440
C                                                                       READBP    441
  210 CONTINUE                                                          READBP    442
C                                                                       READBP    443
      IF(MX2(KTHGEN).EQ.0)THEN                                          READBP    444
        JREC=JREC+1                                                     READBP    445
        MX2(KTHGEN)=JREC                                                READBP    446
      ENDIF                                                             READBP    447
      IREC=MX2(KTHGEN)                                                  READBP    448
      WRITE(IU31,REC=IREC) LINE                                         READBP    449
C                                                                       READBP    450
      GOTO 100                                                          READBP    451
C                                                                       READBP    452
C.................................................................      READBP    453
C     'C' IN COLUMN 2 , MACHINE CARD                                    READBP    454
C                                                                       READBP    455
  220 CONTINUE                                                          READBP    456
C                                                                       READBP    457
      IF(MC(KTHGEN).EQ.0)THEN                                           READBP    458
        JREC=JREC+1                                                     READBP    459
        MC(KTHGEN)=JREC                                                 READBP    460
      ENDIF                                                             READBP    461
      NGSTAT(KTHGEN)=1                                                  READBP    462
      IREC=MC(KTHGEN)                                                   READBP    463
      WRITE(IU31,REC=IREC) LINE                                         READBP    464
C                                                                       READBP    465
      GOTO 100                                                          READBP    466
C                                                                       READBP    467
C..................................................................     READBP    468
C     'F' IN COLUMN 2 , MACHINE CARD                                    READBP    469
C                                                                       READBP    470
  230 CONTINUE                                                          READBP    471
C                                                                       READBP    472
      IF(MF(KTHGEN).EQ.0)THEN                                           READBP    473
        JREC=JREC+1                                                     READBP    474
        MF(KTHGEN)=JREC                                                 READBP    475
      ENDIF                                                             READBP    476
      NGSTAT(KTHGEN)=2                                                  READBP    477
      IREC=MF(KTHGEN)                                                   READBP    478
      WRITE(IU31,REC=IREC) LINE                                         READBP    479
      GOTO 100                                                          READBP    480
C                                                                       READBP    481
C-----------------------------------------------------------------------READBP    482
C     EXCITER DATA                                                      READBP    483
  240 CONTINUE                                                          READBP    484
C                                                                       READBP    485
      IF(LDEB) WRITE(IUD6,1060) LINE                                    READBP    486
      IF(EXCEP(KTHGEN).EQ.0)THEN                                        READBP    487
        JREC=JREC+1                                                     READBP    488
        EXCEP(KTHGEN)=JREC                                              READBP    489
      ENDIF                                                             READBP    490
      IREC=EXCEP(KTHGEN)                                                READBP    491
      WRITE(IU31,REC=IREC) LINE                                         READBP    492
C                                                                       READBP    493
      GOTO 100                                                          READBP    494
C                                                                       READBP    495
C-----------------------------------------------------------------------READBP    496
C    BPA-IEEE EXCITER DATA                                              READBP    497
  250 CONTINUE                                                          READBP    498
C                                                                       READBP    499
      IF(LDEB) WRITE(IUD6,1060) LINE                                    READBP    500
C                                                                       READBP    501
      IF(EXCIE(KTHGEN).EQ.0)THEN                                        READBP    502
        JREC=JREC+1                                                     READBP    503
        EXCIE(KTHGEN)=JREC                                              READBP    504
        IREC=EXCIE(KTHGEN)                                              READBP    505
        WRITE(IU31,REC=IREC) LINE                                       READBP    506
C                             Second card required for a new generator  READBP    507
        IF(.NOT.RDMODS)THEN                                             READBP    508
          CALL GETLIN(IUX,LINE1)                                        READBP    509
        ELSE                                                            READBP    510
          READ(IU56,REC=KREC)LINE1                                      READBP    511
          KREC=INXPTR(KREC)                                             READBP    512
        ENDIF                                                           READBP    513
C                                                                       READBP    514
        IF(IBPAFL.GT.0)WRITE(IUY,7000)LINE1                             READBP    515
C                                                                       READBP    516
        IF(LDEB) WRITE(IUD6,1060) LINE1                                 READBP    517
        IF(LINE(1:2).EQ.LINE1(1:2))THEN                                 READBP    518
          LINE=LINE1                                                    READBP    519
C                                                                       READBP    520
C     CHECK RECORD IDENTIFIER                                           READBP    521
C                                                                       READBP    522
          IF(LINE(3:3).NE.'2') GOTO 9900                                READBP    523
C                                                                       READBP    524
          JREC=JREC+1                                                   READBP    525
          IREC=JREC                                                     READBP    526
          WRITE(IU31,REC=IREC) LINE                                     READBP    527
        ELSE                                                            READBP    528
          MSG(1)=' *** ERROR IN READING SECOND EXCITER CARD FOR'        READBP    529
          MSG(2)=LINE                                                   READBP    530
          CALL PRTMSG(2)                                                READBP    531
          LINE='READBP: SECOND EXCITER CARD IS INVALID'                 READBP    532
          CALL ASTOP(LINE,38)                                           READBP    533
        ENDIF                                                           READBP    534
      ELSE                                                              READBP    535
        IREC=EXCIE(KTHGEN)                                              READBP    536
        IF(LINE(3:3).EQ.'2')IREC=IREC+1                                 READBP    537
        WRITE(IU31,REC=IREC) LINE                                       READBP    538
      ENDIF                                                             READBP    539
C                                                                       READBP    540
      GOTO 100                                                          READBP    541
C ----------------------------------------------------------------      READBP    542
C     STABILIZER DATA                                                   READBP    543
C                                                                       READBP    544
  260 CONTINUE                                                          READBP    545
C                                                                       READBP    546
      IF(LINE(2:2).EQ.'T')THEN                                          READBP    547
        WRITE(MSG(1),6100)                                              READBP    548
        MSG(2)=LINE                                                     READBP    549
        CALL PRTMSG(2)                                                  READBP    550
      ELSE                                                              READBP    551
        IF(LDEB) WRITE(IUD6,1080) LINE                                  READBP    552
        IF(STAB(KTHGEN).EQ.0)THEN                                       READBP    553
          JREC=JREC+1                                                   READBP    554
          STAB(KTHGEN)=JREC                                             READBP    555
        ENDIF                                                           READBP    556
        IREC=STAB(KTHGEN)                                               READBP    557
        WRITE(IU31,REC=IREC) LINE                                       READBP    558
      ENDIF                                                             READBP    559
C                                                                       READBP    560
      GOTO 100                                                          READBP    561
C                                                                       READBP    562
C-----------------------------------------------------------------------READBP    563
C     GOVERNOR DATA                                                     READBP    564
C                                                                       READBP    565
  300 CONTINUE                                                          READBP    566
C                                                                       READBP    567
      IF(LDEB) WRITE(IUD6,1090) LINE                                    READBP    568
      IF(GOV(KTHGEN).EQ.0)THEN                                          READBP    569
        JREC=JREC+1                                                     READBP    570
        GOV(KTHGEN)=JREC                                                READBP    571
      ENDIF                                                             READBP    572
      IREC=GOV(KTHGEN)                                                  READBP    573
      WRITE(IU31,REC=IREC) LINE                                         READBP    574
C                                                                       READBP    575
      GOTO 100                                                          READBP    576
C                                                                       READBP    577
C-----------------------------------------------------------------------READBP    578
C     IEEE FORMAT EXCITER TYPE DATA                                     READBP    579
C                                                                       READBP    580
C       REPEAT                                                          READBP    581
C         READ 5 CARDS,                                                 READBP    582
C         STORE THE 5 CARDS INTO ARRAY IEEEX(5,MP)                      READBP    583
C       UNTIL (LINE(1:4)='WSCC')                                        READBP    584
C                                                                       READBP    585
C       KIEEE=NUMBER OF IEEE EXCITERS.                                  READBP    586
C                                                                       READBP    587
  310    CONTINUE                                                       READBP    588
         IEEEX(KTHGEN)=JREC+1                                           READBP    589
         JREC=JREC+1                                                    READBP    590
         WRITE(IU31,REC=JREC) IEEEX1                                    READBP    591
C        READ AND STORE 4 MORE CARD                                     READBP    592
         DO 320 I=1,4                                                   READBP    593
           CALL GETLIN(IUX,LINE)                                        READBP    594
C                                                                       READBP    595
           IF(IBPAFL.GT.0)WRITE(IUY,7000)LINE                           READBP    596
C                                                                       READBP    597
           JREC=JREC+1                                                  READBP    598
           WRITE(IU31,REC=JREC) LINE                                    READBP    599
  320    CONTINUE                                                       READBP    600
C                                                                       READBP    601
         CALL GETLIN(IUX,LINE)                                          READBP    602
         IF(LINE(1:5).EQ.'EDATA')GOTO 450                               READBP    603
C                                                                       READBP    604
         IF(IBPAFL.GT.0)WRITE(IUY,7000)LINE                             READBP    605
C                                                                       READBP    606
         IF(LINE(1:4).EQ.'WSCC')THEN                                    READBP    607
           GOTO 100                                                     READBP    608
         ELSEIF(LINE(1:4).NE.'WSCC'.AND. LINE(1:1).EQ.' ')THEN          READBP    609
           IEEEX1=LINE                                                  READBP    610
           BSNAME=LINE(7:18)                                            READBP    611
           LINE(4:15)=BSNAME                                            READBP    612
           LINE(16:16)=LINE(20:20)                                      READBP    613
           GOTO 140                                                     READBP    614
         ELSEIF(LINE(1:4).EQ.'IEEE')THEN                                READBP    615
           GOTO 130                                                     READBP    616
C                                                                       READBP    617
C     ERROR. NOT IEEE KEY WORD..                                        READBP    618
C                                                                       READBP    619
         ELSE                                                           READBP    620
           WRITE(MSG(1),1020)                                           READBP    621
           MSG(2)=LINE                                                  READBP    622
           CALL PRTMSG(2)                                               READBP    623
           LINE='READBP: CHECK COLUMN 1 TO 4 IEEE EXCITER DATA'         READBP    624
           CALL ASTOP(LINE,45)                                          READBP    625
         ENDIF                                                          READBP    626
C                                                                       READBP    627
C    -------------------------------------------------------------      READBP    628
C     TURBINE DATA                                                      READBP    629
C                                                                       READBP    630
  330 CONTINUE                                                          READBP    631
C                                                                       READBP    632
      IF(LDEB) WRITE(IUD6,1090) LINE                                    READBP    633
      IF(TB(KTHGEN).EQ.0)THEN                                           READBP    634
        JREC=JREC+1                                                     READBP    635
        TB(KTHGEN)=JREC                                                 READBP    636
      ENDIF                                                             READBP    637
      IREC=TB(KTHGEN)                                                   READBP    638
      WRITE(IU31,REC=IREC) LINE                                         READBP    639
C                                                                       READBP    640
      GOTO 100                                                          READBP    641
C---------------------------------------------------------------        READBP    642
C     LOAD SHEDDING DATA                                                READBP    643
C                                                                       READBP    644
 340  CONTINUE                                                          READBP    645
C                                                                       READBP    646
C     CHECK RECORD IDENTIFIER                                           READBP    647
C                                                                       READBP    648
      IF (LINE(3:3).NE.' '.AND.LINE(3:3).NE.'1') GOTO 9900              READBP    649
C                                                                       READBP    650
      DO 345 I=1,ICO2U                                                  READBP    651
        IF(LINE(2:2).EQ.COL2U(I))THEN                                   READBP    652
          JTYPE=I                                                       READBP    653
          GOTO 346                                                      READBP    654
        ENDIF                                                           READBP    655
 345  CONTINUE                                                          READBP    656
C                                                                       READBP    657
      WRITE(MSG(1),1380)                                                READBP    658
      MSG(2)=LINE                                                       READBP    659
      CALL PRTMSG(2)                                                    READBP    660
      LINE='READBP: CHECK COLUMN 2 IN LOAD SHEDDING DATA CARS'          READBP    661
      CALL ASTOP(LINE,49)                                               READBP    662
C                                                                       READBP    663
 346  JFLAG=1                                                           READBP    664
      BSNAME=LINE(4:15)                                                 READBP    665
      CALL CHKBUS(BSNAME,IBUSOK)                                        READBP    666
      IF(IBUSOK.GT.0)THEN                                               READBP    667
        JFLAG=0                                                         READBP    668
      ELSEIF (LINE(4:13).EQ.' ')THEN                                    READBP    669
        ZNNAME=LINE(14:15)                                              READBP    670
        CALL CHZONE (ZNNAME,IZONOK)                                     READBP    671
        IF(IZONOK.GT.0)JFLAG=-1                                         READBP    672
      ELSEIF(LINE(4:8).EQ.'TOTAL'.OR.LINE(4:9).EQ.'SYSTEM')THEN         READBP    673
        IF(LINE(9:15).EQ.' ')JFLAG=-3                                   READBP    674
      ELSEIF (LINE(14:15).EQ.' ')THEN                                   READBP    675
        ARNAME=LINE(4:13)                                               READBP    676
        CALL CHAREA (ARNAME,IAREOK)                                     READBP    677
        IF(IAREOK.GT.0)JFLAG=-2                                         READBP    678
      ENDIF                                                             READBP    679
C                                                                       READBP    680
      IF(JFLAG.EQ.1)THEN                                                READBP    681
        WRITE(MSG(1),6000)                                              READBP    682
        MSG(2)=LINE                                                     READBP    683
        CALL PRTMSG(2)                                                  READBP    684
        GOTO 100                                                        READBP    685
      ENDIF                                                             READBP    686
C                                                                       READBP    687
      JREC=JREC+1                                                       READBP    688
      IREC=JREC                                                         READBP    689
      WRITE(IU31,REC=IREC) JFLAG,JTYPE,LINE                             READBP    690
      IF(LINE(16:16).EQ.'S')THEN                                        READBP    691
        ISOPT=1                                                         READBP    692
      ELSE                                                              READBP    693
        ISOPT=0                                                         READBP    694
      ENDIF                                                             READBP    695
C                                                                       READBP    696
      IF(JFLAG.EQ.0)THEN                                                READBP    697
        IF(IBUSOK.GT.LASTBU)LASTBU=IBUSOK                               READBP    698
        IPTR=IBUSOK                                                     READBP    699
        CALL EPLSB2(IPTR,JREC,NTLSD,JTYPE,JFLAG,IERR)                   READBP    700
        IF(IERR.NE.0)GOTO 357                                           READBP    701
      ELSEIF(JFLAG.EQ.-1)THEN                                           READBP    702
        K=0                                                             READBP    703
        KK=0                                                            READBP    704
        DO 352 II=1,NLFBUS                                              READBP    705
          K=K+4                                                         READBP    706
          KK=KK+8                                                       READBP    707
          ILK=IBAR(K-1)                                                 READBP    708
          CALL UPACKI(IZONE,JJJ,ILK)                                    READBP    709
          IF(IZONE.EQ.IZONOK)THEN                                       READBP    710
            IF((IBAR(K-2).NE.0.OR.IBAR(K-3).NE.0).OR.                   READBP    711
     +         ((ISOPT.EQ.1).AND.                                       READBP    712
     +          (RYGR(KK-3).NE.0.0.OR.RYGR(KK-4).NE.0.0)))THEN          READBP    713
              IF(II.GT.LASTBU)LASTBU=II                                 READBP    714
              IPTR=II                                                   READBP    715
              CALL EPLSB2(IPTR,JREC,NTLSD,JTYPE,JFLAG,IERR)             READBP    716
              IF(IERR.NE.0)GOTO 357                                     READBP    717
            ENDIF                                                       READBP    718
          ENDIF                                                         READBP    719
 352    CONTINUE                                                        READBP    720
      ELSEIF(JFLAG.EQ.-2)THEN                                           READBP    721
        K=0                                                             READBP    722
        KK=0                                                            READBP    723
        DO 354 II=1,NLFBUS                                              READBP    724
          K=K+4                                                         READBP    725
          KK=KK+8                                                       READBP    726
          ILK=IBAR(K-1)                                                 READBP    727
          CALL UPACKI(JJJ,IAREA,ILK)                                    READBP    728
          IF(IAREA.EQ.IAREOK)THEN                                       READBP    729
            IF((IBAR(K-2).NE.0.OR.IBAR(K-3).NE.0).OR.                   READBP    730
     +         ((ISOPT.EQ.1).AND.                                       READBP    731
     +          (RYGR(KK-3).NE.0.0.OR.RYGR(KK-4).NE.0.0)))THEN          READBP    732
              IF(II.GT.LASTBU)LASTBU=II                                 READBP    733
              IPTR=II                                                   READBP    734
              CALL EPLSB2(IPTR,JREC,NTLSD,JTYPE,JFLAG,IERR)             READBP    735
              IF(IERR.NE.0)GOTO 357                                     READBP    736
            ENDIF                                                       READBP    737
          ENDIF                                                         READBP    738
 354    CONTINUE                                                        READBP    739
      ELSE                                                              READBP    740
        K=0                                                             READBP    741
        KK=0                                                            READBP    742
        DO 356 II=1,NLFBUS                                              READBP    743
          K=K+4                                                         READBP    744
          KK=KK+8                                                       READBP    745
          IF((IBAR(K-2).NE.0.OR.IBAR(K-3).NE.0).OR.                     READBP    746
     +       ((ISOPT.EQ.1).AND.                                         READBP    747
     +        (RYGR(KK-3).NE.0.0.OR.RYGR(KK-4).NE.0.0)))THEN            READBP    748
            IF(II.GT.LASTBU)LASTBU=II                                   READBP    749
            IPTR=II                                                     READBP    750
            CALL EPLSB2(IPTR,JREC,NTLSD,JTYPE,JFLAG,IERR)               READBP    751
            IF(IERR.NE.0)GOTO 357                                       READBP    752
          ENDIF                                                         READBP    753
 356    CONTINUE                                                        READBP    754
      ENDIF                                                             READBP    755
C                                                                       READBP    756
      GOTO 100                                                          READBP    757
C                                                                       READBP    758
 357  WRITE(MSG(1),1370)                                                READBP    759
      MSG(2)=LINE                                                       READBP    760
      CALL PRTMSG(2)                                                    READBP    761
      LINE='READBP: THERE ARE TOO MANY LOAD SHEDDING BUSSES'            READBP    762
      CALL ASTOP(LINE,47)                                               READBP    763
C                                                                       READBP    764
C---------------------------------------------------------------        READBP    765
C                                                                       READBP    766
C     RELAY DATA                                                        READBP    767
C                                                                       READBP    768
 390  CONTINUE                                                          READBP    769
C                                                                       READBP    770
C     CHECK RECORD IDENTIFIER                                           READBP    771
C                                                                       READBP    772
      IF (LINE(3:3).NE.' '.AND.LINE(3:3).NE.'1') GOTO 9900              READBP    773
C                                                                       READBP    774
      BSNAME=LINE(7:18)                                                 READBP    775
      CALL CHKBUS(BSNAME,IBUSO1)                                        READBP    776
C                                                                       READBP    777
C     BUS NOT FOUND WRITE OUT WARNING MESSAGE AND SKIP THIS CARD        READBP    778
C                                                                       READBP    779
      IF(IBUSO1.LE.0)THEN                                               READBP    780
        WRITE(MSG(1),1190)                                              READBP    781
        MSG(2)=LINE                                                     READBP    782
        CALL PRTMSG(2)                                                  READBP    783
        GOTO 100                                                        READBP    784
      ENDIF                                                             READBP    785
C                                                                       READBP    786
      IBUSO2=0                                                          READBP    787
      BSNAME=LINE(20:31)                                                READBP    788
      IF(BSNAME.NE.NOBUSS)THEN                                          READBP    789
        CALL CHKBUS(BSNAME,IBUSO2)                                      READBP    790
        IF(IBUSO2.LE.0)THEN                                             READBP    791
          WRITE(MSG(1),1190)                                            READBP    792
          MSG(2)=LINE                                                   READBP    793
          CALL PRTMSG(2)                                                READBP    794
          GOTO 100                                                      READBP    795
        ENDIF                                                           READBP    796
      ENDIF                                                             READBP    797
C                                                                       READBP    798
      DO 400 I=1,ICO2R                                                  READBP    799
        IF(LINE(2:2).EQ.COL2R(I))THEN                                   READBP    800
          ICODE2=I                                                      READBP    801
          GOTO 410                                                      READBP    802
        ENDIF                                                           READBP    803
 400  CONTINUE                                                          READBP    804
C                                                                       READBP    805
C     DOESN'T RECOGNIZE COLUMN 2 KEY WORD IN RELAY DATA                 READBP    806
C                                                                       READBP    807
      WRITE(MSG(1),2030)                                                READBP    808
      MSG(2)=LINE                                                       READBP    809
      CALL PRTMSG(2)                                                    READBP    810
      LINE='READBP: CHECK COLUMN 2 IN RELAY DATA CARDS'                 READBP    811
      CALL ASTOP(LINE,42)                                               READBP    812
C                                                                       READBP    813
 410  CONTINUE                                                          READBP    814
C          'A', 'D', 'G', 'L', 'M', 'O', 'U', 'R', 'Y',                 READBP    815
C          '1', '2', '3'                                                READBP    816
      GOTO(415, 420, 415, 415, 415, 415, 415, 420, 415,                 READBP    817
     1     415, 415, 415) ICODE2                                        READBP    818
C                                                                       READBP    819
 415  CONTINUE                                                          READBP    820
      WRITE(MSG(1),2040)                                                READBP    821
      MSG(2)=LINE                                                       READBP    822
      CALL PRTMSG(2)                                                    READBP    823
      LINE='READBP: RELAY DATA FORMAT NOT READY'                        READBP    824
      CALL ASTOP(LINE,35)                                               READBP    825
C                                                                       READBP    826
 420  CONTINUE                                                          READBP    827
C                                                                       READBP    828
      RELBUS=RELBUS+1                                                   READBP    829
      IF(RELBUS.GT.NB/3)THEN                                            READBP    830
        WRITE(MSG(1),1400)                                              READBP    831
        MSG(2)=LINE                                                     READBP    832
        CALL PRTMSG(2)                                                  READBP    833
        LINE='READBP: YOU HAVE TOO MANY RELAY BUSES'                    READBP    834
        CALL ASTOP(LINE,37)                                             READBP    835
      ENDIF                                                             READBP    836
      RLBUS1(RELBUS)=IBUSO1                                             READBP    837
      RLBUS2(RELBUS)=IBUSO2                                             READBP    838
      KRELTY(RELBUS)=ICODE2                                             READBP    839
      JREC=JREC+1                                                       READBP    840
      NTHREL(RELBUS)=JREC                                               READBP    841
      IREC=JREC                                                         READBP    842
C                                                                       READBP    843
 422  WRITE(IU31,REC=IREC) LINE                                         READBP    844
      GOTO 100                                                          READBP    845
C                                                                       READBP    846
C     NONLINEAR LOAD DATA                                               READBP    847
C                                                                       READBP    848
 430  CONTINUE                                                          READBP    849
C                                                                       READBP    850
      READ(LINE,3030)AP1,AQ1,AP2,AQ2,AP3,AQ3,AP4,AQ4,ALDP,ALDQ          READBP    851
C                                                                       READBP    852
      IF(LINE(2:2).EQ.'A')THEN                                          READBP    853
        ATP=AP1+AP2+AP3+AP4                                             READBP    854
        ATQ=AQ1+AQ2+AQ3+AQ4                                             READBP    855
      ELSEIF(LINE(2:2).EQ.'B')THEN                                      READBP    856
        ATP=AP1+AP2+AP3                                                 READBP    857
        ATQ=AQ1+AQ2+AQ3                                                 READBP    858
      ELSE                                                              READBP    859
        WRITE(MSG(1),1020)                                              READBP    860
        MSG(2)=LINE                                                     READBP    861
        CALL PRTMSG(2)                                                  READBP    862
        GOTO 100                                                        READBP    863
      ENDIF                                                             READBP    864
C                                                                       READBP    865
      ITP=ATP*100                                                       READBP    866
      ITQ=ATQ*100                                                       READBP    867
      IF(ITP.NE.100.OR.ITQ.NE.100)THEN                                  READBP    868
        WRITE(MSG(1),3020)                                              READBP    869
        MSG(2)=LINE                                                     READBP    870
        GOTO 100                                                        READBP    871
      ENDIF                                                             READBP    872
C                                                                       READBP    873
      ARNAME=LINE(18:27)                                                READBP    874
      IF(ARNAME(1:5).EQ.'TOTAL'.OR.ARNAME(1:6).EQ.'SYSTEM')THEN         READBP    875
        IF(ITLNLD.EQ.0)THEN                                             READBP    876
          JREC=JREC+1                                                   READBP    877
          ITLNLD=JREC                                                   READBP    878
        ENDIF                                                           READBP    879
        IREC=ITLNLD                                                     READBP    880
        GOTO 432                                                        READBP    881
      ENDIF                                                             READBP    882
C                                                                       READBP    883
      CALL CHAREA (ARNAME,IAREOK)                                       READBP    884
      IF(IAREOK.GT.0)THEN                                               READBP    885
        IF(IARNLD(IAREOK).EQ.0)THEN                                     READBP    886
          JREC=JREC+1                                                   READBP    887
          IARNLD(IAREOK)=JREC                                           READBP    888
        ENDIF                                                           READBP    889
        IREC=IARNLD(IAREOK)                                             READBP    890
        GOTO 432                                                        READBP    891
      ENDIF                                                             READBP    892
C                                                                       READBP    893
      ZNNAME=LINE(16:17)                                                READBP    894
      CALL CHZONE (ZNNAME,IZONOK)                                       READBP    895
      IF(IZONOK.GT.0)THEN                                               READBP    896
        IF(IZNNLD(IZONOK).EQ.0)THEN                                     READBP    897
          JREC=JREC+1                                                   READBP    898
          IZNNLD(IZONOK)=JREC                                           READBP    899
        ENDIF                                                           READBP    900
        IREC=IZNNLD(IZONOK)                                             READBP    901
        GOTO 432                                                        READBP    902
      ENDIF                                                             READBP    903
C                                                                       READBP    904
      BSNAME=LINE(4:15)                                                 READBP    905
      CALL CHKBUS (BSNAME,IBUSOK)                                       READBP    906
      IF(IBUSOK.GT.0)THEN                                               READBP    907
        IF(IBSNLD(IBUSOK).EQ.0)THEN                                     READBP    908
          JREC=JREC+1                                                   READBP    909
          IBSNLD(IBUSOK)=JREC                                           READBP    910
        ENDIF                                                           READBP    911
        IREC=IBSNLD(IBUSOK)                                             READBP    912
        GOTO 432                                                        READBP    913
      ENDIF                                                             READBP    914
C                                                                       READBP    915
      WRITE(MSG(1),6000)                                                READBP    916
      MSG(2)=LINE                                                       READBP    917
      CALL PRTMSG(2)                                                    READBP    918
      GOTO 100                                                          READBP    919
C                                                                       READBP    920
 432  WRITE(IU31,REC=IREC) LINE                                         READBP    921
      GOTO 100                                                          READBP    922
C                                                                       READBP    923
C     INDUCTION MOTOR DATA CARD                                         READBP    924
C                                                                       READBP    925
 435  CONTINUE                                                          READBP    926
      BSNAME=LINE(4:15)                                                 READBP    927
      CALL CHKBUS(BSNAME,IBUSOK)                                        READBP    928
      IF(IBUSOK.LE.0)THEN                                               READBP    929
C                                                                       READBP    930
C     BUS NOT EXIST WRITE OUT WARNING MESSAGE AND SKIP THIS CARD        READBP    931
C                                                                       READBP    932
        WRITE(MSG(1),1190)                                              READBP    933
        MSG(2)=LINE                                                     READBP    934
        CALL PRTMSG(2)                                                  READBP    935
        GOTO 100                                                        READBP    936
      ENDIF                                                             READBP    937
C                                                                       READBP    938
      DO 436 I=1,NMOTBS                                                 READBP    939
        IF(MOTBUS(I).EQ.IBUSOK)THEN                                     READBP    940
          IRECX=NTHMOT(I)                                               READBP    941
          READ(IU31,REC=IRECX)CARD1                                     READBP    942
          IF(CARD1(16:16).EQ.LINE(16:16))THEN                           READBP    943
            IREC=IRECX                                                  READBP    944
            GOTO 437                                                    READBP    945
          ENDIF                                                         READBP    946
        ENDIF                                                           READBP    947
 436  CONTINUE                                                          READBP    948
C                                                                       READBP    949
      NMOTBS=NMOTBS+1                                                   READBP    950
      IF(NMOTBS.GT.NXMT)THEN                                            READBP    951
        WRITE(MSG(1),2090)                                              READBP    952
        MSG(2)=LINE                                                     READBP    953
        CALL PRTMSG(2)                                                  READBP    954
        LINE='READBP: YOU HAVE TOO MANY INDUCTION MOTORS'               READBP    955
        CALL ASTOP(LINE,42)                                             READBP    956
      ENDIF                                                             READBP    957
      JREC=JREC+1                                                       READBP    958
      NTHMOT(NMOTBS)=JREC                                               READBP    959
      MOTBUS(NMOTBS)=IBUSOK                                             READBP    960
      IREC=JREC                                                         READBP    961
C                                                                       READBP    962
 437  WRITE(IU31,REC=IREC)LINE                                          READBP    963
      GOTO 100                                                          READBP    964
C                                                                       READBP    965
C     SVC FIRST CARD ('VN', 'VW') OR SECOND CARD ('VZ')                 READBP    966
C                                                                       READBP    967
 440  CONTINUE                                                          READBP    968
C                                                                       READBP    969
      IF(LINE(2:2).EQ.'Z') GOTO 443                                     READBP    970
C                                                                       READBP    971
      BSNAME=LINE(69:80)                                                READBP    972
      IF(BSNAME.NE.NOBUSS)THEN                                          READBP    973
        CALL CHKBUS(BSNAME,IBUSOR)                                      READBP    974
        IF(IBUSOR.LE.0)THEN                                             READBP    975
C                                                                       READBP    976
C       REMOTE BUS NOT EXIST WRITE OUT WARNING AND SKIP THE CARD        READBP    977
C                                                                       READBP    978
          WRITE(MSG(1),1190)                                            READBP    979
          MSG(2)=LINE                                                   READBP    980
          CALL PRTMSG(2)                                                READBP    981
          GOTO 100                                                      READBP    982
        ENDIF                                                           READBP    983
      ELSE                                                              READBP    984
        IBUSOR=0                                                        READBP    985
      ENDIF                                                             READBP    986
C                                                                       READBP    987
      BSNAME=LINE(4:15)                                                 READBP    988
      CALL CHKBUS(BSNAME,IBUSOK)                                        READBP    989
      IF(IBUSOK.LE.0)THEN                                               READBP    990
C                                                                       READBP    991
C     BUS NOT EXIST WRITE OUT WARNING MESSAGE AND SKIP THIS CARD        READBP    992
C                                                                       READBP    993
        WRITE(MSG(1),1190)                                              READBP    994
        MSG(2)=LINE                                                     READBP    995
        CALL PRTMSG(2)                                                  READBP    996
        GOTO 100                                                        READBP    997
      ENDIF                                                             READBP    998
C                                                                       READBP    999
      DO 441 I=1,NSVCBS                                                 READBP   1000
        IRECX=LSVC(I)                                                   READBP   1001
        READ(IU31,REC=IRECX)CARD1                                       READBP   1002
        IF(CARD1(4:16).EQ.LINE(4:16))THEN                               READBP   1003
          IREC=IRECX                                                    READBP   1004
          ISVC=I                                                        READBP   1005
          GOTO 442                                                      READBP   1006
        ENDIF                                                           READBP   1007
441   CONTINUE                                                          READBP   1008
C                                                                       READBP   1009
      NSVCBS=NSVCBS+1                                                   READBP   1010
      IF(NSVCBS.GT.NSR)THEN                                             READBP   1011
        WRITE(MSG(1),3080)                                              READBP   1012
        MSG(2)=LINE                                                     READBP   1013
        CALL PRTMSG(2)                                                  READBP   1014
        LINE='READBP: YOU HAVE TOO MANY SVCS'                           READBP   1015
        CALL ASTOP(LINE,30)                                             READBP   1016
      END IF                                                            READBP   1017
      LFSVCO(NSVCBS)=IBUSOK                                             READBP   1018
      JREC=JREC+1                                                       READBP   1019
      LSVC(NSVCBS)=JREC                                                 READBP   1020
      LSVCZ(NSVCBS)=0                                                   READBP   1021
      LSVCA(NSVCBS)=0                                                   READBP   1022
      LSVCB(NSVCBS)=0                                                   READBP   1023
      LSVCC(NSVCBS)=0                                                   READBP   1024
      LSVCD(NSVCBS)=0                                                   READBP   1025
      LSVCE(NSVCBS)=0                                                   READBP   1026
      LSVCF(NSVCBS)=0                                                   READBP   1027
      LSVCBN(IBUSOK)=NSVCBS                                             READBP   1028
      IREC=JREC                                                         READBP   1029
      ISVC=NSVCBS                                                       READBP   1030
C                                                                       READBP   1031
 442  LFSVCR(ISVC)=IBUSOR                                               READBP   1032
      WRITE(IU31,REC=IREC) LINE                                         READBP   1033
      GOTO 100                                                          READBP   1034
C                                                                       READBP   1035
C     SVC SECOND CARD ('VZ')                                            READBP   1036
C                                                                       READBP   1037
 443  CONTINUE                                                          READBP   1038
C                                                                       READBP   1039
      BSNAME=LINE(4:15)                                                 READBP   1040
      CALL CHKBUS (BSNAME,IBUSOK)                                       READBP   1041
      IF(IBUSOK.LE.0)THEN                                               READBP   1042
        WRITE(MSG(1),1190)                                              READBP   1043
        MSG(2)=LINE                                                     READBP   1044
        CALL PRTMSG(2)                                                  READBP   1045
        GOTO 100                                                        READBP   1046
      ENDIF                                                             READBP   1047
C                                                                       READBP   1048
      ISVC=LSVCBN(IBUSOK)                                               READBP   1049
      IF(ISVC.LE.0)THEN                                                 READBP   1050
        WRITE(MSG(1),4000)                                              READBP   1051
        MSG(2)=LINE                                                     READBP   1052
        CALL PRTMSG(2)                                                  READBP   1053
        LINE='READBP: FIRST CARD OF SVC DATA NOT SPECIFIED'             READBP   1054
        CALL ASTOP(LINE,44)                                             READBP   1055
      ENDIF                                                             READBP   1056
C                                                                       READBP   1057
      IREC=LSVCZ(ISVC)                                                  READBP   1058
      IF(IREC.EQ.0)THEN                                                 READBP   1059
        JREC=JREC+1                                                     READBP   1060
        IREC=JREC                                                       READBP   1061
        LSVCZ(ISVC)=IREC                                                READBP   1062
      ENDIF                                                             READBP   1063
      WRITE(IU31,REC=IREC)LINE                                          READBP   1064
C                                                                       READBP   1065
      GOTO 100                                                          READBP   1066
C                                                                       READBP   1067
C     SVC THIRD OR FOURTH CARD ('W')                                    READBP   1068
C                                                                       READBP   1069
 447  CONTINUE                                                          READBP   1070
C                                                                       READBP   1071
      BSNAME=LINE(4:15)                                                 READBP   1072
      CALL CHKBUS(BSNAME,IBUSOK)                                        READBP   1073
      IF(IBUSOK.LE.0)THEN                                               READBP   1074
C                                                                       READBP   1075
C     BUS NOT EXIST WRITE OUT WARNING MESSAGE AND SKIP THIS CARD        READBP   1076
C                                                                       READBP   1077
        WRITE(MSG(1),1190)                                              READBP   1078
        MSG(2)=LINE                                                     READBP   1079
        CALL PRTMSG(2)                                                  READBP   1080
        GOTO 100                                                        READBP   1081
      ENDIF                                                             READBP   1082
C                                                                       READBP   1083
      ISVC=LSVCBN(IBUSOK)                                               READBP   1084
      IF(ISVC.LE.0)THEN                                                 READBP   1085
        WRITE(MSG(1),4000)                                              READBP   1086
        MSG(2)=LINE                                                     READBP   1087
        CALL PRTMSG(2)                                                  READBP   1088
        LINE='READBP: FIRST CARD OF SVC DATA NOT SPECIFIED'             READBP   1089
        CALL ASTOP(LINE,44)                                             READBP   1090
      ENDIF                                                             READBP   1091
C                                                                       READBP   1092
      DO 448 I=1,ICO2S                                                  READBP   1093
        IF(LINE(2:2).EQ.COL2S(I))THEN                                   READBP   1094
          ICODE2=I                                                      READBP   1095
          GOTO 449                                                      READBP   1096
        ENDIF                                                           READBP   1097
 448  CONTINUE                                                          READBP   1098
C                                                                       READBP   1099
      WRITE(MSG(1),3090)                                                READBP   1100
      MSG(2)=LINE                                                       READBP   1101
      CALL PRTMSG(2)                                                    READBP   1102
      LINE='READBP: SVC SUPPLEMENTARY CONTROL TYPE NOT RECOGNIZED'      READBP   1103
      CALL ASTOP(LINE,53)                                               READBP   1104
C                                                                       READBP   1105
C           'A'  'B'  'C'  'D'  'E'  'F'                                READBP   1106
 449     GOTO (451, 452, 453, 454, 455, 456) ICODE2                     READBP   1107
C                                                                       READBP   1108
 451  CONTINUE                                                          READBP   1109
C                                                                       READBP   1110
      BSNAME=LINE(54:65)                                                READBP   1111
      CALL CHKBUS(BSNAME,IBUSOR)                                        READBP   1112
      IF(IBUSOR.LE.0)THEN                                               READBP   1113
C                                                                       READBP   1114
C       REMOTE BUS NOT EXIST WRITE OUT WARNING AND SKIP THE CARD        READBP   1115
C                                                                       READBP   1116
        WRITE(MSG(1),1190)                                              READBP   1117
        MSG(2)=LINE                                                     READBP   1118
        CALL PRTMSG(2)                                                  READBP   1119
        GOTO 100                                                        READBP   1120
      ENDIF                                                             READBP   1121
C                                                                       READBP   1122
      IREC=LSVCA(ISVC)+LSVCB(ISVC)+LSVCC(ISVC)                          READBP   1123
      IF(IREC.EQ.0)THEN                                                 READBP   1124
        JREC=JREC+1                                                     READBP   1125
        IREC=JREC                                                       READBP   1126
      ELSE                                                              READBP   1127
        LSVCB(ISVC)=0                                                   READBP   1128
        LSVCC(ISVC)=0                                                   READBP   1129
      ENDIF                                                             READBP   1130
      LSVCA(ISVC)=IREC                                                  READBP   1131
      LFSAR(ISVC)=IBUSOK                                                READBP   1132
      WRITE(IU31,REC=IREC) LINE                                         READBP   1133
      GOTO 100                                                          READBP   1134
C                                                                       READBP   1135
 452  CONTINUE                                                          READBP   1136
C                                                                       READBP   1137
      BSNAME=LINE(54:65)                                                READBP   1138
      CALL CHKBUS(BSNAME,IBUSOF)                                        READBP   1139
      IF(IBUSOF.LE.0)THEN                                               READBP   1140
C                                                                       READBP   1141
C       REMOTE BUS NOT EXIST WRITE OUT WARNING AND SKIP THE CARD        READBP   1142
C                                                                       READBP   1143
        WRITE(MSG(1),1190)                                              READBP   1144
        MSG(2)=LINE                                                     READBP   1145
        CALL PRTMSG(2)                                                  READBP   1146
        GOTO 100                                                        READBP   1147
      ENDIF                                                             READBP   1148
C                                                                       READBP   1149
      BSNAME=LINE(67:78)                                                READBP   1150
      CALL CHKBUS(BSNAME,IBUSOT)                                        READBP   1151
      IF(IBUSOT.LE.0)THEN                                               READBP   1152
C                                                                       READBP   1153
C       REMOTE BUS NOT EXIST WRITE OUT WARNING AND SKIP THE CARD        READBP   1154
C                                                                       READBP   1155
        WRITE(MSG(1),1190)                                              READBP   1156
        MSG(2)=LINE                                                     READBP   1157
        CALL PRTMSG(2)                                                  READBP   1158
        GOTO 100                                                        READBP   1159
      ENDIF                                                             READBP   1160
C                                                                       READBP   1161
      IREC=LSVCA(ISVC)+LSVCB(ISVC)+LSVCC(ISVC)                          READBP   1162
      IF(IREC.EQ.0)THEN                                                 READBP   1163
        JREC=JREC+1                                                     READBP   1164
        IREC=JREC                                                       READBP   1165
      ELSE                                                              READBP   1166
        LSVCA(ISVC)=0                                                   READBP   1167
        LSVCC(ISVC)=0                                                   READBP   1168
      ENDIF                                                             READBP   1169
      LSVCB(ISVC)=IREC                                                  READBP   1170
      LFSBRF(ISVC)=IBUSOF                                               READBP   1171
      LFSBRT(ISVC)=IBUSOT                                               READBP   1172
      WRITE(IU31,REC=IREC) LINE                                         READBP   1173
      GOTO 100                                                          READBP   1174
C                                                                       READBP   1175
 453  CONTINUE                                                          READBP   1176
C                                                                       READBP   1177
      BSNAME=LINE(54:65)                                                READBP   1178
      IF(BSNAME.NE.NOBUSS)THEN                                          READBP   1179
        CALL CHKBUS(BSNAME,IBUSOR)                                      READBP   1180
        IF(IBUSOR.LE.0)THEN                                             READBP   1181
C                                                                       READBP   1182
C       REMOTE BUS NOT EXIST WRITE OUT WARNING AND SKIP THE CARD        READBP   1183
C                                                                       READBP   1184
          WRITE(MSG(1),1190)                                            READBP   1185
          MSG(2)=LINE                                                   READBP   1186
          CALL PRTMSG(2)                                                READBP   1187
          GOTO 100                                                      READBP   1188
        ENDIF                                                           READBP   1189
      ELSE                                                              READBP   1190
        IBUSOR=0                                                        READBP   1191
      ENDIF                                                             READBP   1192
C                                                                       READBP   1193
      IREC=LSVCA(ISVC)+LSVCB(ISVC)+LSVCC(ISVC)                          READBP   1194
      IF(IREC.EQ.0)THEN                                                 READBP   1195
        JREC=JREC+1                                                     READBP   1196
        IREC=JREC                                                       READBP   1197
      ELSE                                                              READBP   1198
        LSVCA(ISVC)=0                                                   READBP   1199
        LSVCB(ISVC)=0                                                   READBP   1200
      ENDIF                                                             READBP   1201
      LSVCC(ISVC)=IREC                                                  READBP   1202
      LFSCR(ISVC)=IBUSOR                                                READBP   1203
      WRITE(IU31,REC=IREC) LINE                                         READBP   1204
      GOTO 100                                                          READBP   1205
C                                                                       READBP   1206
 454  CONTINUE                                                          READBP   1207
C                                                                       READBP   1208
      IREC=LSVCD(ISVC)+LSVCE(ISVC)+LSVCF(ISVC)                          READBP   1209
      IF(IREC.EQ.0)THEN                                                 READBP   1210
        JREC=JREC+1                                                     READBP   1211
        IREC=JREC                                                       READBP   1212
      ELSE                                                              READBP   1213
        LSVCE(ISVC)=0                                                   READBP   1214
        LSVCF(ISVC)=0                                                   READBP   1215
      ENDIF                                                             READBP   1216
      LSVCD(ISVC)=IREC                                                  READBP   1217
      WRITE(IU31,REC=IREC) LINE                                         READBP   1218
      GOTO 100                                                          READBP   1219
C                                                                       READBP   1220
 455  CONTINUE                                                          READBP   1221
C                                                                       READBP   1222
      IREC=LSVCD(ISVC)+LSVCE(ISVC)+LSVCF(ISVC)                          READBP   1223
      IF(IREC.EQ.0)THEN                                                 READBP   1224
        JREC=JREC+1                                                     READBP   1225
        IREC=JREC                                                       READBP   1226
      ELSE                                                              READBP   1227
        LSVCD(ISVC)=0                                                   READBP   1228
        LSVCF(ISVC)=0                                                   READBP   1229
      ENDIF                                                             READBP   1230
      LSVCE(ISVC)=IREC                                                  READBP   1231
      WRITE(IU31,REC=IREC) LINE                                         READBP   1232
      GOTO 100                                                          READBP   1233
C                                                                       READBP   1234
 456  CONTINUE                                                          READBP   1235
C                                                                       READBP   1236
      IREC=LSVCD(ISVC)+LSVCE(ISVC)+LSVCF(ISVC)                          READBP   1237
      IF(IREC.EQ.0)THEN                                                 READBP   1238
        JREC=JREC+1                                                     READBP   1239
        IREC=JREC                                                       READBP   1240
      ELSE                                                              READBP   1241
        LSVCD(ISVC)=0                                                   READBP   1242
        LSVCE(ISVC)=0                                                   READBP   1243
      ENDIF                                                             READBP   1244
      LSVCF(ISVC)=IREC                                                  READBP   1245
      WRITE(IU31,REC=IREC) LINE                                         READBP   1246
      GOTO 100                                                          READBP   1247
C=======================================================================READBP   1248
C                                                                       READBP   1249
C                        =============                                  READBP   1250
C                         : SECTION 2 :                                 READBP   1251
C                        =============                                  READBP   1252
C                                                                       READBP   1253
C=======================================================================READBP   1254
C     ARRANGE THE DATA CARD IN THE FOLLOWING ORDER FOR EACH OF THE MACHIREADBP   1255
C                                                                       READBP   1256
C               DETAIL MACHINE MODEL    (MF)                            READBP   1257
C               SUB TRANSIENT DATA      (M)                             READBP   1258
C               EXCITER DATA            (E*)                            READBP   1259
C               STABILIZER DATA         (S*)                            READBP   1260
C               GOVERNOR DATA           (G*)                            READBP   1261
C                   .....                                               READBP   1262
C                (NEXT MACHINE)                                         READBP   1263
C                   ....                                                READBP   1264
C                (LAST DETAIL MACHINE)                                  READBP   1265
C               CLASSICAL MACHINE DATA  (MC)                            READBP   1266
C                (NEXT CLASSICAL M/C)                                   READBP   1267
C                (LAST CLASSICAL M/C)                                   READBP   1268
C                                                                       READBP   1269
C----------------------------                                           READBP   1270
C     FOR EACH DETAIL MACHINE..                                         READBP   1271
C----------------------------                                           READBP   1272
C                                                                       READBP   1273
C                                                                       READBP   1274
  450 CONTINUE                                                          READBP   1275
C                                                                       READBP   1276
      IF(IBPAFL.GT.0)THEN                                               READBP   1277
        LINE='EDATA'                                                    READBP   1278
        WRITE(IUY,7000)LINE                                             READBP   1279
        LINE='  END'                                                    READBP   1280
        WRITE(IUY,7000)LINE                                             READBP   1281
      ENDIF                                                             READBP   1282
C                                                                       READBP   1283
      IF(LDEB)THEN                                                      READBP   1284
       DO 460 I=1,LGBUS                                                 READBP   1285
       WRITE(IUD6,1350)I,MX2(I),MC(I),MF(I),EXCEP(I),IEEEX(I),          READBP   1286
     & STAB(I),GOV(I),TB(I),NTHGEL(I),NEXTG(I),NGSTAT(I)                READBP   1287
  460  CONTINUE                                                         READBP   1288
      ENDIF                                                             READBP   1289
C                                                                       READBP   1290
      LPGID='   L'                                                      READBP   1291
      IVTN=0                                                            READBP   1292
      JFLTN=0                                                           READBP   1293
      UH=99.0                                                           READBP   1294
      BASVR=1.0                                                         READBP   1295
      IRMBU1=0                                                          READBP   1296
      IOHTY1=0                                                          READBP   1297
      IM=0                                                              READBP   1298
      IN=0                                                              READBP   1299
      CMTL=0.0                                                          READBP   1300
C                                                                       READBP   1301
      DO 530 K=1,LGBUS                                                  READBP   1302
C                                                                       READBP   1303
C    FELTCH THE GENERATORS CONNECTED TO K BUS                           READBP   1304
C                                                                       READBP   1305
        JGEN=0                                                          READBP   1306
C                                                                       READBP   1307
        KTHGEN=NTHGEL(K)                                                READBP   1308
        IF(KTHGEN.EQ.0)GOTO 530                                         READBP   1309
470     JGEN=JGEN+1                                                     READBP   1310
        ITHGEN(JGEN)=KTHGEN                                             READBP   1311
        JFNAME(JGEN)=MFNAME(KTHGEN)                                     READBP   1312
        KTHGEN=NEXTG(KTHGEN)                                            READBP   1313
        IF(KTHGEN.NE.0)GOTO 470                                         READBP   1314
C                                                                       READBP   1315
C   SORT THE GENERATORS IN ALPHATICAL ORDER                             READBP   1316
C                                                                       READBP   1317
      IF(JGEN.GT.1)CALL BSORT1(JFNAME,JGEN,ITHGEN)                      READBP   1318
C                                                                       READBP   1319
      IHPLP=.FALSE.                                                     READBP   1320
      DO 520 LI=1,JGEN                                                  READBP   1321
      I=ITHGEN(LI)                                                      READBP   1322
      IF(LDEB) WRITE(IUD6,1240) JFNAME(I)                               READBP   1323
C                                                                       READBP   1324
      JREAD=MC(I)                                                       READBP   1325
      IF(JREAD.EQ.0)JREAD=MF(I)                                         READBP   1326
C                                                                       READBP   1327
      READ(IU31,REC=JREAD) MFB                                          READBP   1328
      READ(MFB,1250) MANE,EMWS,PFA,QFA,BASPR,RA,XPD,XPQ,XD,XQ,          READBP   1329
     1TPDO,TPQO,XL,GSAT1,GSAT2,DAMP                                     READBP   1330
      IF(LDEB) WRITE(IUD6,1100) MFB(1:2),MFB(4:15),EMWS,PFA,QFA,        READBP   1331
     1BASPR,RA,XPD,XPQ,XD,XQ,TPDO,TPQO,XL,GSAT1,GSAT2,DAMP              READBP   1332
      IF(MFB(23:28).EQ.'      ')THEN                                    READBP   1333
         PFA=1.0                                                        READBP   1334
         QFA=1.0                                                        READBP   1335
      ENDIF                                                             READBP   1336
      IPFA=NINT(PFA*100)                                                READBP   1337
      IQFA=NINT(QFA*100)                                                READBP   1338
      IF(BASPR.EQ.0.0)BASPR=100.0                                       READBP   1339
      GMRATE=0.0                                                        READBP   1340
C                                                                       READBP   1341
C     SET SUB TRANSIENT DATA TO DEFAULT VALUES FIRST                    READBP   1342
C                                                                       READBP   1343
      XPPD=0.0                                                          READBP   1344
      XPPQ=0.0                                                          READBP   1345
      TPPDO=0.0                                                         READBP   1346
      TPPQO=0.0                                                         READBP   1347
C                                                                       READBP   1348
C   READ MX2 CARD                                                       READBP   1349
C                                                                       READBP   1350
      JREAD=MX2(I)                                                      READBP   1351
      JSAT=1                                                            READBP   1352
      IF(JREAD.NE.0)THEN                                                READBP   1353
        READ(IU31,REC=JREAD)MFB                                         READBP   1354
        READ(MFB,1260) GMRATE,GRPF,IGNUM,GTYPE,XPPD,XPPQ                READBP   1355
     &  ,TPPDO,TPPQO                                                    READBP   1356
        IF(LDEB)WRITE(IUD6,1120) MFB(1:2),MFB(4:15),GMRATE              READBP   1357
     1  ,GRPF,IGNUM,GTYPE,XPPD,XPPQ,TPPDO,TPPQO                         READBP   1358
        IF(MFB(31:32).EQ.'H ')JSAT=0                                    READBP   1359
      ENDIF                                                             READBP   1360
C                                                                       READBP   1361
      IF(GMRATE.NE.0.0)THEN                                             READBP   1362
        FACT=GMRATE/BASPR                                               READBP   1363
        BASPR=GMRATE                                                    READBP   1364
        XPPD=XPPD*FACT                                                  READBP   1365
        XPPQ=XPPQ*FACT                                                  READBP   1366
        RA=RA*FACT                                                      READBP   1367
        XPD=XPD*FACT                                                    READBP   1368
        XPQ=XPQ*FACT                                                    READBP   1369
        XD=XD*FACT                                                      READBP   1370
        XQ=XQ*FACT                                                      READBP   1371
        XL=XL*FACT                                                      READBP   1372
      ENDIF                                                             READBP   1373
C                                                                       READBP   1374
      HM=EMWS/BASPR                                                     READBP   1375
C                                                                       READBP   1376
      IF(MC(I).NE.0)THEN                                                READBP   1377
        IGEN=3                                                          READBP   1378
        JEXC=0                                                          READBP   1379
        JSTAB=0                                                         READBP   1380
        GOTO 480                                                        READBP   1381
      ELSE                                                              READBP   1382
        IGEN=0                                                          READBP   1383
      ENDIF                                                             READBP   1384
C                                                                       READBP   1385
C     ----------------------------------------------------              READBP   1386
C     . GET THE EXCITER FOR THIS MACHINE                  .             READBP   1387
C     .   WARN IF THERE ARE MORE THAN 1 EXCITER           .             READBP   1388
C     .     MEXC=COUNTER TO KEEP TRACK OF # OF EXC CARDS  .             READBP   1389
C     .   CONVERT EPRI EXCITER TYPE TO MASSS EXCITER TYPE .             READBP   1390
C     .   IF NO EXCITER OR CONVERSION FAILED, SET JEXC=0  .             READBP   1391
C     ----------------------------------------------------              READBP   1392
      JREAD=EXCEP(I)                                                    READBP   1393
      JEXC=0                                                            READBP   1394
      IF(JREAD.NE.0)THEN                                                READBP   1395
        READ(IU31,REC=JREAD) MFB                                        READBP   1396
        CALL EPEXCV (EXC,JEXC,MFB,IEEEX6)                               READBP   1397
      ENDIF                                                             READBP   1398
C                                                                       READBP   1399
      JREAD=EXCIE(I)                                                    READBP   1400
      IF(JREAD.NE.0)THEN                                                READBP   1401
      READ(IU31,REC=JREAD) IEEEX1                                       READBP   1402
      READ(IU31,REC=JREAD+1) IEEEX2                                     READBP   1403
C                                                                       READBP   1404
C     SET KEYWORD IN CARD 3 TO INDICATE ITS A BPA-IEEE CARD FORMAT      READBP   1405
C                                                                       READBP   1406
      WRITE(IEEEX3(1:8),'(A8)')'BPA-IEEE'                               READBP   1407
            CALL EPIECV (EXC,JEXC,IEEEX1,IEEEX2,IEEEX3,IEEEX4,IEEEX5,   READBP   1408
     +                   IEEEX6)                                        READBP   1409
      ENDIF                                                             READBP   1410
C                                                                       READBP   1411
C     ............................................................. ..  READBP   1412
C     :CHECK FOR IEEE TYPE EXCITERS PRVIDED THERE ARE NO WSCC EXCITERS: READBP   1413
C     :ALREADY PROCESSED FOR THIS MACHINE (ABOVE)                     : READBP   1414
C     :...............................................................: READBP   1415
C                                                                       READBP   1416
         JREAD=IEEEX(I)                                                 READBP   1417
         IF(JREAD.NE.0)THEN                                             READBP   1418
         READ(IU31,REC=JREAD) IEEEX1                                    READBP   1419
         READ(IU31,REC=JREAD+1) IEEEX2                                  READBP   1420
         READ(IU31,REC=JREAD+2) IEEEX3                                  READBP   1421
         READ(IU31,REC=JREAD+3) IEEEX4                                  READBP   1422
         READ(IU31,REC=JREAD+4) IEEEX5                                  READBP   1423
            CALL EPIECV (EXC,JEXC,IEEEX1,IEEEX2,IEEEX3,IEEEX4,IEEEX5,   READBP   1424
     +                   IEEEX6)                                        READBP   1425
         ENDIF                                                          READBP   1426
C                                                                       READBP   1427
C     ----------------------------------------------------              READBP   1428
C     . GET THE STABILIZER FOR THIS MACHINE              .              READBP   1429
C     .   MSTAB=COUNTER TO KEEP TRACK OF # OF STAB CARDS .              READBP   1430
C     .   WARN IF THERE ARE MORE THAN 1 STABILIZER CARD  .              READBP   1431
C     .   CONVERT EPRI STABILIZER TYPE TO MASSS TYPE     .              READBP   1432
C     .   JSTAB=0 IF NO STABILIZER REPRESENTED           .              READBP   1433
C     ----------------------------------------------------              READBP   1434
C                                                                       READBP   1435
      JREAD=STAB(I)                                                     READBP   1436
      JSTAB=0                                                           READBP   1437
      JTEB=0                                                            READBP   1438
      IF(JREAD.NE.0)THEN                                                READBP   1439
        READ(IU31,REC=JREAD) MFB                                        READBP   1440
        CALL EPSTCV (IRMBUS,IOHTYP,EXS,JSTAB,EXB,JTEB,MFB,MFB1,         READBP   1441
     +               MFB2,MFB3)                                         READBP   1442
      ENDIF                                                             READBP   1443
C                                                                       READBP   1444
C     -------------------------------------------------------------     READBP   1445
C     . GET THE GOVERNOR AND TURBINE FOR THIS MACHINE             .     READBP   1446
C     .   MGOV=COUNTER TO KEEP TRACK OF # OF GOVERNOR CARDS       .     READBP   1447
C     .   MTB=COUNTER TO KEEP TRACK OF # OF TURBINE  CARDS       .      READBP   1448
C     .   WARN IF THERE ARE MORE THAN 1 GOVERNOR OR TURBINE CARDS .     READBP   1449
C     .   CONVERT EPRI GOVERNOR TYPE TO MASSS TYPE                .     READBP   1450
C     .   IF MASSS GOVERNOR IS TYPE 4 THEN                        .     READBP   1451
C     .      CONVERT EPRI TURBINE TO MASSS TYPE                   .     READBP   1452
C     .   ENDIF                                                   .     READBP   1453
C     .   IF TURBINE CONVERSION FAILED THEN                    .        READBP   1454
C     .      SET JGOV=0 AND WRITE WARNING MSG                  .        READBP   1455
C     .   ENDIF                                                         READBP   1456
C     -------------------------------------------------------------     READBP   1457
C                                                                       READBP   1458
 480  IF(IHPLP)THEN                                                     READBP   1459
         JGOV=5                                                         READBP   1460
      ELSE                                                              READBP   1461
         ITBD=0                                                         READBP   1462
         JGOV=0                                                         READBP   1463
         JREAD=GOV(I)                                                   READBP   1464
         IF(JREAD.NE.0)THEN                                             READBP   1465
         READ(IU31,REC=JREAD) MFB                                       READBP   1466
         CALL EPGOCV (JGOV,ITBD,EXG,BASPR,MFB)                          READBP   1467
         ENDIF                                                          READBP   1468
         IF(ITBD.NE.0)THEN                                              READBP   1469
           JREAD=TB(I)                                                  READBP   1470
           IF(JREAD.NE.0)THEN                                           READBP   1471
             READ(IU31,REC=JREAD) MFB                                   READBP   1472
             CALL EPTBCV (EXG,ITB,MFB)                                  READBP   1473
             IF(ITB.EQ.5)THEN                                           READBP   1474
               IHPLP=.TRUE.                                             READBP   1475
               IF(MC(I).NE.0)THEN                                       READBP   1476
                 IGEN=7                                                 READBP   1477
               ELSE                                                     READBP   1478
                 IGEN=4                                                 READBP   1479
               ENDIF                                                    READBP   1480
               IEXG(1)=K                                                READBP   1481
               IEXG(2)=ILPGID                                           READBP   1482
             ELSEIF(ITB.LE.0)THEN                                       READBP   1483
               JGOV=0                                                   READBP   1484
               WRITE(MSG(1),1180) MFB(4:16)                             READBP   1485
               WRITE(MSG(2),1181)                                       READBP   1486
               CALL PRTMSG(2)                                           READBP   1487
             ENDIF                                                      READBP   1488
           ELSE                                                         READBP   1489
             WRITE(MSG(1),6200)                                         READBP   1490
             WRITE(MSG(2),6300) MFB(4:16)                               READBP   1491
           ENDIF                                                        READBP   1492
         ENDIF                                                          READBP   1493
      ENDIF                                                             READBP   1494
C                                                                       READBP   1495
C     ENTER GENERATOR DATA INTO COMMON AND THEN CALL STGEND             READBP   1496
C                                                                       READBP   1497
      NLF=K                                                             READBP   1498
      BUSNAM=MFNAME(I)(1:12)                                            READBP   1499
      NGRI=' '                                                          READBP   1500
      KCCT=MFNAME(I)(13:13)                                             READBP   1501
      ISAT=0                                                            READBP   1502
C                                                                       READBP   1503
C     ................................................................. READBP   1504
C     : MACHINE SATURATION.. IF(SG1.0) OR (SG1.2) IS SPECIFIED, ALL  :  READBP   1505
C     : MACHINE REACTANCES ARE GIVEN AS UNSATURATED VALUES. CODINGS   : READBP   1506
C     : BELOW CONVERTS SATURATION VALUES TO MASSS FORMAT              : READBP   1507
C     :...............................................................: READBP   1508
C                                                                       READBP   1509
      IF((GSAT1.NE.0) .AND. (GSAT2.NE.0))THEN                           READBP   1510
         ISAT=JSAT+1                                                    READBP   1511
         AA=GSAT1-1.2*GSAT2                                             READBP   1512
         AB=2.4*(GSAT2-GSAT1)                                           READBP   1513
         AC=1.44*GSAT1 - 1.2*GSAT2                                      READBP   1514
C                                                                       READBP   1515
         AP=(-AB+SQRT(AB**2-4*AA*AC))/(2*AA)                            READBP   1516
         AM=(-AB-SQRT(AB**2-4*AA*AC))/(2*AA)                            READBP   1517
         UL=0.0                                                         READBP   1518
C                                                                       READBP   1519
         IF((AP .LT. 1.) .AND. (AP. GT. 0.))THEN                        READBP   1520
            UL=AP                                                       READBP   1521
         ENDIF                                                          READBP   1522
         IF((AM .LT. 1.) .AND. (AM .GT. 0))THEN                         READBP   1523
            IF(AM .GT. AP) UL=AM                                        READBP   1524
         ENDIF                                                          READBP   1525
         PI10=GSAT1                                                     READBP   1526
         PI12=1.2*(GSAT2)                                               READBP   1527
         PI1012=PI12/PI10                                               READBP   1528
         BSAT=LOG(PI1012)/0.2                                           READBP   1529
         ASAT=PI10/(EXP(BSAT*(1.0-UL)))                                 READBP   1530
C                                                                       READBP   1531
C     ..................................................................READBP   1532
C     : IF THERE IS A CONVERSION PROBLEM, GIVE WARNING AND SET ISAT= 0  READBP   1533
C     :.................................................................READBP   1534
C                                                                       READBP   1535
         IF(UL .EQ. 0.0)THEN                                            READBP   1536
           WRITE(MSG(1),1200)                                           READBP   1537
           WRITE(MSG(2),1201) MFNAME(I)                                 READBP   1538
           CALL PRTMSG(2)                                               READBP   1539
           ISAT=0                                                       READBP   1540
         ENDIF                                                          READBP   1541
      ENDIF                                                             READBP   1542
C                                                                       READBP   1543
      IF(JGOV.EQ.5)IHPLP=.FALSE.                                        READBP   1544
C                                                                       READBP   1545
C     FILL THE DDAT ARRAYS                                              READBP   1546
C                                                                       READBP   1547
      CALL STGEND                                                       READBP   1548
C                                                                       READBP   1549
C-----------------------------------------------------------------------READBP   1550
C     FINISH PROCESSING THIS DETAILED MACHINE ..                        READBP   1551
C     GO BACK TO PROCESS THE NEXT ONE .                                 READBP   1552
C-----------------------------------------------------------------------READBP   1553
C                                                                       READBP   1554
  520 CONTINUE                                                          READBP   1555
C                                                                       READBP   1556
  530 CONTINUE                                                          READBP   1557
C=======================================================================READBP   1558
C                                                                       READBP   1559
C     SORT OUT RR TYPE RELAYS                                           READBP   1560
C                                                                       READBP   1561
      DO 594 I=1,RELBUS                                                 READBP   1562
        ICODE2=KRELTY(I)                                                READBP   1563
        IF(ICODE2.NE.8)GOTO 594                                         READBP   1564
C                                                                       READBP   1565
        JREC=NTHREL(I)                                                  READBP   1566
        READ(IU31,REC=JREC)LINE                                         READBP   1567
        BSNAME=LINE(7:18)                                               READBP   1568
        CALL CHKBUS(BSNAME,IBUSOK)                                      READBP   1569
C                                                                       READBP   1570
        IF(LINE(19:19).EQ.'F')THEN                                      READBP   1571
          JTYPE=1                                                       READBP   1572
        ELSEIF(LINE(19:19).EQ.'V')THEN                                  READBP   1573
          JTYPE=2                                                       READBP   1574
        ELSE                                                            READBP   1575
          GOTO 594                                                      READBP   1576
        ENDIF                                                           READBP   1577
C                                                                       READBP   1578
        IPTR=IFSLSD(IBUSOK)                                             READBP   1579
 591    IF(IPTR.NE.0)THEN                                               READBP   1580
          JREC1=ILSREC(IPTR)                                            READBP   1581
          READ(IU31,REC=JREC1)JJFLAG,JJTYPE,LINE1                       READBP   1582
          IF(JJTYPE.EQ.JTYPE) GOTO 592                                  READBP   1583
          IPTR=INXLSD(IPTR)                                             READBP   1584
          GOTO 591                                                      READBP   1585
        ENDIF                                                           READBP   1586
C                                                                       READBP   1587
        WRITE(MSG(1),4050)                                              READBP   1588
        MSG(2)=LINE                                                     READBP   1589
        CALL PRTMSG(2)                                                  READBP   1590
        LINE='READBP: REMOTE RELAY DATA ERROR'                          READBP   1591
        CALL ASTOP(LINE,31)                                             READBP   1592
C                                                                       READBP   1593
 592    JPTR=(IPTR-1)*15                                                READBP   1594
        DO 593 II=1,15                                                  READBP   1595
          IF(IRRREC(JPTR+II).EQ.0)THEN                                  READBP   1596
            IRRREC(JPTR+II)=JREC                                        READBP   1597
            GOTO 594                                                    READBP   1598
          ENDIF                                                         READBP   1599
 593    CONTINUE                                                        READBP   1600
C                                                                       READBP   1601
        WRITE(MSG(1),4070)                                              READBP   1602
        MSG(2)=LINE                                                     READBP   1603
        CALL PRTMSG(2)                                                  READBP   1604
        LINE='READBP: TOO MANY REMOTE RELAYS'                           READBP   1605
        CALL ASTOP(LINE,30)                                             READBP   1606
C                                                                       READBP   1607
 594  CONTINUE                                                          READBP   1608
C-----------------------------------------------------------------------READBP   1609
C                                                                       READBP   1610
C     PUT THE LOAD SHEDDING DATA INTO PERMANENT ARRAYS                  READBP   1611
C                                                                       READBP   1612
      LUFVDB=LRTEMP                                                     READBP   1613
C                                                                       READBP   1614
      DO 600 I=1,LASTBU                                                 READBP   1615
        IPTR=IFSLSD(I)                                                  READBP   1616
        JAUTB=.TRUE.                                                    READBP   1617
        NSCHEM=0                                                        READBP   1618
        IBUSOK=I                                                        READBP   1619
 601    IF(IPTR.EQ.0)GOTO 600                                           READBP   1620
        JREC=ILSREC(IPTR)                                               READBP   1621
C                                                                       READBP   1622
        IF(JAUTB)THEN                                                   READBP   1623
          NAUT=NAUT+1                                                   READBP   1624
          NAUTB=NAUTB+1                                                 READBP   1625
          NLFB=NOLD(IBUSOK)                                             READBP   1626
          NAUBUS(NAUTB)=NLFB                                            READBP   1627
          JAUTB=.FALSE.                                                 READBP   1628
          LRTEMP=LRTEMP+1                                               READBP   1629
          IDATPT(LRTEMP)=JLNA+1                                         READBP   1630
          JSCHEM=JLNA                                                   READBP   1631
          IADATA(JLNA+2)=NLFB                                           READBP   1632
          JLNA7=JLNA+7                                                  READBP   1633
          IADATA(JLNA+7)=1                                              READBP   1634
          IRELAY=JLNA+9                                                 READBP   1635
          KSWITC=0                                                      READBP   1636
          IADATA(JLNA+8)=0                                              READBP   1637
          IADATA(JLNA+9)=0                                              READBP   1638
          JLNA=JLNA+9                                                   READBP   1639
        ENDIF                                                           READBP   1640
C                                                                       READBP   1641
        NSCHEM=NSCHEM+1                                                 READBP   1642
C                                                                       READBP   1643
        READ(IU31,REC=JREC)JFLAG,JTYPE,LINE                             READBP   1644
C                                                                       READBP   1645
        IF(LINE(16:16).EQ.'S')THEN                                      READBP   1646
          ISOPT=1                                                       READBP   1647
        ELSE                                                            READBP   1648
          ISOPT=0                                                       READBP   1649
        ENDIF                                                           READBP   1650
C                                                                       READBP   1651
        IADATA(JLNA+1)=JTYPE                                            READBP   1652
        KPOS=JLNA+2                                                     READBP   1653
        IADATA(JLNA+3)=ISOPT                                            READBP   1654
        ADATA(JLNA+4)=0.0                                               READBP   1655
        JLNA=JLNA+4                                                     READBP   1656
        LEVELS=0                                                        READBP   1657
C                                                                       READBP   1658
        READ(LINE,2020)ATLV1A,ATLV1B,ATLV1C,ATLV1D,                     READBP   1659
     2                 ATLV2A,ATLV2B,ATLV2C,ATLV2D,                     READBP   1660
     3                 ATLV3A,ATLV3B,ATLV3C,ATLV3D,                     READBP   1661
     4                 ATLV4A,ATLV4B,ATLV4C,ATLV4D                      READBP   1662
C                                                                       READBP   1663
        IF(ATLV1A.NE.0.0)THEN                                           READBP   1664
          LEVELS=LEVELS+1                                               READBP   1665
          ADATA(JLNA+1)=ATLV1A                                          READBP   1666
          ADATA(JLNA+2)=ATLV1B                                          READBP   1667
          ADATA(JLNA+3)=ATLV1C                                          READBP   1668
          ADATA(JLNA+4)=ATLV1D*100.0                                    READBP   1669
          IADATA(JLNA+5)=0                                              READBP   1670
          IADATA(JLNA+6)=0                                              READBP   1671
          JLNA=JLNA+6                                                   READBP   1672
          IF(ATLV1D.NE.0.0)IADATA(JLNA7)=0                              READBP   1673
        ENDIF                                                           READBP   1674
C                                                                       READBP   1675
        IF(ATLV2A.NE.0.0)THEN                                           READBP   1676
          LEVELS=LEVELS+1                                               READBP   1677
          ADATA(JLNA+1)=ATLV2A                                          READBP   1678
          ADATA(JLNA+2)=ATLV2B                                          READBP   1679
          ADATA(JLNA+3)=ATLV2C                                          READBP   1680
          ADATA(JLNA+4)=ATLV2D*100.0                                    READBP   1681
          IADATA(JLNA+5)=0                                              READBP   1682
          IADATA(JLNA+6)=0                                              READBP   1683
          JLNA=JLNA+6                                                   READBP   1684
          IF(ATLV2D.NE.0.0)IADATA(JLNA7)=0                              READBP   1685
        ENDIF                                                           READBP   1686
C                                                                       READBP   1687
        IF(ATLV3A.NE.0.0)THEN                                           READBP   1688
          LEVELS=LEVELS+1                                               READBP   1689
          ADATA(JLNA+1)=ATLV3A                                          READBP   1690
          ADATA(JLNA+2)=ATLV3B                                          READBP   1691
          ADATA(JLNA+3)=ATLV3C                                          READBP   1692
          ADATA(JLNA+4)=ATLV3D*100.0                                    READBP   1693
          IADATA(JLNA+5)=0                                              READBP   1694
          IADATA(JLNA+6)=0                                              READBP   1695
          JLNA=JLNA+6                                                   READBP   1696
          IF(ATLV3D.NE.0.0)IADATA(JLNA7)=0                              READBP   1697
        ENDIF                                                           READBP   1698
C                                                                       READBP   1699
        IF(ATLV4A.NE.0.0)THEN                                           READBP   1700
          LEVELS=LEVELS+1                                               READBP   1701
          ADATA(JLNA+1)=ATLV4A                                          READBP   1702
          ADATA(JLNA+2)=ATLV4B                                          READBP   1703
          ADATA(JLNA+3)=ATLV4C                                          READBP   1704
          ADATA(JLNA+4)=ATLV4D*100.0                                    READBP   1705
          IADATA(JLNA+5)=0                                              READBP   1706
          IADATA(JLNA+6)=0                                              READBP   1707
          JLNA=JLNA+6                                                   READBP   1708
          IF(ATLV4D.NE.0.0)IADATA(JLNA7)=0                              READBP   1709
        ENDIF                                                           READBP   1710
C                                                                       READBP   1711
        IADATA(KPOS)=LEVELS                                             READBP   1712
        IADATA(JSCHEM+1)=NSCHEM                                         READBP   1713
C                                                                       READBP   1714
C     FOR REMOTE RELAYS                                                 READBP   1715
C                                                                       READBP   1716
        IF(JTYPE.LE.2)THEN                                              READBP   1717
          JPTR=(IPTR-1)*15                                              READBP   1718
          DO 704 II=1,15                                                READBP   1719
            JREC=IRRREC(JPTR+II)                                        READBP   1720
            IF(JREC.EQ.0)THEN                                           READBP   1721
              IADATA(IRELAY)=KSWITC                                     READBP   1722
              GOTO 602                                                  READBP   1723
            ENDIF                                                       READBP   1724
C                                                                       READBP   1725
            READ(IU31,REC=JREC)LINE                                     READBP   1726
            DO 705 III=1,ICO34R                                         READBP   1727
              IF(LINE(34:34).EQ.COL34R(III))THEN                        READBP   1728
                ICOD34=III                                              READBP   1729
                GOTO 706                                                READBP   1730
              ENDIF                                                     READBP   1731
 705        CONTINUE                                                    READBP   1732
C                                                                       READBP   1733
            WRITE(MSG(1),4080)                                          READBP   1734
            MSG(2)=LINE                                                 READBP   1735
            CALL PRTMSG(2)                                              READBP   1736
            LINE='READBP: REMOTE RELAY DATA ERROR'                      READBP   1737
            CALL ASTOP(LINE,31)                                         READBP   1738
C                                                                       READBP   1739
 706        CONTINUE                                                    READBP   1740
C                                                                       READBP   1741
C            'M', 'D', 'R', 'B', 'G'                                    READBP   1742
            GOTO(711, 712, 713, 714, 715)ICOD34                         READBP   1743
C                                                                       READBP   1744
 711        CARD1=' '                                                   READBP   1745
            CARD3=' '                                                   READBP   1746
            READ(LINE,5000)RRR,XXX,BBB                                  READBP   1747
            WRITE(CARD1,5100)LINE(35:46),LINE(49:60),LINE(61:61),       READBP   1748
     +                       RRR,XXX,BBB                                READBP   1749
            CALL SWIDAT(CARD1,CARD3,KSWITC,IEBK)                        READBP   1750
            IF(IEBK.NE.0)CALL ASTOP(LINE,80)                            READBP   1751
            GOTO 704                                                    READBP   1752
C                                                                       READBP   1753
 712        CARD1=' '                                                   READBP   1754
            CARD3=' '                                                   READBP   1755
            READ(LINE,5800)TTRANS                                       READBP   1756
            WRITE(CARD1,5200)LINE(35:46),LINE(49:60),LINE(61:61),       READBP   1757
     +                       TTRANS                                     READBP   1758
            CALL SWIDAT(CARD1,CARD3,KSWITC,IEBK)                        READBP   1759
            IF(IEBK.NE.0)CALL ASTOP(LINE,80)                            READBP   1760
            GOTO 704                                                    READBP   1761
C                                                                       READBP   1762
 713        CARD1=' '                                                   READBP   1763
            CARD3=' '                                                   READBP   1764
            WRITE(CARD1,5300)LINE(35:46),LINE(49:60),LINE(61:61)        READBP   1765
            CALL SWIDAT(CARD1,CARD3,KSWITC,IEBK)                        READBP   1766
            IF(IEBK.NE.0)CALL ASTOP(LINE,80)                            READBP   1767
            GOTO 704                                                    READBP   1768
C                                                                       READBP   1769
 714        CARD1=' '                                                   READBP   1770
            CARD3=' '                                                   READBP   1771
            IF(LINE(35:46).NE.NOBUSS)THEN                               READBP   1772
              READ(LINE,5500)TTRANS,PDROP1                              READBP   1773
              PDROP1=PDROP1*100.0                                       READBP   1774
              WRITE(CARD1,5400)LINE(35:46),ISOPT,PDROP1,PDROP1,         READBP   1775
     +                         TTRANS                                   READBP   1776
              CALL SWIDAT(CARD1,CARD3,KSWITC,IEBK)                      READBP   1777
              IF(IEBK.NE.0)CALL ASTOP(LINE,80)                          READBP   1778
            ENDIF                                                       READBP   1779
            IF(LINE(49:60).NE.NOBUSS)THEN                               READBP   1780
              READ(LINE,5600) TTRANS,PDROP2                             READBP   1781
              PDROP2=PDROP1*100.0                                       READBP   1782
              WRITE(CARD1,5400)LINE(49:60),ISOPT,PDROP2,PDROP2,         READBP   1783
     +                         TTRANS                                   READBP   1784
              CALL SWIDAT(CARD1,CARD3,KSWITC,IEBK)                      READBP   1785
              IF(IEBK.NE.0)CALL ASTOP(LINE,80)                          READBP   1786
            ENDIF                                                       READBP   1787
            GOTO 704                                                    READBP   1788
C                                                                       READBP   1789
 715        CARD1=' '                                                   READBP   1790
            CARD3=' '                                                   READBP   1791
            IF(LINE(35:46).NE.NOBUSS)THEN                               READBP   1792
              DO 766 IIJ=63,68                                          READBP   1793
                IF(LINE(IIJ:IIJ).NE.' ')THEN                            READBP   1794
                  IIJO=IIJ                                              READBP   1795
                  GOTO 767                                              READBP   1796
                ENDIF                                                   READBP   1797
 766          CONTINUE                                                  READBP   1798
              IIJO=63                                                   READBP   1799
 767          CONTINUE                                                  READBP   1800
              PDROP1=1.0                                                READBP   1801
              WRITE(CARD1,5700)LINE(35:46),LINE(IIJO:IIJO+1),PDROP1     READBP   1802
              CALL SWIDAT(CARD1,CARD3,KSWITC,IEBK)                      READBP   1803
              IF(IEBK.NE.0)CALL ASTOP(LINE,80)                          READBP   1804
            ENDIF                                                       READBP   1805
            IF(LINE(49:60).NE.NOBUSS)THEN                               READBP   1806
              DO 768 IIJ=69,74                                          READBP   1807
                IF(LINE(IIJ:IIJ).NE.' ')THEN                            READBP   1808
                  IIJO=IIJ                                              READBP   1809
                  GOTO 769                                              READBP   1810
                ENDIF                                                   READBP   1811
 768          CONTINUE                                                  READBP   1812
              IIJO=63                                                   READBP   1813
 769          CONTINUE                                                  READBP   1814
              PDROP2=1.0                                                READBP   1815
              WRITE(CARD1,5700)LINE(49:60),LINE(IIJO:IIJO+1),PDROP2     READBP   1816
              CALL SWIDAT(CARD1,CARD3,KSWITC,IEBK)                      READBP   1817
              IF(IEBK.NE.0)CALL ASTOP(LINE,80)                          READBP   1818
            ENDIF                                                       READBP   1819
C                                                                       READBP   1820
 704      CONTINUE                                                      READBP   1821
        ENDIF                                                           READBP   1822
C                                                                       READBP   1823
C     NEXT SCHEME                                                       READBP   1824
C                                                                       READBP   1825
 602    IPTR=INXLSD(IPTR)                                               READBP   1826
        GOTO 601                                                        READBP   1827
C                                                                       READBP   1828
 600  CONTINUE                                                          READBP   1829
C                                                                       READBP   1830
      IF(LRTEMP.NE.LUFVDB)THEN                                          READBP   1831
        LUFVDB=LUFVDB+1                                                 READBP   1832
        NUFVDB=LRTEMP                                                   READBP   1833
      ELSE                                                              READBP   1834
        LUFVDB=0                                                        READBP   1835
        NUFVDB=0                                                        READBP   1836
      ENDIF                                                             READBP   1837
C-----------------------------------------------------------------------READBP   1838
C                                                                       READBP   1839
C     PUT THE RELAY DATA INTO PERMANENT ARRAYS                          READBP   1840
C                                                                       READBP   1841
      LDISTR=LRTEMP                                                     READBP   1842
      DO 610 I=1,RELBUS                                                 READBP   1843
      ICODE2=KRELTY(I)                                                  READBP   1844
      IF(ICODE2.EQ.8) GOTO 610                                          READBP   1845
      JREC=NTHREL(I)                                                    READBP   1846
      NLFI=RLBUS1(I)                                                    READBP   1847
      NLFJ=RLBUS2(I)                                                    READBP   1848
      READ(IU31,REC=JREC) LINE                                          READBP   1849
      CID2(1:1)=LINE(32:32)                                             READBP   1850
      CID2(2:2)=' '                                                     READBP   1851
      TFLAG=LINE(19:19)                                                 READBP   1852
      ROPT=LINE(2:2)                                                    READBP   1853
      IF(NAUT.LT.MAXSET) THEN                                           READBP   1854
      NAUT=NAUT+1                                                       READBP   1855
      NAUTB=NAUTB+2                                                     READBP   1856
      NAUBUS(NAUTB-1)=NLFI                                              READBP   1857
      NAUBUS(NAUTB)=NLFJ                                                READBP   1858
      LRTEMP=LRTEMP+1                                                   READBP   1859
      IDATPT(LRTEMP)=JLNA                                               READBP   1860
      IADATA(JLNA+2)=NLFI                                               READBP   1861
      IADATA(JLNA+3)=NLFJ                                               READBP   1862
      CALL PACK(CID2,0,JI)                                              READBP   1863
      IADATA(JLNA+4)=JI                                                 READBP   1864
      IADATA(JLNA+5)=1                                                  READBP   1865
      IF(TFLAG.EQ.'C') IADATA(JLNA+5)=2                                 READBP   1866
      IADATA(JLNA+6)=1                                                  READBP   1867
      READ(LINE,2050) ADATA(JLNA+9),ADATA(JLNA+10),ADATA(JLNA+11),      READBP   1868
     1                ADATA(JLNA+12),ADATA(JLNA+14),ADATA(JLNA+15),     READBP   1869
     2                ADATA(JLNA+16),ADATA(JLNA+17),ADATA(JLNA+20)      READBP   1870
      IADATA(JLNA+7)=0                                                  READBP   1871
      IADATA(JLNA+8)=0                                                  READBP   1872
      JLNA=JLNA+27                                                      READBP   1873
      ELSE                                                              READBP   1874
      WRITE(MSG(1),2060) MXASCH                                         READBP   1875
      MSG(2)=LINE                                                       READBP   1876
      CALL PRTMSG(2)                                                    READBP   1877
      IEBK=1                                                            READBP   1878
      ENDIF                                                             READBP   1879
 610  CONTINUE                                                          READBP   1880
C                                                                       READBP   1881
      IF(LRTEMP.NE.LDISTR)THEN                                          READBP   1882
      LDISTR=LDISTR+1                                                   READBP   1883
      NDISTR=LRTEMP                                                     READBP   1884
      ELSE                                                              READBP   1885
      LDISTR=0                                                          READBP   1886
      NDISTR=0                                                          READBP   1887
      ENDIF                                                             READBP   1888
C                                                                       READBP   1889
C     PUT NONLINEAR LOAD DATA INTO TEMPORARY ARRAYS                     READBP   1890
C                                                                       READBP   1891
      DO 620 II=1,NLFBUS                                                READBP   1892
        IF(IBSNLD(II).EQ.0)GOTO 620                                     READBP   1893
C                                                                       READBP   1894
        IREC=IBSNLD(II)                                                 READBP   1895
        CALL EPLOSP(JNLD,IREC,JTLN,LINE                                 READBP   1896
     &                  ,ICCP,ICPP,KP1,A1,ICCQ,ICPQ,KQ1,B1              READBP   1897
     &                   ,AP1,AQ1,AP2,AQ2,AP3,AQ3,AP4,AQ4,ALDP,ALDQ)    READBP   1898
        BSNAME=LINE(4:15)                                               READBP   1899
C                                                                       READBP   1900
        ITDDAT(JTLN+1)=2                                                READBP   1901
        ITDDAT(JTLN+2)=JBUS(1)                                          READBP   1902
        ITDDAT(JTLN+3)=JBUS(2)                                          READBP   1903
        ITDDAT(JTLN+4)=JBUS(3)                                          READBP   1904
        ITDDAT(JTLN+5)=ICCP                                             READBP   1905
        ITDDAT(JTLN+6)=ICCQ                                             READBP   1906
        ITDDAT(JTLN+7)=ICPP                                             READBP   1907
        ITDDAT(JTLN+8)=ICPQ                                             READBP   1908
        ITDDAT(JTLN+9)=KP1                                              READBP   1909
        ITDDAT(JTLN+10)=KQ1                                             READBP   1910
        ITDDAT(JTLN+11)=0                                               READBP   1911
        ITDDAT(JTLN+12)=0                                               READBP   1912
        ITDDAT(JTLN+13)=0                                               READBP   1913
        ITDDAT(JTLN+14)=0                                               READBP   1914
        ITDDAT(JTLN+15)=0                                               READBP   1915
        JTLN=JTLN+15                                                    READBP   1916
C                                                                       READBP   1917
        IF(KP1.NE.0.OR.KQ1.NE.0)THEN                                    READBP   1918
          TDDAT(JTLN+1)=A1                                              READBP   1919
          TDDAT(JTLN+2)=ALDP                                            READBP   1920
          TDDAT(JTLN+3)=0.0                                             READBP   1921
          TDDAT(JTLN+4)=0.0                                             READBP   1922
          TDDAT(JTLN+5)=B1                                              READBP   1923
          TDDAT(JTLN+6)=ALDQ                                            READBP   1924
          TDDAT(JTLN+7)=0.0                                             READBP   1925
          TDDAT(JTLN+8)=0.0                                             READBP   1926
          JTLN=JTLN+8                                                   READBP   1927
        ENDIF                                                           READBP   1928
620   CONTINUE                                                          READBP   1929
C                                                                       READBP   1930
      DO 630 II=1,NUMZON                                                READBP   1931
        IF(IZNNLD(II).EQ.0)GOTO 630                                     READBP   1932
C                                                                       READBP   1933
        IREC=IZNNLD(II)                                                 READBP   1934
        CALL EPLOSP(JNLD,IREC,JTLN,LINE                                 READBP   1935
     &                  ,ICCP,ICPP,KP1,A1,ICCQ,ICPQ,KQ1,B1              READBP   1936
     &                   ,AP1,AQ1,AP2,AQ2,AP3,AQ3,AP4,AQ4,ALDP,ALDQ)    READBP   1937
        ZNNAME=LINE(16:17)                                              READBP   1938
        ARNAME='            '                                           READBP   1939
        BSNAME='            '                                           READBP   1940
C                                                                       READBP   1941
        ITDDAT(JTLN+1)=4                                                READBP   1942
        ITDDAT(JTLN+2)=JAREA(1)                                         READBP   1943
        ITDDAT(JTLN+3)=JAREA(2)                                         READBP   1944
        ITDDAT(JTLN+4)=JAREA(3)                                         READBP   1945
        ITDDAT(JTLN+5)=JAREA(1)                                         READBP   1946
        ITDDAT(JTLN+6)=JAREA(2)                                         READBP   1947
        ITDDAT(JTLN+7)=JAREA(3)                                         READBP   1948
        ITDDAT(JTLN+8)=JZONE(1)                                         READBP   1949
        ITDDAT(JTLN+9)=JZONE(2)                                         READBP   1950
        ITDDAT(JTLN+10)=JZONE(3)                                        READBP   1951
        ITDDAT(JTLN+11)=JZONE(1)                                        READBP   1952
        ITDDAT(JTLN+12)=JZONE(2)                                        READBP   1953
        ITDDAT(JTLN+13)=JZONE(3)                                        READBP   1954
        ITDDAT(JTLN+14)=JBUS(1)                                         READBP   1955
        ITDDAT(JTLN+15)=JBUS(2)                                         READBP   1956
        ITDDAT(JTLN+16)=JBUS(3)                                         READBP   1957
        ITDDAT(JTLN+17)=JBUS(1)                                         READBP   1958
        ITDDAT(JTLN+18)=JBUS(2)                                         READBP   1959
        ITDDAT(JTLN+19)=JBUS(3)                                         READBP   1960
        JTLN=JTLN+19                                                    READBP   1961
C                                                                       READBP   1962
        TDDAT(JTLN+1)=0.0                                               READBP   1963
        TDDAT(JTLN+2)=0.0                                               READBP   1964
        JTLN=JTLN+2                                                     READBP   1965
C                                                                       READBP   1966
        ITDDAT(JTLN+1)=ICCP                                             READBP   1967
        ITDDAT(JTLN+2)=ICCQ                                             READBP   1968
        ITDDAT(JTLN+3)=ICPP                                             READBP   1969
        ITDDAT(JTLN+4)=ICPQ                                             READBP   1970
        ITDDAT(JTLN+5)=KP1                                              READBP   1971
        ITDDAT(JTLN+6)=KQ1                                              READBP   1972
        ITDDAT(JTLN+7)=0                                                READBP   1973
        ITDDAT(JTLN+8)=0                                                READBP   1974
        ITDDAT(JTLN+9)=0                                                READBP   1975
        ITDDAT(JTLN+10)=0                                               READBP   1976
        ITDDAT(JTLN+11)=0                                               READBP   1977
        JTLN=JTLN+11                                                    READBP   1978
C                                                                       READBP   1979
        IF(KP1.NE.0.OR.KQ1.NE.0)THEN                                    READBP   1980
          TDDAT(JTLN+1)=A1                                              READBP   1981
          TDDAT(JTLN+2)=ALDP                                            READBP   1982
          TDDAT(JTLN+3)=0.0                                             READBP   1983
          TDDAT(JTLN+4)=0.0                                             READBP   1984
          TDDAT(JTLN+5)=B1                                              READBP   1985
          TDDAT(JTLN+6)=ALDQ                                            READBP   1986
          TDDAT(JTLN+7)=0.0                                             READBP   1987
          TDDAT(JTLN+8)=0.0                                             READBP   1988
          JTLN=JTLN+8                                                   READBP   1989
        ENDIF                                                           READBP   1990
630   CONTINUE                                                          READBP   1991
C                                                                       READBP   1992
      DO 640 II=1,NMAREA                                                READBP   1993
        IF(IARNLD(II).EQ.0)GOTO 640                                     READBP   1994
C                                                                       READBP   1995
        IREC=IARNLD(II)                                                 READBP   1996
        CALL EPLOSP(JNLD,IREC,JTLN,LINE                                 READBP   1997
     &                  ,ICCP,ICPP,KP1,A1,ICCQ,ICPQ,KQ1,B1              READBP   1998
     &                   ,AP1,AQ1,AP2,AQ2,AP3,AQ3,AP4,AQ4,ALDP,ALDQ)    READBP   1999
        ARNAME=LINE(18:27)                                              READBP   2000
        ZNNAME='            '                                           READBP   2001
        BSNAME='            '                                           READBP   2002
C                                                                       READBP   2003
        ITDDAT(JTLN+1)=4                                                READBP   2004
        ITDDAT(JTLN+2)=JAREA(1)                                         READBP   2005
        ITDDAT(JTLN+3)=JAREA(2)                                         READBP   2006
        ITDDAT(JTLN+4)=JAREA(3)                                         READBP   2007
        ITDDAT(JTLN+5)=JAREA(1)                                         READBP   2008
        ITDDAT(JTLN+6)=JAREA(2)                                         READBP   2009
        ITDDAT(JTLN+7)=JAREA(3)                                         READBP   2010
        ITDDAT(JTLN+8)=JZONE(1)                                         READBP   2011
        ITDDAT(JTLN+9)=JZONE(2)                                         READBP   2012
        ITDDAT(JTLN+10)=JZONE(3)                                        READBP   2013
        ITDDAT(JTLN+11)=JZONE(1)                                        READBP   2014
        ITDDAT(JTLN+12)=JZONE(2)                                        READBP   2015
        ITDDAT(JTLN+13)=JZONE(3)                                        READBP   2016
        ITDDAT(JTLN+14)=JBUS(1)                                         READBP   2017
        ITDDAT(JTLN+15)=JBUS(2)                                         READBP   2018
        ITDDAT(JTLN+16)=JBUS(3)                                         READBP   2019
        ITDDAT(JTLN+17)=JBUS(1)                                         READBP   2020
        ITDDAT(JTLN+18)=JBUS(2)                                         READBP   2021
        ITDDAT(JTLN+19)=JBUS(3)                                         READBP   2022
        JTLN=JTLN+19                                                    READBP   2023
C                                                                       READBP   2024
        TDDAT(JTLN+1)=0.0                                               READBP   2025
        TDDAT(JTLN+2)=0.0                                               READBP   2026
        JTLN=JTLN+2                                                     READBP   2027
C                                                                       READBP   2028
        ITDDAT(JTLN+1)=ICCP                                             READBP   2029
        ITDDAT(JTLN+2)=ICCQ                                             READBP   2030
        ITDDAT(JTLN+3)=ICPP                                             READBP   2031
        ITDDAT(JTLN+4)=ICPQ                                             READBP   2032
        ITDDAT(JTLN+5)=KP1                                              READBP   2033
        ITDDAT(JTLN+6)=KQ1                                              READBP   2034
        ITDDAT(JTLN+7)=0                                                READBP   2035
        ITDDAT(JTLN+8)=0                                                READBP   2036
        ITDDAT(JTLN+9)=0                                                READBP   2037
        ITDDAT(JTLN+10)=0                                               READBP   2038
        ITDDAT(JTLN+11)=0                                               READBP   2039
        JTLN=JTLN+11                                                    READBP   2040
C                                                                       READBP   2041
        IF(KP1.NE.0.OR.KQ1.NE.0)THEN                                    READBP   2042
          TDDAT(JTLN+1)=A1                                              READBP   2043
          TDDAT(JTLN+2)=ALDP                                            READBP   2044
          TDDAT(JTLN+3)=0.0                                             READBP   2045
          TDDAT(JTLN+4)=0.0                                             READBP   2046
          TDDAT(JTLN+5)=B1                                              READBP   2047
          TDDAT(JTLN+6)=ALDQ                                            READBP   2048
          TDDAT(JTLN+7)=0.0                                             READBP   2049
          TDDAT(JTLN+8)=0.0                                             READBP   2050
          JTLN=JTLN+8                                                   READBP   2051
        ENDIF                                                           READBP   2052
640   CONTINUE                                                          READBP   2053
C                                                                       READBP   2054
      IF(ITLNLD.NE.0)THEN                                               READBP   2055
        IREC=ITLNLD                                                     READBP   2056
        CALL EPLOSP(JNLD,IREC,JTLN,LINE                                 READBP   2057
     &                  ,ICCP,ICPP,KP1,A1,ICCQ,ICPQ,KQ1,B1              READBP   2058
     &                   ,AP1,AQ1,AP2,AQ2,AP3,AQ3,AP4,AQ4,ALDP,ALDQ)    READBP   2059
        ZNNAME='            '                                           READBP   2060
        BSNAME='            '                                           READBP   2061
C                                                                       READBP   2062
        ITDDAT(JTLN+1)=4                                                READBP   2063
        ITDDAT(JTLN+2)=IARE(1,1)                                        READBP   2064
        ITDDAT(JTLN+3)=IARE(1,2)                                        READBP   2065
        ITDDAT(JTLN+4)=IARE(1,3)                                        READBP   2066
        ITDDAT(JTLN+5)=IARE(NMAREA,1)                                   READBP   2067
        ITDDAT(JTLN+6)=IARE(NMAREA,2)                                   READBP   2068
        ITDDAT(JTLN+7)=IARE(NMAREA,3)                                   READBP   2069
        ITDDAT(JTLN+8)=JZONE(1)                                         READBP   2070
        ITDDAT(JTLN+9)=JZONE(2)                                         READBP   2071
        ITDDAT(JTLN+10)=JZONE(3)                                        READBP   2072
        ITDDAT(JTLN+11)=JZONE(1)                                        READBP   2073
        ITDDAT(JTLN+12)=JZONE(2)                                        READBP   2074
        ITDDAT(JTLN+13)=JZONE(3)                                        READBP   2075
        ITDDAT(JTLN+14)=JBUS(1)                                         READBP   2076
        ITDDAT(JTLN+15)=JBUS(2)                                         READBP   2077
        ITDDAT(JTLN+16)=JBUS(3)                                         READBP   2078
        ITDDAT(JTLN+17)=JBUS(1)                                         READBP   2079
        ITDDAT(JTLN+18)=JBUS(2)                                         READBP   2080
        ITDDAT(JTLN+19)=JBUS(3)                                         READBP   2081
        JTLN=JTLN+19                                                    READBP   2082
C                                                                       READBP   2083
        TDDAT(JTLN+1)=0.0                                               READBP   2084
        TDDAT(JTLN+2)=0.0                                               READBP   2085
        JTLN=JTLN+2                                                     READBP   2086
C                                                                       READBP   2087
        ITDDAT(JTLN+1)=ICCP                                             READBP   2088
        ITDDAT(JTLN+2)=ICCQ                                             READBP   2089
        ITDDAT(JTLN+3)=ICPP                                             READBP   2090
        ITDDAT(JTLN+4)=ICPQ                                             READBP   2091
        ITDDAT(JTLN+5)=KP1                                              READBP   2092
        ITDDAT(JTLN+6)=KQ1                                              READBP   2093
        ITDDAT(JTLN+7)=0                                                READBP   2094
        ITDDAT(JTLN+8)=0                                                READBP   2095
        ITDDAT(JTLN+9)=0                                                READBP   2096
        ITDDAT(JTLN+10)=0                                               READBP   2097
        ITDDAT(JTLN+11)=0                                               READBP   2098
        JTLN=JTLN+11                                                    READBP   2099
C                                                                       READBP   2100
        IF(KP1.NE.0.OR.KQ1.NE.0)THEN                                    READBP   2101
          TDDAT(JTLN+1)=A1                                              READBP   2102
          TDDAT(JTLN+2)=ALDP                                            READBP   2103
          TDDAT(JTLN+3)=0.0                                             READBP   2104
          TDDAT(JTLN+4)=0.0                                             READBP   2105
          TDDAT(JTLN+5)=B1                                              READBP   2106
          TDDAT(JTLN+6)=ALDQ                                            READBP   2107
          TDDAT(JTLN+7)=0.0                                             READBP   2108
          TDDAT(JTLN+8)=0.0                                             READBP   2109
          JTLN=JTLN+8                                                   READBP   2110
        ENDIF                                                           READBP   2111
      ENDIF                                                             READBP   2112
C                                                                       READBP   2113
      GOTO 646                                                          READBP   2114
C                                                                       READBP   2115
C     PUT THE INDUCTION MOTOR DATA INTO TEMPORARY ARRAYS                READBP   2116
C                                                                       READBP   2117
 646  DO 650 I=1,NMOTBS                                                 READBP   2118
      JREC=NTHMOT(I)                                                    READBP   2119
      READ(IU31,REC=JREC) LINE                                          READBP   2120
C                                                                       READBP   2121
      READ(LINE,3060)EMWS,PFA,BP,RS,XS,XM,RR,XR,VI,TI,A,B               READBP   2122
C                                                                       READBP   2123
      JMOTL=JMOTL+1                                                     READBP   2124
C                                                                       READBP   2125
      NLFB=MOTBUS(I)                                                    READBP   2126
      JMOTB(JMOTL)=NLFB                                                 READBP   2127
      IPFA1=NINT(PFA*100)                                               READBP   2128
      HM=EMWS/BP                                                        READBP   2129
C                                                                       READBP   2130
      INDMID(JMOTL)='  '//LINE(16:16)//' '                              READBP   2131
      JJMDAT(JMOTL)=JTLN                                                READBP   2132
      ITDDAT(JTLN+1)=1                                                  READBP   2133
      ITDDAT(JTLN+2)=IPFA1                                              READBP   2134
      ITDDAT(JTLN+3)=0                                                  READBP   2135
      ITDDAT(JTLN+4)=2                                                  READBP   2136
C                                                                       READBP   2137
      TDDAT(JTLN+5)=XM                                                  READBP   2138
      TDDAT(JTLN+6)=XS                                                  READBP   2139
      TDDAT(JTLN+7)=RS                                                  READBP   2140
      TDDAT(JTLN+8)=XR                                                  READBP   2141
      TDDAT(JTLN+9)=RR                                                  READBP   2142
      TDDAT(JTLN+10)=HM                                                 READBP   2143
      TDDAT(JTLN+11)=BP                                                 READBP   2144
      TDDAT(JTLN+12)=1.0                                                READBP   2145
      TDDAT(JTLN+13)=0.0                                                READBP   2146
      TDDAT(JTLN+14)=A                                                  READBP   2147
      TDDAT(JTLN+15)=B                                                  READBP   2148
      TDDAT(JTLN+16)=0.0                                                READBP   2149
      TDDAT(JTLN+17)=VI                                                 READBP   2150
      TDDAT(JTLN+18)=TI                                                 READBP   2151
      TDDAT(JTLN+19)=0.0                                                READBP   2152
      TDDAT(JTLN+20)=0.0                                                READBP   2153
      TDDAT(JTLN+21)=10.0                                               READBP   2154
      TDDAT(JTLN+22)=10.0                                               READBP   2155
      TDDAT(JTLN+23)=0.0                                                READBP   2156
      TDDAT(JTLN+24)=0.0                                                READBP   2157
      TDDAT(JTLN+25)=0.0                                                READBP   2158
      TDDAT(JTLN+26)=0.0                                                READBP   2159
C                                                                       READBP   2160
      JTLN=JTLN+26                                                      READBP   2161
      CALL MCHECK (NLFB,13,JTLN,'REPMOT')                               READBP   2162
 650  CONTINUE                                                          READBP   2163
C                                                                       READBP   2164
C     PUT THE SVC DATA INTO TEMPORARY ARRAYS                            READBP   2165
C                                                                       READBP   2166
      IQF=100                                                           READBP   2167
      ISDIV=2                                                           READBP   2168
C                                                                       READBP   2169
      DO 900 I=1,NSVCBS                                                 READBP   2170
        JREC=LSVC(I)                                                    READBP   2171
        JRECZ=LSVCZ(I)                                                  READBP   2172
        JRECA=LSVCA(I)                                                  READBP   2173
        JRECB=LSVCB(I)                                                  READBP   2174
        JRECC=LSVCC(I)                                                  READBP   2175
        JRECD=LSVCD(I)                                                  READBP   2176
        JRECE=LSVCE(I)                                                  READBP   2177
        JRECF=LSVCF(I)                                                  READBP   2178
C                                                                       READBP   2179
        IF(JRECA.LE.0.AND.JRECB.LE.0.AND.JRECC.LE.0)THEN                READBP   2180
          ISVC=2                                                        READBP   2181
        ELSE                                                            READBP   2182
          ISVC=3                                                        READBP   2183
        ENDIF                                                           READBP   2184
C                                                                       READBP   2185
        NLFSV=LFSVCO(I)                                                 READBP   2186
        NVSENX=LFSVCR(I)                                                READBP   2187
        IF(NVSENX.EQ.0)NVSENX=NLFSV                                     READBP   2188
C                                                                       READBP   2189
        READ(IU31,REC=JREC)LINE                                         READBP   2190
        SVCNAM=LINE(4:15)                                               READBP   2191
        SVCKT=' '                                                       READBP   2192
        SVCKT(2:2)=LINE(16:16)                                          READBP   2193
        READ(LINE,4010) TS1,VEMAX,TS2,TS3,TS4,TS5,AKSVS,AKSD,BMAX,      READBP   2194
     +                  BMAXP,BMINP,BMIN,TS6,DV                         READBP   2195
C                                                                       READBP   2196
        IF(AKSVS.LE.0.0)THEN                                            READBP   2197
          WRITE(MSG(1),4020)                                            READBP   2198
          MSG(2)=LINE                                                   READBP   2199
          CALL PRTMSG(2)                                                READBP   2200
          LINE='READBP: SVC DATA ERROR'                                 READBP   2201
          CALL ASTOP (LINE,22)                                          READBP   2202
        ENDIF                                                           READBP   2203
C                                                                       READBP   2204
        QC=BMAX*100.0                                                   READBP   2205
        QL=QC-BMIN*100.0                                                READBP   2206
C                                                                       READBP   2207
        IF(QC.LT.0.0.OR.QL.LE.0.0)THEN                                  READBP   2208
          WRITE(MSG(1),4030)                                            READBP   2209
          MSG(2)=LINE                                                   READBP   2210
          CALL PRTMSG(2)                                                READBP   2211
          LINE='READBP: SVC DATA ERROR'                                 READBP   2212
          CALL ASTOP (LINE,22)                                          READBP   2213
        ENDIF                                                           READBP   2214
C                                                                       READBP   2215
        BMAX=-BMINP*100.0/QL                                            READBP   2216
        BMIN=-BMAXP*100.0/QL                                            READBP   2217
C                                                                       READBP   2218
        IF(JRECZ.NE.0)THEN                                              READBP   2219
          READ(IU31,REC=JRECZ)LINE1                                     READBP   2220
          READ(LINE1,4140) VMAX,VMIN,VEMAXZ,VEMIN,BIAS,DV2,BSHUNT,TDELAYREADBP   2221
          BIAS=BIAS*100.0/QL                                            READBP   2222
          BSHUNT=BSHUNT*100.0/QL                                        READBP   2223
          TDELAY=TDELAY/FQBASE                                          READBP   2224
        ELSE                                                            READBP   2225
          VMAX=0.0                                                      READBP   2226
          VMIN=0.0                                                      READBP   2227
          VEMIN=0.0                                                     READBP   2228
          BIAS=0.0                                                      READBP   2229
          DV2=0.0                                                       READBP   2230
          BSHUNT=0.0                                                    READBP   2231
          TDELAY=0.0                                                    READBP   2232
        ENDIF                                                           READBP   2233
C                                                                       READBP   2234
        IF(VEMAX.EQ.0.0)THEN                                            READBP   2235
          IF(JRECZ.EQ.0)THEN                                            READBP   2236
            WRITE(MSG(1),4150)                                          READBP   2237
            MSG(2)=LINE                                                 READBP   2238
            CALL PRTMSG(2)                                              READBP   2239
            LINE='READBP: SVC DATA ERROR'                               READBP   2240
            CALL ASTOP (LINE,22)                                        READBP   2241
          ENDIF                                                         READBP   2242
          VEMAX=VEMAXZ                                                  READBP   2243
        ELSE                                                            READBP   2244
          VEMIN=-VEMAX                                                  READBP   2245
          VMAX=VEMAX                                                    READBP   2246
          VMIN=VEMIN                                                    READBP   2247
        ENDIF                                                           READBP   2248
C                                                                       READBP   2249
        IF(LINE(2:2).EQ.'W')THEN                                        READBP   2250
          VMAX=0.0                                                      READBP   2251
          VMIN=0.0                                                      READBP   2252
        ENDIF                                                           READBP   2253
C                                                                       READBP   2254
        SVCDA(1)=TS1                                                    READBP   2255
        SVCDA(2)=VEMAX                                                  READBP   2256
        SVCDA(3)=TS2                                                    READBP   2257
        SVCDA(4)=TS3                                                    READBP   2258
        SVCDA(5)=TS4                                                    READBP   2259
        SVCDA(6)=TS5                                                    READBP   2260
        SVCDA(7)=AKSVS                                                  READBP   2261
        SVCDA(8)=0.0                                                    READBP   2262
        SVCDA(9)=AKSD                                                   READBP   2263
        SVCDA(10)=QL                                                    READBP   2264
        SVCDA(11)=BMAX                                                  READBP   2265
        SVCDA(12)=BMIN                                                  READBP   2266
        SVCDA(13)=QC                                                    READBP   2267
        SVCDA(14)=TS6                                                   READBP   2268
        SVCDA(15)=DV                                                    READBP   2269
        SVCDA(16)=0.0                                                   READBP   2270
        SVCDA(17)=VMAX                                                  READBP   2271
        SVCDA(18)=VMIN                                                  READBP   2272
        SVCDA(19)=VEMIN                                                 READBP   2273
        SVCDA(20)=BIAS                                                  READBP   2274
        SVCDA(21)=DV2                                                   READBP   2275
        SVCDA(22)=BSHUNT                                                READBP   2276
        SVCDA(23)=TDELAY                                                READBP   2277
C                                                                       READBP   2278
        IF(ISVC.EQ.3)THEN                                               READBP   2279
          IF(JRECA.GT.0)THEN                                            READBP   2280
            MT1=2                                                       READBP   2281
            READ(IU31,REC=JRECA)LINE                                    READBP   2282
            NVSEN1=LFSAR(I)                                             READBP   2283
            GENCKT=' '                                                  READBP   2284
            GENCKT(2:2)=LINE(66:66)                                     READBP   2285
          ELSEIF (JRECB.GT.0)THEN                                       READBP   2286
            MT1=0                                                       READBP   2287
            READ(IU31,REC=JRECB)LINE                                    READBP   2288
C                                                                       READBP   2289
            NVSEN1=LFSBRF(I)                                            READBP   2290
            NVSEN2=LFSBRT(I)                                            READBP   2291
            LCKT=' '                                                    READBP   2292
            LCKT(2:2)=LINE(79:79)                                       READBP   2293
          ELSE                                                          READBP   2294
            MT1=1                                                       READBP   2295
            READ(IU31,REC=JRECC)LINE                                    READBP   2296
            NVSEN1=LFSCR(I)                                             READBP   2297
          ENDIF                                                         READBP   2298
C                                                                       READBP   2299
          READ(LINE,4110) KS1,TS7,TS8,TS9,TS13,TS14,KS3,VSCCSM          READBP   2300
C                                                                       READBP   2301
          IF(TS14.EQ.0.0)THEN                                           READBP   2302
            WRITE(MSG(1),4120)                                          READBP   2303
            MSG(2)=LINE                                                 READBP   2304
            CALL PRTMSG(2)                                              READBP   2305
            LINE='READBP: SVC DATA ERROR'                               READBP   2306
            CALL ASTOP (LINE,22)                                        READBP   2307
          ENDIF                                                         READBP   2308
C                                                                       READBP   2309
          IF(TS13.NE.TS14) KS3=KS3*TS13/TS14                            READBP   2310
C                                                                       READBP   2311
          MT2=-1                                                        READBP   2312
          IF(JRECD.GT.0)THEN                                            READBP   2313
            MT2=0                                                       READBP   2314
            READ(IU31,REC=JRECD)LINE                                    READBP   2315
          ELSEIF(JRECE.GT.0)THEN                                        READBP   2316
            MT2=1                                                       READBP   2317
            READ(IU31,REC=JRECE)LINE                                    READBP   2318
          ELSEIF(JRECF.GT.0)THEN                                        READBP   2319
            MT2=2                                                       READBP   2320
            READ(IU31,REC=JRECF)LINE                                    READBP   2321
          ELSE                                                          READBP   2322
            KS2=0.0                                                     READBP   2323
            TS10=0.05                                                   READBP   2324
            TS11=0.01                                                   READBP   2325
            TS12=0.05                                                   READBP   2326
          ENDIF                                                         READBP   2327
C                                                                       READBP   2328
          IF(MT2.EQ.-1)THEN                                             READBP   2329
            MT2=0                                                       READBP   2330
          ELSE                                                          READBP   2331
            READ(LINE,4130)KS2,TS10,TS11,TS12                           READBP   2332
          ENDIF                                                         READBP   2333
C                                                                       READBP   2334
          SVCDA(24)=KS1                                                 READBP   2335
          SVCDA(25)=TS7                                                 READBP   2336
          SVCDA(26)=TS8                                                 READBP   2337
          SVCDA(27)=TS9                                                 READBP   2338
          SVCDA(28)=TS14                                                READBP   2339
          SVCDA(29)=KS3                                                 READBP   2340
          SVCDA(30)=VSCCSM                                              READBP   2341
          SVCDA(31)=KS2                                                 READBP   2342
          SVCDA(32)=TS10                                                READBP   2343
          SVCDA(33)=TS11                                                READBP   2344
          SVCDA(34)=TS12                                                READBP   2345
C                                                                       READBP   2346
        ENDIF                                                           READBP   2347
C                                                                       READBP   2348
        CALL STSVCD                                                     READBP   2349
C                                                                       READBP   2350
 900  CONTINUE                                                          READBP   2351
C                                                                       READBP   2352
      CALL CLOSEF(IU31)                                                 READBP   2353
C                                                                       READBP   2354
      GOTO 9990                                                         READBP   2355
C-----------------------------------------------------------------------READBP   2356
C                          Error message for incorrect record identifierREADBP   2357
C                                                                       READBP   2358
9900  MSG(1)=' *** ERROR - INVALID RECORD IDENTIFIER IN THE'//          READBP   2359
     +       ' FOLLOWING CARD.'                                         READBP   2360
      MSG(2)=LINE                                                       READBP   2361
      CALL PRTMSG(2)                                                    READBP   2362
      IF(RDMODS)THEN                                                    READBP   2363
        LINE='READBP: CHECK COLUMN 3 IN DYN MOD CARDS'                  READBP   2364
        CALL ASTOP (LINE,39)                                            READBP   2365
      ELSE                                                              READBP   2366
        LINE='READBP: CHECK COLUMN 3 IN BPA/NEW DYNAMIC DATA CARDS'     READBP   2367
        CALL ASTOP (LINE,52)                                            READBP   2368
      ENDIF                                                             READBP   2369
C                                                                       READBP   2370
9990  RETURN                                                            READBP   2371
C                                                                       READBP   2372
 1000 FORMAT(' *** ERROR READING THE FOLLOWING DYNAMIC DATA CARD:')     READBP   2373
 1010 FORMAT(' *** ERROR READING THE FOLLOWING MACHINE DATA CARD:')     READBP   2374
 1020 FORMAT(' *** ERROR UNKNOWN CARD TYPE:')                           READBP   2375
 1040 FORMAT(1X,'MACHINE DATA CARD ',/,1X,A80)                          READBP   2376
 1060 FORMAT(1X,'EXCITER DATA CARD ',/,1X,A80)                          READBP   2377
 1080 FORMAT(1X,'STABILIZER DATA CARD ',/,1X,A80)                       READBP   2378
 1090 FORMAT(1X,'GOVERNOR DATA CARD ',/,1X,A80)                         READBP   2379
 1100 FORMAT(1X,'DEBUG (READBP) DETAIL MACHINE ',A2,' BUS :',A12,       READBP   2380
     1       /,1X,F7.1,3F8.2,11F8.3)                                    READBP   2381
 1120 FORMAT(1X,'DEBUG (READBP) DETAIL MACHINE SUB TRANSIENT  ',A2,     READBP   2382
     1       ' BUS :',A15,/,1X,F6.1,F4.2,I4,A3,F7.1,4(1X,F7.3))         READBP   2383
 1180 FORMAT(' *** WARNING TURBINE MODEL CONVERSION FOR BUS ',A13       READBP   2384
     *,'. FAILED.')                                                     READBP   2385
 1181 FORMAT(5X,'NO GOVERNOR OR TURBINE MODEL WILL BE',                 READBP   2386
     2       ' REPRESENTED FOR THIS MACHINE.')                          READBP   2387
 1190 FORMAT(' *** ERROR THE BUS IS NOT IN THE LOAD FLOW DATA SKIPPED.')READBP   2388
 1200 FORMAT(' *** WARNING MACHINE SATURATION CONVERSION ERROR')        READBP   2389
 1201 FORMAT(5X,'CHECK MACHINE DATA FOR : ',A12)                        READBP   2390
 1240 FORMAT(1X,'+++++++++++++++++++++++++++++++++++++',/,1X,A80)       READBP   2391
 1250 FORMAT(BZ,T4,A12,T17,F6.0,T23,F3.2,T26,F3.2,T29,F4.0,T33,F4.4,    READBP   2392
     1       T37,F5.4,T42,F5.4,T47,F5.4,T52,F5.4,T57,F4.2,              READBP   2393
     1       T61,F3.2,T64,F5.4,T69,F5.4,T74,F4.3,T78,F3.2)              READBP   2394
 1260 FORMAT(BZ,T17,F5.1,T23,F3.2,T27,I3,T31,A2,T38,F5.4,T43,F5.4,      READBP   2395
     1       T48,F4.4,T52,F4.4)                                         READBP   2396
 1310 FORMAT(A80)                                                       READBP   2397
 1350 FORMAT(1X,12I8)                                                   READBP   2398
 1360 FORMAT(' *** ERROR TOO MANY GENERATORS')                          READBP   2399
 1370 FORMAT(' *** ERROR TOO MANY LOAD SHEDDING BUSES')                 READBP   2400
 1380 FORMAT(' *** ERROR READING THE FOLLOWING LOAD SHED DATA CARD:')   READBP   2401
 1390 FORMAT(' *** ERROR FOLLOWING LOAD SHED DATA CARD NOT READY :')    READBP   2402
 1400 FORMAT(' *** ERROR TOO MANY RELAY BUSES')                         READBP   2403
 2020 FORMAT(16X,4(F5.3,F3.0,F2.0,F3.3))                                READBP   2404
 2030 FORMAT(' *** ERROR READING THE FOLLOWING RELAY DATA CARD :')      READBP   2405
 2040 FORMAT(' *** ERROR FOLLOWING RELAY DATA CARD NOT READY :')        READBP   2406
 2050 FORMAT(33X,2(F5.5,F5.2,F5.5,F5.2),F5.2)                           READBP   2407
 2060 FORMAT(' *** RELAY SCHEME EXCEEDS THE LIMIT OF ',I3)              READBP   2408
 2090 FORMAT(' *** ERROR TOO MANY INDUCTION MOTORS')                    READBP   2409
 3020 FORMAT(' *** SUM OF MULTIPLIERS FOR NONLINEAR LOAD IS NOT 1.0 ',  READBP   2410
     +       '- DATA IS IGNORED')                                       READBP   2411
 3030 FORMAT(BZ,27X,10F5.3)                                             READBP   2412
 3060 FORMAT(BZ,T17,F6.0,T23,F3.2,T29,F4.0,T33,F5.4,T38,F5.4,T43,F5.4,  READBP   2413
     1 T48,F5.4,T53,F5.4,T58,F3.2,T61,F4.2,T65,F5.4,T70,F5.4)           READBP   2414
 3080 FORMAT(' *** ERROR TOO MANY SVCS')                                READBP   2415
 3090 FORMAT(' *** ERROR SVC CONTROL TYPE')                             READBP   2416
 4000 FORMAT(' *** ERROR FIRST CARD OF SVC DATA MISSING')               READBP   2417
 4010 FORMAT(16X,2F3.3,2F4.4,2X,2F3.3,2F4.0,2F4.3,2F4.2,2F3.3)          READBP   2418
 4020 FORMAT(' *** ERROR SVC GAIN KSVS MUST BE LARGER THAN 0')          READBP   2419
 4030 FORMAT(' *** ERROR SVC QL MUST BE LARGER THAN ZERO AND            READBP   2420
     1 QC NON-NEGATIVE')                                                READBP   2421
 4040 FORMAT(' *** ERROR REMOTE RELAY NOT READY')                       READBP   2422
 4050 FORMAT(' *** ERROR CONTROLLING RELAY DOES NOT EXIST FOR ',        READBP   2423
     +       'REMOTE RELAY')                                            READBP   2424
 4070 FORMAT(' *** ERROR TOO MANY REMOTE RELAYS. MAX 15')               READBP   2425
 4080 FORMAT(' *** ERROR KEY WORD AT COLUMN 34 OF REMOTE RELAY CARD'    READBP   2426
     *,' NOT RECOGNIZABLE')                                             READBP   2427
 4110 FORMAT(16X,F4.0,3F4.4,2X,3F4.2,F4.3)                              READBP   2428
 4120 FORMAT(' *** ERROR SVC WASHOUT TIME CONSTANT TS14 ',              READBP   2429
     +       ' MUST BE NON-ZERO')                                       READBP   2430
 4130 FORMAT (16X,F4.0,3F4.4)                                           READBP   2431
 4140 FORMAT (16X,8F6.0)                                                READBP   2432
 4150 FORMAT(' *** ERROR - VZ CARD IS MISSING FOR THE FOLLOWING SVC')   READBP   2433
 5000 FORMAT(62X,3F6.5)                                                 READBP   2434
 5100 FORMAT('MLI',1X,2A12,A1,3X,3F8.3)                                 READBP   2435
 5200 FORMAT('DLI',1X,2A12,A1,41X,F10.5)                                READBP   2436
 5300 FORMAT('RLI',1X,2A12,A1)                                          READBP   2437
 5400 FORMAT('SLD',1X,A12,I5,2F8.3,33X,F10.5)                           READBP   2438
 5500 FORMAT(3X,F3.0,56X,F6.5)                                          READBP   2439
 5600 FORMAT(3X,F3.0,62X,F6.5)                                          READBP   2440
 5700 FORMAT('GM ',1X,A12,1X,A2,2X,F8.3)                                READBP   2441
 5800 FORMAT(3X,F3.0)                                                   READBP   2442
 6000 FORMAT(' *** ERROR - BUS/AREA/ZONE NOT IN LOAD FLOW',             READBP   2443
     +       ' - DATA IS IGNORED')                                      READBP   2444
 6100 FORMAT(' *** WARNING - TRANSIENT STABILIZER MODEL IS OBSOLETE',   READBP   2445
     +       ' - DATA IS IGNORED')                                      READBP   2446
 6200 FORMAT(' *** WARNING - A TURBINE MODEL IS NOT REPRESENTED')       READBP   2447
 6300 FORMAT('     FOR THE GOVERNOR ON GENERATOR ',A13)                 READBP   2448
 7000 FORMAT(A80)                                                       READBP   2449
 7100 FORMAT(' *** WARNING - BPA(NEW) DYNAMIC DATA CANNOT BE WRITTEN ') READBP   2450
 7200 FORMAT('     OUT IN EPRI(OLD) FORMAT.')                           READBP   2451
      END                                                               READBP   2452
C                                                                       READBP   2453
      SUBROUTINE EPLSB2(IPTR,JREC,NTLSD,JTYPE,JFLAG,IERR)               READBP   2454
      INCLUDE 'PARX.INS'                                                READBP   2455
      INCLUDE 'CNUNIT.INS'                                              READBP   2456
C                                                                       READBP   2457
      CHARACTER*80 LINE1                                                READBP   2458
C                                                                       READBP   2459
      INTEGER MX2(NM),MC(NM),MF(NM),EXCEP(NM),EXCIE(NM),IEEEX(NM)       READBP   2460
      INTEGER STAB(NM),GOV(NM),TB(NM)                                   READBP   2461
C                                                                       READBP   2462
      INTEGER NTHREL(NB/3)                                              READBP   2463
      INTEGER RLBUS1(NB/3),RLBUS2(NB/3)                                 READBP   2464
      INTEGER NTHMOT(NMT),MOTBUS(NMT)                                   READBP   2465
      INTEGER LSVCBN(NB),LSVC(NSR),LSVCZ(NSR),LSVCA(NSR),LSVCB(NSR)     READBP   2466
      INTEGER LSVCC(NSR),LSVCD(NSR),LSVCE(NSR),LSVCF(NSR)               READBP   2467
      INTEGER LFSVCO(NSR),LFSVCR(NSR),LFSAR(NSR),LFSBRF(NSR)            READBP   2468
      INTEGER LFSBRT(NSR),LFSCR(NSR),ITHGEN(20)                         READBP   2469
C                                                                       READBP   2470
*IF -MI2                                                                READBP   2471
      INTEGER*2 IFSLSD,INXLSD,ILSREC,IRRREC,IBSNLD,IZNNLD,IARNLD        READBP   2472
*ENDIF                                                                  READBP   2473
C                                                                       READBP   2474
      COMMON /SCRAT3/ MX2,MC,MF,EXCEP,EXCIE,IEEEX,STAB,GOV,TB           READBP   2475
     +               ,NTHREL,RLBUS1,RLBUS2                              READBP   2476
     +               ,IBSNLD(NB),IZNNLD(JZN),IARNLD(JAR),NTHMOT,MOTBUS  READBP   2477
     +               ,LSVCBN,LSVC,LSVCZ,LSVCA,LSVCB,LSVCC,LSVCD,LSVCE   READBP   2478
     +               ,LSVCF,LFSVCO,LFSVCR,LFSAR,LFSBRF                  READBP   2479
     +               ,LFSBRT,LFSCR,ITHGEN                               READBP   2480
     +               ,IFSLSD(NB),INXLSD(MAXSET),ILSREC(MAXSET)          READBP   2481
     +               ,IRRREC(15*MAXSET)                                 READBP   2482
C                                                                       READBP   2483
      IERR=0                                                            READBP   2484
C                                                                       READBP   2485
        IF(IFSLSD(IPTR).EQ.0)THEN                                       READBP   2486
        NTLSD=NTLSD+1                                                   READBP   2487
        IF(NTLSD.GT.MAXSET)THEN                                         READBP   2488
        IERR=1                                                          READBP   2489
        RETURN                                                          READBP   2490
        ENDIF                                                           READBP   2491
        IFSLSD(IPTR)=NTLSD                                              READBP   2492
        ILSREC(NTLSD)=JREC                                              READBP   2493
        ELSE                                                            READBP   2494
        II=IFSLSD(IPTR)                                                 READBP   2495
 381    JJREC=ILSREC(II)                                                READBP   2496
        READ(IU31,REC=JJREC) JJFLAG,JJTYPE,LINE1                        READBP   2497
        IF(JJTYPE.EQ.JTYPE.AND.JJFLAG.LE.JFLAG)THEN                     READBP   2498
          ILSREC(II)=JREC                                               READBP   2499
          RETURN                                                        READBP   2500
        ENDIF                                                           READBP   2501
        IF(INXLSD(II).NE.0)THEN                                         READBP   2502
          II=INXLSD(II)                                                 READBP   2503
          GOTO 381                                                      READBP   2504
        ELSE                                                            READBP   2505
          NTLSD=NTLSD+1                                                 READBP   2506
          IF(NTLSD.GT.MAXSET)THEN                                       READBP   2507
          IERR=1                                                        READBP   2508
          RETURN                                                        READBP   2509
          ENDIF                                                         READBP   2510
          INXLSD(II)=NTLSD                                              READBP   2511
          ILSREC(NTLSD)=JREC                                            READBP   2512
        ENDIF                                                           READBP   2513
      ENDIF                                                             READBP   2514
C                                                                       READBP   2515
      RETURN                                                            READBP   2516
      END                                                               READBP   2517
      SUBROUTINE EPLOSP(JNLD,IREC,JTLN,LINE                             READBP   2518
     &                  ,ICCP,ICPP,KP1,A1,ICCQ,ICPQ,KQ1,B1              READBP   2519
     &                   ,AP1,AQ1,AP2,AQ2,AP3,AQ3,AP4,AQ4,ALDP,ALDQ)    READBP   2520
C                                                                       READBP   2521
      INCLUDE 'PARX.INS'                                                READBP   2522
      INCLUDE 'CNJDAT.INS'                                              READBP   2523
      INCLUDE 'CNUNIT.INS'                                              READBP   2524
C                                                                       READBP   2525
      CHARACTER*80 LINE                                                 READBP   2526
C                                                                       READBP   2527
        READ(IU31,REC=IREC) LINE                                        READBP   2528
        READ(LINE,3030)AP1,AQ1,AP2,AQ2,AP3,AQ3,AP4,AQ4,ALDP,ALDQ        READBP   2529
        IF(LINE(2:2).EQ.'A')THEN                                        READBP   2530
          ICCP=AP2*100                                                  READBP   2531
          ICPP=AP3*100                                                  READBP   2532
          KP1=AP4*100                                                   READBP   2533
          A1=0.0                                                        READBP   2534
          ICCQ=AQ2*100                                                  READBP   2535
          ICPQ=AQ3*100                                                  READBP   2536
          KQ1=AQ4*100                                                   READBP   2537
          B1=0.0                                                        READBP   2538
        ELSE                                                            READBP   2539
          ICCP=0                                                        READBP   2540
          ICPP=0                                                        READBP   2541
          KP1=100                                                       READBP   2542
          A1=2.0*AP1+AP2                                                READBP   2543
          ICCQ=0                                                        READBP   2544
          ICPQ=0                                                        READBP   2545
          KQ1=100                                                       READBP   2546
          B1=2.0*AQ1+AQ2                                                READBP   2547
        ENDIF                                                           READBP   2548
        JNLD=JNLD+1                                                     READBP   2549
        IF(JNLD.GT.NZL)THEN                                             READBP   2550
          LINE='READEP: YOU HAVE TOO MANY NONLINEAR LOAD SPECIFICATIONS'READBP   2551
          CALL ASTOP(LINE,55)                                           READBP   2552
        ENDIF                                                           READBP   2553
        JJNLD(JNLD)=JTLN                                                READBP   2554
      RETURN                                                            READBP   2555
 3030 FORMAT(BZ,27X,10F5.3)                                             READBP   2556
      END                                                               READBP   2557
