CFPRIME RNLBDA                                                          RNLBDA      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 RNLBDA(IUX,IUY,IEBK)                                   RNLBDA      3
CD                                                                      RNLBDA      4
CD    TO READ IN THE NONLINEAR LOAD DATA.                               RNLBDA      5
CD                                                                      RNLBDA      6
      INCLUDE 'PARX.INS'                                                RNLBDA      7
      INCLUDE 'CNPARX.INS'                                              RNLBDA      8
      INCLUDE 'CNFLAG.INS'                                              RNLBDA      9
      INCLUDE 'CNJPT.INS'                                               RNLBDA     10
      INCLUDE 'CNJDAT.INS'                                              RNLBDA     11
      INCLUDE 'CNTMDA.INS'                                              RNLBDA     12
      INCLUDE 'CNTGED.INS'                                              RNLBDA     13
      INCLUDE 'CNUNIT.INS'                                              RNLBDA     14
      INCLUDE 'CNMSG.INS'                                               RNLBDA     15
C                                                                       RNLBDA     16
      CHARACTER*80 SIMBUF,LCARD                                         RNLBDA     17
      CHARACTER*12 AFBUS,ATBUS,AFAREA,ATAREA,AFZONE,ATZONE              RNLBDA     18
      CHARACTER*4 JINDLM,JINDSM                                         RNLBDA     19
      CHARACTER*5 EDATA,RANGE                                           RNLBDA     20
      INTEGER JFBUS(3),JTBUS(3),JFAREA(3),JTAREA(3),JFZONE(3),JTZONE(3) RNLBDA     21
      EQUIVALENCE (JFBUS(1),AFBUS),(JTBUS(1),ATBUS)                     RNLBDA     22
      EQUIVALENCE (JFAREA(1),AFAREA),(JTAREA(1),ATAREA)                 RNLBDA     23
      EQUIVALENCE (JFZONE(1),AFZONE),(JTZONE(1),ATZONE)                 RNLBDA     24
C                                                                       RNLBDA     25
      DATA EDATA/'EDATA'/,RANGE/'RANGE'/                                RNLBDA     26
C                                                                       RNLBDA     27
      LDEB=(JDEB(9).NE.0)                                               RNLBDA     28
      NTYP=0                                                            RNLBDA     29
C                                                                       RNLBDA     30
 100  CALL GETLIN(IUX,SIMBUF)                                           RNLBDA     31
      LCARD=SIMBUF                                                      RNLBDA     32
C                                                                       RNLBDA     33
      IF(SIMBUF(1:5).EQ.EDATA)RETURN                                    RNLBDA     34
C                                                                       RNLBDA     35
      JNLD=JNLD+1                                                       RNLBDA     36
      JJNLD(JNLD)=JTLN                                                  RNLBDA     37
C                                                                       RNLBDA     38
      IF(SIMBUF(1:5).EQ.RANGE) GOTO 120                                 RNLBDA     39
C                                                                       RNLBDA     40
      IF(KLFO.EQ.0)THEN                                                 RNLBDA     41
      READ(SIMBUF,1000) (ITDDAT(JTLN+J),J=2,13)                         RNLBDA     42
      ITDDAT(JTLN+1)=1                                                  RNLBDA     43
      NLF=ITDDAT(JTLN+2)                                                RNLBDA     44
      IPF1=ITDDAT(JTLN+7)                                               RNLBDA     45
      IQF1=ITDDAT(JTLN+8)                                               RNLBDA     46
      IPF2=ITDDAT(JTLN+9)                                               RNLBDA     47
      IQF2=ITDDAT(JTLN+10)                                              RNLBDA     48
      ICLDP=ITDDAT(JTLN+11)                                             RNLBDA     49
      ICLDQ=ITDDAT(JTLN+12)                                             RNLBDA     50
      ITSCP=ITDDAT(JTLN+13)                                             RNLBDA     51
      ITOTP=ITDDAT(JTLN+3)+ITDDAT(JTLN+5)+ITDDAT(JTLN+7)                RNLBDA     52
     &+ITDDAT(JTLN+9)+ITDDAT(JTLN+11)+ITDDAT(JTLN+13)                   RNLBDA     53
      ITOTQ=ITDDAT(JTLN+4)+ITDDAT(JTLN+6)+ITDDAT(JTLN+8)                RNLBDA     54
     &+ITDDAT(JTLN+10)+ITDDAT(JTLN+12)                                  RNLBDA     55
      JTLN=JTLN+13                                                      RNLBDA     56
      ELSE                                                              RNLBDA     57
      READ(SIMBUF,1010) AFBUS,(ITDDAT(JTLN+J),J=5,15)                   RNLBDA     58
      ITDDAT(JTLN+1)=2                                                  RNLBDA     59
      CALL CHKBUS(AFBUS,NLF)                                            RNLBDA     60
      IF(NLF.LE.0)THEN                                                  RNLBDA     61
      IEBK=1                                                            RNLBDA     62
      WRITE(MSG(1),1150) AFBUS                                          RNLBDA     63
      CALL PRTMSG(1)                                                    RNLBDA     64
      ENDIF                                                             RNLBDA     65
      ITDDAT(JTLN+2)=JFBUS(1)                                           RNLBDA     66
      ITDDAT(JTLN+3)=JFBUS(2)                                           RNLBDA     67
      ITDDAT(JTLN+4)=JFBUS(3)                                           RNLBDA     68
      IPF1=ITDDAT(JTLN+9)                                               RNLBDA     69
      IQF1=ITDDAT(JTLN+10)                                              RNLBDA     70
      IPF2=ITDDAT(JTLN+11)                                              RNLBDA     71
      IQF2=ITDDAT(JTLN+12)                                              RNLBDA     72
      ICLDP=ITDDAT(JTLN+13)                                             RNLBDA     73
      ICLDQ=ITDDAT(JTLN+14)                                             RNLBDA     74
      ITSCP=ITDDAT(JTLN+15)                                             RNLBDA     75
      ITOTP=ITDDAT(JTLN+5)+ITDDAT(JTLN+7)+ITDDAT(JTLN+9)                RNLBDA     76
     &+ITDDAT(JTLN+11)+ITDDAT(JTLN+13)+ITDDAT(JTLN+15)                  RNLBDA     77
      ITOTQ=ITDDAT(JTLN+6)+ITDDAT(JTLN+8)+ITDDAT(JTLN+10)               RNLBDA     78
     &+ITDDAT(JTLN+12)+ITDDAT(JTLN+14)                                  RNLBDA     79
      JTLN=JTLN+15                                                      RNLBDA     80
      ENDIF                                                             RNLBDA     81
      IF(ITOTP.GT.100.OR.ITOTQ.GT.100)THEN                              RNLBDA     82
      IEBK=1                                                            RNLBDA     83
      WRITE(MSG(1),1090)                                                RNLBDA     84
      MSG(2)=LCARD                                                      RNLBDA     85
      CALL PRTMSG(2)                                                    RNLBDA     86
      ENDIF                                                             RNLBDA     87
C                                                                       RNLBDA     88
      IF(IPF1.NE.0.OR.IQF1.NE.0.OR.IPF2.NE.0.OR.IQF2.NE.0)THEN          RNLBDA     89
C                                                                       RNLBDA     90
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA     91
      READ(SIMBUF,1020) TDDAT(JTLN+1),TDDAT(JTLN+2),TDDAT(JTLN+3)       RNLBDA     92
     &,TDDAT(JTLN+4),TDDAT(JTLN+5),TDDAT(JTLN+6),TDDAT(JTLN+7)          RNLBDA     93
     &,TDDAT(JTLN+8)                                                    RNLBDA     94
      JTLN=JTLN+8                                                       RNLBDA     95
      ENDIF                                                             RNLBDA     96
C                                                                       RNLBDA     97
C--  READ IN COMPOSITE LOAD DATA                                        RNLBDA     98
C                                                                       RNLBDA     99
      IF(ICLDP.NE.0.OR.ICLDQ.NE.0)THEN                                  RNLBDA    100
C                                                                       RNLBDA    101
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    102
      READ(SIMBUF,1005) JINDLM,NTYPLM,ICLLMP,ISATLM,ILTYPL              RNLBDA    103
     1,JINDSM,NTYPSM,ICLSMP,ISATSM,ILTYPS,ICLDLP,ICLTSQ,ICLCPP,ICLCPQ   RNLBDA    104
      ITDDAT(JTLN+1)=ICLLMP                                             RNLBDA    105
      ITDDAT(JTLN+2)=ICLSMP                                             RNLBDA    106
      ITDDAT(JTLN+3)=ICLDLP                                             RNLBDA    107
      ITDDAT(JTLN+4)=ICLTSQ                                             RNLBDA    108
      ITDDAT(JTLN+5)=ICLCPP                                             RNLBDA    109
      ITDDAT(JTLN+6)=ICLCPQ                                             RNLBDA    110
      ITOTP=ICLLMP+ICLSMP+ICLDLP+ICLCPP                                 RNLBDA    111
      TOTQ=0.4*(ICLLMP+ICLSMP)+0.435890*ICLDLP+ICLTSQ+ICLCPQ            RNLBDA    112
      IF(ITOTP.GT.100.OR.TOTQ.GT.100.)THEN                              RNLBDA    113
      IEBK=1                                                            RNLBDA    114
      WRITE(MSG(1),1095)                                                RNLBDA    115
      MSG(2)=LCARD                                                      RNLBDA    116
      WRITE(MSG(3),1096)                                                RNLBDA    117
      MSG(4)=SIMBUF                                                     RNLBDA    118
      WRITE(MSG(5),1097)                                                RNLBDA    119
      CALL PRTMSG(5)                                                    RNLBDA    120
      ENDIF                                                             RNLBDA    121
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    122
      READ(SIMBUF,1020) TDDAT(JTLN+7),TDDAT(JTLN+8),TDDAT(JTLN+9)       RNLBDA    123
     &,TDDAT(JTLN+10)                                                   RNLBDA    124
      JTLN=JTLN+10                                                      RNLBDA    125
C--                                  READ IN LARGE MOTORS               RNLBDA    126
      IF(ICLLMP.NE.0)THEN                                               RNLBDA    127
      JMOTL=JMOTL+1                                                     RNLBDA    128
      IF (JMOTL.GT.NXMT) GOTO 130                                       RNLBDA    129
      IF (NTYPLM.LT.1.OR.(NTYPLM.GT.3.AND.NTYPLM.LT.6)                  RNLBDA    130
     *   .OR.NTYPLM.GT.8) THEN                                          RNLBDA    131
         NTYP=NTYPLM                                                    RNLBDA    132
         GOTO 140                                                       RNLBDA    133
      END IF                                                            RNLBDA    134
      JMOTB(JMOTL)=-NLF                                                 RNLBDA    135
      INDMID(JMOTL)=JINDLM                                              RNLBDA    136
      JJMDAT(JMOTL)=JTLN                                                RNLBDA    137
      ITDDAT(JTLN+1)=NTYPLM                                             RNLBDA    138
      ITDDAT(JTLN+2)=ICLLMP                                             RNLBDA    139
      ITDDAT(JTLN+3)=ISATLM                                             RNLBDA    140
      ITDDAT(JTLN+4)=ILTYPL                                             RNLBDA    141
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    142
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=5,9)                          RNLBDA    143
     +,(TDDAT(JTLN+J),J=27,28)                                          RNLBDA    144
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    145
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=19,26)                        RNLBDA    146
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    147
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=10,13)                        RNLBDA    148
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    149
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=14,18)                        RNLBDA    150
C                                                                       RNLBDA    151
      ITDDAT(JTLN+29)=JMOTL                                             RNLBDA    152
      JTLN=JTLN+29                                                      RNLBDA    153
      ENDIF                                                             RNLBDA    154
C--                                  READ IN SMALL MOTORS               RNLBDA    155
      IF(ICLSMP.NE.0)THEN                                               RNLBDA    156
      JMOTL=JMOTL+1                                                     RNLBDA    157
      IF (JMOTL.GT.NXMT) GOTO 130                                       RNLBDA    158
      IF (NTYPSM.LT.1.OR.(NTYPSM.GT.3.AND.NTYPSM.LT.6)                  RNLBDA    159
     *   .OR.NTYPSM.GT.8) THEN                                          RNLBDA    160
         NTYP=NTYPSM                                                    RNLBDA    161
         GOTO 140                                                       RNLBDA    162
      END IF                                                            RNLBDA    163
      JMOTB(JMOTL)=-NLF                                                 RNLBDA    164
      INDMID(JMOTL)=JINDSM                                              RNLBDA    165
      JJMDAT(JMOTL)=JTLN                                                RNLBDA    166
      ITDDAT(JTLN+1)=NTYPSM                                             RNLBDA    167
      ITDDAT(JTLN+2)=ICLSMP                                             RNLBDA    168
      ITDDAT(JTLN+3)=ISATSM                                             RNLBDA    169
      ITDDAT(JTLN+4)=ILTYPS                                             RNLBDA    170
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    171
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=5,9)                          RNLBDA    172
     +,(TDDAT(JTLN+J),J=27,28)                                          RNLBDA    173
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    174
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=19,26)                        RNLBDA    175
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    176
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=10,13)                        RNLBDA    177
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    178
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=14,18)                        RNLBDA    179
C                                                                       RNLBDA    180
      ITDDAT(JTLN+29)=JMOTL                                             RNLBDA    181
      JTLN=JTLN+29                                                      RNLBDA    182
      ENDIF                                                             RNLBDA    183
      IF(ICLDLP.NE.0)THEN                                               RNLBDA    184
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    185
      READ(SIMBUF,1020) TDDAT(JTLN+1),TDDAT(JTLN+2),TDDAT(JTLN+3)       RNLBDA    186
      JTLN=JTLN+3                                                       RNLBDA    187
      IF(TDDAT(JTLN+1).LT.TDDAT(JTLN+2))THEN                            RNLBDA    188
      IEBK=1                                                            RNLBDA    189
      WRITE(MSG(1),1100)                                                RNLBDA    190
      MSG(2)=LCARD                                                      RNLBDA    191
      WRITE(MSG(3),1110)                                                RNLBDA    192
      MSG(4)=SIMBUF                                                     RNLBDA    193
      WRITE(MSG(5),1097)                                                RNLBDA    194
      CALL PRTMSG(5)                                                    RNLBDA    195
      ENDIF                                                             RNLBDA    196
      ENDIF                                                             RNLBDA    197
      IF(ICLTSQ.NE.0)THEN                                               RNLBDA    198
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    199
      READ(SIMBUF,1020) TDDAT(JTLN+1),TDDAT(JTLN+2),TDDAT(JTLN+3)       RNLBDA    200
      JTLN=JTLN+3                                                       RNLBDA    201
      IF(TDDAT(JTLN+2).LT.TDDAT(JTLN+3))THEN                            RNLBDA    202
      IEBK=1                                                            RNLBDA    203
      WRITE(MSG(1),1100)                                                RNLBDA    204
      MSG(2)=LCARD                                                      RNLBDA    205
      WRITE(MSG(3),1120)                                                RNLBDA    206
      MSG(4)=SIMBUF                                                     RNLBDA    207
      WRITE(MSG(5),1097)                                                RNLBDA    208
      CALL PRTMSG(5)                                                    RNLBDA    209
      ENDIF                                                             RNLBDA    210
      ENDIF                                                             RNLBDA    211
      ENDIF                                                             RNLBDA    212
C                                                                       RNLBDA    213
C     READ IN TSCL DATA                                                 RNLBDA    214
C                                                                       RNLBDA    215
      IF (ITSCP.NE.0) THEN                                              RNLBDA    216
         JTSCL=JTSCL+1                                                  RNLBDA    217
         IF (JTSCL.GT.NXZL) GOTO 150                                    RNLBDA    218
         JJTSCD(JTSCL)=JTLN                                             RNLBDA    219
         ITDDAT(JTLN+1)=NLF                                             RNLBDA    220
         CALL GETLIN(IUX,SIMBUF)                                        RNLBDA    221
         READ(SIMBUF,1020) (TDDAT(JTLN+J),J=2,8)                        RNLBDA    222
         JTLN=JTLN+8                                                    RNLBDA    223
      END IF                                                            RNLBDA    224
C                                                                       RNLBDA    225
C    READ ANOTHER LOAD BUS                                              RNLBDA    226
C                                                                       RNLBDA    227
      GOTO 100                                                          RNLBDA    228
C                                                                       RNLBDA    229
C--  ASSIGN NLL BY THE RANGE OF AREA, ZONE AND BUS NAME OR NUMBER       RNLBDA    230
C                                                                       RNLBDA    231
  120 CONTINUE                                                          RNLBDA    232
C                                                                       RNLBDA    233
      IF(KLFO.EQ.0)THEN                                                 RNLBDA    234
      READ(SIMBUF,1030)IFAREA,ITAREA,IFZONE,ITZONE,IFBUS,ITBUS          RNLBDA    235
      ITDDAT(JTLN+1)=3                                                  RNLBDA    236
      ITDDAT(JTLN+2)=IFAREA                                             RNLBDA    237
      ITDDAT(JTLN+3)=ITAREA                                             RNLBDA    238
      ITDDAT(JTLN+4)=IFZONE                                             RNLBDA    239
      ITDDAT(JTLN+5)=ITZONE                                             RNLBDA    240
      ITDDAT(JTLN+6)=IFBUS                                              RNLBDA    241
      ITDDAT(JTLN+7)=ITBUS                                              RNLBDA    242
      JTLN=JTLN+7                                                       RNLBDA    243
      ELSE                                                              RNLBDA    244
      READ(SIMBUF,1040)AFAREA,ATAREA,AFZONE,ATZONE,AFBUS,ATBUS          RNLBDA    245
      ITDDAT(JTLN+1)=4                                                  RNLBDA    246
      ITDDAT(JTLN+2)=JFAREA(1)                                          RNLBDA    247
      ITDDAT(JTLN+3)=JFAREA(2)                                          RNLBDA    248
      ITDDAT(JTLN+4)=JFAREA(3)                                          RNLBDA    249
      ITDDAT(JTLN+5)=JTAREA(1)                                          RNLBDA    250
      ITDDAT(JTLN+6)=JTAREA(2)                                          RNLBDA    251
      ITDDAT(JTLN+7)=JTAREA(3)                                          RNLBDA    252
      ITDDAT(JTLN+8)=JFZONE(1)                                          RNLBDA    253
      ITDDAT(JTLN+9)=JFZONE(2)                                          RNLBDA    254
      ITDDAT(JTLN+10)=JFZONE(3)                                         RNLBDA    255
      ITDDAT(JTLN+11)=JTZONE(1)                                         RNLBDA    256
      ITDDAT(JTLN+12)=JTZONE(2)                                         RNLBDA    257
      ITDDAT(JTLN+13)=JTZONE(3)                                         RNLBDA    258
      ITDDAT(JTLN+14)=JFBUS(1)                                          RNLBDA    259
      ITDDAT(JTLN+15)=JFBUS(2)                                          RNLBDA    260
      ITDDAT(JTLN+16)=JFBUS(3)                                          RNLBDA    261
      ITDDAT(JTLN+17)=JTBUS(1)                                          RNLBDA    262
      ITDDAT(JTLN+18)=JTBUS(2)                                          RNLBDA    263
      ITDDAT(JTLN+19)=JTBUS(3)                                          RNLBDA    264
      JTLN=JTLN+19                                                      RNLBDA    265
      ENDIF                                                             RNLBDA    266
C                                                                       RNLBDA    267
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    268
      READ(SIMBUF,1020) TDDAT(JTLN+1),TDDAT(JTLN+2)                     RNLBDA    269
      JTLN=JTLN+2                                                       RNLBDA    270
C                                                                       RNLBDA    271
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    272
      READ(SIMBUF,1030) ITDDAT(JTLN+1),ITDDAT(JTLN+2),ITDDAT(JTLN+3)    RNLBDA    273
     &,ITDDAT(JTLN+4),IPF1,IQF1,IPF2,IQF2,ICLDP,ICLDQ,ITSCP             RNLBDA    274
      ITDDAT(JTLN+5)=IPF1                                               RNLBDA    275
      ITDDAT(JTLN+6)=IQF1                                               RNLBDA    276
      ITDDAT(JTLN+7)=IPF2                                               RNLBDA    277
      ITDDAT(JTLN+8)=IQF2                                               RNLBDA    278
      ITDDAT(JTLN+9)=ICLDP                                              RNLBDA    279
      ITDDAT(JTLN+10)=ICLDQ                                             RNLBDA    280
      ITDDAT(JTLN+11)=ITSCP                                             RNLBDA    281
C                                                                       RNLBDA    282
      ITOTP=ITDDAT(JTLN+1)+ITDDAT(JTLN+3)+ITDDAT(JTLN+5)                RNLBDA    283
     &+ITDDAT(JTLN+7)+ITDDAT(JTLN+9)+ITDDAT(JTLN+11)                    RNLBDA    284
      ITOTQ=ITDDAT(JTLN+2)+ITDDAT(JTLN+4)+ITDDAT(JTLN+6)                RNLBDA    285
     &+ITDDAT(JTLN+8)+ITDDAT(JTLN+10)                                   RNLBDA    286
C                                                                       RNLBDA    287
      JTLN=JTLN+11                                                      RNLBDA    288
      IF(ITOTP.GT.100.OR.ITOTQ.GT.100)THEN                              RNLBDA    289
      IEBK=1                                                            RNLBDA    290
      WRITE(MSG(1),1100)                                                RNLBDA    291
      MSG(2)=LCARD                                                      RNLBDA    292
      WRITE(MSG(3),1101)                                                RNLBDA    293
      MSG(4)=SIMBUF                                                     RNLBDA    294
      WRITE(MSG(5),1097)                                                RNLBDA    295
      CALL PRTMSG(5)                                                    RNLBDA    296
      ENDIF                                                             RNLBDA    297
C                                                                       RNLBDA    298
      IF(IPF1.NE.0.OR.IQF1.NE.0.OR.IPF2.NE.0.OR.IQF2.NE.0)THEN          RNLBDA    299
C                                                                       RNLBDA    300
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    301
      READ(SIMBUF,1020) TDDAT(JTLN+1),TDDAT(JTLN+2),TDDAT(JTLN+3)       RNLBDA    302
     &,TDDAT(JTLN+4),TDDAT(JTLN+5),TDDAT(JTLN+6),TDDAT(JTLN+7)          RNLBDA    303
     &,TDDAT(JTLN+8)                                                    RNLBDA    304
      JTLN=JTLN+8                                                       RNLBDA    305
      ENDIF                                                             RNLBDA    306
C                                                                       RNLBDA    307
C--  READ IN COMPOSITE LOAD DATA                                        RNLBDA    308
C                                                                       RNLBDA    309
      IF(ICLDP.NE.0.OR.ICLDQ.NE.0)THEN                                  RNLBDA    310
C                                                                       RNLBDA    311
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    312
      READ(SIMBUF,1005) JINDLM,NTYPLM,ICLLMP,ISATLM,ILTYPL              RNLBDA    313
     1,JINDSM,NTYPSM,ICLSMP,ISATSM,ILTYPS,ICLDLP,ICLTSQ,ICLCPP,ICLCPQ   RNLBDA    314
      ITDDAT(JTLN+1)=ICLLMP                                             RNLBDA    315
      ITDDAT(JTLN+2)=ICLSMP                                             RNLBDA    316
      ITDDAT(JTLN+3)=ICLDLP                                             RNLBDA    317
      ITDDAT(JTLN+4)=ICLTSQ                                             RNLBDA    318
      ITDDAT(JTLN+5)=ICLCPP                                             RNLBDA    319
      ITDDAT(JTLN+6)=ICLCPQ                                             RNLBDA    320
      ITOTP=ICLLMP+ICLSMP+ICLDLP+ICLCPP                                 RNLBDA    321
      TOTQ=0.4*(ICLLMP+ICLSMP)+0.435890*ICLDLP+ICLTSQ+ICLCPQ            RNLBDA    322
      IF(ITOTP.GT.100.OR.ITOTQ.GT.100)THEN                              RNLBDA    323
      IEBK=1                                                            RNLBDA    324
      WRITE(MSG(1),1095)                                                RNLBDA    325
      MSG(2)=LCARD                                                      RNLBDA    326
      WRITE(MSG(3),1096)                                                RNLBDA    327
      MSG(4)=SIMBUF                                                     RNLBDA    328
      WRITE(MSG(5),1097)                                                RNLBDA    329
      CALL PRTMSG(5)                                                    RNLBDA    330
      ENDIF                                                             RNLBDA    331
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    332
      READ(SIMBUF,1020) TDDAT(JTLN+7),TDDAT(JTLN+8),TDDAT(JTLN+9)       RNLBDA    333
     &,TDDAT(JTLN+10)                                                   RNLBDA    334
      JTLN=JTLN+10                                                      RNLBDA    335
C                                                                       RNLBDA    336
C     NOTE THAT MOTOR AND TSC LOADS IN RANGE CARDS ARE LOADED           RNLBDA    337
C     SEPARATELY IN LNLBDA. THEREFORE, ONLY ONE SET OF DATA             RNLBDA    338
C     IS STORED HERE WITH NLF = 0                                       RNLBDA    339
C                                                                       RNLBDA    340
C--                                  READ IN LARGE MOTORS               RNLBDA    341
      IF(ICLLMP.NE.0)THEN                                               RNLBDA    342
      JMOTL=JMOTL+1                                                     RNLBDA    343
      IF (JMOTL.GT.NXMT) GOTO 130                                       RNLBDA    344
      IF (NTYPLM.LT.1.OR.(NTYPLM.GT.3.AND.NTYPLM.LT.6)                  RNLBDA    345
     *   .OR.NTYPLM.GT.8) THEN                                          RNLBDA    346
         NTYP=NTYPLM                                                    RNLBDA    347
         GOTO 140                                                       RNLBDA    348
      END IF                                                            RNLBDA    349
      JMOTB(JMOTL)=0                                                    RNLBDA    350
      INDMID(JMOTL)=JINDLM                                              RNLBDA    351
      JJMDAT(JMOTL)=JTLN                                                RNLBDA    352
      ITDDAT(JTLN+1)=NTYPLM                                             RNLBDA    353
      ITDDAT(JTLN+2)=ICLLMP                                             RNLBDA    354
      ITDDAT(JTLN+3)=ISATLM                                             RNLBDA    355
      ITDDAT(JTLN+4)=ILTYPL                                             RNLBDA    356
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    357
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=5,9)                          RNLBDA    358
     +,(TDDAT(JTLN+J),J=27,28)                                          RNLBDA    359
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    360
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=19,26)                        RNLBDA    361
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    362
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=10,13)                        RNLBDA    363
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    364
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=14,18)                        RNLBDA    365
C                                                                       RNLBDA    366
      ITDDAT(JTLN+29)=JMOTL                                             RNLBDA    367
      JTLN=JTLN+29                                                      RNLBDA    368
      ENDIF                                                             RNLBDA    369
C--                                  READ IN SMALL MOTORS               RNLBDA    370
      IF(ICLSMP.NE.0)THEN                                               RNLBDA    371
      JMOTL=JMOTL+1                                                     RNLBDA    372
      IF (JMOTL.GT.NXMT) GOTO 130                                       RNLBDA    373
      IF (NTYPSM.LT.1.OR.(NTYPSM.GT.3.AND.NTYPSM.LT.6)                  RNLBDA    374
     *   .OR.NTYPSM.GT.8) THEN                                          RNLBDA    375
         NTYP=NTYPSM                                                    RNLBDA    376
         GOTO 140                                                       RNLBDA    377
      END IF                                                            RNLBDA    378
      JMOTB(JMOTL)=0                                                    RNLBDA    379
      INDMID(JMOTL)=JINDSM                                              RNLBDA    380
      JJMDAT(JMOTL)=JTLN                                                RNLBDA    381
      ITDDAT(JTLN+1)=NTYPSM                                             RNLBDA    382
      ITDDAT(JTLN+2)=ICLSMP                                             RNLBDA    383
      ITDDAT(JTLN+3)=ISATSM                                             RNLBDA    384
      ITDDAT(JTLN+4)=ILTYPS                                             RNLBDA    385
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    386
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=5,9)                          RNLBDA    387
     +,(TDDAT(JTLN+J),J=27,28)                                          RNLBDA    388
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    389
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=19,26)                        RNLBDA    390
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    391
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=10,13)                        RNLBDA    392
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    393
      READ (SIMBUF,1020) (TDDAT(JTLN+J),J=14,18)                        RNLBDA    394
C                                                                       RNLBDA    395
      ITDDAT(JTLN+29)=JMOTL                                             RNLBDA    396
      JTLN=JTLN+29                                                      RNLBDA    397
      ENDIF                                                             RNLBDA    398
      IF(ICLDLP.NE.0)THEN                                               RNLBDA    399
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    400
      READ(SIMBUF,1020) TDDAT(JTLN+1),TDDAT(JTLN+2),TDDAT(JTLN+3)       RNLBDA    401
      JTLN=JTLN+3                                                       RNLBDA    402
      IF(TDDAT(JTLN+1).LT.TDDAT(JTLN+2))THEN                            RNLBDA    403
      IEBK=1                                                            RNLBDA    404
      WRITE(MSG(1),1100)                                                RNLBDA    405
      MSG(2)=LCARD                                                      RNLBDA    406
      WRITE(MSG(3),1110)                                                RNLBDA    407
      MSG(4)=SIMBUF                                                     RNLBDA    408
      WRITE(MSG(5),1097)                                                RNLBDA    409
      CALL PRTMSG(5)                                                    RNLBDA    410
      ENDIF                                                             RNLBDA    411
      ENDIF                                                             RNLBDA    412
      IF(ICLTSQ.NE.0)THEN                                               RNLBDA    413
      CALL GETLIN(IUX,SIMBUF)                                           RNLBDA    414
      READ(SIMBUF,1020) TDDAT(JTLN+1),TDDAT(JTLN+2),TDDAT(JTLN+3)       RNLBDA    415
      JTLN=JTLN+3                                                       RNLBDA    416
      IF(TDDAT(JTLN+2).LT.TDDAT(JTLN+3))THEN                            RNLBDA    417
      IEBK=1                                                            RNLBDA    418
      WRITE(MSG(1),1100)                                                RNLBDA    419
      MSG(2)=LCARD                                                      RNLBDA    420
      WRITE(MSG(3),1120)                                                RNLBDA    421
      MSG(4)=SIMBUF                                                     RNLBDA    422
      WRITE(MSG(5),1097)                                                RNLBDA    423
      CALL PRTMSG(5)                                                    RNLBDA    424
      ENDIF                                                             RNLBDA    425
      ENDIF                                                             RNLBDA    426
      ENDIF                                                             RNLBDA    427
C                                                                       RNLBDA    428
C     READ IN TSCL DATA                                                 RNLBDA    429
C                                                                       RNLBDA    430
      IF (ITSCP.NE.0) THEN                                              RNLBDA    431
         JTSCL=JTSCL+1                                                  RNLBDA    432
         IF (JTSCL.GT.NXZL) GOTO 150                                    RNLBDA    433
         JJTSCD(JTSCL)=JTLN                                             RNLBDA    434
         ITDDAT(JTLN+1)=0                                               RNLBDA    435
         CALL GETLIN(IUX,SIMBUF)                                        RNLBDA    436
         READ(SIMBUF,1020) (TDDAT(JTLN+J),J=2,8)                        RNLBDA    437
         JTLN=JTLN+8                                                    RNLBDA    438
      END IF                                                            RNLBDA    439
C                                                                       RNLBDA    440
      GOTO 100                                                          RNLBDA    441
C                                                                       RNLBDA    442
  130 CONTINUE                                                          RNLBDA    443
      WRITE(MSG(1),1160) NXMT,SIMBUF                                    RNLBDA    444
      CALL PRTMSG(1)                                                    RNLBDA    445
      SIMBUF='RNLBDA: INDUCTION MOTOR DATA ERROR'                       RNLBDA    446
      CALL ASTOP(SIMBUF,34)                                             RNLBDA    447
C                                                                       RNLBDA    448
  140 CONTINUE                                                          RNLBDA    449
      WRITE(MSG(1),1170) NTYP,SIMBUF                                    RNLBDA    450
      CALL PRTMSG(1)                                                    RNLBDA    451
      SIMBUF='RNLBDA: INDUCTION MOTOR TYPE ERROR'                       RNLBDA    452
      CALL ASTOP(SIMBUF,34)                                             RNLBDA    453
C                                                                       RNLBDA    454
  150 CONTINUE                                                          RNLBDA    455
      WRITE(MSG(1),1180) NXZL,SIMBUF                                    RNLBDA    456
      CALL PRTMSG(1)                                                    RNLBDA    457
      SIMBUF='RNLBDA: TSC LOAD DATA ERROR'                              RNLBDA    458
      CALL ASTOP(SIMBUF,27)                                             RNLBDA    459
C                                                                       RNLBDA    460
 1000 FORMAT(16I5)                                                      RNLBDA    461
 1005 FORMAT(1X,A4,4I5,1X,A4,4I5,4I5)                                   RNLBDA    462
 1010 FORMAT(A12,11I5)                                                  RNLBDA    463
 1020 FORMAT(8F10.5)                                                    RNLBDA    464
 1030 FORMAT(5X,16I5)                                                   RNLBDA    465
 1040 FORMAT(5X,3(1X,2A12))                                             RNLBDA    466
 1090 FORMAT(' *** WARNING THE TOTAL % OF THE NONLINEAR LOAD BUS '      RNLBDA    467
     &,'EXCEEDS 100%, CHECK YOUR DATA')                                 RNLBDA    468
 1095 FORMAT(' *** WARNING AT BUS CARD ')                               RNLBDA    469
 1096 FORMAT(5X,'THE TOTAL % OF THE COMPOSITE LOAD BUS '                RNLBDA    470
     &,' EXCEEDS 100%,')                                                RNLBDA    471
 1097 FORMAT(5X,'CHECK YOUR DATA')                                      RNLBDA    472
 1100 FORMAT(' *** WARNING AT RANGE CARD ')                             RNLBDA    473
 1101 FORMAT(5X,'THE TOTAL % OF THE NONLNIEAR LOAD BUS '                RNLBDA    474
     &,' EXCEEDS 100%,')                                                RNLBDA    475
 1110 FORMAT(5X,'THE DISCHARGER LIGHTING CURVE '                        RNLBDA    476
     &,'IS NOT MONOTONICALLY INCREASING,')                              RNLBDA    477
 1120 FORMAT(5X,'THE TRANSFORMER SATURATION CURVE '                     RNLBDA    478
     &,'IS NOT MONOTONICALLY INCREASING,')                              RNLBDA    479
 1150 FORMAT(' *** ERROR BUS ',A12,' DOES NOT EXIST IN THE NETWORK')    RNLBDA    480
 1160 FORMAT(' *** ERROR NO. OF MOTORS EXCEEDS THE LIMIT'               RNLBDA    481
     &,' OF',I4)                                                        RNLBDA    482
 1170 FORMAT(' *** ERROR INDUCTION MOTOR TYPE ERROR. TYPE = '           RNLBDA    483
     &,I2)                                                              RNLBDA    484
 1180 FORMAT(' *** ERROR NO. OF TSC LOADS EXCEEDS THE LIMIT'            RNLBDA    485
     &,' OF',I4)                                                        RNLBDA    486
C                                                                       RNLBDA    487
      END                                                               RNLBDA    488
                                                                        RNLBDA    489
