CFPRIME LODSUM                                                          LODSUM      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 LODSUM(TS,LFLAG,IJUMP)                                 LODSUM      3
CD                                                                      LODSUM      4
CD    TO PRINT A LOAD SUMMARY TABLE.                                    LODSUM      5
CD                                                                      LODSUM      6
      INCLUDE 'PARX.INS'                                                LODSUM      7
      INCLUDE 'CNIPTR.INS'                                              LODSUM      8
      INCLUDE 'CNVOLT.INS'                                              LODSUM      9
      INCLUDE 'CNSTN.INS'                                               LODSUM     10
      INCLUDE 'CNPT.INS'                                                LODSUM     11
      INCLUDE 'CNB1.INS'                                                LODSUM     12
      INCLUDE 'CNB6.INS'                                                LODSUM     13
      INCLUDE 'CNB8.INS'                                                LODSUM     14
      INCLUDE 'CNB19.INS'                                               LODSUM     15
      INCLUDE 'CNNNEW.INS'                                              LODSUM     16
      INCLUDE 'CNMDAT.INS'                                              LODSUM     17
      INCLUDE 'CNLSTA.INS'                                              LODSUM     18
      INCLUDE 'CNUNIT.INS'                                              LODSUM     19
      INCLUDE 'CNSPC1.INS'                                              LODSUM     20
      INCLUDE 'CNSPVI.INS'                                              LODSUM     21
      INCLUDE 'CNNBLD.INS'                                              LODSUM     22
      INCLUDE 'EPBUS.INS'                                               LODSUM     23
      INCLUDE 'CNHL20.INS'                                              LODSUM     24
      INCLUDE 'CNCVHL.INS'                                              LODSUM     25
      INCLUDE 'CNPARX.INS'                                              LODSUM     26
      INCLUDE 'CNENG1.INS'                                              LODSUM     27
      INCLUDE 'CNZSTA.INS'                                              LODSUM     28
C                                                                       LODSUM     29
      DIMENSION LLFBUS(20),KNAME(20),PERC(20),JVADD(NB)                 LODSUM     30
      EQUIVALENCE (JVADD(1),ZSTATE(1))                                  LODSUM     31
      CHARACTER*2 LGID(20)                                              LODSUM     32
C                                                                       LODSUM     33
      IF(NTSCL.EQ.0) GOTO 1710                                          LODSUM     34
CD                                                                      LODSUM     35
CD    PRINT SUMMARY OF THERMOSTATICALLY CONTROLLED LOAD CONDITIONS      LODSUM     36
CD                                                                      LODSUM     37
      JAR4=JAR*4                                                        LODSUM     38
      JZN4=JZN*4                                                        LODSUM     39
      JAR2=JAR*2                                                        LODSUM     40
      JZN2=JZN*2                                                        LODSUM     41
      CALL FMOVE(0,PAREA,PAREA,JAR4)                                    LODSUM     42
      CALL FMOVE(0,PZONE,PZONE,JZN4)                                    LODSUM     43
      IIL=61                                                            LODSUM     44
C      WRITE(LOUT,'(///)')                                              LODSUM     45
C      WRITE(LOUT,3100)                                                 LODSUM     46
      DO 1500 II=1,NTSCL                                                LODSUM     47
         JTC=JTCDAT(II)                                                 LODSUM     48
         K=IDDAT(JTC+1)                                                 LODSUM     49
         NLF=NOLD(K)                                                    LODSUM     50
         K3=K*3                                                         LODSUM     51
         VREAL=REAL(VOLT(K))                                            LODSUM     52
         VIMAG=AIMAG(VOLT(K))                                           LODSUM     53
         VMG2=VREAL**2+VIMAG**2                                         LODSUM     54
         GCHANG=100*(DDAT(JTC+11)-DDAT(JTC+10))/DDAT(JTC+10)            LODSUM     55
         P=VMG2*DDAT(JTC+11)                                            LODSUM     56
         P0=DDAT(JTC+10)*DDAT(JTC+14)                                   LODSUM     57
         PCHANG=100*(P-P0)/P0                                           LODSUM     58
         IF(IIL.GE.60)THEN                                              LODSUM     59
            IIL=7                                                       LODSUM     60
            CALL PAGE6                                                  LODSUM     61
            WRITE(IU6,8800)                                             LODSUM     62
         ENDIF                                                          LODSUM     63
         WRITE(IU6,9100) NLF,INAME(K3-2),INAME(K3-1),INAME(K3)          LODSUM     64
     *                  ,DDAT(JTC+10),DDAT(JTC+11),GCHANG,P0,P,PCHANG   LODSUM     65
C         WRITE(LOUT,3150) NLF,INAME(K3-2),INAME(K3-1),INAME(K3)        LODSUM     66
C     *                  ,DDAT(JTC+10),DDAT(JTC+11),GCHANG,P0,P,PCHANG  LODSUM     67
         IIL=IIL+1                                                      LODSUM     68
C                                                                       LODSUM     69
         JJ=NBARZO(K)                                                   LODSUM     70
         CALL UPACKI(LZONE,LAREA,JJ)                                    LODSUM     71
C                                                                       LODSUM     72
         DO 1100 KK=1,IXAREA                                            LODSUM     73
            KK2=KK+KK                                                   LODSUM     74
            IF(LAREA.EQ.JAREA(KK))THEN                                  LODSUM     75
               KK1=KK2+JAR2                                             LODSUM     76
               PAREA(KK2-1)=PAREA(KK2-1)+DDAT(JTC+10)                   LODSUM     77
               PAREA(KK2)=PAREA(KK2)+DDAT(JTC+11)                       LODSUM     78
               PAREA(KK1-1)=PAREA(KK1-1)+P0                             LODSUM     79
               PAREA(KK1)=PAREA(KK1)+P                                  LODSUM     80
               GOTO 1200                                                LODSUM     81
            ENDIF                                                       LODSUM     82
 1100    CONTINUE                                                       LODSUM     83
 1200    CONTINUE                                                       LODSUM     84
         DO 1300 KK=1,IXZONE                                            LODSUM     85
            KK2=KK+KK                                                   LODSUM     86
            KK1=KK2+JZN2                                                LODSUM     87
            IF(LZONE.EQ.JZONE(KK))THEN                                  LODSUM     88
               PZONE(KK2-1)=PZONE(KK2-1)+DDAT(JTC+10)                   LODSUM     89
               PZONE(KK2)=PZONE(KK2)+DDAT(JTC+11)                       LODSUM     90
               PZONE(KK1-1)=PZONE(KK1-1)+P0                             LODSUM     91
               PZONE(KK1)=PZONE(KK1)+P                                  LODSUM     92
               GOTO 1400                                                LODSUM     93
            ENDIF                                                       LODSUM     94
 1300    CONTINUE                                                       LODSUM     95
 1400    CONTINUE                                                       LODSUM     96
 1500 CONTINUE                                                          LODSUM     97
      IIL=61                                                            LODSUM     98
      DO 1600 II=1,IXAREA                                               LODSUM     99
         II2=II+II                                                      LODSUM    100
         II1=II2+JAR2                                                   LODSUM    101
         IF(PAREA(II2-1).LE.1.0E-6.OR.PAREA(II1-1).LE.1.0E-6) GOTO 1600 LODSUM    102
         IF(IIL.GE.60)THEN                                              LODSUM    103
            CALL PAGE6                                                  LODSUM    104
            IIL=7                                                       LODSUM    105
            WRITE(IU6,8900)                                             LODSUM    106
         ENDIF                                                          LODSUM    107
         JI=JAREA(II)                                                   LODSUM    108
         WRITE(IU6,9100) JI,IARE(II,1),IARE(II,2),IARE(II,3)            LODSUM    109
     *      ,PAREA(II2-1),PAREA(II2),100*(PAREA(II2)-PAREA(II2-1))/     LODSUM    110
     *      PAREA(II2-1),PAREA(II1-1),PAREA(II1)                        LODSUM    111
     *      ,100*(PAREA(II1)-PAREA(II1-1))/PAREA(II1-1)                 LODSUM    112
         IIL=IIL+1                                                      LODSUM    113
 1600 CONTINUE                                                          LODSUM    114
C                                                                       LODSUM    115
      IIL=61                                                            LODSUM    116
      DO 1700 II=1,IXZONE                                               LODSUM    117
         II2=II+2                                                       LODSUM    118
         II1=II2+JZN2                                                   LODSUM    119
         IF(PZONE(II2-1).LE.1.0E-6.OR.PZONE(II1-1).LE.1.0E-6) GOTO 1700 LODSUM    120
         IF(IIL.GE.60)THEN                                              LODSUM    121
            CALL PAGE6                                                  LODSUM    122
            IIL=7                                                       LODSUM    123
            WRITE(IU6,9000)                                             LODSUM    124
         ENDIF                                                          LODSUM    125
         JI=JZONE(II)                                                   LODSUM    126
         WRITE(IU6,9100) JI,NAMZN(II,1),NAMZN(II,2),NAMZN(II,3)         LODSUM    127
     *      ,PZONE(II2-1),PZONE(II2),100*(PZONE(II2)-PZONE(II2-1))/     LODSUM    128
     *      PZONE(II2-1),PZONE(II1-1),PZONE(II1)                        LODSUM    129
     *      ,100*(PZONE(II1)-PZONE(II1-1))/PZONE(II1-1)                 LODSUM    130
         IIL=IIL+1                                                      LODSUM    131
 1700 CONTINUE                                                          LODSUM    132
 1710 CONTINUE                                                          LODSUM    133
C                                                                       LODSUM    134
CD                                                                      LODSUM    135
CD    UPDATE LOAD SHED SCHEDULE DUE TO DISCONNECTED LINES               LODSUM    136
CD                                                                      LODSUM    137
CD    1. FOR BUSES THAT VOLTAGES ARE CURRENTLY AVAILABLE                LODSUM    138
CD                                                                      LODSUM    139
      DO 100 K=1,LASTV2                                                 LODSUM    140
      IF(JBLD(K).NE.0)THEN                                              LODSUM    141
         VREAL=REAL(VOLT(K))                                            LODSUM    142
         VIMAG=AIMAG(VOLT(K))                                           LODSUM    143
         VMG2=VREAL**2+VIMAG**2                                         LODSUM    144
         IF(VMG2.LT.1.0E-3)THEN                                         LODSUM    145
         IA=JBLD(K)                                                     LODSUM    146
         IIL=IA*12                                                      LODSUM    147
         IPFA=NBLD(IIL-6)                                               LODSUM    148
         IQFA=NBLD(IIL-10)                                              LODSUM    149
         FACTP=IPFA/100.                                                LODSUM    150
         FACTQ=IQFA/100.                                                LODSUM    151
         BLD(IIL-3)=BLD(IIL-9)*BASPC*FACTP                              LODSUM    152
         BLD(IIL-2)=BLD(IIL-8)*BASPC*FACTQ                              LODSUM    153
         BLD(IIL-5)=BLD(IIL-9)                                          LODSUM    154
         BLD(IIL-4)=BLD(IIL-8)                                          LODSUM    155
         ENDIF                                                          LODSUM    156
      ENDIF                                                             LODSUM    157
  100 CONTINUE                                                          LODSUM    158
CD                                                                      LODSUM    159
CD    2. CALCULATE BUS VOLTAGE FOR BUSES THAT VOLTAGES HAVE NOT         LODSUM    160
CD        BEEN CALCULATED                                               LODSUM    161
CD                                                                      LODSUM    162
      IF(NCZLB.GT.0)THEN                                                LODSUM    163
C                                                                       LODSUM    164

C  Modification done by NPAC, GRA Alvin Leung.
C
C  Original code is commented out by characters CO.
C
      NV=2                                                              LODSUM    165
      INSTR=3                                                           LODSUM    166
      CALL ASOLSC(INSTR,NLAST,NV)                                       LODSUM    167
C
C      Modification start here.
C
C     We bundle the linear solver into two subroutines
C     LINEAR1 and LINEAR2
C     For LU factorization, LINEAR2 does:
C     1. Determine wich mode
C     2. If mode == 1, then do forward and back solve.
C     3. If mode == 2, then do back solve only.
C     4. The data is inherent form LINEAR1.
C
C     CALL LINEAR2(2, NLAST)
C                                                                       LODSUM    168
      DO 200 I=1,NCZLB                                                  LODSUM    169
      K=ICZLB(I)                                                        LODSUM    170
      VREAL=REAL(VOLT(K))                                               LODSUM    171
      VIMAG=AIMAG(VOLT(K))                                              LODSUM    172
      VMG2=VREAL**2+VIMAG**2                                            LODSUM    173
         IF(VMG2.LT.1.0E-3)THEN                                         LODSUM    174
         IA=JBLD(K)                                                     LODSUM    175
         IIL=IA*12                                                      LODSUM    176
         BLD(IIL-3)=BLD(IIL-9)*BASPC                                    LODSUM    177
         BLD(IIL-2)=BLD(IIL-8)*BASPC                                    LODSUM    178
         BLD(IIL-5)=BLD(IIL-9)                                          LODSUM    179
         BLD(IIL-4)=BLD(IIL-8)                                          LODSUM    180
         ENDIF                                                          LODSUM    181
  200 CONTINUE                                                          LODSUM    182
C                                                                       LODSUM    183
         ENDIF                                                          LODSUM    184
C                                                                       LODSUM    185
CD                                                                      LODSUM    186
CD    LFLAG = 0 SUMMARY AT TIME                                         LODSUM    187
CD    LFLAG = 1 SUMMARY AT THE END OF THE SIMULATION                    LODSUM    188
CD                                                                      LODSUM    189
CD    IJUMP = 0 PRINT ALL LOADS INCLUDING TSC LOADS                     LODSUM    190
CD    IJUMP = 1 PRINT ONLY TSC LOADS                                    LODSUM    191
CD                                                                      LODSUM    192
      IF(IJUMP.EQ.1)RETURN                                              LODSUM    193
C                                                                       LODSUM    194
      TMW=0.                                                            LODSUM    195
      TMX=0.                                                            LODSUM    196
      TPSHED=0.                                                         LODSUM    197
      TQSHED=0.                                                         LODSUM    198
      CALL FMOVE(0,PAREA,PAREA,JAR4)                                    LODSUM    199
      CALL FMOVE(0,PZONE,PZONE,JZN4)                                    LODSUM    200
C                                                                       LODSUM    201
      DO 700 K=1,ILOAD                                                  LODSUM    202
      IIL=K*12                                                          LODSUM    203
      JJ=NBLD(IIL-11)                                                   LODSUM    204
      CALL UPACKI(LZONE,LAREA,JJ)                                       LODSUM    205
C                                                                       LODSUM    206
C    TOTAL SYSTEM LOAD                                                  LODSUM    207
C                                                                       LODSUM    208
      TMW=TMW+BLD(IIL-9)*BASPC                                          LODSUM    209
      TMX=TMX+BLD(IIL-8)*BASPC                                          LODSUM    210
C                                                                       LODSUM    211
C    TOTAL SYSTEM LOAD SHEDDED                                          LODSUM    212
C                                                                       LODSUM    213
      TPSHED=TPSHED+BLD(IIL-5)*BASPC                                    LODSUM    214
      TQSHED=TQSHED+BLD(IIL-4)*BASPC                                    LODSUM    215
C                                                                       LODSUM    216
C    TOTAL LOAD , LOAD SHED  BY AREA                                    LODSUM    217
C                                                                       LODSUM    218
      DO 300 KK=1,IXAREA                                                LODSUM    219
        KK2=KK+KK                                                       LODSUM    220
        KK1=KK2+JAR2                                                    LODSUM    221
       IF(LAREA.EQ. JAREA(KK))THEN                                      LODSUM    222
         PAREA(KK2-1)=PAREA(KK2-1)+BLD(IIL-9)*BASPC                     LODSUM    223
         PAREA(KK2)=PAREA(KK2)+BLD(IIL-8)*BASPC                         LODSUM    224
C                                                                       LODSUM    225
         PAREA(KK1-1)=PAREA(KK1-1)+BLD(IIL-5)*BASPC                     LODSUM    226
         PAREA(KK1)=PAREA(KK1)+BLD(IIL-4)*BASPC                         LODSUM    227
         GOTO 400                                                       LODSUM    228
        ENDIF                                                           LODSUM    229
  300  CONTINUE                                                         LODSUM    230
C                                                                       LODSUM    231
  400  CONTINUE                                                         LODSUM    232
C                                                                       LODSUM    233
C    TOTAL LOAD , LOAD SHED  BY ZONE                                    LODSUM    234
C                                                                       LODSUM    235
      DO 500 KK=1,IXZONE                                                LODSUM    236
        KK2=KK+KK                                                       LODSUM    237
        KK1=KK2+JZN2                                                    LODSUM    238
       IF(LZONE.EQ. JZONE(KK))THEN                                      LODSUM    239
         PZONE(KK2-1)=PZONE(KK2-1)+BLD(IIL-9)*BASPC                     LODSUM    240
         PZONE(KK2)=PZONE(KK2)+BLD(IIL-8)*BASPC                         LODSUM    241
C                                                                       LODSUM    242
         PZONE(KK1-1)=PZONE(KK1-1)+BLD(IIL-5)*BASPC                     LODSUM    243
         PZONE(KK1)=PZONE(KK1)+BLD(IIL-4)*BASPC                         LODSUM    244
         GOTO 600                                                       LODSUM    245
       ENDIF                                                            LODSUM    246
  500  CONTINUE                                                         LODSUM    247
C                                                                       LODSUM    248
  600  CONTINUE                                                         LODSUM    249
C                                                                       LODSUM    250
  700 CONTINUE                                                          LODSUM    251
C                                                                       LODSUM    252
C                                                                       LODSUM    253
C                                                                       LODSUM    254
      CALL PAGE6                                                        LODSUM    255
C      WRITE(LOUT,'(///)')                                              LODSUM    256
      IF(LFLAG.EQ.0)THEN                                                LODSUM    257
         WRITE(IU6,8000) TS                                             LODSUM    258
C         WRITE(LOUT,3000) TS                                           LODSUM    259
      ELSE                                                              LODSUM    260
         WRITE(IU6,8200)                                                LODSUM    261
C         WRITE(LOUT,3020)                                              LODSUM    262
      ENDIF                                                             LODSUM    263
      WRITE(IU6,8500)                                                   LODSUM    264
C      WRITE(LOUT,3210)                                                 LODSUM    265
      WRITE(IU6,8600) TMW,TMX,TPSHED,TQSHED,(TMW-TPSHED)                LODSUM    266
     *                ,(TMX-TQSHED)                                     LODSUM    267
C      WRITE(LOUT,2000) TMW,TMX,TPSHED,TQSHED,(TMW-TPSHED)              LODSUM    268
C     *                 ,(TMX-TQSHED)                                   LODSUM    269
C                                                                       LODSUM    270
C  PRINT OUT BY AREA                                                    LODSUM    271
C                                                                       LODSUM    272
C      WRITE(LOUT,'(//)')                                               LODSUM    273
C      IF(LFLAG.EQ.0)THEN                                               LODSUM    274
C         WRITE(LOUT,3010) ' AREA ',TS                                  LODSUM    275
C      ELSE                                                             LODSUM    276
C         WRITE(LOUT,3030) ' AREA '                                     LODSUM    277
C      ENDIF                                                            LODSUM    278
C      WRITE(LOUT,3200) '  AREA'                                        LODSUM    279
      IIL=61                                                            LODSUM    280
C      IIL=71                                                           LODSUM    281
      DO 800 II=1,IXAREA                                                LODSUM    282
        II2=II+II                                                       LODSUM    283
        II1=II2+JAR2                                                    LODSUM    284
        IF(IIL.GE.60)THEN                                               LODSUM    285
           IF(IIL.NE.71)THEN                                            LODSUM    286
              CALL PAGE6                                                LODSUM    287
              IIL=11                                                    LODSUM    288
           ELSE                                                         LODSUM    289
              IIL=19                                                    LODSUM    290
           ENDIF                                                        LODSUM    291
           IF(LFLAG.EQ.0)THEN                                           LODSUM    292
              WRITE(IU6,8100) ' AREA ',TS                               LODSUM    293
           ELSE                                                         LODSUM    294
              WRITE(IU6,8300) ' AREA '                                  LODSUM    295
           ENDIF                                                        LODSUM    296
           WRITE(IU6,8400) '  AREA'                                     LODSUM    297
        ENDIF                                                           LODSUM    298
        JI=JAREA(II)                                                    LODSUM    299
        WRITE(IU6,8700) JI,IARE(II,1),IARE(II,2),IARE(II,3)             LODSUM    300
     *     ,PAREA(II2-1),PAREA(II2),PAREA(II1-1),PAREA(II1)             LODSUM    301
     *     ,(PAREA(II2-1)-PAREA(II1-1)),(PAREA(II2)-PAREA(II1))         LODSUM    302
C        WRITE(LOUT,2200) JI,IARE(JI,1),IARE(JI,2),IARE(JI,3)           LODSUM    303
C     *     ,PAREA(II2-1),PAREA(II2),PAREA(II1-1),PAREA(II1)            LODSUM    304
C     *     ,(PAREA(II2-1)-PAREA(II1-1)),(PAREA(II2)-PAREA(II1))        LODSUM    305
        IIL=IIL+1                                                       LODSUM    306
  800 CONTINUE                                                          LODSUM    307
C                                                                       LODSUM    308
C  PRINT OUT BY ZONE                                                    LODSUM    309
C                                                                       LODSUM    310
C      WRITE(LOUT,'(//)')                                               LODSUM    311
C      IF(LFLAG.EQ.0)THEN                                               LODSUM    312
C         WRITE(LOUT,3010) ' ZONE ',TS                                  LODSUM    313
C      ELSE                                                             LODSUM    314
C         WRITE(LOUT,3030) ' ZONE '                                     LODSUM    315
C      ENDIF                                                            LODSUM    316
C      WRITE(LOUT,3200) '  ZONE'                                        LODSUM    317
      IIL=61                                                            LODSUM    318
      DO 900 II=1,IXZONE                                                LODSUM    319
      II2=II+II                                                         LODSUM    320
      II1=II2+JZN2                                                      LODSUM    321
        IF(IIL.GE.60)THEN                                               LODSUM    322
           CALL PAGE6                                                   LODSUM    323
           IF(LFLAG.EQ.0)THEN                                           LODSUM    324
              WRITE(IU6,8100) ' ZONE ',TS                               LODSUM    325
           ELSE                                                         LODSUM    326
              WRITE(IU6,8300) ' ZONE '                                  LODSUM    327
           ENDIF                                                        LODSUM    328
           WRITE(IU6,8400) '  ZONE'                                     LODSUM    329
           IIL=11                                                       LODSUM    330
        ENDIF                                                           LODSUM    331
      JI=JZONE(II)                                                      LODSUM    332
      WRITE(IU6,8700) JI,NAMZN(II,1),NAMZN(II,2),NAMZN(II,3)            LODSUM    333
     *   ,PZONE(II2-1),PZONE(II2),PZONE(II1-1),PZONE(II1)               LODSUM    334
     *   ,(PZONE(II2-1)-PZONE(II1-1)),(PZONE(II2)-PZONE(II1))           LODSUM    335
      IIL=IIL+1                                                         LODSUM    336
  900 CONTINUE                                                          LODSUM    337
C                                                                       LODSUM    338
CD                                                                      LODSUM    339
CD    PRINT BUSES WITH HIGHEST VOLTAGES                                 LODSUM    340
CD                                                                      LODSUM    341
      CALL PAGE6                                                        LODSUM    342
      WRITE(IU6,9200)                                                   LODSUM    343
      J=0                                                               LODSUM    344
      DO 1750 I=1,NHV                                                   LODSUM    345
         J=J+1                                                          LODSUM    346
         K=KHVBUS(I)                                                    LODSUM    347
         KNAME(J)=K*3                                                   LODSUM    348
         LLFBUS(J)=NOLD(K)                                              LODSUM    349
         XVALUE=HVVALU(I)                                               LODSUM    350
         HVVALU(I)=SQRT(XVALUE)                                         LODSUM    351
         IF(J.EQ.3.OR.I.EQ.NHV)THEN                                     LODSUM    352
            WRITE(IU6,9210) (LLFBUS(LL),INAME(KNAME(LL)-2)              LODSUM    353
     *         ,INAME(KNAME(LL)-1),INAME(KNAME(LL)),HVTIME(I+LL-J)      LODSUM    354
     *         ,HVVALU(I+LL-J),LL=1,J)                                  LODSUM    355
            J=0                                                         LODSUM    356
         ENDIF                                                          LODSUM    357
 1750 CONTINUE                                                          LODSUM    358
CD                                                                      LODSUM    359
CD    PRINT BUSES WITH LOWEST VOLTAGES                                  LODSUM    360
CD                                                                      LODSUM    361
      WRITE(IU6,9230)                                                   LODSUM    362
      DO 1760 I=1,NLV                                                   LODSUM    363
         J=J+1                                                          LODSUM    364
         K=LVBUS(I)                                                     LODSUM    365
         KNAME(J)=K*3                                                   LODSUM    366
         LLFBUS(J)=NOLD(K)                                              LODSUM    367
         XVALUE=VLVALU(I)                                               LODSUM    368
         VLVALU(I)=SQRT(XVALUE)                                         LODSUM    369
         IF(J.EQ.3.OR.I.EQ.NLV)THEN                                     LODSUM    370
            WRITE(IU6,9210) (LLFBUS(LL),INAME(KNAME(LL)-2)              LODSUM    371
     *         ,INAME(KNAME(LL)-1),INAME(KNAME(LL)),VLTIME(I-J+LL)      LODSUM    372
     *         ,VLVALU(I-J+LL),LL=1,J)                                  LODSUM    373
            J=0                                                         LODSUM    374
         ENDIF                                                          LODSUM    375
 1760 CONTINUE                                                          LODSUM    376
CD                                                                      LODSUM    377
CD    PRINT BUSES WITH HIGHEST VOLTAGES RELATIVE TO PRE-FAULT           LODSUM    378
CD                                                                      LODSUM    379
      IF(NVADD.NE.0)THEN                                                LODSUM    380
      CALL MOVE(0,JVADD,JVADD,NLFBUS)                                   LODSUM    381
      DO 1770 I=1,NVADD                                                 LODSUM    382
      K=IVADD(I)                                                        LODSUM    383
      JVADD(K)=I                                                        LODSUM    384
 1770 CONTINUE                                                          LODSUM    385
      ENDIF                                                             LODSUM    386
C                                                                       LODSUM    387
      WRITE(IU6,9430)                                                   LODSUM    388
      J=0                                                               LODSUM    389
      DO 1780 I=1,JHV                                                   LODSUM    390
         J=J+1                                                          LODSUM    391
         K=KHVBUS(I)                                                    LODSUM    392
         KNAME(J)=K*3                                                   LODSUM    393
         LLFBUS(J)=NOLD(K)                                              LODSUM    394
         XVALUE=RHVVAL(I)                                               LODSUM    395
         IF(K.GT.LASTV2)THEN                                            LODSUM    396
         JV=LASTV2+JVADD(K)                                             LODSUM    397
         ELSE                                                           LODSUM    398
         JV=K                                                           LODSUM    399
         ENDIF                                                          LODSUM    400
         VPREF=VOLTHL(5,JV)                                             LODSUM    401
         PERC(J)=SQRT(XVALUE)*100.0-100.0                               LODSUM    402
         RHVVAL(I)=SQRT(XVALUE*VPREF)                                   LODSUM    403
         IF(J.EQ.3.OR.I.EQ.JHV)THEN                                     LODSUM    404
            WRITE(IU6,9440) (LLFBUS(LL),INAME(KNAME(LL)-2)              LODSUM    405
     *         ,INAME(KNAME(LL)-1),INAME(KNAME(LL)),RHVTIM(I+LL-J)      LODSUM    406
     *         ,RHVVAL(I+LL-J),PERC(LL),LL=1,J)                         LODSUM    407
            J=0                                                         LODSUM    408
         ENDIF                                                          LODSUM    409
 1780 CONTINUE                                                          LODSUM    410
CD                                                                      LODSUM    411
CD    PRINT BUSES WITH LOWEST VOLTAGES RELATIVE TO PRE-FAULT            LODSUM    412
CD                                                                      LODSUM    413
      WRITE(IU6,9450)                                                   LODSUM    414
      DO 1790 I=1,JLV                                                   LODSUM    415
         J=J+1                                                          LODSUM    416
         K=JLVBUS(I)                                                    LODSUM    417
         KNAME(J)=K*3                                                   LODSUM    418
         LLFBUS(J)=NOLD(K)                                              LODSUM    419
         XVALUE=RVLVAL(I)                                               LODSUM    420
         IF(K.GT.LASTV2)THEN                                            LODSUM    421
         JV=LASTV2+JVADD(K)                                             LODSUM    422
         ELSE                                                           LODSUM    423
         JV=K                                                           LODSUM    424
         ENDIF                                                          LODSUM    425
         VPREF=VOLTHL(5,JV)                                             LODSUM    426
         PERC(J)=100.0-SQRT(XVALUE)*100.0                               LODSUM    427
         RVLVAL(I)=SQRT(XVALUE*VPREF)                                   LODSUM    428
         IF(J.EQ.3.OR.I.EQ.JLV)THEN                                     LODSUM    429
            WRITE(IU6,9440) (LLFBUS(LL),INAME(KNAME(LL)-2)              LODSUM    430
     *         ,INAME(KNAME(LL)-1),INAME(KNAME(LL)),RVLTIM(I-J+LL)      LODSUM    431
     *         ,RVLVAL(I-J+LL),PERC(LL),LL=1,J)                         LODSUM    432
            J=0                                                         LODSUM    433
         ENDIF                                                          LODSUM    434
 1790 CONTINUE                                                          LODSUM    435
CD                                                                      LODSUM    436
CD    PRINT GENERATORS WITH HIGHEST FREQUENCIES                         LODSUM    437
CD                                                                      LODSUM    438
      CALL PAGE6                                                        LODSUM    439
      WRITE(IU6,9270)                                                   LODSUM    440
      DO 1800 I=1,NHFRQ                                                 LODSUM    441
         J=J+1                                                          LODSUM    442
         N=ITHGEN(I)                                                    LODSUM    443
         K=NGBUS(N)                                                     LODSUM    444
         KNAME(J)=K*3                                                   LODSUM    445
         LLFBUS(J)=NOLD(K)                                              LODSUM    446
         LGID(J)=NDGC(N)(3:4)                                           LODSUM    447
         GHFVAL(I)=(GHFVAL(I)+WOBASE)*PI2                               LODSUM    448
         IF(J.EQ.3.OR.I.EQ.NHFRQ)THEN                                   LODSUM    449
            WRITE(IU6,9250) (LLFBUS(K),INAME(KNAME(K)-2)                LODSUM    450
     *         ,INAME(KNAME(K)-1),INAME(KNAME(K)),LGID(K),GHFTIM(I-J+K) LODSUM    451
     *         ,GHFVAL(I-J+K),K=1,J)                                    LODSUM    452
            J=0                                                         LODSUM    453
         ENDIF                                                          LODSUM    454
 1800 CONTINUE                                                          LODSUM    455
CD                                                                      LODSUM    456
CD    PRINT GENERATORS WITH LOWEST FREQUENCIES                          LODSUM    457
CD                                                                      LODSUM    458
      WRITE(IU6,9280)                                                   LODSUM    459
      DO 1820 I=1,NLFRQ                                                 LODSUM    460
         J=J+1                                                          LODSUM    461
         N=JTHGEN(I)                                                    LODSUM    462
         K=NGBUS(N)                                                     LODSUM    463
         KNAME(J)=K*3                                                   LODSUM    464
         LLFBUS(J)=NOLD(K)                                              LODSUM    465
         LGID(J)=NDGC(N)(3:4)                                           LODSUM    466
         GLFVAL(I)=(GLFVAL(I)+WOBASE)*PI2                               LODSUM    467
         IF(J.EQ.3.OR.I.EQ.NLFRQ)THEN                                   LODSUM    468
            WRITE(IU6,9250) (LLFBUS(K),INAME(KNAME(K)-2)                LODSUM    469
     *         ,INAME(KNAME(K)-1),INAME(KNAME(K)),LGID(K),GLFTIM(I-J+K) LODSUM    470
     *         ,GLFVAL(I-J+K),K=1,J)                                    LODSUM    471
            J=0                                                         LODSUM    472
         ENDIF                                                          LODSUM    473
 1820 CONTINUE                                                          LODSUM    474
CD                                                                      LODSUM    475
CD    PRINT GENERATORS WITH HIGHEST ACCELERATION POWER                  LODSUM    476
CD                                                                      LODSUM    477
      WRITE(IU6,9290)                                                   LODSUM    478
      DO 1850 I=1,NHAP                                                  LODSUM    479
         J=J+1                                                          LODSUM    480
         N=KTHGEN(I)                                                    LODSUM    481
         K=NGBUS(N)                                                     LODSUM    482
         KNAME(J)=K*3                                                   LODSUM    483
         LLFBUS(J)=NOLD(K)                                              LODSUM    484
         LGID(J)=NDGC(N)(3:4)                                           LODSUM    485
         IF(J.EQ.3.OR.I.EQ.NHAP)THEN                                    LODSUM    486
            WRITE(IU6,9250) (LLFBUS(K),INAME(KNAME(K)-2)                LODSUM    487
     *         ,INAME(KNAME(K)-1),INAME(KNAME(K)),LGID(K),GHAPTI(I-J+K) LODSUM    488
     *         ,GHAPVA(I-J+K),K=1,J)                                    LODSUM    489
            J=0                                                         LODSUM    490
         ENDIF                                                          LODSUM    491
 1850 CONTINUE                                                          LODSUM    492
CD                                                                      LODSUM    493
CD    PRINT GENERATORS WITH LOWEST ACCELERATION POWER                   LODSUM    494
CD                                                                      LODSUM    495
      WRITE(IU6,9300)                                                   LODSUM    496
      DO 1870 I=1,NLAP                                                  LODSUM    497
         J=J+1                                                          LODSUM    498
         N=LTHGEN(I)                                                    LODSUM    499
         K=NGBUS(N)                                                     LODSUM    500
         KNAME(I)=K*3                                                   LODSUM    501
         LLFBUS(I)=NOLD(K)                                              LODSUM    502
         LGID(I)=NDGC(N)(3:4)                                           LODSUM    503
         IF(J.EQ.3.OR.I.EQ.NLAP)THEN                                    LODSUM    504
            WRITE(IU6,9250) (LLFBUS(K),INAME(KNAME(K)-2)                LODSUM    505
     *         ,INAME(KNAME(K)-1),INAME(KNAME(K)),LGID(K),GLAPTI(I-J+K) LODSUM    506
     *         ,GLAPVA(I-J+K),K=1,J)                                    LODSUM    507
            J=0                                                         LODSUM    508
         ENDIF                                                          LODSUM    509
 1870 CONTINUE                                                          LODSUM    510
CD                                                                      LODSUM    511
CD    PRINT GENERATORS WITH HIGHEST FIELD VOLTAGE                       LODSUM    512
CD                                                                      LODSUM    513
      CALL PAGE6                                                        LODSUM    514
      WRITE(IU6,9320)                                                   LODSUM    515
      DO 1900 I=1,NHFIV                                                 LODSUM    516
         J=J+1                                                          LODSUM    517
         N=MTHGEN(I)                                                    LODSUM    518
         K=NGBUS(N)                                                     LODSUM    519
         KNAME(J)=K*3                                                   LODSUM    520
         LLFBUS(J)=NOLD(K)                                              LODSUM    521
         LGID(J)=NDGC(N)(3:4)                                           LODSUM    522
         IF(J.EQ.3.OR.I.EQ.NHFIV)THEN                                   LODSUM    523
            WRITE(IU6,9250) (LLFBUS(K),INAME(KNAME(K)-2)                LODSUM    524
     *         ,INAME(KNAME(K)-1),INAME(KNAME(K)),LGID(K),GHFITI(I-J+K) LODSUM    525
     *         ,GHFIVA(I-J+K),K=1,J)                                    LODSUM    526
            J=0                                                         LODSUM    527
         ENDIF                                                          LODSUM    528
 1900 CONTINUE                                                          LODSUM    529
CD                                                                      LODSUM    530
CD    PRINT GENERATORS WITH LOWEST FIELD VOLTAGE                        LODSUM    531
CD                                                                      LODSUM    532
      WRITE(IU6,9330)                                                   LODSUM    533
      DO 1950 I=1,NLFIV                                                 LODSUM    534
         J=J+1                                                          LODSUM    535
         N=NTHGEN(I)                                                    LODSUM    536
         K=NGBUS(N)                                                     LODSUM    537
         KNAME(J)=K*3                                                   LODSUM    538
         LLFBUS(J)=NOLD(K)                                              LODSUM    539
         LGID(J)=NDGC(N)(3:4)                                           LODSUM    540
         IF(J.EQ.3.OR.I.EQ.NLFIV)THEN                                   LODSUM    541
            WRITE(IU6,9250) (LLFBUS(K),INAME(KNAME(K)-2)                LODSUM    542
     *         ,INAME(KNAME(K)-1),INAME(KNAME(K)),LGID(K),GLFITI(I-J+K) LODSUM    543
     *         ,GLFIVA(I-J+K),K=1,J)                                    LODSUM    544
            J=0                                                         LODSUM    545
         ENDIF                                                          LODSUM    546
 1950 CONTINUE                                                          LODSUM    547
CD                                                                      LODSUM    548
CD    PRINT KINETIC ENERGY INFORMATION                                  LODSUM    549
CD                                                                      LODSUM    550
      WRITE(IU6,9400)                                                   LODSUM    551
      WRITE(IU6,9410) TKEMAX,XKEMAX                                     LODSUM    552
      WRITE(IU6,9420) TKEMIN,XKEMIN                                     LODSUM    553
C                                                                       LODSUM    554
      RETURN                                                            LODSUM    555
C                                                                       LODSUM    556
 8000 FORMAT(18X,'SYSTEM LOAD SUMMARY TABLE AT TIME =',F8.3,/,18X       LODSUM    557
     *,43('='),/)                                                       LODSUM    558
 8100 FORMAT(18X,'LOAD SUMMARY TABLE BY',A6,'AT TIME =',F8.3,/,18X      LODSUM    559
     *,44('='),/)                                                       LODSUM    560
 8200 FORMAT(14X,'SYSTEM LOAD SUMMARY TABLE AT THE END OF SIMULATION'   LODSUM    561
     *,' RUN',/,14X,54('='),/)                                          LODSUM    562
 8300 FORMAT(12X,'LOAD SUMMARY TABLE BY',A6                             LODSUM    563
     *,'AT THE END OF SIMULATION RUN',/,12X,55('='),/)                  LODSUM    564
 8400 FORMAT(1X,A6,20X,'TOTAL LOAD  TOTAL SHEDDED LOAD      REMAINING'  LODSUM    565
     *,' LOAD',/,'   ----',20X,10('-'),2X,18('-'),6X,14('-'),/          LODSUM    566
     *,'   # NAME',8X,3(8X,'MW',8X,'MX'),/,'  -- ',12('-'),6(1X,9('-')))LODSUM    567
 8500 FORMAT(27X,'TOTAL LOAD  TOTAL SHEDDED LOAD      REMAINING LOAD'   LODSUM    568
     *,/,27X,10('-'),2X,18('-'),6X,14('-'),/                            LODSUM    569
     *,17X,3(8X,'MW',8X,'MX'),/,17X,6(1X,9('-')))                       LODSUM    570
 8600 FORMAT(17X,6F10.2)                                                LODSUM    571
 8700 FORMAT(I4,1X,3A4,6F10.2)                                          LODSUM    572
 8800 FORMAT(10X                                                        LODSUM    573
     *,'SUMMARY OF THERMOSTATICALLY CONTROLLED (TSC) LOAD CONDITIONS',/ LODSUM    574
     *,10X,60('='),/,'  BUS#   BUS NAME          G0         G'          LODSUM    575
     *,'  %GCHANGE        P0         P  %PCHANGE',/                     LODSUM    576
     *,' ----- ------------',6(1X,9('-')))                              LODSUM    577
 8900 FORMAT(6X,'SUMMARY OF THERMOSTATICALLY CONTROLLED (TSC) LOAD'     LODSUM    578
     *,' CONDITIONS BY AREA',/,6X,68('='),/,' AREA#  AREA NAME     '    LODSUM    579
     *,'     G0         G  %GCHANGE        P0         P  %PCHANGE',/    LODSUM    580
     *,' ----- ------------',6(1X,9('-')))                              LODSUM    581
 9000 FORMAT(6X,'SUMMARY OF THERMOSTATICALLY CONTROLLED (TSC) LOAD'     LODSUM    582
     *,' CONDITIONS BY ZONE',/,6X,68('='),/,' ZONE#  ZONE NAME     '    LODSUM    583
     *,'     G0         G  %GCHANGE        P0         P  %PCHANGE',/    LODSUM    584
     *,' ----- ------------',6(1X,9('-')))                              LODSUM    585
 9100 FORMAT(I6,1X,3A4,6F10.3)                                          LODSUM    586
 9200 FORMAT(///,32X,'BUSES WITH THE HIGHEST PER UNIT VOLTAGES',//      LODSUM    587
     &,3('     BUS# STATION NAME    TIME   VMAG.'),/                    LODSUM    588
     &,3('    ----- ------------ ------- -------'))                     LODSUM    589
 9210 FORMAT(3(I9,1X,3A4,2F8.3))                                        LODSUM    590
 9230 FORMAT(///,33X,'BUSES WITH THE LOWEST PER UNIT VOLTAGES',//       LODSUM    591
     &,3('     BUS# STATION NAME    TIME   VMAG.'),/                    LODSUM    592
     &,3('    ----- ------------ ------- -------'))                     LODSUM    593
 9270 FORMAT(///,31X,'GENERATORS WITH THE HIGHEST FREQUENCIES'          LODSUM    594
     &,//,3('     BUS# STATION NAME GID    TIME   HERTZ'),/             LODSUM    595
     &,3('    ----- ------------ --- ------- -------'))                 LODSUM    596
 9280 FORMAT(///,31X,'GENERATORS WITH THE LOWEST FREQUENCIES'           LODSUM    597
     &,//,3('     BUS# STATION NAME GID    TIME   HERTZ'),/             LODSUM    598
     &,3('    ----- ------------ --- ------- -------'))                 LODSUM    599
 9250 FORMAT(3(I9,1X,3A4,2X,A2,2F8.3))                                  LODSUM    600
 9290 FORMAT(///,27X,'GENERATORS WITH THE HIGHEST PER UNIT ACCEL POWER' LODSUM    601
     &,//,3('     BUS# STATION NAME GID    TIME    P.U.'),/             LODSUM    602
     &,3('    ----- ------------ --- ------- -------'))                 LODSUM    603
 9300 FORMAT(///,27X,'GENERATORS WITH THE LOWEST PER UNIT ACCEL POWER'  LODSUM    604
     &,//,3('     BUS# STATION NAME GID    TIME    P.U.'),/             LODSUM    605
     &,3('    ----- ------------ --- ------- -------'))                 LODSUM    606
 9310 FORMAT(3(I9,1X,3A4,2X,A2,F8.3,F8.4))                              LODSUM    607
 9320 FORMAT(///,27X                                                    LODSUM    608
     *,'GENERATORS WITH THE HIGHEST PER UNIT FIELD VOLTAGES',//         LODSUM    609
     &,3('     BUS# STATION NAME GID    TIME    P.U.'),/                LODSUM    610
     &,3('    ----- ------------ --- ------- -------'))                 LODSUM    611
 9330 FORMAT(///,27X                                                    LODSUM    612
     *,'GENERATORS WITH THE LOWEST PER UNIT FIELD VOLTAGES',//          LODSUM    613
     &,3('     BUS# STATION NAME GID    TIME    P.U.'),/                LODSUM    614
     &,3('    ----- ------------ --- ------- -------'))                 LODSUM    615
 9400 FORMAT(///,36X,'SYSTEM KINETIC ENERGY INFORMATION:',/,            LODSUM    616
     + 36X,'---------------------------------',/)                       LODSUM    617
 9410 FORMAT(5X,'MAXIMUM SYSTEM KINETIC ENERGY AFTER FAULT CLEARING ',  LODSUM    618
     + '(TIME: ',F10.5,' SECS) = ',F10.5,' PU')                         LODSUM    619
 9420 FORMAT(5X,'MINIMUM SYSTEM KINETIC ENERGY AFTER FAULT CLEARING ',  LODSUM    620
     + '(TIME: ',F10.5,' SECS) = ',F10.5,' PU')                         LODSUM    621
 9430 FORMAT(///,38X                                                    LODSUM    622
     &,'BUSES WITH THE HIGHEST VOLTAGE RELATIVE TO PRE-FAULT',//        LODSUM    623
     &,3('   BUS# STATION NAME    TIME   VMAG. % ABOVE'),/              LODSUM    624
     &,3('  ----- ------------ ------- ------- -------'))               LODSUM    625
 9440 FORMAT(3(I7,1X,3A4,2F8.3,F8.2))                                   LODSUM    626
 9450 FORMAT(///,39X                                                    LODSUM    627
     &,'BUSES WITH THE LOWEST VOLTAGE RELATIVE TO PRE-FAULT',//         LODSUM    628
     &,3('   BUS# STATION NAME    TIME   VMAG. % BELOW'),/              LODSUM    629
     &,3('  ----- ------------ ------- ------- -------'))               LODSUM    630
      END                                                               LODSUM    631
