CFPRIME RESULT                                                          RESULT      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 RESULT (H,LOUT)                                        RESULT      3
CD                                                                      RESULT      4
CD TO PRINT OUT SIMULATION RESULTS IN THE RESULT FILES AND THE BINARY   RESULT      5
CD FILE FOR THE OUTPUT ANALYSIS PROGRAM.                                RESULT      6
CD                                                                      RESULT      7
CD FUNCTIONS OF THIS ROUTINE ARE AS FOLLOWS:                            RESULT      8
CD                                                                      RESULT      9
      INCLUDE 'PARX.INS'                                                RESULT     10
      INCLUDE 'CNPT.INS'                                                RESULT     11
      INCLUDE 'CNIPTR.INS'                                              RESULT     12
      INCLUDE 'CNSTN.INS'                                               RESULT     13
      INCLUDE 'CNB0.INS'                                                RESULT     14
      INCLUDE 'CNB1.INS'                                                RESULT     15
      INCLUDE 'CNB3.INS'                                                RESULT     16
      INCLUDE 'CNB4.INS'                                                RESULT     17
      INCLUDE 'CNB5.INS'                                                RESULT     18
      INCLUDE 'CNB6.INS'                                                RESULT     19
      INCLUDE 'CNB8.INS'                                                RESULT     20
      INCLUDE 'CNB9.INS'                                                RESULT     21
      INCLUDE 'CNB10.INS'                                               RESULT     22
      INCLUDE 'CNB19.INS'                                               RESULT     23
      INCLUDE 'CNMPAR.INS'                                              RESULT     24
      INCLUDE 'CNUNIT.INS'                                              RESULT     25
      INCLUDE 'CNIOUT.INS'                                              RESULT     26
      INCLUDE 'CNMDAT.INS'                                              RESULT     27
      INCLUDE 'CNSVS.INS'                                               RESULT     28
      INCLUDE 'CNRAN.INS'                                               RESULT     29
      INCLUDE 'CNSTP.INS'                                               RESULT     30
      INCLUDE 'CNSDB.INS'                                               RESULT     31
      INCLUDE 'CNMON.INS'                                               RESULT     32
      INCLUDE 'CNPARX.INS'                                              RESULT     33
      INCLUDE 'CNMSTA.INS'                                              RESULT     34
      INCLUDE 'CNVOLT.INS'                                              RESULT     35
      INCLUDE 'CNXSTA.INS'                                              RESULT     36
      INCLUDE 'CNZSTA.INS'                                              RESULT     37
      INCLUDE 'CNREC9.INS'                                              RESULT     38
      INCLUDE 'CNINTE.INS'                                              RESULT     39
      INCLUDE 'CNMYVA.INS'                                              RESULT     40
      INCLUDE 'CNYVAR.INS'                                              RESULT     41
      INCLUDE 'GRDC01.INS'                                              RESULT     42
      INCLUDE 'GRDC03.INS'                                              RESULT     43
      INCLUDE 'UDCA.INS'                                                RESULT     44
      INCLUDE 'UDCF.INS'                                                RESULT     45
      INCLUDE 'GRPDCS.INS'                                              RESULT     46
      INCLUDE 'CNFLAG.INS'                                              RESULT     47
      INCLUDE 'CNENG1.INS'                                              RESULT     48
      INCLUDE 'CNLSMB.INS'                                              RESULT     49
      INCLUDE 'CNLCOM.INS'                                              RESULT     50
C                                                                       RESULT     51
      DIMENSION BUF(NBUF),IBUF(NBUF)                                    RESULT     52
      EQUIVALENCE (ZSTATE(1),BUF(1),IBUF(1))                            RESULT     53
      DIMENSION TBUF(128),LBUF(128)                                     RESULT     54
      EQUIVALENCE (TBUF(1),LBUF(1))                                     RESULT     55
C                                                                       RESULT     56
      LOGICAL IVMG                                                      RESULT     57
C                                                                       RESULT     58
*IF LTSP                                                                RESULT     59
*ENDIF                                                                  RESULT     62
      INTEGER*4   IUID                                                  RESULT     63
      CHARACTER*1 RSF                                                   RESULT     64
      CHARACTER*2 UID                                                   RESULT     65
      CHARACTER*17 LNAME(4)                                             RESULT     66
      CHARACTER*8  DCNAME(6)                                            RESULT     67
C                                                                       RESULT     68
      COMPLEX VOLTK                                                     RESULT     69
      DIMENSION VOLTM(2)                                                RESULT     70
      EQUIVALENCE (VOLTK,VOLTM(1)),(VOLTM(1),VREAL),(VOLTM(2),VIMAG)    RESULT     71
C                                                                       RESULT     72
      INCLUDE 'CDLCOM.INS'                                              RESULT     73
C                                                                       RESULT     74
      DATA DEGREE/57.29578/,ILDEF/60/,ISTART/6/                         RESULT     75
*IF LTSP                                                                RESULT     76
*ENDIF                                                                  RESULT     93
C                                                                       RESULT     94
C                                                                       RESULT     95
      LDEB=(JDEB(400).NE.0)                                             RESULT     96
C                                                                       RESULT     97
      IF(IPRTSW.LT.3)THEN                                               RESULT     98
C                                                                       RESULT     99
      IF(IPRTSW.EQ.1)THEN                                               RESULT    100
         IL=ILDEF-3                                                     RESULT    101
         IF(ISTART.EQ.6)THEN                                            RESULT    102
            IL=IL-3                                                     RESULT    103
         ELSE                                                           RESULT    104
            CALL PAGE17                                                 RESULT    105
            ISTART=3                                                    RESULT    106
         ENDIF                                                          RESULT    107
         WRITE(IU17,1150) TS,ITER,H,ITTER,TS                            RESULT    108
      ENDIF                                                             RESULT    109
C                                                                       RESULT    110
      IBUF(1)=IFAULT                                                    RESULT    111
      BUF(2)=TS                                                         RESULT    112
C                                                                       RESULT    113
C     CALCULATE KINETIC ENERGY                                          RESULT    114
C                                                                       RESULT    115
      CALL SYSCEN                                                       RESULT    116
      CALL KENERG                                                       RESULT    117
C                                                                       RESULT    118
      BUF(3)=TOTALK                                                     RESULT    119
C                                                                       RESULT    120
      BUF(4)=TOTALP                                                     RESULT    121
C                                                                       RESULT    122
      JSG=MSTATE(1,NRF)                                                 RESULT    123
      ALR=XSTATE(JSG+2)*DEGREE+DOFFST                                   RESULT    124
CD                                                                      RESULT    125
CD STEP 1. CALCULATE AND STORE GENERATOR VARIABLES                      RESULT    126
CD                                                                      RESULT    127
      IF(NT.NE.0)THEN                                                   RESULT    128
      DO 120 K=1,NOPTR                                                  RESULT    129
      IPOS=KOPTR(K)                                                     RESULT    130
      JSEM=KOPDAT(IPOS+1)                                               RESULT    131
      IF(JSEM.LT.4)THEN                                                 RESULT    132
      ICOUNX=KOPDAT(IPOS+2)                                             RESULT    133
      IPOS=IPOS+2                                                       RESULT    134
      ICOUNT=0                                                          RESULT    135
 100  ICOUNT=ICOUNT+1                                                   RESULT    136
      IPBNO=KOPDAT(IPOS+1)                                              RESULT    137
      IF(KOPDAT(IPOS+4).EQ.2)THEN                                       RESULT    138
CD                                                                      RESULT    139
CD    DETAILED GENERATOR VARIABLES                                      RESULT    140
CD                                                                      RESULT    141
                                                                        RESULT    142
      IF(IPBNO.LE.IPNODE)THEN                                           RESULT    143
      IMAC=KOPDAT(IPOS+2)                                               RESULT    144
      ISCHAN=KOPDAT(IPOS+3)                                             RESULT    145
      IF(IMAC.NE.0)THEN                                                 RESULT    146
      UID(1:2)=NDGC(IMAC)(3:4)                                          RESULT    147
      IGVN=ICONTA(2,IMAC)                                               RESULT    148
      IF(IGVN.EQ.46) IGVN=0                                             RESULT    149
      JDG=JCONTA(1,IMAC)                                                RESULT    150
      JSG=MSTATE(1,IMAC)                                                RESULT    151
      JYG=MYVAR(1,IMAC)                                                 RESULT    152
      ALPHA=XSTATE(JSG+2)*DEGREE+DOFFST                                 RESULT    153
      ALPD=ALPHA-ALR                                                    RESULT    154
C      IF (ALPHA.GT.180.0) THEN                                         RESULT    155
C         ALPHA=ALPHA-360.0*AINT((ALPHA+180.0)/360.0)                   RESULT    156
C      ELSE IF (ALPHA.LT.-180.0) THEN                                   RESULT    157
C         ALPHA=ALPHA-360.0*AINT((ALPHA-180.0)/360.0)                   RESULT    158
C      END IF                                                           RESULT    159
      CDG1=CDG(1,IMAC)                                                  RESULT    160
      CDG2=CDG(2,IMAC)                                                  RESULT    161
      CT2=CDG1**2+CDG2**2                                               RESULT    162
      CT=SQRT(CT2)                                                      RESULT    163
      IF(CT2.NE.0.0)CT2=1.0/CT2                                         RESULT    164
      VOLTK=VOLT(IPBNO)                                                 RESULT    165
      EC=CABS(VOLTK)                                                    RESULT    166
      PRL=VREAL*CDG1+VIMAG*CDG2                                         RESULT    167
      PIM=VIMAG*CDG1-VREAL*CDG2                                         RESULT    168
      WXBASE=DDAT(JDG+5)                                                RESULT    169
      XFREQ=1.0+XSTATE(JSG+1)/WXBASE                                    RESULT    170
      TINI=TIN(JYG+1)                                                   RESULT    171
C                                                                       RESULT    172
      IF(XPD(IMAC).GT.1.E-6)THEN                                        RESULT    173
      EXPTM=XPD(IMAC)                                                   RESULT    174
      TINI=TINI*XFREQ**EXPTM                                            RESULT    175
      ENDIF                                                             RESULT    176
C                                                                       RESULT    177
C      COMPUTE APP. IMPEDANCE FROM MACHINE TERMINAL                     RESULT    178
C                                                                       RESULT    179
      ZR=(VREAL*CDG1+VIMAG*CDG2)*CT2                                    RESULT    180
      ZI=(VIMAG*CDG1-VREAL*CDG2)*CT2                                    RESULT    181
C                                                                       RESULT    182
C   STORE COMPUTED RESULTS IN  BUF                                      RESULT    183
C                                                                       RESULT    184
      BUF(ISCHAN+1)=EC                                                  RESULT    185
      BUF(ISCHAN+2)=PRL                                                 RESULT    186
      BUF(ISCHAN+3)=PIM                                                 RESULT    187
      BUF(ISCHAN+4)=ALPHA                                               RESULT    188
      DOM=XSTATE(JSG+1)/WXBASE                                          RESULT    189
      IF(JSEM.GT.1)THEN                                                 RESULT    190
      BUF(ISCHAN+5)=DOM                                                 RESULT    191
      BUF(ISCHAN+6)=TINI                                                RESULT    192
      BUF(ISCHAN+7)=EFD(JYG+4)                                          RESULT    193
      ENDIF                                                             RESULT    194
      IF(JSEM.GT.2)THEN                                                 RESULT    195
      BUF(ISCHAN+8)=CFD(JYG+5)                                          RESULT    196
      BUF(ISCHAN+9)=CDG1                                                RESULT    197
      BUF(ISCHAN+10)=CDG2                                               RESULT    198
      BUF(ISCHAN+11)=ZR                                                 RESULT    199
      BUF(ISCHAN+12)=ZI                                                 RESULT    200
      ENDIF                                                             RESULT    201
      FREQ=(WXBASE+XSTATE(JSG+1))*0.25*PI                               RESULT    202
        IF(IPRTSW.EQ.1)THEN                                             RESULT    203
          IF((IL+ISTART).GE.ILDEF)THEN                                  RESULT    204
          IL=8+ISTART                                                   RESULT    205
          IF(ISTART.EQ.0) CALL PAGE17                                   RESULT    206
          ISTART=0                                                      RESULT    207
          WRITE(IU17,1010) TS                                           RESULT    208
          ENDIF                                                         RESULT    209
        NLF=NOLD(IPBNO)                                                 RESULT    210
        K3=IPBNO*3                                                      RESULT    211
        IF(ABS(ZR).LT.100.0.AND.ABS(ZI).LT.100.0)THEN                   RESULT    212
        WRITE(IU17,1020) NLF,INAME(K3-2),INAME(K3-1),INAME(K3),UID      RESULT    213
     &,(BUF(ISCHAN+KK),KK=1,4),ALPD,DOM,FREQ,TINI,EFD(JYG+4)            RESULT    214
     &,CFD(JYG+5),CDG1,CDG2,ZR,ZI                                       RESULT    215
        ELSE                                                            RESULT    216
        WRITE(IU17,1020) NLF,INAME(K3-2),INAME(K3-1),INAME(K3),UID      RESULT    217
     &,(BUF(ISCHAN+KK),KK=1,4),ALPD,DOM,FREQ,TINI,EFD(JYG+4)            RESULT    218
     &,CFD(JYG+5),CDG1,CDG2                                             RESULT    219
        ENDIF                                                           RESULT    220
        IL=IL+1                                                         RESULT    221
        ENDIF                                                           RESULT    222
C                                                                       RESULT    223
C   NON EXISTED GENERATOR                                               RESULT    224
C                                                                       RESULT    225
      ELSE                                                              RESULT    226
      BUF(ISCHAN+1)=0.0                                                 RESULT    227
      BUF(ISCHAN+2)=0.0                                                 RESULT    228
      BUF(ISCHAN+3)=0.0                                                 RESULT    229
      BUF(ISCHAN+4)=0.0                                                 RESULT    230
      ENDIF                                                             RESULT    231
      ENDIF                                                             RESULT    232
      ELSEIF(KOPDAT(IPOS+4).EQ.1)THEN                                   RESULT    233
      IMAC=KOPDAT(IPOS+2)                                               RESULT    234
      IF(IMAC.NE.0)THEN                                                 RESULT    235
      UID(1:2)=NDGC(IMAC)(3:4)                                          RESULT    236
      ISCHAN=KOPDAT(IPOS+3)                                             RESULT    237
      JDG=JCONTA(1,IMAC)                                                RESULT    238
      JSG=MSTATE(1,IMAC)                                                RESULT    239
      JYG=MYVAR(1,IMAC)                                                 RESULT    240
      ALPHA=XSTATE(JSG+2)*DEGREE                                        RESULT    241
      ALPD=ALPHA-ALR                                                    RESULT    242
C      IF (ALPHA.GT.180.0) THEN                                         RESULT    243
C         ALPHA=ALPHA-360.0*AINT((ALPHA+180.0)/360.0)                   RESULT    244
C      ELSE IF (ALPHA.LT.-180.0) THEN                                   RESULT    245
C         ALPHA=ALPHA-360.0*AINT((ALPHA-180.0)/360.0)                   RESULT    246
C      END IF                                                           RESULT    247
      CDG1=CDG(1,IMAC)                                                  RESULT    248
      CDG2=CDG(2,IMAC)                                                  RESULT    249
      CT2=CDG1**2+CDG2**2                                               RESULT    250
      CT=SQRT(CT2)                                                      RESULT    251
      VOLTK=VOLT(IPBNO)                                                 RESULT    252
      EC=CABS(VOLTK)                                                    RESULT    253
      PRL=VREAL*CDG1+VIMAG*CDG2                                         RESULT    254
      PIM=VIMAG*CDG1-VREAL*CDG2                                         RESULT    255
      WXBASE=DDAT(JDG+5)                                                RESULT    256
      XFREQ=1.0+XSTATE(JSG+1)/WXBASE                                    RESULT    257
      TINI=TIN(JYG+1)                                                   RESULT    258
C                                                                       RESULT    259
C   STORE COMPUTED RESULTS IN  BUF                                      RESULT    260
C                                                                       RESULT    261
      BUF(ISCHAN+1)=EC                                                  RESULT    262
      BUF(ISCHAN+2)=PRL                                                 RESULT    263
      BUF(ISCHAN+3)=PIM                                                 RESULT    264
      BUF(ISCHAN+4)=ALPHA                                               RESULT    265
      DOM=XSTATE(JSG+1)/WXBASE                                          RESULT    266
      IF(JSEM.GT.1)THEN                                                 RESULT    267
      BUF(ISCHAN+5)=DOM                                                 RESULT    268
      BUF(ISCHAN+6)=TINI                                                RESULT    269
      ENDIF                                                             RESULT    270
      FREQ=(WXBASE+XSTATE(JSG+1))*0.25*PI                               RESULT    271
        IF(IPRTSW.EQ.1)THEN                                             RESULT    272
          IF((IL+ISTART).GE.ILDEF)THEN                                  RESULT    273
          IL=8+ISTART                                                   RESULT    274
          IF(ISTART.EQ.0) CALL PAGE17                                   RESULT    275
          ISTART=0                                                      RESULT    276
          WRITE(IU17,1010) TS                                           RESULT    277
          ENDIF                                                         RESULT    278
        NLF=NOLD(IPBNO)                                                 RESULT    279
        K3=IPBNO*3                                                      RESULT    280
        WRITE(IU17,1020) NLF,INAME(K3-2),INAME(K3-1),INAME(K3),UID      RESULT    281
     &,(BUF(ISCHAN+KK),KK=1,4),ALPD,DOM,FREQ,TINI                       RESULT    282
        IL=IL+1                                                         RESULT    283
        ENDIF                                                           RESULT    284
C                                                                       RESULT    285
C   NON EXISTED GENERATOR                                               RESULT    286
C                                                                       RESULT    287
      ELSE                                                              RESULT    288
      BUF(ISCHAN+1)=0.0                                                 RESULT    289
      BUF(ISCHAN+2)=0.0                                                 RESULT    290
      BUF(ISCHAN+3)=0.0                                                 RESULT    291
      BUF(ISCHAN+4)=0.0                                                 RESULT    292
C                                                                       RESULT    293
      ENDIF                                                             RESULT    294
C                                                                       RESULT    295
      ENDIF                                                             RESULT    296
C                                                                       RESULT    297
      IPOS=IPOS+4                                                       RESULT    298
      IF(ICOUNT.LT.ICOUNX)GOTO 100                                      RESULT    299
      ENDIF                                                             RESULT    300
 120  CONTINUE                                                          RESULT    301
      IF(NGENO.EQ.0) IL=ILDEF                                           RESULT    302
      ENDIF                                                             RESULT    303
*IF LTSP                                                                RESULT    304
*ENDIF                                                                  RESULT    939
C                                                                       RESULT    940
C      KN=0                                                             RESULT    941
C      DO 132 K=1,IPNODE                                                RESULT    942
C      KN=KN+3                                                          RESULT    943
C      NLF=NOLD(K)                                                      RESULT    944
C      I1=NTHG(K)                                                       RESULT    945
C      I2=NTHG(K+1)-1                                                   RESULT    946
C      DO 131 N=I1,I2                                                   RESULT    947
C      UID(1:2)=NDGC(N)(3:4)                                            RESULT    948
C      IF((IL+ISTART).GE.ILDEF)THEN                                     RESULT    949
C      IL=8+ISTART                                                      RESULT    950
C      IF(ISTART.EQ.0) CALL PAGE17                                      RESULT    951
C      ISTART=0                                                         RESULT    952
C      WRITE(IU17,1680) TS                                              RESULT    953
C      ENDIF                                                            RESULT    954
C      WRITE(IU17,1690) NLF,INAME(KN-2),INAME(KN-1),INAME(KN),UID       RESULT    955
C     &,XKE(N),VPE(N)                                                   RESULT    956
C      IL=IL+1                                                          RESULT    957
C  131 CONTINUE                                                         RESULT    958
C  132 CONTINUE                                                         RESULT    959
C      WRITE(IU17,1700) TOTALK,TOTALP                                   RESULT    960
C                                                                       RESULT    961
C                                                                       RESULT    962
CD                                                                      RESULT    963
CD STEP 2. CALCULATE AND STORE DETAILED GENERATOR CONTROL SIGNALS       RESULT    964
CD                                                                      RESULT    965
      IF(NGCOSO.NE.0)THEN                                               RESULT    966
      DO 320 K=1,NOPTR                                                  RESULT    967
      IPOS=KOPTR(K)                                                     RESULT    968
      JSEM=KOPDAT(IPOS+1)                                               RESULT    969
      IF(JSEM.EQ.4)THEN                                                 RESULT    970
      ICOUNX=KOPDAT(IPOS+2)                                             RESULT    971
      IPOS=IPOS+2                                                       RESULT    972
      ICOUNT=0                                                          RESULT    973
 300  ICOUNT=ICOUNT+1                                                   RESULT    974
      IPBNO=KOPDAT(IPOS+1)                                              RESULT    975
      IF(IPBNO.NE.0)THEN                                                RESULT    976
      IMAC=KOPDAT(IPOS+2)                                               RESULT    977
      ISCHAN=KOPDAT(IPOS+3)                                             RESULT    978
      IF(IMAC.LE.NT)THEN                                                RESULT    979
      UID(1:2)=NDGC(IMAC)(3:4)                                          RESULT    980
C                                                                       RESULT    981
C   STORE COMPUTED RESULTS IN  BUF                                      RESULT    982
C                                                                       RESULT    983
      JYE=MYVAR(2,IMAC)                                                 RESULT    984
      JYS=MYVAR(3,IMAC)                                                 RESULT    985
      JYU=MYVAR(4,IMAC)                                                 RESULT    986
      JYPS=MYVAR(6,IMAC)                                                RESULT    987
      IF(JYE.NE.0)THEN                                                  RESULT    988
         BUF(ISCHAN+1)=VREG(JYE+1)                                      RESULT    989
      ELSE                                                              RESULT    990
         BUF(ISCHAN+1)=0.0                                              RESULT    991
      ENDIF                                                             RESULT    992
      IF(JYS.NE.0)THEN                                                  RESULT    993
         BUF(ISCHAN+2)=VSS(JYS+1)                                       RESULT    994
      ELSE                                                              RESULT    995
         BUF(ISCHAN+2)=0.0                                              RESULT    996
      ENDIF                                                             RESULT    997
      IF(JYU.NE.0)THEN                                                  RESULT    998
         BUF(ISCHAN+3)=VUAL(JYU+1)                                      RESULT    999
      ELSE                                                              RESULT   1000
         BUF(ISCHAN+3)=0.0                                              RESULT   1001
      ENDIF                                                             RESULT   1002
      IF(JYPS.NE.0)THEN                                                 RESULT   1003
         BUF(ISCHAN+4)=GSS(JYPS+1)                                      RESULT   1004
      ELSE                                                              RESULT   1005
         BUF(ISCHAN+4)=0.0                                              RESULT   1006
      ENDIF                                                             RESULT   1007
C                                                                       RESULT   1008
        IF(IPRTSW.EQ.1)THEN                                             RESULT   1009
          IF((IL+ISTART).GE.ILDEF)THEN                                  RESULT   1010
          IL=8+ISTART                                                   RESULT   1011
          IF(ISTART.EQ.0) CALL PAGE17                                   RESULT   1012
          ISTART=0                                                      RESULT   1013
          WRITE(IU17,1330) TS                                           RESULT   1014
          ENDIF                                                         RESULT   1015
        NLF=NOLD(IPBNO)                                                 RESULT   1016
        K3=IPBNO*3                                                      RESULT   1017
      WRITE(IU17,1340) NLF,INAME(K3-2),INAME(K3-1),INAME(K3),UID        RESULT   1018
     +,(BUF(ISCHAN+J),J=1,4)                                            RESULT   1019
        IL=IL+1                                                         RESULT   1020
        ENDIF                                                           RESULT   1021
C                                                                       RESULT   1022
C   NON CONTROLED GENERATOR                                             RESULT   1023
C                                                                       RESULT   1024
      ELSE                                                              RESULT   1025
      BUF(ISCHAN+1)=0.0                                                 RESULT   1026
      BUF(ISCHAN+2)=0.0                                                 RESULT   1027
      BUF(ISCHAN+3)=0.0                                                 RESULT   1028
      BUF(ISCHAN+4)=0.0                                                 RESULT   1029
      ENDIF                                                             RESULT   1030
C                                                                       RESULT   1031
C   NON EXISTED GENERATOR                                               RESULT   1032
C                                                                       RESULT   1033
      ELSE                                                              RESULT   1034
      BUF(ISCHAN+1)=0.0                                                 RESULT   1035
      BUF(ISCHAN+2)=0.0                                                 RESULT   1036
      BUF(ISCHAN+3)=0.0                                                 RESULT   1037
      BUF(ISCHAN+4)=0.0                                                 RESULT   1038
      ENDIF                                                             RESULT   1039
      IPOS=IPOS+3                                                       RESULT   1040
      IF(ICOUNT.LT.ICOUNX)GOTO 300                                      RESULT   1041
      ENDIF                                                             RESULT   1042
 320  CONTINUE                                                          RESULT   1043
      IL=ILDEF                                                          RESULT   1044
      ENDIF                                                             RESULT   1045
CD                                                                      RESULT   1046
CD STEP 3. PICK UP AND STORE USER DEFIEND EXCITER VARIABLES             RESULT   1047
CD                                                                      RESULT   1048
      IF(NUEXCO.NE.0)THEN                                               RESULT   1049
         DO 325 K=1,NOPTR                                               RESULT   1050
         IPOS=KOPTR(K)                                                  RESULT   1051
         JSEM=KOPDAT(IPOS+1)                                            RESULT   1052
         IF(JSEM.EQ.18)THEN                                             RESULT   1053
            ICOUNX=KOPDAT(IPOS+2)                                       RESULT   1054
            IPOS=IPOS+2                                                 RESULT   1055
            ICOUNT=0                                                    RESULT   1056
  321       ICOUNT=ICOUNT+1                                             RESULT   1057
            IPBNO=KOPDAT(IPOS+1)                                        RESULT   1058
            IMAC=KOPDAT(IPOS+2)                                         RESULT   1059
            LITEM=KOPDAT(IPOS+3)                                        RESULT   1060
            ISCHAN=KOPDAT(IPOS+4)                                       RESULT   1061
            IF(IPBNO.NE.0.AND.IMAC.NE.0)THEN                            RESULT   1062
               UID(1:2)=NDGC(IMAC)(3:4)                                 RESULT   1063
               IEXI=ICONTA(4,IMAC)                                      RESULT   1064
               JYE=MYVAR(2,IMAC)                                        RESULT   1065
C                                                                       RESULT   1066
C   STORE COMPUTED RESULTS IN  BUF                                      RESULT   1067
C                                                                       RESULT   1068
               IF(IEXI.EQ.50)THEN                                       RESULT   1069
                  DO 322 JITEM=1,LITEM                                  RESULT   1070
                  NSTNO=KOPDAT(IPOS+JITEM+4)                            RESULT   1071
                  BUF(ISCHAN+JITEM)=YVAR(JYE+NSTNO+4)                   RESULT   1072
  322             CONTINUE                                              RESULT   1073
C                                                                       RESULT   1074
                  IF(IPRTSW.EQ.1)THEN                                   RESULT   1075
                     IF((IL+ISTART).GE.ILDEF)THEN                       RESULT   1076
                        IL=8+ISTART                                     RESULT   1077
                        IF(ISTART.EQ.0) CALL PAGE17                     RESULT   1078
                        ISTART=0                                        RESULT   1079
                        WRITE(IU17,1500) TS                             RESULT   1080
                     ENDIF                                              RESULT   1081
                     NLF=NOLD(IPBNO)                                    RESULT   1082
                     K3=IPBNO*3                                         RESULT   1083
                     WRITE(IU17,1490)NLF,INAME(K3-2),INAME(K3-1)        RESULT   1084
     &               ,INAME(K3),UID                                     RESULT   1085
     &               ,(KOPDAT(IPOS+JIT+4),BUF(ISCHAN+JIT),JIT=1,LITEM)  RESULT   1086
                     IL=IL+1                                            RESULT   1087
                  ENDIF                                                 RESULT   1088
               ELSE                                                     RESULT   1089
C                                                                       RESULT   1090
C   NON TYPE 50 EXCITER                                                 RESULT   1091
C                                                                       RESULT   1092
                  DO 323 JITEM=1,LITEM                                  RESULT   1093
                  BUF(ISCHAN+JITEM)=0.0                                 RESULT   1094
  323             CONTINUE                                              RESULT   1095
               ENDIF                                                    RESULT   1096
C                                                                       RESULT   1097
C   NON EXISTED GENERATOR                                               RESULT   1098
C                                                                       RESULT   1099
            ELSE                                                        RESULT   1100
               DO 324 JITEM=1,LITEM                                     RESULT   1101
               BUF(ISCHAN+JITEM)=0.0                                    RESULT   1102
  324          CONTINUE                                                 RESULT   1103
            ENDIF                                                       RESULT   1104
            IPOS=IPOS+4+LITEM                                           RESULT   1105
            IF(ICOUNT.LT.ICOUNX)GOTO 321                                RESULT   1106
         ENDIF                                                          RESULT   1107
  325    CONTINUE                                                       RESULT   1108
         IL=ILDEF                                                       RESULT   1109
      ENDIF                                                             RESULT   1110
CD                                                                      RESULT   1111
CD STEP 4. PICK UP AND STORE USER DEFIEND PSS VARIABLES                 RESULT   1112
CD                                                                      RESULT   1113
      IF(NUPSSO.NE.0)THEN                                               RESULT   1114
         DO 335 K=1,NOPTR                                               RESULT   1115
         IPOS=KOPTR(K)                                                  RESULT   1116
         JSEM=KOPDAT(IPOS+1)                                            RESULT   1117
         IF(JSEM.EQ.19)THEN                                             RESULT   1118
            ICOUNX=KOPDAT(IPOS+2)                                       RESULT   1119
            IPOS=IPOS+2                                                 RESULT   1120
            ICOUNT=0                                                    RESULT   1121
  331       ICOUNT=ICOUNT+1                                             RESULT   1122
            IPBNO=KOPDAT(IPOS+1)                                        RESULT   1123
            IMAC=KOPDAT(IPOS+2)                                         RESULT   1124
            LITEM=KOPDAT(IPOS+3)                                        RESULT   1125
            ISCHAN=KOPDAT(IPOS+4)                                       RESULT   1126
            IF(IPBNO.NE.0.AND.IMAC.NE.0)THEN                            RESULT   1127
             UID(1:2)=NDGC(IMAC)(3:4)                                   RESULT   1128
               IPSI=ICONTA(5,IMAC)                                      RESULT   1129
               JYS=MYVAR(3,IMAC)                                        RESULT   1130
C                                                                       RESULT   1131
C   STORE COMPUTED RESULTS IN  BUF                                      RESULT   1132
C                                                                       RESULT   1133
               IF(IPSI.EQ.50)THEN                                       RESULT   1134
                  DO 332 JITEM=1,LITEM                                  RESULT   1135
                  NSTNO=KOPDAT(IPOS+JITEM+4)                            RESULT   1136
                  BUF(ISCHAN+JITEM)=YVAR(JYS+NSTNO+3)                   RESULT   1137
  332             CONTINUE                                              RESULT   1138
C                                                                       RESULT   1139
                  IF(IPRTSW.EQ.1)THEN                                   RESULT   1140
                     IF((IL+ISTART).GE.ILDEF)THEN                       RESULT   1141
                        IL=8+ISTART                                     RESULT   1142
                        IF(ISTART.EQ.0) CALL PAGE17                     RESULT   1143
                        ISTART=0                                        RESULT   1144
                        WRITE(IU17,1510) TS                             RESULT   1145
                     ENDIF                                              RESULT   1146
                     NLF=NOLD(IPBNO)                                    RESULT   1147
                     K3=IPBNO*3                                         RESULT   1148
                     WRITE(IU17,1490)NLF,INAME(K3-2),INAME(K3-1)        RESULT   1149
     &               ,INAME(K3),UID                                     RESULT   1150
     &               ,(KOPDAT(IPOS+JIT+4),BUF(ISCHAN+JIT),JIT=1,LITEM)  RESULT   1151
                     IL=IL+1                                            RESULT   1152
                  ENDIF                                                 RESULT   1153
               ELSE                                                     RESULT   1154
C                                                                       RESULT   1155
C   NON TYPE 50 PSS                                                     RESULT   1156
C                                                                       RESULT   1157
                  DO 333 JITEM=1,LITEM                                  RESULT   1158
                  BUF(ISCHAN+JITEM)=0.0                                 RESULT   1159
  333             CONTINUE                                              RESULT   1160
               ENDIF                                                    RESULT   1161
C                                                                       RESULT   1162
C   NON EXISTED GENERATOR                                               RESULT   1163
C                                                                       RESULT   1164
            ELSE                                                        RESULT   1165
               DO 334 JITEM=1,LITEM                                     RESULT   1166
               BUF(ISCHAN+JITEM)=0.0                                    RESULT   1167
  334          CONTINUE                                                 RESULT   1168
            ENDIF                                                       RESULT   1169
            IPOS=IPOS+4+LITEM                                           RESULT   1170
            IF(ICOUNT.LT.ICOUNX)GOTO 331                                RESULT   1171
         ENDIF                                                          RESULT   1172
  335    CONTINUE                                                       RESULT   1173
         IL=ILDEF                                                       RESULT   1174
      ENDIF                                                             RESULT   1175
CD                                                                      RESULT   1176
CD STEP 5. PICK UP AND STORE USER DEFIEND EXL VARIABLES                 RESULT   1177
CD                                                                      RESULT   1178
      IF(NUUELO.NE.0)THEN                                               RESULT   1179
         DO 345 K=1,NOPTR                                               RESULT   1180
         IPOS=KOPTR(K)                                                  RESULT   1181
         JSEM=KOPDAT(IPOS+1)                                            RESULT   1182
         IF(JSEM.EQ.20)THEN                                             RESULT   1183
            ICOUNX=KOPDAT(IPOS+2)                                       RESULT   1184
            IPOS=IPOS+2                                                 RESULT   1185
            ICOUNT=0                                                    RESULT   1186
  341       ICOUNT=ICOUNT+1                                             RESULT   1187
            IPBNO=KOPDAT(IPOS+1)                                        RESULT   1188
            IMAC=KOPDAT(IPOS+2)                                         RESULT   1189
            LITEM=KOPDAT(IPOS+3)                                        RESULT   1190
            ISCHAN=KOPDAT(IPOS+4)                                       RESULT   1191
            IF(IPBNO.NE.0.AND.IMAC.NE.0)THEN                            RESULT   1192
               UID(1:2)=NDGC(IMAC)(3:4)                                 RESULT   1193
               IPSI=ICONTA(5,IMAC)                                      RESULT   1194
               IUEI=ICONTA(7,IMAC)                                      RESULT   1195
               IOEI=ICONTA(12,IMAC)                                     RESULT   1196
C                                                                       RESULT   1197
C   STORE COMPUTED RESULTS IN  BUF                                      RESULT   1198
C                                                                       RESULT   1199
               IF((IUEI.EQ.50.AND.IPSI.NE.50).OR.IOEI.EQ.50) THEN       RESULT   1200
                  IF(IOEI.EQ.50) THEN                                   RESULT   1201
                     JYU=MYVAR(8,IMAC)                                  RESULT   1202
                  ELSE                                                  RESULT   1203
                     JYU=MYVAR(4,IMAC)                                  RESULT   1204
                  ENDIF                                                 RESULT   1205
                  DO 342 JITEM=1,LITEM                                  RESULT   1206
                  NSTNO=KOPDAT(IPOS+JITEM+4)                            RESULT   1207
                  BUF(ISCHAN+JITEM)=YVAR(JYU+NSTNO+2)                   RESULT   1208
  342             CONTINUE                                              RESULT   1209
C                                                                       RESULT   1210
                  IF(IPRTSW.EQ.1)THEN                                   RESULT   1211
                     IF((IL+ISTART).GE.ILDEF)THEN                       RESULT   1212
                        IL=8+ISTART                                     RESULT   1213
                        IF(ISTART.EQ.0) CALL PAGE17                     RESULT   1214
                        ISTART=0                                        RESULT   1215
                        WRITE(IU17,1520) TS                             RESULT   1216
                     ENDIF                                              RESULT   1217
                     NLF=NOLD(IPBNO)                                    RESULT   1218
                     K3=IPBNO*3                                         RESULT   1219
                     WRITE(IU17,1490)NLF,INAME(K3-2),INAME(K3-1)        RESULT   1220
     &               ,INAME(K3),UID                                     RESULT   1221
     &               ,(KOPDAT(IPOS+JIT+4),BUF(ISCHAN+JIT),JIT=1,LITEM)  RESULT   1222
                     IL=IL+1                                            RESULT   1223
                  ENDIF                                                 RESULT   1224
               ELSE                                                     RESULT   1225
C                                                                       RESULT   1226
C   NON TYPE 50 OR 60 EXL                                               RESULT   1227
C                                                                       RESULT   1228
                  DO 343 JITEM=1,LITEM                                  RESULT   1229
                  BUF(ISCHAN+JITEM)=0.0                                 RESULT   1230
  343             CONTINUE                                              RESULT   1231
               ENDIF                                                    RESULT   1232
C                                                                       RESULT   1233
C   NON EXISTED GENERATOR                                               RESULT   1234
C                                                                       RESULT   1235
            ELSE                                                        RESULT   1236
               DO 344 JITEM=1,LITEM                                     RESULT   1237
               BUF(ISCHAN+JITEM)=0.0                                    RESULT   1238
  344          CONTINUE                                                 RESULT   1239
            ENDIF                                                       RESULT   1240
            IPOS=IPOS+4+LITEM                                           RESULT   1241
            IF(ICOUNT.LT.ICOUNX)GOTO 341                                RESULT   1242
         ENDIF                                                          RESULT   1243
  345    CONTINUE                                                       RESULT   1244
         IL=ILDEF                                                       RESULT   1245
      ENDIF                                                             RESULT   1246
CD                                                                      RESULT   1247
CD STEP 6. PICK UP AND STORE USER DEFIEND GOVERNOR VARIABLES            RESULT   1248
CD                                                                      RESULT   1249
      IF(NUGOVO.NE.0)THEN                                               RESULT   1250
         DO 381 K=1,NOPTR                                               RESULT   1251
         IPOS=KOPTR(K)                                                  RESULT   1252
         JSEM=KOPDAT(IPOS+1)                                            RESULT   1253
         IF(JSEM.EQ.21)THEN                                             RESULT   1254
            ICOUNX=KOPDAT(IPOS+2)                                       RESULT   1255
            IPOS=IPOS+2                                                 RESULT   1256
            ICOUNT=0                                                    RESULT   1257
  361       ICOUNT=ICOUNT+1                                             RESULT   1258
            IPBNO=KOPDAT(IPOS+1)                                        RESULT   1259
            IMAC=KOPDAT(IPOS+2)                                         RESULT   1260
            LITEM=KOPDAT(IPOS+3)                                        RESULT   1261
            ISCHAN=KOPDAT(IPOS+4)                                       RESULT   1262
            IF(IPBNO.NE.0.AND.IMAC.NE.0)THEN                            RESULT   1263
              UID(1:2)=NDGC(IMAC)(3:4)                                  RESULT   1264
              IGVI=ICONTA(2,IMAC)                                       RESULT   1265
              JYP=MYVAR(5,IMAC)                                         RESULT   1266
C                                                                       RESULT   1267
C   STORE COMPUTED RESULTS IN  BUF                                      RESULT   1268
C                                                                       RESULT   1269
               IF(IGVI.EQ.50)THEN                                       RESULT   1270
                  DO 362 JITEM=1,LITEM                                  RESULT   1271
                  NSTNO=KOPDAT(IPOS+JITEM+4)                            RESULT   1272
                  BUF(ISCHAN+JITEM)=YVAR(JYP+NSTNO+4)                   RESULT   1273
  362             CONTINUE                                              RESULT   1274
C                                                                       RESULT   1275
                  IF(IPRTSW.EQ.1)THEN                                   RESULT   1276
                     IF((IL+ISTART).GE.ILDEF)THEN                       RESULT   1277
                        IL=8+ISTART                                     RESULT   1278
                        IF(ISTART.EQ.0) CALL PAGE17                     RESULT   1279
                        ISTART=0                                        RESULT   1280
                        WRITE(IU17,1480) TS                             RESULT   1281
                     ENDIF                                              RESULT   1282
                     NLF=NOLD(IPBNO)                                    RESULT   1283
                     K3=IPBNO*3                                         RESULT   1284
                     WRITE(IU17,1490)NLF,INAME(K3-2),INAME(K3-1)        RESULT   1285
     &               ,INAME(K3),UID                                     RESULT   1286
     &               ,(KOPDAT(IPOS+JIT+4),BUF(ISCHAN+JIT),JIT=1,LITEM)  RESULT   1287
                     IL=IL+1                                            RESULT   1288
                  ENDIF                                                 RESULT   1289
               ELSE                                                     RESULT   1290
C                                                                       RESULT   1291
C   NON TYPE 50 GOVERNOR                                                RESULT   1292
C                                                                       RESULT   1293
                  DO 363 JITEM=1,LITEM                                  RESULT   1294
                  BUF(ISCHAN+JITEM)=0.0                                 RESULT   1295
  363             CONTINUE                                              RESULT   1296
               ENDIF                                                    RESULT   1297
C                                                                       RESULT   1298
C   NON EXISTED GENERATOR                                               RESULT   1299
C                                                                       RESULT   1300
            ELSE                                                        RESULT   1301
               DO 364 JITEM=1,LITEM                                     RESULT   1302
               BUF(ISCHAN+JITEM)=0.0                                    RESULT   1303
  364          CONTINUE                                                 RESULT   1304
            ENDIF                                                       RESULT   1305
            IPOS=IPOS+4+LITEM                                           RESULT   1306
            IF(ICOUNT.LT.ICOUNX)GOTO 361                                RESULT   1307
         ENDIF                                                          RESULT   1308
  381    CONTINUE                                                       RESULT   1309
      IL=ILDEF                                                          RESULT   1310
      ENDIF                                                             RESULT   1311
CD                                                                      RESULT   1312
CD STEP 7. PICK UP AND STORE REGULAR GOVERNOR VARIABLES                 RESULT   1313
CD                                                                      RESULT   1314
      IF(NGOVVO.NE.0)THEN                                               RESULT   1315
      DO 380 K=1,NOPTR                                                  RESULT   1316
      IPOS=KOPTR(K)                                                     RESULT   1317
      JSEM=KOPDAT(IPOS+1)                                               RESULT   1318
      IF(JSEM.EQ.5)THEN                                                 RESULT   1319
      ICOUNX=KOPDAT(IPOS+2)                                             RESULT   1320
      IPOS=IPOS+2                                                       RESULT   1321
      ICOUNT=0                                                          RESULT   1322
 360  ICOUNT=ICOUNT+1                                                   RESULT   1323
      IPBNO=KOPDAT(IPOS+1)                                              RESULT   1324
      IMAC=KOPDAT(IPOS+2)                                               RESULT   1325
      ISCHAN=KOPDAT(IPOS+3)                                             RESULT   1326
      IF(IPBNO.NE.0.AND.IMAC.NE.0)THEN                                  RESULT   1327
        UID(1:2)=NDGC(IMAC)(3:4)                                        RESULT   1328
        IGVI=ICONTA(2,IMAC)                                             RESULT   1329
        JYP=MYVAR(5,IMAC)                                               RESULT   1330
C                                                                       RESULT   1331
C   STORE COMPUTED RESULTS IN  BUF                                      RESULT   1332
C                                                                       RESULT   1333
      IF(IGVI.EQ.1.OR.IGVI.EQ.2)THEN                                    RESULT   1334
      BUF(ISCHAN+1)=FACV(JYP+7)                                         RESULT   1335
      BUF(ISCHAN+2)=FAIV(JYP+6)                                         RESULT   1336
      BUF(ISCHAN+3)=AIV(JYP+5)                                          RESULT   1337
      BUF(ISCHAN+4)=PVP(JYP+4)                                          RESULT   1338
      IGSTAN=ICONTA(10,IMAC)                                            RESULT   1339
      IF(IGSTAN.EQ.0)THEN                                               RESULT   1340
      BUF(ISCHAN+5)=0.0                                                 RESULT   1341
      ELSE                                                              RESULT   1342
      JGSN=MSTATE(6,IMAC)                                               RESULT   1343
      BUF(ISCHAN+5)=XSTATE(JGSN+1)                                      RESULT   1344
      ENDIF                                                             RESULT   1345
C                                                                       RESULT   1346
        IF(IPRTSW.EQ.1)THEN                                             RESULT   1347
           IF((IL+ISTART).GE.ILDEF)THEN                                 RESULT   1348
              IL=8+ISTART                                               RESULT   1349
              IF(ISTART.EQ.0) CALL PAGE17                               RESULT   1350
              ISTART=0                                                  RESULT   1351
              WRITE(IU17,1310) TS                                       RESULT   1352
           ENDIF                                                        RESULT   1353
        NLF=NOLD(IPBNO)                                                 RESULT   1354
        K3=IPBNO*3                                                      RESULT   1355
      WRITE(IU17,1320) NLF,INAME(K3-2),INAME(K3-1),INAME(K3),UID,IGVI   RESULT   1356
     +,(BUF(ISCHAN+J),J=1,5)                                            RESULT   1357
        IL=IL+1                                                         RESULT   1358
        ENDIF                                                           RESULT   1359
      ELSE                                                              RESULT   1360
C                                                                       RESULT   1361
C   NON TYPE 1 OR 2 GOVERNOR                                            RESULT   1362
C                                                                       RESULT   1363
      BUF(ISCHAN+1)=0.0                                                 RESULT   1364
      BUF(ISCHAN+2)=0.0                                                 RESULT   1365
      BUF(ISCHAN+3)=0.0                                                 RESULT   1366
      BUF(ISCHAN+4)=0.0                                                 RESULT   1367
      BUF(ISCHAN+5)=0.0                                                 RESULT   1368
      ENDIF                                                             RESULT   1369
C                                                                       RESULT   1370
C   NON EXISTED GENERATOR                                               RESULT   1371
C                                                                       RESULT   1372
      ELSE                                                              RESULT   1373
      BUF(ISCHAN+1)=0.0                                                 RESULT   1374
      BUF(ISCHAN+2)=0.0                                                 RESULT   1375
      BUF(ISCHAN+3)=0.0                                                 RESULT   1376
      BUF(ISCHAN+4)=0.0                                                 RESULT   1377
      BUF(ISCHAN+5)=0.0                                                 RESULT   1378
      ENDIF                                                             RESULT   1379
      IPOS=IPOS+3                                                       RESULT   1380
      IF(ICOUNT.LT.ICOUNX)GOTO 360                                      RESULT   1381
      ENDIF                                                             RESULT   1382
 380  CONTINUE                                                          RESULT   1383
      IL=ILDEF                                                          RESULT   1384
      ENDIF                                                             RESULT   1385
CD                                                                      RESULT   1386
CD STEP 8. PICK UP AND STORE GENERATOR AND CONTROL STATES               RESULT   1387
CD                                                                      RESULT   1388
      IF(NGENSO.NE.0)THEN                                               RESULT   1389
      DO 450 K=1,NOPTR                                                  RESULT   1390
      IPOS=KOPTR(K)                                                     RESULT   1391
      JSEM=KOPDAT(IPOS+1)                                               RESULT   1392
      IF(JSEM.EQ.6)THEN                                                 RESULT   1393
      ICOUNX=KOPDAT(IPOS+2)                                             RESULT   1394
      IPOS=IPOS+2                                                       RESULT   1395
      ICOUNT=0                                                          RESULT   1396
 400  ICOUNT=ICOUNT+1                                                   RESULT   1397
      IPBNO=KOPDAT(IPOS+1)                                              RESULT   1398
      IMAC=KOPDAT(IPOS+2)                                               RESULT   1399
      IF(IPBNO.NE.0.AND.IMAC.NE.0)THEN                                  RESULT   1400
      NSTAT=KOPDAT(IPOS+3)                                              RESULT   1401
      ISCHAN=KOPDAT(IPOS+4)                                             RESULT   1402
      IPOS=IPOS+4                                                       RESULT   1403
      IF(IMAC.NE.0)THEN                                                 RESULT   1404
      UID(1:2)=NDGC(IMAC)(3:4)                                          RESULT   1405
      JSG=MSTATE(1,IMAC)                                                RESULT   1406
C                                                                       RESULT   1407
C   STORE COMPUTED RESULTS IN  BUF                                      RESULT   1408
C                                                                       RESULT   1409
      LK=0                                                              RESULT   1410
 410  LK=LK+1                                                           RESULT   1411
      IPOS=IPOS+1                                                       RESULT   1412
      NSTNO=KOPDAT(IPOS)                                                RESULT   1413
      LBUF(LK)=NSTNO                                                    RESULT   1414
      BUF(ISCHAN+LK)=XSTATE(JSG+NSTNO)                                  RESULT   1415
      IF(LK.LT.NSTAT)GOTO 410                                           RESULT   1416
        IF(IPRTSW.EQ.1)THEN                                             RESULT   1417
           IF((IL+ISTART).GE.ILDEF)THEN                                 RESULT   1418
              IL=8+ISTART                                               RESULT   1419
              IF(ISTART.EQ.0) CALL PAGE17                               RESULT   1420
              ISTART=0                                                  RESULT   1421
              WRITE(IU17,1250) TS                                       RESULT   1422
           ENDIF                                                        RESULT   1423
        NLF=NOLD(IPBNO)                                                 RESULT   1424
        K3=IPBNO*3                                                      RESULT   1425
        WRITE(IU17,1260) NLF,INAME(K3-2),INAME(K3-1),INAME(K3),UID      RESULT   1426
     &,(LBUF(KK),BUF(ISCHAN+KK),KK=1,NSTAT)                             RESULT   1427
        IL=IL+1                                                         RESULT   1428
        ENDIF                                                           RESULT   1429
C                                                                       RESULT   1430
C   NON EXISTED GENERATOR                                               RESULT   1431
C                                                                       RESULT   1432
      ELSE                                                              RESULT   1433
      LK=0                                                              RESULT   1434
 420  LK=LK+1                                                           RESULT   1435
      IPOS=IPOS+1                                                       RESULT   1436
      BUF(ISCHAN+LK)=0.0                                                RESULT   1437
      IF(LK.LT.NSTAT)GOTO 420                                           RESULT   1438
      ENDIF                                                             RESULT   1439
      ENDIF                                                             RESULT   1440
      IF(ICOUNT.LT.ICOUNX)GOTO 400                                      RESULT   1441
      ENDIF                                                             RESULT   1442
 450  CONTINUE                                                          RESULT   1443
C                                                                       RESULT   1444
C   ENDIF NGENSO.NE.0                                                   RESULT   1445
C                                                                       RESULT   1446
      IL=ILDEF                                                          RESULT   1447
      ENDIF                                                             RESULT   1448
CD                                                                      RESULT   1449
CD STEP 9. PICK UP AND STORE GENERATOR AND CONTROL Y VARIABLES          RESULT   1450
CD                                                                      RESULT   1451
      IF(NGENYO.NE.0)THEN                                               RESULT   1452
      DO 500 K=1,NOPTR                                                  RESULT   1453
      IPOS=KOPTR(K)                                                     RESULT   1454
      JSEM=KOPDAT(IPOS+1)                                               RESULT   1455
      IF(JSEM.EQ.7)THEN                                                 RESULT   1456
      ICOUNX=KOPDAT(IPOS+2)                                             RESULT   1457
      IPOS=IPOS+2                                                       RESULT   1458
      ICOUNT=0                                                          RESULT   1459
 460  ICOUNT=ICOUNT+1                                                   RESULT   1460
      IPBNO=KOPDAT(IPOS+1)                                              RESULT   1461
      IF(IPBNO.NE.0)THEN                                                RESULT   1462
      IMAC=KOPDAT(IPOS+2)                                               RESULT   1463
      NSTAT=KOPDAT(IPOS+3)                                              RESULT   1464
      ISCHAN=KOPDAT(IPOS+4)                                             RESULT   1465
      IPOS=IPOS+4                                                       RESULT   1466
      IF(IMAC.NE.0)THEN                                                 RESULT   1467
      UID(1:2)=NDGC(IMAC)(3:4)                                          RESULT   1468
      JSG=MYVAR(1,IMAC)                                                 RESULT   1469
C                                                                       RESULT   1470
C   STORE COMPUTED RESULTS IN  BUF                                      RESULT   1471
C                                                                       RESULT   1472
      LK=0                                                              RESULT   1473
 470  LK=LK+1                                                           RESULT   1474
      IPOS=IPOS+1                                                       RESULT   1475
      NSTNO=KOPDAT(IPOS)                                                RESULT   1476
      LBUF(LK)=NSTNO                                                    RESULT   1477
      BUF(ISCHAN+LK)=YVAR(JSG+NSTNO)                                    RESULT   1478
      IF(LK.LT.NSTAT)GOTO 470                                           RESULT   1479
        IF(IPRTSW.EQ.1)THEN                                             RESULT   1480
           IF((IL+ISTART).GE.ILDEF)THEN                                 RESULT   1481
              IL=8+ISTART                                               RESULT   1482
              IF(ISTART.EQ.0) CALL PAGE17                               RESULT   1483
              ISTART=0                                                  RESULT   1484
              WRITE(IU17,1350) TS                                       RESULT   1485
           ENDIF                                                        RESULT   1486
        NLF=NOLD(IPBNO)                                                 RESULT   1487
        K3=IPBNO*3                                                      RESULT   1488
        WRITE(IU17,1260) NLF,INAME(K3-2),INAME(K3-1),INAME(K3),UID      RESULT   1489
     &,(LBUF(KK),BUF(ISCHAN+KK),KK=1,NSTAT)                             RESULT   1490
        IL=IL+1                                                         RESULT   1491
        ENDIF                                                           RESULT   1492
C                                                                       RESULT   1493
C   NON EXISTED GENERATOR                                               RESULT   1494
C                                                                       RESULT   1495
      ELSE                                                              RESULT   1496
      LK=0                                                              RESULT   1497
 480  LK=LK+1                                                           RESULT   1498
      IPOS=IPOS+1                                                       RESULT   1499
      BUF(ISCHAN+LK)=0.0                                                RESULT   1500
      IF(LK.LT.NSTAT)GOTO 480                                           RESULT   1501
      ENDIF                                                             RESULT   1502
      ENDIF                                                             RESULT   1503
      IF(ICOUNT.LT.ICOUNX)GOTO 460                                      RESULT   1504
      ENDIF                                                             RESULT   1505
 500  CONTINUE                                                          RESULT   1506
C                                                                       RESULT   1507
C   ENDIF NGENYO.NE.0                                                   RESULT   1508
C                                                                       RESULT   1509
      IL=ILDEF                                                          RESULT   1510
      ENDIF                                                             RESULT   1511
CD                                                                      RESULT   1512
CD STEP 10. CALCULATE AND STORE INDUCTION MOTOR VARIABLES               RESULT   1513
CD                                                                      RESULT   1514
      IF (NMOTRO.NE.0) THEN                                             RESULT   1515
         DO 550 K=1,NOPTR                                               RESULT   1516
            IPOS=KOPTR(K)                                               RESULT   1517
            JSEM=KOPDAT(IPOS+1)                                         RESULT   1518
            IF (JSEM.EQ.8.OR.JSEM.EQ.9) THEN                            RESULT   1519
               ICOUNX=KOPDAT(IPOS+2)                                    RESULT   1520
               IPOS=IPOS+2                                              RESULT   1521
               ICOUNT=0                                                 RESULT   1522
 540           ICOUNT=ICOUNT+1                                          RESULT   1523
               IPBNO=KOPDAT(IPOS+1)                                     RESULT   1524
               IMAC=KOPDAT(IPOS+2)                                      RESULT   1525
               ISCHAN=KOPDAT(IPOS+3)                                    RESULT   1526
               IF (IPBNO.NE.0.AND.IMAC.NE.0) THEN                       RESULT   1527
                  JM=JMDAT(IMAC)                                        RESULT   1528
                  JSTATE=JXIMO(IMAC)                                    RESULT   1529
                  JY=JVIMO(IMAC)                                        RESULT   1530
                  NLF=NOLD(IPBNO)                                       RESULT   1531
                  UID(1:2)=NDMC(IMAC)(3:4)                              RESULT   1532
                  MOTYPK=IDDAT(JM+1)                                    RESULT   1533
                  CMR=CDM(JY+8)                                         RESULT   1534
                  CMI=CDM(JY+9)                                         RESULT   1535
                  IF (MOTYPK.LT.10) THEN                                RESULT   1536
                     VOLTK=VOLT(IPBNO)                                  RESULT   1537
                  ELSE                                                  RESULT   1538
                     MOTYPK=MOTYPK-10                                   RESULT   1539
                     VOLTK=CMPLX(DDAT(JM+36),DDAT(JM+37))               RESULT   1540
                  END IF                                                RESULT   1541
C                  ET=CABS(VOLTK)                                       RESULT   1542
                  CT=SQRT(CMR**2+CMI**2)                                RESULT   1543
                  PRL=VREAL*CMR+VIMAG*CMI                               RESULT   1544
                  PIM=VIMAG*CMR-VREAL*CMI                               RESULT   1545
                  IF (MOTYPK.LE.3) THEN                                 RESULT   1546
                     SA=XSTATE(JSTATE+3)                                RESULT   1547
                     PGAP=XSTATE(JSTATE+2)*CMI+XSTATE(JSTATE+1)*CMR     RESULT   1548
                     BUF(ISCHAN+4)=SA                                   RESULT   1549
C/* TO BE IMPLEMENTED                                                   RESULT   1550
C*/                     BUF(ISCHAN+7)=PGAP                              RESULT   1551
                     ETR=DDAT(JM+18)*CMR-DDAT(JM+21)*CMI                RESULT   1552
     1                  +XSTATE(JSTATE+1)                               RESULT   1553
                     ETI=DDAT(JM+18)*CMI+DDAT(JM+21)*CMR                RESULT   1554
     1                  +XSTATE(JSTATE+2)                               RESULT   1555
                  ELSE                                                  RESULT   1556
                     SA=XSTATE(JSTATE+1)                                RESULT   1557
                     PGAP=VC1Q(JY+11)*CMI+VC1D(JY+10)*CMR               RESULT   1558
                     BUF(ISCHAN+4)=SA                                   RESULT   1559
C/* TO BE IMPLEMENTED                                                   RESULT   1560
C*/                     BUF(ISCHAN+7)=PGAP                              RESULT   1561
                     WS1=1.0/(GSM(JY+4)**2+BSM(JY+5)**2)                RESULT   1562
                     Z11=GSM(JY+4)*WS1                                  RESULT   1563
                     Z12=BSM(JY+5)*WS1                                  RESULT   1564
                     ETR=Z11*CMR-Z12*CMI                                RESULT   1565
                     ETI=Z12*CMR+Z11*CMI                                RESULT   1566
                  END IF                                                RESULT   1567
                  ET=SQRT(ETR*ETR+ETI*ETI)                              RESULT   1568
                  IF (LDEB) WRITE(IUD6,*) ETR, ETI, ET, CABS(VOLTK)     RESULT   1569
                  SA1=1.0-SA                                            RESULT   1570
                  ILTYPE=IDDAT(JM+5)                                    RESULT   1571
                  IF (ILTYPE.EQ.1) THEN                                 RESULT   1572
                     EXPN=DDAT(JM+7)                                    RESULT   1573
                     EXPM=DDAT(JM+8)                                    RESULT   1574
                     COFK1=DDAT(JM+9)                                   RESULT   1575
                     COFK2=DDAT(JM+10)                                  RESULT   1576
                     TLOAD=COFK1*SA1**EXPN+COFK2*ABS(SA)**EXPM          RESULT   1577
                  ELSE IF (ILTYPE.EQ.2) THEN                            RESULT   1578
                     ALL=DDAT(JM+7)                                     RESULT   1579
                     BLL=DDAT(JM+8)                                     RESULT   1580
                     CLL=DDAT(JM+9)                                     RESULT   1581
                     TLOAD=ALL*SA1**2+BLL*SA1+CLL                       RESULT   1582
                  ELSE IF (ILTYPE.EQ.3)THEN                             RESULT   1583
                     TLOAD=TLM(JY+2)                                    RESULT   1584
                  ELSE IF (ILTYPE.GT.3)THEN                             RESULT   1585
                     NR=IDDAT(JM+36)                                    RESULT   1586
                     ITQN=IDDAT(JM+37)+NR                               RESULT   1587
                     TLOAD=DDAT(ITQN)*DDAT(JM+11)/BASPC                 RESULT   1588
                  END IF                                                RESULT   1589
                  BUF(ISCHAN+1)=ET                                      RESULT   1590
                  BUF(ISCHAN+2)=PRL                                     RESULT   1591
                  BUF(ISCHAN+3)=PIM                                     RESULT   1592
                  IF (JSEM.EQ.9) THEN                                   RESULT   1593
                     BUF(ISCHAN+5)=CT                                   RESULT   1594
                     BUF(ISCHAN+6)=TLOAD                                RESULT   1595
                  END IF                                                RESULT   1596
                  IF (IPRTSW.EQ.1) THEN                                 RESULT   1597
                     IF ((IL+ISTART).GE.ILDEF) THEN                     RESULT   1598
                        IL=8+ISTART                                     RESULT   1599
                        IF (ISTART.EQ.0) CALL PAGE17                    RESULT   1600
                        ISTART=0                                        RESULT   1601
                        WRITE(IU17,1230) TS                             RESULT   1602
                     END IF                                             RESULT   1603
                     I3=IPBNO*3                                         RESULT   1604
                     WRITE(IU17,1240) NLF,INAME(I3-2),INAME(I3-1)       RESULT   1605
     1                               ,INAME(I3),UID,MOTYPK              RESULT   1606
     2                               ,(BUF(ISCHAN+LK),LK=1,4),CT        RESULT   1607
     3                               ,TLOAD,PGAP,XSTATE(JSTATE+1)       RESULT   1608
     4                               ,XSTATE(JSTATE+2),DDAT(JM+16)      RESULT   1609
     5                               ,DDAT(JM+17),DXM(JY+1)             RESULT   1610
                     IL=IL+1                                            RESULT   1611
                  END IF                                                RESULT   1612
C                                                                       RESULT   1613
C     NON-EXISTING MOTOR BUS                                            RESULT   1614
C                                                                       RESULT   1615
               ELSE                                                     RESULT   1616
C                                                                       RESULT   1617
                  BUF(ISCHAN+1)=0.0                                     RESULT   1618
                  BUF(ISCHAN+2)=0.0                                     RESULT   1619
                  BUF(ISCHAN+3)=0.0                                     RESULT   1620
                  BUF(ISCHAN+4)=0.0                                     RESULT   1621
                  IF (JSEM.EQ.9) THEN                                   RESULT   1622
                     BUF(ISCHAN+5)=0.0                                  RESULT   1623
                     BUF(ISCHAN+6)=0.0                                  RESULT   1624
                  END IF                                                RESULT   1625
               END IF                                                   RESULT   1626
               IPOS=IPOS+3                                              RESULT   1627
               IF (ICOUNT.LT.ICOUNX) GOTO 540                           RESULT   1628
            END IF                                                      RESULT   1629
 550     CONTINUE                                                       RESULT   1630
         IL=ILDEF                                                       RESULT   1631
      END IF                                                            RESULT   1632
CD                                                                      RESULT   1633
CD STEP 11. CALCULATE AND STORE SATURABLE REACTORS AND/OR               RESULT   1634
CD          STATIC VAR COMPENSATORS                                     RESULT   1635
CD                                                                      RESULT   1636
C                                                                       RESULT   1637
      IF(NSVCO.NE.0)THEN                                                RESULT   1638
      DO 570 K=1,NOPTR                                                  RESULT   1639
      IPOS=KOPTR(K)                                                     RESULT   1640
      JSEM=KOPDAT(IPOS+1)                                               RESULT   1641
      IF(JSEM.EQ.10)THEN                                                RESULT   1642
      ICOUNX=KOPDAT(IPOS+2)                                             RESULT   1643
      IPOS=IPOS+2                                                       RESULT   1644
      ICOUNT=0                                                          RESULT   1645
 560  ICOUNT=ICOUNT+1                                                   RESULT   1646
      IPBNO=KOPDAT(IPOS+1)                                              RESULT   1647
      ITFK=KOPDAT(IPOS+2)                                               RESULT   1648
      CALL UNPACK(UID,JJJ,ITFK)                                         RESULT   1649
      IMAC=KOPDAT(IPOS+3)                                               RESULT   1650
      ISCHAN=KOPDAT(IPOS+4)                                             RESULT   1651
      IF(IPBNO.NE.0.AND.IMAC.NE.0)THEN                                  RESULT   1652
         JS=JSDAT(IMAC)                                                 RESULT   1653
         JY=JVSVR(IMAC)                                                 RESULT   1654
         NRTYPN=IDDAT(JS+9)                                             RESULT   1655
C                                                                       RESULT   1656
C     SATURABLE REACTORS                                                RESULT   1657
C                                                                       RESULT   1658
         IF(NRTYPN.EQ.6)THEN                                            RESULT   1659
            VOLTK=VOLT(IPBNO)                                           RESULT   1660
            VMG=CABS(VOLTK)                                             RESULT   1661
            FACT=DDAT(JS+6)                                             RESULT   1662
            BLK=BSVC(JY+2)*FACT                                         RESULT   1663
            QSAT=BLK*VMG**2                                             RESULT   1664
            BUF(ISCHAN+1)=VMG                                           RESULT   1665
            BUF(ISCHAN+2)=VMG                                           RESULT   1666
            BUF(ISCHAN+3)=QSAT                                          RESULT   1667
            IF(IPRTSW.EQ.1)THEN                                         RESULT   1668
               IF((IL+ISTART).GE.ILDEF)THEN                             RESULT   1669
                  IL=8+ISTART                                           RESULT   1670
                  IF(ISTART.EQ.0) CALL PAGE17                           RESULT   1671
                  ISTART=0                                              RESULT   1672
                  WRITE(IU17,1200) TS                                   RESULT   1673
               ENDIF                                                    RESULT   1674
               NLF=NOLD(IPBNO)                                          RESULT   1675
               K3=IPBNO*3                                               RESULT   1676
               WRITE(IU17,1210) NLF,INAME(K3-2),INAME(K3-1),            RESULT   1677
     +         INAME(K3),NRTYPN,BUF(ISCHAN+3),UID,BLK                   RESULT   1678
               IL=IL+1                                                  RESULT   1679
            ENDIF                                                       RESULT   1680
C                                                                       RESULT   1681
         ELSEIF(NRTYPN.LE.5)THEN                                        RESULT   1682
C                                                                       RESULT   1683
C   STATIC COMPENSATOR                                                  RESULT   1684
C                                                                       RESULT   1685
            JSTATE=JXSVR(IMAC)                                          RESULT   1686
            L=IDDAT(JS+10)                                              RESULT   1687
            VOLTK=VOLT(IPBNO)                                           RESULT   1688
            VMG=CABS(VOLTK)                                             RESULT   1689
            BSVCN=BSVC(JY+2)/BASER(JY+4)                                RESULT   1690
            QSAT=BSVCN*VMG*VMG                                          RESULT   1691
            VOLTK=VOLT(L)                                               RESULT   1692
            VL=CABS(VOLTK)                                              RESULT   1693
            BUF(ISCHAN+1)=VMG                                           RESULT   1694
            BUF(ISCHAN+2)=VL                                            RESULT   1695
            BUF(ISCHAN+3)=QSAT                                          RESULT   1696
            IF(IPRTSW.EQ.1)THEN                                         RESULT   1697
               IF((IL+ISTART).GE.ILDEF)THEN                             RESULT   1698
                  IL=8+ISTART                                           RESULT   1699
                  IF(ISTART.EQ.0) CALL PAGE17                           RESULT   1700
                  ISTART=0                                              RESULT   1701
                  WRITE(IU17,1200) TS                                   RESULT   1702
               ENDIF                                                    RESULT   1703
               NLF=NOLD(IPBNO)                                          RESULT   1704
               K3=IPBNO*3                                               RESULT   1705
               WRITE(IU17,1210) NLF,INAME(K3-2),INAME(K3-1),            RESULT   1706
     +         INAME(K3),UID,NRTYPN,VMG,VL,QSAT,BSVCN                   RESULT   1707
               IL=IL+1                                                  RESULT   1708
            ENDIF                                                       RESULT   1709
         ENDIF                                                          RESULT   1710
C                                                                       RESULT   1711
C   NON-EXISTED SVC                                                     RESULT   1712
C                                                                       RESULT   1713
      ELSE                                                              RESULT   1714
         BUF(ISCHAN+1)=0.0                                              RESULT   1715
         BUF(ISCHAN+2)=0.0                                              RESULT   1716
         BUF(ISCHAN+3)=0.0                                              RESULT   1717
      ENDIF                                                             RESULT   1718
      IPOS=IPOS+4                                                       RESULT   1719
      IF(ICOUNT.LT.ICOUNX)GOTO 560                                      RESULT   1720
      ENDIF                                                             RESULT   1721
  570 CONTINUE                                                          RESULT   1722
         IL=ILDEF                                                       RESULT   1723
      ENDIF                                                             RESULT   1724
CD                                                                      RESULT   1725
CD STEP 12. PICK UP AND STORE USER DEFINED SVC VARIABLES                RESULT   1726
CD                                                                      RESULT   1727
C                                                                       RESULT   1728
      IF(NUSVCO.NE.0)THEN                                               RESULT   1729
         DO 565 K=1,NOPTR                                               RESULT   1730
         IPOS=KOPTR(K)                                                  RESULT   1731
         JSEM=KOPDAT(IPOS+1)                                            RESULT   1732
         IF(JSEM.EQ.22)THEN                                             RESULT   1733
            ICOUNX=KOPDAT(IPOS+2)                                       RESULT   1734
            IPOS=IPOS+2                                                 RESULT   1735
            ICOUNT=0                                                    RESULT   1736
  561       ICOUNT=ICOUNT+1                                             RESULT   1737
            IPBNO=KOPDAT(IPOS+1)                                        RESULT   1738
            ITFK=KOPDAT(IPOS+2)                                         RESULT   1739
            CALL UNPACK(UID,LITEM,ITFK)                                 RESULT   1740
            IMAC=KOPDAT(IPOS+3)                                         RESULT   1741
            ISCHAN=KOPDAT(IPOS+4)                                       RESULT   1742
            IF(IPBNO.NE.0.AND.IMAC.NE.0)THEN                            RESULT   1743
               JS=JSDAT(IMAC)                                           RESULT   1744
               NRTYPN=IDDAT(JS+9)                                       RESULT   1745
               IF(NRTYPN.EQ.50) THEN                                    RESULT   1746
                  JY=JVSVR(IMAC)                                        RESULT   1747
                  DO 562 JITEM=1,LITEM                                  RESULT   1748
                  JYPOS=KOPDAT(IPOS+JITEM+4)                            RESULT   1749
                  BUF(ISCHAN+JITEM)=YVAR(JY+JYPOS+8)                    RESULT   1750
  562             CONTINUE                                              RESULT   1751
                  IF(IPRTSW.EQ.1)THEN                                   RESULT   1752
                     IF((IL+ISTART).GE.ILDEF)THEN                       RESULT   1753
                        IL=8+ISTART                                     RESULT   1754
                        IF(ISTART.EQ.0) CALL PAGE17                     RESULT   1755
                        ISTART=0                                        RESULT   1756
                        WRITE(IU17,1460) TS                             RESULT   1757
                     ENDIF                                              RESULT   1758
                     NLF=NOLD(IPBNO)                                    RESULT   1759
                     K3=IPBNO*3                                         RESULT   1760
                     WRITE(IU17,1470)NLF,INAME(K3-2),INAME(K3-1)        RESULT   1761
     &               ,INAME(K3),UID                                     RESULT   1762
     &               ,(KOPDAT(IPOS+JIT+4),BUF(ISCHAN+JIT),JIT=1,LITEM)  RESULT   1763
                     IL=IL+1                                            RESULT   1764
                  ENDIF                                                 RESULT   1765
C                                                                       RESULT   1766
C   NON TYPE 50 SVC                                                     RESULT   1767
C                                                                       RESULT   1768
               ELSE                                                     RESULT   1769
                  DO 563 JITEM=1,LITEM                                  RESULT   1770
                  BUF(ISCHAN+JITEM)=0.0                                 RESULT   1771
  563             CONTINUE                                              RESULT   1772
               ENDIF                                                    RESULT   1773
C                                                                       RESULT   1774
C   NON-EXISTED SVC                                                     RESULT   1775
C                                                                       RESULT   1776
            ELSE                                                        RESULT   1777
               DO 564 JITEM=1,LITEM                                     RESULT   1778
               BUF(ISCHAN+JITEM)=0.0                                    RESULT   1779
  564          CONTINUE                                                 RESULT   1780
            ENDIF                                                       RESULT   1781
            IPOS=IPOS+4+LITEM                                           RESULT   1782
            IF(ICOUNT.LT.ICOUNX)GOTO 561                                RESULT   1783
         ENDIF                                                          RESULT   1784
  565    CONTINUE                                                       RESULT   1785
         IL=ILDEF                                                       RESULT   1786
      ENDIF                                                             RESULT   1787
CD                                                                      RESULT   1788
CD STEP 13. PICKUP AND STORE USER DEFINED RANI VARIABLES                RESULT   1789
CD                                                                      RESULT   1790
      IF(NURANO.NE.0)THEN                                               RESULT   1791
         DO 585 K=1,NOPTR                                               RESULT   1792
         IPOS=KOPTR(K)                                                  RESULT   1793
         JSEM=KOPDAT(IPOS+1)                                            RESULT   1794
         IF(JSEM.EQ.23)THEN                                             RESULT   1795
            ICOUNX=KOPDAT(IPOS+2)                                       RESULT   1796
            IPOS=IPOS+2                                                 RESULT   1797
            ICOUNT=0                                                    RESULT   1798
  581       ICOUNT=ICOUNT+1                                             RESULT   1799
            LITEM=KOPDAT(IPOS+2)                                        RESULT   1800
            ISCHAN=KOPDAT(IPOS+3)                                       RESULT   1801
            IMAC=KOPDAT(IPOS+1)                                         RESULT   1802
            JR=JRDAT(IMAC)                                              RESULT   1803
            IPBN1=IDDAT(JR+1)                                           RESULT   1804
            IPBN2=IDDAT(JR+2)                                           RESULT   1805
            IUID=IDDAT(JR+3)                                            RESULT   1806
            CALL UNPACK(UID,JJJ,IUID)                                   RESULT   1807
            IF(IPBN1.NE.0.AND.IPBN2.NE.0)THEN                           RESULT   1808
               JY=JVRAN(IMAC)                                           RESULT   1809
               NRTYPN=IDDAT(JR+4)                                       RESULT   1810
               IF(NRTYPN.EQ.50) THEN                                    RESULT   1811
                  DO 582 JITEM=1,LITEM                                  RESULT   1812
                  JYPOS=KOPDAT(IPOS+JITEM+3)                            RESULT   1813
                  BUF(ISCHAN+JITEM)=YVAR(JY+JYPOS+10)                   RESULT   1814
  582             CONTINUE                                              RESULT   1815
                  IF(IPRTSW.EQ.1)THEN                                   RESULT   1816
                     IF((IL+ISTART).GE.ILDEF)THEN                       RESULT   1817
                        IL=8+ISTART                                     RESULT   1818
                        IF(ISTART.EQ.0) CALL PAGE17                     RESULT   1819
                        ISTART=0                                        RESULT   1820
                        WRITE(IU17,1530) TS                             RESULT   1821
                     ENDIF                                              RESULT   1822
                     NLF1=NOLD(IPBN1)                                   RESULT   1823
                     NLF2=NOLD(IPBN2)                                   RESULT   1824
                     K3=IPBN1*3                                         RESULT   1825
                     L3=IPBN2*3                                         RESULT   1826
                     WRITE(IU17,1540)NLF1,INAME(K3-2),INAME(K3-1)       RESULT   1827
     &               ,INAME(K3),NLF2,INAME(L3-2),INAME(L3-1),INAME(L3)  RESULT   1828
     &               ,UID                                               RESULT   1829
     &               ,(KOPDAT(IPOS+JIT+3),BUF(ISCHAN+JIT),JIT=1,LITEM)  RESULT   1830
                     IL=IL+1                                            RESULT   1831
                  ENDIF                                                 RESULT   1832
               ELSE                                                     RESULT   1833
C                                                                       RESULT   1834
C  NON TYPE 50 RANI                                                     RESULT   1835
C                                                                       RESULT   1836
                  DO 583 JITEM=1,LITEM                                  RESULT   1837
                  BUF(ISCHAN+JITEM)=0.0                                 RESULT   1838
  583             CONTINUE                                              RESULT   1839
               ENDIF                                                    RESULT   1840
C                                                                       RESULT   1841
C   NON-EXISTED RANI                                                    RESULT   1842
C                                                                       RESULT   1843
            ELSE                                                        RESULT   1844
               DO 584 JITEM=1,LITEM                                     RESULT   1845
               BUF(ISCHAN+JITEM)=0.0                                    RESULT   1846
  584          CONTINUE                                                 RESULT   1847
            ENDIF                                                       RESULT   1848
            IPOS=IPOS+3+LITEM                                           RESULT   1849
            IF(ICOUNT.LT.ICOUNX)GOTO 581                                RESULT   1850
         ENDIF                                                          RESULT   1851
  585    CONTINUE                                                       RESULT   1852
         IL=ILDEF                                                       RESULT   1853
      ENDIF                                                             RESULT   1854
CD                                                                      RESULT   1855
CD STEP 14. PICKUP AND STORE USER DEFINED STC VARIABLES                 RESULT   1856
CD                                                                      RESULT   1857
      IF(NUSTCO.NE.0)THEN                                               RESULT   1858
         DO 595 K=1,NOPTR                                               RESULT   1859
         IPOS=KOPTR(K)                                                  RESULT   1860
         JSEM=KOPDAT(IPOS+1)                                            RESULT   1861
         IF(JSEM.EQ.24)THEN                                             RESULT   1862
            ICOUNX=KOPDAT(IPOS+2)                                       RESULT   1863
            IPOS=IPOS+2                                                 RESULT   1864
            ICOUNT=0                                                    RESULT   1865
  591       ICOUNT=ICOUNT+1                                             RESULT   1866
            LITEM=KOPDAT(IPOS+2)                                        RESULT   1867
            ISCHAN=KOPDAT(IPOS+3)                                       RESULT   1868
            IMAC=KOPDAT(IPOS+1)                                         RESULT   1869
            JR=JTPDAT(IMAC)                                             RESULT   1870
            IPBN1=IDDAT(JR+1)                                           RESULT   1871
            IPBN2=IDDAT(JR+2)                                           RESULT   1872
            IF(IPBN1.NE.0.AND.IPBN2.NE.0)THEN                           RESULT   1873
               NTTYPN=IDDAT(JR+4)                                       RESULT   1874
               IF(NTTYPN.EQ.50) THEN                                    RESULT   1875
                  JY=JVSTC(IMAC)                                        RESULT   1876
                  IUID=IDDAT(JR+3)                                      RESULT   1877
                  CALL UNPACK(UID,JJJ,IUID)                             RESULT   1878
                  DO 592 JITEM=1,LITEM                                  RESULT   1879
                  JYPOS=KOPDAT(IPOS+JITEM+3)                            RESULT   1880
                  BUF(ISCHAN+JITEM)=YVAR(JY+JYPOS+4)                    RESULT   1881
  592             CONTINUE                                              RESULT   1882
                  IF(IPRTSW.EQ.1)THEN                                   RESULT   1883
                     IF((IL+ISTART).GE.ILDEF)THEN                       RESULT   1884
                        IL=8+ISTART                                     RESULT   1885
                        IF(ISTART.EQ.0) CALL PAGE17                     RESULT   1886
                        ISTART=0                                        RESULT   1887
                        WRITE(IU17,1550) TS                             RESULT   1888
                     ENDIF                                              RESULT   1889
                     NLF1=NOLD(IPBN1)                                   RESULT   1890
                     NLF2=NOLD(IPBN2)                                   RESULT   1891
                     K3=IPBN1*3                                         RESULT   1892
                     L3=IPBN2*3                                         RESULT   1893
                     WRITE(IU17,1540)NLF1,INAME(K3-2),INAME(K3-1)       RESULT   1894
     &               ,INAME(K3)                                         RESULT   1895
     &               ,NLF2,INAME(L3-2),INAME(L3-1),INAME(L3),UID        RESULT   1896
     &               ,(KOPDAT(IPOS+JIT+3),BUF(ISCHAN+JIT),JIT=1,LITEM)  RESULT   1897
                     IL=IL+1                                            RESULT   1898
                  ENDIF                                                 RESULT   1899
C                                                                       RESULT   1900
C   NON TYPE 50 STC                                                     RESULT   1901
C                                                                       RESULT   1902
               ELSE                                                     RESULT   1903
                  DO 593 JITEM=1,LITEM                                  RESULT   1904
                  BUF(ISCHAN+JITEM)=0.0                                 RESULT   1905
  593             CONTINUE                                              RESULT   1906
               ENDIF                                                    RESULT   1907
C                                                                       RESULT   1908
C   NON-EXISTED STP                                                     RESULT   1909
C                                                                       RESULT   1910
            ELSE                                                        RESULT   1911
               DO 594 JITEM=1,LITEM                                     RESULT   1912
               BUF(ISCHAN+JITEM)=0.0                                    RESULT   1913
  594          CONTINUE                                                 RESULT   1914
            ENDIF                                                       RESULT   1915
            IPOS=IPOS+3+LITEM                                           RESULT   1916
            IF(ICOUNT.LT.ICOUNX)GOTO 591                                RESULT   1917
         ENDIF                                                          RESULT   1918
  595    CONTINUE                                                       RESULT   1919
         IL=ILDEF                                                       RESULT   1920
      ENDIF                                                             RESULT   1921
CD                                                                      RESULT   1922
CD STEP 15. PICK UP AND STORE USER DEFINED SPS VARIABLES                RESULT   1923
CD                                                                      RESULT   1924
      IF(NUSPSO.NE.0)THEN                                               RESULT   1925
         DO 605 K=1,NOPTR                                               RESULT   1926
         IPOS=KOPTR(K)                                                  RESULT   1927
         JSEM=KOPDAT(IPOS+1)                                            RESULT   1928
         IF(JSEM.EQ.25)THEN                                             RESULT   1929
            ICOUNX=KOPDAT(IPOS+2)                                       RESULT   1930
            IPOS=IPOS+2                                                 RESULT   1931
            ICOUNT=0                                                    RESULT   1932
  601       ICOUNT=ICOUNT+1                                             RESULT   1933
            LITEM=KOPDAT(IPOS+2)                                        RESULT   1934
            ISCHAN=KOPDAT(IPOS+3)                                       RESULT   1935
            IMAC=KOPDAT(IPOS+1)                                         RESULT   1936
            JR=JTPDAT(IMAC)                                             RESULT   1937
            IPBN1=IDDAT(JR+1)                                           RESULT   1938
            IPBN2=IDDAT(JR+2)                                           RESULT   1939
            IF(IPBN1.NE.0.AND.IPBN2.NE.0)THEN                           RESULT   1940
               NPTYPN=IDDAT(JR+5)                                       RESULT   1941
               IF(NPTYPN.EQ.50) THEN                                    RESULT   1942
                  JY=JVSPS(IMAC)                                        RESULT   1943
                  IUID=IDDAT(JR+3)                                      RESULT   1944
                  CALL UNPACK(UID,JJJ,IUID)                             RESULT   1945
                  DO 602 JITEM=1,LITEM                                  RESULT   1946
                  JYPOS=KOPDAT(IPOS+JITEM+3)                            RESULT   1947
                  BUF(ISCHAN+JITEM)=YVAR(JY+JYPOS+4)                    RESULT   1948
  602             CONTINUE                                              RESULT   1949
                  IF(IPRTSW.EQ.1)THEN                                   RESULT   1950
                     IF((IL+ISTART).GE.ILDEF)THEN                       RESULT   1951
                        IL=8+ISTART                                     RESULT   1952
                        IF(ISTART.EQ.0) CALL PAGE17                     RESULT   1953
                        ISTART=0                                        RESULT   1954
                        WRITE(IU17,1560) TS                             RESULT   1955
                     ENDIF                                              RESULT   1956
                     NLF1=NOLD(IPBN1)                                   RESULT   1957
                     NLF2=NOLD(IPBN2)                                   RESULT   1958
                     K3=IPBN1*3                                         RESULT   1959
                     L3=IPBN2*3                                         RESULT   1960
                     WRITE(IU17,1540)NLF1,INAME(K3-2),INAME(K3-1)       RESULT   1961
     &               ,INAME(K3)                                         RESULT   1962
     &               ,NLF2,INAME(L3-2),INAME(L3-1),INAME(L3),UID        RESULT   1963
     &               ,(KOPDAT(IPOS+JIT+3),BUF(ISCHAN+JIT),JIT=1,LITEM)  RESULT   1964
                     IL=IL+1                                            RESULT   1965
                  ENDIF                                                 RESULT   1966
C                                                                       RESULT   1967
C   NON TYPE 50 SPS                                                     RESULT   1968
C                                                                       RESULT   1969
               ELSE                                                     RESULT   1970
                  DO 603 JITEM=1,LITEM                                  RESULT   1971
                  BUF(ISCHAN+JITEM)=0.0                                 RESULT   1972
  603             CONTINUE                                              RESULT   1973
               ENDIF                                                    RESULT   1974
C                                                                       RESULT   1975
C   NON-EXISTED STP                                                     RESULT   1976
C                                                                       RESULT   1977
            ELSE                                                        RESULT   1978
               DO 604 JITEM=1,LITEM                                     RESULT   1979
               BUF(ISCHAN+JITEM)=0.0                                    RESULT   1980
  604          CONTINUE                                                 RESULT   1981
            ENDIF                                                       RESULT   1982
            IPOS=IPOS+3+LITEM                                           RESULT   1983
            IF(ICOUNT.LT.ICOUNX)GOTO 601                                RESULT   1984
         ENDIF                                                          RESULT   1985
  605    CONTINUE                                                       RESULT   1986
         IL=ILDEF                                                       RESULT   1987
      ENDIF                                                             RESULT   1988
CD                                                                      RESULT   1989
CD STEP 16. PICK UP AND STORE USER DEFINED SDB VARIABLES                RESULT   1990
CD                                                                      RESULT   1991
      IF(NUSDBO.NE.0)THEN                                               RESULT   1992
         DO 615 K=1,NOPTR                                               RESULT   1993
         IPOS=KOPTR(K)                                                  RESULT   1994
         JSEM=KOPDAT(IPOS+1)                                            RESULT   1995
         IF(JSEM.EQ.26)THEN                                             RESULT   1996
            ICOUNX=KOPDAT(IPOS+2)                                       RESULT   1997
            IPOS=IPOS+2                                                 RESULT   1998
            ICOUNT=0                                                    RESULT   1999
  611       ICOUNT=ICOUNT+1                                             RESULT   2000
            IPBNO=KOPDAT(IPOS+1)                                        RESULT   2001
            LITEM=KOPDAT(IPOS+3)                                        RESULT   2002
            ISCHAN=KOPDAT(IPOS+4)                                       RESULT   2003
            IF(IPBNO.NE.0)THEN                                          RESULT   2004
               IMAC=KOPDAT(IPOS+2)                                      RESULT   2005
               JS=JDDAT(IMAC)                                           RESULT   2006
               NRTYPN=IDDAT(JS+2)                                       RESULT   2007
               IF(NRTYPN.EQ.50) THEN                                    RESULT   2008
                  JY=JVSDB(IMAC)                                        RESULT   2009
                  DO 612 JITEM=1,LITEM                                  RESULT   2010
                  JYPOS=KOPDAT(IPOS+JITEM+4)                            RESULT   2011
                  BUF(ISCHAN+JITEM)=YVAR(JY+JYPOS+4)                    RESULT   2012
  612             CONTINUE                                              RESULT   2013
                  IF(IPRTSW.EQ.1)THEN                                   RESULT   2014
                     IF((IL+ISTART).GE.ILDEF)THEN                       RESULT   2015
                        IL=8+ISTART                                     RESULT   2016
                        IF(ISTART.EQ.0) CALL PAGE17                     RESULT   2017
                        ISTART=0                                        RESULT   2018
                        WRITE(IU17,1570) TS                             RESULT   2019
                     ENDIF                                              RESULT   2020
                     NLF=NOLD(IPBNO)                                    RESULT   2021
                     K3=IPBNO*3                                         RESULT   2022
                     WRITE(IU17,1470)NLF,INAME(K3-2),INAME(K3-1)        RESULT   2023
     &               ,INAME(K3),UID                                     RESULT   2024
     &               ,(KOPDAT(IPOS+JIT+4),BUF(ISCHAN+JIT),JIT=1,LITEM)  RESULT   2025
                     IL=IL+1                                            RESULT   2026
                  ENDIF                                                 RESULT   2027
C                                                                       RESULT   2028
C   NON TYPE 50 SDB                                                     RESULT   2029
C                                                                       RESULT   2030
               ELSE                                                     RESULT   2031
                  DO 613 JITEM=1,LITEM                                  RESULT   2032
                  BUF(ISCHAN+JITEM)=0.0                                 RESULT   2033
  613             CONTINUE                                              RESULT   2034
               ENDIF                                                    RESULT   2035
C                                                                       RESULT   2036
C   NON-EXISTED SDB                                                     RESULT   2037
C                                                                       RESULT   2038
            ELSE                                                        RESULT   2039
               DO 614 JITEM=1,LITEM                                     RESULT   2040
               BUF(ISCHAN+JITEM)=0.0                                    RESULT   2041
  614          CONTINUE                                                 RESULT   2042
            ENDIF                                                       RESULT   2043
            IPOS=IPOS+4+LITEM                                           RESULT   2044
            IF(ICOUNT.LT.ICOUNX)GOTO 611                                RESULT   2045
         ENDIF                                                          RESULT   2046
  615    CONTINUE                                                       RESULT   2047
      IL=ILDEF                                                          RESULT   2048
      ENDIF                                                             RESULT   2049
C                                                                       RESULT   2050
CD                                                                      RESULT   2051
CD STEP 17. COMPUTE AND STORE CURRENT FOR NON-LINEAR LOADS              RESULT   2052
CD                                                                      RESULT   2053
      IF(NLOADO.NE.0)THEN                                               RESULT   2054
      DO 640 K=1,NOPTR                                                  RESULT   2055
      IPOS=KOPTR(K)                                                     RESULT   2056
      JSEM=KOPDAT(IPOS+1)                                               RESULT   2057
      IF(JSEM.EQ.13)THEN                                                RESULT   2058
      ICOUNX=KOPDAT(IPOS+2)                                             RESULT   2059
      IPOS=IPOS+2                                                       RESULT   2060
      ICOUNT=0                                                          RESULT   2061
  620 ICOUNT=ICOUNT+1                                                   RESULT   2062
      IPBNO=KOPDAT(IPOS+1)                                              RESULT   2063
      KTHL=KOPDAT(IPOS+2)                                               RESULT   2064
      ISHIFT=KTHL-1                                                     RESULT   2065
      ISCHAN=KOPDAT(IPOS+3)                                             RESULT   2066
      NCOMP=KOPDAT(IPOS+4)                                              RESULT   2067
      IF(IPBNO.EQ.0.OR.KTHL.EQ.0)THEN                                   RESULT   2068
C                                                                       RESULT   2069
C NON EXIXTED LOAD BUS                                                  RESULT   2070
C                                                                       RESULT   2071
      BUF(ISCHAN+1)=0.0                                                 RESULT   2072
      BUF(ISCHAN+2)=0.0                                                 RESULT   2073
      BUF(ISCHAN+3)=0.0                                                 RESULT   2074
      BUF(ISCHAN+4)=0.0                                                 RESULT   2075
      BUF(ISCHAN+5)=0.0                                                 RESULT   2076
C                                                                       RESULT   2077
      ELSE                                                              RESULT   2078
C                                                                       RESULT   2079
      VOLTK=VOLT(IPBNO)                                                 RESULT   2080
      VMG=CABS(VOLTK)                                                   RESULT   2081
C                                                                       RESULT   2082
C--  IF BUS VOLTAGE MAGNITUDE GREATER THAN ZERO, CALCULATE CURRENT      RESULT   2083
C    OTHERWISE SET CURRENT TO ZERO                                      RESULT   2084
C                                                                       RESULT   2085
      CDLI=0.0                                                          RESULT   2086
      CQLI=0.0                                                          RESULT   2087
      CMW=0.0                                                           RESULT   2088
      CMX=0.0                                                           RESULT   2089
C                                                                       RESULT   2090
      IF(VMG.GT.0.0)THEN                                                RESULT   2091
C                                                                       RESULT   2092
C--  RECOVER THE POINTER TO "DDAT"                                      RESULT   2093
C                                                                       RESULT   2094
C                                                                       RESULT   2095
C     COMPUTE CURRENT FOR NON-LINEAR LOAD BUSES                         RESULT   2096
C                                                                       RESULT   2097
C      NTYPE =1 CONST. CUR  ,  NTYPE=2  CONST. MVA,                     RESULT   2098
C                                                                       RESULT   2099
C      NTYPE=3 VOLT-EXP     ,  NTYPE=4 COMP. LOAD                       RESULT   2100
C                                                                       RESULT   2101
         DO 315 ICOMP=1,NCOMP                                           RESULT   2102
          ISHIFT=ISHIFT+1                                               RESULT   2103
          NTYPE=NLTYPE(ISHIFT)                                          RESULT   2104
          JNL=JDNLL(ISHIFT)                                             RESULT   2105
C                                                                       RESULT   2106
          GOTO (330,340,350,370)NTYPE                                   RESULT   2107
C                                                                       RESULT   2108
C        FOR CONSTANT CURRENT LOAD REPRESENTATION                       RESULT   2109
C                                                                       RESULT   2110
 330     CONTINUE                                                       RESULT   2111
C                                                                       RESULT   2112
              IF(VMG.LE.VTHZH)THEN                                      RESULT   2113
               CDLI=CDLI-(DDAT(JNL+4)*VREAL-DDAT(JNL+5)*VIMAG)          RESULT   2114
               CQLI=CQLI-(DDAT(JNL+4)*VIMAG+DDAT(JNL+5)*VREAL)          RESULT   2115
               CMW=CMW+DDAT(JNL+4)*VMG*VMG                              RESULT   2116
               CMX=CMX+DDAT(JNL+5)*VMG*VMG                              RESULT   2117
              ELSE                                                      RESULT   2118
               CD1=(DDAT(JNL+2)*VREAL+DDAT(JNL+3)*VIMAG)/VMG            RESULT   2119
               CQ1=(DDAT(JNL+2)*VIMAG-DDAT(JNL+3)*VREAL)/VMG            RESULT   2120
               CDLI=CDLI-CD1                                            RESULT   2121
               CQLI=CQLI-CQ1                                            RESULT   2122
               CMW=CMW+(VREAL*CD1+VIMAG*CQ1)                            RESULT   2123
               CMX=CMX+(VIMAG*CD1-VREAL*CQ1)                            RESULT   2124
              ENDIF                                                     RESULT   2125
C                                                                       RESULT   2126
           GOTO 315                                                     RESULT   2127
C                                                                       RESULT   2128
C         CONSTANT MVA LOAD REPRESENTATION                              RESULT   2129
C                                                                       RESULT   2130
 340      CONTINUE                                                      RESULT   2131
C                                                                       RESULT   2132
                   CMW1=DDAT(JNL+2)                                     RESULT   2133
                   CMX1=DDAT(JNL+3)                                     RESULT   2134
                   CMW=CMW+CMW1                                         RESULT   2135
                   CMX=CMX+CMX1                                         RESULT   2136
                   CD1=(CMW1*VREAL+CMX1*VIMAG)                          RESULT   2137
                   CQ1=(CMW1*VIMAG-CMX1*VREAL)                          RESULT   2138
C                                                                       RESULT   2139
                 IF(VMG.LE.VTHZH)THEN                                   RESULT   2140
C                                                                       RESULT   2141
C  CURRENT DUE TO THE CONSTANT Z                                        RESULT   2142
C                                                                       RESULT   2143
                   CDLI=CDLI-CD1/DDAT(JNL+4)                            RESULT   2144
                   CQLI=CQLI-CQ1/DDAT(JNL+4)                            RESULT   2145
                 ELSE                                                   RESULT   2146
                   VMG1=VMG*VMG                                         RESULT   2147
                   CDLI=CDLI-CD1/VMG1                                   RESULT   2148
                   CQLI=CQLI-CQ1/VMG1                                   RESULT   2149
                 ENDIF                                                  RESULT   2150
C--                                                                     RESULT   2151
      GOTO 315                                                          RESULT   2152
C                                                                       RESULT   2153
C   VOLTAGE EXP LOAD                                                    RESULT   2154
C                                                                       RESULT   2155
 350   CONTINUE                                                         RESULT   2156
C                                                                       RESULT   2157
C     IF BUS VOLTAGE MAGNITUDE GREATER THAN ZERO, CALCULATE CURRENT     RESULT   2158
C     OTHERWISE SET CURRENT TO ZERO                                     RESULT   2159
C                                                                       RESULT   2160
C--  RECOVER THE POINTER TO "DDAT"                                      RESULT   2161
C                                                                       RESULT   2162
      JJ=IDDAT(JNL+1)                                                   RESULT   2163
      ITERMP=ITERML(JJ,1)                                               RESULT   2164
      ITERMQ=ITERML(JJ,2)                                               RESULT   2165
      DEF=DDAT(JNL+8)                                                   RESULT   2166
C                                                                       RESULT   2167
C--  ACCOUNT FOR THE VOLTAGE EFFECT ON EXPONENTIAL ADJUSTMENT           RESULT   2168
C                                                                       RESULT   2169
      IF(VMG.LT.VTHZH)THEN                                              RESULT   2170
         IVMG=.TRUE.                                                    RESULT   2171
         VMNL=DDAT(JNL+3)                                               RESULT   2172
         VMGL=VMG-VTHZL                                                 RESULT   2173
         IF(VMGL.LT.0.0) VMGL=0.0                                       RESULT   2174
         VTHZ=VTHZH-VTHZL                                               RESULT   2175
         IF(VTHZ.LE.0.0)THEN                                            RESULT   2176
         VFACT=0.0                                                      RESULT   2177
         ELSE                                                           RESULT   2178
         VFACT=VMGL/VTHZ                                                RESULT   2179
         ENDIF                                                          RESULT   2180
      ELSE                                                              RESULT   2181
         IVMG=.FALSE.                                                   RESULT   2182
      ENDIF                                                             RESULT   2183
C                                                                       RESULT   2184
C--  CURRENT COMPUTATION                                                RESULT   2185
C                                                                       RESULT   2186
      JL=JNL+10                                                         RESULT   2187
C                                                                       RESULT   2188
C--  ACCOUNT FOR THE TERMS IN P                                         RESULT   2189
C                                                                       RESULT   2190
      IF(ITERMP.EQ.0)THEN                                               RESULT   2191
         CMW1=0.0                                                       RESULT   2192
         JL=JL-4                                                        RESULT   2193
      ELSE                                                              RESULT   2194
         APPWR=DDAT(JL+2)                                               RESULT   2195
         CKMW=DDAT(JL+4)                                                RESULT   2196
         IF(IVMG.AND.IDDAT(JL+2).NE.0)THEN                              RESULT   2197
         APPWR=APPWR*VFACT                                              RESULT   2198
         CKMW=CKMW*VMNL**(DDAT(JL+2)-APPWR)                             RESULT   2199
         ENDIF                                                          RESULT   2200
         FKMW=1.0+DEF*DDAT(JL+3)                                        RESULT   2201
         CMW1=CKMW*FKMW*VMG**(APPWR+1.0)                                RESULT   2202
         IF(ITERMP.EQ.2)THEN                                            RESULT   2203
         JL=JL+4                                                        RESULT   2204
         APPWR=DDAT(JL+2)                                               RESULT   2205
         CKMW=DDAT(JL+4)                                                RESULT   2206
         IF(IVMG.AND.IDDAT(JL+2).NE.0)THEN                              RESULT   2207
         APPWR=APPWR*VFACT                                              RESULT   2208
         CKMW=CKMW*VMNL**(DDAT(JL+2)-APPWR)                             RESULT   2209
         ENDIF                                                          RESULT   2210
         FKMW=1.0+DEF*DDAT(JL+3)                                        RESULT   2211
         CMW1=CMW1+CKMW*FKMW*VMG**(APPWR+1.0)                           RESULT   2212
         ENDIF                                                          RESULT   2213
      ENDIF                                                             RESULT   2214
C                                                                       RESULT   2215
C--  ACCOUNT FOR TERMS IN Q                                             RESULT   2216
C                                                                       RESULT   2217
      IF(ITERMQ.EQ.0)THEN                                               RESULT   2218
         CMX1=0.0                                                       RESULT   2219
      ELSE                                                              RESULT   2220
         JL=JL+4                                                        RESULT   2221
         AQPWR=DDAT(JL+2)                                               RESULT   2222
         CKMX=DDAT(JL+4)                                                RESULT   2223
         IF(IVMG.AND.IDDAT(JL+2).NE.0)THEN                              RESULT   2224
         AQPWR=AQPWR*VFACT                                              RESULT   2225
         CKMW=CKMW*VMNL**(DDAT(JL+2)-AQPWR)                             RESULT   2226
         ENDIF                                                          RESULT   2227
         FKMX=1.0+DEF*DDAT(JL+3)                                        RESULT   2228
         CMX1=CKMX*FKMX*VMG**(AQPWR+1.0)                                RESULT   2229
         IF(ITERMQ.EQ.2)THEN                                            RESULT   2230
         JL=JL+4                                                        RESULT   2231
         AQPWR=DDAT(JL+2)                                               RESULT   2232
         CKMX=DDAT(JL+4)                                                RESULT   2233
         IF(IVMG.AND.IDDAT(JL+2).NE.0)THEN                              RESULT   2234
         AQPWR=AQPWR*VFACT                                              RESULT   2235
         CKMW=CKMW*VMNL**(DDAT(JL+2)-AQPWR)                             RESULT   2236
         ENDIF                                                          RESULT   2237
         FKMX=1.0+DEF*DDAT(JL+3)                                        RESULT   2238
         CMX1=CMX1+CKMX*FKMX*VMG**(AQPWR+1.0)                           RESULT   2239
         ENDIF                                                          RESULT   2240
      ENDIF                                                             RESULT   2241
C                                                                       RESULT   2242
C--  EVALUATE THE NON-LINEAR LOAD CURRENT                               RESULT   2243
C                                                                       RESULT   2244
      CDLI=CDLI+(-CMW1*VREAL-CMX1*VIMAG)/VMG                            RESULT   2245
      CQLI=CQLI+(-CMW1*VIMAG+CMX1*VREAL)/VMG                            RESULT   2246
      CMW=CMW+CMW1*VMG                                                  RESULT   2247
      CMX=CMX+CMX1*VMG                                                  RESULT   2248
C                                                                       RESULT   2249
      GOTO 315                                                          RESULT   2250
C                                                                       RESULT   2251
C     FOR COMPOSITE LOAD REPRESENTATION                                 RESULT   2252
C                                                                       RESULT   2253
 370  CONTINUE                                                          RESULT   2254
C                                                                       RESULT   2255
C                                                                       RESULT   2256
C     IF BUS VOLTAGE MAGNITUDE GREATER THAN ZERO, CALCULATE CURRENT     RESULT   2257
C     OTHERWISE SET CURRENT TO ZERO                                     RESULT   2258
C                                                                       RESULT   2259
            CD1=0.0                                                     RESULT   2260
            CQ1=0.0                                                     RESULT   2261
C                                                                       RESULT   2262
C     GET DATA AT BAR BUS                                               RESULT   2263
C                                                                       RESULT   2264
            RTB=DDAT(JNL+1)                                             RESULT   2265
            XTB=DDAT(JNL+2)                                             RESULT   2266
            GKKB=DDAT(JNL+4)                                            RESULT   2267
            BKKB=DDAT(JNL+5)                                            RESULT   2268
            VBAR2=DDAT(JNL+6)                                           RESULT   2269
            VBARVR=DDAT(JNL+7)                                          RESULT   2270
            VBARVI=DDAT(JNL+8)                                          RESULT   2271
            CBARVR=VBARVR*RTB-VBARVI*XTB                                RESULT   2272
            CBARVI=VBARVR*XTB+VBARVI*RTB                                RESULT   2273
            VBARR=VREAL*VBARVR-VIMAG*VBARVI                             RESULT   2274
            VBARI=VREAL*VBARVI+VIMAG*VBARVR                             RESULT   2275
            VBAR=SQRT(VBAR2)                                            RESULT   2276
            JL=JNL+11                                                   RESULT   2277
C                                                                       RESULT   2278
C     ACCOUNT FOR THE VOLTAGE EFFECT ON EACH CLOAD COMPONENT            RESULT   2279
C                                                                       RESULT   2280
            VBARRK=VBARR                                                RESULT   2281
            VBARIK=VBARI                                                RESULT   2282
C                                                                       RESULT   2283
            IF(VBARRK.LE.0..AND.VBARIK.LE.0.)GOTO 315                   RESULT   2284
            VBARK2=VBARRK*VBARRK+VBARIK*VBARIK                          RESULT   2285
            VBARK=SQRT(VBARK2)                                          RESULT   2286
            IF(VBARK2.NE.0)THEN                                         RESULT   2287
              VBVBK2=VBAR2/VBARK2                                       RESULT   2288
            ELSE                                                        RESULT   2289
              VBVBK2=1.0                                                RESULT   2290
            ENDIF                                                       RESULT   2291
            VBVBK=SQRT(VBVBK2)                                          RESULT   2292
            GKVRB=GKKB*VBARRK                                           RESULT   2293
            GKVIB=GKKB*VBARIK                                           RESULT   2294
            BKVRB=-BKKB*VBARRK                                          RESULT   2295
            BKVIB=-BKKB*VBARIK                                          RESULT   2296
C                                                                       RESULT   2297
C ==============================================================        RESULT   2298
C                                                                       RESULT   2299
C     ALOAD MOTOR                                                       RESULT   2300
C-                                      LARGE MOTOR                     RESULT   2301
            NLF=NOLD(IPBNO)                                             RESULT   2302
            KK=NLFLMB(NLF)                                              RESULT   2303
            IF(KK.EQ.0)GOTO 770                                         RESULT   2304
            IF(NMOLD(KK).EQ.K)THEN                                      RESULT   2305
              ASSIGN 740 TO I700                                        RESULT   2306
              GOTO 730                                                  RESULT   2307
  740         CONTINUE                                                  RESULT   2308
            ENDIF                                                       RESULT   2309
C                                                                       RESULT   2310
C-                                      SMALL MOTOR                     RESULT   2311
  770       CONTINUE                                                    RESULT   2312
            NLF=NOLD(IPBNO)                                             RESULT   2313
            KK=NLFSMB(NLF)                                              RESULT   2314
            IF(KK.EQ.0)GOTO 760                                         RESULT   2315
            IF(NMOLD(KK).EQ.K)THEN                                      RESULT   2316
              ASSIGN 750 TO I700                                        RESULT   2317
              GOTO 730                                                  RESULT   2318
  750         CONTINUE                                                  RESULT   2319
            ENDIF                                                       RESULT   2320
            GOTO 760                                                    RESULT   2321
C                                                                       RESULT   2322
C     COMPUTE TERMINAL CURRENT FOR INDUCTION MOTOR(S)                   RESULT   2323
C                                                                       RESULT   2324
  730       CONTINUE                                                    RESULT   2325
            JY=JVIMO(KK)                                                RESULT   2326
            CD1=CDM(JY+8)+CD1                                           RESULT   2327
            CQ1=CQM(JY+9)+CQ1                                           RESULT   2328
C                                                                       RESULT   2329
            GOTO I700                                                   RESULT   2330
C                                                                       RESULT   2331
C    END OF ALOAD MOTOR                                                 RESULT   2332
C  =================================================================    RESULT   2333
C                                                                       RESULT   2334
  760     CONTINUE                                                      RESULT   2335
            FCI=1.0-VBVBK                                               RESULT   2336
            FCP=1.0-VBVBK2                                              RESULT   2337
C                                                                       RESULT   2338
  761     JTYPE=IDDAT(JL+1)                                             RESULT   2339
          IF(JTYPE.EQ.0)GOTO 769                                        RESULT   2340
C                                                                       RESULT   2341
          GOTO(762,764,766,768)JTYPE                                    RESULT   2342
C                                                                       RESULT   2343
 762      CONTINUE                                                      RESULT   2344
C-                                      DISCHARGE LIGHTING              RESULT   2345
C                                                                       RESULT   2346
              CLDLP=IDDAT(JL+2)/100.                                    RESULT   2347
              PK1=DDAT(JL+3)                                            RESULT   2348
              PK2=DDAT(JL+4)                                            RESULT   2349
              QK=DDAT(JL+5)                                             RESULT   2350
              JL=JL+6                                                   RESULT   2351
C                                                                       RESULT   2352
              GRAT=VBARVR*GKKB-VBARVI*BKKB                              RESULT   2353
              BRAT=VBARVI*GKKB+VBARVR*BKKB                              RESULT   2354
              QCV=-0.435890*CLDLP*GRAT/BRAT                             RESULT   2355
              IF(VBARK.GT.0.75)THEN                                     RESULT   2356
                PCI=CLDLP*PK2*VBAR                                      RESULT   2357
                PCP=CLDLP*(1.0-PK2*VBAR)                                RESULT   2358
                FCVDL=1.0-VBVBK**(2.0-QK)                               RESULT   2359
                CD1=CD1+(PCI*FCI+PCP*FCP)*GKVRB+QCV*BKVIB*FCVDL         RESULT   2360
                CQ1I=CQ1+(PCI*FCI+PCP*FCP)*GKVIB-QCV*BKVRB*FCVDL        RESULT   2361
              ELSE                                                      RESULT   2362
                IF(VBARK.GT.0.65)THEN                                   RESULT   2363
                PCI1=CLDLP*(PK1-PK2)*(VBAR-0.75)                        RESULT   2364
                PCI=CLDLP*PK1*VBAR                                      RESULT   2365
                PCP=CLDLP*((1.0-PK2*VBAR)-0.75*(PK1-PK2))               RESULT   2366
                FCVDL=1.0-VBVBK**(2.0-QK)                               RESULT   2367
                CD1=CD1+(PCI*FCI+PCP*FCP-PCI1)*GKVRB+QCV*BKVIB*FCVDL    RESULT   2368
                CQ1=CQ1+(PCI*FCI+PCP*FCP-PCI1)*GKVIB-QCV*BKVRB*FCVDL    RESULT   2369
                ELSE                                                    RESULT   2370
                CD1=CD1+GKVRB*CLDLP+BKVIB*QCV                           RESULT   2371
                CQ1=CQ1+GKVIB*CLDLP-BKVRB*QCV                           RESULT   2372
                ENDIF                                                   RESULT   2373
              ENDIF                                                     RESULT   2374
C                                                                       RESULT   2375
              GOTO 761                                                  RESULT   2376
C                                                                       RESULT   2377
 764         CONTINUE                                                   RESULT   2378
C-                                      TRANSFORMER SATURATION          RESULT   2379
C                                                                       RESULT   2380
              CLTSQ=IDDAT(JL+2)/100.                                    RESULT   2381
              TV1=DDAT(JL+3)                                            RESULT   2382
              TG1=1.0/DDAT(JL+4)                                        RESULT   2383
              TG2=1.0/DDAT(JL+5)                                        RESULT   2384
              TG12=TG2-TG1                                              RESULT   2385
              JL=JL+6                                                   RESULT   2386
C                                                                       RESULT   2387
              IF(VBARK.LE.TV1)THEN                                      RESULT   2388
                IF(VBAR.GT.TV1)QCI=1.0-TV1/VBARK                        RESULT   2389
              ELSE                                                      RESULT   2390
                IF(VBAR.GT.TV1)THEN                                     RESULT   2391
                  QCI=TV1*(1.0-VBVBK)/VBAR                              RESULT   2392
                ELSE                                                    RESULT   2393
                  QCI=TV1/VBAR-1.0                                      RESULT   2394
                ENDIF                                                   RESULT   2395
              ENDIF                                                     RESULT   2396
              QCI=QCI*TG12                                              RESULT   2397
              CD1=CD1-QCI*VBARIK                                        RESULT   2398
              CQ1=CQ1+QCI*VBARRK                                        RESULT   2399
            GOTO 761                                                    RESULT   2400
C                                                                       RESULT   2401
 766        CONTINUE                                                    RESULT   2402
C-                                      CONSTANT MVA                    RESULT   2403
C                                                                       RESULT   2404
              CLCPP=IDDAT(JL+2)/100.                                    RESULT   2405
              CLCPQ=IDDAT(JL+3)/100.                                    RESULT   2406
              JL=JL+5                                                   RESULT   2407
C                                                                       RESULT   2408
              IF(VBARK.GT.VTHZH)THEN                                    RESULT   2409
                PCP=CLCPP                                               RESULT   2410
                QCP=CLCPQ                                               RESULT   2411
                CD1=CD1+(PCP*GKVRB+QCP*BKVIB)*FCP                       RESULT   2412
                CQ1=CQ1+(PCP*GKVIB-QCP*BKVRB)*FCP                       RESULT   2413
              ELSE                                                      RESULT   2414
                IF(VBARK.GT.VTHZL)THEN                                  RESULT   2415
                  PCP=CLCPP                                             RESULT   2416
                  QCP=CLCPQ                                             RESULT   2417
                  VKP=2.0*(VBARK-VTHZL)/(VTHZH-VTHZL)                   RESULT   2418
                  FCVCP=1.0-VBVBK**VKP                                  RESULT   2419
                  CD1=CD1+(PCP*GKVRB+QCP*BKVIB)*FCVCP                   RESULT   2420
                  CQ1=CQ1+(PCP*GKVIB-QCP*BKVRB)*FCVCP                   RESULT   2421
                ENDIF                                                   RESULT   2422
              ENDIF                                                     RESULT   2423
            GOTO 761                                                    RESULT   2424
C                                                                       RESULT   2425
 768        CONTINUE                                                    RESULT   2426
C-                                      REMANING LOAD                   RESULT   2427
C                                                                       RESULT   2428
              CLRMP=DDAT(JL+2)/100.                                     RESULT   2429
              CLRMQ=DDAT(JL+3)/100.                                     RESULT   2430
              RMKP=DDAT(JL+4)                                           RESULT   2431
              JL=JL+6                                                   RESULT   2432
C                                                                       RESULT   2433
              IF(VBARK.GT.VTHZH)THEN                                    RESULT   2434
                PCV=CLRMP                                               RESULT   2435
                IF(RMKP.EQ.2.0)THEN                                     RESULT   2436
                  FCVRM=0.0                                             RESULT   2437
                ELSE                                                    RESULT   2438
                  FCVRM=1.0-VBVBK**(2.0-RMKP)                           RESULT   2439
                ENDIF                                                   RESULT   2440
                CD1=CD1+PCV*GKVRB*FCVRM                                 RESULT   2441
                CQ1=CQ1+PCV*GKVIB*FCVRM                                 RESULT   2442
              ELSE                                                      RESULT   2443
                IF(VBARK.GT.VTHZL)THEN                                  RESULT   2444
                  PCV=CLRMP                                             RESULT   2445
                  VKP=(2.0-RMKP)*(VBARK-VTHZL)/(VTHZH-VTHZL)            RESULT   2446
                  FCVRM=1.0-VBVBK**VKP                                  RESULT   2447
                  CD1=CD1+PCV*GKVRB*FCVRM                               RESULT   2448
                  CQ1=CQ1+PCV*GKVIB*FCVRM                               RESULT   2449
                ENDIF                                                   RESULT   2450
              ENDIF                                                     RESULT   2451
C                                                                       RESULT   2452
              GOTO 761                                                  RESULT   2453
C                                                                       RESULT   2454
 769        CONTINUE                                                    RESULT   2455
C                                                                       RESULT   2456
            CMW=CMW+(VREAL*CD1+VIMAG*CQ1)                               RESULT   2457
            CMX=CMX+(VIMAG*CD1-VREAL*CQ1)                               RESULT   2458
            CDLI=CD1+CDLI                                               RESULT   2459
            CQLI=CQ1+CQLI                                               RESULT   2460
C                                                                       RESULT   2461
 315     CONTINUE                                                       RESULT   2462
C                                                                       RESULT   2463
         CMAG=SQRT(CDLI*CDLI+CQLI*CQLI)                                 RESULT   2464
C                                                                       RESULT   2465
C   ENDIF VMG .GT. 0                                                    RESULT   2466
        ENDIF                                                           RESULT   2467
C                                                                       RESULT   2468
C          STORE COMPUTED RESULTS IN  BUF                               RESULT   2469
C                                                                       RESULT   2470
      BUF(ISCHAN+1)=VMG                                                 RESULT   2471
      BUF(ISCHAN+2)=CMAG                                                RESULT   2472
      BUF(ISCHAN+3)=CMW                                                 RESULT   2473
      BUF(ISCHAN+4)=CMX                                                 RESULT   2474
      BUF(ISCHAN+5)=DEF                                                 RESULT   2475
C                                                                       RESULT   2476
C--  PRINT THE BUFFER CONTENT                                           RESULT   2477
C                                                                       RESULT   2478
         IF(IPRTSW.EQ.1)THEN                                            RESULT   2479
            IF((IL+ISTART).GE.ILDEF)THEN                                RESULT   2480
               IL=9+ISTART                                              RESULT   2481
               IF(ISTART.EQ.0) CALL PAGE17                              RESULT   2482
               ISTART=0                                                 RESULT   2483
               WRITE(IU17,1100) TS,ITSTRN,ITTER,IFAULT                  RESULT   2484
            ENDIF                                                       RESULT   2485
         NLF=NOLD(IPBNO)                                                RESULT   2486
         K3=IPBNO*3                                                     RESULT   2487
         WRITE(IU17,1390) NLF,INAME(K3-2),INAME(K3-1),INAME(K3),        RESULT   2488
     +   (BUF(ISCHAN+J),J=1,5)                                          RESULT   2489
         ENDIF                                                          RESULT   2490
      ENDIF                                                             RESULT   2491
      IPOS=IPOS+4                                                       RESULT   2492
      IF(ICOUNT.LT.ICOUNX)GOTO 620                                      RESULT   2493
      ENDIF                                                             RESULT   2494
 640  CONTINUE                                                          RESULT   2495
C                                                                       RESULT   2496
C--  END OF " IF(NLOADO.EQ.0) "                                         RESULT   2497
C                                                                       RESULT   2498
      IL=ILDEF                                                          RESULT   2499
      ENDIF                                                             RESULT   2500
CD                                                                      RESULT   2501
CD STEP 18. COMPUTE AND STORE VOLTAGES OF ALL MONITORED BUSES           RESULT   2502
CD                                                                      RESULT   2503
      IF(NVBS.NE.0)THEN                                                 RESULT   2504
      DO 720 K=1,NOPTR                                                  RESULT   2505
      IPOS=KOPTR(K)                                                     RESULT   2506
      JSEM=KOPDAT(IPOS+1)                                               RESULT   2507
      IF(JSEM.EQ.16)THEN                                                RESULT   2508
      ICOUNX=KOPDAT(IPOS+2)                                             RESULT   2509
      IPOS=IPOS+2                                                       RESULT   2510
      ICOUNT=0                                                          RESULT   2511
 700  ICOUNT=ICOUNT+1                                                   RESULT   2512
      IPBNO=KOPDAT(IPOS+1)                                              RESULT   2513
      ISCHAN=KOPDAT(IPOS+2)                                             RESULT   2514
      IF(IPBNO.NE.0)THEN                                                RESULT   2515
      VOLTK=VOLT(IPBNO)                                                 RESULT   2516
      EC=CABS(VOLTK)                                                    RESULT   2517
      IF(ABS(VREAL).GT.1.E-6.OR.ABS(VIMAG).GT.1.E-6)THEN                RESULT   2518
      ANGR=DEGREE*ATAN2(VIMAG,VREAL)                                    RESULT   2519
      ELSE                                                              RESULT   2520
      ANGR=0.0                                                          RESULT   2521
      ENDIF                                                             RESULT   2522
C                                                                       RESULT   2523
C   STORE COMPUTED RESULTS IN  BUF                                      RESULT   2524
C                                                                       RESULT   2525
      BUF(ISCHAN+1)=EC                                                  RESULT   2526
      BUF(ISCHAN+2)=ANGR                                                RESULT   2527
C                                                                       RESULT   2528
        IF(IPRTSW.EQ.1)THEN                                             RESULT   2529
           IF((IL+ISTART).GE.ILDEF)THEN                                 RESULT   2530
              IL=9+ISTART                                               RESULT   2531
              IF(ISTART.EQ.0) CALL PAGE17                               RESULT   2532
              ISTART=0                                                  RESULT   2533
              WRITE(IU17,1120) TS                                       RESULT   2534
           ENDIF                                                        RESULT   2535
        NLF=NOLD(IPBNO)                                                 RESULT   2536
        K3=IPBNO*3                                                      RESULT   2537
        WRITE(IU17,1110) NLF,INAME(K3-2),INAME(K3-1),INAME(K3)          RESULT   2538
     &,VREAL,VIMAG,BUF(ISCHAN+1),BUF(ISCHAN+2)                          RESULT   2539
        IL=IL+1                                                         RESULT   2540
        ENDIF                                                           RESULT   2541
      ELSE                                                              RESULT   2542
C                                                                       RESULT   2543
C   NON-EXISTED BUS                                                     RESULT   2544
C                                                                       RESULT   2545
      BUF(ISCHAN+1)=0.0                                                 RESULT   2546
      BUF(ISCHAN+2)=0.0                                                 RESULT   2547
      ENDIF                                                             RESULT   2548
      IPOS=IPOS+2                                                       RESULT   2549
      IF(ICOUNT.LT.ICOUNX)GOTO 700                                      RESULT   2550
      ENDIF                                                             RESULT   2551
 720  CONTINUE                                                          RESULT   2552
      IL=ILDEF                                                          RESULT   2553
      ENDIF                                                             RESULT   2554
CD                                                                      RESULT   2555
CD STEP 19. COMPUTE AND STORE LINE FLOW OF ALL MONITORED LINES          RESULT   2556
CD                                                                      RESULT   2557
      IF(NLINEO.NE.0)THEN                                               RESULT   2558
      DO 820 K=1,NOPTR                                                  RESULT   2559
      IPOS=KOPTR(K)                                                     RESULT   2560
      JSEM=KOPDAT(IPOS+1)                                               RESULT   2561
      IF(JSEM.EQ.14)THEN                                                RESULT   2562
      ICOUNX=KOPDAT(IPOS+2)                                             RESULT   2563
      IPOS=IPOS+2                                                       RESULT   2564
      ICOUNT=0                                                          RESULT   2565
 800  ICOUNT=ICOUNT+1                                                   RESULT   2566
      ILINE=KOPDAT(IPOS+1)                                              RESULT   2567
      ISCHAN=KOPDAT(IPOS+2)                                             RESULT   2568
      ILIN12=ILINE*12                                                   RESULT   2569
      ITFK=MLFTB(ILIN12-11)                                             RESULT   2570
      CALL UPACKI(MTYPI,LSTATU,ITFK)                                    RESULT   2571
      IF(LSTATU.LT.10)THEN                                              RESULT   2572
      ITFK=MLFTB(ILIN12-10)                                             RESULT   2573
      CALL UPACKI(IPBNOF,IPBNOT,ITFK)                                   RESULT   2574
      ITFK=MACKT(ILIN12-9)                                              RESULT   2575
      CALL UNPACK(UID,JJJ,ITFK)                                         RESULT   2576
C                                                                       RESULT   2577
      IF(LSTATU.EQ.0)THEN                                               RESULT   2578
C-                                                                      RESULT   2579
      IF(MTYPI.EQ.5)THEN                                                RESULT   2580
        CALL ZILFLW(IPBNOF,ILIN12,PFR,QFR,CMAGFR,ANGFR,RFR,XFR)         RESULT   2581
        BUF(ISCHAN+1)=PFR                                               RESULT   2582
        BUF(ISCHAN+2)=QFR                                               RESULT   2583
        BUF(ISCHAN+3)=CMAGFR                                            RESULT   2584
        BUF(ISCHAN+4)=ANGFR                                             RESULT   2585
        BUF(ISCHAN+5)=RFR                                               RESULT   2586
        BUF(ISCHAN+6)=XFR                                               RESULT   2587
      ELSE                                                              RESULT   2588
C-                                                                      RESULT   2589
      GJJ=GLM(ILIN12-6)                                                 RESULT   2590
      BJJ=BLM(ILIN12-5)                                                 RESULT   2591
      GJK=BLCF(ILIN12-4)                                                RESULT   2592
      BJK=BLT(ILIN12-3)                                                 RESULT   2593
      VOLTK=VOLT(IPBNOF)                                                RESULT   2594
      ERJ=VREAL                                                         RESULT   2595
      EIJ=VIMAG                                                         RESULT   2596
      VOLTK=VOLT(IPBNOT)                                                RESULT   2597
      ERK=VREAL                                                         RESULT   2598
      EIK=VIMAG                                                         RESULT   2599
      CREAL=(GJJ*ERJ+BJJ*EIJ)-(GJK*ERK+BJK*EIK)                         RESULT   2600
      CIMAG=(GJJ*EIJ-BJJ*ERJ)-(GJK*EIK-BJK*ERK)                         RESULT   2601
      CMAGFR=CREAL*CREAL+CIMAG*CIMAG                                    RESULT   2602
         IF(ABS(CMAGFR).GT.1.E-6)THEN                                   RESULT   2603
         ANGFR=DEGREE*ATAN2(CIMAG,CREAL)                                RESULT   2604
         ELSE                                                           RESULT   2605
         ANGFR=0.0                                                      RESULT   2606
         ENDIF                                                          RESULT   2607
      PFR=ERJ*CREAL+EIJ*CIMAG                                           RESULT   2608
      QFR=EIJ*CREAL-ERJ*CIMAG                                           RESULT   2609
      IF(ABS(CMAGFR).GT.1.E-6)THEN                                      RESULT   2610
      RFR=PFR/CMAGFR                                                    RESULT   2611
      XFR=QFR/CMAGFR                                                    RESULT   2612
      CMAGFR=SQRT(CMAGFR)                                               RESULT   2613
      ELSE                                                              RESULT   2614
      RFR=0.0                                                           RESULT   2615
      XFR=0.0                                                           RESULT   2616
      ENDIF                                                             RESULT   2617
C                                                                       RESULT   2618
C STORE COMPUTED RESULTS IN  BUF                                        RESULT   2619
C                                                                       RESULT   2620
      BUF(ISCHAN+1)=PFR                                                 RESULT   2621
      BUF(ISCHAN+2)=QFR                                                 RESULT   2622
      BUF(ISCHAN+3)=CMAGFR                                              RESULT   2623
      BUF(ISCHAN+4)=ANGFR                                               RESULT   2624
      BUF(ISCHAN+5)=RFR                                                 RESULT   2625
      BUF(ISCHAN+6)=XFR                                                 RESULT   2626
C                                                                       RESULT   2627
C  CHECK POSITION OF APPARENT IMPEDANCE POINTS ON COMPOSITE CIRCLE      RESULT   2628
C                                                                       RESULT   2629
      IF(KRADX(ILIN12-2).EQ.0)THEN                                      RESULT   2630
      RSF='N'                                                           RESULT   2631
      ELSE                                                              RESULT   2632
      RSF=' '                                                           RESULT   2633
      RADXI=RADX(ILIN12-2)                                              RESULT   2634
      RORIGI=RORIG(ILIN12-1)                                            RESULT   2635
      XORIGI=XORIG(ILIN12)                                              RESULT   2636
      KK=JRSKRS(ILIN12-7)                                               RESULT   2637
      CALL UPACKI(JRS,KRS,KK)                                           RESULT   2638
      DISTSQ=(RFR-RORIGI)**2+(XFR-XORIGI)**2                            RESULT   2639
      IF(DISTSQ.LE.RADXI)THEN                                           RESULT   2640
C                                                                       RESULT   2641
C   RELAY TRIP                                                          RESULT   2642
C                                                                       RESULT   2643
      RSF='B'                                                           RESULT   2644
      JRS=3                                                             RESULT   2645
      ELSE                                                              RESULT   2646
C                                                                       RESULT   2647
C   TESTING FOR SYSTEM PLANNING DEFINITION                              RESULT   2648
C                                                                       RESULT   2649
         IF(DISTSQ.LT.RADXI*1.5625)THEN                                 RESULT   2650
         RSF='S'                                                        RESULT   2651
         JRS=1                                                          RESULT   2652
         ENDIF                                                          RESULT   2653
C                                                                       RESULT   2654
C   TESTING FOR OPERATION DEFINITION                                    RESULT   2655
C                                                                       RESULT   2656
         ZSQ=RFR*RFR+XFR*XFR                                            RESULT   2657
         DUM=0.4*ZSQ+RADXI+0.4*SQRT(ZSQ*RADXI)                          RESULT   2658
         IF(DISTSQ.LT.DUM)THEN                                          RESULT   2659
            IF(RSF.EQ.' ')THEN                                          RESULT   2660
            RSF='O'                                                     RESULT   2661
            JRS=2                                                       RESULT   2662
            ELSE                                                        RESULT   2663
            RSF='B'                                                     RESULT   2664
            JRS=3                                                       RESULT   2665
            ENDIF                                                       RESULT   2666
         ENDIF                                                          RESULT   2667
C                                                                       RESULT   2668
      ENDIF                                                             RESULT   2669
C                                                                       RESULT   2670
C   STORE RELAY FLAG                                                    RESULT   2671
C                                                                       RESULT   2672
      CALL PACKII(JRS,KRS,KK)                                           RESULT   2673
      JRSKRS(ILIN12-7)=KK                                               RESULT   2674
C                                                                       RESULT   2675
C   ENDIF KRADX.EQ.0                                                    RESULT   2676
C                                                                       RESULT   2677
      ENDIF                                                             RESULT   2678
C-                                                                      RESULT   2679
C   ENDIF MTYPI.EQ.5                                                    RESULT   2680
C                                                                       RESULT   2681
      ENDIF                                                             RESULT   2682
C                                                                       RESULT   2683
C   OUT OF SERVICE LINE                                                 RESULT   2684
C                                                                       RESULT   2685
      ELSE                                                              RESULT   2686
C                                                                       RESULT   2687
      IF(KRADX(ILIN12-2).EQ.0)THEN                                      RESULT   2688
      RSF='N'                                                           RESULT   2689
      ELSE                                                              RESULT   2690
      RSF=' '                                                           RESULT   2691
      ENDIF                                                             RESULT   2692
C                                                                       RESULT   2693
      BUF(ISCHAN+1)=0.0                                                 RESULT   2694
      BUF(ISCHAN+2)=0.0                                                 RESULT   2695
      BUF(ISCHAN+3)=0.0                                                 RESULT   2696
      BUF(ISCHAN+4)=0.0                                                 RESULT   2697
      BUF(ISCHAN+5)=0.0                                                 RESULT   2698
      BUF(ISCHAN+6)=0.0                                                 RESULT   2699
C                                                                       RESULT   2700
C   ENDIF LSTATU.EQ.0                                                   RESULT   2701
C                                                                       RESULT   2702
      ENDIF                                                             RESULT   2703
C                                                                       RESULT   2704
        IF(IPRTSW.EQ.1)THEN                                             RESULT   2705
           IF((IL+ISTART).GE.ILDEF)THEN                                 RESULT   2706
              IL=11+ISTART                                              RESULT   2707
              IF(ISTART.EQ.0) CALL PAGE17                               RESULT   2708
              ISTART=0                                                  RESULT   2709
              WRITE(IU17,1130) TS                                       RESULT   2710
           ENDIF                                                        RESULT   2711
        J3=IPBNOF*3                                                     RESULT   2712
        K3=IPBNOT*3                                                     RESULT   2713
        NLFF=NOLD(IPBNOF)                                               RESULT   2714
        NLFT=NOLD(IPBNOT)                                               RESULT   2715
        WRITE(IU17,1140) NLFF,INAME(J3-2),INAME(J3-1)                   RESULT   2716
     &,NLFT,INAME(K3-2),INAME(K3-1),UID                                 RESULT   2717
     &,(BUF(ISCHAN+KK),KK=1,6),RSF                                      RESULT   2718
        IL=IL+1                                                         RESULT   2719
        ENDIF                                                           RESULT   2720
C                                                                       RESULT   2721
C NON-EXISTED LINES                                                     RESULT   2722
C                                                                       RESULT   2723
      ELSE                                                              RESULT   2724
C                                                                       RESULT   2725
      BUF(ISCHAN+1)=0.0                                                 RESULT   2726
      BUF(ISCHAN+2)=0.0                                                 RESULT   2727
      BUF(ISCHAN+3)=0.0                                                 RESULT   2728
      BUF(ISCHAN+4)=0.0                                                 RESULT   2729
      BUF(ISCHAN+5)=0.0                                                 RESULT   2730
      BUF(ISCHAN+6)=0.0                                                 RESULT   2731
      ENDIF                                                             RESULT   2732
      IPOS=IPOS+2                                                       RESULT   2733
      IF(ICOUNT.LT.ICOUNX)GOTO 800                                      RESULT   2734
      ENDIF                                                             RESULT   2735
 820  CONTINUE                                                          RESULT   2736
C                                                                       RESULT   2737
C   ENDIF NLINEO.NE.0                                                   RESULT   2738
C                                                                       RESULT   2739
      IL=ILDEF                                                          RESULT   2740
      ENDIF                                                             RESULT   2741
CD                                                                      RESULT   2742
CD STEP 20. COMPUTE AND STORE TOTAL FLOW OF INTERFACE LINES             RESULT   2743
CD                                                                      RESULT   2744
      IF(NINTEO.NE.0)THEN                                               RESULT   2745
      DO 880 K=1,NOPTR                                                  RESULT   2746
      IPOS=KOPTR(K)                                                     RESULT   2747
      JSEM=KOPDAT(IPOS+1)                                               RESULT   2748
      IF(JSEM.EQ.15)THEN                                                RESULT   2749
      ICOUNX=KOPDAT(IPOS+2)                                             RESULT   2750
      IPOS=IPOS+2                                                       RESULT   2751
      ICOUNT=0                                                          RESULT   2752
 860  ICOUNT=ICOUNT+1                                                   RESULT   2753
      ISCHAN=KOPDAT(IPOS+1)                                             RESULT   2754
      JITERF=KOPDAT(IPOS+2)                                             RESULT   2755
      JCOUNX=KOPDAT(IPOS+3)                                             RESULT   2756
      IPOS=IPOS+3                                                       RESULT   2757
      SUMMW=0.0                                                         RESULT   2758
      SUMMX=0.0                                                         RESULT   2759
      JCOUNT=0                                                          RESULT   2760
 870  JCOUNT=JCOUNT+1                                                   RESULT   2761
      ILINE=KOPDAT(IPOS+1)                                              RESULT   2762
      ILIN12=ILINE*12                                                   RESULT   2763
      JJ=MLFTB(ILIN12-11)                                               RESULT   2764
      CALL UPACKI(MTYPI,LSTATU,JJ)                                      RESULT   2765
      IF(LSTATU.LT.10)THEN                                              RESULT   2766
      ITFK=MLFTB(ILIN12-10)                                             RESULT   2767
      CALL UPACKI(IPBNOF,IPBNOT,ITFK)                                   RESULT   2768
      IUID=MACKT(ILIN12-9)                                              RESULT   2769
      CALL UNPACK(UID,JJJ,IUID)                                         RESULT   2770
C                                                                       RESULT   2771
      IF(LSTATU.EQ.0)THEN                                               RESULT   2772
      GJJ=GLM(ILIN12-6)                                                 RESULT   2773
      BJJ=BLM(ILIN12-5)                                                 RESULT   2774
      GJK=BLCF(ILIN12-4)                                                RESULT   2775
      BJK=BLT(ILIN12-3)                                                 RESULT   2776
      VOLTK=VOLT(IPBNOF)                                                RESULT   2777
      ERJ=VREAL                                                         RESULT   2778
      EIJ=VIMAG                                                         RESULT   2779
      VOLTK=VOLT(IPBNOT)                                                RESULT   2780
      ERK=VREAL                                                         RESULT   2781
      EIK=VIMAG                                                         RESULT   2782
      CREAL=(GJJ*ERJ+BJJ*EIJ)-(GJK*ERK+BJK*EIK)                         RESULT   2783
      CIMAG=(GJJ*EIJ-BJJ*ERJ)-(GJK*EIK-BJK*ERK)                         RESULT   2784
      PFR=ERJ*CREAL+EIJ*CIMAG                                           RESULT   2785
      QFR=EIJ*CREAL-ERJ*CIMAG                                           RESULT   2786
      SUMMW=SUMMW+PFR                                                   RESULT   2787
      SUMMX=SUMMX+QFR                                                   RESULT   2788
C                                                                       RESULT   2789
C   OUT OF SERVICE LINE                                                 RESULT   2790
C                                                                       RESULT   2791
      ELSE                                                              RESULT   2792
C                                                                       RESULT   2793
C                                                                       RESULT   2794
      PFR=0.0                                                           RESULT   2795
      QFR=0.0                                                           RESULT   2796
C                                                                       RESULT   2797
C   ENDIF LSTATU.EQ.0                                                   RESULT   2798
C                                                                       RESULT   2799
      ENDIF                                                             RESULT   2800
C                                                                       RESULT   2801
        IF(IPRTSW.EQ.1)THEN                                             RESULT   2802
           IF((IL+ISTART).GE.ILDEF)THEN                                 RESULT   2803
              IL=8+ISTART                                               RESULT   2804
              IF(ISTART.EQ.0) CALL PAGE17                               RESULT   2805
              ISTART=0                                                  RESULT   2806
              WRITE(IU17,1360) TS                                       RESULT   2807
           ENDIF                                                        RESULT   2808
         J3=IPBNOF*3                                                    RESULT   2809
         K3=IPBNOT*3                                                    RESULT   2810
         NLFF=NOLD(IPBNOF)                                              RESULT   2811
         NLFT=NOLD(IPBNOT)                                              RESULT   2812
         WRITE(IU17,1370) NLFF,INAME(J3-2),INAME(J3-1)                  RESULT   2813
     &,NLFT,INAME(K3-2),INAME(K3-1),UID,PFR,QFR                         RESULT   2814
        IL=IL+1                                                         RESULT   2815
        ENDIF                                                           RESULT   2816
      ENDIF                                                             RESULT   2817
      IPOS=IPOS+1                                                       RESULT   2818
      IF(JCOUNT.LT.JCOUNX)GOTO 870                                      RESULT   2819
      BUF(ISCHAN+1)=SUMMW                                               RESULT   2820
      BUF(ISCHAN+2)=SUMMX                                               RESULT   2821
      IF(IPRTSW.EQ.1)                                                   RESULT   2822
     &WRITE(IU17,1380) JITERF,(KNTERF(LL,JITERF),LL=1,6),SUMMW,SUMMX    RESULT   2823
      IF(ICOUNT.LT.ICOUNX)GOTO 860                                      RESULT   2824
      ENDIF                                                             RESULT   2825
 880  CONTINUE                                                          RESULT   2826
C                                                                       RESULT   2827
C   ENDIF NINTEO.NE.0                                                   RESULT   2828
C                                                                       RESULT   2829
      IL=ILDEF                                                          RESULT   2830
      ENDIF                                                             RESULT   2831
CD                                                                      RESULT   2832
CD STEP 21. COMPUTE AND STORE AC/DC CONVERTER VARIABLES                 RESULT   2833
CD                                                                      RESULT   2834
      IF(NCONVO.NE.0)THEN                                               RESULT   2835
      DO 900 K=1,NOPTR                                                  RESULT   2836
      IPOS=KOPTR(K)                                                     RESULT   2837
      JSEM=KOPDAT(IPOS+1)                                               RESULT   2838
      IF(JSEM.EQ.11)THEN                                                RESULT   2839
      ICOUNX=KOPDAT(IPOS+2)                                             RESULT   2840
      IPOS=IPOS+2                                                       RESULT   2841
      ICOUNT=0                                                          RESULT   2842
 890  ICOUNT=ICOUNT+1                                                   RESULT   2843
      JPOSN=KOPDAT(IPOS+1)                                              RESULT   2844
      ISCHAN=KOPDAT(IPOS+2)                                             RESULT   2845
      IF(JPOSN.NE.0)THEN                                                RESULT   2846
      NUM=IDCBNU(JPOSN)                                                 RESULT   2847
      IF(IABS(ICTYPE(JPOSN)).EQ.1)THEN                                  RESULT   2848
         ALP=ACOS(CALPHA(JPOSN))*180.0/PII                              RESULT   2849
         GAM=ACOS(CGAMMA(JPOSN))*180.0/PII                              RESULT   2850
         IF(NUM.EQ.0) THEN                                              RESULT   2851
            TEMP=1.0                                                    RESULT   2852
         ELSE                                                           RESULT   2853
            TEMP=SQRT( DCEA(NUM)**2+DCEB(NUM)**2)                       RESULT   2854
         ENDIF                                                          RESULT   2855
         QA=QAHVDC(JPOSN)                                               RESULT   2856
      ELSE                                                              RESULT   2857
         ALP=CALPHA(JPOSN)*180.0/PII                                    RESULT   2858
         GAM=CGAMMA(JPOSN)                                              RESULT   2859
         NU2=IDCBN2(JPOSN)                                              RESULT   2860
         IF(NUM.EQ.0) THEN                                              RESULT   2861
            TEMP=1.0                                                    RESULT   2862
         ELSE                                                           RESULT   2863
            IF(NU2.EQ.0) THEN                                           RESULT   2864
               TEMP=SQRT( DCEA(NUM)**2+DCEB(NUM)**2)                    RESULT   2865
            ELSE                                                        RESULT   2866
               TEMP=SQRT((DCEA(NUM)-DCEA(NU2))**2+                      RESULT   2867
     *                   (DCEB(NUM)-DCEB(NU2))**2)                      RESULT   2868
            ENDIF                                                       RESULT   2869
         ENDIF                                                          RESULT   2870
         QA=QAHVDC(JPOSN)+Q2HVDC(JPOSN)                                 RESULT   2871
      ENDIF                                                             RESULT   2872
C                                                                       RESULT   2873
C   STORE COMPUTED RESULTS IN  BUF                                      RESULT   2874
C                                                                       RESULT   2875
      BUF(ISCHAN+1)=TEMP                                                RESULT   2876
      BUF(ISCHAN+2)=VDCONV(JPOSN)                                       RESULT   2877
      BUF(ISCHAN+3)=XDCONV(JPOSN)                                       RESULT   2878
      BUF(ISCHAN+4)=ALP                                                 RESULT   2879
      BUF(ISCHAN+5)=GAM                                                 RESULT   2880
      BUF(ISCHAN+6)=PAHVDC(JPOSN)                                       RESULT   2881
      BUF(ISCHAN+7)=QA                                                  RESULT   2882
         IF(IPRTSW.EQ.1)THEN                                            RESULT   2883
           IF((IL+ISTART).GE.ILDEF)THEN                                 RESULT   2884
              IL=8+ISTART                                               RESULT   2885
              IF(ISTART.EQ.0) CALL PAGE17                               RESULT   2886
              ISTART=0                                                  RESULT   2887
              WRITE(IU17,1400) TS                                       RESULT   2888
           ENDIF                                                        RESULT   2889
        NLF=NOLD(IPBNO)                                                 RESULT   2890
        K3=IPBNO*3                                                      RESULT   2891
        WRITE(IU17,1410) DCCNAM(JPOSN),(BUF(ISCHAN+LK),LK=1,7)          RESULT   2892
        IL=IL+1                                                         RESULT   2893
        ENDIF                                                           RESULT   2894
      ELSE                                                              RESULT   2895
       BUF(ISCHAN+1)=0.0                                                RESULT   2896
       BUF(ISCHAN+2)=0.0                                                RESULT   2897
       BUF(ISCHAN+3)=0.0                                                RESULT   2898
       BUF(ISCHAN+4)=0.0                                                RESULT   2899
       BUF(ISCHAN+5)=0.0                                                RESULT   2900
       BUF(ISCHAN+6)=0.0                                                RESULT   2901
       BUF(ISCHAN+7)=0.0                                                RESULT   2902
      ENDIF                                                             RESULT   2903
      IPOS=IPOS+2                                                       RESULT   2904
      IF(ICOUNT.LT.ICOUNX)GOTO 890                                      RESULT   2905
C                                                                       RESULT   2906
C   ENDIF JSEM.EQ.11                                                    RESULT   2907
C                                                                       RESULT   2908
      ENDIF                                                             RESULT   2909
C                                                                       RESULT   2910
 900  CONTINUE                                                          RESULT   2911
C                                                                       RESULT   2912
C   ENDIF NCONVO.NE.0                                                   RESULT   2913
C                                                                       RESULT   2914
      IL=ILDEF                                                          RESULT   2915
      ENDIF                                                             RESULT   2916
C                                                                       RESULT   2917
      IF(NUDCO.NE.0)THEN                                                RESULT   2918
      JL=0                                                              RESULT   2919
      DO 930 K=1,NOPTR                                                  RESULT   2920
      IPOS=KOPTR(K)                                                     RESULT   2921
      JSEM=KOPDAT(IPOS+1)                                               RESULT   2922
      IF(JSEM.EQ.12)THEN                                                RESULT   2923
      ICOUNX=KOPDAT(IPOS+2)                                             RESULT   2924
      IPOS=IPOS+2                                                       RESULT   2925
      ICOUNT=0                                                          RESULT   2926
      NEXT1=0                                                           RESULT   2927
 920  ICOUNT=ICOUNT+1                                                   RESULT   2928
      JL=JL+1                                                           RESULT   2929
      NEXT=KOPDAT(IPOS+1)                                               RESULT   2930
      ISCHAN=KOPDAT(IPOS+2)                                             RESULT   2931
      IPOS=IPOS+2                                                       RESULT   2932
      IF(NEXT.EQ.NEXT1) THEN                                            RESULT   2933
         BUF(ISCHAN+1)=UDVA3(NEXT)                                      RESULT   2934
      ELSE                                                              RESULT   2935
         BUF(ISCHAN+1)=UDVAL(NEXT)                                      RESULT   2936
      ENDIF                                                             RESULT   2937
      NEXT1=NEXT                                                        RESULT   2938
        IF(IPRTSW.EQ.1)THEN                                             RESULT   2939
        LNAME(JL)=UDNAME(NEXT)                                          RESULT   2940
          IF(JL.EQ.4)THEN                                               RESULT   2941
           IF((IL+ISTART).GE.ILDEF)THEN                                 RESULT   2942
              IL=8+ISTART                                               RESULT   2943
              IF(ISTART.EQ.0) CALL PAGE17                               RESULT   2944
              ISTART=0                                                  RESULT   2945
              WRITE(IU17,1420) TS                                       RESULT   2946
           ENDIF                                                        RESULT   2947
          WRITE(IU17,1430) (LNAME(LI),BUF(ISCHAN-JL+LI+1),LI=1,4)       RESULT   2948
          IL=IL+1                                                       RESULT   2949
          JL=0                                                          RESULT   2950
          ENDIF                                                         RESULT   2951
       ENDIF                                                            RESULT   2952
      IF(ICOUNT.LT.ICOUNX)GOTO 920                                      RESULT   2953
        IF(JL.NE.0)THEN                                                 RESULT   2954
        IF(IPRTSW.EQ.1)THEN                                             RESULT   2955
           IF((IL+ISTART).GE.ILDEF)THEN                                 RESULT   2956
              IL=8+ISTART                                               RESULT   2957
              IF(ISTART.EQ.0) CALL PAGE17                               RESULT   2958
              ISTART=0                                                  RESULT   2959
              WRITE(IU17,1420) TS                                       RESULT   2960
           ENDIF                                                        RESULT   2961
          WRITE(IU17,1430) (LNAME(LI),BUF(ISCHAN-JL+LI+1),LI=1,JL)      RESULT   2962
          IL=IL+1                                                       RESULT   2963
        ENDIF                                                           RESULT   2964
        ENDIF                                                           RESULT   2965
C                                                                       RESULT   2966
C   ENDIF JSEM.EQ.12                                                    RESULT   2967
C                                                                       RESULT   2968
      ENDIF                                                             RESULT   2969
 930  CONTINUE                                                          RESULT   2970
C                                                                       RESULT   2971
C   ENDIF NUDCO.NE.0                                                    RESULT   2972
C                                                                       RESULT   2973
      IL=ILDEF                                                          RESULT   2974
      ENDIF                                                             RESULT   2975
      IF(NDVOLO.NE.0)THEN                                               RESULT   2976
      JL=0                                                              RESULT   2977
      DO 950 K=1,NOPTR                                                  RESULT   2978
      IPOS=KOPTR(K)                                                     RESULT   2979
      JSEM=KOPDAT(IPOS+1)                                               RESULT   2980
      IF(JSEM.EQ.17)THEN                                                RESULT   2981
      ICOUNX=KOPDAT(IPOS+2)                                             RESULT   2982
      IPOS=IPOS+2                                                       RESULT   2983
      ICOUNT=0                                                          RESULT   2984
 940  ICOUNT=ICOUNT+1                                                   RESULT   2985
      JL=JL+1                                                           RESULT   2986
      NEXT=KOPDAT(IPOS+1)                                               RESULT   2987
      ISCHAN=KOPDAT(IPOS+2)                                             RESULT   2988
      IPOS=IPOS+2                                                       RESULT   2989
      BUF(ISCHAN+1)=VDCNOD(NEXT)                                        RESULT   2990
        IF(IPRTSW.EQ.1)THEN                                             RESULT   2991
        DCNAME(JL)=IDCNOD(NEXT)                                         RESULT   2992
          IF(JL.EQ.6)THEN                                               RESULT   2993
           IF((IL+ISTART).GE.ILDEF)THEN                                 RESULT   2994
              IL=8+ISTART                                               RESULT   2995
              IF(ISTART.EQ.0) CALL PAGE17                               RESULT   2996
              ISTART=0                                                  RESULT   2997
              WRITE(IU17,1440) TS                                       RESULT   2998
           ENDIF                                                        RESULT   2999
          WRITE(IU17,1450) (DCNAME(LI),BUF(ISCHAN-JL+LI+1),LI=1,6)      RESULT   3000
          IL=IL+1                                                       RESULT   3001
          JL=0                                                          RESULT   3002
          ENDIF                                                         RESULT   3003
       ENDIF                                                            RESULT   3004
      IF(ICOUNT.LT.ICOUNX)GOTO 940                                      RESULT   3005
        IF(JL.NE.0)THEN                                                 RESULT   3006
        IF(IPRTSW.EQ.1)THEN                                             RESULT   3007
           IF((IL+ISTART).GE.ILDEF)THEN                                 RESULT   3008
              IL=8+ISTART                                               RESULT   3009
              IF(ISTART.EQ.0) CALL PAGE17                               RESULT   3010
              ISTART=0                                                  RESULT   3011
              WRITE(IU17,1440) TS                                       RESULT   3012
           ENDIF                                                        RESULT   3013
          WRITE(IU17,1450) (DCNAME(LI),BUF(ISCHAN-JL+LI+1),LI=1,JL)     RESULT   3014
          IL=IL+1                                                       RESULT   3015
        ENDIF                                                           RESULT   3016
        ENDIF                                                           RESULT   3017
C                                                                       RESULT   3018
C   ENDIF JSEM.EQ.17                                                    RESULT   3019
C                                                                       RESULT   3020
      ENDIF                                                             RESULT   3021
 950  CONTINUE                                                          RESULT   3022
C                                                                       RESULT   3023
C   ENDIF NDVOLO.NE.0                                                   RESULT   3024
C                                                                       RESULT   3025
      ENDIF                                                             RESULT   3026
C                                                                       RESULT   3027
C    FINAL RECORD                                                       RESULT   3028
C                                                                       RESULT   3029
      ELSE                                                              RESULT   3030
CD                                                                      RESULT   3031
CD          IF FINAL RECORDS OF BINARY FILE IU8, WRITE JRSKRS ARRAY     RESULT   3032
CD          TO RESULT FILE.                                             RESULT   3033
CD                                                                      RESULT   3034
      II=0                                                              RESULT   3035
      DO 960 I=1,NPFL                                                   RESULT   3036
      II=II+12                                                          RESULT   3037
      IBUF(I)=JRSKRS(II-7)                                              RESULT   3038
 960  CONTINUE                                                          RESULT   3039
C                                                                       RESULT   3040
      KK=-128                                                           RESULT   3041
      DO 970 I=1,IRREC                                                  RESULT   3042
      KK=KK+128                                                         RESULT   3043
      CALL DAIWR(IU8,0,LRREC,IBUF(KK+1),128)                            RESULT   3044
 970  CONTINUE                                                          RESULT   3045
C                                                                       RESULT   3046
C                                                                       RESULT   3047
C                                                                       RESULT   3048
      IBUF(1)=IFAULT                                                    RESULT   3049
      BUF(2)=999999.0                                                   RESULT   3050
C      IPOIN=IPOIN-1                                                    RESULT   3051
C                                                                       RESULT   3052
C   IPRTSW.LT.3                                                         RESULT   3053
C                                                                       RESULT   3054
      ENDIF                                                             RESULT   3055
CD                                                                      RESULT   3056
CD STEP 22. WRITE RESULT BUF TO RESULT FILE                             RESULT   3057
CD                                                                      RESULT   3058
      KK=-128                                                           RESULT   3059
      DO 990 I=1,IREC                                                   RESULT   3060
      KK=KK+128                                                         RESULT   3061
      CALL DAFLWR(IU8,0,NREC,BUF(KK+1),128)                             RESULT   3062
 990  CONTINUE                                                          RESULT   3063
      BUF(2)=999999.0                                                   RESULT   3064
      NREC1=NREC                                                        RESULT   3065
      CALL DAFLWR(IU8,0,NREC1,BUF(1),128)                               RESULT   3066
C                                                                       RESULT   3067
      RETURN                                                            RESULT   3068
C                                                                       RESULT   3069
C 1000 FORMAT(F11.3,I6,1X,3A4,A4,F10.3)                                 RESULT   3070
C 1001 FORMAT(F11.3,I6,1X,3A4,4X,F10.3)                                 RESULT   3071
C 1002 FORMAT(15X,'SOLUTION REPORT',/,15X,15('='),/,36X,'MAX. ANG.',/,7XRESULT   3072
C     *,'TIME  BUS# STATION NAME CID     CHANGE',/,6X                   RESULT   3073
C     *,'----- ----- ------------ --- ----------')                      RESULT   3074
 1010 FORMAT(//,43X,'GENERATOR CONDITIONS AT TIME =',F9.3,' SEC',/      RESULT   3075
     *,43X,43('='),/,'  BUS# STATION NAME CID      VM     MW     MX'    RESULT   3076
     &,'      ABS      REL    DOM   FREQ   TMEC    EFD    IFD      CR'  RESULT   3077
     &,'      CI    APPR    APPX',/,'  ---- ------------ --- '          RESULT   3078
     *,3('   ----'),5X,'----  ',6('   ----'),4('    ----'))             RESULT   3079
 1020 FORMAT(I6,1X,3A4,2X,A2,F8.4,2F7.3,G9.1,F9.2,5F7.3,4F8.3)          RESULT   3080
 1100 FORMAT('   NON-Z LOAD BUS CONDITIONS AT TIME =',F9.3,' SEC',/     RESULT   3081
     *,3X,48('='),/                                                     RESULT   3082
     *,5X,'ITSTRN =',I3,'   ITTER =',I8,'   IFAULT =',I3,//             RESULT   3083
     *,'  BUS# STATION NAME     VM     CM     MW     MX    DEF',/       RESULT   3084
     *,' ----- ------------',5('  -----'))                              RESULT   3085
 1110 FORMAT(I6,1X,3A4,3F7.3,F7.2)                                      RESULT   3086
 1120 FORMAT('  MONITORED BUS CONDITIONS AT TIME =',F9.3,' SEC',/,2X    RESULT   3087
     *,47('='),//,'  BUS# STATION NAME     ER     EI     VM   VANG',/   RESULT   3088
     &,'  ---- ------------',4('   ----'))                              RESULT   3089
 1130 FORMAT(8X                                                         RESULT   3090
     *,'LINE FLOW AND RELAY STATUS AT FROM BUS TERMINAL AT TIME =',F9.3 RESULT   3091
     *,' SEC',/,8X,70('='),//,'  FROM',T18,'TO',/,2('  BUS# STN NAME')  RESULT   3092
     *,'  CID      MW      MX      CM    CANG   APPR   APPX  RS',/      RESULT   3093
     &,2('  ---- --------'),'  ---',4('    ----'),2('   ----'),'  --')  RESULT   3094
 1140 FORMAT(2(I6,1X,2A4),3X,A2,3F8.3,F8.2,2F7.3,3X,A1)                 RESULT   3095
 1150 FORMAT(' TIME =',F7.3,' SEC.','ITER=',I5,3('  *  *  '),4X,        RESULT   3096
     1'H =',F12.8,4X,3(' * * '),'ITTER=',I8,'  TIME =',F7.3,' SEC.')    RESULT   3097
 1200 FORMAT(10X,'SVC/REACTOR CONDITION AT TIME =',F9.3,' SEC',/,10X    RESULT   3098
     *,44('='),/,' BUS# STATION NAME CID  TYPE     RVM     SVM      MX' RESULT   3099
     *,'     MHO    KSAT',/,' ---- ------------ --- ----',5('    ----'))RESULT   3100
 1210 FORMAT(I5,1X,3A4,1X,A2,1X,I5,2F8.4,2F8.3,3F8.4)                   RESULT   3101
 1230 FORMAT(41X,'MOTOR CONDITIONS AT TIME =',F9.3,' SEC',/,41X         RESULT   3102
     *,39('='),/,'  BUS# STATION NAME MID TYPE      VM      MW      MX' RESULT   3103
     2,'     SPDD      CM    TMEC    TGAP     V''D     V''Q     DR'     RESULT   3104
     *,'     DS     DX',/,'  ---- ------------ --- ---- ',3('   ---- ') RESULT   3105
     *,6('    ----'),3('   ----'))                                      RESULT   3106
 1240 FORMAT(I6,1X,3A4,A4,I5,3F8.4,F9.5,5F8.4,3F7.4)                    RESULT   3107
 1250 FORMAT(33X,'GENERATOR & CONTROL STATES AT TIME =',F9.3,' SEC'     RESULT   3108
     *,/,33X,49('='),/,'  BUS# STATION NAME  CID'                       RESULT   3109
     *,5(' STATE#      VALUE'),/,'  ---- ------------  ---'             RESULT   3110
     *,5(' ------      -----'))                                         RESULT   3111
 1260 FORMAT(I6,1X,3A4,3X,A2,5(I7,1X,F10.4))                            RESULT   3112
 1310 FORMAT(21X,'PRIME MOVER VARIABLES AT TIME =',F9.3,' SEC',/        RESULT   3113
     *,21X,44('='),/,'  BUS# STATION NAME  CID  IGV       FACV'         RESULT   3114
     *,'       FAIV        AIV        PVP        XVS1',/                RESULT   3115
     *,'  ---- ------------ --- ----',5('       ----'))                 RESULT   3116
 1320 FORMAT(I6,1X,3A4,3X,A2,I6,5(G11.4))                               RESULT   3117
 1330 FORMAT(11X,'GENERATOR CONTROL SIGNALS AT TIME =',F9.3,' SEC',/    RESULT   3118
     *,11X,48('='),/,'  BUS# STATION NAME  CID       VREG        VSO'   RESULT   3119
     *,'       VUAL        GSO',/,'  ---- ------------  ---'            RESULT   3120
     *,4('       ----'))                                                RESULT   3121
 1340 FORMAT(I6,1X,3A4,3X,A2,5(G11.4))                                  RESULT   3122
 1350 FORMAT(31X,'GENERATOR & CONTROL Y VARIABLES AT TIME =',F9.3       RESULT   3123
     *,' SEC',/,31X,54('='),/,'  BUS# STATION NAME  CID'                RESULT   3124
     *,5('  YVAR#      VALUE')                                          RESULT   3125
     *,/,'  ---- ------------  ---',5(' ------      -----'))            RESULT   3126
 1360 FORMAT(8X,'INTERFACE FLOW AT TIME =',F9.3,' SEC',/,8X,37('=')     RESULT   3127
     *,/,'  FROM',T18,'TO',/,2('  BUS# STN NAME')                       RESULT   3128
     *,'  CID       MW      MX',/,2('  ---- --------'),'  --- '         RESULT   3129
     *,2('    ----'))                                                   RESULT   3130
 1370 FORMAT(2(I6,1X,2A4),3X,A2,1X,2F8.2)                               RESULT   3131
 1380 FORMAT(I6,1X,6A4,5X,2F8.2,/)                                      RESULT   3132
 1390 FORMAT(I6,1X,3A4,4F7.3,F7.4)                                      RESULT   3133
 1400 FORMAT(27X,'CONVERTOR CONDITION AT TIME =',F10.3,' SEC',/         RESULT   3134
     *,27X,43('='),/,8X,'CONVERTER NAME',11X,'AC PU    DC KV     DC KA' RESULT   3135
     &,'    ALPHA    GAMMA    P (MW)  Q (MVAR)',/                       RESULT   3136
     &,1X,29('-'),2('   ----- '),4('    -----'),'-  --------')          RESULT   3137
 1401 FORMAT(27X,'CONVERTOR CONDITION AT TIME =',F10.3,' SEC',/         RESULT   3138
     *,27X,43('='),/,8X,'CONVERTER NAME',11X,'AC PU    DC KV     DC KA' RESULT   3139
     &,'    ALPHA    GAMMA    PT (MW)  QT (MVAR)',/                     RESULT   3140
     &,1X,29('-'),2('   ----- '),4('    -----'),'-  --------')          RESULT   3141
 1410 FORMAT(1X,A29,F8.4,F9.3,F10.5,2F9.3,2F10.3)                       RESULT   3142
 1420 FORMAT(35X,'USER DEFINED DC CONTROL VARIABLES AT TIME',F9.3       RESULT   3143
     *,' SEC',/,35X,54('='),/,4(' VARIABLE NAME',11X,'VALUE '),/        RESULT   3144
     *,4(1X,13('-'),11X,'----- '))                                      RESULT   3145
 1430 FORMAT(4(1X,A17,F12.4,1X))                                        RESULT   3146
 1440 FORMAT(44X,'DC BUS VOLTAGE AT TIME =',F9.3,' SEC',/,44X           RESULT   3147
     *,37('='),/,6(' BUS NAME',8X,'KV  '),/,6(1X,8('-'),6X,'----  '))   RESULT   3148
 1450 FORMAT(6(1X,A8,F10.3,2X))                                         RESULT   3149
 1460 FORMAT(18X,'USER DEFINED SVC CONDITION AT TIME =',F9.3,' SEC'     RESULT   3150
     *,/,18X,49('='),/,'  BUS# STATION NAME CID ',5(' BL#  OUTPUT'),/   RESULT   3151
     *,'  ---- ------------ ---',5(' ---  ------'))                     RESULT   3152
 1470 FORMAT(I6,1X,3A4,1X,A2,1X,5(I4,F8.3))                             RESULT   3153
 1480 FORMAT(16X,'USER DEFINED GOVERNOR CONDITION AT TIME =',F9.3       RESULT   3154
     *,' SEC',/,16X,54('='),/,'  BUS# STATION NAME  CID'                RESULT   3155
     *,5(' BL#  OUTPUT'),/,'  ---- ------------  ---'                   RESULT   3156
     *,5(' ---  ------'))                                               RESULT   3157
 1490 FORMAT(I6,1X,3A4,3X,A2,5(I4,F8.3))                                RESULT   3158
 1500 FORMAT(16X,'USER DEFINED EXCITER CONDITION AT TIME =',F9.3        RESULT   3159
     *,' SEC',/,16X,53('='),/,'  BUS# STATION NAME  CID'                RESULT   3160
     *,5(' BL#  OUTPUT'),/,'  ---- ------------  ---'                   RESULT   3161
     *,5(' ---  ------'))                                               RESULT   3162
 1510 FORMAT(18X,'USER DEFINED PSS CONDITION AT TIME =',F9.3,' SEC'     RESULT   3163
     *,/,18X,49('='),/,'  BUS# STATION NAME  CID',5(' BL#  OUTPUT'),/   RESULT   3164
     *,'  ---- ------------  ---',5(' ---  ------'))                    RESULT   3165
 1520 FORMAT(7X,'USER DEFINED EXCITATION LIMITER CONDITION'             RESULT   3166
     &,' AT TIME =',F9.3,' SEC',/,7X,69('='),/                          RESULT   3167
     *,'  BUS# STATION NAME  CID',5(' BL#  OUTPUT')                     RESULT   3168
     &,/,'  ---- ------------  ---',5(' ---  ------'))                  RESULT   3169
 1530 FORMAT(27X,'USER DEFINED RANI CONDITION AT TIME =',F9.3           RESULT   3170
     *,' SEC',/,27X                                                     RESULT   3171
     *,50('='),/,2('  BUS# STATION NAME'),'  CID',5(' BL#  OUTPUT'),/   RESULT   3172
     *,2('  ---- ------------'),'  ---',5(' ---  ------'))              RESULT   3173
 1540 FORMAT(2(I6,1X,3A4),3X,A2,5(I4,F8.3))                             RESULT   3174
 1550 FORMAT(27X,'USER DEFINED STC CONDITION AT TIME =',F9.3,' SEC'     RESULT   3175
     *,/,27X,49('='),/,2('  BUS# STATION NAME'),'  CID'                 RESULT   3176
     *,5(' BL#  OUTPUT'),/                                              RESULT   3177
     *,2('  ---- ------------'),'  ---',5(' ---  ------'))              RESULT   3178
 1560 FORMAT(27X,'USER DEFINED SPS CONDITION AT TIME =',F9.3,' SEC'     RESULT   3179
     *,/,27X,49('='),/,2('  BUS# STATION NAME'),'  CID'                 RESULT   3180
     *,5(' BL#  OUTPUT'),/,2('  ---- ------------'),'  ---'             RESULT   3181
     *,5(' ---  ------'))                                               RESULT   3182
 1570 FORMAT(18X,'USER DEFINED SDB CONDITION AT TIME =',F9.3,' SEC'     RESULT   3183
     *,/,18X,49('='),/,'  BUS# STATION NAME  CID',5(' BL#  OUTPUT'),/   RESULT   3184
     *,'  ---- ------------  ---',5(' ---  ------'))                    RESULT   3185
C                                                                       RESULT   3186
 1575 FORMAT(11X,'FOSSIL FIRED POWER PLANT AT TIME =',                  RESULT   3187
     * F9.3,' SEC',/,11X,34('='),/)                                     RESULT   3188
 1580 FORMAT(11X,'FOSSIL FIRED POWER PLANT CONTROL SIGNALS AT TIME =',  RESULT   3189
     * F9.3,' SEC',/                                                    RESULT   3190
     *,11X,50('='),//,'  BUS# STATION NAME  CID     COUMW    COUTP'     RESULT   3191
     *,'   COUFW2   COUFWS    COUEO    COUSA     COUF    COUFP    COUDP'RESULT   3192
     *,/,'  ---- ------------  ---     -----    -----   ------   ------'RESULT   3193
     *,'    -----    -----     ----    -----    -----')                 RESULT   3194
 1585 FORMAT(I6,1X,3A4,3X,A2,9(1X,F8.3))                                RESULT   3195
 1590 FORMAT(I6,1X,3A4,3X,A2,1X,5(G11.4))                               RESULT   3196
 1600 FORMAT(/,'  BUS# STATION NAME  CID     SWTT      SWHPT'           RESULT   3197
     *,'     SVGOV      BLDW      FWFW     FNBFP       QWC      HWTC'   RESULT   3198
     *,'       SPD     CCVTP'                                           RESULT   3199
     *,/,'  ---- ------------  ---     ----      -----     -----'       RESULT   3200
     *,'      ----      ----     -----       ---      ----'             RESULT   3201
     *,'       ---     -----',/,I6,1X,3A4,3X,A2,1X,10(1X,F9.3))         RESULT   3202
 1610 FORMAT('                             STSVI     SWDSH'             RESULT   3203
     *,'     STIVI     HTETA       HPF      HWLK      AWWF     QWPAT'   RESULT   3204
     *,'      QCRT     HXAIR'                                           RESULT   3205
     *,/,'                             -----     -----     -----'       RESULT   3206
     *,'      ----      ----     -----       ---      ----'             RESULT   3207
     *,'       ---     -----',/,25X,10(1X,F9.3))                        RESULT   3208
 1620 FORMAT('                             HTGOF     ATSHO'             RESULT   3209
     *,'     GTSHO     FTECO    BWRECN     BWSTM      GWFG'             RESULT   3210
     *,/,'                             -----     -----     -----'       RESULT   3211
     *,'     -----     -----    ------      ----',/,25X,10(1X,F9.3))    RESULT   3212
 1630 FORMAT(/,'  BUS# STATION NAME  CID       Q45      Q12N'           RESULT   3213
     *,'      Q34N       NGP      DQGP     DNGP     QFUEL     WFUEL'    RESULT   3214
     *,'       YWF       ZWF'                                           RESULT   3215
     *,/,'  ---- ------------  ---      ----      ----      ----'       RESULT   3216
     *,'       ---      ----     -----     -----     -----'             RESULT   3217
     *,'       ---       ---',/,I6,1X,3A4,3X,A2,1X,10(1X,F9.3))         RESULT   3218
 1640 FORMAT('                              W61N      W24N'             RESULT   3219
     *,'      W26N      PPN2      PPN3      PPN4      PPN5      TTN3'   RESULT   3220
     *,'      TTN4      TTN5'                                           RESULT   3221
     *,/,'                              ----      ----      ----'       RESULT   3222
     *,'      ----      ----      ----      ----      ----'             RESULT   3223
     *,'      ----      ----',/,25X,10(1X,F9.3))                        RESULT   3224
 1650 FORMAT('                             TTNM4     TTNM5'             RESULT   3225
     *,'     TMCMP     TMGPT     TMPWT      ZIGV      ZBLD'             RESULT   3226
     *,/,'                             -----     -----     -----'       RESULT   3227
     *,'     -----     -----      ----      ----',/,25X,10(1X,F9.3))    RESULT   3228
 1660 FORMAT(11X,'COMBUSTION TURBINE UNIT OUTPUT AT TIME =',            RESULT   3229
     * F9.3,' SEC',/,11X,40('='),/)                                     RESULT   3230
 1670 FORMAT(11X,'COMBUSTION TURBINE UNIT CONTROL SIGNALS AT TIME =',   RESULT   3231
     * F9.3,' SEC',/                                                    RESULT   3232
     *,11X,49('='),//,'  BUS# STATION NAME  CID     SRAMP    CSPNG'     RESULT   3233
     *,'   COUNG    CSPNP     COUNP    CSPT5    COUT5   CSLOAD     MODE'RESULT   3234
     *,/,'  ---- ------------  ---     -----    -----    -----   ----- 'RESULT   3235
     *,'    -----    -----    -----   ------     ----')                 RESULT   3236
 1680 FORMAT(///,10X,5('* ')                                            RESULT   3237
     *,' GENERATOR KINETIC AND POTENTIAL ENERGY AT TS=',F10.5,' SEC'    RESULT   3238
     *,5(' *'),//                                                       RESULT   3239
     *,'  BUS# STATION NAME GID KINETIC ENERGY   POTENTIAL ENERGY',/    RESULT   3240
     *,' ----- ------------ --- --------------   ----------------',/)   RESULT   3241
 1690 FORMAT(I6,1X,3A4,1X,A2,F16.5,F19.5)                               RESULT   3242
 1700 FORMAT(/,8X,'SYSTEM TOTAL  ',F16.5,F19.5)                         RESULT   3243
C                                                                       RESULT   3244
 1710 FORMAT(11X,'NUCLEAR PWR POWER PLANT AT TIME =',                   RESULT   3245
     * F9.3,' SEC',/,11X,33('='),/)                                     RESULT   3246
 1720 FORMAT(/,'  BUS# STATION NAME  CID     SWTT      SWHPTN'          RESULT   3247
     *,'     SWLTPN    SVGOV     SPDOH     FWFWN    BWSTMN     BLSG5V'  RESULT   3248
     *,      /,'  ---- ------------  ---     ----      ------'          RESULT   3249
     *,'     ------    -----     -----     -----    ------     ------'  RESULT   3250
     *,/,I6,1X,3A4,3X,A2,1X,10(1X,F9.3))                                RESULT   3251
 1730 FORMAT(  '                              RN        RZROD'          RESULT   3252
     *,'      HTRO      HPRO     HTAVG    HWRCTN     HQSGN      HQCN'   RESULT   3253
     *,'     PPPRZ'                                                     RESULT   3254
     *,/,      '                            -----       -----'          RESULT   3255
     *,'      ----      ----     -----    ------     -----      ----'   RESULT   3256
     *,'     -----     ',/,25X,10(1X,F9.3))                             RESULT   3257
C                                                                       RESULT   3258
 1740 FORMAT(11X,'CANDU NUCLEAR POWER PLANT AT TIME =',                 RESULT   3259
     * F9.3,' SEC',/,11X,48('='),/)                                     RESULT   3260
 1750 FORMAT(/,'  BUS# STATION NAME  CID      SWTT     SWHPTN'          RESULT   3261
     *,'    SWLTPN     SVGOV     SPDOH     FWFWN    BWSTMN    BWRECN'   RESULT   3262
     *,/,'  ---- ------------  ---      ----     ------    ------'      RESULT   3263
     *,'     -----     -----     -----    ------    ------'             RESULT   3264
     *,/,I6,1X,3A4,3X,A2,1X,10(1X,F9.3))                                RESULT   3265
 1760 FORMAT('                              BWDCN    BLSG5L'            RESULT   3266
     *,'      RN        HPRO    HWRCTN     HQSGN     HQPHN      HQCN'   RESULT   3267
     *,'     PPPRZ'                                                     RESULT   3268
     *,/,'                              -----    ------    ------'      RESULT   3269
     *,'      ----    ------     -----     -----      ----'             RESULT   3270
     *,'     -----     ',/,25X,10(1X,F9.3))                             RESULT   3271
 1770 FORMAT(40X,'BWR NUCLEAR POWER PLANT AT TIME =',                   RESULT   3272
     * F9.3,' SEC',/,40X,46('='),/)                                     RESULT   3273
 1780 FORMAT(/,'  BUS# STATION NAME  CID       SQFN      SQCN'          RESULT   3274
     *,'     XFGAV       SZB    XXCORO     RTFAV     STCAV    SPCORE'   RESULT   3275
     *,/,'  ---- ------------  ---       ----      ----'                RESULT   3276
     *,'     -----       ---    ------     -----     -----    ------'   RESULT   3277
     *,/,I6,1X,3A4,3X,A2,1X,8(1X,F9.3))                                 RESULT   3278
 1790 FORMAT('                              SPND1     SPND2'            RESULT   3279
     *,'     SPND3    SWSTMN      FL34     SWRVN    SWBPSN      FLMC'   RESULT   3280
     *      ,/,'                              -----     -----'          RESULT   3281
     *,'     -----    ------      ----     -----    ------      ----'   RESULT   3282
     *,/,25X,8(1X,F9.3))                                                RESULT   3283
 1800 FORMAT('                             FLFDWN     SCGOV'            RESULT   3284
     *,'       W16      SXBV      SPGN    SLVSNS'                       RESULT   3285
     *      ,/,'                             ------     -----'          RESULT   3286
     *,'       ---      ----      ----    ------'                       RESULT   3287
     *,/,25X,6(1X,F9.3))                                                RESULT   3288
      END                                                               RESULT   3289
