CFPRIME LIMODA                                                          LIMODA      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 LIMODA(ICODE,IEBK)                                     LIMODA      3
CD                                                                      LIMODA      4
CD    TO LOAD INDUCTION MOTOR DATA FROM ARRAYS JJMDAT AND TDDAT TO      LIMODA      5
CD    ARRAYS JMDAT AND DDAT.                                            LIMODA      6
CD                                                                      LIMODA      7
      INCLUDE 'PARX.INS'                                                LIMODA      8
      INCLUDE 'CNPT.INS'                                                LIMODA      9
      INCLUDE 'CNB1.INS'                                                LIMODA     10
      INCLUDE 'CNMDAT.INS'                                              LIMODA     11
      INCLUDE 'CNMPAR.INS'                                              LIMODA     12
      INCLUDE 'CNB19.INS'                                               LIMODA     13
      INCLUDE 'CNFLAG.INS'                                              LIMODA     14
      INCLUDE 'CNIPTR.INS'                                              LIMODA     15
      INCLUDE 'CNPARX.INS'                                              LIMODA     16
      INCLUDE 'CNREN.INS'                                               LIMODA     17
      INCLUDE 'CNLFDA.INS'                                              LIMODA     18
      INCLUDE 'CNMNEW.INS'                                              LIMODA     19
      INCLUDE 'CNJPT.INS'                                               LIMODA     20
      INCLUDE 'CNTMDA.INS'                                              LIMODA     21
      INCLUDE 'CNTGED.INS'                                              LIMODA     22
      INCLUDE 'CNJDAT.INS'                                              LIMODA     23
      INCLUDE 'CNMSG.INS'                                               LIMODA     24
      INCLUDE 'CNLSMB.INS'                                              LIMODA     25
C                                                                       LIMODA     26
      LDEB=(JDEB(7).NE.0)                                               LIMODA     27
C                                                                       LIMODA     28
C   LOADING INDUCTION MOTOR DATA                                        LIMODA     29
C                                                                       LIMODA     30
C     NOTE : NLF > 0  ----  NORMAL MOTORS                               LIMODA     31
C            NLF < 0  ----  MOTORS IN CLOADS (BY BUS ONLY)              LIMODA     32
C                           MOTORS IN CLOADS BY RANGE IS LOADED         LIMODA     33
C                           IN LNLBDA                                   LIMODA     34
C                                                                       LIMODA     35
C            NTYPE > 0 --- MACHINE I/S                                  LIMODA     36
C            NTYPE < 0 --- MACHINE O/S                                  LIMODA     37
C                                                                       LIMODA     38
      DO 130 JM=1,JMOTL                                                 LIMODA     39
      NLF=JMOTB(JM)                                                     LIMODA     40
      NPROG=MNEW(IABS(NLF))                                             LIMODA     41
      IF(NPROG.EQ.0)GOTO 130                                            LIMODA     42
      IF(JBSTAT(NPROG).GT.2)GOTO 130                                    LIMODA     43
      IF (NLF.EQ.0) GOTO 130                                            LIMODA     44
      NMOTL=NMOTL+1                                                     LIMODA     45
      IF(NMOTL.GT.NXMT)GOTO 120                                         LIMODA     46
      NMOTB(NMOTL)=NLF                                                  LIMODA     47
      NDMC(NMOTL)=INDMID(JM)                                            LIMODA     48
      LTN=JJMDAT(JM)                                                    LIMODA     49
      JMDAT(NMOTL)=JLN                                                  LIMODA     50
      NTYPE=ITDDAT(LTN+1)                                               LIMODA     51
      IF (NLF.GT.0) THEN                                                LIMODA     52
         IDDAT(JLN+1)=NTYPE                                             LIMODA     53
      ELSE                                                              LIMODA     54
C         IDDAT(JLN+1)=NTYPE+10                                         LIMODA     55
         IDDAT(JLN+1)=ISIGN(IABS(NTYPE)+10,NTYPE)                       LIMODA     56
         IWS1=IABS(NLF)                                                 LIMODA     57
         IF (ITDDAT(LTN+29).EQ.1) THEN                                  LIMODA     58
            NLFLMB(IWS1)=NMOTL                                          LIMODA     59
C            IDDAT(JLN+35)=1                                            LIMODA     60
            IDDAT(JLN+36)=1                                             LIMODA     61
         ELSE                                                           LIMODA     62
            NLFSMB(IWS1)=NMOTL                                          LIMODA     63
C            IDDAT(JLN+35)=2                                            LIMODA     64
            IDDAT(JLN+36)=2                                             LIMODA     65
         END IF                                                         LIMODA     66
      END IF                                                            LIMODA     67
      IDDAT(JLN+2)=ITDDAT(LTN+2)                                        LIMODA     68
      IDDAT(JLN+4)=ITDDAT(LTN+3)                                        LIMODA     69
      IDDAT(JLN+5)=ITDDAT(LTN+4)                                        LIMODA     70
      DDAT(JLN+6)=TDDAT(LTN+10)                                         LIMODA     71
      DDAT(JLN+7)=TDDAT(LTN+14)                                         LIMODA     72
      DDAT(JLN+8)=TDDAT(LTN+15)                                         LIMODA     73
      DDAT(JLN+10)=TDDAT(LTN+16)                                        LIMODA     74
      DDAT(JLN+11)=TDDAT(LTN+11)                                        LIMODA     75
      DDAT(JLN+12)=TDDAT(LTN+12)                                        LIMODA     76
      DDAT(JLN+13)=TDDAT(LTN+13)                                        LIMODA     77
      DDAT(JLN+14)=TDDAT(LTN+17)                                        LIMODA     78
      DDAT(JLN+15)=TDDAT(LTN+18)                                        LIMODA     79
      DDAT(JLN+16)=TDDAT(LTN+5)                                         LIMODA     80
      DDAT(JLN+17)=TDDAT(LTN+6)                                         LIMODA     81
      DDAT(JLN+18)=TDDAT(LTN+7)                                         LIMODA     82
      DDAT(JLN+19)=TDDAT(LTN+8)                                         LIMODA     83
      DDAT(JLN+20)=TDDAT(LTN+9)                                         LIMODA     84
      DDAT(JLN+24)=TDDAT(LTN+19)                                        LIMODA     85
      DDAT(JLN+25)=TDDAT(LTN+20)                                        LIMODA     86
      DDAT(JLN+26)=TDDAT(LTN+21)                                        LIMODA     87
      DDAT(JLN+27)=TDDAT(LTN+22)                                        LIMODA     88
      DDAT(JLN+28)=TDDAT(LTN+23)                                        LIMODA     89
      DDAT(JLN+29)=TDDAT(LTN+24)                                        LIMODA     90
      DDAT(JLN+30)=TDDAT(LTN+25)                                        LIMODA     91
      DDAT(JLN+31)=TDDAT(LTN+26)                                        LIMODA     92
      IF (NTYPE.EQ.3.OR.NTYPE.EQ.8) THEN                                LIMODA     93
         DDAT(JLN+32)=TDDAT(LTN+27)                                     LIMODA     94
         DDAT(JLN+33)=TDDAT(LTN+28)                                     LIMODA     95
      END IF                                                            LIMODA     96
      IF(IDDAT(JLN+5).GT.3)THEN                                         LIMODA     97
        IDDAT(JLN+36)=ITDDAT(LTN+29)                                    LIMODA     98
        IDDAT(JLN+37)=ITDDAT(LTN+30)                                    LIMODA     99
        IDDAT(JLN+38)=ITDDAT(LTN+31)                                    LIMODA    100
      ENDIF                                                             LIMODA    101
C                                                                       LIMODA    102
      IF (IDDAT(JLN+11).EQ.0) DDAT(JLN+11)=BASPC                        LIMODA    103
      IF (IDDAT(JLN+12).EQ.0) DDAT(JLN+12)=1.0                          LIMODA    104
      IF (IDDAT(JLN+13).EQ.0) THEN                                      LIMODA    105
         DDAT(JLN+13)=WOBASE                                            LIMODA    106
      ELSE                                                              LIMODA    107
         DDAT(JLN+13)=DDAT(JLN+13)*4.0/PI                               LIMODA    108
      END IF                                                            LIMODA    109
C                                                                       LIMODA    110
      IF (NLF.GT.0) THEN                                                LIMODA    111
C         JLN=JLN+34                                                    LIMODA    112
        IF(IDDAT(JLN+5).GT.3)THEN                                       LIMODA    113
         JLN=JLN+38                                                     LIMODA    114
        ELSE                                                            LIMODA    115
         JLN=JLN+35                                                     LIMODA    116
        ENDIF                                                           LIMODA    117
      ELSE                                                              LIMODA    118
C         JLN=JLN+39                                                    LIMODA    119
         JLN=JLN+40                                                     LIMODA    120
      END IF                                                            LIMODA    121
      CALL MCHECK (NLF,13,JLN,'LIMODA')                                 LIMODA    122
      GOTO 130                                                          LIMODA    123
  120 CONTINUE                                                          LIMODA    124
      IF(KLFO.EQ.0)THEN                                                 LIMODA    125
      WRITE(MSG(1),1020) NLF,NXMT                                       LIMODA    126
      CALL PRTMSG(1)                                                    LIMODA    127
      ELSE                                                              LIMODA    128
      K=MNEW(NLF)                                                       LIMODA    129
      KK=K*8                                                            LIMODA    130
      WRITE(MSG(1),1030) NAMES(KK-2),NAMES(KK-1),NAMES(KK),NXMT         LIMODA    131
      CALL PRTMSG(1)                                                    LIMODA    132
      ENDIF                                                             LIMODA    133
      IEBK=2                                                            LIMODA    134
      GOTO 130                                                          LIMODA    135
C                                                                       LIMODA    136
  130 CONTINUE                                                          LIMODA    137
C                                                                       LIMODA    138
      IF(IEBK.EQ.0)RETURN                                               LIMODA    139
C                                                                       LIMODA    140
      MSG(1)='LIMODA: INDUCTION MOTOR DATA ERROR'                       LIMODA    141
      CALL ASTOP(MSG(1),34)                                             LIMODA    142
C                                                                       LIMODA    143
 1020 FORMAT(' *** ERROR MOTOR ON BUS ',I4,' EXCEEDS THE LIMIT OF',I4)  LIMODA    144
 1030 FORMAT(' *** ERROR MOTOR ON BUS ',3A4,' EXCEEDS THE LIMIT OF',I5) LIMODA    145
C                                                                       LIMODA    146
      END                                                               LIMODA    147
