CFPRIME YSELF                                                           YSELF       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 YSELF                                                  YSELF       3
CD                                                                      YSELF       4
CD    TO PERFORM THE FOLLOWING TASKS:                                   YSELF       5
CD                                                                      YSELF       6
CD    1. BUILD THE SELF ADMITTANCE OF THE NETWORK MATRIX BASED ON THE   YSELF       7
CD       LOADFLOW AND THE TRANSIENT MODEL REPRESENTATIONS               YSELF       8
CD    2. INITIALIZE THE NONLINEAR LOADS                                 YSELF       9
CD    3. PRINT NETTING INFORMATION OF GENERATORS AND LOADS              YSELF      10
CD    4. BUILD LOAD TABLE AND GENERATOR CURRENT ARRAYS                  YSELF      11
CD                                                                      YSELF      12
      INCLUDE 'PARX.INS'                                                YSELF      13
      INCLUDE 'CNREC1.INS'                                              YSELF      14
      INCLUDE 'CNFLAG.INS'                                              YSELF      15
      INCLUDE 'CNPT.INS'                                                YSELF      16
      INCLUDE 'CNIPTR.INS'                                              YSELF      17
      INCLUDE 'CNVOLT.INS'                                              YSELF      18
      INCLUDE 'CNSTN.INS'                                               YSELF      19
      INCLUDE 'CNB0.INS'                                                YSELF      20
      INCLUDE 'CNB1.INS'                                                YSELF      21
      INCLUDE 'CNB3.INS'                                                YSELF      22
      INCLUDE 'CNB5.INS'                                                YSELF      23
      INCLUDE 'CNB6.INS'                                                YSELF      24
      INCLUDE 'CNB8.INS'                                                YSELF      25
      INCLUDE 'CNB10.INS'                                               YSELF      26
      INCLUDE 'CNB19.INS'                                               YSELF      27
      INCLUDE 'CNMPAR.INS'                                              YSELF      28
      INCLUDE 'CNSVS.INS'                                               YSELF      29
      INCLUDE 'CNSPC1.INS'                                              YSELF      30
      INCLUDE 'CNPARX.INS'                                              YSELF      31
      INCLUDE 'CNNNEW.INS'                                              YSELF      32
      INCLUDE 'CNMNEW.INS'                                              YSELF      33
      INCLUDE 'CNLFDA.INS'                                              YSELF      34
      INCLUDE 'CNJDAT.INS'                                              YSELF      35
      INCLUDE 'CNSPDI.INS'                                              YSELF      36
      INCLUDE 'CNMDAT.INS'                                              YSELF      37
      INCLUDE 'CNLSTA.INS'                                              YSELF      38
      INCLUDE 'CNQSTA.INS'                                              YSELF      39
      INCLUDE 'CNUNIT.INS'                                              YSELF      40
      INCLUDE 'UDCF.INS'                                                YSELF      41
C                                                                       YSELF      42
C      INCLUDE 'NLTERM.INS/LIST'                                        YSELF      43
      INCLUDE 'EQQSTA.INS'                                              YSELF      44
C                                                                       YSELF      45
      INCLUDE 'CNNBLD.INS'                                              YSELF      46
      INCLUDE 'CNREN.INS'                                               YSELF      47
      INCLUDE 'CNMSG.INS'                                               YSELF      48
      INCLUDE 'CNLSMB.INS'                                              YSELF      49
      INCLUDE 'CNLCOM.INS'                                              YSELF      50
      INCLUDE 'CNGSRC.INS'                                              YSELF      51
C                                                                       YSELF      52
      DIMENSION BUSKK(NB*2)                                             YSELF      53
      EQUIVALENCE (BUSKK(1),STAIRS(1))                                  YSELF      54
      COMPLEX CMPLX                                                     YSELF      55
      DIMENSION BUF(10)                                                 YSELF      56
      DIMENSION NLK(7),NNAME(7),NNAME2(7),NNAME3(7),XGMW(3),XGMX(3),    YSELF      57
     *          NPF(3),NQF(3)                                           YSELF      58
      CHARACTER*80 LINE                                                 YSELF      59
      CHARACTER*61 PMSG1,PMSG2                                          YSELF      60
      CHARACTER*7  SUBPMT                                               YSELF      61
      CHARACTER*4  NGRI,GUNID(3)                                        YSELF      62
C      INTEGER*2 NLFLMB,NLFSMB                                          YSELF      63
C      COMMON /NLFCLM/ NLFLMB(NB),NLFSMB(NB)                            YSELF      64
C      INTEGER*2 NMTNLD                                                 YSELF      65
C      COMPLEX VOLBAR                                                   YSELF      66
C      COMMON /MOTVOL/ VOLBAR(NZL),NMTNLD(2*NZL)                        YSELF      67
C                                                                       YSELF      68
      INCLUDE 'CDLCOM.INS'                                              YSELF      69
C                                                                       YSELF      70
      LDEB=(JDEB(27).NE.0)                                              YSELF      71
C                                                                       YSELF      72
      WRITE(LOUT,'(/A/)')                                               YSELF      73
     *'  CALCULATING NETWORK SELF-ADMITTANCES.  WAIT ...'               YSELF      74
C                                                                       YSELF      75
      IEBK=0                                                            YSELF      76
      IEBK1=0                                                           YSELF      77
      IEBK2=0                                                           YSELF      78
      IEBK3=0                                                           YSELF      79
      IEBK4=0                                                           YSELF      80
      IQIM=0                                                            YSELF      81
C                                                                       YSELF      82
      K=NXB*2                                                           YSELF      83
      CALL FMOVE(0,BUSKK,BUSKK,K)                                       YSELF      84
      CALL HMOVE(0,JAREA,JAREA,JAR)                                     YSELF      85
      CALL HMOVE(0,JZONE,JZONE,JZN)                                     YSELF      86
      CALL HMOVE(0,JBLD,JBLD,NXB)                                       YSELF      87
      CALL HMOVE(0,ISBUS,ISBUS,50)                                      YSELF      88
C                                                                       YSELF      89
C  NOTE:                                                                YSELF      90
C                                                                       YSELF      91
C    ACCOUNTING THE REACTORS AND CAPACITORS                             YSELF      92
C                                                                       YSELF      93
      IXAREA=1                                                          YSELF      94
      IXZONE=1                                                          YSELF      95
      KSKIP=0                                                           YSELF      96
      ILOAD=0                                                           YSELF      97
      DO 350 JJ=1,LBUSNO                                                YSELF      98
      I=NNEW(JJ)                                                        YSELF      99
      IF (I.LE.0) GO TO 350                                             YSELF     100
      J=MNEW(JJ)                                                        YSELF     101
      IF(J.GT.0)THEN                                                    YSELF     102
      KK=(J-1)*8                                                        YSELF     103
      II=(I-1)*3                                                        YSELF     104
      JL=J*4-4                                                          YSELF     105
      INAME(II+1)=NAMES(KK+6)                                           YSELF     106
      INAME(II+2)=NAMES(KK+7)                                           YSELF     107
      INAME(II+3)=NAMES(KK+8)                                           YSELF     108
C                                                                       YSELF     109
C        ZONE/AREA STORAGE                                              YSELF     110
C                                                                       YSELF     111
      NBARZO(I)=IBAR(JL+3)                                              YSELF     112
      ILK=IBAR(JL+3)                                                    YSELF     113
      CALL UPACKI(MZONE,MAREA1,ILK)                                     YSELF     114
      IF(KSKIP.EQ.0)THEN                                                YSELF     115
       JAREA(IXAREA)=MAREA1                                             YSELF     116
       JZONE(IXZONE)=MZONE                                              YSELF     117
       KSKIP=1                                                          YSELF     118
      ENDIF                                                             YSELF     119
       ICHECK=1                                                         YSELF     120
      DO 100 IZ=1,IXAREA                                                YSELF     121
       IF(JAREA(IZ).EQ.MAREA1)THEN                                      YSELF     122
        ICHECK=0                                                        YSELF     123
        GOTO 150                                                        YSELF     124
       ENDIF                                                            YSELF     125
  100 CONTINUE                                                          YSELF     126
C                                                                       YSELF     127
  150 IF(ICHECK.EQ.1)THEN                                               YSELF     128
       IXAREA=IXAREA+1                                                  YSELF     129
       JAREA(IXAREA)=MAREA1                                             YSELF     130
      ENDIF                                                             YSELF     131
C                                                                       YSELF     132
      ICHECK=1                                                          YSELF     133
      DO 200 IZ=1,IXZONE                                                YSELF     134
       IF(JZONE(IZ).EQ.MZONE)THEN                                       YSELF     135
        ICHECK=0                                                        YSELF     136
        GOTO 250                                                        YSELF     137
       ENDIF                                                            YSELF     138
  200 CONTINUE                                                          YSELF     139
C                                                                       YSELF     140
  250 IF(ICHECK.EQ.1)THEN                                               YSELF     141
       IXZONE=IXZONE+1                                                  YSELF     142
       JZONE(IXZONE)=MZONE                                              YSELF     143
      ENDIF                                                             YSELF     144
C                                                                       YSELF     145
      II=(I-1)*2                                                        YSELF     146
      VOLT1=ERBUS(KK+1)                                                 YSELF     147
      VOLT2=EIBUS(KK+2)                                                 YSELF     148
      VOLT(I)=CMPLX(VOLT1,VOLT2)                                        YSELF     149
      RIYGRJ=RIYGR(KK+5)                                                YSELF     150
      QFARX=0.0                                                         YSELF     151
      NTHSRI=NTHSR(3,I)                                                 YSELF     152
      IF (NTHSRI.EQ.0) GO TO 300                                        YSELF     153
      JS=JSDAT(NTHSRI)                                                  YSELF     154
      IF (IDDAT(JS+9).LT.6.OR.IDDAT(JS+9).EQ.50) GO TO 300              YSELF     155
      NROLD(NTHSRI)=I                                                   YSELF     156
      JS=JSDAT(NTHSRI)                                                  YSELF     157
      IQFARX=IDDAT(JS+11)                                               YSELF     158
      QFARX=IQFARX                                                      YSELF     159
      QFARX=QFARX*RIYGRJ/100.                                           YSELF     160
      BSVCT(NTHSRI)=QFARX                                               YSELF     161
      RIYGRJ=RIYGRJ-QFARX                                               YSELF     162
  300 CONTINUE                                                          YSELF     163
      BKK=BSTC(KK+3)-RIYGRJ                                             YSELF     164
      GKK=RYGR(KK+4)                                                    YSELF     165
      STAIRS(I)=STAIRS(I)+CMPLX(GKK,BKK)                                YSELF     166
C                                                                       YSELF     167
C    STORE THE ORIGINAL LOAD AT THE LOAD BUSES                          YSELF     168
C                                                                       YSELF     169
      IF(IBAR(JL+1).EQ.0.AND.IBAR(JL+2).EQ.0)GOTO 350                   YSELF     170
C      IF(ABS(BMW(JL+1)).EQ.0.0.AND.ABS(BMX(JL+2)).EQ.0.0)GOTO 110      YSELF     171
      ILOAD=ILOAD+1                                                     YSELF     172
      IF(ILOAD.GE.JLOAD)THEN                                            YSELF     173
         IEBK1=1                                                        YSELF     174
         WRITE(MSG(1),7250)                                             YSELF     175
         WRITE(MSG(2),7300) JLOAD                                       YSELF     176
         CALL PRTMSG(2)                                                 YSELF     177
         GOTO 350                                                       YSELF     178
      ENDIF                                                             YSELF     179
      KLOAD=ILOAD*12                                                    YSELF     180
      JBLD(I)=ILOAD                                                     YSELF     181
      NBLD(KLOAD-11)=IBAR(JL+3)                                         YSELF     182
      NBLD(KLOAD-10)=100                                                YSELF     183
      BLD(KLOAD-9)=BMW(JL+1)/BASPC                                      YSELF     184
      BLD(KLOAD-8)=BMX(JL+2)/BASPC                                      YSELF     185
      BLD(KLOAD-7)=CABS(VOLT(I))                                        YSELF     186
      NBLD(KLOAD-6)=100                                                 YSELF     187
      BLD(KLOAD-5)=0.                                                   YSELF     188
      BLD(KLOAD-4)=0.                                                   YSELF     189
      BLD(KLOAD-3)=0.                                                   YSELF     190
      BLD(KLOAD-2)=0.                                                   YSELF     191
C                                                                       YSELF     192
C   STORE THE SHUNT DEVICE                                              YSELF     193
C                                                                       YSELF     194
      BLD(KLOAD-1)=GKK                                                  YSELF     195
      BLD(KLOAD)=BKK                                                    YSELF     196
C                                                                       YSELF     197
      IF(LDEB)WRITE(IUD6,5000) JJ,I,STAIRS(I)                           YSELF     198
     *,BSTC(KK+3),RYGR(KK+4),RIYGR(KK+5),QFARX                          YSELF     199
      ENDIF                                                             YSELF     200
  350 CONTINUE                                                          YSELF     201
C                                                                       YSELF     202
      IF(LDEB)THEN                                                      YSELF     203
      DO 400 I=1,NLFBUS                                                 YSELF     204
      IF(JBLD(I).EQ.0)GOTO 400                                          YSELF     205
      II=I*12                                                           YSELF     206
      ILK=NBLD(II-11)                                                   YSELF     207
      CALL UPACKI(IZONE,IAREA,ILK)                                      YSELF     208
C                                                                       YSELF     209
      IPFA=NBLD(II-6)                                                   YSELF     210
      IQFA=NBLD(II-10)                                                  YSELF     211
                                                                        YSELF     212
      NLF=NOLD(I)                                                       YSELF     213
      WRITE(IUD6,6300)I,IAREA,IZONE,NLF,BLD(II-9),BLD(II-8),IPFA,IQFA   YSELF     214
  400 CONTINUE                                                          YSELF     215
      WRITE(IUD6,6350)(JBLD(I),I=1,NLFBUS)                              YSELF     216
      ENDIF                                                             YSELF     217
C                                                                       YSELF     218
C     ACCOUNTING THE SYNCHRONOUS MOTOR LOAD                             YSELF     219
C                                                                       YSELF     220
      IF (NT.EQ.0) GO TO 600                                            YSELF     221
      I=0                                                               YSELF     222
      DO 550 K=1,IPNODE                                                 YSELF     223
      NGCTX=NTHG(K+1)-NTHG(K)                                           YSELF     224
      NLF=NOLD(K)                                                       YSELF     225
C                                                                       YSELF     226
C  GET THE POINTER FOR THE LOAD TABLE                                   YSELF     227
C                                                                       YSELF     228
      J=0                                                               YSELF     229
  450 J=J+1                                                             YSELF     230
      I=I+1                                                             YSELF     231
      IGEN=ICONTA(1,I)                                                  YSELF     232
      IF (IGEN.LT.12)GOTO 500                                           YSELF     233
      IA=JBLD(K)                                                        YSELF     234
      IS=IA*12                                                          YSELF     235
      BLMW=BLD(IS-9)                                                    YSELF     236
      BLMX=BLD(IS-8)                                                    YSELF     237
      IPFA=IGENPQ(1,I)                                                  YSELF     238
      IQFA=IGENPQ(2,I)                                                  YSELF     239
      IPFG(I)=IPFA                                                      YSELF     240
      IQFG(I)=IQFA                                                      YSELF     241
      PFA=FLOAT(IPFA)                                                   YSELF     242
      QFA=FLOAT(IQFA)                                                   YSELF     243
      IPFA=NBLD(IS-6)                                                   YSELF     244
      IQFA=NBLD(IS-10)                                                  YSELF     245
      IPFA=IPFA-PFA                                                     YSELF     246
      IQFA=IQFA-QFA                                                     YSELF     247
      NBLD(IS-6)=IPFA                                                   YSELF     248
      NBLD(IS-10)=IQFA                                                  YSELF     249
      PFA=PFA*BLMW/100.                                                 YSELF     250
      QFA=QFA*BLMX/100.                                                 YSELF     251
      PDGT(1,I)=-PFA                                                    YSELF     252
      PDGT(2,I)=-QFA                                                    YSELF     253
  500 CONTINUE                                                          YSELF     254
      IF (J.LT.NGCTX) GO TO 450                                         YSELF     255
  550 CONTINUE                                                          YSELF     256
  600 CONTINUE                                                          YSELF     257
C                                                                       YSELF     258
C     ACCOUNT FOR THE NON-LINEAR LOADS                                  YSELF     259
C                                                                       YSELF     260
      IF (NLOD.NE.0)THEN                                                YSELF     261
C                                                                       YSELF     262
C--  INITIALIZE THE OLD "TS" TO ZERO                                    YSELF     263
C                                                                       YSELF     264
      TSOLD=0.0                                                         YSELF     265
C                                                                       YSELF     266
C     --  INITIALIZE THE NON-LINEAR LOADS                               YSELF     267
C                                                                       YSELF     268
      ISHIFT=0                                                          YSELF     269
      DO 1250 I=1,NLOD                                                  YSELF     270
      J=NLDOLD(I)                                                       YSELF     271
      K=NNEW(J)                                                         YSELF     272
      NLDOLD(I)=K                                                       YSELF     273
C                                                                       YSELF     274
      IA=JBLD(K)                                                        YSELF     275
      II=IA*12                                                          YSELF     276
      BLMW=BLD(II-9)                                                    YSELF     277
      BLMX=BLD(II-8)                                                    YSELF     278
C*                                                                      YSELF     279
C*                                                                      YSELF     280
      BMVA=SQRT(BLMW*BLMW+BLMX*BLMX)                                    YSELF     281
      VREAL=REAL(VOLT(K))                                               YSELF     282
      VIMAG=AIMAG(VOLT(K))                                              YSELF     283
      VMG2=VREAL**2+VIMAG**2                                            YSELF     284
      VMG=SQRT(VMG2)                                                    YSELF     285
      IF (VMG.GT.0.0) GO TO 650                                         YSELF     286
      KI=(K-1)*3                                                        YSELF     287
      WRITE(MSG(1),5100) J,INAME(KI+1),INAME(KI+2),INAME(KI+3)          YSELF     288
      WRITE(MSG(2),5150)                                                YSELF     289
      CALL PRTMSG(2)                                                    YSELF     290
  650 CONTINUE                                                          YSELF     291
C                                                                       YSELF     292
C    RESTORE THE NO OF COMPONENT AT THE BUS AND THE TYPE                YSELF     293
C                                                                       YSELF     294
      NCOMP=NLCOMP(1,I)                                                 YSELF     295
C                                                                       YSELF     296
C     CHECK FOR NCOMP=0                                                 YSELF     297
      IF(NCOMP.EQ.0)GOTO 1250                                           YSELF     298
C                                                                       YSELF     299
      DO 1200 KCOMP=1,NCOMP                                             YSELF     300
      ISHIFT=ISHIFT+1                                                   YSELF     301
      NTYPE=NLTYPE(ISHIFT)                                              YSELF     302
      IF(NTYPE.EQ.0 .OR.NTYPE.GT.4)THEN                                 YSELF     303
C      WRITE ERROR MESSAGE                                              YSELF     304
       GOTO 1200                                                        YSELF     305
      ENDIF                                                             YSELF     306
C                                                                       YSELF     307
C          KCUR  KMVA  V   ALOAD                                        YSELF     308
      GOTO(700,  750,  800, 850)NTYPE                                   YSELF     309
C                                                                       YSELF     310
C                                                                       YSELF     311
C     CONSTANT CURRENT LOAD REPRESENTATION                              YSELF     312
C                                                                       YSELF     313
  700 CONTINUE                                                          YSELF     314
C                                                                       YSELF     315
        JNL=JDNLL(ISHIFT)                                               YSELF     316
        IPFA=DDAT(JNL+2)                                                YSELF     317
        IQFA=DDAT(JNL+3)                                                YSELF     318
        IIPFA=NBLD(II-6)                                                YSELF     319
        IIQFA=NBLD(II-10)                                               YSELF     320
        IIPFA=IIPFA-IPFA                                                YSELF     321
        IIQFA=IIQFA-IQFA                                                YSELF     322
        NBLD(II-6)=IIPFA                                                YSELF     323
        NBLD(II-10)=IIQFA                                               YSELF     324
        BLMWK=BLMW*IPFA/100.                                            YSELF     325
        BLMXK=BLMX*IQFA/100.                                            YSELF     326
C                                                                       YSELF     327
        IDDAT(JNL+1)=IPFA                                               YSELF     328
        IDDAT(JNL+8)=IQFA                                               YSELF     329
C                                                                       YSELF     330
        DDAT(JNL+2)=BLMWK/VMG                                           YSELF     331
        DDAT(JNL+3)=BLMXK/VMG                                           YSELF     332
C                                                                       YSELF     333
        GKK=BLMWK/VMG2                                                  YSELF     334
        BKK=-BLMXK/VMG2                                                 YSELF     335
C                                                                       YSELF     336
        DDAT(JNL+4)=GKK                                                 YSELF     337
        DDAT(JNL+5)=BKK                                                 YSELF     338
C                                                                       YSELF     339
C       STAIRS(K)=STAIRS(K)+CMPLX(GKK,BKK)                              YSELF     340
        IF(LDEB) WRITE(IUD6,6600)JNL,K,IIPFA,IIQFA,VMG                  YSELF     341
     *  ,DDAT(JNL+2),DDAT(JNL+3),GKK,BKK                                YSELF     342
C                                                                       YSELF     343
      GOTO 1200                                                         YSELF     344
C                                                                       YSELF     345
C    CONSTANT MVA AND PF LOAD REPRESENTATION                            YSELF     346
C                                                                       YSELF     347
  750 CONTINUE                                                          YSELF     348
C                                                                       YSELF     349
      JNL=JDNLL(ISHIFT)                                                 YSELF     350
      IPFA=DDAT(JNL+2)                                                  YSELF     351
      IQFA=DDAT(JNL+3)                                                  YSELF     352
      IIPFA=NBLD(II-6)                                                  YSELF     353
      IIQFA=NBLD(II-10)                                                 YSELF     354
      IIPFA=IIPFA-IPFA                                                  YSELF     355
      IIQFA=IIQFA-IQFA                                                  YSELF     356
      NBLD(II-6)=IIPFA                                                  YSELF     357
      NBLD(II-10)=IIQFA                                                 YSELF     358
      BLMWK=BLMW*IPFA/100.                                              YSELF     359
      BLMXK=BLMX*IQFA/100.                                              YSELF     360
      IDDAT(JNL+1)=IPFA                                                 YSELF     361
      IDDAT(JNL+7)=IQFA                                                 YSELF     362
      DDAT(JNL+2)=BLMWK                                                 YSELF     363
      DDAT(JNL+3)=BLMXK                                                 YSELF     364
      DDAT(JNL+4)=VMG2                                                  YSELF     365
      GKK=BLMWK/VMG2                                                    YSELF     366
      BKK=-BLMXK/VMG2                                                   YSELF     367
C      STAIRS(K)=STAIRS(K)+CMPLX(GKK,BKK)                               YSELF     368
C                                                                       YSELF     369
      GOTO 1200                                                         YSELF     370
C                                                                       YSELF     371
  800 CONTINUE                                                          YSELF     372
C                                                                       YSELF     373
C--  RESTORE THE POINTER TO "DDAT"                                      YSELF     374
C                                                                       YSELF     375
      JNL=JDNLL(ISHIFT)                                                 YSELF     376
      IDDAT(JNL+2)=NBLD(II-11)                                          YSELF     377
      IPFA=NBLD(II-6)                                                   YSELF     378
      IQFA=NBLD(II-10)                                                  YSELF     379
C                                                                       YSELF     380
C    SPACE FOR THE LOAD SHEDDING                                        YSELF     381
C                                                                       YSELF     382
      DDAT(JNL+9)=0.                                                    YSELF     383
      DDAT(JNL+10)=0.                                                   YSELF     384
C                                                                       YSELF     385
C                                                                       YSELF     386
      JK=IDDAT(JNL+1)                                                   YSELF     387
      ITERMP=ITERML(JK,1)                                               YSELF     388
      ITERMQ=ITERML(JK,2)                                               YSELF     389
      JL=JNL+10                                                         YSELF     390
      CMW=0.0                                                           YSELF     391
      CMX=0.0                                                           YSELF     392
      APPWR1=0.0                                                        YSELF     393
      APPWR2=0.0                                                        YSELF     394
      AQPWR1=0.0                                                        YSELF     395
      AQPWR2=0.0                                                        YSELF     396
      CKMW1=0.0                                                         YSELF     397
      CKMW2=0.0                                                         YSELF     398
      CKMX1=0.0                                                         YSELF     399
      CKMX2=0.0                                                         YSELF     400
      IPFA1=0                                                           YSELF     401
      IPFA2=0                                                           YSELF     402
      IQFA1=0                                                           YSELF     403
      IQFA2=0                                                           YSELF     404
C                                                                       YSELF     405
C--  INITIALIZE THE PARAMETERS ACCORDING TO THE NUMBER OF TERMS IN P    YSELF     406
C                                                                       YSELF     407
      IF (ITERMP.NE.0) THEN                                             YSELF     408
         IPFA1=IDDAT(JL+1)                                              YSELF     409
         IPFA=IPFA-IPFA1                                                YSELF     410
         BLMWK=BLMW*IPFA1/100.                                          YSELF     411
         APPWR1=DDAT(JL+2)                                              YSELF     412
         DDAT(JL+2)=APPWR1-2.0                                          YSELF     413
         VMAGP1=VMG**APPWR1                                             YSELF     414
         CKMW1=BLMWK/VMAGP1                                             YSELF     415
         DDAT(JL+4)=CKMW1                                               YSELF     416
         CMW=CKMW1*VMG**DDAT(JL+2)                                      YSELF     417
         JL=JL+4                                                        YSELF     418
         IF (ITERMP.EQ.2) THEN                                          YSELF     419
            IPFA2=IDDAT(JL+1)                                           YSELF     420
            IPFA=IPFA-IPFA2                                             YSELF     421
            BLMWK2=BLMW*IPFA2/100.                                      YSELF     422
            BLMWK=BLMWK+BLMWK2                                          YSELF     423
            APPWR2=DDAT(JL+2)                                           YSELF     424
            DDAT(JL+2)=APPWR2-2.0                                       YSELF     425
            VMAGP2=VMG**APPWR2                                          YSELF     426
            CKMW2=BLMWK2/VMAGP2                                         YSELF     427
            DDAT(JL+4)=CKMW2                                            YSELF     428
            CMW=CMW+CKMW2*VMG**DDAT(JL+2)                               YSELF     429
            JL=JL+4                                                     YSELF     430
         ENDIF                                                          YSELF     431
      ENDIF                                                             YSELF     432
C                                                                       YSELF     433
C--  INITIALIZE THE PARAMETERS ACCORDING TO THE NUMBER OF TERMS IN Q    YSELF     434
C                                                                       YSELF     435
      IF (ITERMQ.NE.0) THEN                                             YSELF     436
         IQFA1=IDDAT(JL+1)                                              YSELF     437
         IQFA=IQFA-IQFA1                                                YSELF     438
         BLMXK=BLMX*IQFA1/100.                                          YSELF     439
         AQPWR1=DDAT(JL+2)                                              YSELF     440
         DDAT(JL+2)=AQPWR1-2.0                                          YSELF     441
         VMAGQ1=VMG**AQPWR1                                             YSELF     442
         CKMX1=BLMXK/VMAGQ1                                             YSELF     443
         DDAT(JL+4)=CKMX1                                               YSELF     444
         CMX=CKMX1*VMG**DDAT(JL+2)                                      YSELF     445
         JL=JL+4                                                        YSELF     446
         IF (ITERMQ.EQ.2) THEN                                          YSELF     447
            IQFA2=IDDAT(JL+1)                                           YSELF     448
            IQFA=IQFA-IQFA2                                             YSELF     449
            BLMXK2=BLMX*IQFA2/100.                                      YSELF     450
            BLMXK=BLMXK+BLMXK2                                          YSELF     451
            AQPWR2=DDAT(JL+2)                                           YSELF     452
            DDAT(JL+2)=AQPWR2-2.0                                       YSELF     453
            VMAGQ2=VMG**AQPWR2                                          YSELF     454
            CKMX2=BLMXK2/VMAGQ2                                         YSELF     455
            DDAT(JL+4)=CKMX2                                            YSELF     456
            CMX=CMX+CKMX2*VMG**DDAT(JL+2)                               YSELF     457
            JL=JL+4                                                     YSELF     458
         ENDIF                                                          YSELF     459
      ENDIF                                                             YSELF     460
C                                                                       YSELF     461
      NBLD(II-6)=IPFA                                                   YSELF     462
      NBLD(II-10)=IQFA                                                  YSELF     463
C                                                                       YSELF     464
C--  FORMING THE NON LINEAR LOAD CURRENT VECTOR AND STORE THE ORIGINAL  YSELF     465
C--  BUS VOLTAGE MAGNITUDE                                              YSELF     466
C                                                                       YSELF     467
      DDAT(JNL+3)=VMG                                                   YSELF     468
      DDAT(JNL+4)=-CMW*VREAL-CMX*VIMAG                                  YSELF     469
      DDAT(JNL+5)=-CMW*VIMAG+CMX*VREAL                                  YSELF     470
      IF (ABS(VREAL).GT.1.E-6.OR.ABS(VIMAG).GT.1.E-6) THEN              YSELF     471
         DDAT(JNL+6)=ATAN2(VIMAG,VREAL)                                 YSELF     472
      ELSE                                                              YSELF     473
         DDAT(JNL+6)=0.0                                                YSELF     474
      END IF                                                            YSELF     475
C                                                                       YSELF     476
      IF(LDEB)WRITE(IUD6,5200) ITERMP,ITERMQ,VMG,IPFA1,CKMW1,APPWR1,    YSELF     477
     +IPFA2,CKMW2,APPWR2,IQFA1,CKMX1,AQPWR1,IQFA2,CKMX2,AQPWR2          YSELF     478
C                                                                       YSELF     479
      GOTO 1200                                                         YSELF     480
C                                                                       YSELF     481
C     ACCOUNT FOR THE COMPOSITE LOADS                                   YSELF     482
C                                                                       YSELF     483
C--        INITIALIZE THE COMPOSITE LOADS                               YSELF     484
C                                                                       YSELF     485
  850 CONTINUE                                                          YSELF     486
C                                                                       YSELF     487
C--  RESTORE THE POINTER TO "DDAT"                                      YSELF     488
C                                                                       YSELF     489
      JNL=JDNLL(ISHIFT)                                                 YSELF     490
      JL=JNL+11                                                         YSELF     491
                                                                        YSELF     492
      TAPTB=DDAT(JNL+3)*DDAT(JNL+3)                                     YSELF     493
      RTB=DDAT(JNL+1)/TAPTB                                             YSELF     494
      DDAT(JNL+1)=RTB                                                   YSELF     495
      XTB=DDAT(JNL+2)/TAPTB                                             YSELF     496
      DDAT(JNL+2)=XTB                                                   YSELF     497
      IPFA=DDAT(JNL+5)                                                  YSELF     498
      IQFA=DDAT(JNL+6)                                                  YSELF     499
      IDDAT(JNL+3)=IPFA                                                 YSELF     500
      IDDAT(JNL+11)=IQFA                                                YSELF     501
      IIPFA=NBLD(II-6)                                                  YSELF     502
      IIQFA=NBLD(II-10)                                                 YSELF     503
      IIPFA=IIPFA-IPFA                                                  YSELF     504
      IIQFA=IIQFA-IQFA                                                  YSELF     505
      NBLD(II-6)=IIPFA                                                  YSELF     506
      NBLD(II-10)=IIQFA                                                 YSELF     507
C                                                                       YSELF     508
C--  INITIALIZE THE PARAMETERS OF COMPONENTS OF ALOAD                   YSELF     509
C                                                                       YSELF     510
C--                     COMPUTE PBAR & VBAR                             YSELF     511
C                                                                       YSELF     512
      PCLD=IPFA*BLMW/100.                                               YSELF     513
      QCLD=IQFA*BLMX/100.                                               YSELF     514
C                                                                       YSELF     515
      CURTBR=(VREAL*PCLD+VIMAG*QCLD)/VMG                                YSELF     516
      CURTBI=(VIMAG*PCLD-VREAL*QCLD)/VMG                                YSELF     517
      CURTB2=CURTBR*CURTBR+CURTBI*CURTBI                                YSELF     518
      VBARR=VREAL-CURTBR*RTB+CURTBI*XTB                                 YSELF     519
      VBARI=VIMAG-CURTBR*XTB-CURTBI*RTB                                 YSELF     520
      VBAR2=VBARR*VBARR+VBARI*VBARI                                     YSELF     521
      PBAR=PCLD-CURTB2*RTB                                              YSELF     522
      QBAR=QCLD-CURTB2*XTB                                              YSELF     523
      PCLRMP=100.0                                                      YSELF     524
      PCLRMQ=100.0                                                      YSELF     525
C                                                                       YSELF     526
      GKKB=PBAR/VBAR2                                                   YSELF     527
      BKKB=-QBAR/VBAR2                                                  YSELF     528
      VBARVR=(VBARR*VREAL+VBARI*VIMAG)/VMG                              YSELF     529
      VBARVI=(VBARI*VREAL-VBARR*VIMAG)/VMG                              YSELF     530
      DDAT(JNL+4)=GKKB                                                  YSELF     531
      DDAT(JNL+5)=BKKB                                                  YSELF     532
      DDAT(JNL+6)=VBAR2                                                 YSELF     533
      DDAT(JNL+7)=VBARVR                                                YSELF     534
      DDAT(JNL+8)=VBARVI                                                YSELF     535
C      VOLBAR(I)=CMPLX(VBARR,VBARI)                                     YSELF     536
C                                                                       YSELF     537
C--  ACCOUNTING THE ALOAD                                               YSELF     538
C                                                                       YSELF     539
C                                ---- LARGE MOTOR                       YSELF     540
      NLM=NLFLMB(J)                                                     YSELF     541
      IF(NLM.EQ.0) GO TO 900                                            YSELF     542
      NMOLD(NLM)=NNEW(J)                                                YSELF     543
C      NMTNLD(NLM)=I                                                    YSELF     544
      JMLM=JMDAT(NLM)                                                   YSELF     545
      NTYPLM=IDDAT(JMLM+1)-10                                           YSELF     546
      IPFA=IDDAT(JMLM+2)                                                YSELF     547
      PDM(1,NLM)=PBAR*IPFA/100.                                         YSELF     548
      PDMV2=-PDM(1,NLM)/VBAR2                                           YSELF     549
      CDMT(1,NLM)=PDMV2*VBARR                                           YSELF     550
      CDMT(2,NLM)=PDMV2*VBARI                                           YSELF     551
      DDAT(JMLM+36)=VBARR                                               YSELF     552
      DDAT(JMLM+37)=VBARI                                               YSELF     553
      CALL YMOTS(NLM)                                                   YSELF     554
      DDAT(JMLM+3)=PDM(2,NLM)*100./QBAR                                 YSELF     555
      PCLRMP=PCLRMP-IDDAT(JMLM+2)                                       YSELF     556
      PCLRMQ=PCLRMQ-DDAT(JMLM+3)                                        YSELF     557
C                                ---- SMALL MOTOR                       YSELF     558
  900 NSM=NLFSMB(J)                                                     YSELF     559
      IF(NSM.EQ.0) GO TO 950                                            YSELF     560
C      NMTNLD(NSM)=I                                                    YSELF     561
      NMOLD(NSM)=NNEW(J)                                                YSELF     562
      JMSM=JMDAT(NSM)                                                   YSELF     563
      NTYPSM=IDDAT(JMSM+1)-10                                           YSELF     564
      IPFA=IDDAT(JMSM+2)                                                YSELF     565
      PDM(1,NSM)=PBAR*IPFA/100.                                         YSELF     566
      PDMV2=-PDM(1,NSM)/VBAR2                                           YSELF     567
      CDMT(1,NSM)=PDMV2*VBARR                                           YSELF     568
      CDMT(2,NSM)=PDMV2*VBARI                                           YSELF     569
      DDAT(JMSM+36)=VBARR                                               YSELF     570
      DDAT(JMSM+37)=VBARI                                               YSELF     571
      CALL YMOTS(NSM)                                                   YSELF     572
      DDAT(JMSM+3)=PDM(2,NSM)*100./QBAR                                 YSELF     573
      PCLRMP=PCLRMP-IDDAT(JMSM+2)                                       YSELF     574
      PCLRMQ=PCLRMQ-DDAT(JMSM+3)                                        YSELF     575
C                                                                       YSELF     576
C                                                                       YSELF     577
  950 JTYPE=IDDAT(JL+1)                                                 YSELF     578
      IF(JTYPE.EQ.0)GOTO 1200                                           YSELF     579
                                                                        YSELF     580
      GO TO (1000,1050,1100,1150)JTYPE                                  YSELF     581
C-                                      DISCHARGE LIGHTING              YSELF     582
C                                                                       YSELF     583
 1000   CLDLP=DDAT(JL+2)                                                YSELF     584
        PCLRMP=PCLRMP-CLDLP                                             YSELF     585
        PCLRMQ=PCLRMQ-0.435890*CLDLP*PBAR/QBAR                          YSELF     586
        JL=JL+6                                                         YSELF     587
        GOTO 950                                                        YSELF     588
C                                                                       YSELF     589
C-                                      TRANSFORMER SATURATION          YSELF     590
C                                                                       YSELF     591
 1050    PCLRMQ=PCLRMQ-DDAT(JL+2)                                       YSELF     592
         JL=JL+6                                                        YSELF     593
         GOTO 950                                                       YSELF     594
C                                                                       YSELF     595
C-                                      CONSTANT MVA                    YSELF     596
C                                                                       YSELF     597
 1100    PCLRMP=PCLRMP-DDAT(JL+2)                                       YSELF     598
         PCLRMQ=PCLRMQ-DDAT(JL+3)                                       YSELF     599
         JL=JL+5                                                        YSELF     600
         GOTO 950                                                       YSELF     601
C                                                                       YSELF     602
C-                                      REMANING LOAD                   YSELF     603
C                                                                       YSELF     604
 1150    DDAT(JL+2)=PCLRMP                                              YSELF     605
         DDAT(JL+3)=PCLRMQ                                              YSELF     606
         JL=JL+6                                                        YSELF     607
C                                                                       YSELF     608
       IF(LDEB) WRITE(IUD6,6550) PCLRMP,PCLRMQ                          YSELF     609
       IF(PCLRMP.LT.0.) THEN                                            YSELF     610
         KI=K*3                                                         YSELF     611
         WRITE(MSG(1),6400) J,INAME(KI-2),INAME(KI-1),INAME(KI)         YSELF     612
         WRITE(MSG(2),6450) 100.-PCLRMP                                 YSELF     613
         CALL PRTMSG(2)                                                 YSELF     614
         IEBK=1                                                         YSELF     615
       ENDIF                                                            YSELF     616
       IF(PCLRMQ.LT.0.) THEN                                            YSELF     617
         KI=K*3                                                         YSELF     618
         WRITE(MSG(1),6400) J,INAME(KI-2),INAME(KI-1),INAME(KI)         YSELF     619
         WRITE(MSG(2),6500) 100.-PCLRMQ                                 YSELF     620
         CALL PRTMSG(2)                                                 YSELF     621
         IEBK=1                                                         YSELF     622
       ENDIF                                                            YSELF     623
C                                                                       YSELF     624
      GOTO 950                                                          YSELF     625
C                                                                       YSELF     626
 1200 CONTINUE                                                          YSELF     627
C                                                                       YSELF     628
 1250 CONTINUE                                                          YSELF     629
C                                                                       YSELF     630
C                                                                       YSELF     631
      ENDIF                                                             YSELF     632
C                                                                       YSELF     633
C      ACCOUNT  TYPE 1 TO 5 AND 50 SVC                                  YSELF     634
C                                                                       YSELF     635
      IF (NSVC.EQ.0) GO TO 1350                                         YSELF     636
      DO 1300 N=1,NSVC                                                  YSELF     637
      JS=JSDAT(N)                                                       YSELF     638
      IF (IDDAT(JS+9).LE.5.OR.IDDAT(JS+9).EQ.50) THEN                   YSELF     639
         NLF=NROLD(N)                                                   YSELF     640
         J=NNEW(NLF)                                                    YSELF     641
         IF(J.EQ.0)GOTO 1300                                            YSELF     642
         NLF=MNEW(NLF)                                                  YSELF     643
         IF(NLF.GT.0)THEN                                               YSELF     644
           NLF=NLF*2-2                                                  YSELF     645
           NROLD(N)=J                                                   YSELF     646
           VOLT1=REAL(VOLT(J))                                          YSELF     647
           VOLT2=AIMAG(VOLT(J))                                         YSELF     648
           VMG=(VOLT1**2+VOLT2**2)*BASPC                                YSELF     649
           IF (NGSREC.EQ.0) THEN                                        YSELF     650
              GMXJ=GMX(NLF+2)                                           YSELF     651
              IQFARX=IDDAT(JS+11)                                       YSELF     652
              QFARX=FLOAT(IQFARX)                                       YSELF     653
              QFARX=QFARX*GMXJ/100.                                     YSELF     654
              BSVCT(N)=-QFARX/VMG                                       YSELF     655
              IF (J.LE.IPNODE) GO TO 1300                               YSELF     656
              GMX(NLF+2)=GMXJ-QFARX                                     YSELF     657
           ELSE                                                         YSELF     658
              GMXJ=SVCQ(N)                                              YSELF     659
              BSVCT(N)=-GMXJ/VMG                                        YSELF     660
              IF (J.LE.IPNODE) GO TO 1300                               YSELF     661
              GMX(NLF+2)=GMX(NLF+2)-GMXJ                                YSELF     662
           END IF                                                       YSELF     663
         ENDIF                                                          YSELF     664
C                                                                       YSELF     665
      ENDIF                                                             YSELF     666
 1300 CONTINUE                                                          YSELF     667
 1350 CONTINUE                                                          YSELF     668
C                                                                       YSELF     669
C        ACCOUNT THE INDUCTION MOTOR LOAD                               YSELF     670
C                                                                       YSELF     671
      IF (NMOTL.EQ.0) GO TO 1450                                        YSELF     672
      DO 1400 I=1,NMOTL                                                 YSELF     673
      NLF=NMOTB(I)                                                      YSELF     674
      IF(NLF.LT.0)GOTO 1400                                             YSELF     675
      K=NNEW(NLF)                                                       YSELF     676
      NMOLD(I)=K                                                        YSELF     677
      IF(LDEB)WRITE(IUD6,5050) NLF,K                                    YSELF     678
      IA=JBLD(K)                                                        YSELF     679
      II=IA*12                                                          YSELF     680
      JM=JMDAT(I)                                                       YSELF     681
      IIPFA=IDDAT(JM+2)                                                 YSELF     682
      BLMW=BLD(II-9)*IIPFA/100.0                                        YSELF     683
      IPFA=NBLD(II-6)                                                   YSELF     684
      IQFA=NBLD(II-10)                                                  YSELF     685
      PDM(1,I)=BLMW                                                     YSELF     686
      VREAL=REAL(VOLT(K))                                               YSELF     687
      VIMAG=AIMAG(VOLT(K))                                              YSELF     688
      VMG=VREAL**2+VIMAG**2                                             YSELF     689
      CDMT(1,I)=-PDM(1,I)*VREAL/VMG                                     YSELF     690
      CDMT(2,I)=-PDM(1,I)*VIMAG/VMG                                     YSELF     691
      CALL YMOTS(I)                                                     YSELF     692
C                                                                       YSELF     693
C     ACCOUNT FOR THE Q DUE TO THE INDUCTION MOTOR                      YSELF     694
C                                                                       YSELF     695
      BMOTOR=PDM(2,I)/VMG                                               YSELF     696
      BLD(II)=BLD(II)-BMOTOR                                            YSELF     697
      STAIRS(K)=STAIRS(K)-CMPLX(0.0,-BMOTOR)                            YSELF     698
C                                                                       YSELF     699
C        QFA=PDM(2,I)*100./BLD(II-8)                                    YSELF     700
C                                                                       YSELF     701
C     IF THERE IS NO REACTIVE LOAD ON THE BUS, SKIP THIS LINE           YSELF     702
C                                                                       YSELF     703
      IF(BLD(II-8).EQ.0.) THEN                                          YSELF     704
      DDAT(JM+3)=0.                                                     YSELF     705
      ELSE                                                              YSELF     706
      DDAT(JM+3)=PDM(2,I)*100./BLD(II-8)                                YSELF     707
      ENDIF                                                             YSELF     708
      IPFA=IPFA-IIPFA                                                   YSELF     709
      NBLD(II-6)=IPFA                                                   YSELF     710
      NBLD(II-10)=IQFA                                                  YSELF     711
 1400 CONTINUE                                                          YSELF     712
 1450 CONTINUE                                                          YSELF     713
C                                                                       YSELF     714
C     ACCOUNT THE TSC LOAD                                              YSELF     715
C                                                                       YSELF     716
      IF (NTSCL.EQ.0) GO TO 1550                                        YSELF     717
      DO 1500 I=1,NTSCL                                                 YSELF     718
         JTSC=JTCDAT(I)                                                 YSELF     719
         NLF=IDDAT(JTSC+1)                                              YSELF     720
         IIPFA=IDDAT(JTSC+9)                                            YSELF     721
         IA=JBLD(NLF)                                                   YSELF     722
         II=IA*12                                                       YSELF     723
         PTSC=BLD(II-9)*IIPFA/100.0                                     YSELF     724
         IPFA=NBLD(II-6)                                                YSELF     725
         IQFA=NBLD(II-10)                                               YSELF     726
         VREAL=REAL(VOLT(NLF))                                          YSELF     727
         VIMAG=AIMAG(VOLT(NLF))                                         YSELF     728
         VMG=VREAL**2+VIMAG**2                                          YSELF     729
         GTSC=PTSC/VMG                                                  YSELF     730
         DDAT(JTSC+10)=GTSC                                             YSELF     731
         DDAT(JTSC+11)=GTSC                                             YSELF     732
         DDAT(JTSC+12)=GTSC*VREAL                                       YSELF     733
         DDAT(JTSC+13)=GTSC*VIMAG                                       YSELF     734
         DDAT(JTSC+14)=VMG                                              YSELF     735
C                                                                       YSELF     736
C     SUBTRACT PTSC FROM THE BUS LOAD                                   YSELF     737
C                                                                       YSELF     738
         IPFA=IPFA-IIPFA                                                YSELF     739
         NBLD(II-6)=IPFA                                                YSELF     740
         NBLD(II-10)=IQFA                                               YSELF     741
 1500 CONTINUE                                                          YSELF     742
 1550 CONTINUE                                                          YSELF     743
C                                                                       YSELF     744
C   CHECK IF THE INDIVIDUAL LOAD COMPONENT AT EACH BUS ADD UP TO 100%   YSELF     745
C                                                                       YSELF     746
      DO 1600 LI=1,NLFBUS                                               YSELF     747
      IF(JBLD(LI).EQ.0)GOTO 1600                                        YSELF     748
      IA=JBLD(LI)                                                       YSELF     749
      IIL=IA*12                                                         YSELF     750
      IPFA=NBLD(IIL-6)                                                  YSELF     751
      IQFA=NBLD(IIL-10)                                                 YSELF     752
      IF(IPFA.LT.0 .OR. IQFA .LT. 0)THEN                                YSELF     753
C                                                                       YSELF     754
      KI=LI*3                                                           YSELF     755
      WRITE(MSG(1),5100) LI,INAME(KI-2),INAME(KI-1),INAME(KI)           YSELF     756
      WRITE(MSG(2),5250) IPFA,IQFA                                      YSELF     757
      WRITE(MSG(3),5300)                                                YSELF     758
      CALL PRTMSG(3)                                                    YSELF     759
C      IEBK1=1                                                          YSELF     760
      ENDIF                                                             YSELF     761
 1600 CONTINUE                                                          YSELF     762
C                                                                       YSELF     763
C     ACCOUNTING THE CONSTANT IMPEDANCE LOADS                           YSELF     764
C                                                                       YSELF     765
      JLNODE=IDCNOX-1                                                   YSELF     766
      DO 1650 I=1,NLFBUS                                                YSELF     767
      IF(JBLD(I).EQ.0)GOTO 1650                                         YSELF     768
      VOLT1=REAL(VOLT(I))                                               YSELF     769
      VOLT2=AIMAG(VOLT(I))                                              YSELF     770
      VMG=VOLT1**2+VOLT2**2                                             YSELF     771
      JL=JBLD(I)                                                        YSELF     772
      II=JL*12                                                          YSELF     773
      IPFA=NBLD(II-6)                                                   YSELF     774
      IQFA=NBLD(II-10)                                                  YSELF     775
      PFA=FLOAT(IPFA)                                                   YSELF     776
      QFA=FLOAT(IQFA)                                                   YSELF     777
      NLF=NOLD(I)                                                       YSELF     778
      J=MNEW(NLF)                                                       YSELF     779
      J=J*4                                                             YSELF     780
      BLMW=BMW(J-3)*PFA/(BASPC*100.)                                    YSELF     781
      GKK=BLMW/VMG                                                      YSELF     782
      BKK=-(BMX(J-2)*QFA)/(VMG*BASPC*100.)                              YSELF     783
      VMG1=SQRT(VMG)                                                    YSELF     784
      IF(LDEB)WRITE(IUD6,6650)JL,I,VMG1,PFA,QFA,GKK,BKK                 YSELF     785
C                                                                       YSELF     786
      STAIRS(I)=STAIRS(I)+CMPLX(GKK,BKK)                                YSELF     787
 1650 CONTINUE                                                          YSELF     788
C                                                                       YSELF     789
C                                                                       YSELF     790
C     COMPUTE VOLTAGE CURRENT AND POWER FOR SYNCHRONOUS GENERATORS      YSELF     791
C                                                                       YSELF     792
      I=0                                                               YSELF     793
      KK=-2                                                             YSELF     794
      DO 1850 K=1,IPNODE                                                YSELF     795
      KK=KK+2                                                           YSELF     796
      NGCTX=NTHG(K+1)-NTHG(K)                                           YSELF     797
      NLFI=NOLD(K)                                                      YSELF     798
      NLF=MNEW(NLFI)                                                    YSELF     799
      IF(NLF.GT.0)THEN                                                  YSELF     800
      NLF=NLF*2-2                                                       YSELF     801
      VOLT1=REAL(VOLT(K))                                               YSELF     802
      VOLT2=AIMAG(VOLT(K))                                              YSELF     803
      FACT1=ATAN2(VOLT2,VOLT1)                                          YSELF     804
      VMG=VOLT1**2+VOLT2**2                                             YSELF     805
      GMWB=0.0                                                          YSELF     806
      GMXB=0.0                                                          YSELF     807
      DO 1800 J=1,NGCTX                                                 YSELF     808
      I=I+1                                                             YSELF     809
      IGEN=ICONTA(1,I)                                                  YSELF     810
      IF (IGEN.LT.12) THEN                                              YSELF     811
C                                                                       YSELF     812
         IF (NGSREC.EQ.0) THEN                                          YSELF     813
            IPFG(I)=IGENPQ(1,I)                                         YSELF     814
            IQFG(I)=IGENPQ(2,I)                                         YSELF     815
            IPFGI=IPFG(I)                                               YSELF     816
            IQFGI=IQFG(I)                                               YSELF     817
            PFA=FLOAT(IPFGI)                                            YSELF     818
            QFA=FLOAT(IQFGI)                                            YSELF     819
            PFA=0.01*PFA*GMW(NLF+1)                                     YSELF     820
            QFA=0.01*QFA*GMX(NLF+2)                                     YSELF     821
         ELSE                                                           YSELF     822
            IPFG(I)=100                                                 YSELF     823
            IQFG(I)=100                                                 YSELF     824
            PFA=GENPQ(1,I)                                              YSELF     825
            QFA=GENPQ(2,I)                                              YSELF     826
         END IF                                                         YSELF     827
C                                                                       YSELF     828
         GMWB=GMWB+PFA                                                  YSELF     829
         GMXB=GMXB+QFA                                                  YSELF     830
         PDGT(1,I)=PFA/BASPC                                            YSELF     831
         PDGT(2,I)=QFA/BASPC                                            YSELF     832
C                                                                       YSELF     833
         IF(IGEN.NE.3.AND.IGEN.NE.7.AND.IGEN.NE.11)THEN                 YSELF     834
C                                                                       YSELF     835
C        DETAILED GENERATOR                                             YSELF     836
C                                                                       YSELF     837
         CDG(1,I)=(PDGT(1,I)*VOLT1+PDGT(2,I)*VOLT2)/VMG                 YSELF     838
         CDG(2,I)=(PDGT(1,I)*VOLT2-PDGT(2,I)*VOLT1)/VMG                 YSELF     839
C                                                                       YSELF     840
         ELSE                                                           YSELF     841
C                                                                       YSELF     842
C        CLASSICAL GENERATOR                                            YSELF     843
C                                                                       YSELF     844
         FACT1=PDGT(1,I)*VOLT1+PDGT(2,I)*VOLT2                          YSELF     845
         FACT2=PDGT(1,I)*VOLT2-PDGT(2,I)*VOLT1                          YSELF     846
         CR=FACT1/VMG                                                   YSELF     847
         CI=FACT2/VMG                                                   YSELF     848
         CDG(1,I)=CR                                                    YSELF     849
         CDG(2,I)=CI                                                    YSELF     850
         EDGX=VOLT1-CI/XPD(I)                                           YSELF     851
         EQGX=VOLT2+CR/XPD(I)                                           YSELF     852
         CDGI=EQGX*XPD(I)                                               YSELF     853
         CQGI=-EDGX*XPD(I)                                              YSELF     854
         EMGT(I)=SQRT(CDGI**2+CQGI**2)                                  YSELF     855
C                                                                       YSELF     856
         ENDIF                                                          YSELF     857
C                                                                       YSELF     858
      ENDIF                                                             YSELF     859
C                                                                       YSELF     860
      IF(LDEB)WRITE(IUD6,5350) NLFI,K,I,GMW(NLF+1),GMX(NLF+2),PFA,QFA,  YSELF     861
     &PDGT(1,I),PDGT(2,I),CDG(1,I),CDG(2,I)                             YSELF     862
C                                                                       YSELF     863
 1800 CONTINUE                                                          YSELF     864
C                                                                       YSELF     865
         GMWB=GMWB-GMW(NLF+1)                                           YSELF     866
         GMXB=GMXB-GMX(NLF+2)                                           YSELF     867
         NTHSRK=NTHSR(3,K)                                              YSELF     868
         IF(NTHSRK.NE.0)THEN                                            YSELF     869
         JS=JSDAT(NTHSRK)                                               YSELF     870
         IF(IDDAT(JS+9).LE.5.OR.IDDAT(JS+9).EQ.50)                      YSELF     871
     *   GMXB=GMXB-BSVCT(NTHSRK)*VMG*BASPC                              YSELF     872
         ENDIF                                                          YSELF     873
         IF(ABS(GMWB).GT.3.0.OR.ABS(GMXB).GT.3.0)THEN                   YSELF     874
         KI=K*3                                                         YSELF     875
         WRITE(MSG(1),6050) NLFI,INAME(KI-2),INAME(KI-1),INAME(KI)      YSELF     876
         WRITE(MSG(2),6100) GMWB,GMXB                                   YSELF     877
         CALL PRTMSG(2)                                                 YSELF     878
         IEBK3=1                                                        YSELF     879
         ENDIF                                                          YSELF     880
      ENDIF                                                             YSELF     881
 1850 CONTINUE                                                          YSELF     882
C                                                                       YSELF     883
C    NETTING OF LF GENERATOR BUS                                        YSELF     884
C                                                                       YSELF     885
      KK=IPNODX*2-2                                                     YSELF     886
      DO 1950 I=ICNODX,NLFBUS                                           YSELF     887
      KK=KK+2                                                           YSELF     888
      JJ=NOLD(I)                                                        YSELF     889
      DO 1900 II=1,IFNBUS                                               YSELF     890
       IF(NINF(II).EQ. JJ)GOTO 1950                                     YSELF     891
 1900 CONTINUE                                                          YSELF     892
      J=MNEW(JJ)                                                        YSELF     893
      IF(J.GT.0)THEN                                                    YSELF     894
      J=J*2-2                                                           YSELF     895
      VOLT1=REAL(VOLT(I))                                               YSELF     896
      VOLT2=AIMAG(VOLT(I))                                              YSELF     897
      VMG=VOLT1**2+VOLT2**2                                             YSELF     898
      VMG=VMG*BASPC                                                     YSELF     899
      GKK=-GMW(J+1)/VMG                                                 YSELF     900
      BKK=GMX(J+2)/VMG                                                  YSELF     901
      STAIRS(I)=STAIRS(I)+CMPLX(GKK,BKK)                                YSELF     902
      IF(LDEB)WRITE(IUD6,5400) JJ,I,STAIRS(I),GMW(J+1),                 YSELF     903
     +GMX(J+2)                                                          YSELF     904
      ENDIF                                                             YSELF     905
 1950 CONTINUE                                                          YSELF     906
C                                                                       YSELF     907
C    PRINT NETTING INFORMATION                                          YSELF     908
C                                                                       YSELF     909
      INNET=0                                                           YSELF     910
      I=0                                                               YSELF     911
      TOGMWK=0.                                                         YSELF     912
      TOGMXK=0.                                                         YSELF     913
      IPLINE=56                                                         YSELF     914
      DO 2050 J=IPNODX,NLFBUS                                           YSELF     915
      NLFK=NOLD(J)                                                      YSELF     916
      K=MNEW(NLFK)                                                      YSELF     917
      IF(K.GT.0)THEN                                                    YSELF     918
      K=K*2-2                                                           YSELF     919
      GMWK=GMW(K+1)                                                     YSELF     920
      GMXK=GMX(K+2)                                                     YSELF     921
      IF (GMWK.EQ.0.0.AND.GMXK.EQ.0.0) GO TO 2050                       YSELF     922
      DO 2000 II=1,IFNBUS                                               YSELF     923
       IF(NINF(II).EQ. NLFK)GOTO 2050                                   YSELF     924
 2000 CONTINUE                                                          YSELF     925
      JJ=J*3-3                                                          YSELF     926
      IF(GMWK.GT.XCMMX.OR.ABS(GMXK).GT.XCMMX)THEN                       YSELF     927
         IEBK2=1                                                        YSELF     928
         WRITE(MSG(1),5600) NLFK,INAME(JJ+1),INAME(JJ+2),INAME(JJ+3)    YSELF     929
         WRITE(MSG(2),5650) GMWK,GMXK                                   YSELF     930
         WRITE(MSG(3),5700) XCMMX                                       YSELF     931
         CALL PRTMSG(3)                                                 YSELF     932
      ENDIF                                                             YSELF     933
      IF(NGSREC.NE.0)GOTO 2050                                          YSELF     934
      INNET=1                                                           YSELF     935
      I=I+1                                                             YSELF     936
      NLK(I)=NLFK                                                       YSELF     937
      NNAME(I)=INAME(JJ+1)                                              YSELF     938
      NNAME2(I)=INAME(JJ+2)                                             YSELF     939
      NNAME3(I)=INAME(JJ+3)                                             YSELF     940
      XGMW(I)=GMWK                                                      YSELF     941
      XGMX(I)=GMXK                                                      YSELF     942
      TOGMWK=TOGMWK+GMWK                                                YSELF     943
      TOGMXK=TOGMXK+GMXK                                                YSELF     944
      IF (I.NE.3) GO TO 2050                                            YSELF     945
      IF(IPLINE.EQ.56)THEN                                              YSELF     946
      IPLINE=3                                                          YSELF     947
      CALL PAGE6                                                        YSELF     948
      WRITE(IU6,5450)                                                   YSELF     949
C      WRITE(IU16,1580)                                                 YSELF     950
      ENDIF                                                             YSELF     951
      WRITE(IU6,5500)                                                   YSELF     952
     *(NLK(M),NNAME(M),NNAME2(M),NNAME3(M),XGMW(M),XGMX(M),M=1,I)       YSELF     953
C      WRITE(IU16,1590)                                                 YSELF     954
C     &(NLK(M),NNAME(M),NNAME2(M),NNAME3(M),XGMW(M),XGMX(M),M=1,I)      YSELF     955
      I=0                                                               YSELF     956
      IPLINE=IPLINE+1                                                   YSELF     957
      ENDIF                                                             YSELF     958
 2050 CONTINUE                                                          YSELF     959
C                                                                       YSELF     960
      IF(NGSREC.NE.0)GOTO 2060                                          YSELF     961
C                                                                       YSELF     962
      IF (I.NE.0)THEN                                                   YSELF     963
        IF(IPLINE.EQ.56)THEN                                            YSELF     964
          IPLINE=3                                                      YSELF     965
          CALL PAGE6                                                    YSELF     966
          WRITE(IU6,5450)                                               YSELF     967
C          WRITE(IU16,1580)                                             YSELF     968
        ENDIF                                                           YSELF     969
        WRITE(IU6,5500)                                                 YSELF     970
     *  (NLK(M),NNAME(M),NNAME2(M),NNAME3(M),XGMW(M),XGMX(M),M=1,I)     YSELF     971
C        WRITE(IU16,1590)                                               YSELF     972
C     &  (NLK(M),NNAME(M),NNAME2(M),NNAME3(M),XGMW(M),XGMX(M),M=1,I)    YSELF     973
        IPLINE=IPLINE+1                                                 YSELF     974
      ENDIF                                                             YSELF     975
C                                                                       YSELF     976
      IF (INNET.EQ.0)THEN                                               YSELF     977
        CALL PAGE6                                                      YSELF     978
        WRITE(IU6,5550)                                                 YSELF     979
C        WRITE(IU16,1580)                                               YSELF     980
C        WRITE(IU16,1600)                                               YSELF     981
      ELSE                                                              YSELF     982
        IF(IPLINE.EQ.52)THEN                                            YSELF     983
          IPLINE=3                                                      YSELF     984
          CALL PAGE6                                                    YSELF     985
          WRITE(IU6,5450)                                               YSELF     986
C          WRITE(IU16,1580)                                             YSELF     987
        ENDIF                                                           YSELF     988
        WRITE(IU6,7150) TOGMWK,TOGMXK                                   YSELF     989
C        WRITE(IU16,1820) TOGMWK,TOGMXK                                 YSELF     990
      ENDIF                                                             YSELF     991
C                                                                       YSELF     992
 2060 XCMMX=0.0                                                         YSELF     993
C                                                                       YSELF     994
      IF(NGSREC.EQ.0)GOTO 2090                                          YSELF     995
C                                                                       YSELF     996
      DO 2080 II=1,NGSREC                                               YSELF     997
        ISTAT=IGENST(II)                                                YSELF     998
        IF(ISTAT.NE.1)GOTO 2080                                         YSELF     999
        NLF=LFGEN(II)                                                   YSELF    1000
C                                                                       YSELF    1001
        DO 2070 IK=1,IFNBUS                                             YSELF    1002
          IF(NINF(IK).EQ.NLF)GOTO 2080                                  YSELF    1003
 2070   CONTINUE                                                        YSELF    1004
C                                                                       YSELF    1005
        NPROG=NNEW(NLF)                                                 YSELF    1006
        JJ=NPROG*3-3                                                    YSELF    1007
        NGRI='  '//XGEID(II)                                            YSELF    1008
        GMWK=GSRCD(1,II)                                                YSELF    1009
        GMXK=GSRCD(2,II)                                                YSELF    1010
        IF(GMWK.EQ.0.0.AND.GMXK.EQ.0.0)GOTO 2080                        YSELF    1011
C                                                                       YSELF    1012
        INNET=1                                                         YSELF    1013
        I=I+1                                                           YSELF    1014
        NLK(I)=NLF                                                      YSELF    1015
        NNAME(I)=INAME(JJ+1)                                            YSELF    1016
        NNAME2(I)=INAME(JJ+2)                                           YSELF    1017
        NNAME3(I)=INAME(JJ+3)                                           YSELF    1018
        GUNID(I)=NGRI                                                   YSELF    1019
        XGMW(I)=GMWK                                                    YSELF    1020
        XGMX(I)=GMXK                                                    YSELF    1021
        TOGMWK=TOGMWK+GMWK                                              YSELF    1022
        TOGMXK=TOGMXK+GMXK                                              YSELF    1023
C                                                                       YSELF    1024
        IF(I.NE.3)GOTO 2080                                             YSELF    1025
        IF(IPLINE.EQ.56)THEN                                            YSELF    1026
          IPLINE=3                                                      YSELF    1027
          CALL PAGE6                                                    YSELF    1028
          WRITE(IU6,7450)                                               YSELF    1029
        ENDIF                                                           YSELF    1030
        WRITE(IU6,7500) (NLK(M),NNAME(M),NNAME2(M),NNAME3(M),           YSELF    1031
     +                   GUNID(M),XGMW(M),XGMX(M),M=1,3)                YSELF    1032
        I=0                                                             YSELF    1033
        IPLINE=IPLINE+1                                                 YSELF    1034
C                                                                       YSELF    1035
2080  CONTINUE                                                          YSELF    1036
C                                                                       YSELF    1037
      IF(I.NE.0)THEN                                                    YSELF    1038
        IF(IPLINE.EQ.56)THEN                                            YSELF    1039
          IPLINE=3                                                      YSELF    1040
          CALL PAGE6                                                    YSELF    1041
          WRITE(IU6,7450)                                               YSELF    1042
        ENDIF                                                           YSELF    1043
        WRITE(IU6,7500) (NLK(M),NNAME(M),NNAME2(M),NNAME3(M),           YSELF    1044
     +                   GUNID(M),XGMW(M),XGMX(M),M=1,3)                YSELF    1045
        IPLINE=IPLINE+1                                                 YSELF    1046
      ENDIF                                                             YSELF    1047
C                                                                       YSELF    1048
      IF(INNET.EQ.0)THEN                                                YSELF    1049
        CALL PAGE6                                                      YSELF    1050
        WRITE(IU6,5550)                                                 YSELF    1051
      ELSE                                                              YSELF    1052
        IF(IPLINE.EQ.52)THEN                                            YSELF    1053
          IPLINE=3                                                      YSELF    1054
          CALL PAGE6                                                    YSELF    1055
          WRITE(IU6,7450)                                               YSELF    1056
        ENDIF                                                           YSELF    1057
        WRITE(IU6,7150) TOGMWK,TOGMXK                                   YSELF    1058
      ENDIF                                                             YSELF    1059
C                                                                       YSELF    1060
C    PRINT INFINITE BUS INFORMATION                                     YSELF    1061
C                                                                       YSELF    1062
 2090 IF (IFNBUS.EQ.0) GO TO 2150                                       YSELF    1063
      I=0                                                               YSELF    1064
      IPLINE=3                                                          YSELF    1065
      CALL PAGE6                                                        YSELF    1066
      WRITE(IU6,5750)                                                   YSELF    1067
C      WRITE(IU16,1620)                                                 YSELF    1068
      DO 2100 II=1,IFNBUS                                               YSELF    1069
      NLFK=NINF(II)                                                     YSELF    1070
      I=I+1                                                             YSELF    1071
      NLK(I)=NLFK                                                       YSELF    1072
      J=NNEW(NLFK)                                                      YSELF    1073
      JJ=J*3                                                            YSELF    1074
      NNAME(I)=INAME(JJ-2)                                              YSELF    1075
      NNAME2(I)=INAME(JJ-1)                                             YSELF    1076
      NNAME3(I)=INAME(JJ)                                               YSELF    1077
      IF (I.NE.7) GO TO 2100                                            YSELF    1078
      WRITE(IU6,5800) (NLK(M),NNAME(M),NNAME2(M),NNAME3(M),M=1,I)       YSELF    1079
C      WRITE(IU16,1630) (NLK(M),NNAME(M),NNAME2(M),NNAME3(M),M=1,I)     YSELF    1080
      I=0                                                               YSELF    1081
      IPLINE=IPLINE+1                                                   YSELF    1082
      IF(IPLINE.EQ.58.AND.II.LT.IFNBUS)THEN                             YSELF    1083
      IPLINE=3                                                          YSELF    1084
      CALL PAGE6                                                        YSELF    1085
      WRITE(IU6,5750)                                                   YSELF    1086
C      WRITE(IU16,1620)                                                 YSELF    1087
      ENDIF                                                             YSELF    1088
 2100 CONTINUE                                                          YSELF    1089
      IF (I.NE.0)THEN                                                   YSELF    1090
      WRITE(IU6,5800) (NLK(M),NNAME(M),NNAME2(M),NNAME3(M),M=1,I)       YSELF    1091
C      WRITE(IU16,1630) (NLK(M),NNAME(M),NNAME2(M),NNAME3(M),M=1,I)     YSELF    1092
      ENDIF                                                             YSELF    1093
 2150 CONTINUE                                                          YSELF    1094
C                                                                       YSELF    1095
C  PRINT NETTING OF THE 100% CONSTANT IMPEDANCE LOAD BUS                YSELF    1096
C                                                                       YSELF    1097
C                                                                       YSELF    1098
      TOGMW=0.0                                                         YSELF    1099
      TOGMX=0.0                                                         YSELF    1100
      TOGMWK=0.                                                         YSELF    1101
      TOGMXK=0.                                                         YSELF    1102
      I=0                                                               YSELF    1103
      ICOUNT=0                                                          YSELF    1104
      IPLINE=56                                                         YSELF    1105
      NCZLB=0                                                           YSELF    1106
      LASTLB=0                                                          YSELF    1107
      DO 2200 K=1,NLFBUS                                                YSELF    1108
      IF(JBLD(K).EQ.0)GOTO 2200                                         YSELF    1109
      ICOUNT=ICOUNT+1                                                   YSELF    1110
      IA=JBLD(K)                                                        YSELF    1111
      IIL=IA*12                                                         YSELF    1112
      TOGMW=TOGMW+BLD(IIL-9)*BASPC                                      YSELF    1113
      TOGMX=TOGMX+BLD(IIL-8)*BASPC                                      YSELF    1114
      IPFA=NBLD(IIL-6)                                                  YSELF    1115
      IQFA=NBLD(IIL-10)                                                 YSELF    1116
      FACTP=IPFA/100.                                                   YSELF    1117
      FACTQ=IQFA/100.                                                   YSELF    1118
      IF(IPFA.NE.0 .AND. IQFA.NE.0)THEN                                 YSELF    1119
      I=I+1                                                             YSELF    1120
      KI=K*3                                                            YSELF    1121
      NLF=NOLD(K)                                                       YSELF    1122
      IF(K.GT.LASTV2)THEN                                               YSELF    1123
      NCZLB=NCZLB+1                                                     YSELF    1124
      ICZLB(NCZLB)=K                                                    YSELF    1125
      IF(K.GT.LASTLB)LASTLB=K                                           YSELF    1126
      ENDIF                                                             YSELF    1127
      NLK(I)=NLF                                                        YSELF    1128
      NPF(I)=IPFA                                                       YSELF    1129
      NQF(I)=IQFA                                                       YSELF    1130
      NNAME(I)=INAME(KI-2)                                              YSELF    1131
      NNAME2(I)=INAME(KI-1)                                             YSELF    1132
      NNAME3(I)=INAME(KI)                                               YSELF    1133
      XGMW(I)=BLD(IIL-9)*BASPC*FACTP                                    YSELF    1134
      XGMX(I)=BLD(IIL-8)*BASPC*FACTQ                                    YSELF    1135
      TOGMWK=TOGMWK+XGMW(I)                                             YSELF    1136
      TOGMXK=TOGMXK+XGMX(I)                                             YSELF    1137
      IF(I.NE.2)GOTO 2200                                               YSELF    1138
      IF(IPLINE.EQ.56)THEN                                              YSELF    1139
       IPLINE=3                                                         YSELF    1140
       CALL PAGE6                                                       YSELF    1141
       WRITE(IU6,7000)                                                  YSELF    1142
      ENDIF                                                             YSELF    1143
      WRITE(IU6,7050)                                                   YSELF    1144
     * (NLK(M),NNAME(M),NNAME2(M),NNAME3(M),XGMW(M),XGMX(M),            YSELF    1145
     *  NPF(M),NQF(M),M=1,I)                                            YSELF    1146
      I=0                                                               YSELF    1147
      IPLINE=IPLINE+1                                                   YSELF    1148
      ENDIF                                                             YSELF    1149
 2200 CONTINUE                                                          YSELF    1150
      IF (I.NE.0)THEN                                                   YSELF    1151
      IF(IPLINE.EQ.56)THEN                                              YSELF    1152
      IPLINE=3                                                          YSELF    1153
      CALL PAGE6                                                        YSELF    1154
      WRITE(IU6,7000)                                                   YSELF    1155
      ENDIF                                                             YSELF    1156
      WRITE(IU6,7050)                                                   YSELF    1157
     *(NLK(M),NNAME(M),NNAME2(M),NNAME3(M),XGMW(M),XGMX(M),             YSELF    1158
     * NPF(M),NQF(M),M=1,I)                                             YSELF    1159
      IPLINE=IPLINE+1                                                   YSELF    1160
      ENDIF                                                             YSELF    1161
      IF(IPLINE.EQ.52)THEN                                              YSELF    1162
      CALL PAGE6                                                        YSELF    1163
      WRITE(IU6,7000)                                                   YSELF    1164
      ENDIF                                                             YSELF    1165
      WRITE(IU6,7200) TOGMW,TOGMX,TOGMWK,TOGMXK                         YSELF    1166
C      WRITE(IU16,1830) TOGMWK,TOGMXK                                   YSELF    1167
C                                                                       YSELF    1168
C   STORE PROGRAM BUS NUMBER AND ACIBAS OF AC BUS FOR THE DC SYSTEM     YSELF    1169
C                                                                       YSELF    1170
      IF(NACTOT.NE.0)THEN                                               YSELF    1171
      XACIBA=BASPC*1000.0/SQRT(3.0)                                     YSELF    1172
      DO 2250 I=1,NACTOT                                                YSELF    1173
      NLF=IUQABU(I)                                                     YSELF    1174
      K=MNEW(NLF)                                                       YSELF    1175
      IF(LDEB)WRITE(IUD6,7100) I,NLF,K                                  YSELF    1176
      BASKVX=XBASKV(K*4)                                                YSELF    1177
      IF(BASKVX.LE.0.0) THEN                                            YSELF    1178
       IEBK4=1                                                          YSELF    1179
       K3=NNEW(NLF)*3                                                   YSELF    1180
       WRITE(MSG(1),7350)NLF,INAME(K3-2),INAME(K3-1),INAME(K3)          YSELF    1181
       WRITE(MSG(2),7400)                                               YSELF    1182
       CALL PRTMSG(2)                                                   YSELF    1183
      ELSE                                                              YSELF    1184
       ACIBAS(I)=XACIBA/BASKVX                                          YSELF    1185
      ENDIF                                                             YSELF    1186
      IF(LDEB) WRITE(IUD6,6250) NLF,K,IUQABU(I),BASKVX,ACIBAS(I)        YSELF    1187
 2250 CONTINUE                                                          YSELF    1188
      ENDIF                                                             YSELF    1189
C                                                                       YSELF    1190
      IF(IEBK2.EQ.1)THEN                                                YSELF    1191
         MSG(1)=                                                        YSELF    1192
     *   ' NETTING OF GENERATION HAS EXCEEDED THE SPECIFIED LIMIT'      YSELF    1193
         MSG(2)=                                                        YSELF    1194
     *   ' DO YOU WANT TO PROCEED (Y/N) ?'                              YSELF    1195
         WRITE(LOUT,'(A,/,A)') MSG(1),MSG(2)                            YSELF    1196
         IF(RECORD) WRITE(IREC,'(A,/,A)') '?'//MSG(1),'?'//MSG(2)       YSELF    1197
 2300    CALL REDLIN(LOUT,LIN,JERR,0,MSG(1),SUBPMT,'TB1',LINE           YSELF    1198
     *   ,RECORD,IREC,KLAYER,KEND,KREAD,PLAYBA)                         YSELF    1199
         IF(JERR.LT.0)THEN                                              YSELF    1200
         IF(PLAYBA)CALL PSTOP                                           YSELF    1201
         GOTO 2300                                                      YSELF    1202
         ENDIF                                                          YSELF    1203
         IF(KLAYER.LT.0) GOTO 2300                                      YSELF    1204
         IF(LINE(1:1).EQ.'N'.OR.LINE(1:1).EQ.'n')CALL ASTOP(LINE,0)     YSELF    1205
         IF(LINE(1:1).NE.'Y'.AND.LINE(1:1).NE.'y')THEN                  YSELF    1206
         IF(PLAYBA)CALL PSTOP                                           YSELF    1207
         GOTO 2300                                                      YSELF    1208
         ENDIF                                                          YSELF    1209
      ENDIF                                                             YSELF    1210
C                                                                       YSELF    1211
      IF(IEBK.EQ.1.OR.IEBK1.EQ.1.OR.IEBK3.EQ.1.OR.IEBK4.EQ.1) THEN      YSELF    1212
       MSG(1)='PROGRAM TERMINATED IN YSELF'                             YSELF    1213
       CALL ASTOP(MSG(1),27)                                            YSELF    1214
      ENDIF                                                             YSELF    1215
C                                                                       YSELF    1216
      RETURN                                                            YSELF    1217
C                                                                       YSELF    1218
C=======================================================================YSELF    1219
C     ENTRY TNETDA SECTION                                              YSELF    1220
C                                                                       YSELF    1221
C=======================================================================YSELF    1222
C                                                                       YSELF    1223
      ENTRY TNETDA(IUY)                                                 YSELF    1224
CD                                                                      YSELF    1225
CD    TO PRINT THE LOAD TABLE.                                          YSELF    1226
CD                                                                      YSELF    1227
      NOLOAD=NLOD+NMOTL+NTSCL                                           YSELF    1228
      IPLINE=60                                                         YSELF    1229
      IF(NOLOAD.NE.0)THEN                                               YSELF    1230
      IF(ILOAD.NE.0)THEN                                                YSELF    1231
      DO 3000 LK=1,NLFBUS                                               YSELF    1232
      IF(JBLD(LK).EQ.0)GOTO 3000                                        YSELF    1233
      IIL=JBLD(LK)                                                      YSELF    1234
      KL=IIL*12                                                         YSELF    1235
      ILK=NBLD(KL-11)                                                   YSELF    1236
      CALL UPACKI(IZONE,IAREA,ILK)                                      YSELF    1237
      JJ=NOLD(LK)                                                       YSELF    1238
      PMW=BLD(KL-9)                                                     YSELF    1239
      QMX=BLD(KL-8)                                                     YSELF    1240
      ICZP=NBLD(KL-6)                                                   YSELF    1241
      ICZQ=NBLD(KL-10)                                                  YSELF    1242
C                                                                       YSELF    1243
      IF(ICZP.EQ.100.AND.ICZQ.EQ.100)GOTO 3000                          YSELF    1244
C                                                                       YSELF    1245
      J3=NNEW(JJ)                                                       YSELF    1246
      J3=J3*3                                                           YSELF    1247
C                                                                       YSELF    1248
C     INDUCTION MOTOR LOAD                                              YSELF    1249
C     NOTE THE CASE WITH MORE THAN ONE MOTOR AT ONE BUS                 YSELF    1250
C                                                                       YSELF    1251
      IPIM=0                                                            YSELF    1252
      DO 2350 IM=1,NMOTL                                                YSELF    1253
      NPROG=NMOLD(IM)                                                   YSELF    1254
      NLF=NOLD(NPROG)                                                   YSELF    1255
      IF (NLF.EQ.JJ) THEN                                               YSELF    1256
         JM=JMDAT(IM)                                                   YSELF    1257
         IPIM=IPIM+IDDAT(JM+2)                                          YSELF    1258
      END IF                                                            YSELF    1259
      IQIM=0                                                            YSELF    1260
 2350 CONTINUE                                                          YSELF    1261
C                                                                       YSELF    1262
C     TSC LOAD                                                          YSELF    1263
C                                                                       YSELF    1264
      IPTSC=0                                                           YSELF    1265
      DO 2400 ITSC=1,NTSCL                                              YSELF    1266
         JTSC=JTCDAT(ITSC)                                              YSELF    1267
         NLF=IDDAT(JTSC+1)                                              YSELF    1268
         NLF=NOLD(NLF)                                                  YSELF    1269
         IF (NLF.EQ.JJ) THEN                                            YSELF    1270
            IPTSC=IDDAT(JTSC+9)                                         YSELF    1271
            GOTO 2450                                                   YSELF    1272
         END IF                                                         YSELF    1273
 2400 CONTINUE                                                          YSELF    1274
 2450 CONTINUE                                                          YSELF    1275
C                                                                       YSELF    1276
C           SYNCHRONOUS MOTOR LOAD                                      YSELF    1277
C                                                                       YSELF    1278
      IPSM=0                                                            YSELF    1279
      IQSM=0                                                            YSELF    1280
      IF (NT.EQ.0) GO TO 2650                                           YSELF    1281
      I=0                                                               YSELF    1282
      K=NNEW(JJ)                                                        YSELF    1283
      IF(K.GT.IPNODE)GOTO 2650                                          YSELF    1284
      I=NTHG(K)-1                                                       YSELF    1285
      NGCTX=NTHG(K+1)-I+1                                               YSELF    1286
      J=0                                                               YSELF    1287
 2500 J=J+1                                                             YSELF    1288
      I=I+1                                                             YSELF    1289
      IGEN=ICONTA(1,I)                                                  YSELF    1290
      IF(IGEN.LT.12)GOTO 2550                                           YSELF    1291
      IPSM=IPFG(I)+IPSM                                                 YSELF    1292
      IQSM=IQFG(I)+IQSM                                                 YSELF    1293
 2550 CONTINUE                                                          YSELF    1294
      IF (J.LT.NGCTX) GO TO 2500                                        YSELF    1295
 2650 CONTINUE                                                          YSELF    1296
C                                                                       YSELF    1297
C        THE NON-LINEAR LOADS                                           YSELF    1298
C                                                                       YSELF    1299
      IPNL1=0                                                           YSELF    1300
      IQNL1=0                                                           YSELF    1301
      IPNL2=0                                                           YSELF    1302
      IQNL2=0                                                           YSELF    1303
C                                                                       YSELF    1304
      IPCLD=0                                                           YSELF    1305
      IQCLD=0                                                           YSELF    1306
C                                                                       YSELF    1307
      IPKCUR=0                                                          YSELF    1308
      IQKCUR=0                                                          YSELF    1309
C                                                                       YSELF    1310
      IPKMVA=0                                                          YSELF    1311
      IQKMVA=0                                                          YSELF    1312
      ISHIFT=0                                                          YSELF    1313
C                                                                       YSELF    1314
      DO 2950 I=1,NLOD                                                  YSELF    1315
      JN=NLDOLD(I)                                                      YSELF    1316
      JN=NOLD(JN)                                                       YSELF    1317
C                                                                       YSELF    1318
      NCOMP=NLCOMP(1,I)                                                 YSELF    1319
C                                                                       YSELF    1320
      IF(NCOMP.EQ.0)GOTO 2950                                           YSELF    1321
C                                                                       YSELF    1322
      IF(JN.EQ.JJ)THEN                                                  YSELF    1323
C                                                                       YSELF    1324
C    RESTORE THE NO OF COMPONENT AT THE BUS AND THE TYPE                YSELF    1325
C                                                                       YSELF    1326
C                                                                       YSELF    1327
      DO 2900 KCOMP=1,NCOMP                                             YSELF    1328
      ISHIFT=ISHIFT+1                                                   YSELF    1329
      NTYPE=NLTYPE(ISHIFT)                                              YSELF    1330
      IF(NTYPE.EQ.0 .OR.NTYPE.GT.4)THEN                                 YSELF    1331
C      WRITE ERROR MESSAGE                                              YSELF    1332
       GOTO 2900                                                        YSELF    1333
      ENDIF                                                             YSELF    1334
C                                                                       YSELF    1335
C          KCUR  KMVA  V   ALOAD                                        YSELF    1336
      GOTO(2700, 2750, 2800,2850)NTYPE                                  YSELF    1337
C                                                                       YSELF    1338
C     CONSTANT CURRENT LOAD                                             YSELF    1339
C                                                                       YSELF    1340
 2700  CONTINUE                                                         YSELF    1341
C                                                                       YSELF    1342
        K=NNEW(JN)                                                      YSELF    1343
        VMG=CABS(VOLT(K))                                               YSELF    1344
        JNL=JDNLL(ISHIFT)                                               YSELF    1345
        IPKCUR=IDDAT(JNL+1)                                             YSELF    1346
        IQKCUR=IDDAT(JNL+8)                                             YSELF    1347
        GOTO 2900                                                       YSELF    1348
C                                                                       YSELF    1349
C                                                                       YSELF    1350
C    CONSTANT MVA AND PF LOAD REPRESENTATION                            YSELF    1351
C                                                                       YSELF    1352
C                                                                       YSELF    1353
 2750  CONTINUE                                                         YSELF    1354
C                                                                       YSELF    1355
       JNL=JDNLL(ISHIFT)                                                YSELF    1356
       IPKMVA=IDDAT(JNL+1)                                              YSELF    1357
       IQKMVA=IDDAT(JNL+7)                                              YSELF    1358
       GOTO 2900                                                        YSELF    1359
C                                                                       YSELF    1360
C    VOLTAGE EXP LOAD                                                   YSELF    1361
C--  RESTORE THE POINTER TO "DDAT"                                      YSELF    1362
C                                                                       YSELF    1363
 2800 CONTINUE                                                          YSELF    1364
C                                                                       YSELF    1365
      JNL=JDNLL(ISHIFT)                                                 YSELF    1366
      JK=IDDAT(JNL+1)                                                   YSELF    1367
      ITERMP=ITERML(JK,1)                                               YSELF    1368
      ITERMQ=ITERML(JK,2)                                               YSELF    1369
      JL=JNL+10                                                         YSELF    1370
C                                                                       YSELF    1371
       IF (ITERMP.NE.0) THEN                                            YSELF    1372
         IPNL1=IDDAT(JL+1)                                              YSELF    1373
         JL=JL+4                                                        YSELF    1374
       IF (ITERMP.EQ.2) THEN                                            YSELF    1375
         IPNL2=IDDAT(JL+1)                                              YSELF    1376
         JL=JL+4                                                        YSELF    1377
       ENDIF                                                            YSELF    1378
       ENDIF                                                            YSELF    1379
C                                                                       YSELF    1380
       IF (ITERMQ.NE.0) THEN                                            YSELF    1381
         IQNL1=IDDAT(JL+1)                                              YSELF    1382
         JL=JL+4                                                        YSELF    1383
        IF (ITERMQ.EQ.2) THEN                                           YSELF    1384
         IQNL2=IDDAT(JL+1)                                              YSELF    1385
         JL=JL+4                                                        YSELF    1386
        ENDIF                                                           YSELF    1387
       ENDIF                                                            YSELF    1388
      GOTO 2900                                                         YSELF    1389
C                                                                       YSELF    1390
C                                                                       YSELF    1391
C    COMPOSITE LOAD REPRESENTATION                                      YSELF    1392
C                                                                       YSELF    1393
 2850 CONTINUE                                                          YSELF    1394
C                                                                       YSELF    1395
       JNL=JDNLL(ISHIFT)                                                YSELF    1396
       IPCLD=IDDAT(JNL+3)                                               YSELF    1397
       IQCLD=IDDAT(JNL+11)                                              YSELF    1398
C                                                                       YSELF    1399
 2900 CONTINUE                                                          YSELF    1400
C                                                                       YSELF    1401
C                                                                       YSELF    1402
C   ENDIF JN .EQ. JJ                                                    YSELF    1403
C                                                                       YSELF    1404
      ELSE                                                              YSELF    1405
      ISHIFT=ISHIFT+NCOMP                                               YSELF    1406
C                                                                       YSELF    1407
      ENDIF                                                             YSELF    1408
                                                                        YSELF    1409
C                                                                       YSELF    1410
 2950 CONTINUE                                                          YSELF    1411
C                                                                       YSELF    1412
      IF(IPLINE.GE.53)THEN                                              YSELF    1413
         IF(IPLINE.GE.60)THEN                                           YSELF    1414
            WRITE(IUY,6730)                                             YSELF    1415
            WRITE(IUY,6731)                                             YSELF    1416
            WRITE(IUY,6732)                                             YSELF    1417
            WRITE(IUY,6733) BASPC                                       YSELF    1418
         ENDIF                                                          YSELF    1419
         WRITE(IUY,6700)                                                YSELF    1420
         WRITE(IUY,6750)                                                YSELF    1421
         IPLINE=0                                                       YSELF    1422
      ENDIF                                                             YSELF    1423
      WRITE(IUY,6800) JJ,INAME(J3-2),INAME(J3-1),INAME(J3),IAREA,IZONE, YSELF    1424
     *PMW,QMX,IPIM,IPTSC,IPSM,IQSM,IPNL1,IQNL1,IPNL2,IQNL2,IPCLD,IQCLD, YSELF    1425
     *IPKCUR,IQKCUR,IPKMVA,IQKMVA,ICZP,ICZQ                             YSELF    1426
      IPLINE=IPLINE+1                                                   YSELF    1427
C                                                                       YSELF    1428
 3000 CONTINUE                                                          YSELF    1429
C                                                                       YSELF    1430
C    ENDING ILOAD                                                       YSELF    1431
C                                                                       YSELF    1432
      ENDIF                                                             YSELF    1433
C                                                                       YSELF    1434
C   ENDING THE NLBS,NKCUR,NKMVA CHECK                                   YSELF    1435
C                                                                       YSELF    1436
      ENDIF                                                             YSELF    1437
C                                                                       YSELF    1438
C             PRINTING NON-LINEAR LOAD DATA                             YSELF    1439
C                                                                       YSELF    1440
      IF(NLBS.NE.0)THEN                                                 YSELF    1441
C                                                                       YSELF    1442
      IF(IPLINE.LT.59) IPLINE=59                                        YSELF    1443
C                                                                       YSELF    1444
      DO 3100 K=1,NLFBUS                                                YSELF    1445
C                                                                       YSELF    1446
C  6 LINES FOR BUS ORDER                                                YSELF    1447
C                                                                       YSELF    1448
         ISHIFT=0                                                       YSELF    1449
         DO 3010 I=1,NLOD                                               YSELF    1450
            JK=NLDOLD(I)                                                YSELF    1451
            INLBS=0                                                     YSELF    1452
            NCOMP=NLCOMP(1,I)                                           YSELF    1453
            DO 3050 ICOMP=1,NCOMP                                       YSELF    1454
               ISHIFT=ISHIFT+1                                          YSELF    1455
               IF(NLTYPE(ISHIFT).EQ.3) INLBS=ISHIFT                     YSELF    1456
 3050       CONTINUE                                                    YSELF    1457
            IF(JK.EQ.K) GOTO 3020                                       YSELF    1458
 3010    CONTINUE                                                       YSELF    1459
         GOTO 3100                                                      YSELF    1460
C                                                                       YSELF    1461
 3020 CONTINUE                                                          YSELF    1462
      IF(INLBS.EQ.0)GOTO 3100                                           YSELF    1463
      J=NOLD(K)                                                         YSELF    1464
      KN=K*3                                                            YSELF    1465
C                                                                       YSELF    1466
C--  RESTORE THE POINTER TO "DDAT" AND RECOVER THE BUS VOLTAGE          YSELF    1467
C                                                                       YSELF    1468
      JNL=JDNLL(INLBS)                                                  YSELF    1469
      JK=IDDAT(JNL+1)                                                   YSELF    1470
      ITERMP=ITERML(JK,1)                                               YSELF    1471
      ITERMQ=ITERML(JK,2)                                               YSELF    1472
      JL=JNL+10                                                         YSELF    1473
      CMW=0.0                                                           YSELF    1474
      CMX=0.0                                                           YSELF    1475
C                                                                       YSELF    1476
      EREAL=REAL(VOLT(K))                                               YSELF    1477
      EIMAG=AIMAG(VOLT(K))                                              YSELF    1478
      VMG=DDAT(JNL+3)                                                   YSELF    1479
      ANGR=0.0                                                          YSELF    1480
      IF (ABS(EREAL).GT.1.E-6) ANGR=ATAN2(EIMAG,EREAL)                  YSELF    1481
      ANGR=ANGR*57.29578                                                YSELF    1482
C                                                                       YSELF    1483
C--  RECOVER THE PARAMETERS ACCORDING TO THE NUMBER OF TERMS IN P       YSELF    1484
C                                                                       YSELF    1485
      IF (ITERMP.NE.0) THEN                                             YSELF    1486
         APPWR1=DDAT(JL+2)+2.0                                          YSELF    1487
         VMAGP1=VMG**APPWR1                                             YSELF    1488
         CKMW1=DDAT(JL+4)                                               YSELF    1489
         CMW1=CKMW1*VMG**APPWR1                                         YSELF    1490
         CMW=CMW1                                                       YSELF    1491
         FKMW1=DDAT(JL+3)                                               YSELF    1492
         JL=JL+4                                                        YSELF    1493
         IF (ITERMP.EQ.2) THEN                                          YSELF    1494
            APPWR2=DDAT(JL+2)+2.0                                       YSELF    1495
            VMAGP2=VMG**APPWR2                                          YSELF    1496
            CKMW2=DDAT(JL+4)                                            YSELF    1497
            CMW2=CKMW2*VMG**APPWR2                                      YSELF    1498
            CMW=CMW+CMW2                                                YSELF    1499
            FKMW2=DDAT(JL+3)                                            YSELF    1500
            JL=JL+4                                                     YSELF    1501
         ENDIF                                                          YSELF    1502
      ENDIF                                                             YSELF    1503
C                                                                       YSELF    1504
C--  RECOVER THE PARAMETERS ACCORDING TO THE NUMBER OF TERMS IN Q       YSELF    1505
C                                                                       YSELF    1506
      IF (ITERMQ.NE.0) THEN                                             YSELF    1507
         AQPWR1=DDAT(JL+2)+2.0                                          YSELF    1508
         VMAGQ1=VMG**AQPWR1                                             YSELF    1509
         CKMX1=DDAT(JL+4)                                               YSELF    1510
         CMX1=CKMX1*VMG**AQPWR1                                         YSELF    1511
         CMX=CMX1                                                       YSELF    1512
         FKMX1=DDAT(JL+3)                                               YSELF    1513
         JL=JL+4                                                        YSELF    1514
         IF (ITERMP.EQ.2) THEN                                          YSELF    1515
            AQPWR2=DDAT(JL+2)+2.0                                       YSELF    1516
            VMAGQ2=VMG**AQPWR2                                          YSELF    1517
            CKMX2=DDAT(JL+4)                                            YSELF    1518
            CMX2=CKMX2*VMG**AQPWR2                                      YSELF    1519
            CMX=CMX+CMX2                                                YSELF    1520
            FKMX2=DDAT(JL+3)                                            YSELF    1521
            JL=JL+4                                                     YSELF    1522
         ENDIF                                                          YSELF    1523
      ENDIF                                                             YSELF    1524
      ILK=IDDAT(JNL+2)                                                  YSELF    1525
      CALL UPACKI(IZONE,IAREA,ILK)                                      YSELF    1526
      CDL=DDAT(JNL+4)                                                   YSELF    1527
      CQL=DDAT(JNL+5)                                                   YSELF    1528
      CMAG=SQRT(CDL**2+CQL**2)                                          YSELF    1529
      JNL=JNL+JL                                                        YSELF    1530
C                                                                       YSELF    1531
C--  PRINTING                                                           YSELF    1532
C                                                                       YSELF    1533
      IF(IPLINE.GE.56.AND.I.LT.NLBS)THEN                                YSELF    1534
         IF(IPLINE.GE.60)THEN                                           YSELF    1535
            WRITE(IUY,6730)                                             YSELF    1536
            WRITE(IUY,6731)                                             YSELF    1537
            WRITE(IUY,6732)                                             YSELF    1538
            WRITE(IUY,6733) BASPC                                       YSELF    1539
         ENDIF                                                          YSELF    1540
         IPLINE=0                                                       YSELF    1541
         WRITE(IUY,5850)                                                YSELF    1542
      ENDIF                                                             YSELF    1543
      WRITE(IUY,5950)J,INAME(KN-2),INAME(KN-1),INAME(KN),IAREA,IZONE,VMGYSELF    1544
C                                                                       YSELF    1545
C--  DUMP THE OUTPUT VARIABLES INTO BUFFER AND WRITE                    YSELF    1546
C                                                                       YSELF    1547
      IF (ITERMP.NE.0) THEN                                             YSELF    1548
         IKP=3                                                          YSELF    1549
         BUF(1)=CMW1                                                    YSELF    1550
         BUF(2)=APPWR1                                                  YSELF    1551
         BUF(3)=FKMW1                                                   YSELF    1552
         IF (ITERMP.EQ.2) THEN                                          YSELF    1553
            IKP=6                                                       YSELF    1554
            BUF(4)=CMW2                                                 YSELF    1555
            BUF(5)=APPWR2                                               YSELF    1556
            BUF(6)=FKMW2                                                YSELF    1557
         END IF                                                         YSELF    1558
         WRITE(IUY,6150) (BUF(KJ),KJ=1,IKP)                             YSELF    1559
      ENDIF                                                             YSELF    1560
C                                                                       YSELF    1561
      IF (ITERMQ.NE.0) THEN                                             YSELF    1562
         IKQ=3                                                          YSELF    1563
         BUF(1)=CMX1                                                    YSELF    1564
         BUF(2)=AQPWR1                                                  YSELF    1565
         BUF(3)=FKMX1                                                   YSELF    1566
         IF (ITERMQ.EQ.2) THEN                                          YSELF    1567
            IKQ=6                                                       YSELF    1568
            BUF(4)=CMX2                                                 YSELF    1569
            BUF(5)=AQPWR2                                               YSELF    1570
            BUF(6)=FKMX2                                                YSELF    1571
         END IF                                                         YSELF    1572
         WRITE(IUY,6200) (BUF(KJ),KJ=1,IKQ)                             YSELF    1573
      ENDIF                                                             YSELF    1574
      IPLINE=IPLINE+1                                                   YSELF    1575
 3100 CONTINUE                                                          YSELF    1576
C                                                                       YSELF    1577
C     ENDIF NLBS .NE.0                                                  YSELF    1578
C                                                                       YSELF    1579
      ENDIF                                                             YSELF    1580
C                                                                       YSELF    1581
C    COMPOSITE LOAD REPRESENTATION                                      YSELF    1582
C                                                                       YSELF    1583
      IF(NCLD .NE.0)THEN                                                YSELF    1584
C                                                                       YSELF    1585
      IPLINE=60                                                         YSELF    1586
      DO 3500 I=1,NLOD                                                  YSELF    1587
C                                                                       YSELF    1588
      INCLD=0                                                           YSELF    1589
       NCOMP=NLCOMP(1,I)                                                YSELF    1590
       DO 3150 ICOMP=1,NCOMP                                            YSELF    1591
        ISHIFT=ISHIFT+1                                                 YSELF    1592
        IF(NLTYPE(ISHIFT).EQ.4)THEN                                     YSELF    1593
         INCLD=ISHIFT                                                   YSELF    1594
        ENDIF                                                           YSELF    1595
 3150  CONTINUE                                                         YSELF    1596
C                                                                       YSELF    1597
      IF(INCLD.EQ.0)GOTO 3500                                           YSELF    1598
C                                                                       YSELF    1599
      K=NLDOLD(I)                                                       YSELF    1600
      J=NOLD(K)                                                         YSELF    1601
      JK=JBLD(K)                                                        YSELF    1602
      JK=JK*12                                                          YSELF    1603
      ILK=NBLD(JK-11)                                                   YSELF    1604
      CALL UPACKI(IZONE,IAREA,ILK)                                      YSELF    1605
C                                                                       YSELF    1606
      JNL=JDNLL(INCLD)                                                  YSELF    1607
      VMG=CABS(VOLT(K))                                                 YSELF    1608
      PBAR=DDAT(JNL+4)*DDAT(JNL+6)                                      YSELF    1609
      QBAR=-DDAT(JNL+5)*DDAT(JNL+6)                                     YSELF    1610
      S=SQRT(PBAR*PBAR+QBAR*QBAR)                                       YSELF    1611
      CMAG=S/VMG                                                        YSELF    1612
      K3=K*3                                                            YSELF    1613
      NLM=NLFLMB(K)                                                     YSELF    1614
      IPLM=0                                                            YSELF    1615
      IQLM=0                                                            YSELF    1616
      IF(NLM.NE.0)THEN                                                  YSELF    1617
        JM=JMDAT(NLM)                                                   YSELF    1618
        IPLM=IDDAT(JM+2)                                                YSELF    1619
        IQLM=IDDAT(JM+3)                                                YSELF    1620
      ENDIF                                                             YSELF    1621
      NSM=NLFSMB(K)                                                     YSELF    1622
      IPSM=0                                                            YSELF    1623
      IQSM=0                                                            YSELF    1624
      IF(NSM.NE.0)THEN                                                  YSELF    1625
        JM=JMDAT(NSM)                                                   YSELF    1626
        IPSM=IDDAT(JM+2)                                                YSELF    1627
        IQSM=IDDAT(JM+3)                                                YSELF    1628
      ENDIF                                                             YSELF    1629
      JNL=JDNLL(I)                                                      YSELF    1630
      JL=JNL+11                                                         YSELF    1631
C                                                                       YSELF    1632
      ICLCPP=0                                                          YSELF    1633
      ICLCPQ=0                                                          YSELF    1634
      ICLDLP=0                                                          YSELF    1635
      ICLDLQ=0                                                          YSELF    1636
      ICLRMP=0                                                          YSELF    1637
      ICLRMQ=0                                                          YSELF    1638
      ICLTSQ=0                                                          YSELF    1639
C                                                                       YSELF    1640
 3200 CONTINUE                                                          YSELF    1641
      JTYPE=IDDAT(JL+1)                                                 YSELF    1642
C                                                                       YSELF    1643
      IF(JTYPE.EQ.0)GOTO 3450                                           YSELF    1644
      GOTO(3250,3300,3350,3400)JTYPE                                    YSELF    1645
C                                                                       YSELF    1646
 3250 CONTINUE                                                          YSELF    1647
C                                                                       YSELF    1648
        ICLDLP=IDDAT(JL+6)                                              YSELF    1649
        ICLDLQ=0.435890*ICLDLP*PBAR/QBAR                                YSELF    1650
        JL=JL+6                                                         YSELF    1651
        GOTO 3200                                                       YSELF    1652
C                                                                       YSELF    1653
 3300 CONTINUE                                                          YSELF    1654
C                                                                       YSELF    1655
        ICLTSQ=IDDAT(JL+2)                                              YSELF    1656
        JL=JL+6                                                         YSELF    1657
        GOTO 3200                                                       YSELF    1658
C                                                                       YSELF    1659
 3350 CONTINUE                                                          YSELF    1660
C                                                                       YSELF    1661
        ICLCPP=IDDAT(JL+2)                                              YSELF    1662
        ICLCPQ=IDDAT(JL+3)                                              YSELF    1663
        JL=JL+5                                                         YSELF    1664
        GOTO 3200                                                       YSELF    1665
C                                                                       YSELF    1666
 3400 CONTINUE                                                          YSELF    1667
        ICLRMP=DDAT(JL+2)                                               YSELF    1668
        ICLRMQ=DDAT(JL+3)                                               YSELF    1669
        JL=JL+6                                                         YSELF    1670
        GOTO 3200                                                       YSELF    1671
C                                                                       YSELF    1672
 3450 CONTINUE                                                          YSELF    1673
C                                                                       YSELF    1674
      IF(IPLINE.GE.56)THEN                                              YSELF    1675
       IPLINE=0                                                         YSELF    1676
       WRITE(IUY,6950)                                                  YSELF    1677
      ENDIF                                                             YSELF    1678
      WRITE(IUY,6000)J,INAME(K3-2),INAME(K3-1),INAME(K3),IAREA,IZONE,   YSELF    1679
     +VMG,CMAG,PBAR,QBAR,IPLM,IQLM,IPSM,IQSM,ICLDLP,ICLDLQ,ICLTSQ,      YSELF    1680
     +ICLCPP,ICLCPQ,ICLRMP,ICLRMQ                                       YSELF    1681
      IPLINE=IPLINE+1                                                   YSELF    1682
 3500 CONTINUE                                                          YSELF    1683
      ENDIF                                                             YSELF    1684
C                                                                       YSELF    1685
C     PRINTING OF THE CONSTANT CURRENT LOAD CONDITIONS                  YSELF    1686
C                                                                       YSELF    1687
      IF(NKCUR.NE.0)THEN                                                YSELF    1688
C                                                                       YSELF    1689
C                                                                       YSELF    1690
       ISHIFT=0                                                         YSELF    1691
       ICOUNT=2                                                         YSELF    1692
       JJMOD=0                                                          YSELF    1693
C                                                                       YSELF    1694
       IPLINE=60                                                        YSELF    1695
       DO 3600 I=1,NLOD                                                 YSELF    1696
C                                                                       YSELF    1697
        IKI=0                                                           YSELF    1698
        NCOMP=NLCOMP(1,I)                                               YSELF    1699
        DO 3550 ICOMP=1,NCOMP                                           YSELF    1700
         ISHIFT=ISHIFT+1                                                YSELF    1701
         IF(NLTYPE(ISHIFT).EQ.1)THEN                                    YSELF    1702
          IKI=ISHIFT                                                    YSELF    1703
         ENDIF                                                          YSELF    1704
 3550   CONTINUE                                                        YSELF    1705
C                                                                       YSELF    1706
        IF(IKI.EQ.0)GOTO 3600                                           YSELF    1707
C                                                                       YSELF    1708
        ICOUNT=ICOUNT+1                                                 YSELF    1709
        JJMOD=MOD(ICOUNT,2)                                             YSELF    1710
C                                                                       YSELF    1711
        K=NLDOLD(I)                                                     YSELF    1712
        J=NOLD(K)                                                       YSELF    1713
        JK=JBLD(K)                                                      YSELF    1714
        JK=JK*12                                                        YSELF    1715
        ILK=NBLD(JK-11)                                                 YSELF    1716
        CALL UPACKI(IZONE,IAREA,ILK)                                    YSELF    1717
        VMG=CABS(VOLT(K))                                               YSELF    1718
        JNL=JDNLL(IKI)                                                  YSELF    1719
        PKCUR=DDAT(JNL+2)*VMG                                           YSELF    1720
        QKCUR=DDAT(JNL+3)*VMG                                           YSELF    1721
        CMAG=SQRT(DDAT(JNL+2)*DDAT(JNL+2)+DDAT(JNL+3)*DDAT(JNL+3))      YSELF    1722
        K3=K*3                                                          YSELF    1723
C                                                                       YSELF    1724
        IF(IPLINE.GE.56)THEN                                            YSELF    1725
        IPLINE=0                                                        YSELF    1726
        WRITE(IUY,6850)                                                 YSELF    1727
        ENDIF                                                           YSELF    1728
C                                                                       YSELF    1729
        IF(JJMOD.NE.0)THEN                                              YSELF    1730
         WRITE(PMSG1,5950)J,INAME(K3-2),INAME(K3-1),INAME(K3),          YSELF    1731
     +   IAREA,IZONE,VMG,CMAG,PKCUR,QKCUR                               YSELF    1732
        ELSE                                                            YSELF    1733
         WRITE(PMSG2,5950)J,INAME(K3-2),INAME(K3-1),INAME(K3),          YSELF    1734
     +   IAREA,IZONE,VMG,CMAG,PKCUR,QKCUR                               YSELF    1735
        ENDIF                                                           YSELF    1736
       IF(JJMOD.EQ.0)THEN                                               YSELF    1737
         WRITE(IUY,5900)PMSG1,PMSG2                                     YSELF    1738
         IPLINE=IPLINE+1                                                YSELF    1739
       ENDIF                                                            YSELF    1740
C                                                                       YSELF    1741
 3600   CONTINUE                                                        YSELF    1742
C                                                                       YSELF    1743
       IF(JJMOD.EQ.1)THEN                                               YSELF    1744
        JJMOD=0                                                         YSELF    1745
         WRITE(IUY,5900)PMSG1                                           YSELF    1746
       ENDIF                                                            YSELF    1747
C                                                                       YSELF    1748
C    ENDIF NKCUR .NE. 0                                                 YSELF    1749
       ENDIF                                                            YSELF    1750
C                                                                       YSELF    1751
C    CONSTANT MVA AND PF LOAD REPRESENTATION                            YSELF    1752
C                                                                       YSELF    1753
      IF(NKMVA.NE.0)THEN                                                YSELF    1754
C                                                                       YSELF    1755
       ISHIFT=0                                                         YSELF    1756
       ICOUNT=2                                                         YSELF    1757
       JJMOD=0                                                          YSELF    1758
C                                                                       YSELF    1759
      IPLINE=60                                                         YSELF    1760
      DO 3700 I=1,NLOD                                                  YSELF    1761
C                                                                       YSELF    1762
        IKP=0                                                           YSELF    1763
        NCOMP=NLCOMP(1,I)                                               YSELF    1764
        DO 3650 ICOMP=1,NCOMP                                           YSELF    1765
         ISHIFT=ISHIFT+1                                                YSELF    1766
         IF(NLTYPE(ISHIFT).EQ.2)THEN                                    YSELF    1767
          IKP=ISHIFT                                                    YSELF    1768
         ENDIF                                                          YSELF    1769
 3650   CONTINUE                                                        YSELF    1770
        IF(IKP.EQ.0)GOTO 3700                                           YSELF    1771
C                                                                       YSELF    1772
        ICOUNT=ICOUNT+1                                                 YSELF    1773
        JJMOD=MOD(ICOUNT,2)                                             YSELF    1774
C                                                                       YSELF    1775
      K=NLDOLD(I)                                                       YSELF    1776
      J1=NOLD(K)                                                        YSELF    1777
      JK=JBLD(K)                                                        YSELF    1778
      JK=JK*12                                                          YSELF    1779
      ILK=NBLD(JK-11)                                                   YSELF    1780
      CALL UPACKI(IZONE1,IAREA1,ILK)                                    YSELF    1781
      JNL=JDNLL(IKP)                                                    YSELF    1782
      VMG=CABS(VOLT(K))                                                 YSELF    1783
      PKMVA=DDAT(JNL+2)                                                 YSELF    1784
      QKMVA=DDAT(JNL+3)                                                 YSELF    1785
      S=SQRT(PKMVA*PKMVA+QKMVA*QKMVA)                                   YSELF    1786
      CMAG=S/VMG                                                        YSELF    1787
      K3=K*3                                                            YSELF    1788
C                                                                       YSELF    1789
      IF(IPLINE.GE.56)THEN                                              YSELF    1790
         IPLINE=0                                                       YSELF    1791
         WRITE(IUY,6900)                                                YSELF    1792
      ENDIF                                                             YSELF    1793
C                                                                       YSELF    1794
C                                                                       YSELF    1795
        IF(JJMOD.NE.0)THEN                                              YSELF    1796
         WRITE(PMSG1,5950)J1,INAME(K3-2),INAME(K3-1),INAME(K3),         YSELF    1797
     +   IAREA1,IZONE1,VMG,CMAG,PKMVA,QKMVA                             YSELF    1798
        ELSE                                                            YSELF    1799
         WRITE(PMSG2,5950)J1,INAME(K3-2),INAME(K3-1),INAME(K3),         YSELF    1800
     +   IAREA1,IZONE1,VMG,CMAG,PKMVA,QKMVA                             YSELF    1801
        ENDIF                                                           YSELF    1802
       IF(JJMOD.EQ.0)THEN                                               YSELF    1803
         WRITE(IUY,5900)PMSG1,PMSG2                                     YSELF    1804
         IPLINE=IPLINE+1                                                YSELF    1805
       ENDIF                                                            YSELF    1806
 3700 CONTINUE                                                          YSELF    1807
C                                                                       YSELF    1808
       IF(JJMOD.EQ.1)THEN                                               YSELF    1809
        JJMOD=0                                                         YSELF    1810
         WRITE(IUY,5900)PMSG1                                           YSELF    1811
       ENDIF                                                            YSELF    1812
C                                                                       YSELF    1813
      ENDIF                                                             YSELF    1814
C                                                                       YSELF    1815
      RETURN                                                            YSELF    1816
C                                                                       YSELF    1817
 5000 FORMAT(' CAP-REAC LBNO=',I5,'PBNO=',I5,'GBUS=',G9.4,'BBUS=',G9.   YSELF    1818
     +4,'BSTC=',G9.4,'RYGR =',G9.4,'RIYGR=',G10.4,'QFARX=',G9.3)        YSELF    1819
 5050 FORMAT(' J=',I5,' K=',I5)                                         YSELF    1820
 5100 FORMAT(' *** WARNING AT BUS:',I5,' STATION: ',3A4)                YSELF    1821
 5150 FORMAT(5X,'IS NOT IN LF CHECK YOUR NON-LINEAR LOAD DATA')         YSELF    1822
 5200 FORMAT(' YSELF.DB:ITERMP,ITERMQ,VMG,PFA1,CKMW1,APPWR1,',          YSELF    1823
     +'PFA2,CKMW2,APPWR2,QFA1,CKMX1,AQPWR1,QFA2,CKMX2,AQPWR2 ',2I2,G9.3,YSELF    1824
     +/,1X,12G9.3)                                                      YSELF    1825
 5250 FORMAT(5X,'HAS NEGATIVE % OF',I6,' FOR BMW AND',I6,' FOR BMX')    YSELF    1826
 5300 FORMAT(5X,'CHECK LOAD DATA')                                      YSELF    1827
 5350 FORMAT(' PARK''S LBNO=',I5,' PBNO=',I3,' CT=',I3,' GMWJ=',G8.2,   YSELF    1828
     +' GMXJ=',G8.2,' PFA=',F4.0,' QFA=',F4.0,' PDGI=',E7.1,' PQGI=',E7.YSELF    1829
     +1,' CDGI=',E7.1,' CQGI=',E7.1)                                    YSELF    1830
 5400 FORMAT(' NETTING LBNO=',I5,'PBNO=',I5,'GBUS=',E12.5,'BBUS=',E12   YSELF    1831
     +.5,'GMW=',E12.5,'GMX=',E12.5)                                     YSELF    1832
 5450 FORMAT(34X,'*** NETTING OF LF GENERATION NOT REPRESENTED ***',//  YSELF    1833
     *,1X,3(' BUS# STATION NAME        GMW        GMX '),/              YSELF    1834
     *,1X,3('----- ------------   --------   -------- '))               YSELF    1835
 5500 FORMAT(3(1X,I5,1X,3A4,2F11.2))                                    YSELF    1836
 5550 FORMAT(34X,'*** NO NETTING OF GENERATION NOT REPRESENTED ***')    YSELF    1837
 5600 FORMAT(' *** ERROR AT BUS:',I5,' STATION: ',3A4                   YSELF    1838
     *,'  NETTING OF GENERATION')                                       YSELF    1839
 5650 FORMAT(5X,'GMW =',F11.2,' OR GMX =',F11.2                         YSELF    1840
     *,' EXCEEDS THE SPECIFIED LIMIT')                                  YSELF    1841
 5700 FORMAT(5X,'OF',F11.2,' MW')                                       YSELF    1842
 5750 FORMAT(47X,'*** INFINITE BUSES ***',/,1X                          YSELF    1843
     *,7(' BUS# BUS NAME    '),/,1X,7(' ---- ',12('-')))                YSELF    1844
 5800 FORMAT(1X,7(I5,1X,3A4))                                           YSELF    1845
 5850 FORMAT(1H1,30X,5('* '),'VOLTAGE EXPONENTIAL LOAD BUS CONDITIONS'  YSELF    1846
     *,5(' *'),//,'  BUS# BUS NAME     AREA ZONE     V0     P1     A1'  YSELF    1847
     *,'   KPF1     P2     A2   KPF2     Q1     B1   KQF1     Q2     B2'YSELF    1848
     *,'   KQF2',/,' ----- ------------ ---- ----',13(' ------'))       YSELF    1849
 5900 FORMAT(A61,4X,A61)                                                YSELF    1850
 5950 FORMAT(I6,1X,3A4,2I5,4F7.3,I14,1X,3A4,2I5,4F7.3)                  YSELF    1851
 6000 FORMAT (1X,I5,1X,3A4,2I5,2X,2F7.3,2X,2F7.3,6I5,5X,5I5)            YSELF    1852
 6050 FORMAT(' *** ERROR GENERATOR AT BUS#',I5,' STATION:'              YSELF    1853
     *,3A4)                                                             YSELF    1854
 6100 FORMAT(5X,'HAS EXTRA GENERATION OF ',G12.4,' MW & ',G12.4,' MX')  YSELF    1855
 6150 FORMAT('+',T37,6F7.3)                                             YSELF    1856
 6200 FORMAT('+',T79,6F7.3)                                             YSELF    1857
 6250 FORMAT(' NLF,MNEW(NLF),NNEW(NLF),ACBASKV,ACBASI: ',3I6,2F10.2)    YSELF    1858
 6300 FORMAT(' ORIGINAL LOAD ',4I5,2F12.6,2I10)                         YSELF    1859
 6350 FORMAT(' JBLD(1:LBUSNO) ',10I5)                                   YSELF    1860
 6400 FORMAT(1X,'*** ERROR COMPOSITE LOAD AT BUS#',I5,' NAME:',3A4)     YSELF    1861
 6450 FORMAT(5X,'HAS ',F8.2,' OF REAL BUS POWER  CHECK ALOAD DATA')     YSELF    1862
 6500 FORMAT(5X,'HAS ',F8.2                                             YSELF    1863
     *,' OF REACTIVE BUS POWER  CHECK ALOAD DATA')                      YSELF    1864
 6550 FORMAT(' REMAINING LOAD ',2F12.5)                                 YSELF    1865
 6600 FORMAT(' CONST-CURRENT ',2I5,2I10,6F12.5)                         YSELF    1866
C 1730 FORMAT(' CONST MVA ',2I5,2F12.5,2I10,4F12.5)                     YSELF    1867
 6650 FORMAT(' CONST-Z LOAD ',2I5,F12.5,2F10.2,4F12.5)                  YSELF    1868
 6700 FORMAT(1H1,49X,5('* '),'NONLINEAR LOAD TABLE',5(' *'),/)          YSELF    1869
 6730 FORMAT(1H1,44X,5('* '),'NONLINEAR LOAD DATA TABULATION',5(' *')   YSELF    1870
     1,////,10X,'SYMBOLS USED IN NONLINEAR LOAD TABLE:',/,10X,37('=')   YSELF    1871
     2,//,10X,'IM LOAD',15X,'= INDUCTION MOTOR LOAD',/                  YSELF    1872
     3,10X,'TSC LOAD',14X,'= THERMOSTATICALLY CONTROLLED LOAD',/        YSELF    1873
     4,10X,'SM LOAD',15X,'= SYNCHRONOUS MOTOR LOAD',/                   YSELF    1874
     5,10X,'VOLTAGE EXPONT. LOAD  = VOLTAGE EXPONENTIAL LOAD',/         YSELF    1875
     *,10X,'A-LOAD',16X,'= AGGREGATED LOAD',/                           YSELF    1876
     7,10X,'CONST-I',15X,'= CONSTANT CURRENT LOAD',/                    YSELF    1877
     8,10X,'CONST-MVA',13X,'= CONSTANT MVA LOAD',/                      YSELF    1878
     9,10X,'CONST-Z',15X,'= CONSTANT IMPEDANCE LOAD',////,10X           YSELF    1879
     *,'SYMBOLS USED IN VOLTAGE EXPONENTIAL LOAD BUS CONDITIONS TABLE:')YSELF    1880
 6731 FORMAT(10X,62('='),//,10X,'V0',20X                                YSELF    1881
     2,'= VOLTAGE MAGNITUDE OF THE LOAD BUS AT THE STEADY STATE',/      YSELF    1882
     3,10X,'P1',20X,'= P0*KP1/100, WHERE P0 IS THE TOTAL ACTIVE POWER'  YSELF    1883
     4,' OF THE LOAD BUS AT THE STEADY STATE, KP1 IS THE',/             YSELF    1884
     5,34X,'PERCENTAGE OF P0 FOR THE FIRST ACTIVE POWER COMPONENT',/    YSELF    1885
     6,10X,'A1',20X,'= VOLTAGE EXPONENTIAL IN THE FIRST ACTIVE POWER'   YSELF    1886
     7,' COMPONENT',/,10X,'KPF1',18X,'= COEFFICIENT OF THE FREQUENCY'   YSELF    1887
     8,' DEPENDENT TERM IN THE FIRST ACTIVE POWER COMPONENT',/          YSELF    1888
     9,10X,'P2',20X,'= P0*KP2/100, WHERE P0 IS THE TOTAL ACTIVE POWER'  YSELF    1889
     *,' OF THE LOAD BUS AT THE STEADY STATE, KP2 IS THE')              YSELF    1890
 6732 FORMAT(34X                                                        YSELF    1891
     1,'PERCENTAGE OF P0 FOR THE SECOND ACTIVE POWER COMPONENT',/       YSELF    1892
     2,10X,'A2',20X,'= VOLTAGE EXPONENTIAL IN THE SECOND ACTIVE POWER'  YSELF    1893
     3,' COMPONENT',/,10X,'KPF2',18X,'= COEFFICIENT OF THE FREQUENCY'   YSELF    1894
     4,' DEPENDENT TERM IN THE SECOND ACTIVE POWER COMPONENT',/         YSELF    1895
     5,10X,'Q1',20X,'= Q0*KQ1/100, WHERE Q0 IS THE TOTAL REACTIVE POWER'YSELF    1896
     6,' OF THE LOAD BUS AT THE STEADY STATE, KQ1 IS THE',/             YSELF    1897
     7,34X,'PERCENTAGE OF Q0 FOR THE FIRST REACTIVE POWER COMPONENT',/  YSELF    1898
     8,10X,'B1',20X,'= VOLTAGE EXPONENTIAL IN THE FIRST REACTIVE POWER' YSELF    1899
     9,' COMPONENT',/,10X,'KQF1',18X,'= COEFFICIENT OF THE FREQUENCY'   YSELF    1900
     *,' DEPENDENT TERM IN THE FIRST REACTIVE POWER COMPONENT')         YSELF    1901
 6733 FORMAT(10X,'Q2',20X                                               YSELF    1902
     1,'= Q0*KQ2/100, WHERE Q0 IS THE TOTAL REACTIVE POWER'             YSELF    1903
     2,' OF THE LOAD BUS AT THE STEADY STATE, KQ2 IS THE',/             YSELF    1904
     3,34X,'PERCENTAGE OF Q0 FOR THE SECOND REACTIVE POWER COMPONENT',/ YSELF    1905
     4,10X,'B2',20X,'= VOLTAGE EXPONENTIAL IN THE SECOND REACTIVE POWER'YSELF    1906
     5,' COMPONENT',/,10X,'KQF2',18X,'= COEFFICIENT OF THE FREQUENCY'   YSELF    1907
     6,' DEPENDENT TERM IN THE SECOND REACTIVE POWER COMPONENT',//      YSELF    1908
     7,10X,'SYMBOLS V0, P0, KP1, A1, KPF1, KP2, A2, KPF2, Q0, KQ1, B1,' YSELF    1909
     8,' KQF1, KQ2, B2, AND KQF2 ARE ALSO EXPLAINED IN THE USER''S',/   YSELF    1910
     9,10X,'MANUAL',////,10X,'ALL LOAD POWERS ARE IN PER UNIT ON'       YSELF    1911
     *,F9.2,' MVA BASE')                                                YSELF    1912
 6750 FORMAT(33X,'TOTAL LOAD  IM LOAD TSC LOAD   SM LOAD VOLTAGE'       YSELF    1913
     *,' EXPONT. LOAD   A-LOAD   CONST-I CONST-MVA   CONST-Z',/,31X     YSELF    1914
     *,12('-'),'  ------- --------   ------- ',20('-'),'   ------'      YSELF    1915
     *,'   ------- --',2(7('-'),3X),/,'  BUS# BUS NAME     AREA ZONE'   YSELF    1916
     *,'  P(PU)  Q(PU)     % P     % P  ',7('  % P  % Q'),/,'  ----'    YSELF    1917
     *,' ------------ ',2('---- '),2(' ----- '),2('   ---- '),1X        YSELF    1918
     *,14(' ----'))                                                     YSELF    1919
 6800 FORMAT(I6,1X,3A4,2I5,2(F7.2),3X,I5,3X,I5,2X,14(I5))               YSELF    1920
 6850 FORMAT(1H1,21X,5('* '),'CONSTANT CURRENT LOAD BUS CONDITIONS'     YSELF    1921
     +,5(' *'),//,'  BUS# BUS NAME     AREA ZONE   VMAG   CMAG  '       YSELF    1922
     *,'P(PU)  Q(PU)',10X,'BUS# BUS NAME     AREA ZONE   VMAG   CMAG'   YSELF    1923
     *,'  P(PU)  Q(PU)',/,' ----- ',12('-'),2(' ----'),4('  -----')     YSELF    1924
     *,9X,'----- ',12('-'),2(' ----'),4('  -----'))                     YSELF    1925
 6900 FORMAT(1H1,25X,5('* '),'CONSTANT MVA LOAD BUS CONDITIONS'         YSELF    1926
     +,5(' *'),//,'  BUS# BUS NAME     AREA ZONE   VMAG   CMAG  '       YSELF    1927
     *,'P(PU)  Q(PU)',10X,'BUS# BUS NAME     AREA ZONE   VMAG   CMAG'   YSELF    1928
     *,'  P(PU)  Q(PU)',/,' ----- ',12('-'),2(' ----'),4('  -----')     YSELF    1929
     *,9X,'----- ',12('-'),2(' ----'),4('  -----'))                     YSELF    1930
 6950 FORMAT (1H1,1X,24X,5('* '),' COMPOSITE LOAD BUS CONDITIONS   '    YSELF    1931
     +,5('* '),//,2X,'BUS# BUS NAME    ',1X,'AREA',3X,'ZONE'            YSELF    1932
     +,3X,'VMAG',3X,'CMAG',4X,'PBAR ',2X,'QBAR ',' L-MOTOR  ',' S-      YSELF    1933
     +MOTOR  ','D-LIGHTING',' TRAN.SAT.',' CONST-MVA',' RM. LOAD '      YSELF    1934
     +,/,1X,5('-'),1X,12('-'),1X,'----',3X,'----',2(2X,5('-')),4X       YSELF    1935
     +,'-----',2X,'-----',2(1X,7('-'),2X),10('-'),1X,9('-'),1X,9('-')   YSELF    1936
     +,1X,8('-'),1X,/,61X,3(' % P  % Q '),6X,'% Q ',2(' % P  % Q '),/   YSELF    1937
     +,61X,6(' ----'),5X,5(' ----'))                                    YSELF    1938
 7000 FORMAT(20X,'*** NETTING OF LOADS NOT REPRESENTED AND THEIR % ',   YSELF    1939
     *       'WITH RESPECT TO ORIGINAL LOAD  ***',//,                   YSELF    1940
     +1X,2(' BUS# BUS NAME             MW         MX     %P    %Q '),/  YSELF    1941
     *,1X,2('----- ------------   --------   --------   ----  ---- '))  YSELF    1942
 7050 FORMAT(1X,2(I5,1X,3A4,2F11.2,2X,I5,1X,I5,1X))                     YSELF    1943
 7100 FORMAT(' I,NLF,K: ',3I10)                                         YSELF    1944
 7150 FORMAT(/,6X,34(' *'),/,7X                                         YSELF    1945
     *,'*   TOTAL NETTING OF GENERATION NOT REPRESENTED:'               YSELF    1946
     *,F12.2,' MW   *',/,7X,'*',47X,F12.2,' MX   *',/,6X,34(' *'))      YSELF    1947
 7200 FORMAT(/,6X,32(' *'),/,7X,'*   TOTAL SYSTEM LOAD :',F33.2         YSELF    1948
     *,' MW   *',/,7X,'*',F55.2,' MX   *',/,7X,'*',61X,'*',/            YSELF    1949
     *,7X,'*   TOTAL NETTING OF LOADS NOT REPRESENTED :'                YSELF    1950
     *,F12.2,' MW   *',/,7X,'*',43X,F12.2,' MX   *',/,6X,32(' *'))      YSELF    1951
 7250 FORMAT(' *** ERROR TOTAL NUMBER OF LOAD IN THE NETWORK EXCEEDS'   YSELF    1952
     *,' THE DIMENSION')                                                YSELF    1953
 7300 FORMAT(5X,'ALLOWED (',I5,')')                                     YSELF    1954
 7350 FORMAT(1X,'*** ERROR CONVERTER AC BUS: ',I6,1X,3A4)               YSELF    1955
 7400 FORMAT(11X,'HAS BASE KV OF 0.0 IN THE LOAD FLOW')                 YSELF    1956
 7450 FORMAT(34X,'*** NETTING OF LF GENERATION NOT REPRESENTED ***',//  YSELF    1957
     *,1X,3(' BUS# STATION NAME  GID      GMW      GMX '),/             YSELF    1958
     *,1X,3('----- ------------  --- -------- -------- '))              YSELF    1959
 7500 FORMAT(3(1X,I5,1X,3A4,1X,A4,2F9.2))                               YSELF    1960
      END                                                               YSELF    1961
