CFPRIME CHKGXT                                                          CHKGXT      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 CHKGXT(NLF,BUSNAM,NGRI                                 CHKGXT      3
     &,RAN,XD,XQ,XL,X1D,X1Q,X11D,X11Q,T1D,T1Q,T11D,T11Q,IEBK)           CHKGXT      4
CD                                                                      CHKGXT      5
CD    TO CHECK GENERATOR IMPEDANCE AND TIME CONSTANTS                   CHKGXT      6
CD                                                                      CHKGXT      7
CD    ROUTINE INPUT:                                                    CHKGXT      8
CD      NLF      = LOADFLOW BUS NUMBER                                  CHKGXT      9
CD      BUSNAM   = LOADFLOW BUS NAME                                    CHKGXT     10
CD      NGRI     = GENERATOR CIRCUIT IDENTITY                           CHKGXT     11
CD      RAN      = ARMATURE RESISTANCE                                  CHKGXT     12
CD      XD       = DIRECT AXIS REACTANCE                                CHKGXT     13
CD      XQ       = QUARDTURE AXIS REACTANCE                             CHKGXT     14
CD      XL       = LEAKAGE REACTANCE                                    CHKGXT     15
CD      X1D      = DIRECT AXIS SUBTRANSIENT REACTANCE                   CHKGXT     16
CD      X1Q      = QUADRATURE AXIS SUBTRANSIENT RECATANCE               CHKGXT     17
CD      X11D     = DIRECT AXIS SUB-SUBTRANSIENT REACTANCE               CHKGXT     18
CD      X11Q     = QUADRATURE AXIS SUB-SUBTRANSIENT REACTANCE           CHKGXT     19
CD      T1D      = DIRECT AXIS SHORT CIRCUIT TIME CONSTANT              CHKGXT     20
CD      T1Q      = QUADRATURE AXIS SHORT CIRCUIT TIME CONSTANT          CHKGXT     21
CD      T11D     = DIRECT AXIS SHORT CIRCUIT SUBTRANSIENT TIME CONSTANT CHKGXT     22
CD      T11Q     = QUADRATURE AXIS SHORT CIRCUIT SUBTRANSIENT TIME      CHKGXT     23
CD                 CONSTANT                                             CHKGXT     24
CD                                                                      CHKGXT     25
CD                                                                      CHKGXT     26
CD    ROUTINE OUTPUT:                                                   CHKGXT     27
CD                                                                      CHKGXT     28
CD    IEBK IS THE ERROR FLAG:                                           CHKGXT     29
CD    IEBK = 0   NO ERROR                                               CHKGXT     30
CD    IEBK = 1   ERROR IN GENERATOR DATA WHICH USER HAS TO RECTIFY      CHKGXT     31
CD               OTHERWISE, LOADING OF GENERATOR DATA WILL FAIL         CHKGXT     32
CD                                                                      CHKGXT     33
      INCLUDE 'CNFLAG.INS'                                              CHKGXT     34
      INCLUDE 'CNMSG.INS'                                               CHKGXT     35
C                                                                       CHKGXT     36
      CHARACTER BUSNAM*12,NGRI*4                                        CHKGXT     37
C                                                                       CHKGXT     38
C                                                                       CHKGXT     39
C   DATA IN X'S AND TIME CONSTANT FORM                                  CHKGXT     40
C                                                                       CHKGXT     41
C                                                                       CHKGXT     42
C     DATA SWITCHING IF NECESSARY                                       CHKGXT     43
C                                                                       CHKGXT     44
C     NOTE THAT ONLY Q-AXIS DAMPER WINDING DATA WILL BE SWITCHED        CHKGXT     45
C                                                                       CHKGXT     46
      IEBK=0                                                            CHKGXT     47
C                                                                       CHKGXT     48
      LDEB=.FALSE.                                                      CHKGXT     49
C                                                                       CHKGXT     50
      IF (X1Q.LE.0.0.OR.T1Q.LE.0.0) THEN                                CHKGXT     51
         IF (X11Q.GT.0.0.AND.T11Q.GT.0.0) THEN                          CHKGXT     52
            X1Q=X11Q                                                    CHKGXT     53
            T1Q=T11Q                                                    CHKGXT     54
            X11Q=0.0                                                    CHKGXT     55
            T11Q=0.0                                                    CHKGXT     56
         END IF                                                         CHKGXT     57
      END IF                                                            CHKGXT     58
C                                                                       CHKGXT     59
C    XMIN IS THE LOWEST NON-ZERO VALUE FROM THE SET OF                  CHKGXT     60
C    X11D, X11Q, X1D AND X1Q                                            CHKGXT     61
C                                                                       CHKGXT     62
      XMIN=0.0                                                          CHKGXT     63
      XMIN=X11D                                                         CHKGXT     64
      IF(X11Q.GT.0.0.AND.X11Q.LT.XMIN)XMIN=X11Q                         CHKGXT     65
      IF(XMIN.EQ.0.0)THEN                                               CHKGXT     66
        XMIN=X1D                                                        CHKGXT     67
        IF(X1Q.GT.0.0.AND.X1Q.LT.XMIN)XMIN=X1Q                          CHKGXT     68
      ENDIF                                                             CHKGXT     69
      XMIN=0.75*XMIN                                                    CHKGXT     70
C                                                                       CHKGXT     71
C     TRANSIENT Q-AXIS                                                  CHKGXT     72
C                                                                       CHKGXT     73
      IF (T1Q.NE.0.0.AND.T1Q.LT.0.01) THEN                              CHKGXT     74
        IF(KLFO.EQ.0)THEN                                               CHKGXT     75
          WRITE(MSG(1),1020) NLF,NGRI                                   CHKGXT     76
        ELSE                                                            CHKGXT     77
          WRITE(MSG(1),1030) BUSNAM,NGRI                                CHKGXT     78
        ENDIF                                                           CHKGXT     79
        WRITE(MSG(2),1330) T1Q                                          CHKGXT     80
        CALL PRTMSG(2)                                                  CHKGXT     81
        T1Q=0.0                                                         CHKGXT     82
      END IF                                                            CHKGXT     83
C                                                                       CHKGXT     84
      IF (X1Q.GT.0.0.AND.T1Q.GT.0.0) THEN                               CHKGXT     85
         IF (X1Q.GE.XQ) THEN                                            CHKGXT     86
            IF(KLFO.EQ.0)THEN                                           CHKGXT     87
              WRITE(MSG(1),1020) NLF,NGRI                               CHKGXT     88
            ELSE                                                        CHKGXT     89
              WRITE(MSG(1),1030) BUSNAM,NGRI                            CHKGXT     90
            ENDIF                                                       CHKGXT     91
            WRITE(MSG(2),1310) X1Q,XQ                                   CHKGXT     92
            X1Q=0.0                                                     CHKGXT     93
            T1Q=0.0                                                     CHKGXT     94
            WRITE(MSG(3),1400)                                          CHKGXT     95
            CALL PRTMSG(3)                                              CHKGXT     96
         ELSE IF (X1Q.LE.XL) THEN                                       CHKGXT     97
            IF(KLFO.EQ.0)THEN                                           CHKGXT     98
              WRITE(MSG(1),1020) NLF,NGRI                               CHKGXT     99
            ELSE                                                        CHKGXT    100
              WRITE(MSG(1),1030) BUSNAM,NGRI                            CHKGXT    101
            ENDIF                                                       CHKGXT    102
            WRITE(MSG(2),1320) X1Q,XL                                   CHKGXT    103
            XL=XMIN                                                     CHKGXT    104
            WRITE(MSG(3),1380)                                          CHKGXT    105
            WRITE(MSG(4),1385) XL                                       CHKGXT    106
            CALL PRTMSG(4)                                              CHKGXT    107
         END IF                                                         CHKGXT    108
      END IF                                                            CHKGXT    109
C                                                                       CHKGXT    110
C     TRANSIENT D-AXIS                                                  CHKGXT    111
C                                                                       CHKGXT    112
      IF (X1D.GT.0.0.AND.T1D.GT.0.0) THEN                               CHKGXT    113
         IF (X1D.GE.XD) THEN                                            CHKGXT    114
            IEBK=1                                                      CHKGXT    115
            IF(KLFO.EQ.0)THEN                                           CHKGXT    116
              WRITE(MSG(1),1000) NLF,NGRI                               CHKGXT    117
            ELSE                                                        CHKGXT    118
              WRITE(MSG(1),1010) BUSNAM,NGRI                            CHKGXT    119
            ENDIF                                                       CHKGXT    120
            WRITE(MSG(2),1240) X1D,XD                                   CHKGXT    121
            CALL PRTMSG(2)                                              CHKGXT    122
         ELSE IF (X1D.LE.XL) THEN                                       CHKGXT    123
            IF(KLFO.EQ.0)THEN                                           CHKGXT    124
              WRITE(MSG(1),1020) NLF,NGRI                               CHKGXT    125
            ELSE                                                        CHKGXT    126
              WRITE(MSG(1),1030) BUSNAM,NGRI                            CHKGXT    127
            ENDIF                                                       CHKGXT    128
            WRITE(MSG(2),1250) X1D,XL                                   CHKGXT    129
            XL=XMIN                                                     CHKGXT    130
            WRITE(MSG(3),1380)                                          CHKGXT    131
            WRITE(MSG(4),1385) XL                                       CHKGXT    132
            CALL PRTMSG(4)                                              CHKGXT    133
         END IF                                                         CHKGXT    134
      ELSE                                                              CHKGXT    135
         IEBK=1                                                         CHKGXT    136
         IF(KLFO.EQ.0)THEN                                              CHKGXT    137
           WRITE(MSG(1),1000) NLF,NGRI                                  CHKGXT    138
         ELSE                                                           CHKGXT    139
           WRITE(MSG(1),1010) BUSNAM,NGRI                               CHKGXT    140
         ENDIF                                                          CHKGXT    141
         IF (X1D.LE.0.0) THEN                                           CHKGXT    142
            WRITE(MSG(2),1260) X1D                                      CHKGXT    143
         ELSE                                                           CHKGXT    144
            WRITE(MSG(2),1270) T1D                                      CHKGXT    145
         END IF                                                         CHKGXT    146
         CALL PRTMSG(2)                                                 CHKGXT    147
      END IF                                                            CHKGXT    148
C                                                                       CHKGXT    149
C     SUBTRANSIENT Q-AXIS                                               CHKGXT    150
C                                                                       CHKGXT    151
      IF (T11Q.NE.0.0.AND.T11Q.LT.0.01) THEN                            CHKGXT    152
        IF(KLFO.EQ.0)THEN                                               CHKGXT    153
          WRITE(MSG(1),1020) NLF,NGRI                                   CHKGXT    154
        ELSE                                                            CHKGXT    155
          WRITE(MSG(1),1030) BUSNAM,NGRI                                CHKGXT    156
        ENDIF                                                           CHKGXT    157
        WRITE(MSG(2),1360) T11Q                                         CHKGXT    158
        CALL PRTMSG(2)                                                  CHKGXT    159
        T11Q=0.0                                                        CHKGXT    160
      END IF                                                            CHKGXT    161
C                                                                       CHKGXT    162
      IF (X11Q.GT.0.0.AND.T11Q.GT.0.0) THEN                             CHKGXT    163
         IF (X11Q.GE.X1Q) THEN                                          CHKGXT    164
            IF(KLFO.EQ.0)THEN                                           CHKGXT    165
              WRITE(MSG(1),1020) NLF,NGRI                               CHKGXT    166
            ELSE                                                        CHKGXT    167
              WRITE(MSG(1),1030) BUSNAM,NGRI                            CHKGXT    168
            ENDIF                                                       CHKGXT    169
            WRITE(MSG(2),1340) X11Q,X1Q                                 CHKGXT    170
            X11Q=0.0                                                    CHKGXT    171
            T11Q=0.0                                                    CHKGXT    172
            WRITE(MSG(3),1370)                                          CHKGXT    173
            CALL PRTMSG(3)                                              CHKGXT    174
         ELSE IF (X11Q.LE.XL) THEN                                      CHKGXT    175
            IF(KLFO.EQ.0)THEN                                           CHKGXT    176
              WRITE(MSG(1),1020) NLF,NGRI                               CHKGXT    177
            ELSE                                                        CHKGXT    178
              WRITE(MSG(1),1030) BUSNAM,NGRI                            CHKGXT    179
            ENDIF                                                       CHKGXT    180
            WRITE(MSG(2),1350) X11Q,XL                                  CHKGXT    181
            XL=XMIN                                                     CHKGXT    182
            WRITE(MSG(3),1380)                                          CHKGXT    183
            WRITE(MSG(4),1385) XL                                       CHKGXT    184
            CALL PRTMSG(4)                                              CHKGXT    185
         END IF                                                         CHKGXT    186
      END IF                                                            CHKGXT    187
C                                                                       CHKGXT    188
C     SUBTRANSIENT D-AXIS                                               CHKGXT    189
C                                                                       CHKGXT    190
      IF (T11D.NE.0.0.AND.T11D.LT.0.01) THEN                            CHKGXT    191
        IF(KLFO.EQ.0)THEN                                               CHKGXT    192
          WRITE(MSG(1),1020) NLF,NGRI                                   CHKGXT    193
        ELSE                                                            CHKGXT    194
          WRITE(MSG(1),1030) BUSNAM,NGRI                                CHKGXT    195
        ENDIF                                                           CHKGXT    196
        WRITE(MSG(2),1300) T11D                                         CHKGXT    197
        CALL PRTMSG(2)                                                  CHKGXT    198
        T11D=0.0                                                        CHKGXT    199
      END IF                                                            CHKGXT    200
C                                                                       CHKGXT    201
      IF (X11D.GT.0.0.AND.T11D.GT.0.0) THEN                             CHKGXT    202
         IF (X11D.GE.X1D) THEN                                          CHKGXT    203
            IF(KLFO.EQ.0)THEN                                           CHKGXT    204
              WRITE(MSG(1),1020) NLF,NGRI                               CHKGXT    205
            ELSE                                                        CHKGXT    206
              WRITE(MSG(1),1030) BUSNAM,NGRI                            CHKGXT    207
            ENDIF                                                       CHKGXT    208
            WRITE(MSG(2),1280) X11D,X1D                                 CHKGXT    209
            X11D=0.0                                                    CHKGXT    210
            T11D=0.0                                                    CHKGXT    211
            WRITE(MSG(3),1390)                                          CHKGXT    212
            CALL PRTMSG(3)                                              CHKGXT    213
         ELSE IF (X11D.LE.XL) THEN                                      CHKGXT    214
            IF(KLFO.EQ.0)THEN                                           CHKGXT    215
              WRITE(MSG(1),1020) NLF,NGRI                               CHKGXT    216
            ELSE                                                        CHKGXT    217
              WRITE(MSG(1),1030) BUSNAM,NGRI                            CHKGXT    218
            ENDIF                                                       CHKGXT    219
            WRITE(MSG(2),1290) X11D,XL                                  CHKGXT    220
            XL=XMIN                                                     CHKGXT    221
            WRITE(MSG(3),1380)                                          CHKGXT    222
            WRITE(MSG(4),1385) XL                                       CHKGXT    223
            CALL PRTMSG(4)                                              CHKGXT    224
         END IF                                                         CHKGXT    225
      END IF                                                            CHKGXT    226
 1000 FORMAT(' *** ERROR GENERATOR AT BUS ',I5,' GID ',A4)              CHKGXT    227
 1010 FORMAT(' *** ERROR GENERATOR AT BUS ',A12,' GID ',A4)             CHKGXT    228
 1020 FORMAT(' *** WARNING GENERATOR AT BUS ',I5,' GID ',A4)            CHKGXT    229
 1030 FORMAT(' *** WARNING GENERATOR AT BUS ',A12,' GID ',A4)           CHKGXT    230
 1240 FORMAT('     X''D (' ,G12.4,') IS GREATER THAN OR EQUAL TO XD ('  CHKGXT    231
     1,G12.4,')')                                                       CHKGXT    232
 1250 FORMAT('     X''D (',G12.4,') IS LESS THAN OR EQUAL TO XL ('      CHKGXT    233
     1,G12.4,')')                                                       CHKGXT    234
 1260 FORMAT('     X''D (',G12.4,') IS NON-POSITIVE')                   CHKGXT    235
 1270 FORMAT('     T''D0 (',G12.4,') IS NON-POSITIVE')                  CHKGXT    236
 1280 FORMAT('     X"D (',G12.4,') IS GREATER THAN OR EQUAL TO X''D ('  CHKGXT    237
     1,G12.4,')')                                                       CHKGXT    238
 1290 FORMAT('     X"D (',G12.4,') IS LESS THAN OR EQUAL TO XL ('       CHKGXT    239
     1,G12.4,')')                                                       CHKGXT    240
 1300 FORMAT('     T"D0 (',G12.4,') IS LESS THAN 0.01,'                 CHKGXT    241
     *,' PROGRAM HAS SET T"D0 TO 0.0')                                  CHKGXT    242
 1310 FORMAT('     X''Q (',G12.4,') IS GREATER THAN OR EQUAL TO XQ ('   CHKGXT    243
     1,G12.4,')')                                                       CHKGXT    244
 1320 FORMAT('     X''Q (',G12.4,') IS LESS THAN OR EQUAL TO XL ('      CHKGXT    245
     1,G12.4,')')                                                       CHKGXT    246
 1330 FORMAT('     T''Q0 (',G12.4,') IS LESS THAN 0.01,'                CHKGXT    247
     *,' PROGRAM HAS SET T''Q0 TO 0.0')                                 CHKGXT    248
 1340 FORMAT('     X"Q (',G12.4,') IS GREATER THAN OR EQUAL TO X''Q ('  CHKGXT    249
     1,G12.4,')')                                                       CHKGXT    250
 1350 FORMAT('     X"Q (',G12.4,') IS LESS THAN OR EQUAL TO XL ('       CHKGXT    251
     1,G12.4,')')                                                       CHKGXT    252
 1360 FORMAT('     T"Q0 (',G12.4,') IS LESS THAN 0.01,'                 CHKGXT    253
     *,' PROGRAM HAS SET T"Q0 TO 0.0')                                  CHKGXT    254
 1370 FORMAT('     PROGRAM HAS SET X"Q AND T"Q0 TO 0.0')                CHKGXT    255
 1380 FORMAT('     XL IS SET TO 75% OF THE LOWER OF NON-ZERO TRANSIENT' CHKGXT    256
     *,' AND')                                                          CHKGXT    257
 1385 FORMAT('     SUBTRANSIENT REACTANCE (=',F8.6,')')                 CHKGXT    258
 1390 FORMAT('     PROGRAM HAS SET X"D AND T"D0 TO 0.0')                CHKGXT    259
 1400 FORMAT('     PROGRAM HAS SET X''Q AND T''Q0 TO 0.0')              CHKGXT    260
C                                                                       CHKGXT    261
      END                                                               CHKGXT    262
