CFPRIME TGEINT                                                          TGEINT      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 TGEINT(IUX)                                            TGEINT      3
CD                                                                      TGEINT      4
CD    TO TABULATE SYNCHRONOUS MACHINE INITIAL CONDITIONS.               TGEINT      5
CD                                                                      TGEINT      6
      INCLUDE 'PARX.INS'                                                TGEINT      7
      INCLUDE 'CNPT.INS'                                                TGEINT      8
      INCLUDE 'CNIPTR.INS'                                              TGEINT      9
      INCLUDE 'CNB3.INS'                                                TGEINT     10
      INCLUDE 'CNSTN.INS'                                               TGEINT     11
      INCLUDE 'CNMDAT.INS'                                              TGEINT     12
      INCLUDE 'CNVOLT.INS'                                              TGEINT     13
      INCLUDE 'CNB1.INS'                                                TGEINT     14
      INCLUDE 'CNB5.INS'                                                TGEINT     15
      INCLUDE 'CNB8.INS'                                                TGEINT     16
      INCLUDE 'CNB19.INS'                                               TGEINT     17
      INCLUDE 'CNREC1.INS'                                              TGEINT     18
      INCLUDE 'CNNNEW.INS'                                              TGEINT     19
      INCLUDE 'CNMSTA.INS'                                              TGEINT     20
      INCLUDE 'CNXSTA.INS'                                              TGEINT     21
      INCLUDE 'CNMYVA.INS'                                              TGEINT     22
      INCLUDE 'CNYVAR.INS'                                              TGEINT     23
      INCLUDE 'CNEXC.INS'                                               TGEINT     24
      INCLUDE 'CNUDM.INS'                                               TGEINT     25
      INCLUDE 'CNUDIC.INS'                                              TGEINT     26
C                                                                       TGEINT     27
      CHARACTER*4 CKID                                                  TGEINT     28
      REAL SWSTMR                                                       TGEINT     29
C                                                                       TGEINT     30
      COMPLEX VOLTG,VOLTC                                               TGEINT     31
      DIMENSION EVOLTG(2),EVOLTC(2)                                     TGEINT     32
      EQUIVALENCE (VOLTG,EVOLTG(1),GTREAL),(EVOLTG(2),GTIMAG)           TGEINT     33
      EQUIVALENCE (VOLTC,EVOLTC(1),CVREAL),(EVOLTC(2),CVIMAG)           TGEINT     34
C                                                                       TGEINT     35
      DATA ILDEF/60/                                                    TGEINT     36
C                                                                       TGEINT     37
      IL=ILDEF                                                          TGEINT     38
      DO 100 LK=1,LBUSNO                                                TGEINT     39
      K=NNEW(LK)                                                        TGEINT     40
      IF(K.EQ.0.OR.K.GT.IPNODE)GOTO 100                                 TGEINT     41
      KN=K*3                                                            TGEINT     42
      NLF=NOLD(K)                                                       TGEINT     43
      VOLTG=VOLT(K)                                                     TGEINT     44
      VANG=ATAN2(GTIMAG,GTREAL)*57.29578                                TGEINT     45
      VMAG=GTREAL**2+GTIMAG**2                                          TGEINT     46
      GTV=SQRT(VMAG)                                                    TGEINT     47
      I1=NTHG(K)                                                        TGEINT     48
      I2=NTHG(K+1)-1                                                    TGEINT     49
      DO 105 N=I1,I2                                                    TGEINT     50
      IGENS=ICONTA(1,N)                                                 TGEINT     51
      IF(IGENS.NE.4)THEN                                                TGEINT     52
      JG=JCONTA(1,N)                                                    TGEINT     53
      JY=MYVAR(1,N)                                                     TGEINT     54
      JYE=MYVAR(2,N)                                                    TGEINT     55
      JYP=MYVAR(5,N)                                                    TGEINT     56
      IEXN=ICONTA(4,N)                                                  TGEINT     57
      IGVN=ICONTA(2,N)                                                  TGEINT     58
      IF(IGVN.GT.40.AND.IGVN.LE.46)IGVN=0                               TGEINT     59
      BMVA=DDAT(JG+3)/BASPC                                             TGEINT     60
      CKID(1:2)=NDGC(N)(3:4)                                            TGEINT     61
      PMW=PDG(JY+2)*BASPC                                               TGEINT     62
      QMVR=PQG(JY+3)*BASPC                                              TGEINT     63
      CDGN=CDG(1,N)/BMVA                                                TGEINT     64
      CQGN=CDG(2,N)/BMVA                                                TGEINT     65
      JSTATE=MSTATE(1,N)                                                TGEINT     66
      DELTA=XSTATE(JSTATE+2)*57.29578+DOFFST                            TGEINT     67
      IF (DELTA.GT.180.0) THEN                                          TGEINT     68
         DELTA=DELTA-360.0*AINT((DELTA+180.0)/360.0)                    TGEINT     69
      ELSE IF (DELTA.LT.-180.0) THEN                                    TGEINT     70
         DELTA=DELTA-360.0*AINT((DELTA-180.0)/360.0)                    TGEINT     71
      END IF                                                            TGEINT     72
      IF(IL.GE.ILDEF)THEN                                               TGEINT     73
      IL=7                                                              TGEINT     74
      WRITE(IUX,2000)                                                   TGEINT     75
      ENDIF                                                             TGEINT     76
      IF(IEXN.NE.0)THEN                                                 TGEINT     77
         IF(IGVN.NE.0.AND.IGVN.NE.20)THEN                               TGEINT     78
            WRITE(IUX,2010) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       TGEINT     79
     *,           CKID,DDAT(JG+3),GTV,VANG,PMW,QMVR,CDGN,CQGN           TGEINT     80
     *,           DELTA,DDAT(JG+32),DDAT(JG+33),EFD(JY+4)               TGEINT     81
     *,           VREF(JYE+2),VREF(JYP+1)                               TGEINT     82
         ELSE                                                           TGEINT     83
            WRITE(IUX,2010) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       TGEINT     84
     *,           CKID,DDAT(JG+3),GTV,VANG,PMW,QMVR,CDGN,CQGN           TGEINT     85
     *,           DELTA,DDAT(JG+32),DDAT(JG+33),EFD(JY+4)               TGEINT     86
     *,           VREF(JYE+2)                                           TGEINT     87
         ENDIF                                                          TGEINT     88
      ELSE                                                              TGEINT     89
         IF(IGVN.NE.0.AND.IGVN.NE.20)THEN                               TGEINT     90
            WRITE(IUX,2040) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       TGEINT     91
     *,           CKID,DDAT(JG+3),GTV,VANG,PMW,QMVR,CDGN,CQGN           TGEINT     92
     *,           DELTA,DDAT(JG+32),DDAT(JG+33),EFD(JY+4)               TGEINT     93
     *,           VREF(JYP+1)                                           TGEINT     94
         ELSE                                                           TGEINT     95
            WRITE(IUX,2010) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       TGEINT     96
     *,           CKID,DDAT(JG+3),GTV,VANG,PMW,QMVR,CDGN,CQGN           TGEINT     97
     *,           DELTA,DDAT(JG+32),DDAT(JG+33),EFD(JY+4)               TGEINT     98
         ENDIF                                                          TGEINT     99
      ENDIF                                                             TGEINT    100
      IL=IL+1                                                           TGEINT    101
      ENDIF                                                             TGEINT    102
C                                                                       TGEINT    103
  105 CONTINUE                                                          TGEINT    104
  100 CONTINUE                                                          TGEINT    105
C                                                                       TGEINT    106
C     CLASSICAL MACHINE                                                 TGEINT    107
C                                                                       TGEINT    108
      IL=ILDEF                                                          TGEINT    109
      DO 250 LK=1,LBUSNO                                                TGEINT    110
        K=NNEW(LK)                                                      TGEINT    111
        IF(K.EQ.0.OR.K.GT.IPNODE)GOTO 250                               TGEINT    112
        KN=K*3                                                          TGEINT    113
        NLF=NOLD(K)                                                     TGEINT    114
        VOLTG=VOLT(K)                                                   TGEINT    115
        VANG=ATAN2(GTIMAG,GTREAL)*57.29578                              TGEINT    116
        VMAG=GTREAL**2+GTIMAG**2                                        TGEINT    117
        GTV=SQRT(VMAG)                                                  TGEINT    118
        I1=NTHG(K)                                                      TGEINT    119
        I2=NTHG(K+1)-1                                                  TGEINT    120
        DO 200 N=I1,I2                                                  TGEINT    121
          IGENS=ICONTA(1,N)                                             TGEINT    122
          IF(IGENS.EQ.4)THEN                                            TGEINT    123
            JG=JCONTA(1,N)                                              TGEINT    124
            JY=MYVAR(1,N)                                               TGEINT    125
            JYP=MYVAR(5,N)                                              TGEINT    126
            IGVN=ICONTA(2,N)                                            TGEINT    127
            CKID(1:2)=NDGC(N)(3:4)                                      TGEINT    128
            PMW=PDG(JY+2)*BASPC                                         TGEINT    129
            QMVR=PQG(JY+3)*BASPC                                        TGEINT    130
            BMVA=DDAT(JG+3)/BASPC                                       TGEINT    131
            CDGN=CDG(1,N)                                               TGEINT    132
            CQGN=CDG(2,N)                                               TGEINT    133
            EPD=GTREAL-CQGN/XPD(N)                                      TGEINT    134
            EPQ=GTIMAG+CDGN/XPD(N)                                      TGEINT    135
            EFDN=SQRT(EPD**2+EPQ**2)                                    TGEINT    136
            CDGN=CDGN/BMVA                                              TGEINT    137
            CQGN=CQGN/BMVA                                              TGEINT    138
            JS=MSTATE(1,N)                                              TGEINT    139
            DELTA=XSTATE(JS+2)*57.29578                                 TGEINT    140
            IF (DELTA.GT.180.0) THEN                                    TGEINT    141
               DELTA=DELTA-360.0*AINT((DELTA+180.0)/360.0)              TGEINT    142
            ELSE IF (DELTA.LT.-180.0) THEN                              TGEINT    143
               DELTA=DELTA-360.0*AINT((DELTA-180.0)/360.0)              TGEINT    144
            END IF                                                      TGEINT    145
            IF(IL.GE.ILDEF)THEN                                         TGEINT    146
              WRITE(IUX,2020)                                           TGEINT    147
              IL=7                                                      TGEINT    148
            ENDIF                                                       TGEINT    149
            IF(IGVN.NE.0.AND.IGVN.NE.20)THEN                            TGEINT    150
              WRITE(IUX,2030)NLF,INAME(KN-2),INAME(KN-1),INAME(KN),     TGEINT    151
     +              CKID,DDAT(JG+3),GTV,VANG,PMW,QMVR,CDGN,CQGN,EFDN,   TGEINT    152
     +              DELTA,VREF(JYP+1)                                   TGEINT    153
            ELSE                                                        TGEINT    154
              WRITE(IUX,2030)NLF,INAME(KN-2),INAME(KN-1),INAME(KN),     TGEINT    155
     +              CKID,DDAT(JG+3),GTV,VANG,PMW,QMVR,CDGN,CQGN,EFDN,   TGEINT    156
     +              DELTA                                               TGEINT    157
            ENDIF                                                       TGEINT    158
          ENDIF                                                         TGEINT    159
 200  CONTINUE                                                          TGEINT    160
 250  CONTINUE                                                          TGEINT    161
      IF(ILBOIL.LE.0) GOTO 500                                          TGEINT    162
C                                                                       TGEINT    163
C     BWR NUCLEAR PLANT MODEL                                           TGEINT    164
C                                                                       TGEINT    165
      IL=ILDEF                                                          TGEINT    166
      DO 260 LK=1,LBUSNO                                                TGEINT    167
        K=NNEW(LK)                                                      TGEINT    168
        IF(K.EQ.0.OR.K.GT.IPNODE)GOTO 260                               TGEINT    169
        KN=K*3                                                          TGEINT    170
        NLF=NOLD(K)                                                     TGEINT    171
        I1=NTHG(K)                                                      TGEINT    172
        I2=NTHG(K+1)-1                                                  TGEINT    173
        DO 255 N=I1,I2                                                  TGEINT    174
          IGENS=ICONTA(1,N)                                             TGEINT    175
          IF(IGENS.NE.4)THEN                                            TGEINT    176
            JGG=JCONTA(2,N)                                             TGEINT    177
            IGVN=ICONTA(2,N)                                            TGEINT    178
            CKID(1:2)=NDGC(N)(3:4)                                      TGEINT    179
          ELSE                                                          TGEINT    180
            IGVN=0                                                      TGEINT    181
          ENDIF                                                         TGEINT    182
C                                                                       TGEINT    183
          IF(IGVN .EQ.46)THEN                                           TGEINT    184
            IF(IL.GE.ILDEF)THEN                                         TGEINT    185
              WRITE(IUX,2050)                                           TGEINT    186
              IL=7                                                      TGEINT    187
            ENDIF                                                       TGEINT    188
            SWSTMR=DDAT(JGG+120)                                        TGEINT    189
            WRITE(IUX,2060) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       TGEINT    190
     *                     ,CKID(1:2),DDAT(JGG+85)/1000.                TGEINT    191
     *                     ,DDAT(JGG+402)/1000.,DDAT(JGG+120)           TGEINT    192
     *                     ,DDAT(JGG+564)*SWSTMR,DDAT(JGG+391)          TGEINT    193
     *                     ,DDAT(JGG+390),DDAT(JGG+405)/1000.           TGEINT    194
     *                     ,DDAT(JGG+404)/1000.                         TGEINT    195
            WRITE(IUX,2070) DDAT(JGG+407)/1000.,DDAT(JGG+406)/1000.     TGEINT    196
     *                     ,DDAT(JGG+28),DDAT(JGG+431),DDAT(JGG+89)     TGEINT    197
     *                     ,DDAT(JGG+442),DDAT(JGG+30)                  TGEINT    198
     *                     ,DDAT(JGG+244)*SWSTMR                        TGEINT    199
          ENDIF                                                         TGEINT    200
 255    CONTINUE                                                        TGEINT    201
 260  CONTINUE                                                          TGEINT    202
C                                                                       TGEINT    203
C                                                                       TGEINT    204
C     FOSSIL FIRED  PLANT MODEL                                         TGEINT    205
C                                                                       TGEINT    206
      IL=ILDEF                                                          TGEINT    207
      DO 270 LK=1,LBUSNO                                                TGEINT    208
        K=NNEW(LK)                                                      TGEINT    209
        IF(K.EQ.0.OR.K.GT.IPNODE)GOTO 270                               TGEINT    210
        KN=K*3                                                          TGEINT    211
        NLF=NOLD(K)                                                     TGEINT    212
        I1=NTHG(K)                                                      TGEINT    213
        I2=NTHG(K+1)-1                                                  TGEINT    214
        DO 265 N=I1,I2                                                  TGEINT    215
          IGENS=ICONTA(1,N)                                             TGEINT    216
          IF(IGENS.NE.4)THEN                                            TGEINT    217
            JGG=JCONTA(2,N)                                             TGEINT    218
            IGVN=ICONTA(2,N)                                            TGEINT    219
            CKID(1:2)=NDGC(N)(3:4)                                      TGEINT    220
          ELSE                                                          TGEINT    221
            IGVN=0                                                      TGEINT    222
          ENDIF                                                         TGEINT    223
C                                                                       TGEINT    224
        IF(IGVN .EQ.41 .OR. IGVN.EQ.42)THEN                             TGEINT    225
          IF(IL.GE.ILDEF)THEN                                           TGEINT    226
            WRITE(IUX,2080)                                             TGEINT    227
            IL=7                                                        TGEINT    228
          ENDIF                                                         TGEINT    229
          WRITE(IUX,2090) NLF,INAME(KN-2),INAME(KN-1),INAME(KN),CKID    TGEINT    230
     *                   ,DDAT(JGG+504)/1000.,DDAT(JGG+503)/1000.       TGEINT    231
     *                   ,DDAT(JGG+421)                                 TGEINT    232
     *                   ,DDAT(JGG+425),DDAT(JGG+452)                   TGEINT    233
     *                   ,DDAT(JGG+451),DDAT(JGG+500)/1000.             TGEINT    234
          WRITE(IUX,2100) DDAT(JGG+501)/1000.,DDAT(JGG+502)/1000.       TGEINT    235
     *                   ,DDAT(JGG+411)                                 TGEINT    236
     *                   ,DDAT(JGG+414)                                 TGEINT    237
        ENDIF                                                           TGEINT    238
 265    CONTINUE                                                        TGEINT    239
 270  CONTINUE                                                          TGEINT    240
C                                                                       TGEINT    241
C     CANDU NUCLEAR  PLANT MODEL                                        TGEINT    242
C                                                                       TGEINT    243
      IL=ILDEF                                                          TGEINT    244
      DO 280 LK=1,LBUSNO                                                TGEINT    245
        K=NNEW(LK)                                                      TGEINT    246
        IF(K.EQ.0.OR.K.GT.IPNODE)GOTO 280                               TGEINT    247
        KN=K*3                                                          TGEINT    248
        NLF=NOLD(K)                                                     TGEINT    249
        I1=NTHG(K)                                                      TGEINT    250
        I2=NTHG(K+1)-1                                                  TGEINT    251
        DO 275 N=I1,I2                                                  TGEINT    252
          IGENS=ICONTA(1,N)                                             TGEINT    253
          IF(IGENS.NE.4)THEN                                            TGEINT    254
            JGG=JCONTA(2,N)                                             TGEINT    255
            IGVN=ICONTA(2,N)                                            TGEINT    256
            CKID(1:2)=NDGC(N)(3:4)                                      TGEINT    257
          ELSE                                                          TGEINT    258
            IGVN=0                                                      TGEINT    259
          ENDIF                                                         TGEINT    260
C                                                                       TGEINT    261
        IF(IGVN .EQ.44)THEN                                             TGEINT    262
          IF(IL.GE.ILDEF)THEN                                           TGEINT    263
            WRITE(IUX,2110)                                             TGEINT    264
            IL=7                                                        TGEINT    265
          ENDIF                                                         TGEINT    266
          WRITE(IUX,2120) NLF,INAME(KN-2),INAME(KN-1),INAME(KN),CKID    TGEINT    267
     *                   ,DDAT(JGG+435)/1000.,DDAT(JGG+434)/1000.       TGEINT    268
     *                   ,DDAT(JGG+368)                                 TGEINT    269
     *                   ,DDAT(JGG+371),DDAT(JGG+344)                   TGEINT    270
     *                   ,DDAT(JGG+343),DDAT(JGG+432)/1000.             TGEINT    271
          WRITE(IUX,2130) DDAT(JGG+433)/1000.,DDAT(JGG+266)             TGEINT    272
     *                   ,DDAT(JGG+351)                                 TGEINT    273
     *                   ,DDAT(JGG+355)                                 TGEINT    274
        ENDIF                                                           TGEINT    275
 275    CONTINUE                                                        TGEINT    276
 280  CONTINUE                                                          TGEINT    277
C                                                                       TGEINT    278
C                                                                       TGEINT    279
C     PWR NUCLEAR  PLANT MODEL                                          TGEINT    280
C                                                                       TGEINT    281
      IL=ILDEF                                                          TGEINT    282
      DO 290 LK=1,LBUSNO                                                TGEINT    283
        K=NNEW(LK)                                                      TGEINT    284
        IF(K.EQ.0.OR.K.GT.IPNODE)GOTO 290                               TGEINT    285
        KN=K*3                                                          TGEINT    286
        NLF=NOLD(K)                                                     TGEINT    287
        I1=NTHG(K)                                                      TGEINT    288
        I2=NTHG(K+1)-1                                                  TGEINT    289
        DO 285 N=I1,I2                                                  TGEINT    290
          IGENS=ICONTA(1,N)                                             TGEINT    291
          IF(IGENS.NE.4)THEN                                            TGEINT    292
            JGG=JCONTA(2,N)                                             TGEINT    293
            IGVN=ICONTA(2,N)                                            TGEINT    294
            CKID(1:2)=NDGC(N)(3:4)                                      TGEINT    295
          ELSE                                                          TGEINT    296
            IGVN=0                                                      TGEINT    297
          ENDIF                                                         TGEINT    298
C                                                                       TGEINT    299
        IF(IGVN .EQ.45)THEN                                             TGEINT    300
          IF(IL.GE.ILDEF)THEN                                           TGEINT    301
            WRITE(IUX,2140)                                             TGEINT    302
            IL=7                                                        TGEINT    303
          ENDIF                                                         TGEINT    304
          WRITE(IUX,2150) NLF,INAME(KN-2),INAME(KN-1),INAME(KN),CKID    TGEINT    305
     *                   ,DDAT(JGG+379)/1000.,DDAT(JGG+378)/1000.       TGEINT    306
     *                   ,DDAT(JGG+314)                                 TGEINT    307
     *                   ,DDAT(JGG+317),DDAT(JGG+295)                   TGEINT    308
     *                   ,DDAT(JGG+294),DDAT(JGG+376)/1000.             TGEINT    309
          WRITE(IUX,2160) DDAT(JGG+377)/1000.,DDAT(JGG+77)*DDAT(JGG+314)TGEINT    310
     *                   ,DDAT(JGG+301)                                 TGEINT    311
     *                   ,DDAT(JGG+304)                                 TGEINT    312
        ENDIF                                                           TGEINT    313
 285    CONTINUE                                                        TGEINT    314
 290  CONTINUE                                                          TGEINT    315
C                                                                       TGEINT    316
 500  CONTINUE                                                          TGEINT    317
C                                                                       TGEINT    318
      RETURN                                                            TGEINT    319
C                                                                       TGEINT    320
 2000 FORMAT(1H1,//,35X,5('* '),'DETAILED GENERATOR INITIAL CONDITIONS' TGEINT    321
     *,5(' *'),//,96X,'SAT.FACTORS',/,'  BUS# STATION NAME GID   BMVA'  TGEINT    322
     *,'   VMAG     VANG     P(MW)    Q(MX)   CR(PU)   CI(PU)    DELTA' TGEINT    323
     *,'  D-AXIS  Q-AXIS     EFD    VREF    PREF',/,' ----- -----------'TGEINT    324
     *,'- ---  -----  ------   ------   ------   ------   ------'       TGEINT    325
     *,'   ------   ------  ------  ------  ------  ------  ------')    TGEINT    326
 2010 FORMAT(I6,1X,3A4,1X,A2,F8.2,F8.4,3F9.2,2F9.4,F9.2,3F8.4,2F8.2)    TGEINT    327
 2020 FORMAT(1H1,//,34X,5('* '),'CLASSICAL GENERATOR INITIAL CONDITIONS'TGEINT    328
     *,5(' *'),//,'  BUS# STATION NAME GID    BMVA    VMAG     VANG'    TGEINT    329
     *,'    P(MW)    Q(MX)   CR(PU)   CI(PU)      E''Q    DELTA'        TGEINT    330
     *,'    PREF',/,' ----- ------------ --- ------- -------'           TGEINT    331
     *,7(' --------'),' -------')                                       TGEINT    332
 2030 FORMAT(I6,1X,3A4,1X,A2,F9.2,F8.4,3F9.2,2F9.4,F9.2,F9.4,F8.2)      TGEINT    333
 2040 FORMAT(I6,1X,3A4,1X,A2,F8.2,F8.4,3F9.2,2F9.4,F9.2,3F8.4,8X,F8.2)  TGEINT    334
C                                                                       TGEINT    335
 2050 FORMAT(1H1,//,35X,5('* '),'BWR NUCLEAR PLANT RATED AND',          TGEINT    336
     *' INITIAL CONDITIONS',5(' *'))                                    TGEINT    337
 2060 FORMAT(/,34X,'TURBINE POWER (MW)',8X,'STM FL RATE (KG/S)'         TGEINT    338
     *,         8X,'CNTR VALV POS (PU)',8X,'HP TURB POWER (MW)'         TGEINT    339
     *     ,/,5X,'BUS# STATION NAME GID'                                TGEINT    340
     *,       8X,  'RATED      INITIAL',8X,'RATED      INITIAL'         TGEINT    341
     *,         8X,'RATED      INITIAL',8X,'RATED      INITIAL'         TGEINT    342
     *,     /,5X,'---- ------------ ---'                                TGEINT    343
     *,       8X,  '-----      -------',8X,'-----      -------'         TGEINT    344
     *,         8X,'-----      -------',8X,'-----      -------'         TGEINT    345
     *,/3X,I6,1X,3A4,2X,A2,8F13.4)                                      TGEINT    346
 2070 FORMAT(/,34X,'LP TURB POWER (MW)',8X,'VESS. PRESS. (KPA)'         TGEINT    347
     *,         8X,'HP EX. PRSS. (KPA)',8X,'RCL FL RATE (KG/S)'         TGEINT    348
     *    ,/  ,34X,'RATED      INITIAL',8X,'RATED      INITIAL'         TGEINT    349
     *         ,8X,'RATED      INITIAL',8X,'RATED      INITIAL'         TGEINT    350
     *,     / ,34X,'-----      -------',8X,'-----      -------'         TGEINT    351
     *,         8X,'-----      -------',8X,'-----      -------'         TGEINT    352
     *,/,26X,8F13.4)                                                    TGEINT    353
 2080 FORMAT(1H1,//,35X,5('* '),'FOSSIL FIRED PLANT RATED AND',         TGEINT    354
     *' INITIAL CONDITIONS',5(' *'))                                    TGEINT    355
 2090 FORMAT(/,34X,'TURBINE POWER (MW)',8X,'STM FL RATE (KG/S)'         TGEINT    356
     *         ,8X,'CNTR VALV POS (PU)',8X,'HP TURB POWER (MW)'         TGEINT    357
     *     ,/,5X,'BUS# STATION NAME GID'                                TGEINT    358
     *,         8X,'RATED      INITIAL',8X,'RATED      INITIAL'         TGEINT    359
     *         ,8X,'RATED      INITIAL',8X,'      INITIAL     '         TGEINT    360
     *,      /5X,'---- ------------ ---'                                TGEINT    361
     *,         8X,'-----      -------',8X,'-----      -------'         TGEINT    362
     *         ,8X,'-----      -------',8X,'      -------     '         TGEINT    363
     *,/,3X,I6,1X,3A4,2X,A2,6F13.4,8X,F13.4)                            TGEINT    364
 2100 FORMAT(/,34X,'IP TURB POWER (MW)',8X,'LP TURB POWER (MW)',        TGEINT    365
     *           8X,'HP EX. PRES. (KPA)',8X,'IP EX. PRES. (KPA)'        TGEINT    366
     * ,      /,34X,'      INITIAL     ',8X,'      INITIAL     '        TGEINT    367
     *,          8X,'      INITIAL     ',8X,'      INITIAL     '        TGEINT    368
     *,       /,34X,'      -------     ',8X,'      -------     '        TGEINT    369
     *          ,8X,'      -------     ',8X,'      -------     '        TGEINT    370
     *,/,26X,8X,4(F13.4,13X))                                           TGEINT    371
 2110 FORMAT(1H1,//,35X,5('* '),'CANDU NUCLEAR PLANT RATED AND',        TGEINT    372
     *' INITIAL CONDITIONS',5(' *'))                                    TGEINT    373
 2120 FORMAT(/,34X,'TURBINE POWER (MW)',8X,'STM FL RATE (KG/S)'         TGEINT    374
     *         ,8X,'CNTR VALV POS (PU)',8X,'HP TURB POWER (MW)'         TGEINT    375
     *  , /5X,'BUS# STATION NAME GID'                                   TGEINT    376
     *,         8X,'RATED      INITIAL',8X,'RATED      INITIAL'         TGEINT    377
     *         ,8X,'RATED      INITIAL',8X,'      INITIAL     '         TGEINT    378
     *,     /5X,'---- ------------ ---'                                 TGEINT    379
     *,         8X,'-----      -------',8X,'-----      -------'         TGEINT    380
     *         ,8X,'-----      -------',8X,'      -------     '         TGEINT    381
     *,/,3X,I6,1X,3A4,2X,A2,6F13.4,8X,F13.4)                            TGEINT    382
 2130 FORMAT(/,34X,'LP TURB POWER (MW)',8X,'FWT FL RATE (KG/S)',        TGEINT    383
     *        8X,'DRUM EX PRES (KPA)',8X,'HP EX. PRES. (KPA)'           TGEINT    384
     * ,   /,34X,'      INITIAL     ',8X,'      INITIAL     '           TGEINT    385
     *       ,8X,'      INITIAL     ',8X,'      INITIAL     '           TGEINT    386
     *,    /,34X,'      -------     ',8X,'      -------     '           TGEINT    387
     *       ,8X,'      -------     ',8X,'      -------     '           TGEINT    388
     *,/,26X,8X,4(F13.4,13X))                                           TGEINT    389
 2140 FORMAT(1H1,//,35X,5('* '),'PWR NUCLEAR PLANT RATED AND',          TGEINT    390
     *' INITIAL CONDITIONS',5(' *'))                                    TGEINT    391
 2150 FORMAT(/,34X,'TURBINE POWER (MW)',8X,'STM FL RATE (KG/S)'         TGEINT    392
     *         ,8X,'CNTR VALV POS (PU)',8X,'HP TURB POWER (MW)'         TGEINT    393
     *  , /5X,'BUS# STATION NAME GID'                                   TGEINT    394
     *,         8X,'RATED      INITIAL',8X,'RATED      INITIAL'         TGEINT    395
     *         ,8X,'RATED      INITIAL',8X,'      INITIAL     '         TGEINT    396
     *,     /5X,'---- ------------ ---'                                 TGEINT    397
     *,         8X,'-----      -------',8X,'-----      -------'         TGEINT    398
     *         ,8X,'-----      -------',8X,'      -------     '         TGEINT    399
     *,/,3X,I6,1X,3A4,2X,A2,6F13.4,8X,F13.4)                            TGEINT    400
 2160 FORMAT(/,34X,'LP TURB POWER (MW)',8X,'FWT FL RATE (KG/S)',        TGEINT    401
     *        8X,'DRUM EX PRES (KPA)',8X,'HP EX. PRES. (KPA)'           TGEINT    402
     * ,   /,34X,'      INITIAL     ',8X,'      INITIAL     '           TGEINT    403
     *       ,8X,'      INITIAL     ',8X,'      INITIAL     '           TGEINT    404
     *,    /,34X,'      -------     ',8X,'      -------     '           TGEINT    405
     *       ,8X,'      -------     ',8X,'      -------     '           TGEINT    406
     *,/,26X,8X,4(F13.4,13X))                                           TGEINT    407
C                                                                       TGEINT    408
C  ----------------------------------------------                       TGEINT    409
C                                                                       TGEINT    410
      ENTRY PGCNIN(IUX)                                                 TGEINT    411
CD                                                                      TGEINT    412
CD    TO TABULATE THE INITIAL CONDITIONS OF THE USER DEFINED GENERATOR  TGEINT    413
CD    CONTROL DEVICES.                                                  TGEINT    414
CD                                                                      TGEINT    415
      IL=0                                                              TGEINT    416
      DO 1010 LK=1,LBUSNO                                               TGEINT    417
      K=NNEW(LK)                                                        TGEINT    418
      IF(K.EQ.0.OR.K.GT.IPNODE)GOTO 1010                                TGEINT    419
      KN=K*3                                                            TGEINT    420
      NLF=NOLD(K)                                                       TGEINT    421
      N1=NTHG(K)                                                        TGEINT    422
      N2=NTHG(K+1)-1                                                    TGEINT    423
      DO 1015 N=N1,N2                                                   TGEINT    424
      IEXN=ICONTA(4,N)                                                  TGEINT    425
      IF(IEXN.EQ.50)THEN                                                TGEINT    426
         JE=JCONTA(3,N)                                                 TGEINT    427
         JE1=JE+9                                                       TGEINT    428
         CKID(1:2)=NDGC(N)(3:4)                                         TGEINT    429
         IF(IL.EQ.0)THEN                                                TGEINT    430
            WRITE(IUX,4000) 'GENERATOR CONTROL'                         TGEINT    431
            IL=1                                                        TGEINT    432
         ENDIF                                                          TGEINT    433
         WRITE(IUX,5000) 'EXCITER'                                      TGEINT    434
     *   ,NLF,INAME(KN-2),INAME(KN-1),INAME(KN),CKID                    TGEINT    435
         CALL PUDMIN(IUX,JE1)                                           TGEINT    436
         WRITE(IUX,3850) (VALIUD(NVALIU-80+JK),JK=1,12)                 TGEINT    437
     *           ,(VALIUD(NVALIU-80+I),I=14,20)                         TGEINT    438
      ENDIF                                                             TGEINT    439
C                                                                       TGEINT    440
C     STABILIZER                                                        TGEINT    441
C                                                                       TGEINT    442
      ISTAB=ICONTA(5,N)                                                 TGEINT    443
      IF(ISTAB.EQ.50)THEN                                               TGEINT    444
         JS=JCONTA(4,N)                                                 TGEINT    445
         JS1=JS+9                                                       TGEINT    446
         CKID(1:2)=NDGC(N)(3:4)                                         TGEINT    447
         IF(IL.EQ.0)THEN                                                TGEINT    448
            WRITE(IUX,4000) 'GENERATOR CONTROL'                         TGEINT    449
            IL=1                                                        TGEINT    450
         ENDIF                                                          TGEINT    451
         WRITE(IUX,5000) 'STABILIZER'                                   TGEINT    452
     *   ,NLF,INAME(KN-2),INAME(KN-1),INAME(KN),CKID                    TGEINT    453
         CALL PUDMIN(IUX,JS1)                                           TGEINT    454
         WRITE(IUX,3890) (VALIUD(NVALIU-80+JK),JK=1,12)                 TGEINT    455
     *   ,VALIUD(NVALIU-80+14),(VALIUD(NVALIU-80+I),I=16,18)            TGEINT    456
      ENDIF                                                             TGEINT    457
C                                                                       TGEINT    458
C     UNDER EXCITATION LIMITER                                          TGEINT    459
C                                                                       TGEINT    460
      IUAL=ICONTA(7,N)                                                  TGEINT    461
      IF(IUAL.EQ.50.AND.ISTAB.NE.50)THEN                                TGEINT    462
         JU=JCONTA(6,N)                                                 TGEINT    463
         JU1=JU+9                                                       TGEINT    464
         CKID(1:2)=NDGC(N)(3:4)                                         TGEINT    465
         IF(IL.EQ.0)THEN                                                TGEINT    466
            WRITE(IUX,4000) 'GENERATOR CONTROL'                         TGEINT    467
            IL=1                                                        TGEINT    468
         ENDIF                                                          TGEINT    469
         WRITE(IUX,5000) 'UNDER EXCITATION LIMITER'                     TGEINT    470
     *   ,NLF,INAME(KN-2),INAME(KN-1),INAME(KN),CKID                    TGEINT    471
         CALL PUDMIN(IUX,JU1)                                           TGEINT    472
         WRITE(IUX,3930) (VALIUD(NVALIU-80+JK),JK=1,12)                 TGEINT    473
     *   ,VALIUD(NVALIU-80+14),VALIUD(NVALIU-80+16),VALIUD(NVALIU-80+18)TGEINT    474
      ENDIF                                                             TGEINT    475
C                                                                       TGEINT    476
C     MAXIMUM EXCITATION LIMITER                                        TGEINT    477
C                                                                       TGEINT    478
      IMXL=ICONTA(12,N)                                                 TGEINT    479
      IF(IMXL.EQ.50)THEN                                                TGEINT    480
         JMX=JCONTA(11,N)                                               TGEINT    481
         JMX1=JMX+9                                                     TGEINT    482
         CKID(1:2)=NDGC(N)(3:4)                                         TGEINT    483
         IF(IL.EQ.0)THEN                                                TGEINT    484
            WRITE(IUX,4000) 'GENERATOR CONTROL'                         TGEINT    485
            IL=1                                                        TGEINT    486
         ENDIF                                                          TGEINT    487
         WRITE(IUX,5000) 'MAXIMUM EXCITATION LIMITER'                   TGEINT    488
     *   ,NLF,INAME(KN-2),INAME(KN-1),INAME(KN),CKID                    TGEINT    489
         CALL PUDMIN(IUX,JMX1)                                          TGEINT    490
         WRITE(IUX,3931) (VALIUD(NVALIU-80+JK),JK=1,12)                 TGEINT    491
     *   ,VALIUD(NVALIU-80+14),VALIUD(NVALIU-80+16)                     TGEINT    492
      ENDIF                                                             TGEINT    493
C                                                                       TGEINT    494
C     GOVERNOR                                                          TGEINT    495
C                                                                       TGEINT    496
      IGV=ICONTA(2,N)                                                   TGEINT    497
      IF(IGV.EQ.50)THEN                                                 TGEINT    498
         JGG=JCONTA(2,N)                                                TGEINT    499
         JGG1=JGG+3                                                     TGEINT    500
         CKID(1:2)=NDGC(N)(3:4)                                         TGEINT    501
         IF(IL.EQ.0)THEN                                                TGEINT    502
            WRITE(IUX,4000) 'GENERATOR CONTROL'                         TGEINT    503
            IL=1                                                        TGEINT    504
         ENDIF                                                          TGEINT    505
         WRITE(IUX,5000) 'GOVERNOR'                                     TGEINT    506
     *   ,NLF,INAME(KN-2),INAME(KN-1),INAME(KN),CKID                    TGEINT    507
         CALL PUDMIN(IUX,JGG1)                                          TGEINT    508
         WRITE(IUX,3870) (VALIUD(NVALIU-80+JK),JK=1,12)                 TGEINT    509
     *             ,VALIUD(NVALIU-80+14),VALIUD(NVALIU-80+20)           TGEINT    510
      ENDIF                                                             TGEINT    511
 1015 CONTINUE                                                          TGEINT    512
 1010 CONTINUE                                                          TGEINT    513
C                                                                       TGEINT    514
      RETURN                                                            TGEINT    515
C                                                                       TGEINT    516
 3850 FORMAT(1X,'LOCAL INPUT SIGNALS:',/,'   VC(PU)   AC(PU) PACC(PU)'  TGEINT    517
     *,'   VT(PU)  AT(RAD)   VD(PU)   VQ(PU)   ID(PU)   IQ(PU)   '      TGEINT    518
     *,'PT(PU)   QT(PU)   DW(PU)  TS(SEC)  EFD(PU)',/,14(' --------')   TGEINT    519
     *,/,14F9.3,//,'  IFD(PU)       VS       VU   VF(PU)     VREF',/    TGEINT    520
     *,5(' --------'),/,5F9.3,/)                                        TGEINT    521
 3870 FORMAT(1X,'LOCAL INPUT SIGNALS:',/,'   VG(PU)  VG2(PU) PACC(PU)'  TGEINT    522
     *,'   VT(PU)  AT(RAD)   VD(PU)   VQ(PU)   ID(PU)   IQ(PU)   '      TGEINT    523
     *,'PT(PU)   QT(PU)   DW(PU)  TS(SEC)     VREF',/,14(' --------')   TGEINT    524
     *,/,14F9.3,/)                                                      TGEINT    525
 3890 FORMAT(1X,'LOCAL INPUT SIGNALS:',/,'   VC(PU)   AC(PU) PACC(PU)'  TGEINT    526
     *,'  VT(PU) AT(RAD)  VD(PU)  VQ(PU)  ID(PU)  IQ(PU)  '             TGEINT    527
     *,'PT(PU)  QT(PU)  DW(PU) TS(SEC) IFD(PU)      VS      VU',/       TGEINT    528
     *,3(' --------'),13(' -------'),/,3F9.3,13F8.3,/)                  TGEINT    529
 3930 FORMAT(1X,'LOCAL INPUT SIGNALS:',/,'   VC(PU)   AC(PU) PACC(PU)'  TGEINT    530
     *,'  VT(PU) AT(RAD)  VD(PU)  VQ(PU)  ID(PU)  IQ(PU)   '            TGEINT    531
     *,'PT(PU)  QT(PU)  DW(PU) TS(SEC) IFD(PU)     VU',/                TGEINT    532
     *,3(' --------'),12(' -------'),/,3F9.3,12F8.3,/)                  TGEINT    533
 3931 FORMAT(1X,'LOCAL INPUT SIGNALS:',/,'   VC(PU)   AC(PU) PACC(PU)'  TGEINT    534
     *,'   VT(PU)  AT(RAD)   VD(PU)   VQ(PU)   ID(PU)   IQ(PU)   '      TGEINT    535
     *,'PT(PU)   QT(PU)   DW(PU)  TS(SEC)  IFD(PU)',/,14(' --------')   TGEINT    536
     *,/,14F9.3,/)                                                      TGEINT    537
 4000 FORMAT(1H1,T50,'USER DEFINED ',A,' MODEL INITIAL CONDITIONS',/)   TGEINT    538
 5000 FORMAT(2X,A,'  BUS#: ',I5,' STATION NAME: ',3A4,' GID: ',A2,/)    TGEINT    539
C                                                                       TGEINT    540
      END                                                               TGEINT    541
