CFPRIME LDGEDA                                                          LDGEDA      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 LDGEDA(IU16,IEBK)                                      LDGEDA      3
CD                                                                      LDGEDA      4
CD    TO LOAD DETAILED GENERATOR DYNAMIC DATA FROM ARRAYS IGENDA,       LDGEDA      5
CD    JGENDA, AND TDDAT TO ICONTA, JCONTA, AND DDAT ARRAYS.             LDGEDA      6
CD                                                                      LDGEDA      7
      INCLUDE 'PARX.INS'                                                LDGEDA      8
      INCLUDE 'CNPT.INS'                                                LDGEDA      9
      INCLUDE 'CNMDAT.INS'                                              LDGEDA     10
      INCLUDE 'CNB1.INS'                                                LDGEDA     11
      INCLUDE 'CNB3.INS'                                                LDGEDA     12
      INCLUDE 'CNB8.INS'                                                LDGEDA     13
      INCLUDE 'CNB19.INS'                                               LDGEDA     14
      INCLUDE 'CNFLAG.INS'                                              LDGEDA     15
      INCLUDE 'CNPARX.INS'                                              LDGEDA     16
      INCLUDE 'CNREN.INS'                                               LDGEDA     17
      INCLUDE 'CNUDM.INS'                                               LDGEDA     18
      INCLUDE 'CNMNEW.INS'                                              LDGEDA     19
      INCLUDE 'CNLFDA.INS'                                              LDGEDA     20
      INCLUDE 'CNJPT.INS'                                               LDGEDA     21
      INCLUDE 'CNJDAT.INS'                                              LDGEDA     22
      INCLUDE 'CNTMDA.INS'                                              LDGEDA     23
      INCLUDE 'CNTGED.INS'                                              LDGEDA     24
      INCLUDE 'CNMSG.INS'                                               LDGEDA     25
      INCLUDE 'CNGSRC.INS'                                              LDGEDA     26
C                                                                       LDGEDA     27
      CHARACTER*12 BUSNAM,BSNAME                                        LDGEDA     28
      CHARACTER*4 NGRI,LPGID                                            LDGEDA     29
      DIMENSION SATC(12)                                                LDGEDA     30
      EQUIVALENCE (ILPGID,LPGID)                                        LDGEDA     31
C                                                                       LDGEDA     32
C                                                                       LDGEDA     33
      LDEB=(JDEB(6).NE.0)                                               LDGEDA     34
C                                                                       LDGEDA     35
C  READING GENERATOR DATA                                               LDGEDA     36
C                                                                       LDGEDA     37
      IHPLP=0                                                           LDGEDA     38
      JLNX=0                                                            LDGEDA     39
      IEBK=0                                                            LDGEDA     40
      DO 3450 I=2,LJNT+1                                                LDGEDA     41
      JG=NTHGEN(I)                                                      LDGEDA     42
      IF(JG.EQ.0)GOTO 3450                                              LDGEDA     43
  100 CONTINUE                                                          LDGEDA     44
      IF(IDSTAT(JG).NE.1)GOTO 3400                                      LDGEDA     45
      IF((IGENDA(2,JG).EQ.5.OR.IGENDA(2,JG).EQ.35)                      LDGEDA     46
     1                       .AND.IHPLP.EQ.0)GOTO 3400                  LDGEDA     47
      LTN=JGENDA(1,JG)                                                  LDGEDA     48
      LTN1=LTN                                                          LDGEDA     49
      IF(IHPLP.EQ.0)THEN                                                LDGEDA     50
        NLF=NGEBUS(JG)                                                  LDGEDA     51
      ELSE                                                              LDGEDA     52
        NLF=-NGEBUS(JG)                                                 LDGEDA     53
      ENDIF                                                             LDGEDA     54
      NGRI=GENID(JG)                                                    LDGEDA     55
      NT=NT+1                                                           LDGEDA     56
      IF(NT.GT.MXP) GOTO 4500                                           LDGEDA     57
      NDGE(NT)=NLF                                                      LDGEDA     58
      NDGC(NT)=NGRI                                                     LDGEDA     59
      IGEN=IGENDA(1,JG)                                                 LDGEDA     60
      GENPQ(1,NT)=PQGEN(1,JG)                                           LDGEDA     61
      GENPQ(2,NT)=PQGEN(2,JG)                                           LDGEDA     62
      IGVN=IGENDA(2,JG)                                                 LDGEDA     63
      IF(IGEN.EQ.3.OR.IGEN.EQ.7.OR.IGEN.EQ.11)GOTO 550                  LDGEDA     64
      ISATX=IGENDA(3,JG)                                                LDGEDA     65
      IEXX=IGENDA(4,JG)                                                 LDGEDA     66
      ISTABX=IGENDA(5,JG)                                               LDGEDA     67
      IFLTN=IGENDA(6,JG)                                                LDGEDA     68
      IUALN=IGENDA(7,JG)                                                LDGEDA     69
      MASSN=IGENDA(8,JG)                                                LDGEDA     70
      ICBRN=IGENDA(9,JG)                                                LDGEDA     71
      IGSTAN=IGENDA(10,JG)                                              LDGEDA     72
      ITEBN=IGENDA(11,JG)                                               LDGEDA     73
      IMXLN=IGENDA(12,JG)                                               LDGEDA     74
      IF(IEXX.EQ.50) THEN                                               LDGEDA     75
         IF(ISTABX.EQ.50) ISTABX=0                                      LDGEDA     76
         IF(IUALN.EQ.50) IUALN=0                                        LDGEDA     77
         IF(IMXLN.EQ.50) IMXLN=0                                        LDGEDA     78
      ENDIF                                                             LDGEDA     79
      IF(ISTABX.EQ.50) THEN                                             LDGEDA     80
         IF(IUALN.EQ.0) IUALN=50                                        LDGEDA     81
         IF(IFLTN.NE.0) IFLTN=0                                         LDGEDA     82
         IF(IMXLN.EQ.50) IMXLN=0                                        LDGEDA     83
      ENDIF                                                             LDGEDA     84
      IF(IUALN.EQ.50) THEN                                              LDGEDA     85
         IF(IMXLN.EQ.50) IMXLN=0                                        LDGEDA     86
      ENDIF                                                             LDGEDA     87
      ICONTA(1,NT)=IGEN                                                 LDGEDA     88
      ICONTA(4,NT)=IEXX                                                 LDGEDA     89
      ICONTA(5,NT)=ISTABX                                               LDGEDA     90
      ICONTA(6,NT)=IFLTN                                                LDGEDA     91
      ICONTA(7,NT)=IUALN                                                LDGEDA     92
      ICONTA(9,NT)=ICBRN                                                LDGEDA     93
      ICONTA(10,NT)=IGSTAN                                              LDGEDA     94
      ICONTA(11,NT)=ITEBN                                               LDGEDA     95
      ICONTA(12,NT)=IMXLN                                               LDGEDA     96
      ICONTA(14,NT)=IGENDA(14,JG)                                       LDGEDA     97
      ICONTA(15,NT)=IGENDA(15,JG)                                       LDGEDA     98
      ICONTA(16,NT)=IGENDA(16,JG)                                       LDGEDA     99
C                                                                       LDGEDA    100
      DDAT(JLN+24)=0.0                                                  LDGEDA    101
      DDAT(JLN+25)=0.0                                                  LDGEDA    102
C                                                                       LDGEDA    103
      CALL CHKNAM(BUSNAM,NLF)                                           LDGEDA    104
C                                                                       LDGEDA    105
      IF(IGEN.EQ.0.OR.IGEN.EQ.4.OR.IGEN.EQ.8.OR.IGEN.EQ.12)THEN         LDGEDA    106
C                                                                       LDGEDA    107
C   DATA IN X'S AND TIME CONSTANT FORM                                  LDGEDA    108
C                                                                       LDGEDA    109
      RAN=TDDAT(LTN+7)                                                  LDGEDA    110
      XD=TDDAT(LTN+8)                                                   LDGEDA    111
      XQ=TDDAT(LTN+9)                                                   LDGEDA    112
      XL=TDDAT(LTN+10)                                                  LDGEDA    113
      X1D=TDDAT(LTN+11)                                                 LDGEDA    114
      X1Q=TDDAT(LTN+12)                                                 LDGEDA    115
      X11D=TDDAT(LTN+13)                                                LDGEDA    116
      X11Q=TDDAT(LTN+14)                                                LDGEDA    117
      T1D=TDDAT(LTN+15)                                                 LDGEDA    118
      T1Q=TDDAT(LTN+16)                                                 LDGEDA    119
      T11D=TDDAT(LTN+17)                                                LDGEDA    120
      T11Q=TDDAT(LTN+18)                                                LDGEDA    121
      LTN=LTN+18                                                        LDGEDA    122
      DDAT(JLN+18)=9999999.0                                            LDGEDA    123
      DDAT(JLN+20)=9999999.0                                            LDGEDA    124
CD                                                                      LDGEDA    125
CD    CALL CHKGXT TO PERFORM SANITY CHECK OF GENERATOR IMPEDANCE AND    LDGEDA    126
CD    TIME CONSTANTS                                                    LDGEDA    127
CD                                                                      LDGEDA    128
      CALL CHKGXT(NLF,BUSNAM,NGRI,                                      LDGEDA    129
     & RAN,XD,XQ,XL,X1D,X1Q,X11D,X11Q,T1D,T1Q,T11D,T11Q,IEBK1)          LDGEDA    130
C                                                                       LDGEDA    131
      DDAT(JLN+6)=XD-XL                                                 LDGEDA    132
      DDAT(JLN+7)=XQ-XL                                                 LDGEDA    133
      DDAT(JLN+8)=XL                                                    LDGEDA    134
      DDAT(JLN+9)=RAN                                                   LDGEDA    135
C                                                                       LDGEDA    136
C     TRANSIENT Q-AXIS                                                  LDGEDA    137
C                                                                       LDGEDA    138
      IF (X1Q.GT.0.0.AND.T1Q.GT.0.0) THEN                               LDGEDA    139
        DDAT(JLN+12)=((X1Q-XL)*DDAT(JLN+7))/(XQ-X1Q)                    LDGEDA    140
        DDAT(JLN+13)=(DDAT(JLN+7)+DDAT(JLN+12))/(WOBASE*T1Q)            LDGEDA    141
      ELSE                                                              LDGEDA    142
        DDAT(JLN+12)=999999.0                                           LDGEDA    143
        DDAT(JLN+13)=0.0                                                LDGEDA    144
      ENDIF                                                             LDGEDA    145
C                                                                       LDGEDA    146
C     TRANSIENT D-AXIS                                                  LDGEDA    147
C                                                                       LDGEDA    148
      IF (IEBK1.EQ.0) THEN                                              LDGEDA    149
        DDAT(JLN+10)=((X1D-XL)*DDAT(JLN+6))/(XD-X1D)                    LDGEDA    150
        DDAT(JLN+11)=(DDAT(JLN+10)+DDAT(JLN+6))/(WOBASE*T1D)            LDGEDA    151
      ELSE                                                              LDGEDA    152
        IEBK=2                                                          LDGEDA    153
      ENDIF                                                             LDGEDA    154
C                                                                       LDGEDA    155
C     SUBTRANSIENT Q-AXIS                                               LDGEDA    156
C                                                                       LDGEDA    157
      IF (X11Q.GT.0.0.AND.T11Q.GT.0.0) THEN                             LDGEDA    158
        DDAT(JLN+16)=((X11Q-XL)*(X1Q-XL))/(X1Q-X11Q)                    LDGEDA    159
        XKK=(DDAT(JLN+7)*DDAT(JLN+12))/(DDAT(JLN+7)+DDAT(JLN+12))       LDGEDA    160
        DDAT(JLN+17)=(DDAT(JLN+16)+XKK)/(WOBASE*T11Q)                   LDGEDA    161
      ELSE                                                              LDGEDA    162
        DDAT(JLN+16)=999999.0                                           LDGEDA    163
        DDAT(JLN+17)=0.0                                                LDGEDA    164
      ENDIF                                                             LDGEDA    165
C                                                                       LDGEDA    166
C     SUBTRANSIENT D-AXIS                                               LDGEDA    167
C                                                                       LDGEDA    168
      IF (X11D.GT.0.0.AND.T11D.GT.0.0) THEN                             LDGEDA    169
        DDAT(JLN+14)=((X11D-XL)*(X1D-XL))/(X1D-X11D)                    LDGEDA    170
        DDAT(JLN+15)=(DDAT(JLN+14)+((DDAT(JLN+10)*DDAT(JLN+6))          LDGEDA    171
     *               /(DDAT(JLN+10)+DDAT(JLN+6))))/(WOBASE*T11D)        LDGEDA    172
      ELSE                                                              LDGEDA    173
        DDAT(JLN+14)=9999999.0                                          LDGEDA    174
        DDAT(JLN+15)=0.0                                                LDGEDA    175
      ENDIF                                                             LDGEDA    176
C                                                                       LDGEDA    177
      ELSE                                                              LDGEDA    178
C                                                                       LDGEDA    179
C     DATA IN PARK'S FORM                                               LDGEDA    180
C                                                                       LDGEDA    181
      DO 150 LL=6,21                                                    LDGEDA    182
  150 DDAT(JLN+LL)=TDDAT(LTN+1+LL)                                      LDGEDA    183
      LTN=LTN+22                                                        LDGEDA    184
      IF(IGEN.EQ.2.OR.IGEN.EQ.6.OR.IGEN.EQ.10.OR.IGEN.EQ.14)THEN        LDGEDA    185
      DDAT(JLN+24)=TDDAT(LTN+1)                                         LDGEDA    186
      DDAT(JLN+25)=TDDAT(LTN+2)                                         LDGEDA    187
      LTN=LTN+2                                                         LDGEDA    188
      ENDIF                                                             LDGEDA    189
C                                                                       LDGEDA    190
      IF (IDDAT(JLN+12).EQ.0) DDAT(JLN+12)=9999999.0                    LDGEDA    191
      IF (IDDAT(JLN+14).EQ.0) DDAT(JLN+14)=9999999.0                    LDGEDA    192
      IF (IDDAT(JLN+16).EQ.0) DDAT(JLN+16)=9999999.0                    LDGEDA    193
      IF (IDDAT(JLN+18).EQ.0) DDAT(JLN+18)=9999999.0                    LDGEDA    194
      IF (IDDAT(JLN+20).EQ.0) DDAT(JLN+20)=9999999.0                    LDGEDA    195
C                                                                       LDGEDA    196
C   ENDIF IGEN.EQ.0                                                     LDGEDA    197
C                                                                       LDGEDA    198
      ENDIF                                                             LDGEDA    199
C                                                                       LDGEDA    200
C                                                                       LDGEDA    201
      IF(ISATX.NE.0)THEN                                                LDGEDA    202
      DO 200 LL=1,6                                                     LDGEDA    203
  200 SATC(LL)=TDDAT(LTN+LL)                                            LDGEDA    204
      LTN=LTN+6                                                         LDGEDA    205
      ENDIF                                                             LDGEDA    206
      IF(ISATX.EQ.3.OR.ISATX.EQ.30)THEN                                 LDGEDA    207
      DO 250 LL=1,6                                                     LDGEDA    208
  250 SATC(LL+6)=TDDAT(LTN+LL)                                          LDGEDA    209
      LTN=LTN+6                                                         LDGEDA    210
      ENDIF                                                             LDGEDA    211
C                                                                       LDGEDA    212
C  PREPARE GENERATOR SATURATION DATA                                    LDGEDA    213
C                                                                       LDGEDA    214
      DDAT(JLN+26)=0.0                                                  LDGEDA    215
      DDAT(JLN+27)=10.0                                                 LDGEDA    216
      DDAT(JLN+28)=99.0                                                 LDGEDA    217
      IF (ISATX.EQ.0) GO TO 400                                         LDGEDA    218
      IF (ISATX.GT.3) GO TO 300                                         LDGEDA    219
C             ISAT=1,2,3                                                LDGEDA    220
      DDAT(JLN+26)=SATC(1)                                              LDGEDA    221
      ICONTA(3,NT)=ISATX                                                LDGEDA    222
      DDAT(JLN+27)=SATC(2)                                              LDGEDA    223
      DDAT(JLN+28)=SATC(3)                                              LDGEDA    224
      DDAT(JLN+29)=SATC(4)                                              LDGEDA    225
      DDAT(JLN+30)=SATC(5)                                              LDGEDA    226
      IF (IDDAT(JLN+29).EQ.0) THEN                                      LDGEDA    227
         DDAT(JLN+29)=10.                                               LDGEDA    228
         DDAT(JLN+30)=50.                                               LDGEDA    229
      ENDIF                                                             LDGEDA    230
      IF (ISATX.LT.3) GO TO 400                                         LDGEDA    231
C             ISAT=3                                                    LDGEDA    232
      DDAT(JLN+45)=SATC(7)                                              LDGEDA    233
      DDAT(JLN+46)=SATC(8)                                              LDGEDA    234
      DDAT(JLN+47)=SATC(9)                                              LDGEDA    235
      DDAT(JLN+48)=SATC(10)                                             LDGEDA    236
      IF (IDDAT(JLN+48).EQ.0) THEN                                      LDGEDA    237
         DDAT(JLN+48)=10.                                               LDGEDA    238
         DDAT(JLN+49)=50.                                               LDGEDA    239
      ENDIF                                                             LDGEDA    240
      GO TO 400                                                         LDGEDA    241
  300 IF (ISATX.GT.30) GO TO 350                                        LDGEDA    242
C             ISTA=10,20,30                                             LDGEDA    243
      DDAT(JLN+28)=SATC(1)                                              LDGEDA    244
      DDAT(JLN+29)=SATC(4)                                              LDGEDA    245
      DDAT(JLN+30)=SATC(6)                                              LDGEDA    246
C             COMPUTE ASAT AND BSAT                                     LDGEDA    247
      XNUM=(SATC(5)-SATC(4))/(SATC(3)-SATC(2))                          LDGEDA    248
      XNUM=LOG(XNUM)                                                    LDGEDA    249
      DDAT(JLN+27)=XNUM/(SATC(4)-SATC(2))                               LDGEDA    250
      XNUM=EXP(DDAT(JLN+27)*(SATC(4)-SATC(1)))                          LDGEDA    251
      DDAT(JLN+26)=(SATC(5)-SATC(4))/XNUM                               LDGEDA    252
      ICONTA(3,NT)=ISATX/10                                             LDGEDA    253
      IF (IDDAT(JLN+29).EQ.0) THEN                                      LDGEDA    254
         DDAT(JLN+29)=10.                                               LDGEDA    255
         DDAT(JLN+30)=50.                                               LDGEDA    256
      ENDIF                                                             LDGEDA    257
      IF (ISATX.LT.30) GO TO 400                                        LDGEDA    258
C             ISTA=30                                                   LDGEDA    259
      DDAT(JLN+47)=SATC(7)                                              LDGEDA    260
      DDAT(JLN+48)=SATC(10)                                             LDGEDA    261
      DDAT(JLN+49)=SATC(12)                                             LDGEDA    262
C                                                                       LDGEDA    263
C  COMPUTE ASAT AND BSAT                                                LDGEDA    264
C                                                                       LDGEDA    265
      XNUM=(SATC(11)-SATC(10))/(SATC(9)-SATC(8))                        LDGEDA    266
      XNUM=LOG(XNUM)                                                    LDGEDA    267
      DDAT(JLN+46)=XNUM/(SATC(10)-SATC(8))                              LDGEDA    268
      XNUM=EXP(DDAT(JLN+46)*(SATC(10)-SATC(7)))                         LDGEDA    269
      DDAT(JLN+45)=(SATC(11)-SATC(10))/XNUM                             LDGEDA    270
      ICONTA(3,NT)=ISATX/10                                             LDGEDA    271
      IF (IDDAT(JLN+48).EQ.0) THEN                                      LDGEDA    272
         DDAT(JLN+48)=10.                                               LDGEDA    273
         DDAT(JLN+49)=50.                                               LDGEDA    274
      ENDIF                                                             LDGEDA    275
      GO TO 400                                                         LDGEDA    276
  350 CONTINUE                                                          LDGEDA    277
      IEBK=2                                                            LDGEDA    278
      IF(KLFO.EQ.0)THEN                                                 LDGEDA    279
      WRITE(MSG(1),5000) NLF,NGRI,ISATX                                 LDGEDA    280
      ELSE                                                              LDGEDA    281
      WRITE(MSG(1),5100) BUSNAM,NGRI,ISATX                              LDGEDA    282
      ENDIF                                                             LDGEDA    283
      CALL PRTMSG(1)                                                    LDGEDA    284
  400 CONTINUE                                                          LDGEDA    285
C                                                                       LDGEDA    286
      DDAT(JLN+1)=TDDAT(LTN1+1)                                         LDGEDA    287
      DDAT(JLN+2)=TDDAT(LTN1+2)                                         LDGEDA    288
      DDAT(JLN+31)=TDDAT(LTN1+3)                                        LDGEDA    289
      DDAT(JLN+3)=TDDAT(LTN1+4)                                         LDGEDA    290
      DDAT(JLN+4)=TDDAT(LTN1+5)                                         LDGEDA    291
      DDAT(JLN+5)=TDDAT(LTN1+6)                                         LDGEDA    292
C                                                                       LDGEDA    293
      XPD(NT)=DDAT(JLN+31)                                              LDGEDA    294
      IF(IDDAT(JLN+5).NE.0)THEN                                         LDGEDA    295
        DDAT(JLN+5)=DDAT(JLN+5)*4.0/PI                                  LDGEDA    296
        IF(IGEN.EQ.0.OR.IGEN.EQ.4.OR.IGEN.EQ.8.OR.IGEN.EQ.12)THEN       LDGEDA    297
          DDAT(JLN+11)=DDAT(JLN+11)*WOBASE/DDAT(JLN+5)                  LDGEDA    298
          DDAT(JLN+13)=DDAT(JLN+13)*WOBASE/DDAT(JLN+5)                  LDGEDA    299
          DDAT(JLN+15)=DDAT(JLN+15)*WOBASE/DDAT(JLN+5)                  LDGEDA    300
          DDAT(JLN+17)=DDAT(JLN+17)*WOBASE/DDAT(JLN+5)                  LDGEDA    301
        ENDIF                                                           LDGEDA    302
      ELSE                                                              LDGEDA    303
        DDAT(JLN+5)=WOBASE                                              LDGEDA    304
      ENDIF                                                             LDGEDA    305
C                                                                       LDGEDA    306
      IF (LDEB)WRITE(IUD6,6100) JLN,DDAT(JLN+5),WOBASE                  LDGEDA    307
C                                                                       LDGEDA    308
      JCONTA(1,NT)=JLN                                                  LDGEDA    309
C                                                                       LDGEDA    310
      IF (IDDAT(JLN+24).NE.0.OR.IDDAT(JLN+25).NE.0                      LDGEDA    311
     *.OR.ICONTA(3,NT).EQ.3) THEN                                       LDGEDA    312
      JLN=JLN+49                                                        LDGEDA    313
      ELSE                                                              LDGEDA    314
      JLN=JLN+38                                                        LDGEDA    315
      ENDIF                                                             LDGEDA    316
C                                                                       LDGEDA    317
      CALL MCHECK (NLF,1,JLN,'LDGEDA')                                  LDGEDA    318
      JCONTA(7,NT)=0                                                    LDGEDA    319
      ICONTA(8,NT)=0                                                    LDGEDA    320
      IF (MASSN.EQ.0) GO TO 500                                         LDGEDA    321
      LTN=LTN+1                                                         LDGEDA    322
      JLN=JLN+1                                                         LDGEDA    323
      IDDAT(JLN+1)=ITDDAT(LTN+1)                                        LDGEDA    324
      IDDAT(JLN+2)=ITDDAT(LTN+2)                                        LDGEDA    325
      IDDAT(JLN+3)=ITDDAT(LTN+3)                                        LDGEDA    326
      IDDAT(JLN+4)=ITDDAT(LTN+4)                                        LDGEDA    327
      IDDAT(JLN+5)=ITDDAT(LTN+5)                                        LDGEDA    328
      DDAT(JLN+6)=TDDAT(LTN+6)                                          LDGEDA    329
      DDAT(JLN+7)=TDDAT(LTN+7)                                          LDGEDA    330
      MASSN6=MASSN*6                                                    LDGEDA    331
      DO 450 LL=1,MASSN6                                                LDGEDA    332
  450 DDAT(JLN+7+LL)=TDDAT(LTN+7+LL)                                    LDGEDA    333
      ICONTA(8,NT)=MASSN                                                LDGEDA    334
      JCONTA(7,NT)=JLN                                                  LDGEDA    335
      II=7+6*MASSN                                                      LDGEDA    336
C      IDDAT(JLN-1)=II                                                  LDGEDA    337
      IDDAT(JLN)=II                                                     LDGEDA    338
      JLN=JLN+II                                                        LDGEDA    339
      CALL MCHECK (NLF,2,JLN,'LDGEDA')                                  LDGEDA    340
  500 CONTINUE                                                          LDGEDA    341
      IF (LDEB)WRITE (IUD6,6000) IEXX,JLN,JCONTA(3,NT),NT               LDGEDA    342
C                                                                       LDGEDA    343
      JCONTA(8,NT)=0                                                    LDGEDA    344
      IF (ICBRN.GT.1) THEN                                              LDGEDA    345
         DDAT(JLN+1)=TDDAT(LTN+1)                                       LDGEDA    346
         DDAT(JLN+2)=TDDAT(LTN+2)                                       LDGEDA    347
         IDDAT(JLN+3)=ITDDAT(LTN+3)                                     LDGEDA    348
         DDAT(JLN+4)=TDDAT(LTN+4)                                       LDGEDA    349
         JCONTA(8,NT)=JLN                                               LDGEDA    350
         JLN=JLN+4                                                      LDGEDA    351
      ENDIF                                                             LDGEDA    352
      GOTO 650                                                          LDGEDA    353
C                                                                       LDGEDA    354
  550 CONTINUE                                                          LDGEDA    355
C                                                                       LDGEDA    356
C     LOAD IN THE CLASSICAL GENERATOR DATA                              LDGEDA    357
C                                                                       LDGEDA    358
      ICONTA(1,NT)=IGEN                                                 LDGEDA    359
      ICONTA(3,NT)=0                                                    LDGEDA    360
      ICONTA(4,NT)=0                                                    LDGEDA    361
      ICONTA(5,NT)=0                                                    LDGEDA    362
      ICONTA(6,NT)=0                                                    LDGEDA    363
      ICONTA(7,NT)=0                                                    LDGEDA    364
      ICONTA(8,NT)=0                                                    LDGEDA    365
      ICONTA(9,NT)=0                                                    LDGEDA    366
      ICONTA(10,NT)=0                                                   LDGEDA    367
      ICONTA(11,NT)=0                                                   LDGEDA    368
      ICONTA(12,NT)=0                                                   LDGEDA    369
C                                                                       LDGEDA    370
      JCONTA(1,NT)=JLN                                                  LDGEDA    371
      JCONTA(3,NT)=0                                                    LDGEDA    372
      JCONTA(4,NT)=0                                                    LDGEDA    373
      JCONTA(5,NT)=0                                                    LDGEDA    374
      JCONTA(6,NT)=0                                                    LDGEDA    375
      JCONTA(7,NT)=0                                                    LDGEDA    376
      JCONTA(8,NT)=0                                                    LDGEDA    377
      JCONTA(9,NT)=0                                                    LDGEDA    378
      JCONTA(10,NT)=0                                                   LDGEDA    379
      JCONTA(11,NT)=0                                                   LDGEDA    380
C                                                                       LDGEDA    381
      XTRXX=TDDAT(LTN+1)                                                LDGEDA    382
      XPDN=TDDAT(LTN+2)                                                 LDGEDA    383
      DDAT(JLN+1)=TDDAT(LTN+3)                                          LDGEDA    384
      DDAT(JLN+2)=TDDAT(LTN+4)                                          LDGEDA    385
      DDAT(JLN+3)=TDDAT(LTN+5)                                          LDGEDA    386
      DDAT(JLN+4)=TDDAT(LTN+6)                                          LDGEDA    387
      FBGNT=TDDAT(LTN+7)                                                LDGEDA    388
C                                                                       LDGEDA    389
      XPDN=XPDN+XTRXX                                                   LDGEDA    390
      IF(IDDAT(JLN+3).EQ.0.OR.IDDAT(JLN+4).EQ.0)GOTO 600                LDGEDA    391
      DDAT(JLN+1)=DDAT(JLN+1)*DDAT(JLN+3)/BASPC                         LDGEDA    392
      DDAT(JLN+2)=DDAT(JLN+2)*DDAT(JLN+3)/BASPC                         LDGEDA    393
      XPDN=XPDN*BASPC*DDAT(JLN+4)*DDAT(JLN+4)/DDAT(JLN+3)               LDGEDA    394
  600 XPD(NT)=1.0/XPDN                                                  LDGEDA    395
C                                                                       LDGEDA    396
C     SET MINIMUM XDP                                                   LDGEDA    397
C                                                                       LDGEDA    398
      IF (XPDN.LT.0.001) THEN                                           LDGEDA    399
         XPDN=0.001                                                     LDGEDA    400
         XPD(NT)=1000.0                                                 LDGEDA    401
      END IF                                                            LDGEDA    402
C                                                                       LDGEDA    403
      FBGNT=FBGNT*4.0/PI                                                LDGEDA    404
      WXBASE=FBGNT                                                      LDGEDA    405
      IF(ABS(WXBASE).LT.1.E-5) WXBASE=WOBASE                            LDGEDA    406
      DDAT(JLN+5)=WXBASE                                                LDGEDA    407
C                                                                       LDGEDA    408
      JLN=JLN+5                                                         LDGEDA    409
      CALL MCHECK(NLF,3,JLN,'LDGEDA')                                   LDGEDA    410
      GOTO 2350                                                         LDGEDA    411
C                                                                       LDGEDA    412
  650 CONTINUE                                                          LDGEDA    413
      IF (IEXX.EQ.0) GO TO 2350                                         LDGEDA    414
      IF (IEXX.EQ.50) GO TO 850                                         LDGEDA    415
      LTN=JGENDA(3,JG)                                                  LDGEDA    416
      IVTN=ITDDAT(LTN+1)                                                LDGEDA    417
      JLN=JLN+1                                                         LDGEDA    418
      IDDAT(JLN+1)=IVTN                                                 LDGEDA    419
      DO 700 LL=2,25                                                    LDGEDA    420
  700 DDAT(JLN+LL)=TDDAT(LTN+LL)                                        LDGEDA    421
      JCONTA(3,NT)=JLN                                                  LDGEDA    422
      IF (IEXX.EQ.1.OR.IEXX.EQ.2) THEN                                  LDGEDA    423
         JLN=JLN+25                                                     LDGEDA    424
         LTN=LTN+25                                                     LDGEDA    425
      ELSE IF (IEXX.EQ.3.OR.IEXX.EQ.5) THEN                             LDGEDA    426
         DO 750 LL=26,33                                                LDGEDA    427
            DDAT(JLN+LL)=TDDAT(LTN+LL)                                  LDGEDA    428
  750    CONTINUE                                                       LDGEDA    429
         JLN=JLN+36                                                     LDGEDA    430
         LTN=LTN+33                                                     LDGEDA    431
      ELSE IF (IEXX.EQ.4) THEN                                          LDGEDA    432
         DDAT(JLN+26)=TDDAT(LTN+26)                                     LDGEDA    433
         DDAT(JLN+27)=TDDAT(LTN+27)                                     LDGEDA    434
         DDAT(JLN+28)=TDDAT(LTN+28)                                     LDGEDA    435
         JLN=JLN+31                                                     LDGEDA    436
         LTN=LTN+28                                                     LDGEDA    437
      ELSE IF (IEXX.EQ.6) THEN                                          LDGEDA    438
         DDAT(JLN+26)=TDDAT(LTN+26)                                     LDGEDA    439
         DDAT(JLN+27)=TDDAT(LTN+27)                                     LDGEDA    440
         JLN=JLN+30                                                     LDGEDA    441
         LTN=LTN+27                                                     LDGEDA    442
      ELSE IF (IEXX.EQ.8) THEN                                          LDGEDA    443
         DDAT(JLN+26)=TDDAT(LTN+26)                                     LDGEDA    444
         DDAT(JLN+27)=TDDAT(LTN+27)                                     LDGEDA    445
         JLN=JLN+28                                                     LDGEDA    446
         LTN=LTN+27                                                     LDGEDA    447
      ELSE IF (IEXX.EQ.14) THEN                                         LDGEDA    448
         DDAT(JLN+26)=TDDAT(LTN+26)                                     LDGEDA    449
         DDAT(JLN+27)=TDDAT(LTN+27)                                     LDGEDA    450
         DDAT(JLN+28)=TDDAT(LTN+28)                                     LDGEDA    451
         DDAT(JLN+29)=TDDAT(LTN+29)                                     LDGEDA    452
         DDAT(JLN+30)=TDDAT(LTN+30)                                     LDGEDA    453
         DDAT(JLN+31)=TDDAT(LTN+31)                                     LDGEDA    454
         DDAT(JLN+32)=TDDAT(LTN+32)                                     LDGEDA    455
         DDAT(JLN+33)=TDDAT(LTN+33)                                     LDGEDA    456
         JLN=JLN+33                                                     LDGEDA    457
         LTN=LTN+33                                                     LDGEDA    458
      ELSE IF (IEXX.EQ.30) THEN                                         LDGEDA    459
         DDAT(JLN+26)=TDDAT(LTN+26)                                     LDGEDA    460
         DDAT(JLN+27)=TDDAT(LTN+27)                                     LDGEDA    461
         DDAT(JLN+28)=TDDAT(LTN+28)                                     LDGEDA    462
         DDAT(JLN+29)=TDDAT(LTN+29)                                     LDGEDA    463
         JLN=JLN+41                                                     LDGEDA    464
         LTN=LTN+29                                                     LDGEDA    465
      ELSE IF (IEXX.EQ.31) THEN                                         LDGEDA    466
         JLN=JLN+28                                                     LDGEDA    467
      ELSE IF (IEXX.EQ.32) THEN                                         LDGEDA    468
         DO 800 LL=26,35                                                LDGEDA    469
  800    DDAT(JLN+LL)=TDDAT(LTN+LL)                                     LDGEDA    470
         JLN=JLN+46                                                     LDGEDA    471
         LTN=LTN+35                                                     LDGEDA    472
      ELSE IF (IEXX.EQ.34) THEN                                         LDGEDA    473
         JLN=JLN+29                                                     LDGEDA    474
      ELSE                                                              LDGEDA    475
         JLN=JLN+25                                                     LDGEDA    476
         LTN=LTN+25                                                     LDGEDA    477
      ENDIF                                                             LDGEDA    478
      GO TO 900                                                         LDGEDA    479
C                                                                       LDGEDA    480
  850 CONTINUE                                                          LDGEDA    481
C                                                                       LDGEDA    482
C     USER DEFINED EXCITER DATA                                         LDGEDA    483
C                                                                       LDGEDA    484
      JCONTA(3,NT)=JLN                                                  LDGEDA    485
      LTN=JGENDA(3,JG)                                                  LDGEDA    486
      DDAT(JLN+1)=TDDAT(LTN+1)                                          LDGEDA    487
      DDAT(JLN+2)=TDDAT(LTN+2)                                          LDGEDA    488
      IDDAT(JLN+3)=ITDDAT(LTN+3)                                        LDGEDA    489
      LTN=LTN+8                                                         LDGEDA    490
      JLN=JLN+8                                                         LDGEDA    491
      JLN1=0                                                            LDGEDA    492
      NUF=1                                                             LDGEDA    493
      CALL LUDMDA(NUF,JLN1,LTN)                                         LDGEDA    494
      IF(NUF.EQ.900) GO TO 4550                                         LDGEDA    495
  900 CONTINUE                                                          LDGEDA    496
      CALL MCHECK (NLF,4,JLN,'LDGEDA')                                  LDGEDA    497
C                                                                       LDGEDA    498
C--  LOAD STABILIZER DATA IF THERE IS ANY                               LDGEDA    499
C                                                                       LDGEDA    500
      IF (ISTABX.EQ.0) GO TO 2050                                       LDGEDA    501
      IF(ISTABX.EQ.50) GO TO 1900                                       LDGEDA    502
      JCONTA(4,NT)=JLN                                                  LDGEDA    503
      LTN=JGENDA(4,JG)                                                  LDGEDA    504
C                                                                       LDGEDA    505
C     LOAD IN THE STABILIZER DATA                                       LDGEDA    506
C                                                                       LDGEDA    507
C            1   2    3   4    5    6    7    8    9   10   11   12     LDGEDA    508
      GOTO(950,1150,1150,950,1150,1150,1300,1950,1400,1500,1650,1800)   LDGEDA    509
     &,ISTABX                                                           LDGEDA    510
C                                                                       LDGEDA    511
  950 CONTINUE                                                          LDGEDA    512
C                                                                       LDGEDA    513
C   TYPE 1 AND 4 STABILIZER                                             LDGEDA    514
C                                                                       LDGEDA    515
      ASSIGN 1050 TO I220                                               LDGEDA    516
C                                                                       LDGEDA    517
C   COMMON PART OF DATA FOR STABILIZER                                  LDGEDA    518
C   TYPES 1,2,3,4,5,6,8,10 AND 11                                       LDGEDA    519
C                                                                       LDGEDA    520
 1000 CONTINUE                                                          LDGEDA    521
         IDDAT(JLN+1)=ITDDAT(LTN+1)                                     LDGEDA    522
         IDDAT(JLN+2)=ITDDAT(LTN+2)                                     LDGEDA    523
         GOTO I220                                                      LDGEDA    524
C                                                                       LDGEDA    525
 1050 CONTINUE                                                          LDGEDA    526
         DO 1100 LJ=3,14                                                LDGEDA    527
 1100    DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                     LDGEDA    528
         DDAT(JLN+9)=AMIN1(DDAT(JLN+9),99.0)                            LDGEDA    529
         DDAT(JLN+10)=AMAX1(DDAT(JLN+10),-99.0)                         LDGEDA    530
         LTN=LTN+14                                                     LDGEDA    531
         JLN=JLN+16                                                     LDGEDA    532
      GOTO 1950                                                         LDGEDA    533
 1150 CONTINUE                                                          LDGEDA    534
C                                                                       LDGEDA    535
C   TYPE 2,3,5,6 STABILIZERS                                            LDGEDA    536
C                                                                       LDGEDA    537
      ASSIGN 1200 TO I220                                               LDGEDA    538
      GOTO 1000                                                         LDGEDA    539
 1200 CONTINUE                                                          LDGEDA    540
         DO 1250 LJ=3,22                                                LDGEDA    541
 1250    DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                     LDGEDA    542
         DDAT(JLN+9)=AMIN1(DDAT(JLN+9),99.0)                            LDGEDA    543
         DDAT(JLN+10)=AMAX1(DDAT(JLN+10),-99.0)                         LDGEDA    544
         JLN=JLN+27                                                     LDGEDA    545
         LTN=LTN+22                                                     LDGEDA    546
      GOTO 1950                                                         LDGEDA    547
C                                                                       LDGEDA    548
 1300 CONTINUE                                                          LDGEDA    549
C                                                                       LDGEDA    550
C   TYPE 7 STABILIZER                                                   LDGEDA    551
C                                                                       LDGEDA    552
      IDDAT(JLN+1)=0                                                    LDGEDA    553
      DO 1350 LJ=2,9                                                    LDGEDA    554
 1350 DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                        LDGEDA    555
         DDAT(JLN+8)=AMIN1(DDAT(JLN+8),99.0)                            LDGEDA    556
         DDAT(JLN+9)=AMAX1(DDAT(JLN+9),-99.0)                           LDGEDA    557
      JLN=JLN+9                                                         LDGEDA    558
      LTN=LTN+9                                                         LDGEDA    559
      GOTO 1950                                                         LDGEDA    560
C                                                                       LDGEDA    561
 1400 CONTINUE                                                          LDGEDA    562
C                                                                       LDGEDA    563
C     TYPE 9 STABILIZER                                                 LDGEDA    564
C                                                                       LDGEDA    565
         IDDAT(JLN+1)=ITDDAT(LTN+1)                                     LDGEDA    566
         IDDAT(JLN+2)=ITDDAT(LTN+2)                                     LDGEDA    567
         IDDAT(JLN+3)=0                                                 LDGEDA    568
         IDDAT(JLN+4)=4                                                 LDGEDA    569
         IDDAT(JLN+5)=ITDDAT(LTN+5)                                     LDGEDA    570
         IDDAT(JLN+6)=ITDDAT(LTN+6)                                     LDGEDA    571
         DO 1450 LJ=7,29                                                LDGEDA    572
 1450    DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                     LDGEDA    573
         DDAT(JLN+13)=AMIN1(DDAT(JLN+13),99.0)                          LDGEDA    574
         DDAT(JLN+14)=AMAX1(DDAT(JLN+14),-99.0)                         LDGEDA    575
         JLN=JLN+39                                                     LDGEDA    576
         LTN=LTN+29                                                     LDGEDA    577
      GOTO 1950                                                         LDGEDA    578
 1500 CONTINUE                                                          LDGEDA    579
C                                                                       LDGEDA    580
C   TYPE 10 STABILIZER                                                  LDGEDA    581
C                                                                       LDGEDA    582
      ASSIGN 1550 TO I220                                               LDGEDA    583
      GOTO 1000                                                         LDGEDA    584
 1550 CONTINUE                                                          LDGEDA    585
         DO 1600 LJ=3,20                                                LDGEDA    586
 1600    DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                     LDGEDA    587
         LTN=LTN+20                                                     LDGEDA    588
         DDAT(JLN+14)=AMIN1(DDAT(JLN+14),99.0)                          LDGEDA    589
         DDAT(JLN+15)=AMAX1(DDAT(JLN+15),-99.0)                         LDGEDA    590
         JLN=JLN+27                                                     LDGEDA    591
      GOTO 1950                                                         LDGEDA    592
 1650 CONTINUE                                                          LDGEDA    593
C                                                                       LDGEDA    594
C   TYPE 11 STABILIZER                                                  LDGEDA    595
C                                                                       LDGEDA    596
      ASSIGN 1700 TO I220                                               LDGEDA    597
      GOTO 1000                                                         LDGEDA    598
 1700 CONTINUE                                                          LDGEDA    599
         DO 1750 LJ=3,30                                                LDGEDA    600
 1750    DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                     LDGEDA    601
         DDAT(JLN+14)=AMIN1(DDAT(JLN+14),99.0)                          LDGEDA    602
         DDAT(JLN+15)=AMAX1(DDAT(JLN+15),-99.0)                         LDGEDA    603
         LTN=LTN+30                                                     LDGEDA    604
         JLN=JLN+34                                                     LDGEDA    605
         GOTO 1950                                                      LDGEDA    606
 1800 CONTINUE                                                          LDGEDA    607
C                                                                       LDGEDA    608
C   TYPE 12 STABILIZER                                                  LDGEDA    609
C                                                                       LDGEDA    610
         IDDAT(JLN+1)=ITDDAT(LTN+1)                                     LDGEDA    611
         IDDAT(JLN+2)=ITDDAT(LTN+2)                                     LDGEDA    612
         IDDAT(JLN+3)=ITDDAT(LTN+3)                                     LDGEDA    613
         IDDAT(JLN+4)=ITDDAT(LTN+4)                                     LDGEDA    614
         DO 1850 LJ=5,24                                                LDGEDA    615
 1850    DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                     LDGEDA    616
         DDAT(JLN+17)=AMIN1(DDAT(JLN+17),99.0)                          LDGEDA    617
         DDAT(JLN+18)=AMAX1(DDAT(JLN+18),-99.0)                         LDGEDA    618
         LTN=LTN+24                                                     LDGEDA    619
         JLN=JLN+31                                                     LDGEDA    620
      GOTO 1950                                                         LDGEDA    621
 1900 CONTINUE                                                          LDGEDA    622
C                                                                       LDGEDA    623
C     USER DEFINED STABILIZER DATA                                      LDGEDA    624
C                                                                       LDGEDA    625
      JCONTA(4,NT)=JLN                                                  LDGEDA    626
      LTN=JGENDA(4,JG)                                                  LDGEDA    627
      DDAT(JLN+1)=TDDAT(LTN+1)                                          LDGEDA    628
      DDAT(JLN+2)=TDDAT(LTN+2)                                          LDGEDA    629
      IDDAT(JLN+3)=ITDDAT(LTN+3)                                        LDGEDA    630
      IF (LDEB) WRITE (IUD6,6200) DDAT(JLN+1),DDAT(JLN+2)               LDGEDA    631
      JLN=JLN+8                                                         LDGEDA    632
      LTN=LTN+8                                                         LDGEDA    633
      JLN1=0                                                            LDGEDA    634
      NUF=2                                                             LDGEDA    635
      CALL LUDMDA(NUF,JLN1,LTN)                                         LDGEDA    636
      IF(NUF.EQ.900) GO TO 4550                                         LDGEDA    637
 1950 CONTINUE                                                          LDGEDA    638
      CALL MCHECK (NLF,5,JLN,'LDGEDA')                                  LDGEDA    639
C                                                                       LDGEDA    640
C--  LOAD TORSIONAL FILTER DATA IF THERE IS ANY                         LDGEDA    641
C                                                                       LDGEDA    642
      IF (IFLTN.EQ.0) GO TO 2050                                        LDGEDA    643
      JCONTA(5,NT)=JLN                                                  LDGEDA    644
      LTN=JGENDA(5,JG)                                                  LDGEDA    645
      DO 2000 LJ=1,8                                                    LDGEDA    646
 2000 DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                        LDGEDA    647
      LTN=LTN+8                                                         LDGEDA    648
      JLN=JLN+11                                                        LDGEDA    649
      CALL MCHECK (NLF,6,JLN,'LDGEDA')                                  LDGEDA    650
C                                                                       LDGEDA    651
C--  LOAD TRANSIENT EXCITATION BOOSTER DATA IF THERE IS ANY             LDGEDA    652
C                                                                       LDGEDA    653
 2050 CONTINUE                                                          LDGEDA    654
      IF (ITEBN.NE.0) THEN                                              LDGEDA    655
         JCONTA(10,NT)=JLN                                              LDGEDA    656
         LTN=JGENDA(10,JG)                                              LDGEDA    657
         DO 2100 LJ=2,5                                                 LDGEDA    658
 2100    DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                     LDGEDA    659
         LTN=LTN+5                                                      LDGEDA    660
         JLN=JLN+8                                                      LDGEDA    661
      ENDIF                                                             LDGEDA    662
C                                                                       LDGEDA    663
C--  LOAD MAXIMUM EXCITATION LIMITER DATA IF THERE IS ANY               LDGEDA    664
C                                                                       LDGEDA    665
      IF (IMXLN.NE.0) THEN                                              LDGEDA    666
         JCONTA(11,NT)=JLN                                              LDGEDA    667
         LTN=JGENDA(11,JG)                                              LDGEDA    668
         IF(IMXLN.EQ.50) THEN                                           LDGEDA    669
C                                                                       LDGEDA    670
C     USER DEFINED OVER EXCITATION LIMITER DATA                         LDGEDA    671
C                                                                       LDGEDA    672
            DDAT(JLN+1)=TDDAT(LTN+1)                                    LDGEDA    673
            DDAT(JLN+2)=TDDAT(LTN+2)                                    LDGEDA    674
            IDDAT(JLN+3)=ITDDAT(LTN+3)                                  LDGEDA    675
            JLN=JLN+8                                                   LDGEDA    676
            LTN=LTN+8                                                   LDGEDA    677
            JLN1=1                                                      LDGEDA    678
            NUF=3                                                       LDGEDA    679
            CALL LUDMDA(NUF,JLN1,LTN)                                   LDGEDA    680
            IF(NUF.EQ.900) GO TO 4550                                   LDGEDA    681
         ELSE                                                           LDGEDA    682
            DO 2150 LJ=1,8                                              LDGEDA    683
 2150       DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                  LDGEDA    684
            LTN=LTN+8                                                   LDGEDA    685
            JLN=JLN+10                                                  LDGEDA    686
         ENDIF                                                          LDGEDA    687
      ENDIF                                                             LDGEDA    688
C                                                                       LDGEDA    689
C--  LOAD UNDER EXCITATION LIMITER DATA IF THERE IS ANY                 LDGEDA    690
C                                                                       LDGEDA    691
      IF (IUALN.EQ.0) GO TO 2350                                        LDGEDA    692
      IF (IUALN.EQ.50.AND.ISTABX.NE.50) GO TO 2250                      LDGEDA    693
      IF (IUALN.EQ.50) GO TO 2350                                       LDGEDA    694
      JCONTA(6,NT)=JLN                                                  LDGEDA    695
      LTN=JGENDA(6,JG)                                                  LDGEDA    696
      DO 2200 LJ=1,16                                                   LDGEDA    697
 2200 DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                        LDGEDA    698
      LTN=LTN+16                                                        LDGEDA    699
      JLN=JLN+16                                                        LDGEDA    700
      GO TO 2300                                                        LDGEDA    701
 2250 CONTINUE                                                          LDGEDA    702
C                                                                       LDGEDA    703
C     USER DEFINED UNDER EXCITATION LIMITER DATA                        LDGEDA    704
C                                                                       LDGEDA    705
      JCONTA(6,NT)=JLN                                                  LDGEDA    706
      DDAT(JLN+1)=TDDAT(LTN+1)                                          LDGEDA    707
      DDAT(JLN+2)=TDDAT(LTN+2)                                          LDGEDA    708
      IDDAT(JLN+3)=ITDDAT(LTN+3)                                        LDGEDA    709
      JLN=JLN+8                                                         LDGEDA    710
      LTN=LTN+8                                                         LDGEDA    711
      JLN1=0                                                            LDGEDA    712
      NUF=3                                                             LDGEDA    713
      CALL LUDMDA(NUF,JLN1,LTN)                                         LDGEDA    714
      IF(NUF.EQ.900) GO TO 4550                                         LDGEDA    715
 2300 CONTINUE                                                          LDGEDA    716
      CALL MCHECK (NLF,7,JLN,'LDGEDA')                                  LDGEDA    717
 2350 CONTINUE                                                          LDGEDA    718
      ICONTA(2,NT)=IGVN                                                 LDGEDA    719
      JCONTA(2,NT)=0                                                    LDGEDA    720
      IF (IGVN.EQ.0) GO TO 3400                                         LDGEDA    721
      NTTL=NT                                                           LDGEDA    722
      JLN=JLN+1                                                         LDGEDA    723
      JCONTA(2,NT)=JLN                                                  LDGEDA    724
      LTN=JGENDA(2,JG)                                                  LDGEDA    725
      IF (IGVN.EQ.50) GO TO 3350                                        LDGEDA    726
C                                                                       LDGEDA    727
      IF(IGVN.GT.40 .AND. IGVN.LT.50)GOTO 3360                          LDGEDA    728
      IGVNB=0                                                           LDGEDA    729
      IF(IGVN.GE.31.AND.IGVN.LE.35)THEN                                 LDGEDA    730
        IGVNB=IGVN                                                      LDGEDA    731
        IGVN=IGVN-30                                                    LDGEDA    732
      ENDIF                                                             LDGEDA    733
C                                                                       LDGEDA    734
C                                                                       LDGEDA    735
C IGVN TYPE :  1    2    3    4    5    6    7    8    9   10   11      LDGEDA    736
      GOTO (2400,2400,3150,2500,2600,2650,2750,2850,3150,3150,3150,     LDGEDA    737
C       12   13   14   15   16   17   18   19   20   21   22            LDGEDA    738
     &3150,3150,3150,3150,3150,3150,3150,3150,2950,3050,3050), IGVN     LDGEDA    739
C                                                                       LDGEDA    740
C  TYPE 1, 2                                                            LDGEDA    741
C                                                                       LDGEDA    742
 2400 CONTINUE                                                          LDGEDA    743
      DO 2450 LJ=1,64                                                   LDGEDA    744
 2450 DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                        LDGEDA    745
      IDDAT(JLN+65)=ITDDAT(LTN+65)                                      LDGEDA    746
      IDDAT(JLN+66)=ITDDAT(LTN+66)                                      LDGEDA    747
C                                                                       LDGEDA    748
C-- RESERVE 12 STORAGES FOR DEADBAND 1 & 2 OF C.V. AND I.V.             LDGEDA    749
C   EACH ARRAY NEEDS 3 ELEMENTS, TOTAL 4 ARRAYS.                        LDGEDA    750
C   THE ORDER OF THESE ARRAYS IS C.V. DB1,DB2, I.V. DB1,DB2.            LDGEDA    751
C                                                                       LDGEDA    752
      DDAT(JLN+67)=0.0                                                  LDGEDA    753
      DDAT(JLN+68)=0.0                                                  LDGEDA    754
      DDAT(JLN+69)=0.0                                                  LDGEDA    755
      IF(IGVNB.EQ.0)THEN                                                LDGEDA    756
        IDDAT(JLN)=78                                                   LDGEDA    757
        LTN=LTN+66                                                      LDGEDA    758
        JLN=JLN+78                                                      LDGEDA    759
      ELSE                                                              LDGEDA    760
        IDDAT(JLN)=98                                                   LDGEDA    761
        JLNA=JLN+78                                                     LDGEDA    762
        JLNB=LTN+66                                                     LDGEDA    763
        DO 2455 LJ=1,20                                                 LDGEDA    764
          DDAT(JLNA+LJ)=TDDAT(JLNB+LJ)                                  LDGEDA    765
 2455   CONTINUE                                                        LDGEDA    766
        LTN=LTN+86                                                      LDGEDA    767
        JLN=JLN+98                                                      LDGEDA    768
      ENDIF                                                             LDGEDA    769
      CALL MCHECK (NLF,8,JLN,'LDGEDA')                                  LDGEDA    770
      GO TO 3250                                                        LDGEDA    771
C                                                                       LDGEDA    772
C  TYPE 4                                                               LDGEDA    773
C                                                                       LDGEDA    774
 2500 CONTINUE                                                          LDGEDA    775
      IF(IGVNB.EQ.0)THEN                                                LDGEDA    776
        NDD=16                                                          LDGEDA    777
      ELSE                                                              LDGEDA    778
        NDD=36                                                          LDGEDA    779
      ENDIF                                                             LDGEDA    780
      DO 2550 LJ=1,16                                                   LDGEDA    781
 2550 DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                        LDGEDA    782
      IF(DDAT(JLN+5).GT.99.0)DDAT(JLN+5)=99.0                           LDGEDA    783
      IF(DDAT(JLN+6).LT.-99.0)DDAT(JLN+6)=-99.0                         LDGEDA    784
      IF(NDD.GT.16)THEN                                                 LDGEDA    785
        DO 2560 LJ=19,38                                                LDGEDA    786
 2560   DDAT(JLN+LJ-2)=TDDAT(LTN+LJ)                                    LDGEDA    787
      ENDIF                                                             LDGEDA    788
      IF(IGEN.GE.4.AND.IGEN.LE.7)THEN                                   LDGEDA    789
        LPGLFN=ITDDAT(LTN+17)                                           LDGEDA    790
        ILPGID=ITDDAT(LTN+18)                                           LDGEDA    791
        IHPLP=1                                                         LDGEDA    792
        JGOLD=JG                                                        LDGEDA    793
      ENDIF                                                             LDGEDA    794
      IDDAT(JLN)=NDD                                                    LDGEDA    795
      LTN=LTN+NDD+2                                                     LDGEDA    796
      JLN=JLN+NDD                                                       LDGEDA    797
      CALL MCHECK (NLF,9,JLN,'LDGEDA')                                  LDGEDA    798
      GO TO 3250                                                        LDGEDA    799
C                                                                       LDGEDA    800
C  TYPE 5                                                               LDGEDA    801
C                                                                       LDGEDA    802
 2600 IGVNM1=ICONTA(2,NT-1)                                             LDGEDA    803
      IF(IGVNM1.GE.31.AND.IGVNM1.LE.35)IGVNM1=IGVNM1-30                 LDGEDA    804
      IF (IGVNM1.NE.4.AND.IGVNM1.NE.50) GO TO 3200                      LDGEDA    805
      IF(IGVNM1.EQ.50.AND.JLNX.NE.45) GO TO 3200                        LDGEDA    806
      JLNX=0                                                            LDGEDA    807
      IHPLP=2                                                           LDGEDA    808
      DDAT(JLN+1)=TDDAT(LTN+1)                                          LDGEDA    809
      DDAT(JLN+2)=TDDAT(LTN+2)                                          LDGEDA    810
      DDAT(JLN+3)=TDDAT(LTN+3)                                          LDGEDA    811
      LTN=LTN+4                                                         LDGEDA    812
      IDDAT(JLN)=4                                                      LDGEDA    813
      JLN=JLN+4                                                         LDGEDA    814
      CALL MCHECK (NLF,10,JLN,'LDGEDA')                                 LDGEDA    815
      GO TO 3250                                                        LDGEDA    816
C                                                                       LDGEDA    817
C  TYPE 6                                                               LDGEDA    818
C                                                                       LDGEDA    819
 2650 CONTINUE                                                          LDGEDA    820
      DO 2700 LJ=1,7                                                    LDGEDA    821
 2700 DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                        LDGEDA    822
      IDDAT(JLN)=7                                                      LDGEDA    823
      LTN=LTN+7                                                         LDGEDA    824
      JLN=JLN+7                                                         LDGEDA    825
      CALL MCHECK (NLF,11,JLN,'LDGEDA')                                 LDGEDA    826
      GOTO 3250                                                         LDGEDA    827
C                                                                       LDGEDA    828
C  TYPE 7                                                               LDGEDA    829
C                                                                       LDGEDA    830
 2750 CONTINUE                                                          LDGEDA    831
      DO 2800 LJ=1,10                                                   LDGEDA    832
 2800 DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                        LDGEDA    833
      IDDAT(JLN)=11                                                     LDGEDA    834
      LTN=LTN+10                                                        LDGEDA    835
      JLN=JLN+11                                                        LDGEDA    836
      CALL MCHECK (NLF,12,JLN,'LDGEDA')                                 LDGEDA    837
      GOTO 3250                                                         LDGEDA    838
C                                                                       LDGEDA    839
C  TYPE 8                                                               LDGEDA    840
C                                                                       LDGEDA    841
 2850 CONTINUE                                                          LDGEDA    842
      DO 2900 LJ=1,9                                                    LDGEDA    843
 2900 DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                        LDGEDA    844
      IDDAT(JLN)=9                                                      LDGEDA    845
      LTN=LTN+9                                                         LDGEDA    846
      JLN=JLN+9                                                         LDGEDA    847
      CALL MCHECK (NLF,13,JLN,'LDGEDA')                                 LDGEDA    848
      GOTO 3250                                                         LDGEDA    849
C                                                                       LDGEDA    850
C  TYPE 20                                                              LDGEDA    851
C                                                                       LDGEDA    852
 2950 CONTINUE                                                          LDGEDA    853
      DO 3000 LJ=1,15                                                   LDGEDA    854
 3000 DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                        LDGEDA    855
C                                                                       LDGEDA    856
C= RESERVE STORAGE FOR "DBin","DBout","At","Unl","G0"                   LDGEDA    857
C= AT POSITIONS OF       16     17     18    19   20                    LDGEDA    858
C                                                                       LDGEDA    859
      IDDAT(JLN)=20                                                     LDGEDA    860
      LTN=LTN+15                                                        LDGEDA    861
      JLN=JLN+20                                                        LDGEDA    862
      CALL MCHECK (NLF,14,JLN,'LDGEDA')                                 LDGEDA    863
      GO TO 3250                                                        LDGEDA    864
C                                                                       LDGEDA    865
C  TYPE 21, 22                                                          LDGEDA    866
C                                                                       LDGEDA    867
 3050 CONTINUE                                                          LDGEDA    868
      DO 3100 LJ=1,11                                                   LDGEDA    869
 3100 DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                        LDGEDA    870
      IDDAT(JLN)=11                                                     LDGEDA    871
      LTN=LTN+11                                                        LDGEDA    872
      JLN=JLN+11                                                        LDGEDA    873
      CALL MCHECK (NLF,15,JLN,'LDGEDA')                                 LDGEDA    874
      GOTO 3250                                                         LDGEDA    875
C                                                                       LDGEDA    876
C  TYPES WHICH HAVE NOT BE DEFINED                                      LDGEDA    877
C                                                                       LDGEDA    878
 3150 CONTINUE                                                          LDGEDA    879
      IF(KLFO.EQ.0)THEN                                                 LDGEDA    880
      WRITE(MSG(1),5300) NLF,NGRI                                       LDGEDA    881
      ELSE                                                              LDGEDA    882
      WRITE(MSG(1),5200) BUSNAM,NGRI                                    LDGEDA    883
      ENDIF                                                             LDGEDA    884
      WRITE(MSG(2),5400) IGVN                                           LDGEDA    885
      CALL PRTMSG(2)                                                    LDGEDA    886
      MSG(1)='LDGEDA GOVERNOR TYPE ERROR'                               LDGEDA    887
      CALL ASTOP(MSG(1),26)                                             LDGEDA    888
C                                                                       LDGEDA    889
C  TYPE 4 AND TYPE 5 ARE NOT MATCHED                                    LDGEDA    890
C                                                                       LDGEDA    891
 3200 CONTINUE                                                          LDGEDA    892
      IF(KLFO.EQ.0)THEN                                                 LDGEDA    893
      WRITE(MSG(1),5300) NLF,NGRI                                       LDGEDA    894
      ELSE                                                              LDGEDA    895
      WRITE(MSG(1),5200) BUSNAM,NGRI                                    LDGEDA    896
      ENDIF                                                             LDGEDA    897
      WRITE(MSG(2),5500) IGVN                                           LDGEDA    898
      WRITE(MSG(3),5600)                                                LDGEDA    899
      CALL PRTMSG(3)                                                    LDGEDA    900
      MSG(1)='LDGEDA HP/LP GOVERNOR REPRESENTATION ERROR'               LDGEDA    901
      CALL ASTOP(MSG(1),42)                                             LDGEDA    902
 3250 CONTINUE                                                          LDGEDA    903
C                                                                       LDGEDA    904
C-- LOAD THE GOVERNOR STABILIZER DATA IF THERE IS ANY                   LDGEDA    905
      IF (IGSTAN.GT.0) THEN                                             LDGEDA    906
        JCONTA(9,NT)=JLN                                                LDGEDA    907
        DO 3300 LJ=1,6                                                  LDGEDA    908
 3300   DDAT(JLN+LJ)=TDDAT(LTN+LJ)                                      LDGEDA    909
        LTN=LTN+6                                                       LDGEDA    910
        JLN=JLN+6                                                       LDGEDA    911
      ENDIF                                                             LDGEDA    912
      GO TO 3400                                                        LDGEDA    913
 3350 CONTINUE                                                          LDGEDA    914
C                                                                       LDGEDA    915
C     USER DEFINED GOVERNOR DATA                                        LDGEDA    916
C                                                                       LDGEDA    917
      JLN=JLN+2                                                         LDGEDA    918
      LTN=LTN+2                                                         LDGEDA    919
      JLNX=0                                                            LDGEDA    920
      NUF=4                                                             LDGEDA    921
      CALL LUDMDA(NUF,JLNX,LTN)                                         LDGEDA    922
      IF(NUF.EQ.900) GO TO 4550                                         LDGEDA    923
      IF(IGEN.GE.4.AND.IGEN.LE.7)THEN                                   LDGEDA    924
         IF(JLNX.EQ.45) THEN                                            LDGEDA    925
            LPGLFN=ITDDAT(LTN-3)                                        LDGEDA    926
            ILPGID=ITDDAT(LTN-2)                                        LDGEDA    927
         ELSE                                                           LDGEDA    928
            LPGLFN=0                                                    LDGEDA    929
            ILPGID=0                                                    LDGEDA    930
         ENDIF                                                          LDGEDA    931
         IHPLP=1                                                        LDGEDA    932
         JGOLD=JG                                                       LDGEDA    933
      ENDIF                                                             LDGEDA    934
      CALL MCHECK (NLF,16,JLN,'LDGEDA')                                 LDGEDA    935
      GO TO 3400                                                        LDGEDA    936
C                                                                       LDGEDA    937
 3360 CONTINUE                                                          LDGEDA    938
*IF LTSP                                                                LDGEDA    939
*ENDIF                                                                  LDGEDA    983
C                                                                       LDGEDA    984
 3400 IF(IHPLP.EQ.2)THEN                                                LDGEDA    985
        JG=JGOLD                                                        LDGEDA    986
        IHPLP=0                                                         LDGEDA    987
      ENDIF                                                             LDGEDA    988
      IF(IHPLP.EQ.0)THEN                                                LDGEDA    989
        JG=NEXGEN(JG)                                                   LDGEDA    990
        IF(JG.NE.0)GOTO 100                                             LDGEDA    991
      ELSE                                                              LDGEDA    992
        LPROG=MNEW(LPGLFN)                                              LDGEDA    993
        CALL CHKNAM(BSNAME,LPGLFN)                                      LDGEDA    994
        JG=NTHGEN(LPROG+1)                                              LDGEDA    995
 3420   IF(JG.NE.0)THEN                                                 LDGEDA    996
          IF(NGEBUS(JG).EQ.LPGLFN.AND.GENID(JG).EQ.LPGID)THEN           LDGEDA    997
            IF(IDSTAT(JG).NE.1)THEN                                     LDGEDA    998
              IF(KLFO.EQ.0)THEN                                         LDGEDA    999
                WRITE(MSG(1),6500)NLF,NGRI                              LDGEDA   1000
                WRITE(MSG(2),6600)LPGLFN,LPGID                          LDGEDA   1001
              ELSE                                                      LDGEDA   1002
                WRITE(MSG(1),6550)BUSNAM,NGRI                           LDGEDA   1003
                WRITE(MSG(2),6650)BSNAME,LPGID                          LDGEDA   1004
              ENDIF                                                     LDGEDA   1005
            ELSEIF(IGENDA(2,JG).NE.5.AND.IGENDA(2,JG).NE.35)THEN        LDGEDA   1006
              IF(KLFO.EQ.0)THEN                                         LDGEDA   1007
                WRITE(MSG(1),6700)NLF,NGRI                              LDGEDA   1008
                WRITE(MSG(2),6800)LPGLFN,LPGID                          LDGEDA   1009
              ELSE                                                      LDGEDA   1010
                WRITE(MSG(1),6750)BUSNAM,NGRI                           LDGEDA   1011
                WRITE(MSG(2),6850)BSNAME,LPGID                          LDGEDA   1012
              ENDIF                                                     LDGEDA   1013
            ELSE                                                        LDGEDA   1014
              NGEBUS(JG)=-LPGLFN                                        LDGEDA   1015
              GOTO 100                                                  LDGEDA   1016
            ENDIF                                                       LDGEDA   1017
            CALL PRTMSG(2)                                              LDGEDA   1018
            CALL ASTOP ('LDGEDA: FATAL ERROR',19)                       LDGEDA   1019
          ENDIF                                                         LDGEDA   1020
          JG=NEXGEN(JG)                                                 LDGEDA   1021
          GOTO 3420                                                     LDGEDA   1022
        ENDIF                                                           LDGEDA   1023
        IF(KLFO.EQ.0)THEN                                               LDGEDA   1024
          WRITE(MSG(1),6900)NLF,NGRI                                    LDGEDA   1025
          WRITE(MSG(2),7000)LPGLFN,LPGID                                LDGEDA   1026
        ELSE                                                            LDGEDA   1027
          WRITE(MSG(1),6950)BUSNAM,NGRI                                 LDGEDA   1028
          WRITE(MSG(2),7050)BSNAME,LPGID                                LDGEDA   1029
        ENDIF                                                           LDGEDA   1030
        CALL PRTMSG(2)                                                  LDGEDA   1031
        CALL ASTOP ('LDGEDA: FATAL ERROR',19)                           LDGEDA   1032
      ENDIF                                                             LDGEDA   1033
C                                                                       LDGEDA   1034
 3450 CONTINUE                                                          LDGEDA   1035
C                                                                       LDGEDA   1036
      DO 4000 II=2,LJNT,1                                               LDGEDA   1037
        JG=NTHGEN(II)                                                   LDGEDA   1038
 3500   IF(JG.NE.0)THEN                                                 LDGEDA   1039
          IF((IGENDA(2,JG).EQ.5.OR.IGENDA(2,JG).EQ.35)                  LDGEDA   1040
     1                                .AND.IDSTAT(JG).EQ.1)THEN         LDGEDA   1041
            LPGLFN=NGEBUS(JG)                                           LDGEDA   1042
            IF(LPGLFN.LT.0)THEN                                         LDGEDA   1043
              NGEBUS(JG)=-LPGLFN                                        LDGEDA   1044
            ELSE                                                        LDGEDA   1045
              IEBK=1                                                    LDGEDA   1046
              IF(KLFO.EQ.0)THEN                                         LDGEDA   1047
                WRITE(MSG(1),6300)LPGLFN,GENID(JG)                      LDGEDA   1048
              ELSE                                                      LDGEDA   1049
                CALL CHKNAM(BSNAME,LPGLFN)                              LDGEDA   1050
                WRITE(MSG(1),6350)BSNAME,GENID(JG)                      LDGEDA   1051
              ENDIF                                                     LDGEDA   1052
              WRITE(MSG(2),6400)                                        LDGEDA   1053
              CALL PRTMSG(2)                                            LDGEDA   1054
            ENDIF                                                       LDGEDA   1055
          ENDIF                                                         LDGEDA   1056
          JG=NEXGEN(JG)                                                 LDGEDA   1057
          GOTO 3500                                                     LDGEDA   1058
        ENDIF                                                           LDGEDA   1059
 4000 CONTINUE                                                          LDGEDA   1060
C                                                                       LDGEDA   1061
      IF (IEBK.NE.0) THEN                                               LDGEDA   1062
         WRITE(MSG(1),*)                                                LDGEDA   1063
     1   ' DETAILED GENERATOR DATA ERROR. PLEASE CHECK THE MESSAGES'    LDGEDA   1064
         WRITE(MSG(2),*)                                                LDGEDA   1065
     1   ' PRINTED AND FIX FAULTY DATA.'                                LDGEDA   1066
         CALL PRTMSG(2)                                                 LDGEDA   1067
         CALL ASTOP('LDGEDA: FATAL ERROR',19)                           LDGEDA   1068
      ENDIF                                                             LDGEDA   1069
      RETURN                                                            LDGEDA   1070
                                                                        LDGEDA   1071
 4500 CONTINUE                                                          LDGEDA   1072
      WRITE(MSG(1),5700) MXP                                            LDGEDA   1073
      IF(KLFO.EQ.0)THEN                                                 LDGEDA   1074
        WRITE(MSG(2),5800) NLF,NGRI                                     LDGEDA   1075
      ELSE                                                              LDGEDA   1076
        WRITE(MSG(2),5900) BUSNAM,NGRI                                  LDGEDA   1077
      ENDIF                                                             LDGEDA   1078
      CALL PRTMSG(2)                                                    LDGEDA   1079
      MSG(1)='LDGEDA: TOO MANY GENERATORS'                              LDGEDA   1080
      CALL ASTOP(MSG(1),27)                                             LDGEDA   1081
C                                                                       LDGEDA   1082
 4550 CONTINUE                                                          LDGEDA   1083
      MSG(1)='LDGEDA: USER DEFINED GENERATOR CONTROL DATA ERROR'        LDGEDA   1084
      CALL ASTOP(MSG(1),49)                                             LDGEDA   1085
C                                                                       LDGEDA   1086
 5000 FORMAT(' *** ERROR IN SATURATION DATA GEN=',I5,' ID:',A4          LDGEDA   1087
     +,' ISATX=',I5)                                                    LDGEDA   1088
 5100 FORMAT(' *** ERROR IN SATURATION DATA GEN=',A12,' ID:',A4         LDGEDA   1089
     +,' ISATX=',I5)                                                    LDGEDA   1090
 5200 FORMAT(' *** ERROR IN PRIME MOVER DATA FOR GENERATOR AT BUS:'     LDGEDA   1091
     *,A12,' GID:',A4)                                                  LDGEDA   1092
 5300 FORMAT(' *** ERROR IN PRIME MOVER DATA FOR GENERATOR AT BUS:'     LDGEDA   1093
     *,I5,' GID:',A4)                                                   LDGEDA   1094
 5400 FORMAT(5X,'TYPE ',I2,' GOVERNOR NOT RECOGNIZED')                  LDGEDA   1095
 5500 FORMAT(5X,'TYPE ',I2,' GOVERNOR LP TURBINE REPRESENTATION WITH')  LDGEDA   1096
 5600 FORMAT(5X,'NO HP TURBINE REPRESENTED IS NOT ALLOWED')             LDGEDA   1097
 5700 FORMAT (' *** ERROR - NUMBER OF GENERATORS EXCEEDS ',I5)          LDGEDA   1098
 5800 FORMAT ('     AT GENERATOR ON BUS ',I6, 'GID: ',A4)               LDGEDA   1099
 5900 FORMAT ('     AT GENERATOR ON BUS ',A12, 'GID: ',A4)              LDGEDA   1100
 6000 FORMAT (1X,'IN LDGEDA',1X,'IEXX',I5,'JLN',I5,'JEX(NT)',I5,'NT',I5)LDGEDA   1101
 6100 FORMAT(1X,'DB-LDGEDA_NEW:JLN,DDAT+5,WOBASE ',I5,2G12.5)           LDGEDA   1102
 6200 FORMAT (8F10.5)                                                   LDGEDA   1103
C                                                                       LDGEDA   1104
 6300 FORMAT (' *** ERROR - LP UNIT AT BUS ',I5,' GID: ',A4)            LDGEDA   1105
 6350 FORMAT (' *** ERROR - LP UNIT AT BUS ',A12,' GID: ',A4)           LDGEDA   1106
 6400 FORMAT ('     DOES NOT HAVE MATCHING HP UNIT')                    LDGEDA   1107
 6500 FORMAT (' *** ERROR - FOR HP UNIT AT BUS ',I5,' GID: ',A4)        LDGEDA   1108
 6600 FORMAT ('     THE LP UNIT AT BUS ',I5,' GID: ',A4,                LDGEDA   1109
     +        ' IS NOT IN SERVICE')                                     LDGEDA   1110
 6550 FORMAT (' *** ERROR - FOR HP UNIT AT BUS ',A12,' GID: ',A4)       LDGEDA   1111
 6650 FORMAT ('     THE LP UNIT AT BUS ',A12,' GID: ',A4,               LDGEDA   1112
     +        ' IS NOT IN SERVICE')                                     LDGEDA   1113
 6700 FORMAT (' *** ERROR - FOR HP UNIT AT BUS ',I5,' GID: ',A4)        LDGEDA   1114
 6800 FORMAT ('     THE GOVERNOR TYPE OF THE LP UNIT AT BUS ',I5,       LDGEDA   1115
     +        ' GID: ',A4,' IS NOT 5')                                  LDGEDA   1116
 6750 FORMAT (' *** ERROR - FOR HP UNIT AT BUS ',A12,' GID: ',A4)       LDGEDA   1117
 6850 FORMAT ('     THE GOVERNOR TYPE OF THE LP UNIT AT BUS ',A12,      LDGEDA   1118
     +        ' GID: ',A4,' IS NOT 5')                                  LDGEDA   1119
 6900 FORMAT (' *** ERROR - FOR HP UNIT AT BUS ',I5,' GID: ',A4)        LDGEDA   1120
 7000 FORMAT ('     THE SPECIFIED LP UNIT AT BUS ',I5,' GID: ',A4,      LDGEDA   1121
     +        ' DOES NOT EXIST')                                        LDGEDA   1122
 6950 FORMAT (' *** ERROR - FOR HP UNIT AT BUS ',A12,' GID: ',A4)       LDGEDA   1123
 7050 FORMAT ('     THE SPECIFIED LP UNIT AT BUS ',A12,' GID: ',A4,     LDGEDA   1124
     +        ' DOES NOT EXIST')                                        LDGEDA   1125
C                                                                       LDGEDA   1126
      END                                                               LDGEDA   1127
