CFPRIME LNLBDA                                                          LNLBDA      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 LNLBDA(IUY,IEBK)                                       LNLBDA      3
CD                                                                      LNLBDA      4
CD    TO LOAD THE NONLINEAR LOAD DATA FROM TDDAT INTO THE FINAL ARRAY   LNLBDA      5
CD    DDAT.                                                             LNLBDA      6
CD                                                                      LNLBDA      7
CD   11.0 Static load                                                   LNLBDA      8
CD                                                                      LNLBDA      9
CD     NLOD           : load number                                     LNLBDA     10
CD     NLDB(NLOD)     : load bus number                                 LNLBDA     11
CD     NLCOMP(1,NLOD) : number of load components                       LNLBDA     12
CD                                                                      LNLBDA     13
CD     JBLD(NLFP)     = pointer to the load data array using program busLNLBDA     14
CD                      number                                          LNLBDA     15
CD                                                                      LNLBDA     16
CD     KK = 12*JBLD(NLFP)                                               LNLBDA     17
CD                                                                      LNLBDA     18
CD     NBLD(KK-11)    = area and zone                                   LNLBDA     19
CD     NBLD(KK-10)    = load flow bus number                            LNLBDA     20
CD     NBLD(KK- 9)    = original P on the bus                           LNLBDA     21
CD     NBLD(KK- 8)    = original Q on the bus                           LNLBDA     22
CD     NBLD(KK- 7)    = voltage magnitude                               LNLBDA     23
CD     NBLD(KK- 6)    = %P and %Q for the constant impedance load       LNLBDA     24
CD     NBLD(KK- 5)    = total P shed on the bus                         LNLBDA     25
CD     NBLD(KK- 4)    = total Q shed on the bus                         LNLBDA     26
CD     NBLD(KK- 3)    = total P shed for the constant-Z on the bus      LNLBDA     27
CD     NBLD(KK- 2)    = total Q shed for the constant-Z on the bus      LNLBDA     28
CD     NBLD(KK- 1)    = GKK, the real part of the shunt reactor         LNLBDA     29
CD     NBLD(KK)       = BKK, the imaginary part of the shunt reactor    LNLBDA     30
CD                                                                      LNLBDA     31
CD     Nonlinear load table                                             LNLBDA     32
CD                                                                      LNLBDA     33
CD     ISHIFT         : cummulative load component number               LNLBDA     34
CD     JNDLL(ISHIFT)  = KK  the starting address of the nonlinear load  LNLBDA     35
CD                          data in the DDAT array                      LNLBDA     36
CD                                                                      LNLBDA     37
CD     Constant current load                                            LNLBDA     38
CD                                                                      LNLBDA     39
CD     NLTYPE(ISHIFT) = 1                                               LNLBDA     40
CD                                                                      LNLBDA     41
CD     IDDAT(KK+1)    = area and zone                                   LNLBDA     42
CD     DDAT(KK+2)     = ICCP                                            LNLBDA     43
CD     DDAT(KK+3)     = ICCQ                                            LNLBDA     44
CD     DDAT(KK+4)     = GKK due to the constant current load            LNLBDA     45
CD     DDAT(KK+5)     = BKK due to the constant current load            LNLBDA     46
CD     DDAT(KK+6)     = P shedded                                       LNLBDA     47
CD     DDAT(KK+7)     = Q shedded                                       LNLBDA     48
CD                                                                      LNLBDA     49
CD     KK = KK + 8                                                      LNLBDA     50
CD                                                                      LNLBDA     51
CD     Constant MVA load                                                LNLBDA     52
CD                                                                      LNLBDA     53
CD     NLTYPE(ISHIFT) = 2                                               LNLBDA     54
CD                                                                      LNLBDA     55
CD     IDDAT(KK+1)    = area and zone                                   LNLBDA     56
CD     DDAT(KK+2)     = ICPP (updated after each load shedding/         LNLBDA     57
CD                      restoration activity                            LNLBDA     58
CD     DDAT(KK+3)     = ICPQ (updated after each load shedding/         LNLBDA     59
CD                      restoration activity                            LNLBDA     60
CD     DDAT(KK+4)     = voltage magnitude                               LNLBDA     61
CD     DDAT(KK+5)     = P shedded                                       LNLBDA     62
CD     DDAT(KK+6)     = Q shedded                                       LNLBDA     63
CD                                                                      LNLBDA     64
CD     KK = KK + 7                                                      LNLBDA     65
CD                                                                      LNLBDA     66
CD     Voltage exponential load                                         LNLBDA     67
CD                                                                      LNLBDA     68
CD     NLTYPE(ISHIFT) = 3                                               LNLBDA     69
CD                                                                      LNLBDA     70
CD     IDDAT(KK+1)    = number of terms in P and Q                      LNLBDA     71
CD     IDDAT(KK+2)    = area and zone                                   LNLBDA     72
CD     DDAT(KK+ 3)    = bus voltage magnitude                           LNLBDA     73
CD     DDAT(KK+ 4)    = real part of the current                        LNLBDA     74
CD     DDAT(KK+ 5)    = imaginary part of the current                   LNLBDA     75
CD     DDAT(KK+ 6)    = bus voltage phase angle                         LNLBDA     76
CD     DDAT(KK+ 7)    = new frequency deviation                         LNLBDA     77
CD     DDAT(KK+ 8)    = old frequency deviation                         LNLBDA     78
CD     DDAT(KK+ 9)    = P shedded                                       LNLBDA     79
CD     DDAT(KK+10)    = Q shedded                                       LNLBDA     80
CD                                                                      LNLBDA     81
CD     KK = KK + 10                                                     LNLBDA     82
CD                                                                      LNLBDA     83
CD     For each component                                               LNLBDA     84
CD                                                                      LNLBDA     85
CD     First P term                                                     LNLBDA     86
CD                                                                      LNLBDA     87
CD     DDAT(KK+1)     = KP1                                             LNLBDA     88
CD     DDAT(KK+2)     = A1                                              LNLBDA     89
CD     DDAT(KK+3)     = KPF1                                            LNLBDA     90
CD     DDAT(KK+4)     = GP1(CKMW), GKK                                  LNLBDA     91
CD                                                                      LNLBDA     92
CD     KK = KK + 4                                                      LNLBDA     93
CD                                                                      LNLBDA     94
CD     Second P term                                                    LNLBDA     95
CD                                                                      LNLBDA     96
CD     DDAT(KK+1)     = KP2                                             LNLBDA     97
CD     DDAT(KK+2)     = A2                                              LNLBDA     98
CD     DDAT(KK+3)     = KPF2                                            LNLBDA     99
CD     DDAT(KK+4)     = GP2                                             LNLBDA    100
CD                                                                      LNLBDA    101
CD     KK = KK + 4                                                      LNLBDA    102
CD                                                                      LNLBDA    103
CD     First Q term                                                     LNLBDA    104
CD                                                                      LNLBDA    105
CD     DDAT(KK+1)     = KQ1                                             LNLBDA    106
CD     DDAT(KK+2)     = B1                                              LNLBDA    107
CD     DDAT(KK+3)     = KQF1                                            LNLBDA    108
CD     DDAT(KK+4)     = GQ1(CKMX), BKK                                  LNLBDA    109
CD                                                                      LNLBDA    110
CD     KK = KK + 4                                                      LNLBDA    111
CD                                                                      LNLBDA    112
CD     Second Q term                                                    LNLBDA    113
CD                                                                      LNLBDA    114
CD     DDAT(KK+1)     = KQ2                                             LNLBDA    115
CD     DDAT(KK+2)     = B2                                              LNLBDA    116
CD     DDAT(KK+3)     = KQF2                                            LNLBDA    117
CD     DDAT(KK+4)     = GQ2                                             LNLBDA    118
CD                                                                      LNLBDA    119
CD     KK = KK + 4                                                      LNLBDA    120
CD                                                                      LNLBDA    121
CD     A-LOAD                                                           LNLBDA    122
CD                                                                      LNLBDA    123
CD     DDAT(KK+1)     = RTB                                             LNLBDA    124
CD     DDAT(KK+2)     = XTB                                             LNLBDA    125
CD     DDAT(KK+3)     = %P and %Q                                       LNLBDA    126
CD     DDAT(KK+4)     = GKK due to the A-LOAD                           LNLBDA    127
CD     DDAT(KK+5)     = BKK due to the A-LOAD                           LNLBDA    128
CD     DDAT(KK+6)     = square of the voltage magnitude                 LNLBDA    129
CD     DDAT(KK+7)     = real part of the ratio                          LNLBDA    130
CD     DDAT(KK+8)     = imaginary part of the ratio                     LNLBDA    131
CD     DDAT(KK+9)     = P shedded                                       LNLBDA    132
CD     DDAT(KK+10)    = Q shedded                                       LNLBDA    133
CD                                                                      LNLBDA    134
CD     KK = KK + 10                                                     LNLBDA    135
CD                                                                      LNLBDA    136
CD     For each component in A-LOAD                                     LNLBDA    137
CD                                                                      LNLBDA    138
CD     Large and small motors -- see motor DDAT table                   LNLBDA    139
CD                                                                      LNLBDA    140
CD     Discharger lighting:                                             LNLBDA    141
CD                                                                      LNLBDA    142
CD     DDAT(KK+1)     = ICLDLP, % P                                     LNLBDA    143
CD     DDAT(KK+2)     = PCVDL1, slop when voltage is 0.65-0.75          LNLBDA    144
CD     DDAT(KK+3)     = PCVDL2, slop when voltage is high than 0.75     LNLBDA    145
CD     DDAT(KK+4)     = QKVDL, voltage exponent of MVA when voltage is  LNLBDA    146
CD                      high than 0.75                                  LNLBDA    147
CD     DDAT(KK+5)     = P shedded                                       LNLBDA    148
CD                                                                      LNLBDA    149
CD     KK = KK + 5                                                      LNLBDA    150
CD                                                                      LNLBDA    151
CD     Transformer saturation:                                          LNLBDA    152
CD                                                                      LNLBDA    153
CD     DDAT(KK+1)     = ICLTSQ, %Q                                      LNLBDA    154
CD     DDAT(KK+2)     = TSV1, knee point voltage                        LNLBDA    155
CD     DDAT(KK+3)     = TSG1, slop when voltage is lower than TSV1      LNLBDA    156
CD     DDAT(KK+4)     = TSG2, slop when voltage is lower than TSV1      LNLBDA    157
CD     DDAT(KK+5)     = Q shedded                                       LNLBDA    158
CD                                                                      LNLBDA    159
CD     KK = KK + 5                                                      LNLBDA    160
CD                                                                      LNLBDA    161
CD     Constant MVA load:                                               LNLBDA    162
CD                                                                      LNLBDA    163
CD     DDAT(KK+1)     = ICLCPP, %P                                      LNLBDA    164
CD     DDAT(KK+2)     = ICLCPQ, %Q                                      LNLBDA    165
CD     DDAT(KK+3)     = P shedded                                       LNLBDA    166
CD     DDAT(KK+4)     = Q shedded                                       LNLBDA    167
CD                                                                      LNLBDA    168
CD     KK = KK + 4                                                      LNLBDA    169
CD                                                                      LNLBDA    170
CD     Remaining load:                                                  LNLBDA    171
CD                                                                      LNLBDA    172
CD     DDAT(KK+1)     = ICLRMP, %P                                      LNLBDA    173
CD     DDAT(KK+2)     = ICLRMQ, %Q                                      LNLBDA    174
CD     DDAT(KK+3)     = PKVRL, voltage exponent of the real power       LNLBDA    175
CD     DDAT(KK+4)     = P shedded                                       LNLBDA    176
CD     DDAT(KK+5)     = Q shedded                                       LNLBDA    177
CD                                                                      LNLBDA    178
CD     KK = KK + 5                                                      LNLBDA    179
CD                                                                      LNLBDA    180
CD     PLEASE NOTE THAT ALL OF THE ABOVE VARIABLES/ARRAYS MAY NOT       LNLBDA    181
CD     BE SET IN THIS SUBROUTINE                                        LNLBDA    182
CD                                                                      LNLBDA    183
      INCLUDE 'PARX.INS'                                                LNLBDA    184
      INCLUDE 'CNREC1.INS'                                              LNLBDA    185
      INCLUDE 'CNB19.INS'                                               LNLBDA    186
      INCLUDE 'CNPT.INS'                                                LNLBDA    187
      INCLUDE 'CNB1.INS'                                                LNLBDA    188
      INCLUDE 'CNLFDA.INS'                                              LNLBDA    189
      INCLUDE 'CNMNEW.INS'                                              LNLBDA    190
      INCLUDE 'CNPARX.INS'                                              LNLBDA    191
      INCLUDE 'CNEXC.INS'                                               LNLBDA    192
      INCLUDE 'CNMDAT.INS'                                              LNLBDA    193
      INCLUDE 'CNMPAR.INS'                                              LNLBDA    194
      INCLUDE 'CNB6.INS'                                                LNLBDA    195
      INCLUDE 'CNFLAG.INS'                                              LNLBDA    196
      INCLUDE 'CNIPTR.INS'                                              LNLBDA    197
      INCLUDE 'CNREN.INS'                                               LNLBDA    198
C      INCLUDE 'NLTERM.INS/LIST'                                        LNLBDA    199
      INCLUDE 'CNJPT.INS'                                               LNLBDA    200
      INCLUDE 'CNJDAT.INS'                                              LNLBDA    201
      INCLUDE 'CNTMDA.INS'                                              LNLBDA    202
      INCLUDE 'CNTGED.INS'                                              LNLBDA    203
      INCLUDE 'CNUNIT.INS'                                              LNLBDA    204
      INCLUDE 'CNMSG.INS'                                               LNLBDA    205
      INCLUDE 'CNLSMB.INS'                                              LNLBDA    206
      INCLUDE 'CNLCOM.INS'                                              LNLBDA    207
      INCLUDE 'EPBUS.INS'                                               LNLBDA    208
C                                                                       LNLBDA    209
      CHARACTER*80 SIMBUF                                               LNLBDA    210
      CHARACTER*12 AFBUS,ATBUS,AFAREA,ATAREA,AFZONE,ATZONE              LNLBDA    211
      INTEGER JFBUS(3),JTBUS(3),JFAREA(3),JTAREA(3),JFZONE(3),JTZONE(3) LNLBDA    212
      INTEGER IAFLAG(JAR),IZFLAG(JZN)                                   LNLBDA    213
      EQUIVALENCE (JFBUS(1),AFBUS),(JTBUS(1),ATBUS)                     LNLBDA    214
      EQUIVALENCE (JFAREA(1),AFAREA),(JTAREA(1),ATAREA)                 LNLBDA    215
      EQUIVALENCE (JFZONE(1),AFZONE),(JTZONE(1),ATZONE)                 LNLBDA    216
C                                                                       LNLBDA    217
      INCLUDE 'CDLCOM.INS'                                              LNLBDA    218
C                                                                       LNLBDA    219
      LDEB=(JDEB(9).NE.0)                                               LNLBDA    220
C                                                                       LNLBDA    221
C   LOADING NONLINEAR LOAD DATA                                         LNLBDA    222
C                                                                       LNLBDA    223
C      NLOD :  NO. OF BUSES CONTAIN NONLINEAR LOAD                      LNLBDA    224
C      NKCUR:  NO. OF CONSTANT CURRENT LOAD                             LNLBDA    225
C      NKMVA:  NO. OF CONSTANT MVA LOAD                                 LNLBDA    226
C      NLBS :  NO. OF VOLTAGE EXPONENTIAL                               LNLBDA    227
C      NCLD :  NO. OF COMPOSITE LOADS                                   LNLBDA    228
C                                                                       LNLBDA    229
C--  FIRST CARD (OF TOTAL THREE CARDS) READ                             LNLBDA    230
C                                                                       LNLBDA    231
      NSHIFT=0                                                          LNLBDA    232
C                                                                       LNLBDA    233
      CALL LMOVE(0,JREBUS,NLFBUS)                                       LNLBDA    234
C                                                                       LNLBDA    235
      J=0                                                               LNLBDA    236
 110  J=J+1                                                             LNLBDA    237
      NTYPE=0                                                           LNLBDA    238
      LTN=JJNLD(J)                                                      LNLBDA    239
C                                                                       LNLBDA    240
C--  CHECK WHETHER THE NLL DATA IS ASIGNED BY GROUP                     LNLBDA    241
C                                                                       LNLBDA    242
      LL=ITDDAT(LTN+1)                                                  LNLBDA    243
C                                                                       LNLBDA    244
C         BUS# BUSN RANGE# RANGE NAME                                   LNLBDA    245
      GOTO(120, 130,   210,       220),LL                               LNLBDA    246
C                                                                       LNLBDA    247
 120  CONTINUE                                                          LNLBDA    248
      NLF=ITDDAT(LTN+2)                                                 LNLBDA    249
      N=MNEW(NLF)                                                       LNLBDA    250
      IF(N.NE.0) THEN                                                   LNLBDA    251
       IF(JBSTAT(N).GT.2)GOTO 500                                       LNLBDA    252
       KK=(N-1)*4                                                       LNLBDA    253
       IF(BMW(KK+1).EQ.0.0.AND.BMX(KK+2).EQ.0.0) GOTO 500               LNLBDA    254
      ELSE                                                              LNLBDA    255
       IEBK=1                                                           LNLBDA    256
       WRITE(MSG(1),1130) NLF                                           LNLBDA    257
       MSG(2)='LNLBDA : NONLINEAR LOAD BUS DOES NOT EXIST'              LNLBDA    258
       CALL PRTMSG(2)                                                   LNLBDA    259
       GOTO 500                                                         LNLBDA    260
      ENDIF                                                             LNLBDA    261
      ICONCP=ITDDAT(LTN+3)                                              LNLBDA    262
      ICONCQ=ITDDAT(LTN+4)                                              LNLBDA    263
      ICONPP=ITDDAT(LTN+5)                                              LNLBDA    264
      ICONPQ=ITDDAT(LTN+6)                                              LNLBDA    265
      IPF1=ITDDAT(LTN+7)                                                LNLBDA    266
      IQF1=ITDDAT(LTN+8)                                                LNLBDA    267
      IPF2=ITDDAT(LTN+9)                                                LNLBDA    268
      IQF2=ITDDAT(LTN+10)                                               LNLBDA    269
      ICLDP=ITDDAT(LTN+11)                                              LNLBDA    270
      ICLDQ=ITDDAT(LTN+12)                                              LNLBDA    271
      ITSCP=ITDDAT(LTN+13)                                              LNLBDA    272
      LTN=LTN+13                                                        LNLBDA    273
      GOTO 140                                                          LNLBDA    274
C                                                                       LNLBDA    275
 130  CONTINUE                                                          LNLBDA    276
C                                                                       LNLBDA    277
      JFBUS(1)=ITDDAT(LTN+2)                                            LNLBDA    278
      JFBUS(2)=ITDDAT(LTN+3)                                            LNLBDA    279
      JFBUS(3)=ITDDAT(LTN+4)                                            LNLBDA    280
      ICONCP=ITDDAT(LTN+5)                                              LNLBDA    281
      ICONCQ=ITDDAT(LTN+6)                                              LNLBDA    282
      ICONPP=ITDDAT(LTN+7)                                              LNLBDA    283
      ICONPQ=ITDDAT(LTN+8)                                              LNLBDA    284
      IPF1=ITDDAT(LTN+9)                                                LNLBDA    285
      IQF1=ITDDAT(LTN+10)                                               LNLBDA    286
      IPF2=ITDDAT(LTN+11)                                               LNLBDA    287
      IQF2=ITDDAT(LTN+12)                                               LNLBDA    288
      ICLDP=ITDDAT(LTN+13)                                              LNLBDA    289
      ICLDQ=ITDDAT(LTN+14)                                              LNLBDA    290
      ITSCP=ITDDAT(LTN+15)                                              LNLBDA    291
      LTN=LTN+15                                                        LNLBDA    292
C                                                                       LNLBDA    293
      CALL CHKBUS(AFBUS,NLF)                                            LNLBDA    294
      IF(NLF.LE.0)THEN                                                  LNLBDA    295
       IEBK=1                                                           LNLBDA    296
       WRITE(MSG(1),1140) AFBUS                                         LNLBDA    297
       MSG(2)='LNLBDA : NONLINEAR LOAD BUS DOES NOT EXIST'              LNLBDA    298
       CALL PRTMSG(2)                                                   LNLBDA    299
       GOTO 500                                                         LNLBDA    300
      ENDIF                                                             LNLBDA    301
C                                                                       LNLBDA    302
C   CHECK IF THE SPECIFIED LOAD BUS EXIST                               LNLBDA    303
C                                                                       LNLBDA    304
      N=MNEW(NLF)                                                       LNLBDA    305
      IF(N.NE.0)THEN                                                    LNLBDA    306
        IF(JBSTAT(N).GT.2)GOTO 500                                      LNLBDA    307
        KK=(N-1)*4                                                      LNLBDA    308
        IF(BMW(KK+1).EQ.0.0.AND.BMX(KK+2).EQ.0.0) GOTO 500              LNLBDA    309
      ENDIF                                                             LNLBDA    310
C                                                                       LNLBDA    311
 140  CONTINUE                                                          LNLBDA    312
C                                                                       LNLBDA    313
C--  ADVANCE THE  LOAD COUNTER                                          LNLBDA    314
C                                                                       LNLBDA    315
      ICHECK=IABS(IPF1)+IABS(IPF2)+IABS(ICONCP)+IABS(ICONPP)+IABS(ICLDP)LNLBDA    316
     & +IABS(IQF1)+IABS(IQF2)+IABS(ICONCQ)+IABS(ICONPQ)                 LNLBDA    317
     & +IABS(ICLDQ)                                                     LNLBDA    318
C                                                                       LNLBDA    319
      IF(ICHECK.NE.0)THEN                                               LNLBDA    320
C                                                                       LNLBDA    321
       NLOD=NLOD+1                                                      LNLBDA    322
       IF(NLOD.GT.NZL) GOTO 390                                         LNLBDA    323
       NLDB(NLOD)=NLF                                                   LNLBDA    324
       JREBUS(N)=.TRUE.                                                 LNLBDA    325
      ENDIF                                                             LNLBDA    326
C                                                                       LNLBDA    327
C            VA1  VA2   CONP  CMVA   CAGL  TSCL                         LNLBDA    328
      ITOTP=IPF1+IPF2+ICONCP+ICONPP+ICLDP+ITSCP                         LNLBDA    329
      ITOTQ=IQF1+IQF2+ICONCQ+ICONPQ+ICLDQ                               LNLBDA    330
C                                                                       LNLBDA    331
      IF(ITOTP.GT.100 .OR. ITOTQ.GT.100)THEN                            LNLBDA    332
C        IEBK=1                                                         LNLBDA    333
        IF(KLFO.EQ.0)THEN                                               LNLBDA    334
         WRITE(MSG(2),1071) NLF                                         LNLBDA    335
        ELSE                                                            LNLBDA    336
         WRITE(MSG(2),1080) AFBUS                                       LNLBDA    337
        ENDIF                                                           LNLBDA    338
        WRITE(MSG(1),1070)                                              LNLBDA    339
        CALL PRTMSG(2)                                                  LNLBDA    340
      ENDIF                                                             LNLBDA    341
C                                                                       LNLBDA    342
C    FOR CONSTANT CURRENT AND CONSTANT MVA LOAD PRESENTATION            LNLBDA    343
C                                                                       LNLBDA    344
      IF(ICONCP.NE.0.OR.ICONCQ.NE.0) THEN                               LNLBDA    345
       NKCUR=NKCUR+1                                                    LNLBDA    346
       NTYPE=NTYPE+1                                                    LNLBDA    347
       NSHIFT=NSHIFT+1                                                  LNLBDA    348
       NLTYPE(NSHIFT)=1                                                 LNLBDA    349
       JDNLL(NSHIFT)=JLN                                                LNLBDA    350
       IDDAT(JLN+1)=IBAR(KK+3)                                          LNLBDA    351
       DDAT(JLN+2)=ICONCP                                               LNLBDA    352
       DDAT(JLN+3)=ICONCQ                                               LNLBDA    353
       DDAT(JLN+4)=0                                                    LNLBDA    354
       DDAT(JLN+5)=0                                                    LNLBDA    355
       DDAT(JLN+6)=0                                                    LNLBDA    356
       DDAT(JLN+7)=0                                                    LNLBDA    357
       JLN=JLN+8                                                        LNLBDA    358
      ENDIF                                                             LNLBDA    359
C                                                                       LNLBDA    360
      IF(ICONPP.NE.0.OR.ICONPQ.NE.0) THEN                               LNLBDA    361
       NKMVA=NKMVA+1                                                    LNLBDA    362
       NTYPE=NTYPE+1                                                    LNLBDA    363
       NSHIFT=NSHIFT+1                                                  LNLBDA    364
       NLTYPE(NSHIFT)=2                                                 LNLBDA    365
       JDNLL(NSHIFT)=JLN                                                LNLBDA    366
       IDDAT(JLN+1)=IBAR(KK+3)                                          LNLBDA    367
       DDAT(JLN+2)=ICONPP                                               LNLBDA    368
       DDAT(JLN+3)=ICONPQ                                               LNLBDA    369
       DDAT(JLN+4)=0                                                    LNLBDA    370
       DDAT(JLN+5)=0                                                    LNLBDA    371
       DDAT(JLN+6)=0                                                    LNLBDA    372
       JLN=JLN+7                                                        LNLBDA    373
      ENDIF                                                             LNLBDA    374
C                                                                       LNLBDA    375
      IF(IPF1.NE.0.OR.IQF1.NE.0.OR.IPF2.NE.0.OR.IQF2.NE.0)THEN          LNLBDA    376
C                                                                       LNLBDA    377
C--  ADVANCE THE NON-LINEAR LOAD COUNTER                                LNLBDA    378
C                                                                       LNLBDA    379
       NLBS=NLBS+1                                                      LNLBDA    380
       NTYPE=NTYPE+1                                                    LNLBDA    381
       NSHIFT=NSHIFT+1                                                  LNLBDA    382
       NLTYPE(NSHIFT)=3                                                 LNLBDA    383
       NLCOMP(1,NLOD)=0                                                 LNLBDA    384
       NLCOMP(2,NLOD)=1                                                 LNLBDA    385
C                                                                       LNLBDA    386
C--  SET THE POINTER POINTING TO ARRAY "DDAT"                           LNLBDA    387
C                                                                       LNLBDA    388
       JDNLL(NSHIFT)=JLN                                                LNLBDA    389
C                                                                       LNLBDA    390
C--  SECOND CARD (OF TOTAL TWO CARDS) READ                              LNLBDA    391
C                                                                       LNLBDA    392
       PKV1=TDDAT(LTN+1)                                                LNLBDA    393
       PKF1=TDDAT(LTN+2)                                                LNLBDA    394
       PKV2=TDDAT(LTN+3)                                                LNLBDA    395
       PKF2=TDDAT(LTN+4)                                                LNLBDA    396
       QKV1=TDDAT(LTN+5)                                                LNLBDA    397
       QKF1=TDDAT(LTN+6)                                                LNLBDA    398
       QKV2=TDDAT(LTN+7)                                                LNLBDA    399
       QKF2=TDDAT(LTN+8)                                                LNLBDA    400
       LTN=LTN+8                                                        LNLBDA    401
C                                                                       LNLBDA    402
       JL=JLN+10                                                        LNLBDA    403
       ITERMP=0                                                         LNLBDA    404
       ITERMQ=0                                                         LNLBDA    405
C                                                                       LNLBDA    406
       CALL STLODA(JL,IPF1,IPF2,IQF1,IQF2,ITERMP,ITERMQ                 LNLBDA    407
     &                    ,PKV1,PKF1,PKV2,PKF2,QKV1,QKF1,QKV2,QKF2)     LNLBDA    408
C                                                                       LNLBDA    409
C--  STORE THE NUMBER OF TERMS IN P AND Q                               LNLBDA    410
C                                                                       LNLBDA    411
       JJ=ITERPQ(ITERMP,ITERMQ)                                         LNLBDA    412
       IDDAT(JLN+1)=JJ                                                  LNLBDA    413
       IDDAT(JLN+2)=IBAR(KK+3)                                          LNLBDA    414
       DDAT(JLN+7)=0.0                                                  LNLBDA    415
       DDAT(JLN+8)=0.0                                                  LNLBDA    416
       JLN=JL                                                           LNLBDA    417
      ENDIF                                                             LNLBDA    418
C                                                                       LNLBDA    419
C    FOR COMPOSITE LOAD PRESENTATION                                    LNLBDA    420
C                                                                       LNLBDA    421
      IF(ICLDP.NE.0.OR.ICLDQ.NE.0) THEN                                 LNLBDA    422
C                                                                       LNLBDA    423
C--  ADVANCE THE COMPOSITE LOAD COUNTER                                 LNLBDA    424
C                                                                       LNLBDA    425
       NCLD=NCLD+1                                                      LNLBDA    426
       NTYPE=NTYPE+1                                                    LNLBDA    427
       NSHIFT=NSHIFT+1                                                  LNLBDA    428
       NLTYPE(NSHIFT)=4                                                 LNLBDA    429
       NLCOMP(1,NLOD)=0                                                 LNLBDA    430
       NLCOMP(2,NLOD)=1                                                 LNLBDA    431
C                                                                       LNLBDA    432
C--  SET THE POINTER POINTING TO ARRAY "DDAT"                           LNLBDA    433
C                                                                       LNLBDA    434
       JDNLL(NSHIFT)=JLN                                                LNLBDA    435
C                                                                       LNLBDA    436
       ICLLMP=ITDDAT(LTN+1)                                             LNLBDA    437
       ICLSMP=ITDDAT(LTN+2)                                             LNLBDA    438
       ICLDLP=ITDDAT(LTN+3)                                             LNLBDA    439
       ICLTSQ=ITDDAT(LTN+4)                                             LNLBDA    440
       ICLCPP=ITDDAT(LTN+5)                                             LNLBDA    441
       ICLCPQ=ITDDAT(LTN+6)                                             LNLBDA    442
C                                                                       LNLBDA    443
       RTB=TDDAT(LTN+7)                                                 LNLBDA    444
       XTB=TDDAT(LTN+8)                                                 LNLBDA    445
       TAPTB=TDDAT(LTN+9)                                               LNLBDA    446
       PKVRL=TDDAT(LTN+10)                                              LNLBDA    447
       LTN=LTN+10                                                       LNLBDA    448
C                                                                       LNLBDA    449
C      SKIP MOTOR DATA. NOTE THAT MOTOR DATA IN CLOAD BY BUS            LNLBDA    450
C      ARE LOADED IN LIMODA                                             LNLBDA    451
C                                                                       LNLBDA    452
       LTNLM=-1                                                         LNLBDA    453
       IF (ICLLMP.NE.0) THEN                                            LNLBDA    454
          LTN=LTN+29                                                    LNLBDA    455
       END IF                                                           LNLBDA    456
C                                                                       LNLBDA    457
       LTNSM=-1                                                         LNLBDA    458
       IF (ICLSMP.NE.0) THEN                                            LNLBDA    459
          LTN=LTN+29                                                    LNLBDA    460
       END IF                                                           LNLBDA    461
C                                                                       LNLBDA    462
       IF (ICLDLP.NE.0) THEN                                            LNLBDA    463
          PCVDL1=TDDAT(LTN+1)                                           LNLBDA    464
          PCVDL2=TDDAT(LTN+2)                                           LNLBDA    465
          QKVDL=TDDAT(LTN+3)                                            LNLBDA    466
          LTN=LTN+3                                                     LNLBDA    467
       END IF                                                           LNLBDA    468
C                                                                       LNLBDA    469
       IF(ICLTSQ.NE.0)THEN                                              LNLBDA    470
        TSV1=TDDAT(LTN+1)                                               LNLBDA    471
        TSG1=TDDAT(LTN+2)                                               LNLBDA    472
        TSG2=TDDAT(LTN+3)                                               LNLBDA    473
        LTN=LTN+3                                                       LNLBDA    474
       ENDIF                                                            LNLBDA    475
C                                                                       LNLBDA    476
       JL=JLN+11                                                        LNLBDA    477
C                                                                       LNLBDA    478
       CALL STLODB(JL,KL,NMOTL,NTYPE                                    LNLBDA    479
     &                  ,ICLDLP,PCVDL1,PCVDL2,QKVDL                     LNLBDA    480
     &                  ,ICLTSQ,TSV1,TSG1,TSG2                          LNLBDA    481
     &                  ,ICLCPP,ICLCPQ,PKVRL,LTNLM,LTNSM)               LNLBDA    482
C                                                                       LNLBDA    483
       DDAT(JLN+1)=RTB                                                  LNLBDA    484
       DDAT(JLN+2)=XTB                                                  LNLBDA    485
       DDAT(JLN+3)=TAPTB                                                LNLBDA    486
       DDAT(JLN+4)=PKVRL                                                LNLBDA    487
       DDAT(JLN+5)=ICLDP                                                LNLBDA    488
       DDAT(JLN+6)=ICLDQ                                                LNLBDA    489
       DDAT(JLN+9)=0.0                                                  LNLBDA    490
       DDAT(JLN+10)=0.0                                                 LNLBDA    491
       JLN=JL                                                           LNLBDA    492
      ENDIF                                                             LNLBDA    493
C                                                                       LNLBDA    494
C     UPDATE THE NLCOMP ARRAY                                           LNLBDA    495
C                                                                       LNLBDA    496
      IF(ICHECK.NE.0) NLCOMP(1,NLOD)=NTYPE                              LNLBDA    497
C                                                                       LNLBDA    498
C     LOAD TSC LOAD                                                     LNLBDA    499
C                                                                       LNLBDA    500
      IF (ITSCP.NE.0) THEN                                              LNLBDA    501
         NTSCL=NTSCL+1                                                  LNLBDA    502
         IF (NTSCL.GT.NXZL) GOTO 600                                    LNLBDA    503
         JTCDAT(NTSCL)=JLN                                              LNLBDA    504
         IDDAT(JLN+1)=ITDDAT(LTN+1)                                     LNLBDA    505
         DDAT(JLN+2)=TDDAT(LTN+2)                                       LNLBDA    506
         DDAT(JLN+3)=TDDAT(LTN+3)                                       LNLBDA    507
         DDAT(JLN+4)=TDDAT(LTN+4)                                       LNLBDA    508
         DDAT(JLN+5)=TDDAT(LTN+5)                                       LNLBDA    509
         DDAT(JLN+6)=TDDAT(LTN+6)                                       LNLBDA    510
         DDAT(JLN+7)=TDDAT(LTN+7)                                       LNLBDA    511
         DDAT(JLN+8)=TDDAT(LTN+8)                                       LNLBDA    512
         IDDAT(JLN+9)=ITSCP                                             LNLBDA    513
         LTN=LTN+8                                                      LNLBDA    514
         JLN=JLN+15                                                     LNLBDA    515
      END IF                                                            LNLBDA    516
C                                                                       LNLBDA    517
      CALL MCHECK(NLF,15,JLN,'LNLBDA')                                  LNLBDA    518
C                                                                       LNLBDA    519
      GOTO 500                                                          LNLBDA    520
C                                                                       LNLBDA    521
C     RANGE  LOAD DATA                                                  LNLBDA    522
C                                                                       LNLBDA    523
  210 CONTINUE                                                          LNLBDA    524
C                                                                       LNLBDA    525
C--  ASSIGN NLL BY THE RANGE OF AREA, ZONE AND BUS NAME OR NUMBER       LNLBDA    526
C                                                                       LNLBDA    527
      IFAREA=ITDDAT(LTN+2)                                              LNLBDA    528
      ITAREA=ITDDAT(LTN+3)                                              LNLBDA    529
      IFZONE=ITDDAT(LTN+4)                                              LNLBDA    530
      ITZONE=ITDDAT(LTN+5)                                              LNLBDA    531
      IFBUS=ITDDAT(LTN+6)                                               LNLBDA    532
      ITBUS=ITDDAT(LTN+7)                                               LNLBDA    533
      LTN=LTN+7                                                         LNLBDA    534
C                                                                       LNLBDA    535
      GOTO 230                                                          LNLBDA    536
C                                                                       LNLBDA    537
  220 CONTINUE                                                          LNLBDA    538
C                                                                       LNLBDA    539
      JFAREA(1)=ITDDAT(LTN+2)                                           LNLBDA    540
      JFAREA(2)=ITDDAT(LTN+3)                                           LNLBDA    541
      JFAREA(3)=ITDDAT(LTN+4)                                           LNLBDA    542
      JTAREA(1)=ITDDAT(LTN+5)                                           LNLBDA    543
      JTAREA(2)=ITDDAT(LTN+6)                                           LNLBDA    544
      JTAREA(3)=ITDDAT(LTN+7)                                           LNLBDA    545
      JFZONE(1)=ITDDAT(LTN+8)                                           LNLBDA    546
      JFZONE(2)=ITDDAT(LTN+9)                                           LNLBDA    547
      JFZONE(3)=ITDDAT(LTN+10)                                          LNLBDA    548
      JTZONE(1)=ITDDAT(LTN+11)                                          LNLBDA    549
      JTZONE(2)=ITDDAT(LTN+12)                                          LNLBDA    550
      JTZONE(3)=ITDDAT(LTN+13)                                          LNLBDA    551
      JFBUS(1)=ITDDAT(LTN+14)                                           LNLBDA    552
      JFBUS(2)=ITDDAT(LTN+15)                                           LNLBDA    553
      JFBUS(3)=ITDDAT(LTN+16)                                           LNLBDA    554
      JTBUS(1)=ITDDAT(LTN+17)                                           LNLBDA    555
      JTBUS(2)=ITDDAT(LTN+18)                                           LNLBDA    556
      JTBUS(3)=ITDDAT(LTN+19)                                           LNLBDA    557
      LTN=LTN+19                                                        LNLBDA    558
C                                                                       LNLBDA    559
      CALL CHAREA(AFAREA,IFAREA)                                        LNLBDA    560
      CALL CHAREA(ATAREA,ITAREA)                                        LNLBDA    561
      CALL CHZONE(AFZONE,IFZONE)                                        LNLBDA    562
      CALL CHZONE(ATZONE,ITZONE)                                        LNLBDA    563
      CALL CHKBUS(AFBUS,IFBUS)                                          LNLBDA    564
      CALL CHKBUS(ATBUS,ITBUS)                                          LNLBDA    565
C                                                                       LNLBDA    566
      IF(IFAREA.NE.0)IFAREA=MNEWA(IFAREA)                               LNLBDA    567
      IF(ITAREA.NE.0)ITAREA=MNEWA(ITAREA)                               LNLBDA    568
C                                                                       LNLBDA    569
      IF(IFZONE.NE.0)IFZONE=MNEWZ(IFZONE+1)                             LNLBDA    570
      IF(ITZONE.NE.0)ITZONE=MNEWZ(ITZONE+1)                             LNLBDA    571
C                                                                       LNLBDA    572
      IF(IFBUS.NE.0)IFBUS=MNEW(IFBUS)                                   LNLBDA    573
      IF(ITBUS.NE.0)ITBUS=MNEW(ITBUS)                                   LNLBDA    574
C                                                                       LNLBDA    575
 230  CONTINUE                                                          LNLBDA    576
C                                                                       LNLBDA    577
      WMIN=ABS(TDDAT(LTN+1))                                            LNLBDA    578
      XMIN=ABS(TDDAT(LTN+2))                                            LNLBDA    579
      LTN=LTN+2                                                         LNLBDA    580
      IF(WMIN.LE.5.0) WMIN=5.0                                          LNLBDA    581
      IF(XMIN.LE.5.0) XMIN=5.0                                          LNLBDA    582
C                                                                       LNLBDA    583
      ICONCP=ITDDAT(LTN+1)                                              LNLBDA    584
      ICONCQ=ITDDAT(LTN+2)                                              LNLBDA    585
      ICONPP=ITDDAT(LTN+3)                                              LNLBDA    586
      ICONPQ=ITDDAT(LTN+4)                                              LNLBDA    587
      IPF1=ITDDAT(LTN+5)                                                LNLBDA    588
      IQF1=ITDDAT(LTN+6)                                                LNLBDA    589
      IPF2=ITDDAT(LTN+7)                                                LNLBDA    590
      IQF2=ITDDAT(LTN+8)                                                LNLBDA    591
      ICLDP=ITDDAT(LTN+9)                                               LNLBDA    592
      ICLDQ=ITDDAT(LTN+10)                                              LNLBDA    593
      ITSCP=ITDDAT(LTN+11)                                              LNLBDA    594
      LTN=LTN+11                                                        LNLBDA    595
C                                                                       LNLBDA    596
      ICHECK=IABS(IPF1)+IABS(IPF2)+IABS(ICONCP)+IABS(ICONPP)+IABS(ICLDP)LNLBDA    597
     & +IABS(IQF1)+IABS(IQF2)+IABS(ICONCQ)+IABS(ICONPQ)                 LNLBDA    598
     & +IABS(ICLDQ)                                                     LNLBDA    599
C                                                                       LNLBDA    600
      IF(IFAREA.LE.0.AND.ITAREA.LE.0)THEN                               LNLBDA    601
        DO 240 IA=1,NMAREA                                              LNLBDA    602
          IAFLAG(IA)=1                                                  LNLBDA    603
 240    CONTINUE                                                        LNLBDA    604
      ELSE                                                              LNLBDA    605
        DO 250 IA=1,NMAREA                                              LNLBDA    606
          IAFLAG(IA)=0                                                  LNLBDA    607
 250    CONTINUE                                                        LNLBDA    608
        IF(IFAREA.EQ.0.AND.ITAREA.NE.0)IFAREA=ITAREA                    LNLBDA    609
        IF(ITAREA.EQ.0.AND.IFAREA.NE.0)ITAREA=IFAREA                    LNLBDA    610
        IF(IFAREA.GT.ITAREA)THEN                                        LNLBDA    611
          ITEMP=IFAREA                                                  LNLBDA    612
          IFAREA=ITAREA                                                 LNLBDA    613
          ITAREA=ITEMP                                                  LNLBDA    614
        ENDIF                                                           LNLBDA    615
        DO 260 IA=1,NMAREA                                              LNLBDA    616
          IF(KLFO.EQ.0)THEN                                             LNLBDA    617
            IF(INTARA(IA).GE.IFAREA.AND.                                LNLBDA    618
     +         INTARA(IA).LE.ITAREA)IAFLAG(IA)=1                        LNLBDA    619
          ELSE                                                          LNLBDA    620
            IF(IA.GE.IFAREA.AND.                                        LNLBDA    621
     +         IA.LE.ITAREA)IAFLAG(IA)=1                                LNLBDA    622
          ENDIF                                                         LNLBDA    623
 260    CONTINUE                                                        LNLBDA    624
      ENDIF                                                             LNLBDA    625
C                                                                       LNLBDA    626
      IF(IFZONE.LE.0.AND.ITZONE.LE.0)THEN                               LNLBDA    627
        DO 270 IZ=1,NUMZON                                              LNLBDA    628
          IZFLAG(IZ)=1                                                  LNLBDA    629
 270    CONTINUE                                                        LNLBDA    630
      ELSE                                                              LNLBDA    631
        DO 280 IZ=1,NUMZON                                              LNLBDA    632
          IZFLAG(IZ)=0                                                  LNLBDA    633
 280    CONTINUE                                                        LNLBDA    634
        IF(IFZONE.EQ.0.AND.ITZONE.NE.0)IFZONE=ITZONE                    LNLBDA    635
        IF(ITZONE.EQ.0.AND.IFZONE.NE.0)ITZONE=IFZONE                    LNLBDA    636
        IF(IFZONE.GT.ITZONE)THEN                                        LNLBDA    637
          ITEMP=IFZONE                                                  LNLBDA    638
          IFZONE=ITZONE                                                 LNLBDA    639
          ITZONE=ITEMP                                                  LNLBDA    640
        ENDIF                                                           LNLBDA    641
        DO 290 IZ=1,NUMZON                                              LNLBDA    642
          IF(KLFO.EQ.0)THEN                                             LNLBDA    643
            IF(INTZON(IZ).GE.IFZONE.AND.                                LNLBDA    644
     +         INTZON(IZ).LE.ITZONE)IZFLAG(IZ)=1                        LNLBDA    645
          ELSE                                                          LNLBDA    646
            IF(IZ.GE.IFZONE.AND.                                        LNLBDA    647
     +         IZ.LE.ITZONE)IZFLAG(IZ)=1                                LNLBDA    648
          ENDIF                                                         LNLBDA    649
 290    CONTINUE                                                        LNLBDA    650
      ENDIF                                                             LNLBDA    651
C                                                                       LNLBDA    652
      IF(IFBUS.LE.0)IFBUS=1                                             LNLBDA    653
      IF(KLFO.EQ.0)THEN                                                 LNLBDA    654
        IF(ITBUS.LE.0.OR.ITBUS.GT.LBUSNO)ITBUS=LBUSNO                   LNLBDA    655
      ELSE                                                              LNLBDA    656
        IF(ITBUS.LE.0)ITBUS=NLFBUS                                      LNLBDA    657
      ENDIF                                                             LNLBDA    658
C                                                                       LNLBDA    659
      IF(IPF1.NE.0.OR.IQF1.NE.0.OR.IPF2.NE.0.OR.IQF2.NE.0)THEN          LNLBDA    660
      PKV1=TDDAT(LTN+1)                                                 LNLBDA    661
      PKF1=TDDAT(LTN+2)                                                 LNLBDA    662
      PKV2=TDDAT(LTN+3)                                                 LNLBDA    663
      PKF2=TDDAT(LTN+4)                                                 LNLBDA    664
      QKV1=TDDAT(LTN+5)                                                 LNLBDA    665
      QKF1=TDDAT(LTN+6)                                                 LNLBDA    666
      QKV2=TDDAT(LTN+7)                                                 LNLBDA    667
      QKF2=TDDAT(LTN+8)                                                 LNLBDA    668
      LTN=LTN+8                                                         LNLBDA    669
      ENDIF                                                             LNLBDA    670
C                                                                       LNLBDA    671
      IF(ICLDP.NE.0.OR.ICLDQ.NE.0)THEN                                  LNLBDA    672
      ICLLMP=ITDDAT(LTN+1)                                              LNLBDA    673
      ICLSMP=ITDDAT(LTN+2)                                              LNLBDA    674
      ICLDLP=ITDDAT(LTN+3)                                              LNLBDA    675
      ICLTSQ=ITDDAT(LTN+4)                                              LNLBDA    676
      ICLCPP=ITDDAT(LTN+5)                                              LNLBDA    677
      ICLCPQ=ITDDAT(LTN+6)                                              LNLBDA    678
C                                                                       LNLBDA    679
      RTB=TDDAT(LTN+7)                                                  LNLBDA    680
      XTB=TDDAT(LTN+8)                                                  LNLBDA    681
      TAPTB=TDDAT(LTN+9)                                                LNLBDA    682
      PKVRL=TDDAT(LTN+10)                                               LNLBDA    683
      LTN=LTN+10                                                        LNLBDA    684
C                                                                       LNLBDA    685
C     RECORD MOTOR OFFSET VALUES AND SKIP MOTOR DATA NOW                LNLBDA    686
C                                                                       LNLBDA    687
      LTNLM=-1                                                          LNLBDA    688
      IF (ICLLMP.NE.0) THEN                                             LNLBDA    689
         LTNLM=LTN                                                      LNLBDA    690
         LTN=LTN+29                                                     LNLBDA    691
      END IF                                                            LNLBDA    692
C                                                                       LNLBDA    693
      LTNSM=-1                                                          LNLBDA    694
      IF (ICLSMP.NE.0) THEN                                             LNLBDA    695
         LTNSM=LTN                                                      LNLBDA    696
         LTN=LTN+29                                                     LNLBDA    697
      END IF                                                            LNLBDA    698
C                                                                       LNLBDA    699
      IF (ICLDLP.NE.0) THEN                                             LNLBDA    700
         PCVDL1=TDDAT(LTN+1)                                            LNLBDA    701
         PCVDL2=TDDAT(LTN+2)                                            LNLBDA    702
         QKVDL=TDDAT(LTN+3)                                             LNLBDA    703
         LTN=LTN+3                                                      LNLBDA    704
      END IF                                                            LNLBDA    705
C                                                                       LNLBDA    706
      IF (ICLTSQ.NE.0) THEN                                             LNLBDA    707
         TSV1=TDDAT(LTN+1)                                              LNLBDA    708
         TSG1=TDDAT(LTN+2)                                              LNLBDA    709
         TSG2=TDDAT(LTN+3)                                              LNLBDA    710
         LTN=LTN+3                                                      LNLBDA    711
      END IF                                                            LNLBDA    712
      END IF                                                            LNLBDA    713
C                                                                       LNLBDA    714
C     TSC LOAD                                                          LNLBDA    715
C                                                                       LNLBDA    716
      IF (ITSCP.NE.0) THEN                                              LNLBDA    717
         CKP=TDDAT(LTN+2)                                               LNLBDA    718
         CKI=TDDAT(LTN+3)                                               LNLBDA    719
         TC=TDDAT(LTN+4)                                                LNLBDA    720
         CK1=TDDAT(LTN+5)                                               LNLBDA    721
         T1=TDDAT(LTN+6)                                                LNLBDA    722
         CKL=TDDAT(LTN+7)                                               LNLBDA    723
         TA=TDDAT(LTN+8)                                                LNLBDA    724
         LTN=LTN+8                                                      LNLBDA    725
      END IF                                                            LNLBDA    726
C                                                                       LNLBDA    727
      DO 380 KL=IFBUS,ITBUS                                             LNLBDA    728
        IF(KLFO.EQ.0)THEN                                               LNLBDA    729
          N=MNEW(KL)                                                    LNLBDA    730
          IF(N.LE.0) GOTO 380                                           LNLBDA    731
        ELSE                                                            LNLBDA    732
          N=KL                                                          LNLBDA    733
        ENDIF                                                           LNLBDA    734
        NLF=NOLD(N)                                                     LNLBDA    735
        IF(JBSTAT(N).GT.2) GOTO 380                                     LNLBDA    736
        KK=(N-1)*4                                                      LNLBDA    737
        ILK=IBAR(KK+3)                                                  LNLBDA    738
        CALL UPACKI(IZONE,IAREA,ILK)                                    LNLBDA    739
        IA=MNEWA(IAREA)                                                 LNLBDA    740
        IZ=MNEWZ(IZONE+1)                                               LNLBDA    741
        IF(IAFLAG(IA).EQ.0.OR.IZFLAG(IZ).EQ.0) GOTO 380                 LNLBDA    742
C                                                                       LNLBDA    743
        IF(ABS(BMW(KK+1)).LE.WMIN.AND.                                  LNLBDA    744
     +     ABS(BMX(KK+2)).LE.XMIN) GOTO 380                             LNLBDA    745
C                                                                       LNLBDA    746
        IF(JREBUS(N)) GOTO 380                                          LNLBDA    747
C                                                                       LNLBDA    748
        IF(ICHECK.NE.0)THEN                                             LNLBDA    749
          NLOD=NLOD+1                                                   LNLBDA    750
          IF(NLOD.GT.NZL) GOTO 390                                      LNLBDA    751
          NLDB(NLOD)=NLF                                                LNLBDA    752
          JREBUS(N)=.TRUE.                                              LNLBDA    753
        ENDIF                                                           LNLBDA    754
        NTYPE=0                                                         LNLBDA    755
C                                                                       LNLBDA    756
        ITOTP=IPF1+IPF2+ICONCP+ICONPP+ICLDP+ITSCP                       LNLBDA    757
        ITOTQ=IQF1+IQF2+ICONCQ+ICONPQ+ICLDQ                             LNLBDA    758
        IF(ITOTP.GT.100.OR.ITOTQ.GT.100)THEN                            LNLBDA    759
          IF(KLFO.EQ.0)THEN                                             LNLBDA    760
            WRITE(MSG(2),1071) NLF                                      LNLBDA    761
          ELSE                                                          LNLBDA    762
            K1=N*8                                                      LNLBDA    763
            WRITE(MSG(2),1090) NAMES(K1-2),NAMES(K1-1),NAMES(K1)        LNLBDA    764
          ENDIF                                                         LNLBDA    765
          WRITE(MSG(1),1070)                                            LNLBDA    766
          CALL PRTMSG(2)                                                LNLBDA    767
        ENDIF                                                           LNLBDA    768
C                                                                       LNLBDA    769
        IF(ICONCP.NE.0.OR.ICONCQ.NE.0)THEN                              LNLBDA    770
          NKCUR=NKCUR+1                                                 LNLBDA    771
          NTYPE=NTYPE+1                                                 LNLBDA    772
          NSHIFT=NSHIFT+1                                               LNLBDA    773
          NLTYPE(NSHIFT)=1                                              LNLBDA    774
          JDNLL(NSHIFT)=JLN                                             LNLBDA    775
          IDDAT(JLN+1)=ILK                                              LNLBDA    776
          DDAT(JLN+2)=ICONCP                                            LNLBDA    777
          DDAT(JLN+3)=ICONCQ                                            LNLBDA    778
          DDAT(JLN+4)=0                                                 LNLBDA    779
          DDAT(JLN+5)=0                                                 LNLBDA    780
          DDAT(JLN+6)=0                                                 LNLBDA    781
          DDAT(JLN+7)=0                                                 LNLBDA    782
          JLN=JLN+8                                                     LNLBDA    783
        ENDIF                                                           LNLBDA    784
C                                                                       LNLBDA    785
        IF(ICONPP.NE.0.OR.ICONPQ.NE.0)THEN                              LNLBDA    786
          NKMVA=NKMVA+1                                                 LNLBDA    787
          NTYPE=NTYPE+1                                                 LNLBDA    788
          NSHIFT=NSHIFT+1                                               LNLBDA    789
          NLTYPE(NSHIFT)=2                                              LNLBDA    790
          JDNLL(NSHIFT)=JLN                                             LNLBDA    791
          IDDAT(JLN+1)=ILK                                              LNLBDA    792
          DDAT(JLN+2)=ICONPP                                            LNLBDA    793
          DDAT(JLN+3)=ICONPQ                                            LNLBDA    794
          DDAT(JLN+4)=0                                                 LNLBDA    795
          DDAT(JLN+5)=0                                                 LNLBDA    796
          DDAT(JLN+6)=0                                                 LNLBDA    797
          JLN=JLN+7                                                     LNLBDA    798
        ENDIF                                                           LNLBDA    799
C                                                                       LNLBDA    800
        IF(IPF1.NE.0.OR.IQF1.NE.0.OR.IPF2.NE.0.OR.IQF2.NE.0)THEN        LNLBDA    801
          NLBS=NLBS+1                                                   LNLBDA    802
          NTYPE=NTYPE+1                                                 LNLBDA    803
          NSHIFT=NSHIFT+1                                               LNLBDA    804
          NLTYPE(NSHIFT)=3                                              LNLBDA    805
          NLCOMP(1,NLOD)=0                                              LNLBDA    806
          NLCOMP(2,NLOD)=1                                              LNLBDA    807
C                                                                       LNLBDA    808
C--  SET THE POINTER POINTING TO ARRAY "DDAT"                           LNLBDA    809
C                                                                       LNLBDA    810
          JDNLL(NSHIFT)=JLN                                             LNLBDA    811
C                                                                       LNLBDA    812
          JL=JLN+10                                                     LNLBDA    813
          ITERMP=0                                                      LNLBDA    814
          ITERMQ=0                                                      LNLBDA    815
C                                                                       LNLBDA    816
          CALL STLODA(JL,IPF1,IPF2,IQF1,IQF2,ITERMP,ITERMQ              LNLBDA    817
     &                  ,PKV1,PKF1,PKV2,PKF2,QKV1,QKF1,QKV2,QKF2)       LNLBDA    818
C                                                                       LNLBDA    819
C--  STORE THE NUMBER OF TERMS IN P AND Q                               LNLBDA    820
C                                                                       LNLBDA    821
          JJ=ITERPQ(ITERMP,ITERMQ)                                      LNLBDA    822
          IDDAT(JLN+1)=JJ                                               LNLBDA    823
          IDDAT(JLN+2)=ILK                                              LNLBDA    824
          DDAT(JLN+7)=0.0                                               LNLBDA    825
          DDAT(JLN+8)=0.0                                               LNLBDA    826
          JLN=JL                                                        LNLBDA    827
        ENDIF                                                           LNLBDA    828
C                                                                       LNLBDA    829
        IF(ICLDP.NE.0.OR.ICLDQ.NE.0)THEN                                LNLBDA    830
          NCLD=NCLD+1                                                   LNLBDA    831
          NTYPE=NTYPE+1                                                 LNLBDA    832
          NSHIFT=NSHIFT+1                                               LNLBDA    833
          NLTYPE(NSHIFT)=4                                              LNLBDA    834
          NLCOMP(1,NLOD)=0                                              LNLBDA    835
          NLCOMP(2,NLOD)=1                                              LNLBDA    836
C                                                                       LNLBDA    837
C--  SET THE POINTER POINTING TO ARRAY "DDAT"                           LNLBDA    838
C                                                                       LNLBDA    839
          JDNLL(NSHIFT)=JLN                                             LNLBDA    840
C                                                                       LNLBDA    841
          JL=JLN+11                                                     LNLBDA    842
C                                                                       LNLBDA    843
          CALL STLODB(JL,KL,NMOTL,NTYPE                                 LNLBDA    844
     &                  ,ICLDLP,PCVDL1,PCVDL2,QKVDL                     LNLBDA    845
     &                  ,ICLTSQ,TSV1,TSG1,TSG2                          LNLBDA    846
     &                  ,ICLCPP,ICLCPQ,PKVRL,LTNLM,LTNSM)               LNLBDA    847
C                                                                       LNLBDA    848
          DDAT(JLN+1)=RTB                                               LNLBDA    849
          DDAT(JLN+2)=XTB                                               LNLBDA    850
          DDAT(JLN+3)=TAPTB                                             LNLBDA    851
          DDAT(JLN+4)=PKVRL                                             LNLBDA    852
          DDAT(JLN+5)=ICLDP                                             LNLBDA    853
          DDAT(JLN+6)=ICLDQ                                             LNLBDA    854
          DDAT(JLN+9)=0.0                                               LNLBDA    855
          DDAT(JLN+10)=0.0                                              LNLBDA    856
          JLN=JL                                                        LNLBDA    857
        ENDIF                                                           LNLBDA    858
C                                                                       LNLBDA    859
C     UPDATE THE NLCOMP ARRAY                                           LNLBDA    860
C                                                                       LNLBDA    861
        IF(ICHECK.NE.0) NLCOMP(1,NLOD)=NTYPE                            LNLBDA    862
C                                                                       LNLBDA    863
C     LOAD TSC LOAD                                                     LNLBDA    864
C                                                                       LNLBDA    865
        IF(ITSCP.NE.0)THEN                                              LNLBDA    866
          NTSCL=NTSCL+1                                                 LNLBDA    867
          IF(NTSCL.GT.NXZL)GOTO 600                                     LNLBDA    868
          JTCDAT(NTSCL)=JLN                                             LNLBDA    869
          IDDAT(JLN+1)=KL                                               LNLBDA    870
          DDAT(JLN+2)=CKP                                               LNLBDA    871
          DDAT(JLN+3)=CKI                                               LNLBDA    872
          DDAT(JLN+4)=TC                                                LNLBDA    873
          DDAT(JLN+5)=CK1                                               LNLBDA    874
          DDAT(JLN+6)=T1                                                LNLBDA    875
          DDAT(JLN+7)=CKL                                               LNLBDA    876
          DDAT(JLN+8)=TA                                                LNLBDA    877
          IDDAT(JLN+9)=ITSCP                                            LNLBDA    878
          JLN=JLN+15                                                    LNLBDA    879
        ENDIF                                                           LNLBDA    880
C                                                                       LNLBDA    881
        CALL MCHECK(NLF,15,JLN,'LNLBDA')                                LNLBDA    882
C                                                                       LNLBDA    883
 380  CONTINUE                                                          LNLBDA    884
C                                                                       LNLBDA    885
      GOTO 500                                                          LNLBDA    886
C                                                                       LNLBDA    887
  390 CONTINUE                                                          LNLBDA    888
         WRITE(MSG(1),1100) NLF,NLOD                                    LNLBDA    889
         CALL PRTMSG(1)                                                 LNLBDA    890
         IEBK=1                                                         LNLBDA    891
C                                                                       LNLBDA    892
 500  IF(J.LT.JNLD)GOTO 110                                             LNLBDA    893
C                                                                       LNLBDA    894
C                                                                       LNLBDA    895
       IF(LDEB)WRITE(IUD6,1110)NLOD,NKCUR,NKMVA,NLBS,NCLD               LNLBDA    896
C                                                                       LNLBDA    897
       RETURN                                                           LNLBDA    898
C                                                                       LNLBDA    899
 600  CONTINUE                                                          LNLBDA    900
      WRITE(MSG(1),1150) NXZL                                           LNLBDA    901
      CALL PRTMSG(1)                                                    LNLBDA    902
      SIMBUF='LNLBDA: TSC LOAD DATA ERROR'                              LNLBDA    903
      CALL ASTOP(SIMBUF,27)                                             LNLBDA    904
C                                                                       LNLBDA    905
 1070 FORMAT                                                            LNLBDA    906
     *(' *** WARNING THE TOTAL % OF THE NONLINEAR LOAD COMPONENTS')     LNLBDA    907
 1071 FORMAT(5X,'AT BUS:',I5,' EXCEEDS 100%, CHECK YOUR DATA')          LNLBDA    908
 1080 FORMAT(5X,'AT BUS:',A12,' EXCEEDS 100%, CHECK YOUR DATA')         LNLBDA    909
 1090 FORMAT(5X,'AT BUS:',3A4,' EXCEEDS 100%, CHECK YOUR DATA')         LNLBDA    910
 1100 FORMAT(' *** ERROR LOAD ON BUS:',I5,' EXCEEDS THE LIMIT OF ',I4)  LNLBDA    911
 1110 FORMAT(' NLOD, NKCUR, NKMVA, NLBS, NCLD, KLOAD  :',6I5)           LNLBDA    912
 1130 FORMAT(' *** ERROR BUS ',I6,' DOES NOT EXSIT IN THE NETWORK')     LNLBDA    913
 1140 FORMAT(' *** ERROR BUS ',A12,'  DOES NOT EXSIT IN THE NETWORK')   LNLBDA    914
 1150 FORMAT(' *** ERROR NO. OF TSC LOADS EXCEEDS THE LIMIT OF',I4)     LNLBDA    915
C                                                                       LNLBDA    916
      END                                                               LNLBDA    917
C                                                                       LNLBDA    918
      SUBROUTINE STLODA(JL,IPF1,IPF2,IQF1,IQF2,ITERMP,ITERMQ            LNLBDA    919
     &                     ,PKV1,PKF1,PKV2,PKF2,QKV1,QKF1,QKV2,QKF2)    LNLBDA    920
C                                                                       LNLBDA    921
CD                                                                      LNLBDA    922
CD    THIS ROUTINE STORES USER INPUT DATA OF VOLTAGE EXPONENT           LNLBDA    923
CD    DEPENDENT LOAD                                                    LNLBDA    924
CD                                                                      LNLBDA    925
      INCLUDE 'PARX.INS'                                                LNLBDA    926
      INCLUDE 'CNMDAT.INS'                                              LNLBDA    927
                                                                        LNLBDA    928
C                                                                       LNLBDA    929
C--  STORE USER INPUT DATA FOR TERM 1 OF ACTIVE POWER P                 LNLBDA    930
C                                                                       LNLBDA    931
      IF(IPF1.NE.0)THEN                                                 LNLBDA    932
        ITERMP=1                                                        LNLBDA    933
        IDDAT(JL+1)=IPF1                                                LNLBDA    934
        DDAT(JL+2)=PKV1                                                 LNLBDA    935
        DDAT(JL+3)=PKF1                                                 LNLBDA    936
        JL=JL+4                                                         LNLBDA    937
      ENDIF                                                             LNLBDA    938
C                                                                       LNLBDA    939
C--  STORE USER INPUT DATA FOR TERM 2 OF ACTIVE POWER P                 LNLBDA    940
C                                                                       LNLBDA    941
      IF(IPF2.NE.0)THEN                                                 LNLBDA    942
        ITERMP=ITERMP+1                                                 LNLBDA    943
        IDDAT(JL+1)=IPF2                                                LNLBDA    944
        DDAT(JL+2)=PKV2                                                 LNLBDA    945
        DDAT(JL+3)=PKF2                                                 LNLBDA    946
        JL=JL+4                                                         LNLBDA    947
      ENDIF                                                             LNLBDA    948
C                                                                       LNLBDA    949
C--  STORE USER INPUT DATA FOR TERM 1 OF REACTIVE POWER Q               LNLBDA    950
C                                                                       LNLBDA    951
      IF(IQF1.NE.0)THEN                                                 LNLBDA    952
        ITERMQ=1                                                        LNLBDA    953
        IDDAT(JL+1)=IQF1                                                LNLBDA    954
        DDAT(JL+2)=QKV1                                                 LNLBDA    955
        DDAT(JL+3)=QKF1                                                 LNLBDA    956
        JL=JL+4                                                         LNLBDA    957
      ENDIF                                                             LNLBDA    958
C                                                                       LNLBDA    959
C--  STORE USER INPUT DATA FOR TERM 2 OF REACTIVE POWER Q               LNLBDA    960
C                                                                       LNLBDA    961
      IF(IQF2.NE.0)THEN                                                 LNLBDA    962
        ITERMQ=ITERMQ+1                                                 LNLBDA    963
        IDDAT(JL+1)=IQF2                                                LNLBDA    964
        DDAT(JL+2)=QKV2                                                 LNLBDA    965
        DDAT(JL+3)=QKF2                                                 LNLBDA    966
        JL=JL+4                                                         LNLBDA    967
      ENDIF                                                             LNLBDA    968
C                                                                       LNLBDA    969
      RETURN                                                            LNLBDA    970
      END                                                               LNLBDA    971
C                                                                       LNLBDA    972
      SUBROUTINE STLODB(JL,KL,NMOTL,NTYPE                               LNLBDA    973
     &                  ,ICLDLP,PCVDL1,PCVDL2,QKVDL                     LNLBDA    974
     &                  ,ICLTSQ,TSV1,TSG1,TSG2                          LNLBDA    975
     &                  ,ICLCPP,ICLCPQ,PKVRL,LTNLM,LTNSM)               LNLBDA    976
C                                                                       LNLBDA    977
CD                                                                      LNLBDA    978
CD  THIS ROUTINE STORES THE USER INPUT DATA OF COMPOSITE LOAD           LNLBDA    979
CD                                                                      LNLBDA    980
C                                                                       LNLBDA    981
      INCLUDE 'PARX.INS'                                                LNLBDA    982
      INCLUDE 'CNPARX.INS'                                              LNLBDA    983
      INCLUDE 'CNB1.INS'                                                LNLBDA    984
      INCLUDE 'CNB19.INS'                                               LNLBDA    985
      INCLUDE 'CNMPAR.INS'                                              LNLBDA    986
      INCLUDE 'CNTMDA.INS'                                              LNLBDA    987
      INCLUDE 'CNTGED.INS'                                              LNLBDA    988
      INCLUDE 'CNMDAT.INS'                                              LNLBDA    989
      INCLUDE 'CNREN.INS'                                               LNLBDA    990
      INCLUDE 'CNLSMB.INS'                                              LNLBDA    991
      INCLUDE 'CNMSG.INS'                                               LNLBDA    992
C                                                                       LNLBDA    993
      CHARACTER*80 SIMBUF                                               LNLBDA    994
CD                                                                      LNLBDA    995
CD    DISCHARGER LIGHTING                                               LNLBDA    996
CD                                                                      LNLBDA    997
      IF(ICLDLP.NE.0)THEN                                               LNLBDA    998
        IDDAT(JL+1)=1                                                   LNLBDA    999
        IDDAT(JL+2)=ICLDLP                                              LNLBDA   1000
        DDAT(JL+3)=PCVDL1                                               LNLBDA   1001
        DDAT(JL+4)=PCVDL2                                               LNLBDA   1002
        DDAT(JL+5)=QKVDL                                                LNLBDA   1003
        DDAT(JL+6)=0.0                                                  LNLBDA   1004
        JL=JL+6                                                         LNLBDA   1005
      ENDIF                                                             LNLBDA   1006
CD                                                                      LNLBDA   1007
CD   TRANSFORMER SATURATION                                             LNLBDA   1008
CD                                                                      LNLBDA   1009
      IF(ICLTSQ.NE.0)THEN                                               LNLBDA   1010
        IDDAT(JL+1)=2                                                   LNLBDA   1011
        IDDAT(JL+2)=ICLTSQ                                              LNLBDA   1012
        DDAT(JL+3)=TSV1                                                 LNLBDA   1013
        DDAT(JL+4)=TSG1                                                 LNLBDA   1014
        DDAT(JL+5)=TSG2                                                 LNLBDA   1015
        DDAT(JL+6)=0.0                                                  LNLBDA   1016
        JL=JL+6                                                         LNLBDA   1017
      ENDIF                                                             LNLBDA   1018
CD                                                                      LNLBDA   1019
CD   CONSTANT MVA                                                       LNLBDA   1020
CD                                                                      LNLBDA   1021
      IF(ICLCPP.NE.0.OR.ICLCPQ.NE.0)THEN                                LNLBDA   1022
        IDDAT(JL+1)=3                                                   LNLBDA   1023
        IDDAT(JL+2)=ICLCPP                                              LNLBDA   1024
        IDDAT(JL+3)=ICLCPQ                                              LNLBDA   1025
        DDAT(JL+4)=0.0                                                  LNLBDA   1026
        DDAT(JL+5)=0.0                                                  LNLBDA   1027
        JL=JL+5                                                         LNLBDA   1028
      ENDIF                                                             LNLBDA   1029
CD                                                                      LNLBDA   1030
CD    REMAINING LOAD                                                    LNLBDA   1031
CD                                                                      LNLBDA   1032
      IDDAT(JL+1)=1                                                     LNLBDA   1033
      IDDAT(JL+2)=100                                                   LNLBDA   1034
      IDDAT(JL+3)=100                                                   LNLBDA   1035
      DDAT(JL+4)=PKVRL                                                  LNLBDA   1036
      DDAT(JL+5)=0.0                                                    LNLBDA   1037
      DDAT(JL+6)=0.0                                                    LNLBDA   1038
      JL=JL+6                                                           LNLBDA   1039
C                                                                       LNLBDA   1040
      JL=JL+1                                                           LNLBDA   1041
C                                                                       LNLBDA   1042
      IDDAT(JL)=0                                                       LNLBDA   1043
CD                                                                      LNLBDA   1044
CD   LARGE AND SMALL MOTORS                                             LNLBDA   1045
CD                                                                      LNLBDA   1046
 920  IF (LTNLM.GE.0) THEN                                              LNLBDA   1047
         LTNMO=LTNLM                                                    LNLBDA   1048
         LTNLM=-1                                                       LNLBDA   1049
         NLFLMB(KL)=NMOTL+1                                             LNLBDA   1050
         IDDAT(JL+36)=1                                                 LNLBDA   1051
      ELSE IF (LTNSM.GE.0) THEN                                         LNLBDA   1052
         LTNMO=LTNSM                                                    LNLBDA   1053
         LTNSM=-1                                                       LNLBDA   1054
         NLFSMB(KL)=NMOTL+1                                             LNLBDA   1055
         IDDAT(JL+36)=2                                                 LNLBDA   1056
      ELSE                                                              LNLBDA   1057
         RETURN                                                         LNLBDA   1058
      END IF                                                            LNLBDA   1059
C                                                                       LNLBDA   1060
      JM=ITDDAT(LTNMO+29)                                               LNLBDA   1061
      NMOTL=NMOTL+1                                                     LNLBDA   1062
      IF (NMOTL.GT.NXMT) GOTO 610                                       LNLBDA   1063
      NMOTB(NMOTL)=-KL                                                  LNLBDA   1064
      NDMC(NMOTL)=INDMID(JM)                                            LNLBDA   1065
      JMDAT(NMOTL)=JL                                                   LNLBDA   1066
      NTYPE=ITDDAT(LTNMO+1)                                             LNLBDA   1067
      IDDAT(JL+1)=NTYPE+10                                              LNLBDA   1068
      IDDAT(JL+2)=ITDDAT(LTNMO+2)                                       LNLBDA   1069
      IDDAT(JL+4)=ITDDAT(LTNMO+3)                                       LNLBDA   1070
      IDDAT(JL+5)=ITDDAT(LTNMO+4)                                       LNLBDA   1071
      DDAT(JL+6)=TDDAT(LTNMO+10)                                        LNLBDA   1072
      DDAT(JL+7)=TDDAT(LTNMO+14)                                        LNLBDA   1073
      DDAT(JL+8)=TDDAT(LTNMO+15)                                        LNLBDA   1074
      DDAT(JL+10)=TDDAT(LTNMO+16)                                       LNLBDA   1075
      DDAT(JL+11)=TDDAT(LTNMO+11)                                       LNLBDA   1076
      DDAT(JL+12)=TDDAT(LTNMO+12)                                       LNLBDA   1077
      DDAT(JL+13)=TDDAT(LTNMO+13)                                       LNLBDA   1078
      DDAT(JL+14)=TDDAT(LTNMO+17)                                       LNLBDA   1079
      DDAT(JL+15)=TDDAT(LTNMO+18)                                       LNLBDA   1080
      DDAT(JL+16)=TDDAT(LTNMO+5)                                        LNLBDA   1081
      DDAT(JL+17)=TDDAT(LTNMO+6)                                        LNLBDA   1082
      DDAT(JL+18)=TDDAT(LTNMO+7)                                        LNLBDA   1083
      DDAT(JL+19)=TDDAT(LTNMO+8)                                        LNLBDA   1084
      DDAT(JL+20)=TDDAT(LTNMO+9)                                        LNLBDA   1085
      DDAT(JL+24)=TDDAT(LTNMO+19)                                       LNLBDA   1086
      DDAT(JL+25)=TDDAT(LTNMO+20)                                       LNLBDA   1087
      DDAT(JL+26)=TDDAT(LTNMO+21)                                       LNLBDA   1088
      DDAT(JL+27)=TDDAT(LTNMO+22)                                       LNLBDA   1089
      DDAT(JL+28)=TDDAT(LTNMO+23)                                       LNLBDA   1090
      DDAT(JL+29)=TDDAT(LTNMO+24)                                       LNLBDA   1091
      DDAT(JL+30)=TDDAT(LTNMO+25)                                       LNLBDA   1092
      DDAT(JL+31)=TDDAT(LTNMO+26)                                       LNLBDA   1093
      IF (NTYPE.EQ.3.OR.NTYPE.EQ.8) THEN                                LNLBDA   1094
         DDAT(JL+32)=TDDAT(LTNMO+27)                                    LNLBDA   1095
         DDAT(JL+33)=TDDAT(LTNMO+28)                                    LNLBDA   1096
      END IF                                                            LNLBDA   1097
C                                                                       LNLBDA   1098
      IF (IDDAT(JL+11).EQ.0) DDAT(JL+11)=BASPC                          LNLBDA   1099
      IF (IDDAT(JL+12).EQ.0) DDAT(JL+12)=1.0                            LNLBDA   1100
      IF (IDDAT(JL+13).EQ.0) THEN                                       LNLBDA   1101
         DDAT(JL+13)=WOBASE                                             LNLBDA   1102
      ELSE                                                              LNLBDA   1103
         DDAT(JL+13)=DDAT(JL+13)*4.0/PI                                 LNLBDA   1104
      END IF                                                            LNLBDA   1105
C                                                                       LNLBDA   1106
      JL=JL+40                                                          LNLBDA   1107
C                                                                       LNLBDA   1108
      CALL MCHECK(KL,13,JL,'STLODB')                                    LNLBDA   1109
C                                                                       LNLBDA   1110
      GOTO 920                                                          LNLBDA   1111
C                                                                       LNLBDA   1112
  610 CONTINUE                                                          LNLBDA   1113
      WRITE(MSG(1),1160) NXMT                                           LNLBDA   1114
      CALL PRTMSG(1)                                                    LNLBDA   1115
      SIMBUF='STLODB: INDUCTION MOTOR DATA ERROR'                       LNLBDA   1116
      CALL ASTOP(SIMBUF,34)                                             LNLBDA   1117
C                                                                       LNLBDA   1118
 1160 FORMAT(' *** ERROR MOTOR ON BUS ',I4,' EXCEEDS THE LIMIT OF',I4)  LNLBDA   1119
C                                                                       LNLBDA   1120
      END                                                               LNLBDA   1121
