CFPRIME FLODA2                                                          FLODA2      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 FLODA2 (LDUMP,KDEB,LFEPRI,ZILTOL,IUX,IEBK)             FLODA2      3
CD                                                                      FLODA2      4
CD    THIS SUBROUTINE READS AN OLD EPRI POWER FLOW BINARY FILE.         FLODA2      5
CD                                                                      FLODA2      6
CD    THE CODING FOR READING LOAD FLOW BINARY FILE WAS ADDOPTED FROM    FLODA2      7
CD    ETMSP VERSION 1 ROUTINE LDHIST.                                   FLODA2      8
CD                                                                      FLODA2      9
CD THE LOAD FLOW DATA IS STORED IN THE PROGRAM IN THE FOLLOWING FORM:   FLODA2     10
CD                                                                      FLODA2     11
CD BUS DATA:                                                            FLODA2     12
CD --------                                                             FLODA2     13
CD                                                                      FLODA2     14
CD LET K BE THE LOADFLOW BUS NUMBER A BUS AND JJ=MNEW(K),THEN JJ        FLODA2     15
CD CAN BE USED TO RETRIEVE INFORMATION FROM THE FOLLOWING ARRAYS.       FLODA2     16
CD                                                                      FLODA2     17
CD GMWX(NB*2)  : ARRAY STORES THE GENERATOR REAL AND REACTIVE POWER.    FLODA2     18
CD               IT IS EQUIVALANCE TO ARRAYS GMW AND GMX.               FLODA2     19
CD                                                                      FLODA2     20
CD GMW(JJ+1)   : REAL POWER OF THE GENERATOR IN MW                      FLODA2     21
CD BMX(JJ+2)   : REACTIVE POWER OF THE GENERATOR IN MVAR                FLODA2     22
CD                                                                      FLODA2     23
CD BMWX(NB*4)  : ARRAY STORES THE LOAD BUS INFORMATION. IT IS           FLODA2     24
CD               EQUIVALENCE TO ARRAYS BMW ,BMX,IBAR AND XBASKV.        FLODA2     25
CD                                                                      FLODA2     26
CD BMW(JJ+1)   : REAL POWER IN MW                                       FLODA2     27
CD BMX(JJ+2)   : REACTIVE POWER IN MVAR                                 FLODA2     28
CD IBAR(JJ+3)  : AREA AND ZONE                                          FLODA2     29
CD XBASKV(JJ+4): BASE KV                                                FLODA2     30
CD                                                                      FLODA2     31
CD BUDAT(NB8)  : ARRAY STORES THE BUS INFORMATION. IT IS EQUIVALENCE    FLODA2     32
CD               TO ARRAYS ERBUS,EIBUS,BSTC,RYGR,RIYGR AND NAMES.       FLODA2     33
CD                                                                      FLODA2     34
CD ERBUS(JJ+1) : REAL PART OF BUS VOLTAGE                               FLODA2     35
CD EIBUS(JJ+2) : IMAGINARY PART OF BUS VOLTAGE                          FLODA2     36
CD BSTC(JJ+3)  : SWITCHING SHUNT                                        FLODA2     37
CD RYGR(JJ+4)  : REAL PART OF BUS SHUNT                                 FLODA2     38
CD RIYGR(JJ+5) : IMAGINARY PART OF BUS SHUNT                            FLODA2     39
CD NAMES(JJ+6) : FIRST 4 CHARACTERS OF THE BUS NAME                     FLODA2     40
CD NAMES(JJ+7) : SECOND 4 CHARACTERS OF THE BUS NAME                    FLODA2     41
CD NAMES(JJ+8) : LAST 4 CHARACTERS OF THE BUS NAME                      FLODA2     42
CD                                                                      FLODA2     43
CD                                                                      FLODA2     44
CD BRANCH DATA:                                                         FLODA2     45
CD -----------                                                          FLODA2     46
CD                                                                      FLODA2     47
CD LET N = THE N'TH BRANCH AND  JL = 5*N - 5 ,THEN                      FLODA2     48
CD                                                                      FLODA2     49
CD GBFT(NPL*5)   :  ARRAY STORES THE LINE INFORMATION. IT IS EQUIVALENCEFLODA2     50
CD                  TO ARRAYS LFTB,GA,BA AND BCHG.                      FLODA2     51
CD LFTB(JL+1)  : CIRCUIT ID, IN SERIVE STATUS                           FLODA2     52
CD LFTB(JL+2)  : FROM AND TO BUS NO.                                    FLODA2     53
CD GA(JL+3)    : LINE ADMITTANCE                                        FLODA2     54
CD BA(JL+4)    : LINE SUSCEPTANCE                                       FLODA2     55
CD BCHG(JL+5)  : LINE CHARGING                                          FLODA2     56
CD                                                                      FLODA2     57
CD ITRAN(NTR)    :  ARRAY STORES THE LOAD FLOW BUS NO. TRANSFORMER      FLODA2     58
CD ITRORD(NTR)   :  RESERVE FOR FUTURE USE                              FLODA2     59
CD TRANS(NTRX2)  :  ARRAY STORES THE TRANSFORMER INFORMATION.           FLODA2     60
CD                  IT IS EQUIVALENCE TO ARRAYS RANG AND RATIO          FLODA2     61
CD                                                                      FLODA2     62
CD LET N = THE N'TH TRANFORMER  AND JL = 2*N-2, THEN                    FLODA2     63
CD                                                                      FLODA2     64
CD RATIO(JL+1) : TRANSFORMER ONR                                        FLODA2     65
CD RANG(JL+2)  : PHASE SHIFTER ANGLE                                    FLODA2     66
CD                                                                      FLODA2     67
CD                                                                      FLODA2     68
CD ONRX(NB*9/6) :  ARRAY STORES THE ULTC INFORMATION. IT IS             FLODA2     69
CD                 EQUIVALENCE TO ARRAYS ISCFRM,ISCTO,ISCCID,           FLODA2     70
CD                 ISCCON, ONRMAX,ONRMIN,VOLMAX,VOLMIN AND STEP.        FLODA2     71
CD                                                                      FLODA2     72
CD LET N = THE N'TH ULTC AND  JL = 9*N-9, THEN                          FLODA2     73
CD                                                                      FLODA2     74
CD ISCFRM(JL+1) : FROM-BUS NO.                                          FLODA2     75
CD ISCTO(JL+2)  : TO-BUS NO.                                            FLODA2     76
CD ISCCID(JL+3) : CIRCUIT ID                                            FLODA2     77
CD ISCCON(JL+4) : CONTROL BUS NO.                                       FLODA2     78
CD ONRMAX(JL+5) : MAXIMUM ONR                                           FLODA2     79
CD ONRMIN(JL+6) : MINIMUM ONR                                           FLODA2     80
CD VOLMAX(JL+7) : MAXIMUM ULTC VOLTAGE                                  FLODA2     81
CD VOLMIN(JL+8) : MINUMUM ULTC VOLTAGE                                  FLODA2     82
CD STEP(JL+9)   : ULTC STEP SIZE                                        FLODA2     83
CD                                                                      FLODA2     84
CD CORTBL(220)   : ARRAY STORE THE IMPEDANCE CORRECTION TABLE           FLODA2     85
CD                                                                      FLODA2     86
CD                                                                      FLODA2     87
CD                                                                      FLODA2     88
      CHARACTER*80 LINE                                                 FLODA2     89
C                                                                       FLODA2     90
C-----------------------------------------------------------------------FLODA2     91
      INCLUDE 'PARX.INS'                                                FLODA2     92
      INCLUDE 'EPBUS.INS'                                               FLODA2     93
      PARAMETER (JZN0ZZ=100,JAR0ZZ=60)                                  FLODA2     94
      PARAMETER ( JARLT=10*JAR0ZZ,JDC1=10,JDC2=2*JDC1 )                 FLODA2     95
      PARAMETER ( JL1=2*JBB,JL2=2*JL1,JT=JBB/4)                         FLODA2     96
C                                                                       FLODA2     97
      DIMENSION JARE(JAR0ZZ,3),JNTARA(JAR0ZZ)                           FLODA2     98
     &       ,JNAMZN(JZN0ZZ)  ,JNTZON(JZN0ZZ)                           FLODA2     99
      EQUIVALENCE (JNTARA(1),INTARA(1)),(JNAMZN(1),NAMZN(1,1))          FLODA2    100
      EQUIVALENCE (JNTZON(1),INTZON(1)),(JARE(1,1),IARE(1,1))           FLODA2    101
C                                                                       FLODA2    102
      DIMENSION         IXCROS(JBB),   JBUSI(JBB),    JISLND(JBB),      FLODA2    103
     2   KIND(JBB),     NBNEWI(JBB),   EA(JBB),       EB(JBB),          FLODA2    104
     3   BKV(JBB),      BSR(JBB),      GSR(JBB),      NARE(JBB),        FLODA2    105
     4   PL(JBB),       QL(JBB)                                         FLODA2    106
C                                                                       FLODA2    107
C                                                                       FLODA2    108
C                                                                       FLODA2    109
      DIMENSION        LTIE(JARLT),   NSLACK(JAR0ZZ),    DFLOW(JAR0ZZ)  FLODA2    110
C                                                                       FLODA2    111
      DIMENSION         IDCBUS(JDC2),  IDCEX(JDC1),   IDCINT(JDC1),     FLODA2    112
     1   IDCROW(JDC1),  ILTBLD(JDC1),  KMODDC(JDC2),  LMOD(JDC2),       FLODA2    113
     2   LPDC(JDC2),    NEWDC1(JDC2),  NEWDC2(JDC2),  NPDC(JDC2),       FLODA2    114
     3   MLTBLD(JDC1),  NLTBLD(JDC1),  KEYDCC(JDC1),                    FLODA2    115
     4   KBMODC(JDC1)                                                   FLODA2    116
C                                                                       FLODA2    117
      DIMENSION         MKSWX(100),    PGM(5),        TLE(54),          FLODA2    118
     1   TITLE(54)                                                      FLODA2    119
C                                                                       FLODA2    120
      DIMENSION         DALFMN(20),    DAPHST(20),    DBRIDG(20),       FLODA2    121
     1   DCOMVL(20),    DCUR(10),      DDBASE(20),    DDCKV(20),        FLODA2    122
     2   DDCMW(20),     DDCOUT(10),    DDCVRT(10),    DDIRAT(20),       FLODA2    123
     3   DDTRKV(20),    DFARAD(10),    DFLTDT(20),    DGAMIN(10),       FLODA2    124
     4   DHENRY(10),    DHENSR(20),    DPDCDS(10),    DPGEN(20),        FLODA2    125
     5   DQGEN(20),     DROHM(20),     DTCLMX(20),    DTLOHM(10),       FLODA2    126
     6   DTR(20),       DVDROP(20),    DVPROJ(20),    DXOHM(20)         FLODA2    127
C                                                                       FLODA2    128
C     PUT THE ABOVE ARRAYS IN A SCRATCH COMMON SO THE MEMORY CAN BE REUSFLODA2    129
C                                                                       FLODA2    130
         COMMON /SCRAT0/ LCIRC(JL1),LKIND(JL1),                         FLODA2    131
     1   B(JL1),G(JL1),PBC1(JL1),PBC2(JL1),PGC1(JL1),PGC2(JL1)          FLODA2    132
C                                                                       FLODA2    133
      COMMON /SCRAT6/                                                   FLODA2    134
     1   IBSOUT(200),LINAB(JL2),LINDX(JL2),LTRA(JT),                    FLODA2    135
     2   LTRB(JT),SWBSR(100),TAP(JT),                                   FLODA2    136
     &   MKSWX,TLE,TITLE,LTIE,NSLACK,DFLOW,                             FLODA2    137
C                                                                       FLODA2    138
     &   IDCBUS,IDCEX,IDCINT,IDCROW,ILTBLD,KMODDC,LMOD,                 FLODA2    139
     2   LPDC,NEWDC1,NEWDC2,NPDC,MLTBLD,NLTBLD,KEYDCC,KBMODC,           FLODA2    140
C                                                                       FLODA2    141
     &   DALFMN,DAPHST,DBRIDG,DCOMVL,DCUR,DDBASE,DDCKV,                 FLODA2    142
     2   DDCMW,DDCOUT,DDCVRT,DDIRAT,DDTRKV,DFARAD,DFLTDT,DGAMIN,        FLODA2    143
     4   DHENRY,DHENSR,DPDCDS,DPGEN,DQGEN,DROHM,DTCLMX,DTLOHM,          FLODA2    144
     6   DTR,DVDROP,DVPROJ,DXOHM,BKV,BSR,ZCX,Y1CX,Y2CX                  FLODA2    145
C                                                                       FLODA2    146
          COMMON /SCRAT3/                                               FLODA2    147
     &    EA,EB,IXCROS,JBUSI,JISLND,KIND,METR,GSR,PL,QL,XXEA,XXEB       FLODA2    148
     &   ,XXPG,XXQG,NARE,NBNEWI                                         FLODA2    149
C                                                                       FLODA2    150
      INTEGER*4 JZONE                                                   FLODA2    151
      CHARACTER*4 CZONE                                                 FLODA2    152
      EQUIVALENCE (JZONE,CZONE)                                         FLODA2    153
C                                                                       FLODA2    154
      INTEGER*2 METR                                                    FLODA2    155
      DIMENSION METR(JL1)                                               FLODA2    156
      DOUBLE PRECISION XXEA(JBB),XXEB(JBB),XXPG(JBB),XXQG(JBB)          FLODA2    157
C                                                                       FLODA2    158
C--------------------------------------------------------------------   FLODA2    159
C                                                                       FLODA2    160
      INCLUDE 'CNPARX.INS'                                              FLODA2    161
C                                                                       FLODA2    162
      COMPLEX ZCX(20),Y1CX(20),Y2CX(20)                                 FLODA2    163
C                                                                       FLODA2    164
      INCLUDE 'CNMNEW.INS'                                              FLODA2    165
      INCLUDE 'CNB19.INS'                                               FLODA2    166
      INCLUDE 'CNLFDA.INS'                                              FLODA2    167
      INCLUDE 'CNSELI.INS'                                              FLODA2    168
      INCLUDE 'CNREC1.INS'                                              FLODA2    169
      INCLUDE 'CNPT.INS'                                                FLODA2    170
      INCLUDE 'CNIPTR.INS'                                              FLODA2    171
      INCLUDE 'CNFLAG.INS'                                              FLODA2    172
      INCLUDE 'CNUNIT.INS'                                              FLODA2    173
C                                                                       FLODA2    174
      INCLUDE 'GRDC01.INS'                                              FLODA2    175
      INCLUDE 'GRDC03.INS'                                              FLODA2    176
      INCLUDE 'GRPDCS.INS'                                              FLODA2    177
      INCLUDE 'UDCF.INS'                                                FLODA2    178
      INCLUDE 'CNMSG.INS'                                               FLODA2    179
C                                                                       FLODA2    180
      INTEGER*4 JCKID                                                   FLODA2    181
      CHARACTER*2 CKID,IALFA(37)                                        FLODA2    182
      CHARACTER*8 NCONV(100)                                            FLODA2    183
C                                                                       FLODA2    184
      DIMENSION JDCC(NDCC)                                              FLODA2    185
C                                                                       FLODA2    186
      LOGICAL FOUND,LDEB1                                               FLODA2    187
C                                                                       FLODA2    188
      DATA CZONE/'    '/                                                FLODA2    189
C                                                                       FLODA2    190
      DATA              FLAG1/-1.0/,             JEND/9999/             FLODA2    191
      DATA              IVER1 / 5 /,             MAXBS/JBB/             FLODA2    192
      DATA              IPACK /65536/                                   FLODA2    193
      DATA IALFA/'  ','0 ','1 ','2 ','3 ','4 ','5 ','6 ','7 ','8 '      FLODA2    194
     &,'9 ','A ', 'B ','C ','D ','E ','F ','G ','H ','I ','J ','K '     FLODA2    195
     &,'L ','M ','N ','O ','P ','Q ','R ','S ','T ','U ','V ','W '      FLODA2    196
     &,'X ','Y ', 'Z '/                                                 FLODA2    197
C                                                                       FLODA2    198
      DATA (NCONV(I),I=1,52)/                                           FLODA2    199
     &           'REC01   ',  'INV01   ',  'REC02   ',  'INV02   ',     FLODA2    200
     &           'REC03   ',  'INV03   ',  'REC04   ',  'INV04   ',     FLODA2    201
     &           'REC05   ',  'INV05   ',  'REC06   ',  'INV06   ',     FLODA2    202
     &           'REC07   ',  'INV07   ',  'REC08   ',  'INV08   ',     FLODA2    203
     &           'REC09   ',  'INV09   ',  'REC10   ',  'INV10   ',     FLODA2    204
     &           'REC11   ',  'INV11   ',  'REC12   ',  'INV12   ',     FLODA2    205
     &           'REC13   ',  'INV13   ',  'REC14   ',  'INV14   ',     FLODA2    206
     &           'REC15   ',  'INV15   ',  'REC16   ',  'INV16   ',     FLODA2    207
     &           'REC17   ',  'INV17   ',  'REC18   ',  'INV18   ',     FLODA2    208
     &           'REC19   ',  'INV19   ',  'REC20   ',  'INV20   ',     FLODA2    209
     &           'REC21   ',  'INV21   ',  'REC22   ',  'INV22   ',     FLODA2    210
     &           'REC23   ',  'INV23   ',  'REC24   ',  'INV24   ',     FLODA2    211
     &           'REC25   ',  'INV25   ',  'REC26   ',  'INV26   '/     FLODA2    212
      DATA (NCONV(I),I=53,100)/                                         FLODA2    213
     &           'REC27   ',  'INV27   ',  'REC28   ',  'INV28   ',     FLODA2    214
     &           'REC29   ',  'INV29   ',  'REC30   ',  'INV30   ',     FLODA2    215
     &           'REC31   ',  'INV31   ',  'REC32   ',  'INV32   ',     FLODA2    216
     &           'REC33   ',  'INV33   ',  'REC34   ',  'INV34   ',     FLODA2    217
     &           'REC35   ',  'INV35   ',  'REC36   ',  'INV36   ',     FLODA2    218
     &           'REC37   ',  'INV37   ',  'REC38   ',  'INV38   ',     FLODA2    219
     &           'REC39   ',  'INV39   ',  'REC40   ',  'INV40   ',     FLODA2    220
     &           'REC41   ',  'INV41   ',  'REC42   ',  'INV42   ',     FLODA2    221
     &           'REC43   ',  'INV43   ',  'REC44   ',  'INV44   ',     FLODA2    222
     &           'REC45   ',  'INV45   ',  'REC46   ',  'INV46   ',     FLODA2    223
     &           'REC47   ',  'INV47   ',  'REC48   ',  'INV48   ',     FLODA2    224
     &           'REC49   ',  'INV49   ',  'REC50   ',  'INV50   '/     FLODA2    225
CD                                                                      FLODA2    226
CD THE LOAD FLOW DATA IS STORED IN THE PROGRAM IN THE FOLLOWING FORM:   FLODA2    227
CD                                                                      FLODA2    228
CD BUS DATA:                                                            FLODA2    229
CD --------                                                             FLODA2    230
CD                                                                      FLODA2    231
CD LET K BE THE LOADFLOW BUS NUMBER A BUS AND JJ=MNEW(K),THEN JJ        FLODA2    232
CD CAN BE USED TO RETRIEVE INFORMATION FROM THE FOLLOWING ARRAYS.       FLODA2    233
CD                                                                      FLODA2    234
CD GMWX(NB*2)  : ARRAY STORES THE GENERATOR REAL AND REACTIVE POWER.    FLODA2    235
CD               IT IS EQUIVALANCE TO ARRAYS GMW AND GMX.               FLODA2    236
CD                                                                      FLODA2    237
CD GMW(JJ+1)   : REAL POWER OF THE GENERATOR IN MW                      FLODA2    238
CD BMX(JJ+2)   : REACTIVE POWER OF THE GENERATOR IN MVAR                FLODA2    239
CD                                                                      FLODA2    240
CD BMWX(NB*4)  : ARRAY STORES THE LOAD BUS INFORMATION. IT IS           FLODA2    241
CD               EQUIVALENCE TO ARRAYS BMW ,BMX,IBAR AND XBASKV.        FLODA2    242
CD                                                                      FLODA2    243
CD BMW(JJ+1)   : REAL POWER IN MW                                       FLODA2    244
CD BMX(JJ+2)   : REACTIVE POWER IN MVAR                                 FLODA2    245
CD IBAR(JJ+3)  : AREA AND ZONE                                          FLODA2    246
CD XBASKV(JJ+4): BASE KV                                                FLODA2    247
CD                                                                      FLODA2    248
CD BUDAT(NB8)  : ARRAY STORES THE BUS INFORMATION. IT IS EQUIVALENCE    FLODA2    249
CD               TO ARRAYS ERBUS,EIBUS,BSTC,RYGR,RIYGR AND NAMES.       FLODA2    250
CD                                                                      FLODA2    251
CD ERBUS(JJ+1) : REAL PART OF BUS VOLTAGE                               FLODA2    252
CD EIBUS(JJ+2) : IMAGINARY PART OF BUS VOLTAGE                          FLODA2    253
CD BSTC(JJ+3)  : SWITCHING SHUNT                                        FLODA2    254
CD RYGR(JJ+4)  : REAL PART OF BUS SHUNT                                 FLODA2    255
CD RIYGR(JJ+5) : IMAGINARY PART OF BUS SHUNT                            FLODA2    256
CD NAMES(JJ+6) : FIRST 4 CHARACTERS OF THE BUS NAME                     FLODA2    257
CD NAMES(JJ+7) : SECOND 4 CHARACTERS OF THE BUS NAME                    FLODA2    258
CD NAMES(JJ+8) : LAST 4 CHARACTERS OF THE BUS NAME                      FLODA2    259
CD                                                                      FLODA2    260
CD                                                                      FLODA2    261
CD BRANCH DATA:                                                         FLODA2    262
CD -----------                                                          FLODA2    263
CD                                                                      FLODA2    264
CD LET N = THE N'TH BRANCH AND  JL = 5*N - 5 ,THEN                      FLODA2    265
CD                                                                      FLODA2    266
CD GBFT(NPL*5)   :  ARRAY STORES THE LINE INFORMATION. IT IS EQUIVALENCEFLODA2    267
CD                  TO ARRAYS LFTB,GA,BA AND BCHG.                      FLODA2    268
CD LFTB(JL+1)  : CIRCUIT ID, IN SERIVE STATUS                           FLODA2    269
CD LFTB(JL+2)  : FROM AND TO BUS NO.                                    FLODA2    270
CD GA(JL+3)    : LINE ADMITTANCE                                        FLODA2    271
CD BA(JL+4)    : LINE SUSCEPTANCE                                       FLODA2    272
CD BCHG(JL+5)  : LINE CHARGING                                          FLODA2    273
CD                                                                      FLODA2    274
CD ITRAN(NTR)    :  ARRAY STORES THE LOAD FLOW BUS NO. TRANSFORMER      FLODA2    275
CD ITRORD(NTR)   :  RESERVE FOR FUTURE USE                              FLODA2    276
CD TRANS(NTRX2)  :  ARRAY STORES THE TRANSFORMER INFORMATION.           FLODA2    277
CD                  IT IS EQUIVALENCE TO ARRAYS RANG AND RATIO          FLODA2    278
CD                                                                      FLODA2    279
CD LET N = THE N'TH TRANFORMER  AND JL = 2*N-2, THEN                    FLODA2    280
CD                                                                      FLODA2    281
CD RATIO(JL+1) : TRANSFORMER ONR                                        FLODA2    282
CD RANG(JL+2)  : PHASE SHIFTER ANGLE                                    FLODA2    283
CD                                                                      FLODA2    284
CD                                                                      FLODA2    285
CD ONRX(NB*9/6) :  ARRAY STORES THE ULTC INFORMATION. IT IS             FLODA2    286
CD                 EQUIVALENCE TO ARRAYS ISCFRM,ISCTO,ISCCID,           FLODA2    287
CD                 ISCCON, ONRMAX,ONRMIN,VOLMAX,VOLMIN AND STEP.        FLODA2    288
CD                                                                      FLODA2    289
CD LET N = THE N'TH ULTC AND  JL = 9*N-9, THEN                          FLODA2    290
CD                                                                      FLODA2    291
CD ISCFRM(JL+1) : FROM-BUS NO.                                          FLODA2    292
CD ISCTO(JL+2)  : TO-BUS NO.                                            FLODA2    293
CD ISCCID(JL+3) : CIRCUIT ID                                            FLODA2    294
CD ISCCON(JL+4) : CONTROL BUS NO.                                       FLODA2    295
CD ONRMAX(JL+5) : MAXIMUM ONR                                           FLODA2    296
CD ONRMIN(JL+6) : MINIMUM ONR                                           FLODA2    297
CD VOLMAX(JL+7) : MAXIMUM ULTC VOLTAGE                                  FLODA2    298
CD VOLMIN(JL+8) : MINUMUM ULTC VOLTAGE                                  FLODA2    299
CD STEP(JL+9)   : ULTC STEP SIZE                                        FLODA2    300
CD                                                                      FLODA2    301
CD CORTBL(220)   : ARRAY STORE THE IMPEDANCE CORRECTION TABLE           FLODA2    302
CD                                                                      FLODA2    303
CD                                                                      FLODA2    304
CD                                                                      FLODA2    305
C---------------------------------------------------------------------  FLODA2    306
C     FIRST EXECUTABLE STATEMENT FOLLOWS                                FLODA2    307
C---------------------------------------------------------------------  FLODA2    308
C                                                                       FLODA2    309
      LDEB=(JDEB(2).NE.0)                                               FLODA2    310
      LDEB1=(JDEB(280).NE.0)                                            FLODA2    311
C                                                                       FLODA2    312
      JSEL=0                                                            FLODA2    313
      NLIN=0                                                            FLODA2    314
      NOLIN=0                                                           FLODA2    315
      NDCLIN=0                                                          FLODA2    316
      NOTRA=0                                                           FLODA2    317
      ISECNX=1                                                          FLODA2    318
      NAMEX1=0                                                          FLODA2    319
      NAMEX2=0                                                          FLODA2    320
      ITRF2=0                                                           FLODA2    321
      NSEL=0                                                            FLODA2    322
      IPOS=0                                                            FLODA2    323
      I52 = 1                                                           FLODA2    324
      DEGRAD=180.0/PII                                                  FLODA2    325
      PI32=3.0*SQRT(2.0)/PII                                            FLODA2    326
      KCDC=0                                                            FLODA2    327
C                                                                       FLODA2    328
C---------------------------------------------------------------------  FLODA2    329
C     READ FROM DATA FILE FOR TAPE UNIT # (I1),RECORD#(I3), AND ID      FLODA2    330
C---------------------------------------------------------------------  FLODA2    331
C      CALL GETLIN(5,LINE)                                              FLODA2    332
C      READ (LINE,1110) I3,NAMEX1,NAMEX2                                FLODA2    333
C                                                                       FLODA2    334
C                                                                       FLODA2    335
      I1=IUX                                                            FLODA2    336
      I3=1                                                              FLODA2    337
C                                                                       FLODA2    338
C---------------------------------------------------------------------  FLODA2    339
C     CHECK THE CONTROL RECORD ON THE INPUT FILE.                       FLODA2    340
C---------------------------------------------------------------------  FLODA2    341
  100 REWIND I1                                                         FLODA2    342
      READ (I1)  FLAG, IPGM, IVER, PGM                                  FLODA2    343
C                                                                       FLODA2    344
C      IF(LDEB)THEN                                                     FLODA2    345
C         WRITE (IUD6,1180) FLAG,IPGM,IVER,PGM                          FLODA2    346
C      ENDIF                                                            FLODA2    347
C                                                                       FLODA2    348
      IF(FLAG.EQ.FLAG1)GOTO 110                                         FLODA2    349
      MSG(1)=                                                           FLODA2    350
     *' *** WARNING THE INPUT POWER FLOW HISTORY FILE DOES NOT HAVE'    FLODA2    351
      MSG(2)='              A CONTROL RECORD.'                          FLODA2    352
      CALL PRTMSG(2)                                                    FLODA2    353
      REWIND I1                                                         FLODA2    354
      GOTO 120                                                          FLODA2    355
C                                                                       FLODA2    356
  110 IF(IPGM.EQ.2)GOTO 120                                             FLODA2    357
      MSG(1)=                                                           FLODA2    358
     *' *** ERROR THE INPUT FILE IS NOT A POWER FLOW HISTORY FILE.'     FLODA2    359
      WRITE (MSG(2),1320)  PGM                                          FLODA2    360
      CALL PRTMSG(2)                                                    FLODA2    361
      GOTO 180                                                          FLODA2    362
C                                                                       FLODA2    363
C---------------------------------------------------------------------  FLODA2    364
C     *** SEARCH FOR RECORD TO BE LOADED FROM LOAD FLOW HISTORY TAPE    FLODA2    365
C---------------------------------------------------------------------  FLODA2    366
  120 READ (I1, END = 150)  I6, NRL1, NRL2, NOLIN, NLIN, NOBUS,         FLODA2    367
     1 NOTRA, TLE                                                       FLODA2    368
C                                                                       FLODA2    369
      NLFBUS=NOBUS                                                      FLODA2    370
C                                                                       FLODA2    371
C      IF(LDEB)THEN                                                     FLODA2    372
C         WRITE(IUD6,1190) I6, NRL1, NRL2, NOLIN, NLIN, NOBUS,NOTRA,TLE FLODA2    373
C      ENDIF                                                            FLODA2    374
C                                                                       FLODA2    375
      IF(I6.EQ.JEND)GOTO 150                                            FLODA2    376
C                                                                       FLODA2    377
C---------------------------------------------------------------------  FLODA2    378
C     DECODE THE VERSION KEY.                                           FLODA2    379
C---------------------------------------------------------------------  FLODA2    380
C      IF(NRL1.EQ.NAMEX1.AND.NRL2.EQ.NAMEX2)GOTO 130                    FLODA2    381
C      WRITE (MSG(1),1330)  NAMEX1, NAMEX2, NRL1, NRL2                  FLODA2    382
C      GOTO 180                                                         FLODA2    383
C                                                                       FLODA2    384
C  130 IF(I6 - I3) 140, 170, 150                                        FLODA2    385
      IF(I6 - I3) 140, 170, 150                                         FLODA2    386
C---------------------------------------------------------------------  FLODA2    387
C     THIS IS NOT THE CASE, SKIP IT.                                    FLODA2    388
C---------------------------------------------------------------------  FLODA2    389
  140 READ (I1)  USED                                                   FLODA2    390
      READ (I1)  USED                                                   FLODA2    391
      GOTO 120                                                          FLODA2    392
C                                                                       FLODA2    393
  150 IF(I52.EQ.2)GOTO 160                                              FLODA2    394
C---------------------------------------------------------------------  FLODA2    395
C     THE CASE WAS NOT FOUND. TRY AGAIN.                                FLODA2    396
C---------------------------------------------------------------------  FLODA2    397
      REWIND I1                                                         FLODA2    398
      I52 = 2                                                           FLODA2    399
      GOTO 120                                                          FLODA2    400
C                                                                       FLODA2    401
  160 WRITE (MSG(1),1340)                                               FLODA2    402
      CALL PRTMSG(1)                                                    FLODA2    403
      GOTO 180                                                          FLODA2    404
C                                                                       FLODA2    405
C---------------------------------------------------------------------  FLODA2    406
C     THE CASE HAS BEEN FOUND. CHECK IFIT EXCEEDS THE PROGRAM           FLODA2    407
C     LIMITS.                                                           FLODA2    408
C---------------------------------------------------------------------  FLODA2    409
C                                                                       FLODA2    410
  170 IF(NOBUS.LE.MAXBS)GOTO 200                                        FLODA2    411
      WRITE(MSG(1),1350) NOBUS                                          FLODA2    412
      WRITE(MSG(2),1351) MAXBS                                          FLODA2    413
      CALL PRTMSG(1)                                                    FLODA2    414
  180 WRITE (MSG(1),1360)  I1,I3,NAMEX1,NAMEX2                          FLODA2    415
      CALL PRTMSG(1)                                                    FLODA2    416
      LINE='FLODA2: EPRI LOADFLOW FILE ERROR'                           FLODA2    417
      CALL ASTOP(LINE,32)                                               FLODA2    418
C                                                                       FLODA2    419
C---------------------------------------------------------------------  FLODA2    420
C     READ THE POWER FLOW CASE.                                         FLODA2    421
C---------------------------------------------------------------------  FLODA2    422
C                                                                       FLODA2    423
  200 NNTRA = NOTRA                                                     FLODA2    424
      ITEMP = 244                                                       FLODA2    425
      IF(NOTRA.EQ.0)NNTRA = 1                                           FLODA2    426
      IF(IVER .GE.2)ITEMP = 304                                         FLODA2    427
C                                                                       FLODA2    428
C     XXPG(),XXQG(),XXEA(),and XXEB() are temporary real*8 varables usedFLODA2    429
C     read real*8 values from lf tape.They're converted back to real*4 bFLODA2    430
C                                                                       FLODA2    431
      READ (I1)  (INTNUM(I), IXCROS(I), KIND(I), USED, BKV(I),          FLODA2    432
     1    PL(I), QL(I), GSR(I), BSR(I), USED, XXPG(I), XXQG(I), USED,   FLODA2    433
     2    XXEA(I), XXEB(I), USED, USED, USED, USED, NARE(I), NBNEWI     FLODA2    434
     3    (I), INAMES(1,I), INAMES(2,I), INAMES(3,I), I = 1, NOBUS),    FLODA2    435
     4    (LINAB(I), LINDX(I), USED, I = 1, NOLIN), (LKIND(I),          FLODA2    436
     5    USED, LCIRC(I), USED, G(I), B(I), PGC1(I), PBC1(I), PGC2      FLODA2    437
     6    (I), PBC2(I), I = 1, NLIN), (LTRA(I), LTRB(I), USED,          FLODA2    438
     7    USED, TAP(I), USED, USED, USED, USED, I = 1, NNTRA)           FLODA2    439
C                                                                       FLODA2    440
C      IF(LDEB)THEN                                                     FLODA2    441
C         WRITE (IUD6,*) 'FROM RECORD 3 : '                             FLODA2    442
C         WRITE (IUD6,1200)                                             FLODA2    443
C                                                                       FLODA2    444
C         WRITE(IUD6,1210)(I,INTNUM(I),IXCROS(I),BKV(I),                FLODA2    445
C     1   PL(I),QL(I),GSR(I),BSR(I),XXPG(I),XXQG(I),                    FLODA2    446
C     2   XXEA(I),XXEB(I), I = 1, NOBUS)                                FLODA2    447
C                                                                       FLODA2    448
C         WRITE(IUD6,1220)                                              FLODA2    449
C         WRITE(IUD6,1230)(I,NARE(I), NBNEWI(I),INAMES(1,I), INAMES(2,I)FLODA2    450
C     1   INAMES(3,I),KIND(I)/IPACK,MOD(KIND(I),IPACK), I = 1, NOBUS)   FLODA2    451
C         WRITE(IUD6,1240)                                              FLODA2    452
C         WRITE(IUD6,1250) (I,LINAB(I)/IPACK,MOD(LINAB(I),IPACK),       FLODA2    453
C     1   LINDX(I), I = 1, NOLIN)                                       FLODA2    454
C                                                                       FLODA2    455
C         WRITE(IUD6,1260)                                              FLODA2    456
C         WRITE(IUD6,1270) (I,LKIND(I)/IPACK,MOD(LKIND(I),IPACK),       FLODA2    457
C     1   LCIRC(I)/IPACK,MOD(LCIRC(I),IPACK), G(I), B(I), PGC1(I),      FLODA2    458
C     1   PBC1(I), PGC2(I), PBC2(I), I = 1, NLIN)                       FLODA2    459
C         WRITE(IUD6,1280)                                              FLODA2    460
C         WRITE(IUD6,1290) (I,LTRA(I), LTRB(I),TAP(I),I = 1, NNTRA)     FLODA2    461
C      ENDIF                                                            FLODA2    462
C                                                                       FLODA2    463
      IF(IVER.EQ.3.OR.IVER.EQ.5)THEN                                    FLODA2    464
       GOTO 230                                                         FLODA2    465
      ELSE                                                              FLODA2    466
       WRITE (MSG(1),1390) IVER                                         FLODA2    467
       MSG(2)='THIS PROGRAM READS ONLY VERSIONS 3 OR 5 LOAD FLOW DATA.' FLODA2    468
       CALL PRTMSG(2)                                                   FLODA2    469
       LINE='FLODA2: EPRI LF HISTORY FILE IS NEITHER V3 OR V5'          FLODA2    470
       CALL ASTOP(LINE,48)                                              FLODA2    471
      ENDIF                                                             FLODA2    472
C                                                                       FLODA2    473
 230  CONTINUE                                                          FLODA2    474
      DO 231 I=1,100                                                    FLODA2    475
      MNEWZ(I+1)=I                                                      FLODA2    476
      NAMZN(I,2)=JZONE                                                  FLODA2    477
  231 NAMZN(I,3)=JZONE                                                  FLODA2    478
      IF(IVER.EQ.3)THEN                                                 FLODA2    479
      READ(I1)        (USED, I=1,550),                                  FLODA2    480
     1 JNAMZN , LTIE  , (USED, I=1,120), JARE , DFLOW , NSLACK,         FLODA2    481
     2 (USED, I=1,600),JNTZON, (USED, I=1,JZN0ZZ), JNTARA,              FLODA2    482
     3 (USED, I=1,JAR0ZZ),                                              FLODA2    483
     4 (USED, I=1,33), NTOTI , (USED, I=1,13), NLTOTC,                  FLODA2    484
     6 (USED, I=1,30), NUMZON, NBSOUT, USED  , NMAREA, (USED, I=1,18),  FLODA2    485
     7 IBSOUT, (USED, I=1,123),ITIECN, (USED, I=1,ITEMP),               FLODA2    486
     8 (METR(I), I=1,NLIN),                                             FLODA2    487
     9 NDCLIN, NDCBUS,   USED,   USED,   USED,   USED,   USED,          FLODA2    488
     9                                 IDCEX , (USED, I=1,10), DTLOHM,  FLODA2    489
     A (USED, I=1,10), DPDCDS, DDCVRT, DDCOUT, DGAMIN, IDCINT, DCUR  ,  FLODA2    490
     B IDCBUS, DDCKV , DDCMW , DBRIDG, DVDROP, DROHM , DXOHM , DTCLMX,  FLODA2    491
     C DALFMN, DAPHST, DCOMVL, DTR   , DVPROJ, DFLTDT, DDBASE, DPGEN ,  FLODA2    492
     D DQGEN , NEWDC1, NEWDC2, DDTRKV, DDIRAT, NSWXC ,                  FLODA2    493
     E (USED, I=1,1600),  (SWBSR(I), I=1,100),                          FLODA2    494
     F (USED, I=1,100),   (MKSWX(I), I=1,100),       (USED, I=1,200),   FLODA2    495
     G DHENSR, (USED, I=1,60), DHENRY, DFARAD                           FLODA2    496
C                                                                       FLODA2    497
C      IF(LDEB)THEN                                                     FLODA2    498
C         WRITE(IUD6,1420)                                              FLODA2    499
C     6   NDCLIN, NDCBUS,                                               FLODA2    500
C     7   IDCEX, DTLOHM,                                                FLODA2    501
C     8   DPDCDS, DDCVRT, DDCOUT, DGAMIN, IDCINT, DCUR, IDCBUS,         FLODA2    502
C     9   DDCKV, DDCMW, DBRIDG, DVDROP, DROHM, DXOHM, DTCLMX, DALFMN,   FLODA2    503
C     1   DAPHST, DCOMVL, DTR, DVPROJ, DFLTDT, DDBASE, DPGEN, DQGEN,    FLODA2    504
C     2   NEWDC1, NEWDC2, DDTRKV, DDIRAT, NSWXC                         FLODA2    505
C         WRITE(IUD6,1430) (SWBSR(I), I = 1, 100),(MKSWX(I), I = 1, 100)FLODA2    506
C         WRITE(IUD6,1440) DHENSR,DHENRY, DFARAD                        FLODA2    507
C         WRITE(IUD6,1550)NMAREA                                        FLODA2    508
C         WRITE(IUD6,1520)((IARE(I,J),J=1,3),INTARA(I),I=1,JAR)         FLODA2    509
C         WRITE(IUD6,1570)NUMZON                                        FLODA2    510
C         WRITE(IUD6,1560)(NAMZN(J),INTZON(J),J=1,JZN)                  FLODA2    511
C        ENDIF                                                          FLODA2    512
C                                                                       FLODA2    513
      IF(NDCLIN.NE.0.AND.NDCBUS.NE.0)THEN                               FLODA2    514
        WRITE(MSG(1),1590)IVER                                          FLODA2    515
        WRITE(MSG(2),1600)IVER1                                         FLODA2    516
        CALL PRTMSG(2)                                                  FLODA2    517
      LINE='FLODA2: ETMSP CANNOT ACCEPT DC MODEL IN EPRI LF V3'         FLODA2    518
      CALL ASTOP(LINE,50)                                               FLODA2    519
      ENDIF                                                             FLODA2    520
C                                                                       FLODA2    521
        GOTO 320                                                        FLODA2    522
      ENDIF                                                             FLODA2    523
C                                                                       FLODA2    524
C                                                                       FLODA2    525
      IF(IVER.EQ.5)THEN                                                 FLODA2    526
C                                                                       FLODA2    527
       READ (I1)  (USED, I = 1, 550), JNAMZN, LTIE, (USED, I = 1,       FLODA2    528
     1    120), JARE, DFLOW, NSLACK, (USED, I = 1, 600), JNTZON,        FLODA2    529
     2    (USED, I=1,JZN0ZZ), JNTARA, (USED, I=1,JAR0ZZ), (USED,        FLODA2    530
     3    I = 1, 33), NTOTI, (USED, I = 1, 13), NLTOTC, (USED,          FLODA2    531
     4    I = 1, 30), NUMZON, NBSOUT, USED, NMAREA, (USED, I =          FLODA2    532
     5    1, 18), IBSOUT, (USED, I = 1, 123), ITIECN, (USED, I =        FLODA2    533
     6    1, ITEMP),                                                    FLODA2    534
     8    (METR(I), I=1,NLIN),                                          FLODA2    535
     6                               USED, USED, USED, USED,            FLODA2    536
     2                                    NSWXC, (USED, I = 1,          FLODA2    537
     3    1600), (SWBSR(I), I = 1, 100), (USED, I = 1, 100), (MKSWX     FLODA2    538
     4    (I), I = 1, 100), (USED, I = 1, 200)                          FLODA2    539
C                                                                       FLODA2    540
C      IF(LDEB)THEN                                                     FLODA2    541
C         WRITE(IUD6,1430) (SWBSR(I), I = 1, 100),(MKSWX(I), I = 1, 100)FLODA2    542
C         WRITE(IUD6,1550)NMAREA                                        FLODA2    543
C         WRITE(IUD6,1520)((IARE(I,J),J=1,3),INTARA(I),I=1,JAR)         FLODA2    544
C         WRITE(IUD6,1570)NUMZON                                        FLODA2    545
C         WRITE(IUD6,1560)(NAMZN(J),INTZON(J),J=1,JZN)                  FLODA2    546
C      ENDIF                                                            FLODA2    547
C                                                                       FLODA2    548
C     READING MTDC IN THE NEW EPRI LOAD FLOW (VERSIONS 4 AND 5)         FLODA2    549
C                                                                       FLODA2    550
      DO 290 I = 1, NDCC                                                FLODA2    551
      IDC(I) = 0                                                        FLODA2    552
      IDCFRE(I) = 0                                                     FLODA2    553
      IDCNOD(I) = ' '                                                   FLODA2    554
      NODIDX(I) = I                                                     FLODA2    555
      DCCNAM(I) = ' '                                                   FLODA2    556
      DCCNA2(I) = ' '                                                   FLODA2    557
      DCCNMR(I) = ' '                                                   FLODA2    558
      BDIND(I) = .FALSE.                                                FLODA2    559
      BZIND(I) = .FALSE.                                                FLODA2    560
  290 CONTINUE                                                          FLODA2    561
C                                                                       FLODA2    562
      DO 295 I = 1, NDCL                                                FLODA2    563
      IDCL(I) = 0                                                       FLODA2    564
      IDCFRL(I) = 0                                                     FLODA2    565
      DCLNAM(I) = ' '                                                   FLODA2    566
      DCLNMR(I) = ' '                                                   FLODA2    567
  295 CONTINUE                                                          FLODA2    568
C                                                                       FLODA2    569
      DO 300 I = 1, NDCB                                                FLODA2    570
      IDCFRB(I) = 0                                                     FLODA2    571
      IDCB(I) = 0                                                       FLODA2    572
      DCBNAM(I) = ' '                                                   FLODA2    573
      DCBNMR(I) = ' '                                                   FLODA2    574
  300 CONTINUE                                                          FLODA2    575
C                                                                       FLODA2    576
C     Read the size of the arrays stored.                               FLODA2    577
C                                                                       FLODA2    578
         READ (I1)  ICDC, ISIZEC, ILDC, ISIZEL, IBDC, ISIZEB,           FLODA2    579
     1   NUMNOD, NONODR, NUMGRP                                         FLODA2    580
C                                                                       FLODA2    581
C      IF(LDEB1) WRITE(IUD6,1450) ICDC,ISIZEC,ILDC,ISIZEL,IBDC,ISIZEB   FLODA2    582
C     &,NUMNOD,NONODR,NUMGRP                                            FLODA2    583
C                                                                       FLODA2    584
      LCDC=ICDC                                                         FLODA2    585
      KCDC=ICDC                                                         FLODA2    586
C                                                                       FLODA2    587
C     Recover the converter information.                                FLODA2    588
C                                                                       FLODA2    589
      IF (ICDC .GT. 0) THEN                                             FLODA2    590
         DCEXST=.TRUE.                                                  FLODA2    591
         READ (I1)  (IDC(I), I = 1, ICDC)                               FLODA2    592
C         IF(LDEB1) WRITE(IUD6,1450) (IDC(I), I = 1, ICDC)              FLODA2    593
      ELSE                                                              FLODA2    594
         DCEXST=.FALSE.                                                 FLODA2    595
      END IF                                                            FLODA2    596
      READ (I1)  (IDCFRE(I), I = 1, NDCC)                               FLODA2    597
C      IF(LDEB1) WRITE(IUD6,1450) (IDCFRE(I), I = 1, NDCC)              FLODA2    598
C                                                                       FLODA2    599
      DO 310 I = 1, ICDC                                                FLODA2    600
      IF (IDC(I) .NE. 0) THEN                                           FLODA2    601
         IPOSN = IDC(I)                                                 FLODA2    602
         READ (I1)  DCCNMR(IPOSN), BDIND(IPOSN), VABASE(IPOSN),         FLODA2    603
     1   CNGRP(IPOSN), CNZONE(IPOSN), NSBRDG(IPOSN),                    FLODA2    604
     2   XCOHMS(IPOSN), TAPNOM(IPOSN), TAPSTP(IPOSN),                   FLODA2    605
     3   AMINTP(IPOSN), AMAXTP(IPOSN), ALPMIN(IPOSN),                   FLODA2    606
     4   ALPMAX(IPOSN), GAMMIN(IPOSN), TEMP                             FLODA2    607
C                                                                       FLODA2    608
         READ (I1)  BZIND(IPOSN), SPTYPE(IPOSN), USERD(1,IPOSN),        FLODA2    609
     1   USERD(2,IPOSN), QINV(IPOSN), CNVMVA(IPOSN),                    FLODA2    610
     2   DCPMIN(IPOSN), DCPMAX(IPOSN), DCQMIN(IPOSN),                   FLODA2    611
     3   DCQMAX(IPOSN), BIASO(IPOSN)                                    FLODA2    612
         SPTYP3(IPOSN) = 'NO'                                           FLODA2    613
         ICTYPE(IPOSN) = 1                                              FLODA2    614
      END IF                                                            FLODA2    615
C                                                                       FLODA2    616
C      IF(LDEB1)THEN                                                    FLODA2    617
C         WRITE(IUD6,1450) IPOSN                                        FLODA2    618
C         WRITE(IUD6,1460) DCCNMR(IPOSN),BDIND(IPOSN),VABASE(IPOSN),    FLODA2    619
C     1   CNGRP(IPOSN), CNZONE(IPOSN), NSBRDG(IPOSN),                   FLODA2    620
C     2   XCOHMS(IPOSN), TAPNOM(IPOSN), TAPSTP(IPOSN),                  FLODA2    621
C     3   AMINTP(IPOSN), AMAXTP(IPOSN), ALPMIN(IPOSN),                  FLODA2    622
C     4   ALPMAX(IPOSN), GAMMIN(IPOSN), TEMP                            FLODA2    623
C                                                                       FLODA2    624
C         WRITE(IUD6,1470) BZIND(IPOSN),SPTYPE(IPOSN),USERD(1,IPOSN)    FLODA2    625
C     1   ,USERD(2,IPOSN), QINV(IPOSN), CNVMVA(IPOSN)                   FLODA2    626
C     2   ,DCPMIN(IPOSN), DCPMAX(IPOSN), DCQMIN(IPOSN)                  FLODA2    627
C     3   ,DCQMAX(IPOSN), BIASO(IPOSN)                                  FLODA2    628
C      ENDIF                                                            FLODA2    629
  310 CONTINUE                                                          FLODA2    630
C                                                                       FLODA2    631
C     Recover line information.                                         FLODA2    632
C                                                                       FLODA2    633
      IF (ILDC .GT. 0) THEN                                             FLODA2    634
         READ (I1)  (IDCL(I), I = 1, ILDC)                              FLODA2    635
C         IF(LDEB1) WRITE(IUD6,1450) (IDCL(I), I = 1, ILDC)             FLODA2    636
      END IF                                                            FLODA2    637
      READ (I1)  (IDCFRL(I), I = 1, NDCC)                               FLODA2    638
C      IF(LDEB1) WRITE(IUD6,1450) (IDCFRL(I), I = 1, NDCC)              FLODA2    639
C                                                                       FLODA2    640
      DO 311 I = 1, ILDC                                                FLODA2    641
      IF (IDCL(I) .NE. 0) THEN                                          FLODA2    642
         IPOSN = IDCL(I)                                                FLODA2    643
C         IF(LDEB1) WRITE(IUD6,1450) IPOSN                              FLODA2    644
         READ (I1)  DCLNMR(IPOSN), DLGRP(IPOSN), DLOWN(IPOSN),          FLODA2    645
     1   DLZONE(IPOSN), RDCOHM(IPOSN), XLDC(IPOSN),                     FLODA2    646
     2   CDCA(IPOSN), CDCB(IPOSN), DCIMAX(IPOSN)                        FLODA2    647
C                                                                       FLODA2    648
C         IF(LDEB1) WRITE(IUD6,1480) DCLNMR(IPOSN), DLGRP(IPOSN),       FLODA2    649
C     1   DLOWN(IPOSN),                                                 FLODA2    650
C     2   DLZONE(IPOSN), RDCOHM(IPOSN), XLDC(IPOSN),                    FLODA2    651
C     3   CDCA(IPOSN),CDCB(IPOSN), DCIMAX(IPOSN)                        FLODA2    652
      END IF                                                            FLODA2    653
  311 CONTINUE                                                          FLODA2    654
C                                                                       FLODA2    655
C     Recover breaker information.                                      FLODA2    656
C                                                                       FLODA2    657
         IF (IBDC .GT. 0) THEN                                          FLODA2    658
            READ (I1)  (IDCB(I), I = 1, IBDC)                           FLODA2    659
C            IF(LDEB1) WRITE(IUD6,1450) (IDCB(I), I = 1, IBDC)          FLODA2    660
         END IF                                                         FLODA2    661
         READ (I1)  (IDCFRB(I), I = 1, NDCB)                            FLODA2    662
C         IF(LDEB1) WRITE(IUD6,1450) (IDCFRB(I), I = 1, NDCB)           FLODA2    663
         DO 312 I = 1, IBDC                                             FLODA2    664
         IF (IDCB(I) .NE. 0) THEN                                       FLODA2    665
            IPOSN = IDCB(I)                                             FLODA2    666
C            IF(LDEB1) WRITE(IUD6,1450) IPOSN                           FLODA2    667
            READ (I1)  DCBNMR(IPOSN), DBGRP(IPOSN), DBOWN(IPOSN),       FLODA2    668
     1      DBZONE(IPOSN), IBSTAT(IPOSN)                                FLODA2    669
C            IF(LDEB1)WRITE(IUD6,1580) DCBNMR(IPOSN), DBGRP(IPOSN)      FLODA2    670
C     1      ,DBOWN(IPOSN),DBZONE(IPOSN), IBSTAT(IPOSN)                 FLODA2    671
         END IF                                                         FLODA2    672
  312    CONTINUE                                                       FLODA2    673
C                                                                       FLODA2    674
C     Recover node name array.                                          FLODA2    675
C                                                                       FLODA2    676
      IF (NONODR .GT. 0) THEN                                           FLODA2    677
         READ (I1)  (IDCNOD(I), I = 1, NONODR)                          FLODA2    678
C         IF(LDEB1) WRITE(IUD6,1490) (IDCNOD(I), I = 1, NONODR)         FLODA2    679
         IF (IVER .GE. 5) THEN                                          FLODA2    680
            READ (I1)  (NODIDX(I), I = 1, NONODR)                       FLODA2    681
C            IF(LDEB1) WRITE(IUD6,1450) (NODIDX(I), I = 1, NONODR)      FLODA2    682
         END IF                                                         FLODA2    683
      END IF                                                            FLODA2    684
C                                                                       FLODA2    685
C     Recover group name array.                                         FLODA2    686
C                                                                       FLODA2    687
      IF (NUMGRP .GT. 0) THEN                                           FLODA2    688
         READ (I1)  (GROUP(I), I = 1, NUMGRP)                           FLODA2    689
C         IF(LDEB1) WRITE(IUD6,1490) (GROUP(I), I = 1, NUMGRP)          FLODA2    690
      END IF                                                            FLODA2    691
C                                                                       FLODA2    692
C     Recover solution.                                                 FLODA2    693
C                                                                       FLODA2    694
      DO 313 I = 1, ICDC                                                FLODA2    695
      IF (IDC(I) .NE. 0) THEN                                           FLODA2    696
         IPOSN = IDC(I)                                                 FLODA2    697
C         IF(LDEB1) WRITE(IUD6,1450) IPOSN                              FLODA2    698
         READ (I1)  CALPHA(IPOSN), CGAMMA(IPOSN), XACURR(IPOSN),        FLODA2    699
     1   TAPPOS(IPOSN), PHIDC(IPOSN), PAHVDC(IPOSN),                    FLODA2    700
     2   QAHVDC(IPOSN), VDCONV(IPOSN), XDCONV(IPOSN)                    FLODA2    701
      END IF                                                            FLODA2    702
  313 CONTINUE                                                          FLODA2    703
C                                                                       FLODA2    704
      IF (NUMNOD .GT. 0) THEN                                           FLODA2    705
         READ (I1)  (VDCNOD(I), I = 1, NUMNOD)                          FLODA2    706
         READ (I1)  (XDNODE(I), I = 1, NUMNOD)                          FLODA2    707
      END IF                                                            FLODA2    708
      READ (I1)  PABASE, VDBASE, PDBASE                                 FLODA2    709
C                                                                       FLODA2    710
      IF(NONODR.GT.NUMNOD) THEN                                         FLODA2    711
         DO 314 I = NUMNOD+1, NONODR                                    FLODA2    712
         VDCNOD(I) = VDCNOD(NODIDX(I))                                  FLODA2    713
         XDNODE(I) = XDNODE(NODIDX(I))                                  FLODA2    714
  314    CONTINUE                                                       FLODA2    715
      END IF                                                            FLODA2    716
C                                                                       FLODA2    717
      NUMNOD = NONODR                                                   FLODA2    718
C                                                                       FLODA2    719
      DO 315 I = 1, NDCC                                                FLODA2    720
      DCCNAM(I) = DCCNMR(I)                                             FLODA2    721
  315 CONTINUE                                                          FLODA2    722
C                                                                       FLODA2    723
      DO 316 I = 1, NDCL                                                FLODA2    724
      DCLNAM(I) = DCLNMR(I)                                             FLODA2    725
  316 CONTINUE                                                          FLODA2    726
C                                                                       FLODA2    727
      DO 317 I = 1, NDCB                                                FLODA2    728
      DCBNAM(I) = DCBNMR(I)                                             FLODA2    729
  317 CONTINUE                                                          FLODA2    730
C                                                                       FLODA2    731
C                                                                       FLODA2    732
      DO 318 I=1,ICDC                                                   FLODA2    733
      IF(IDC(I).NE.0)THEN                                               FLODA2    734
         IPOSN = IDC(I)                                                 FLODA2    735
         PAHVDC(IPOSN)=PAHVDC(IPOSN)*PABASE/BASPC                       FLODA2    736
         QAHVDC(IPOSN)=QAHVDC(IPOSN)*PABASE/BASPC                       FLODA2    737
         XACURR(IPOSN)=XACURR(IPOSN)*PABASE/BASPC                       FLODA2    738
C                                                                       FLODA2    739
C         IF(LDEB1) WRITE(IUD6,1500) CALPHA(IPOSN), CGAMMA(IPOSN),      FLODA2    740
C     1   XACURR(IPOSN),TAPPOS(IPOSN), PHIDC(IPOSN), PAHVDC(IPOSN),     FLODA2    741
C     2   QAHVDC(IPOSN), VDCONV(IPOSN), XDCONV(IPOSN)                   FLODA2    742
      ENDIF                                                             FLODA2    743
C                                                                       FLODA2    744
  318 CONTINUE                                                          FLODA2    745
      PABASE=BASPC                                                      FLODA2    746
C                                                                       FLODA2    747
C      IF(NUMNOD.GT.0)THEN                                              FLODA2    748
C         IF(LDEB1) WRITE(IUD6,1500) (VDCNOD(I), I = 1, NUMNOD)         FLODA2    749
C         IF(LDEB1) WRITE(IUD6,1500) (XDNODE(I), I = 1, NUMNOD)         FLODA2    750
C      ENDIF                                                            FLODA2    751
C                                                                       FLODA2    752
C      IF(LDEB1) WRITE(IUD6,1500) PABASE, VDBASE, PDBASE                FLODA2    753
C                                                                       FLODA2    754
C                                                                       FLODA2    755
C    END OF VERSION 5 DATA READ                                         FLODA2    756
C                                                                       FLODA2    757
      ENDIF                                                             FLODA2    758
C                                                                       FLODA2    759
  320 CONTINUE                                                          FLODA2    760
C---------------------------------------------------------------------  FLODA2    761
C     *****  SYSTEM HAS BEEN LOADED                                     FLODA2    762
C---------------------------------------------------------------------  FLODA2    763
      DO 330  I = 1, 54                                                 FLODA2    764
  330 TITLE(I) = TLE(I)                                                 FLODA2    765
      DO 335 I=1,60                                                     FLODA2    766
        MNEWA(I)=I                                                      FLODA2    767
 335  CONTINUE                                                          FLODA2    768
C      IF(LDEB)THEN                                                     FLODA2    769
C         WRITE (IUD6,1370) I3,NRL1,NRL2,I1,TLE                         FLODA2    770
C         WRITE (IUD6,1380) NOBUS                                       FLODA2    771
C      ENDIF                                                            FLODA2    772
C                                                                       FLODA2    773
C    .................................                                  FLODA2    774
C     : END OF READING LOAD FLOW FILE :                                 FLODA2    775
C     :...............................:                                 FLODA2    776
C                                                                       FLODA2    777
C=====================================================================  FLODA2    778
C                                                                       FLODA2    779
      NXTR1=NTR+1                                                       FLODA2    780
      NXTR=NTR                                                          FLODA2    781
C                                                                       FLODA2    782
      NXB=NB                                                            FLODA2    783
      NXL=NPL                                                           FLODA2    784
      IEBK=0                                                            FLODA2    785
C                                                                       FLODA2    786
      LBUSNO=0                                                          FLODA2    787
      NL=0                                                              FLODA2    788
      K=0                                                               FLODA2    789
      ITRF=0                                                            FLODA2    790
      ITRF2=0                                                           FLODA2    791
      MDCLK=0                                                           FLODA2    792
C                                                                       FLODA2    793
C     BUS DATA AND GENERATOR DATA                                       FLODA2    794
C-----------------------------------------------------------------------FLODA2    795
C                                                                       FLODA2    796
C     NOBUS      => MAXIMUM NUMBER OF BUSES READ FROM LF BINARY FILE    FLODA2    797
C     NARE(J)    => ARRAY CONTAINS AREA NUMBER FOR THE (J) BUS          FLODA2    798
C     PL(J)      => LOAD MW IN ACTUAL MW FOR THE (J) BUS                FLODA2    799
C     QL(J)      => LOAD MX IN ACTUAL MX FOR THE (J) BUS                FLODA2    800
C     INAMES(1),INAMES(2),INAMES(3)   => BUS NAME                       FLODA2    801
C     IXCROS(J)  => CROSSREF OF INPUT ORDERED BUS NAME TO ALPHA ORDERED FLODA2    802
C     XXEA(J)    => THE (J) BUS VOLTAGE MAGNITUTE IN P.U.(INTEGER*8)    FLODA2    803
C     XXEB(J)    => THE (J) BUS VOLTAGE ANGLE IN RADIANS (INTEGER*8)    FLODA2    804
C     GSR(J)     => THE (J) BUS REAL PART OF SHUNT DEVICE.              FLODA2    805
C     BSR(J)     => THE (J) BUS IMAGINARY PART OF SHUNT DEVICE.         FLODA2    806
C     JBTYPE =(KIND(J)/IPACK) => PACKED INTEGER CONTAINING THE BUS TYPE.FLODA2    807
C     3,6,7 = GENERATOR.(TO BE CONFIRMED)                               FLODA2    808
C                                                                       FLODA2    809
C     MNEW()     => CROSSREF BETWEEN INTERNAL NUMBERED BUS TO EXTERNAL NFLODA2    810
C                BUS.NOTE IN EPRI FORMATED LF, NO EXTERNAL BUS NUMBERS  FLODA2    811
C                ARE USED.THE BUS NUMBERS ARE THEREFORE ASSIGNED ACCORDIFLODA2    812
C                TO THE DATA INPUT ORDER.                               FLODA2    813
C-----------------------------------------------------------------------FLODA2    814
C      IF(LDEB.AND.K.LT.50)THEN                                         FLODA2    815
C         WRITE (IUD6,1120)                                             FLODA2    816
C      ENDIF                                                            FLODA2    817
C                                                                       FLODA2    818
      J=0                                                               FLODA2    819
  340 CONTINUE                                                          FLODA2    820
      J=J+1                                                             FLODA2    821
      IF(J.GT.NOBUS)GOTO 370                                            FLODA2    822
      IF(MNEW(J).EQ.0)GOTO 350                                          FLODA2    823
      IXC=IXCROS(J)                                                     FLODA2    824
      WRITE(MSG(1),1140) INAMES(1,IXC),INAMES(2,IXC),INAMES(3,IXC)      FLODA2    825
      MSG(2)='CHECK YOUR LOADFLOW DATA'                                 FLODA2    826
      CALL PRTMSG(2)                                                    FLODA2    827
      IEBK=1                                                            FLODA2    828
      GOTO 340                                                          FLODA2    829
  350 CONTINUE                                                          FLODA2    830
      K=K+1                                                             FLODA2    831
      IF(K.LT.NXB)GOTO 360                                              FLODA2    832
      IXC=IXCROS(J)                                                     FLODA2    833
      MSG(1)=' *** ERROR(FLODA2) TOTAL NO OF BUSES EXCEEDED'            FLODA2    834
      WRITE(MSG(2),1150) NXB,INAMES(1,IXC),INAMES(2,IXC),INAMES(3,IXC)  FLODA2    835
      CALL PRTMSG(2)                                                    FLODA2    836
      IEBK=1                                                            FLODA2    837
      GOTO 340                                                          FLODA2    838
  360 CONTINUE                                                          FLODA2    839
      MNEW(J)=K                                                         FLODA2    840
      NOLD(K)=J                                                         FLODA2    841
      JBSTAT(K)=2                                                       FLODA2    842
      JBTYPE=(KIND(J)/IPACK)                                            FLODA2    843
      IZONE=MOD(KIND(J),IPACK)                                          FLODA2    844
C      IF((LDEB).AND.(K.LT.50).AND.(JBTYPE.NE.20))THEN                  FLODA2    845
C      IXC=IXCROS(J)                                                    FLODA2    846
C         WRITE (IUD6,1130) J,XXPG(J),XXQG(J),PL(J),QL(J),              FLODA2    847
C     +   GSR(J),BSR(J),NARE(J),XXEA(J),XXEB(J),INAMES(1,IXC),          FLODA2    848
C     +   INAMES(2,IXC),INAMES(3,IXC),MOD(KIND(J),IPACK)                FLODA2    849
C      ENDIF                                                            FLODA2    850
C                                                                       FLODA2    851
C                                                                       FLODA2    852
      KK=(K-1)*4                                                        FLODA2    853
      IF(IZONE.LE.0)IZONE=1                                             FLODA2    854
      IBARK=NARE(J)                                                     FLODA2    855
      XBASKV(KK+4)=BKV(J)                                               FLODA2    856
      IF(IBARK.LE.0)IBARK=1                                             FLODA2    857
      CALL PACKII(IZONE,IBARK,IL)                                       FLODA2    858
      IBAR(KK+3)=IL                                                     FLODA2    859
      IF(JBTYPE.NE.20)THEN                                              FLODA2    860
         BMW(KK+1)=PL(J)                                                FLODA2    861
         BMX(KK+2)=QL(J)                                                FLODA2    862
      ELSE                                                              FLODA2    863
         BMW(KK+1)=0.0                                                  FLODA2    864
         BMX(KK+2)=0.0                                                  FLODA2    865
      ENDIF                                                             FLODA2    866
C                                                                       FLODA2    867
      KK=(K-1)*8                                                        FLODA2    868
      IXC=IXCROS(J)                                                     FLODA2    869
      NAMES(KK+6)=INAMES(1,IXC)                                         FLODA2    870
      NAMES(KK+7)=INAMES(2,IXC)                                         FLODA2    871
      NAMES(KK+8)=INAMES(3,IXC)                                         FLODA2    872
      ERBUS(KK+1)=XXEA(J)*COS(XXEB(J))                                  FLODA2    873
      EIBUS(KK+2)=XXEA(J)*SIN(XXEB(J))                                  FLODA2    874
      IF(JBTYPE.NE.20)THEN                                              FLODA2    875
         RYGR(KK+4)=GSR(J)                                              FLODA2    876
         RIYGR(KK+5)=-BSR(J)                                            FLODA2    877
         BSTC(KK+3)=0.0                                                 FLODA2    878
      ELSE                                                              FLODA2    879
         RYGR(KK+4)=0.0                                                 FLODA2    880
         RIYGR(KK+5)=0.0                                                FLODA2    881
         BSTC(KK+3)=0.0                                                 FLODA2    882
      ENDIF                                                             FLODA2    883
C                                                                       FLODA2    884
C     IFTHE BUS HAS A GENERATOR, THEN..                                 FLODA2    885
C                                                                       FLODA2    886
      KK=(K-1)*2                                                        FLODA2    887
      IF((JBTYPE.EQ.3).OR.                                              FLODA2    888
     1   (JBTYPE.EQ.6).OR.                                              FLODA2    889
     2   (JBTYPE.EQ.7).OR.                                              FLODA2    890
     3   (JBTYPE.EQ.9).OR.                                              FLODA2    891
     4   (XXPG(J) .NE.0.0).OR.                                          FLODA2    892
     5   (XXQG(J) .NE.0.0))THEN                                         FLODA2    893
C                                                                       FLODA2    894
C     GENERATOR BUS                                                     FLODA2    895
C                                                                       FLODA2    896
         GMW(KK+1)=XXPG(J)                                              FLODA2    897
         GMX(KK+2)=XXQG(J)                                              FLODA2    898
      ELSE                                                              FLODA2    899
         GMW(KK+1)=0.0                                                  FLODA2    900
         GMX(KK+2)=0.0                                                  FLODA2    901
      ENDIF                                                             FLODA2    902
C                                                                       FLODA2    903
C                                                                       FLODA2    904
      IF(J.GT.LBUSNO) LBUSNO=J                                          FLODA2    905
      GOTO 340                                                          FLODA2    906
C                                                                       FLODA2    907
  370 CONTINUE                                                          FLODA2    908
C                                                                       FLODA2    909
C=======================================================================FLODA2    910
C                                                                       FLODA2    911
C     BRANCH AND FIXED TAP TRANSFORMER  DATA                            FLODA2    912
C     --------------------------------------                            FLODA2    913
C                                                                       FLODA2    914
C     LINAB() IS A PACKED INTEGER*4 ARRAY WITH 2 INTEGER*2 WORDS.       FLODA2    915
C     (LINAB()/IPACK)     => "FROM" BUS #                               FLODA2    916
C     (MOD(LINAB(),IPACK) => "  TO" BUS #                               FLODA2    917
C     LINDX() => LINE ITEM NUMBER (ASSIGNED IN DATA INPUT ORDER)        FLODA2    918
C         NEGATIVE NUMBER MEANS "FROM" , "TO" IS REVERSED.              FLODA2    919
C         THERE ARE 2 LINE ITEMS PER LINE.IE +# AND -#.                 FLODA2    920
C         FOR EACH PASS IN THIS LOOP, I IS INCREMENTED FROM             FLODA2    921
C        1 TO NOLIN.THE CORRESPONDING BRANCH INFORMATIONS               FLODA2    922
C        ARE POINTED TO BY II=LINDX(I).                                 FLODA2    923
C     LK => LINE TYPE (LK=LKIND(II)/IPACK)                              FLODA2    924
C       LK = 4,15 FIXED TAP TRANSFORMER                                 FLODA2    925
C       LK = 14,16,17,18 ADJUSTABLE TAP TRANSFORMER (TO BE CONFIRMED) !!FLODA2    926
C                                                                       FLODA2    927
      NL=0                                                              FLODA2    928
      NLINES=0                                                          FLODA2    929
      I=0                                                               FLODA2    930
C                                                                       FLODA2    931
C     REPEAT...                                                         FLODA2    932
C                                                                       FLODA2    933
  380 CONTINUE                                                          FLODA2    934
      IISECT=0                                                          FLODA2    935
      I=I+1                                                             FLODA2    936
      IF(I.GT.NOLIN)GOTO 460                                            FLODA2    937
C                                                                       FLODA2    938
C     K=> EPRI "FROM" BUS                                               FLODA2    939
C     J=> EPRI "TO" BUS                                                 FLODA2    940
C     II=> INDEX TO BRANCH DATA ARRAYS                                  FLODA2    941
C     LK=> BRANCH TYPES                                                 FLODA2    942
C     ICKT=>POINTER TO CIRCUIT ID.USED HERE AS IS.DOES NOT USE ACTUAL IDFLODA2    943
C     ISEC=>POINTER TO BRANCH SERIAL LINE SECTION ID.USED HERE AS IS.   FLODA2    944
C                                                                       FLODA2    945
C     GET BRANCH INFORMATION :                                          FLODA2    946
C                                                                       FLODA2    947
      K=LINAB(I)/IPACK                                                  FLODA2    948
      J=MOD(LINAB(I),IPACK)                                             FLODA2    949
      II=LINDX(I)                                                       FLODA2    950
C                                                                       FLODA2    951
      IF(II.LT.0) GOTO 380                                              FLODA2    952
C                                                                       FLODA2    953
      LK=LKIND(II)/IPACK                                                FLODA2    954
      ICKT=LCIRC(II)/IPACK                                              FLODA2    955
      ISEC=MOD(LCIRC(II),IPACK)                                         FLODA2    956
C                                                                       FLODA2    957
C-----------------------------------------------------------------------FLODA2    958
C     SKIP BRANCH INFORMATION FOR DC LINE                               FLODA2    959
C                                                                       FLODA2    960
      IF(LK.EQ.21)GOTO 380                                              FLODA2    961
C                                                                       FLODA2    962
C     PREVIEW THE NEXT BRANCH IFTHE CURRENT BRANCH IS PART OF A SERIAL SFLODA2    963
C                                                                       FLODA2    964
      IF((I+1).GT.NOLIN)GOTO 410                                        FLODA2    965
      KNX=LINAB(I+1)/IPACK                                              FLODA2    966
      JNX=MOD(LINAB(I+1),IPACK)                                         FLODA2    967
      IINX=IABS(LINDX(I+1))                                             FLODA2    968
      ICKTNX=LCIRC(IINX)/IPACK                                          FLODA2    969
C                                                                       FLODA2    970
      IF((K.EQ.KNX).AND.                                                FLODA2    971
     1   (J.EQ.JNX).AND.                                                FLODA2    972
     1   (ICKT.EQ.ICKTNX))THEN                                          FLODA2    973
         NEXTS=I                                                        FLODA2    974
         JSECT=1                                                        FLODA2    975
         ZCX(JSECT)=CMPLX(G(II),B(II))                                  FLODA2    976
         Y1CX(JSECT)=CMPLX(PGC1(II),PBC1(II))                           FLODA2    977
         Y2CX(JSECT)=CMPLX(PGC2(II),PBC2(II))                           FLODA2    978
C                                                                       FLODA2    979
         NSEL=NSEL+1                                                    FLODA2    980
         JSEL=NSEL                                                      FLODA2    981
         IPOS=IPOS+1                                                    FLODA2    982
         IK=MNEW(K)                                                     FLODA2    983
         IJ=MNEW(J)                                                     FLODA2    984
         LCONE(1,JSEL)=IK                                               FLODA2    985
         LCONE(2,JSEL)=IJ                                               FLODA2    986
         LCONE(3,JSEL)=1                                                FLODA2    987
         CCONE(4,JSEL)=IALFA(ICKT)                                      FLODA2    988
         LCONE(5,JSEL)=IPOS                                             FLODA2    989
         LCONE(6,JSEL)=1                                                FLODA2    990
         NEXTSL(1,IPOS)=0                                               FLODA2    991
         CNEXTS(2,IPOS)=IALFA(ISEC)                                     FLODA2    992
         NEXTSL(3,IPOS)=0                                               FLODA2    993
         YMAG=G(II)*G(II)+B(II)*B(II)                                   FLODA2    994
         PSELIN(1,IPOS)=G(II)/YMAG                                      FLODA2    995
         PSELIN(2,IPOS)=B(II)/YMAG                                      FLODA2    996
         PSELIN(3,IPOS)=PGC1(II)                                        FLODA2    997
         PSELIN(4,IPOS)=PBC1(II)                                        FLODA2    998
         PSELIN(5,IPOS)=PGC2(II)                                        FLODA2    999
         PSELIN(6,IPOS)=PBC2(II)                                        FLODA2   1000
  390    CONTINUE                                                       FLODA2   1001
         NEXTS=NEXTS+1                                                  FLODA2   1002
         JSECT=JSECT+1                                                  FLODA2   1003
C                                                                       FLODA2   1004
C        CHECK FOR THE LAST CIRCUIT                                     FLODA2   1005
C                                                                       FLODA2   1006
         IF(NEXTS.GT.NOLIN)GOTO 400                                     FLODA2   1007
C                                                                       FLODA2   1008
         KNX=LINAB(NEXTS)/IPACK                                         FLODA2   1009
         JNX=MOD(LINAB(NEXTS),IPACK)                                    FLODA2   1010
C                                                                       FLODA2   1011
         IINX=IABS(LINDX(NEXTS))                                        FLODA2   1012
C                                                                       FLODA2   1013
         LKNX=LKIND(IINX)/IPACK                                         FLODA2   1014
         ICKTNX=LCIRC(IINX)/IPACK                                       FLODA2   1015
         ISECNX=MOD(LCIRC(IINX),IPACK)                                  FLODA2   1016
C                                                                       FLODA2   1017
 400     CONTINUE                                                       FLODA2   1018
         IF((K.EQ.KNX).AND.                                             FLODA2   1019
     1      (J.EQ.JNX).AND.                                             FLODA2   1020
     1      (NEXTS.LE.NOLIN).AND.                                       FLODA2   1021
     1      (ICKT.EQ.ICKTNX))THEN                                       FLODA2   1022
C                                                                       FLODA2   1023
C     "FROM","TO" BUS AND CITCUIT ID ARE THE SAME.                      FLODA2   1024
C                                                                       FLODA2   1025
            IISECT=1                                                    FLODA2   1026
            IPOS=IPOS+1                                                 FLODA2   1027
            LCONE(6,JSEL)=LCONE(6,JSEL)+1                               FLODA2   1028
            NEXTSL(1,IPOS-1)=IPOS                                       FLODA2   1029
            NEXTSL(1,IPOS)=0                                            FLODA2   1030
            CNEXTS(2,IPOS)=IALFA(ISECNX)                                FLODA2   1031
            NEXTSL(3,IPOS)=0                                            FLODA2   1032
            YMAG=G(IINX)*G(IINX)+B(IINX)*B(IINX)                        FLODA2   1033
            PSELIN(1,IPOS)=G(IINX)/YMAG                                 FLODA2   1034
            PSELIN(2,IPOS)=B(IINX)/YMAG                                 FLODA2   1035
            PSELIN(3,IPOS)=PGC1(IINX)                                   FLODA2   1036
            PSELIN(4,IPOS)=PBC1(IINX)                                   FLODA2   1037
            PSELIN(5,IPOS)=PGC2(IINX)                                   FLODA2   1038
            PSELIN(6,IPOS)=PBC2(IINX)                                   FLODA2   1039
            ZCX(JSECT)=CMPLX(G(IINX),B(IINX))                           FLODA2   1040
            Y1CX(JSECT)=CMPLX(PGC1(IINX),PBC1(IINX))                    FLODA2   1041
            Y2CX(JSECT)=CMPLX(PGC2(IINX),PBC2(IINX))                    FLODA2   1042
C                                                                       FLODA2   1043
C     CHECK TO NEXT BRANCH TO SEE IFIT IS ANOTHER SERIAL LINE SECTION   FLODA2   1044
C                                                                       FLODA2   1045
            GOTO 390                                                    FLODA2   1046
         ELSE                                                           FLODA2   1047
            NEXTS=NEXTS-1                                               FLODA2   1048
            I=NEXTS                                                     FLODA2   1049
            II=LINDX(I)                                                 FLODA2   1050
            JSECT=JSECT-1                                               FLODA2   1051
C                                                                       FLODA2   1052
      CALL ABCD(JSECT,ZCX,Y1CX,Y2CX,REQ,XEQ,G1EQ,B1EQ,G2EQ,B2EQ)        FLODA2   1053
C                                                                       FLODA2   1054
            G(II)=REQ                                                   FLODA2   1055
            B(II)=XEQ                                                   FLODA2   1056
            PGC1(II)=G1EQ                                               FLODA2   1057
            PBC1(II)=B1EQ                                               FLODA2   1058
            PGC2(II)=G2EQ                                               FLODA2   1059
            PBC2(II)=B2EQ                                               FLODA2   1060
            YMAG=REQ*REQ+XEQ*XEQ                                        FLODA2   1061
            EQPI(1,JSEL)=REQ/YMAG                                       FLODA2   1062
            EQPI(2,JSEL)=XEQ/YMAG                                       FLODA2   1063
            EQPI(3,JSEL)=G1EQ                                           FLODA2   1064
            EQPI(4,JSEL)=B1EQ                                           FLODA2   1065
            EQPI(5,JSEL)=G2EQ                                           FLODA2   1066
            EQPI(6,JSEL)=B2EQ                                           FLODA2   1067
            EQPI(7,JSEL)=0                                              FLODA2   1068
            EQPI(8,JSEL)=0                                              FLODA2   1069
            EQPI(9,JSEL)=0                                              FLODA2   1070
            EQPI(10,JSEL)=0                                             FLODA2   1071
            EQPI(11,JSEL)=0                                             FLODA2   1072
            EQPI(12,JSEL)=0                                             FLODA2   1073
C                                                                       FLODA2   1074
C            IF(LDEB)WRITE(IUD6,1410) I,II,G(II),B(II),PGC1(II),        FLODA2   1075
C     1      PBC1(II),PGC2(II),PBC2(II)                                 FLODA2   1076
         ENDIF                                                          FLODA2   1077
      ENDIF                                                             FLODA2   1078
C                                                                       FLODA2   1079
  410 CONTINUE                                                          FLODA2   1080
C                                                                       FLODA2   1081
C     NEWK => "FROM" BUS NUMBER                                         FLODA2   1082
C     NEWJ   => "  TO" BUS NUMBER                                       FLODA2   1083
C     FILL IN THE LINE INFORMATIONS ONLY IFTHERE IS A BUS ENTRY (MNEW() FLODA2   1084
C                                                                       FLODA2   1085
      NEWK=MNEW(K)                                                      FLODA2   1086
      NEWJ=MNEW(J)                                                      FLODA2   1087
      IF(NEWK.NE.0.AND.NEWJ.NE.0)GOTO 420                               FLODA2   1088
      JXC=IXCROS(J)                                                     FLODA2   1089
      KXC=IXCROS(K)                                                     FLODA2   1090
      WRITE(MSG(1),1160)                                                FLODA2   1091
     &INAMES(1,KXC),INAMES(2,KXC),INAMES(3,KXC)                         FLODA2   1092
     1,INAMES(1,JXC),INAMES(2,JXC),INAMES(3,JXC)                        FLODA2   1093
     1,ICKT                                                             FLODA2   1094
      MSG(2)='           NOT IN LOADFLOW'                               FLODA2   1095
      CALL PRTMSG(2)                                                    FLODA2   1096
      IEBK=1                                                            FLODA2   1097
      GOTO 380                                                          FLODA2   1098
C                                                                       FLODA2   1099
  420 CONTINUE                                                          FLODA2   1100
C                                                                       FLODA2   1101
      NL=NL+1                                                           FLODA2   1102
C                                                                       FLODA2   1103
      IF(NL.LT.NXL) GOTO 430                                            FLODA2   1104
      WRITE (MSG(1),1170) K,J,ICKT                                      FLODA2   1105
      WRITE(MSG(2),1171) NXL                                            FLODA2   1106
      CALL PRTMSG(2)                                                    FLODA2   1107
      IEBK=1                                                            FLODA2   1108
      GOTO 380                                                          FLODA2   1109
C                                                                       FLODA2   1110
  430 CONTINUE                                                          FLODA2   1111
      NLINES=NLINES+5                                                   FLODA2   1112
      IF(LK.LT.0)THEN                                                   FLODA2   1113
       GAZN=0.0                                                         FLODA2   1114
       BAZN=1.0/ZILTOL                                                  FLODA2   1115
      ELSE                                                              FLODA2   1116
       XSUM=G(II)**2+B(II)**2                                           FLODA2   1117
       GAZN=G(II)/XSUM                                                  FLODA2   1118
       BAZN=B(II)/XSUM                                                  FLODA2   1119
      ENDIF                                                             FLODA2   1120
      GA(NLINES-2)=GAZN                                                 FLODA2   1121
      BA(NLINES-1)=BAZN                                                 FLODA2   1122
      IK=MNEW(K)                                                        FLODA2   1123
      IJ=MNEW(J)                                                        FLODA2   1124
      CALL PACKII(IK,IJ,IL)                                             FLODA2   1125
      LFTB(NLINES-3)=IL                                                 FLODA2   1126
      CKID=(IALFA(ICKT))                                                FLODA2   1127
      IF((LK.EQ.1).AND.(IISECT.EQ.0))THEN                               FLODA2   1128
C                                                                       FLODA2   1129
C     -LK 1 IS EQUAL PI LEGS                                            FLODA2   1130
C                                                                       FLODA2   1131
         CHG=PBC1(II)+PBC2(II)                                          FLODA2   1132
         BCHG(NLINES)=CHG                                               FLODA2   1133
         CALL PACK(CKID,0,JCKID)                                        FLODA2   1134
         LFTB(NLINES-4)=JCKID                                           FLODA2   1135
      ELSE                                                              FLODA2   1136
C                                                                       FLODA2   1137
         CALL PACK(CKID,JSEL,JCKID)                                     FLODA2   1138
         LFTB(NLINES-4)=JCKID                                           FLODA2   1139
         BCHG(NLINES)=0.0                                               FLODA2   1140
      ENDIF                                                             FLODA2   1141
C                                                                       FLODA2   1142
C----------------------------------------------------------------       FLODA2   1143
C     STORING THE COMPENSATION COMPONENT ON THE "FROM" AND "TO" BUSES   FLODA2   1144
C                                                                       FLODA2   1145
C     ONLY VALID FOR LINE TYPE (LK) 10..(WITH LINE TYPE =4, PGC1() AND  FLODA2   1146
C                                       PBC1() CONTAINS THE TRANSFORMER FLODA2   1147
C                                       FIXED TAP SETTINGS.SEE NOTE BELOFLODA2   1148
C                                                                       FLODA2   1149
C     -LK 10 IS UNEQUAL PI LEGS - THIS WILL BE TREATED AS A SEGMENTED LIFLODA2   1150
C                                                                       FLODA2   1151
      IF( (LK.EQ.10).AND.(IISECT.EQ.0) )THEN                            FLODA2   1152
         NSEL=NSEL+1                                                    FLODA2   1153
         JSEL=NSEL                                                      FLODA2   1154
         IPOS=IPOS+1                                                    FLODA2   1155
         IK=MNEW(K)                                                     FLODA2   1156
         IJ=MNEW(J)                                                     FLODA2   1157
         LCONE(1,JSEL)=IK                                               FLODA2   1158
         LCONE(2,JSEL)=IJ                                               FLODA2   1159
         LCONE(3,JSEL)=1                                                FLODA2   1160
         CCONE(4,JSEL)=IALFA(ICKT)                                      FLODA2   1161
         LCONE(5,JSEL)=IPOS                                             FLODA2   1162
         LCONE(6,JSEL)=1                                                FLODA2   1163
         NEXTSL(1,IPOS)=0                                               FLODA2   1164
         CNEXTS(2,IPOS)=IALFA(ICKT)                                     FLODA2   1165
         NEXTSL(3,IPOS)=0                                               FLODA2   1166
         YMAG=G(II)*G(II)+B(II)*B(II)                                   FLODA2   1167
         PSELIN(1,IPOS)=G(II)/YMAG                                      FLODA2   1168
         PSELIN(2,IPOS)=B(II)/YMAG                                      FLODA2   1169
         PSELIN(3,IPOS)=PGC1(II)                                        FLODA2   1170
         PSELIN(4,IPOS)=PBC1(II)                                        FLODA2   1171
         PSELIN(5,IPOS)=PGC2(II)                                        FLODA2   1172
         PSELIN(6,IPOS)=PBC2(II)                                        FLODA2   1173
         EQPI(1,JSEL)=G(II)/YMAG                                        FLODA2   1174
         EQPI(2,JSEL)=B(II)/YMAG                                        FLODA2   1175
         EQPI(3,JSEL)=PGC1(II)                                          FLODA2   1176
         EQPI(4,JSEL)=PBC1(II)                                          FLODA2   1177
         EQPI(5,JSEL)=PGC2(II)                                          FLODA2   1178
         EQPI(6,JSEL)=PBC2(II)                                          FLODA2   1179
         EQPI(7,JSEL)=0                                                 FLODA2   1180
         EQPI(8,JSEL)=0                                                 FLODA2   1181
         EQPI(9,JSEL)=0                                                 FLODA2   1182
         EQPI(10,JSEL)=0                                                FLODA2   1183
         EQPI(11,JSEL)=0                                                FLODA2   1184
         EQPI(12,JSEL)=0                                                FLODA2   1185
         CALL PACK(CKID,JSEL,JCKID)                                     FLODA2   1186
         LFTB(NLINES-4)=JCKID                                           FLODA2   1187
         BCHG(NLINES)=0.0                                               FLODA2   1188
      ENDIF                                                             FLODA2   1189
      IF((LK.EQ.14).OR.                                                 FLODA2   1190
     1   (LK.EQ.4).OR.                                                  FLODA2   1191
     2   (LK.EQ.12).OR.                                                 FLODA2   1192
     3   (LK.EQ.15).OR.                                                 FLODA2   1193
     4   (LK.EQ.16).OR.                                                 FLODA2   1194
     5   (LK.EQ.17).OR.                                                 FLODA2   1195
     6   (LK.EQ.18))THEN                                                FLODA2   1196
C                                                                       FLODA2   1197
C     TRANSFORMERS.SEE LK=4 NOTE BELOW..                                FLODA2   1198
C                                                                       FLODA2   1199
         JJ=(NEWJ-1)*8                                                  FLODA2   1200
         KK=(NEWK-1)*8                                                  FLODA2   1201
         RYGR(JJ+4)=RYGR(JJ+4)+PGC2(II)                                 FLODA2   1202
         RIYGR(JJ+5)=RIYGR(JJ+5)-PBC2(II)                               FLODA2   1203
      ENDIF                                                             FLODA2   1204
C                                                                       FLODA2   1205
C-----------------------------------------------------------------------FLODA2   1206
C     TRANSFORMER INFORMATIONS (FIXED TAPS..FROM BRANCH DATA)           FLODA2   1207
C                                                                       FLODA2   1208
C     LK=4 ==> FIXED TAP TRANSFORMER.IN THIS CASE,                      FLODA2   1209
C             PGC1()=> TAP POSITION ON "FROM" BUS..(LINAB/IPACK)        FLODA2   1210
C             PBC1()=> TAP POSITION ON "TO" BUS..[MOD(LINAB(),IPACK)]   FLODA2   1211
C             PGC2()/PBC2=> REAL/IMAG PART OF CHARGING ON THE "TO" BUS  FLODA2   1212
C                                                                       FLODA2   1213
      IF(LK.EQ.4)THEN                                                   FLODA2   1214
         ITRF=ITRF+1                                                    FLODA2   1215
         ITRF2=ITRF2+2                                                  FLODA2   1216
         ITRAN(ITRF)=NL                                                 FLODA2   1217
         RATIO(ITRF2-1)=(PGC1(II)/PBC1(II))*(BKV(J)/BKV(K))             FLODA2   1218
         RANG(ITRF2)= 0.0                                               FLODA2   1219
      ENDIF                                                             FLODA2   1220
C-----------------------------------------------------------------------FLODA2   1221
C                                                                       FLODA2   1222
C                                                                       FLODA2   1223
C     LK=12          ==>IT'S A FIX PHASE SHIFTER IN                     FLODA2   1224
C                      PGC1()=> PHASE ANGLE IN DEGREES ???              FLODA2   1225
C                                                                       FLODA2   1226
      IF(LK.EQ.12)THEN                                                  FLODA2   1227
         ITRF=ITRF+1                                                    FLODA2   1228
         ITRF2=ITRF2+2                                                  FLODA2   1229
         ITRAN(ITRF)=NL                                                 FLODA2   1230
         RATIO(ITRF2-1)=1.0                                             FLODA2   1231
         RANG(ITRF2)= PGC1(II)                                          FLODA2   1232
      ENDIF                                                             FLODA2   1233
C-----------------------------------------------------------------------FLODA2   1234
C     LK=14,17,18 -- ADJUSTABLE TRANSFORMERS.FINAL RATIO IN TAB().ANG=0.FLODA2   1235
C     LK=15,16, -- ADJUSTABLE PHASE SHIFTERS.FINAL ANGLE IN TAB().RATIO=FLODA2   1236
C                                                                       FLODA2   1237
C     MATCH THE FROM/TO (K/J) BUS NUMBERS TO THE ARRAYS LTRA() AND LTRB(FLODA2   1238
C     LTRA() --> BUS NUMBER OF THE ADJUSTABLE TAB SIDE.                 FLODA2   1239
C     LTRB() --> BUS NUMBER OF THE NON-ADJUSTABLE TAB SIDE.             FLODA2   1240
C                                                                       FLODA2   1241
C                                                                       FLODA2   1242
      IF((LK.EQ.14).OR.                                                 FLODA2   1243
     1   (LK.EQ.15).OR.                                                 FLODA2   1244
     2   (LK.EQ.16).OR.                                                 FLODA2   1245
     3   (LK.EQ.17).OR.                                                 FLODA2   1246
     4   (LK.EQ.18))THEN                                                FLODA2   1247
         DO 440 JX=1,NOTRA                                              FLODA2   1248
         IF(LTRA(JX).GT.K)THEN                                          FLODA2   1249
            WRITE(MSG(1),1400) LK                                       FLODA2   1250
            CALL PRTMSG(1)                                              FLODA2   1251
            LINE='FLODA2: LOADFLOW TRANSFORMER/PHASE SHIFTER ERROR'     FLODA2   1252
            CALL ASTOP(LINE,48)                                         FLODA2   1253
         ENDIF                                                          FLODA2   1254
         IF(((LTRA(JX).EQ.K).AND.(LTRB(JX).EQ.J)).OR.                   FLODA2   1255
     1      ((LTRA(JX).EQ.J).AND.(LTRB(JX).EQ.K)))THEN                  FLODA2   1256
            ITRF=ITRF+1                                                 FLODA2   1257
            ITRF2=ITRF2+2                                               FLODA2   1258
            ITRAN(ITRF)=NL                                              FLODA2   1259
            IF((LK.EQ.14).OR.                                           FLODA2   1260
     1         (LK.EQ.17).OR.                                           FLODA2   1261
     2         (LK.EQ.18))THEN                                          FLODA2   1262
               RATIO(ITRF2-1)=TAP(JX)                                   FLODA2   1263
               RANG(ITRF2)=0.0                                          FLODA2   1264
            ENDIF                                                       FLODA2   1265
            IF((LK.EQ.15).OR.                                           FLODA2   1266
     1         (LK.EQ.16))THEN                                          FLODA2   1267
               RATIO(ITRF2-1)=1.0                                       FLODA2   1268
               RANG(ITRF2)=TAP(JX)                                      FLODA2   1269
            ENDIF                                                       FLODA2   1270
            GOTO 450                                                    FLODA2   1271
         ENDIF                                                          FLODA2   1272
C                                                                       FLODA2   1273
  440    CONTINUE                                                       FLODA2   1274
      ENDIF                                                             FLODA2   1275
  450 CONTINUE                                                          FLODA2   1276
C-----------------------------------------------------------------------FLODA2   1277
      GOTO 380                                                          FLODA2   1278
C                                                                       FLODA2   1279
C    ..UNTIL ALL BRANCH DATA HAVE BEEN PROCESS                          FLODA2   1280
C=======================================================================FLODA2   1281
C                                                                       FLODA2   1282
  460 CONTINUE                                                          FLODA2   1283
      IF(LFEPRI.NE.1) GO TO 490                                         FLODA2   1284
C                                                                       FLODA2   1285
C     2 TERMINAL DC IN OLD EPRI LOAD FLOW                               FLODA2   1286
C     NB: LT & HT BUSES NOT WORKED OUT YET!                             FLODA2   1287
C                                                                       FLODA2   1288
C     DC BUS & LINE INFORMATION TO BE SAVED                             FLODA2   1289
C                                                                       FLODA2   1290
      ICDC=2*NDCLIN                                                     FLODA2   1291
      LCDC=ICDC                                                         FLODA2   1292
      KCDC=ICDC                                                         FLODA2   1293
      ISIZEC=ICDC+1                                                     FLODA2   1294
      ILDC=NDCLIN                                                       FLODA2   1295
      ISIZEL=ILDC+1                                                     FLODA2   1296
      NUMNOD=2*NDCLIN                                                   FLODA2   1297
      NUMGRP=0                                                          FLODA2   1298
      IF(NDCLIN.EQ.0)GOTO 490                                           FLODA2   1299
  470 MDCLK=MDCLK+1                                                     FLODA2   1300
      MCON1=2*MDCLK-1                                                   FLODA2   1301
      MCON2=2*MDCLK                                                     FLODA2   1302
      IDC(MCON1)=MCON1                                                  FLODA2   1303
      IDC(MCON2)=MCON2                                                  FLODA2   1304
      K=IDCEX(MDCLK)/IPACK                                              FLODA2   1305
      J=MOD(IDCEX(MDCLK),IPACK)                                         FLODA2   1306
C      IF(LDEB)WRITE(IUD6,1010) K,J                                     FLODA2   1307
C                                                                       FLODA2   1308
      DCCNAM(MCON1)(1:8)=NCONV(MCON1)                                   FLODA2   1309
      DCCNAM(MCON2)(1:8)=NCONV(MCON2)                                   FLODA2   1310
      DCCNAM(MCON1)(9:16)='GROUND  '                                    FLODA2   1311
      DCCNAM(MCON2)(9:16)='GROUND  '                                    FLODA2   1312
      I=0                                                               FLODA2   1313
      DO 475 LL=1,NOBUS                                                 FLODA2   1314
      IF(NEWDC1(MCON1).EQ.INTNUM(LL)) THEN                              FLODA2   1315
         WRITE(DCCNAM(MCON1)(17:28),1520)                               FLODA2   1316
     &   INAMES(1,LL),INAMES(2,LL),INAMES(3,LL)                         FLODA2   1317
         I=I+1                                                          FLODA2   1318
      ELSE IF(NEWDC1(MCON2).EQ.INTNUM(LL)) THEN                         FLODA2   1319
         WRITE(DCCNAM(MCON2)(17:28),1520)                               FLODA2   1320
     &   INAMES(1,LL),INAMES(2,LL),INAMES(3,LL)                         FLODA2   1321
         I=I+1                                                          FLODA2   1322
      END IF                                                            FLODA2   1323
C      IF(LDEB) WRITE(IUD6,1530) DCCNAM(MCON1)(17:28)                   FLODA2   1324
C     &,DCCNAM(MCON2)(17:28),NEWDC1(MCON1),NEWDC1(MCON2),               FLODA2   1325
C     &LL,I,NOBUS                                                       FLODA2   1326
      IF(I.EQ.2) GO TO 476                                              FLODA2   1327
  475 CONTINUE                                                          FLODA2   1328
      LINE='FLODA2: DC BUS NAMES NOT FOUND'                             FLODA2   1329
      CALL ASTOP(LINE,30)                                               FLODA2   1330
  476 CONTINUE                                                          FLODA2   1331
      DCCNAM(MCON1)(29:29)='1'                                          FLODA2   1332
      DCCNAM(MCON2)(29:29)='1'                                          FLODA2   1333
C                                                                       FLODA2   1334
      BDIND(MCON1)=.TRUE.                                               FLODA2   1335
      BDIND(MCON2)=.TRUE.                                               FLODA2   1336
      BZIND(MCON1)=.TRUE.                                               FLODA2   1337
      BZIND(MCON2)=.TRUE.                                               FLODA2   1338
      QINV(MCON1)=.FALSE.                                               FLODA2   1339
      QINV(MCON2)=.TRUE.                                                FLODA2   1340
C                                                                       FLODA2   1341
      KK=4*MNEW(NEWDC1(MCON1))                                          FLODA2   1342
      VABASE(MCON1)=XBASKV(KK)                                          FLODA2   1343
C                                                                       FLODA2   1344
      JJ=4*MNEW(NEWDC1(MCON2))                                          FLODA2   1345
      VABASE(MCON2)=XBASKV(JJ)                                          FLODA2   1346
C      IF(LDEB)WRITE(IUD6,1020) MDCLK,VABASE(MCON1),VABASE(MCON2)       FLODA2   1347
C                                                                       FLODA2   1348
      IDCL(MDCLK)=MDCLK                                                 FLODA2   1349
      DCLNAM(MDCLK)(1:8)=NCONV(MCON1)                                   FLODA2   1350
      DCLNAM(MDCLK)(9:16)=NCONV(MCON2)                                  FLODA2   1351
      DCLNAM(MDCLK)(17:17)='1'                                          FLODA2   1352
      RDCOHM(MDCLK)=DTLOHM(MDCLK)                                       FLODA2   1353
      DCIMAX(MDCLK)=DCUR(MDCLK)                                         FLODA2   1354
      XLDC(MDCLK)=DHENRY(MDCLK)                                         FLODA2   1355
      CDCA(MDCLK)=DFARAD(MDCLK)                                         FLODA2   1356
      CDCB(MDCLK)=DFARAD(MDCLK)                                         FLODA2   1357
C      IF(LDEB)WRITE(IUD6,1030) RDCOHM(MDCLK),DCIMAX(MDCLK),            FLODA2   1358
C     &XLDC(MDCLK),CDCA(MDCLK)                                          FLODA2   1359
C                                                                       FLODA2   1360
      IDCNOD(MCON1)=NCONV(MCON1)                                        FLODA2   1361
      IDCNOD(MCON2)=NCONV(MCON2)                                        FLODA2   1362
C                                                                       FLODA2   1363
      IF((IDCBUS(MCON1).EQ.K).AND.                                      FLODA2   1364
     +   (IDCBUS(MCON2).EQ.J))THEN                                      FLODA2   1365
         IOFF=1                                                         FLODA2   1366
         KOFF=MCON1                                                     FLODA2   1367
      ELSE                                                              FLODA2   1368
         IF((IDCBUS(MCON2).NE.K).OR.                                    FLODA2   1369
     +      (IDCBUS(MCON1).NE.J))THEN                                   FLODA2   1370
            MSG(1)=' *** CHECK DC BUS ASSIGNMENT FOR EPRI-DC'           FLODA2   1371
            CALL PRTMSG(1)                                              FLODA2   1372
            LINE='FLODA2: CHECK DC BUS ASSIGNMENT FOR EPRI-DC'          FLODA2   1373
            CALL ASTOP(LINE,43)                                         FLODA2   1374
         ENDIF                                                          FLODA2   1375
         IOFF=-1                                                        FLODA2   1376
         KOFF=MCON2                                                     FLODA2   1377
      ENDIF                                                             FLODA2   1378
      NSBRDG(MCON1)=DBRIDG(KOFF)                                        FLODA2   1379
      NSBRDG(MCON2)=DBRIDG(KOFF+IOFF)                                   FLODA2   1380
      DCBR=PI32*DBRIDG(KOFF)*BKV(K)                                     FLODA2   1381
      DCBI=PI32*DBRIDG(KOFF+IOFF)*BKV(J)                                FLODA2   1382
      CNVMVA(MCON1)=0.0                                                 FLODA2   1383
      CNVMVA(MCON2)=0.0                                                 FLODA2   1384
      XCOHMS(MCON1)=DXOHM(KOFF)                                         FLODA2   1385
      XCOHMS(MCON2)=DXOHM(KOFF+IOFF)                                    FLODA2   1386
      CALPHA(MCON1)=COS(DTCLMX(KOFF))                                   FLODA2   1387
      CGAMMA(MCON2)=COS(DTCLMX(KOFF+IOFF))                              FLODA2   1388
      ALPMIN(MCON1)=DALFMN(KOFF)                                        FLODA2   1389
      ALPMIN(MCON2)=0.0                                                 FLODA2   1390
      ALPMAX(MCON1)=180.0                                               FLODA2   1391
      ALPMAX(MCON2)=180.0                                               FLODA2   1392
      GAMMIN(MCON1)=0.0                                                 FLODA2   1393
      GAMMIN(MCON2)=DALFMN(KOFF+IOFF)                                   FLODA2   1394
C                                                                       FLODA2   1395
      IF(DCBR.EQ.DCBI)GOTO 480                                          FLODA2   1396
      IEBK=1                                                            FLODA2   1397
      MSG(1)=                                                           FLODA2   1398
     *' *** ERROR DC KV BASE DIFFERENT FOR RECTIFIER AND INVERTER ENDS' FLODA2   1399
      CALL PRTMSG(1)                                                    FLODA2   1400
C                                                                       FLODA2   1401
  480 VDBASE=100.0                                                      FLODA2   1402
      PDBASE=BASPC                                                      FLODA2   1403
      PABASE=BASPC                                                      FLODA2   1404
C                                                                       FLODA2   1405
      TAPNOM(MCON1)=DTR(KOFF)                                           FLODA2   1406
      TAPNOM(MCON2)=DTR(KOFF+IOFF)                                      FLODA2   1407
      TAPPOS(MCON1)=1.0                                                 FLODA2   1408
      TAPPOS(MCON2)=1.0                                                 FLODA2   1409
C                                                                       FLODA2   1410
      PAHVDC(MCON1)=-DDCMW(KOFF)/PABASE                                 FLODA2   1411
      PAHVDC(MCON2)=DDCMW(KOFF+IOFF)/PABASE                             FLODA2   1412
      QAHVDC(MCON1)=-DQGEN(KOFF)/PABASE                                 FLODA2   1413
      QAHVDC(MCON2)=-DQGEN(KOFF+IOFF)/PABASE                            FLODA2   1414
C                                                                       FLODA2   1415
      VDCONV(MCON1)=DDCKV(KOFF)/VDBASE                                  FLODA2   1416
      VDCONV(MCON2)=DDCKV(KOFF+IOFF)/VDBASE                             FLODA2   1417
      XDCONV(MCON1)=DCUR(MDCLK)*VDBASE/PDBASE                           FLODA2   1418
      XDCONV(MCON2)=-DCUR(MDCLK)*VDBASE/PDBASE                          FLODA2   1419
      VDCNOD(MCON1)=VDCONV(MCON1)                                       FLODA2   1420
      VDCNOD(MCON2)=VDCONV(MCON2)                                       FLODA2   1421
      XDNODE(MCON1)=XDCONV(MCON1)                                       FLODA2   1422
      XDNODE(MCON2)=XDCONV(MCON2)                                       FLODA2   1423
C                                                                       FLODA2   1424
C     COMPUTE HT CONVERTER BUS VOLTAGES                                 FLODA2   1425
C                                                                       FLODA2   1426
      KRH=NEWDC1(MCON1)                                                 FLODA2   1427
      KIH=NEWDC1(MCON2)                                                 FLODA2   1428
      JRH=MNEW(KRH)                                                     FLODA2   1429
      JIH=MNEW(KIH)                                                     FLODA2   1430
C      IF(LDEB)WRITE(IUD6,1040) KRH,KIH,JRH,JIH                         FLODA2   1431
C                                                                       FLODA2   1432
      KK=(JRH-1)*8                                                      FLODA2   1433
      ERRH=ERBUS(KK+1)*DTR(KOFF)*BKV(K)                                 FLODA2   1434
      ERIH=EIBUS(KK+2)*DTR(KOFF)*BKV(K)                                 FLODA2   1435
      EMR=ERRH**2+ERIH**2                                               FLODA2   1436
      ANGR=ATAN(ERIH/ERRH)                                              FLODA2   1437
C                                                                       FLODA2   1438
      KK=(JIH-1)*8                                                      FLODA2   1439
      EIRH=ERBUS(KK+1)*DTR(KOFF+IOFF)*BKV(J)                            FLODA2   1440
      EIIH=EIBUS(KK+2)*DTR(KOFF+IOFF)*BKV(J)                            FLODA2   1441
      EMI=EIRH**2+EIIH**2                                               FLODA2   1442
      ANGI=ATAN(EIIH/EIRH)                                              FLODA2   1443
C      IF(LDEB)WRITE(IUD6,1050) ERRH,ERIH,ANGR,EIRH,EIIH,ANGI           FLODA2   1444
C                                                                       FLODA2   1445
C     COMPUTE ANGLES                                                    FLODA2   1446
C                                                                       FLODA2   1447
      VDCR0=PI32*DBRIDG(KOFF)*SQRT(EMR)                                 FLODA2   1448
      VDCI0=PI32*DBRIDG(KOFF+IOFF)*SQRT(EMI)                            FLODA2   1449
      CXALFR=(DDCKV(KOFF)+DCUR(MDCLK)*3.0*DXOHM(KOFF)/PII)              FLODA2   1450
     +/VDCR0                                                            FLODA2   1451
      CXGAMR=(-DDCKV(KOFF)+DCUR(MDCLK)*3.0*DXOHM(KOFF)/PII)             FLODA2   1452
     +/VDCR0                                                            FLODA2   1453
      CXGAMI=(DDCKV(KOFF+IOFF)+DCUR(MDCLK)*3.0*DXOHM(KOFF+IOFF)/PII)    FLODA2   1454
     +/VDCI0                                                            FLODA2   1455
      CXALFI=(-DDCKV(KOFF+IOFF)+DCUR(MDCLK)*3.0*DXOHM(KOFF+IOFF)/PII)   FLODA2   1456
     +/VDCI0                                                            FLODA2   1457
      CGAMMA(MCON1)=CXGAMR                                              FLODA2   1458
      CALPHA(MCON2)=CXALFI                                              FLODA2   1459
      ERRA=ABS(CXALFR-CALPHA(MCON1))                                    FLODA2   1460
      ERRG=ABS(CXGAMI-CGAMMA(MCON2))                                    FLODA2   1461
      IF(ERRA.GT.0.0001.OR.ERRG.GT.0.0001)THEN                          FLODA2   1462
         WRITE(MSG(1),1060) CXALFR,CALPHA(MCON1)                        FLODA2   1463
         WRITE(MSG(2),1061) CXGAMI,CGAMMA(MCON2)                        FLODA2   1464
         CALL PRTMSG(2)                                                 FLODA2   1465
      ENDIF                                                             FLODA2   1466
C                                                                       FLODA2   1467
C      IF(LDEB)WRITE(IUD6,1070) VDCR0,VDCI0,CXALFR,CXGAMI               FLODA2   1468
C     &,CALPHA(MCON1),CGAMMA(MCON2)                                     FLODA2   1469
C                                                                       FLODA2   1470
C     CALCULATE POWER FACTORS                                           FLODA2   1471
C                                                                       FLODA2   1472
      PHIDC(MCON1)=ACOS(DDCKV(KOFF)/VDCR0)                              FLODA2   1473
      PHIDC(MCON2)=ACOS(DDCKV(KOFF+IOFF)/VDCI0)                         FLODA2   1474
C                                                                       FLODA2   1475
C     CALCULATE AC CURRENT                                              FLODA2   1476
C                                                                       FLODA2   1477
      CIRR=(-DDCMW(KOFF)*ERRH-DQGEN(KOFF)*ERIH)/EMR                     FLODA2   1478
      CIRI=(-DDCMW(KOFF)*ERIH+DQGEN(KOFF)*ERRH)/EMR                     FLODA2   1479
      CIIR=(+DDCMW(KOFF+IOFF)*EIRH-DQGEN(KOFF+IOFF)*EIIH)/EMI           FLODA2   1480
      CIII=(+DDCMW(KOFF+IOFF)*EIIH+DQGEN(KOFF+IOFF)*EIRH)/EMI           FLODA2   1481
      XACURR(MCON1)=-SQRT(CIRR**2+CIRI**2)*BKV(K)/PABASE                FLODA2   1482
      XACURR(MCON2)=SQRT(CIIR**2+CIII**2)*BKV(J)/PABASE                 FLODA2   1483
C      IF(LDEB)WRITE(IUD6,1080) CIRR,CIRI,CIIR,CIII                     FLODA2   1484
C                                                                       FLODA2   1485
C      IF(LDEB)THEN                                                     FLODA2   1486
C         WRITE(IUD6,1450) ICDC,ISIZEC,ILDC,ISIZEL,NUMNOD,NUMGRP        FLODA2   1487
C         WRITE(IUD6,1450) (IDC(I), I = 1, ICDC)                        FLODA2   1488
C         WRITE(IUD6,1450) (IDCFRE(I), I = 1, NDCC)                     FLODA2   1489
C         WRITE(IUD6,1460) (DCCNAM(IPOSN),BDIND(IPOSN),VABASE(IPOSN),   FLODA2   1490
C     1   CNGRP(IPOSN), CNZONE(IPOSN), NSBRDG(IPOSN),                   FLODA2   1491
C     2   XCOHMS(IPOSN), TAPNOM(IPOSN), TAPSTP(IPOSN),                  FLODA2   1492
C     3   AMINTP(IPOSN), AMAXTP(IPOSN), ALPMIN(IPOSN),                  FLODA2   1493
C     4   ALPMAX(IPOSN), GAMMIN(IPOSN), TEMP,IPOSN=1,2)                 FLODA2   1494
C         WRITE(IUD6,1470) (BZIND(IPOSN),SPTYPE(IPOSN),USERD(1,IPOSN)   FLODA2   1495
C     1   ,USERD(2,IPOSN), QINV(IPOSN), CNVMVA(IPOSN)                   FLODA2   1496
C     2   ,DCPMIN(IPOSN), DCPMAX(IPOSN), DCQMIN(IPOSN)                  FLODA2   1497
C     3   ,DCQMAX(IPOSN), BIASO(IPOSN),IPOSN=1,2)                       FLODA2   1498
C         WRITE(IUD6,1450) (IDCL(I), I = 1, ILDC)                       FLODA2   1499
C         WRITE(IUD6,1450) (IDCFRL(I), I = 1, NDCC)                     FLODA2   1500
C         IPOSN=1                                                       FLODA2   1501
C         WRITE(IUD6,1480) DCLNAM(IPOSN), DLGRP(IPOSN),                 FLODA2   1502
C     3   DLOWN(IPOSN),                                                 FLODA2   1503
C     1   DLZONE(IPOSN), RDCOHM(IPOSN), XLDC(IPOSN),                    FLODA2   1504
C     2   CDCA(IPOSN),CDCB(IPOSN), DCIMAX(IPOSN)                        FLODA2   1505
C         WRITE(IUD6,1490) (IDCNOD(I), I = 1, NUMNOD)                   FLODA2   1506
C         WRITE(IUD6,1490) (GROUP(I), I = 1, NUMGRP)                    FLODA2   1507
C         WRITE(IUD6,1500) (VDCNOD(I), I = 1, NUMNOD)                   FLODA2   1508
C         WRITE(IUD6,1500) (XDNODE(I), I = 1, NUMNOD)                   FLODA2   1509
C         WRITE(IUD6,1500) PABASE, VDBASE, PDBASE                       FLODA2   1510
C      ENDIF                                                            FLODA2   1511
C                                                                       FLODA2   1512
      IF(MDCLK.LT.NDCLIN)GO TO 470                                      FLODA2   1513
C                                                                       FLODA2   1514
  490 CONTINUE                                                          FLODA2   1515
C                                                                       FLODA2   1516
C     MTDC IN THE EPRI LOAD FLOW                                        FLODA2   1517
C                                                                       FLODA2   1518
      MCON=0                                                            FLODA2   1519
      NACBUS=0                                                          FLODA2   1520
      IF(ICDC.NE.0)THEN                                                 FLODA2   1521
  500    MCON=MCON+1                                                    FLODA2   1522
         IPOSN=IDC(MCON)                                                FLODA2   1523
         CALL CHKBUS(DCCNAM(IPOSN)(17:28),IBUSOK)                       FLODA2   1524
         IF(IBUSOK.LE.0)THEN                                            FLODA2   1525
            IEBK=1                                                      FLODA2   1526
            WRITE(MSG(1),1510) IPOSN,DCCNAM(IPOSN)(17:28)               FLODA2   1527
            CALL PRTMSG(1)                                              FLODA2   1528
         ENDIF                                                          FLODA2   1529
         JDCC(IPOSN)=IBUSOK                                             FLODA2   1530
         IF(MCON.LT.ICDC) GO TO 500                                     FLODA2   1531
C                                                                       FLODA2   1532
C     Initialize udc arrays, structure arrays and fixed arrays.         FLODA2   1533
C                                                                       FLODA2   1534
         DO 550 KI=1,ICDC                                               FLODA2   1535
         IPOSN=IDC(KI)                                                  FLODA2   1536
         NLF=JDCC(IPOSN)                                                FLODA2   1537
         FOUND =.FALSE.                                                 FLODA2   1538
         I = 1                                                          FLODA2   1539
  520    IF(FOUND.OR.I.GT.NACBUS) GOTO 530                              FLODA2   1540
         IF(NLF.EQ.IUQABU(I))THEN                                       FLODA2   1541
            FOUND =.TRUE.                                               FLODA2   1542
         ELSE                                                           FLODA2   1543
            I = I + 1                                                   FLODA2   1544
         ENDIF                                                          FLODA2   1545
         GOTO 520                                                       FLODA2   1546
  530    CONTINUE                                                       FLODA2   1547
         IF(.NOT.FOUND)THEN                                             FLODA2   1548
            NACBUS = NACBUS+1                                           FLODA2   1549
            IUQABU(NACBUS) = NLF                                        FLODA2   1550
C            IF(LDEB)WRITE(IUD6,1540) NACBUS,NLF                        FLODA2   1551
         ENDIF                                                          FLODA2   1552
C                                                                       FLODA2   1553
  550    CONTINUE                                                       FLODA2   1554
      ENDIF                                                             FLODA2   1555
C                                                                       FLODA2   1556
      NACBU2=NACBUS                                                     FLODA2   1557
      NACTOT=NACBUS                                                     FLODA2   1558
                                                                        FLODA2   1559
      LDUMP=0                                                           FLODA2   1560
      IF(IEBK.EQ.0) RETURN                                              FLODA2   1561
      LINE='FLODA2: EPRI LOADFLOW FILE ERROR'                           FLODA2   1562
      CALL ASTOP(LINE,32)                                               FLODA2   1563
C                                                                       FLODA2   1564
 1010 FORMAT(2X,'K=',I4,1X,'J=',I4)                                     FLODA2   1565
 1020 FORMAT(2X,'DCLINK #=',I3,1X,'AC BASE KV; ',2F10.4)                FLODA2   1566
 1030  FORMAT(2X,'RDC= ',F10.4,' DCCUR=',F10.4,' DCXL=',                FLODA2   1567
     +F10.4,' DCCL=',F10.4)                                             FLODA2   1568
 1040 FORMAT(2X,4(I3,2X))                                               FLODA2   1569
 1050 FORMAT(2X,'ERRH=',F10.5,'ERIH=',F10.5,'ANGR=',F10.6,              FLODA2   1570
     +'EIIH=',F10.5,'EIRH=',F10.5,'ANGI=',F10.5)                        FLODA2   1571
 1060 FORMAT(' *** FIRING ANGLES MISMATCH COS(ALFA)',2F10.4)            FLODA2   1572
 1061 FORMAT('                            COS(GAMA)',2F10.4)            FLODA2   1573
 1070 FORMAT(2X,'VDCR0=',F10.6,'VDCI0=',F10.6,4(1X,F10.6))              FLODA2   1574
 1080 FORMAT(2X,'AC CUR=',(1X,F10.4))                                   FLODA2   1575
C 1090 FORMAT(2X,'LT VAR=',F10.5,1X,F10.5,                              FLODA2   1576
C     +'LT KV=',4(1X,F10.5))                                            FLODA2   1577
C 1100 FORMAT(2X,'KK=',I3,2X,'ER=',F10.5,'EI=',F10.5)                   FLODA2   1578
C 1110  FORMAT(I5,2A4)                                                  FLODA2   1579
 1120 FORMAT (1X,'BUS',2X,'    GEN MW',3X,'    GEN MX',3X,'   LOAD MW', FLODA2   1580
     +3X,'   LOAD MX',3X,' CHARGE MW',3X,'CHARGE MX',1X,'AREA',1X,      FLODA2   1581
     +' VOLTAGE',1X,' ANGLE',5X,' BUS NAME')                            FLODA2   1582
 1130 FORMAT (I5,2X,6F13.5,I4,F8.5,F10.4,2X,3A4,I5)                     FLODA2   1583
 1140 FORMAT(' *** ERROR(FLODA2) BUS: ',3A4,' HAS DUPLICATED DATA ')    FLODA2   1584
 1150 FORMAT(11X,'THE PROGRAM LIMIT OF ',I5,'BUS ',3A4)                 FLODA2   1585
 1160 FORMAT(' *** ERROR(FLODA2) BUSES: ',2(3A4,1X),'CCT: ',I5)         FLODA2   1586
 1170 FORMAT(' *** ERROR LINE ID ',3I6,' EXCEEDS THE PROGRAM')          FLODA2   1587
 1171 FORMAT(11X,'LIMIT OF ',I10,' LINES')                              FLODA2   1588
 1180 FORMAT(1X,'FLAG ,IPGM,IVER,PGM : ',F10.4,2I5,5A4)                 FLODA2   1589
 1190 FORMAT(1X,'I6, NRL1, NRL2, NOLIN, NLIN, NOBUS,NOTRA,TLE :',/1X,   FLODA2   1590
     1I5,2A4,4I4,3(/2X,18A4))                                           FLODA2   1591
 1200 FORMAT(/T5,'I',T10,'INTNUM',T20,'IXCROS',T40,'BKV',               FLODA2   1592
     1 T50,'PL',T60,'QL',T70,'GSR',T80,'BSR',T90,'XXPG',T100,'XXQG',    FLODA2   1593
     2 T110,'XXEA',T120,'XXEB'/)                                        FLODA2   1594
 1210 FORMAT(T1,I5,T10,I5,T20,I5,T40,F10.4,                             FLODA2   1595
     1 T50,F10.4,T60,F10.4,T70,F10.4,T80,F10.4,T90,F10.4,T100,F10.4,    FLODA2   1596
     2 T110,F10.4,T120,F10.4)                                           FLODA2   1597
 1220 FORMAT(/T5,'I',T10,'NARE',T20,'NBNEWI',T30,'INAME1',T40,          FLODA2   1598
     1 'INAME2',T50,'INAME3',T60,'KIND1(I)',T70,'KIND2(I)'/)            FLODA2   1599
 1230 FORMAT(T1,I4,I5,T20,I5,T30,A4,T40,A4,T50,A4,T60,I5,T70,I5)        FLODA2   1600
 1240 FORMAT(/T5,'I',T10,'LINAB1(I)',T20,'LINAB2(I)',T30,'LINDX(I)',/)  FLODA2   1601
 1250 FORMAT(T1,I5,T10,I6,T20,I6,T30,I10)                               FLODA2   1602
 1260 FORMAT(/T5,'I',T10,'LKIND1(I)',T20,'LKIND2(I)',T30,'LCIRC1(I)',   FLODA2   1603
     1T40,'LCIRC2(I)',T50,' G(I)',T60,' B(I)',                          FLODA2   1604
     1T70,'PGC1(I)',T80,'PBC1(I)',T90,'PGC2(I)',T100, 'PBC2(I)',/)      FLODA2   1605
 1270 FORMAT(T1,I5,T10,I6,T20,I6,T30,I6,T40,I6,T50,F10.4,T60,F10.4,     FLODA2   1606
     1T70,F10.4,T80,F10.4,T90,F10.4,T100,F10.4)                         FLODA2   1607
 1280 FORMAT(/T5,'I',T10,'LTRA(I)',T20,'LTRB(I)',T30,'TAP(I)',/)        FLODA2   1608
 1290 FORMAT(T1,I5,T10,I6,T20,I6,T30,F10.4)                             FLODA2   1609
 1320 FORMAT(14X,'IT IS A ',5A4,'.')                                    FLODA2   1610
 1340 FORMAT (' *** ERROR THE SPECIFIED RECORD IS NOT ON THE TAPE.')    FLODA2   1611
 1350 FORMAT(' *** ERROR THE SYSTEM SIZE OF',I5,' BUSES EXCEEDS')       FLODA2   1612
 1351 FORMAT(14X,'THE PROGRAM LIMIT OF',I5,' LINES.')                   FLODA2   1613
 1360 FORMAT (' *** CARD IMAGE*LDHIST',2I5,8X,2A4)                      FLODA2   1614
 1370 FORMAT ('0*MESSAGE   RECORD NUMBER', I3, ' HAS BEEN LOADED FRO',  FLODA2   1615
     1       'M TAPE WITH CASE ID.', 2A4, ' FROM TAPE HANDLER', I3,     FLODA2   1616
     2       / 12X, 'WITH THE TITLE BELOW:', 3(/ 20X, 18A4))            FLODA2   1617
 1380 FORMAT('0*MESSAGE   THERE ARE',I5,' BUSES IN THIS SYSTEM.')       FLODA2   1618
 1390 FORMAT(' *** ERROR CAN NOT READ VERSION ',I3,' LOAD FLOW DATA')   FLODA2   1619
 1400 FORMAT(' *** ERROR(FLODA2) LINE TYPE ',I3                         FLODA2   1620
     *,' TRANSFORMER/PHASE SHIFTER')                                    FLODA2   1621
 1410 FORMAT(1X,'%DEBUG(FLODA2) I= ',I5,' II= ',I5,' G= ',F10.4,        FLODA2   1622
     1   ' B= ',F10.4,' PGC1= ',F10.4,' PBC1= ',F10.4,                  FLODA2   1623
     2   ' PGC2= ',F10.4,' PBC2= ',F10.4)                               FLODA2   1624
 1420 FORMAT(/,1X,2I4,/,1X,10I10,/,1X,10F10.4,/,1X,10F10.4,/,1X,        FLODA2   1625
     +10F10.4,/,1X,10F10.4,/,1X,10F10.4,/,1X,10I10,/,1X,10F10.4,//,     FLODA2   1626
     +1X,10I10,/,1X,10I10,//,16(1X,10F10.4,/,1X,10F10.4,//),2(1X,       FLODA2   1627
     +10I10,/,1X,10I10,//),2(2X,10F10.4,/,10F10.4,//),1X,I10)           FLODA2   1628
 1430 FORMAT(/,10(1X,10(1X,F10.4),/),/,10(1X,10(1X,I5),/),/)            FLODA2   1629
 1440 FORMAT(3(1X,10F10.4,/,1X,10F10.4,//))                             FLODA2   1630
 1450 FORMAT(10I10)                                                     FLODA2   1631
 1460 FORMAT(A30,9X,L1,F10.5,2A10,I10,/,9F10.3)                         FLODA2   1632
 1470 FORMAT(9X,L1,A10,2F10.3,9X,L1,6F10.3)                             FLODA2   1633
 1480 FORMAT(A20,3A10,6F10.3)                                           FLODA2   1634
 1490 FORMAT(10A10)                                                     FLODA2   1635
 1500 FORMAT(10F10.5)                                                   FLODA2   1636
 1510 FORMAT(' *** CONVERTER BUS DCCNAM(',I2,')=',A12,' NOT IN THE'     FLODA2   1637
     &,' BASE CASE LOADFLOW')                                           FLODA2   1638
 1520 FORMAT(1X,3A4,I5)                                                 FLODA2   1639
 1530 FORMAT(1X,'DCCNAM1,DCCNAM2,NEWDC1,NEWDC2,LL,I,NOBUS:',/,2A13,5I6) FLODA2   1640
 1540 FORMAT(1X,'NACBUS,NLF:',2I6)                                      FLODA2   1641
 1550 FORMAT('  AREA NAME            INTERNAL AREA NUMBER',I5 )         FLODA2   1642
 1560 FORMAT(1X,A4,5X,I5)                                               FLODA2   1643
 1570 FORMAT('  ZONE NAME                ZONE NUMBER',I5)               FLODA2   1644
 1580 FORMAT(A20,3A10,I10)                                              FLODA2   1645
 1590 FORMAT(' *** ERROR VERSION ',I3,' SHOULD BE USED TO REPRESENT')   FLODA2   1646
 1600 FORMAT(11X,'THE DC MODEL INSTEAD OF VERSION',I3)                  FLODA2   1647
      END                                                               FLODA2   1648
