CFPRIME TMOTDA                                                          TMOTDA      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 TMOTDA(IUX)                                            TMOTDA      3
CD                                                                      TMOTDA      4
CD    TO TABULATE INDUCTION MOTOR DATA.                                 TMOTDA      5
CD                                                                      TMOTDA      6
      INCLUDE 'PARX.INS'                                                TMOTDA      7
      INCLUDE 'CNB1.INS'                                                TMOTDA      8
      INCLUDE 'CNB19.INS'                                               TMOTDA      9
      INCLUDE 'CNFLAG.INS'                                              TMOTDA     10
      INCLUDE 'CNREC1.INS'                                              TMOTDA     11
      INCLUDE 'CNNNEW.INS'                                              TMOTDA     12
      INCLUDE 'CNVOLT.INS'                                              TMOTDA     13
      INCLUDE 'CNSTN.INS'                                               TMOTDA     14
      INCLUDE 'CNPT.INS'                                                TMOTDA     15
      INCLUDE 'CNIPTR.INS'                                              TMOTDA     16
      INCLUDE 'CNMDAT.INS'                                              TMOTDA     17
      INCLUDE 'CNMPAR.INS'                                              TMOTDA     18
      INCLUDE 'CNPARX.INS'                                              TMOTDA     19
      INCLUDE 'CNXSTA.INS'                                              TMOTDA     20
      INCLUDE 'CNSPDI.INS'                                              TMOTDA     21
      INCLUDE 'CNMYVA.INS'                                              TMOTDA     22
      INCLUDE 'CNYVAR.INS'                                              TMOTDA     23
      INCLUDE 'CNQSTA.INS'                                              TMOTDA     24
      INCLUDE 'EQQSTA.INS'                                              TMOTDA     25
C                                                                       TMOTDA     26
C      COMMON /IMOTOR/DATMOT(NMT,12),TMAX(NMT),FNATF(NMT)               TMOTDA     27
      COMMON /MCUR/DATMOT(NMT,12),TMAX(NMT),FNATF(NMT)                  TMOTDA     28
C                                                                       TMOTDA     29
      CHARACTER*4 MUID                                                  TMOTDA     30
      COMPLEX VOLTG,VOLTC                                               TMOTDA     31
      DIMENSION EVOLTG(2),EVOLTC(2)                                     TMOTDA     32
      EQUIVALENCE (VOLTG,EVOLTG(1),GTREAL),(EVOLTG(2),GTIMAG)           TMOTDA     33
      EQUIVALENCE (VOLTC,EVOLTC(1),CVREAL),(EVOLTC(2),CVIMAG)           TMOTDA     34
C                                                                       TMOTDA     35
      DATA ILDEF/60/                                                    TMOTDA     36
C                                                                       TMOTDA     37
      IF (NMOTL.EQ.0) RETURN                                            TMOTDA     38
      LDEB=(JDEB(29).NE.0)                                              TMOTDA     39
      IL=ILDEF                                                          TMOTDA     40
C             ---------------------------                               TMOTDA     41
      DO 20 L=1,LBUSNO                                                  TMOTDA     42
      LK=NNEW(L)                                                        TMOTDA     43
      IF(LK.LE.0)GOTO 20                                                TMOTDA     44
      K=NTHM(2,LK)                                                      TMOTDA     45
      IF(K.LE.0)GOTO 20                                                 TMOTDA     46
C                                                                       TMOTDA     47
C             ENTER LINE 1 PRINT DO LOOP                                TMOTDA     48
C             ---------------------------                               TMOTDA     49
C                                                                       TMOTDA     50
 10   CONTINUE                                                          TMOTDA     51
      KK=NMOLD(K)                                                       TMOTDA     52
      NLF=NOLD(KK)                                                      TMOTDA     53
      MUID=NDMC(K)                                                      TMOTDA     54
      KN=KK*3                                                           TMOTDA     55
      JM=JMDAT(K)                                                       TMOTDA     56
      MOTYPK=IDDAT(JM+1)                                                TMOTDA     57
C                                                                       TMOTDA     58
      IF(IL.GE.ILDEF)THEN                                               TMOTDA     59
         WRITE(IUX,1020)                                                TMOTDA     60
         IL=5                                                           TMOTDA     61
      ENDIF                                                             TMOTDA     62
C                                                                       TMOTDA     63
      IF(MOTYPK.EQ.2.OR.MOTYPK.EQ.7)THEN                                TMOTDA     64
      WRITE(IUX,1040) NLF,INAME(KN-2),INAME(KN-1),INAME(KN),MUID        TMOTDA     65
     +,MOTYPK,IDDAT(JM+2),IDDAT(JM+4),DDAT(JM+11),DDAT(JM+12)           TMOTDA     66
     *,DDAT(JM+13)*PI/4.,(DDAT(JM+J),J=16,18),DDAT(JM+20),DDAT(JM+19)   TMOTDA     67
      ELSEIF(MOTYPK.EQ.3.OR.MOTYPK.EQ.8)THEN                            TMOTDA     68
      WRITE(IUX,1060) NLF,INAME(KN-2),INAME(KN-1),INAME(KN),MUID        TMOTDA     69
     +,MOTYPK,IDDAT(JM+2),IDDAT(JM+4),DDAT(JM+11),DDAT(JM+12)           TMOTDA     70
     *,DDAT(JM+13)*PI/4.,(DDAT(JM+J),J=16,20),DDAT(JM+32),DDAT(JM+33)   TMOTDA     71
      ELSE                                                              TMOTDA     72
      WRITE(IUX,1060) NLF,INAME(KN-2),INAME(KN-1),INAME(KN),MUID        TMOTDA     73
     +,MOTYPK,IDDAT(JM+2),IDDAT(JM+4),DDAT(JM+11),DDAT(JM+12)           TMOTDA     74
     *,DDAT(JM+13)*PI/4.,(DDAT(JM+J),J=16,20)                           TMOTDA     75
      ENDIF                                                             TMOTDA     76
      IL=IL+1                                                           TMOTDA     77
C             ---------------------------                               TMOTDA     78
      IF(NEXTIM(K).LE.0)GOTO 20                                         TMOTDA     79
      K=NEXTIM(K)                                                       TMOTDA     80
      GOTO 10                                                           TMOTDA     81
   20 CONTINUE                                                          TMOTDA     82
C             END OF LINE 1 PRINT DO LOOP                               TMOTDA     83
C             ---------------------------                               TMOTDA     84
C                                                                       TMOTDA     85
      IL=ILDEF                                                          TMOTDA     86
C             ---------------------------                               TMOTDA     87
      DO 40 L=1,LBUSNO                                                  TMOTDA     88
      LK=NNEW(L)                                                        TMOTDA     89
      IF(LK.LE.0)GOTO 40                                                TMOTDA     90
      K=NTHM(2,LK)                                                      TMOTDA     91
      IF(K.LE.0)GOTO 40                                                 TMOTDA     92
C                                                                       TMOTDA     93
C             ENTER LINE 2 PRINT DO LOOP                                TMOTDA     94
C             ---------------------------                               TMOTDA     95
C                                                                       TMOTDA     96
 30   CONTINUE                                                          TMOTDA     97
      KK=NMOLD(K)                                                       TMOTDA     98
      NLF=NOLD(KK)                                                      TMOTDA     99
      MUID=NDMC(K)                                                      TMOTDA    100
      KN=KK*3                                                           TMOTDA    101
      JM=JMDAT(K)                                                       TMOTDA    102
C                                                                       TMOTDA    103
      IF(IL.GE.ILDEF)THEN                                               TMOTDA    104
         WRITE(IUX,1220)                                                TMOTDA    105
         IL=5                                                           TMOTDA    106
      ENDIF                                                             TMOTDA    107
C                                                                       TMOTDA    108
      ILTYPE=IDDAT(JM+5)                                                TMOTDA    109
      IF (ILTYPE.EQ.1) THEN                                             TMOTDA    110
         WRITE(IUX,1240) NLF,INAME(KN-2),INAME(KN-1),INAME(KN),MUID     TMOTDA    111
     1   ,PDM(1,K)*BASPC,PDM(2,K)*BASPC,TMAX(K)*DDAT(JM+11),DDAT(JM+6)  TMOTDA    112
     2   ,ILTYPE,DDAT(JM+7),DDAT(JM+8),DDAT(JM+9),DDAT(JM+10)           TMOTDA    113
     3   ,DDAT(JM+14),DDAT(JM+15)                                       TMOTDA    114
      ELSE IF (ILTYPE.EQ.2) THEN                                        TMOTDA    115
         WRITE(IUX,1250) NLF,INAME(KN-2),INAME(KN-1),INAME(KN),MUID     TMOTDA    116
     1   ,PDM(1,K)*BASPC,PDM(2,K)*BASPC,TMAX(K)*DDAT(JM+11),DDAT(JM+6)  TMOTDA    117
     2   ,ILTYPE,DDAT(JM+7),DDAT(JM+8),DDAT(JM+9),DDAT(JM+14)           TMOTDA    118
     3   ,DDAT(JM+15)                                                   TMOTDA    119
      ELSE                                                              TMOTDA    120
         WRITE(IUX,1260) NLF,INAME(KN-2),INAME(KN-1),INAME(KN),MUID     TMOTDA    121
     1   ,PDM(1,K)*BASPC,PDM(2,K)*BASPC,TMAX(K)*DDAT(JM+11),DDAT(JM+6)  TMOTDA    122
     2   ,ILTYPE,DDAT(JM+14),DDAT(JM+15)                                TMOTDA    123
      END IF                                                            TMOTDA    124
      IL=IL+1                                                           TMOTDA    125
C             ---------------------------                               TMOTDA    126
      IF(NEXTIM(K).LE.0)GOTO 40                                         TMOTDA    127
      K=NEXTIM(K)                                                       TMOTDA    128
      GOTO 30                                                           TMOTDA    129
   40 CONTINUE                                                          TMOTDA    130
C             END OF LINE 2 PRINT DO LOOP                               TMOTDA    131
C             ---------------------------                               TMOTDA    132
C                                                                       TMOTDA    133
      IL=ILDEF                                                          TMOTDA    134
C             ---------------------------                               TMOTDA    135
      DO 60 L=1,LBUSNO                                                  TMOTDA    136
      LK=NNEW(L)                                                        TMOTDA    137
      IF(LK.LE.0)GOTO 60                                                TMOTDA    138
      K=NTHM(2,LK)                                                      TMOTDA    139
      IF(K.LE.0)GOTO 60                                                 TMOTDA    140
C                                                                       TMOTDA    141
C             ENTER LINE 3 PRINT DO LOOP                                TMOTDA    142
C             ---------------------------                               TMOTDA    143
C                                                                       TMOTDA    144
 50   CONTINUE                                                          TMOTDA    145
      KK=NMOLD(K)                                                       TMOTDA    146
      NLF=NOLD(KK)                                                      TMOTDA    147
      MUID=NDMC(K)                                                      TMOTDA    148
      KN=KK*3                                                           TMOTDA    149
      JM=JMDAT(K)                                                       TMOTDA    150
      IF(IDDAT(JM+4).EQ.0) GOTO 55                                      TMOTDA    151
      MOTYPK=IDDAT(JM+1)                                                TMOTDA    152
C                                                                       TMOTDA    153
      IF(IL.GE.ILDEF)THEN                                               TMOTDA    154
         WRITE(IUX,1120)                                                TMOTDA    155
         IL=5                                                           TMOTDA    156
      ENDIF                                                             TMOTDA    157
C                                                                       TMOTDA    158
      WRITE(IUX,1140)NLF,INAME(KN-2),INAME(KN-1),INAME(KN),MUID         TMOTDA    159
     *,(DDAT(JM+J),J=24,31),DDAT(JM+22),DDAT(JM+23)                     TMOTDA    160
      IL=IL+1                                                           TMOTDA    161
C             ---------------------------                               TMOTDA    162
   55 IF(NEXTIM(K).LE.0)GOTO 60                                         TMOTDA    163
      K=NEXTIM(K)                                                       TMOTDA    164
      GOTO 50                                                           TMOTDA    165
   60 CONTINUE                                                          TMOTDA    166
C             END OF LINE 3 PRINT DO LOOP                               TMOTDA    167
C             ---------------------------                               TMOTDA    168
C                                                                       TMOTDA    169
      RETURN                                                            TMOTDA    170
C                                                                       TMOTDA    171
 1020 FORMAT(1H1,55X,'INDUCTION MOTORS DATA',/,56X,21('='),//,'  BUS#'  TMOTDA    172
     *,' STATION NAME  MID TYPE IPFA ISAT    BMVA  BASVR   FREQ      XM'TMOTDA    173
     *,'      XS      RS      XR      RR     DBF     XR2     RR2',/     TMOTDA    174
     *,' ----- ------------',4(' ----'),' -------',2(' ------')         TMOTDA    175
     *,8(' -------'))                                                   TMOTDA    176
 1040 FORMAT(I6,1X,3A4,1X,A4,3I5,F8.2,2F7.2,3F8.4,8X,2F8.4)             TMOTDA    177
 1060 FORMAT(I6,1X,3A4,1X,A4,3I5,F8.2,2F7.2,5F8.4,8X,2F8.4)             TMOTDA    178
 1120 FORMAT(1H1,50X,'INDUCTION MOTORS DATA (CONTINUE)',/,51X,32('='),//TMOTDA    179
     *,'  BUS# STATION NAME  MID ISAT     XS0     XR0     CS0     CR0'  TMOTDA    180
     *,'      V1      V2      G1      G2      DR      DS',/             TMOTDA    181
     *,' ----- ------------ ---- ----',10(' -------'))                  TMOTDA    182
 1140 FORMAT(I6,1X,3A4,1X,A4,I5,10F8.4)                                 TMOTDA    183
 1220 FORMAT(1H1,50X,'INDUCTION MOTORS DATA (CONTINUE)',/,51X,32('='),//TMOTDA    184
     *,'  BUS# STATION NAME  MID      MW      MX    TMAX      HM'       TMOTDA    185
     *,'  ILTYPE     N/A     M/B    K1/C      K2      VI      TI',/     TMOTDA    186
     *,' ----- ------------ ----',11(' -------'))                       TMOTDA    187
 1240 FORMAT(I6,1X,3A4,1X,A4,3F8.2,F8.3,I8,2F8.3,3F8.4,F8.3)            TMOTDA    188
 1250 FORMAT(I6,1X,3A4,1X,A4,3F8.2,F8.3,I8,3F8.3,8X,F8.4,F8.3)          TMOTDA    189
 1260 FORMAT(I6,1X,3A4,1X,A4,3F8.2,F8.3,I8,32X,F8.4,F8.3)               TMOTDA    190
C                                                                       TMOTDA    191
C  -----------------------------------------                            TMOTDA    192
C                                                                       TMOTDA    193
      ENTRY TMOTIN(IUX)                                                 TMOTDA    194
CD                                                                      TMOTDA    195
CD    TO TABULATE THE INITIAL CONDITIONS OF INDUCTION MOTORS.           TMOTDA    196
CD                                                                      TMOTDA    197
      IL=ILDEF                                                          TMOTDA    198
      IF (NMOTL.EQ.0) GO TO 140                                         TMOTDA    199
C                                                                       TMOTDA    200
      DO 120 L=1,LBUSNO                                                 TMOTDA    201
      LK=NNEW(L)                                                        TMOTDA    202
      IF(LK.LE.0)GOTO 120                                               TMOTDA    203
      K=NTHM(2,LK)                                                      TMOTDA    204
      IF(K.LE.0)GOTO 120                                                TMOTDA    205
 110  CONTINUE                                                          TMOTDA    206
      KK=NMOLD(K)                                                       TMOTDA    207
      MUID=NDMC(K)                                                      TMOTDA    208
      NLF=NOLD(KK)                                                      TMOTDA    209
      KN=KK*3                                                           TMOTDA    210
      JM=JMDAT(K)                                                       TMOTDA    211
      JZT=JXIMO(K)                                                      TMOTDA    212
      JY=JVIMO(K)                                                       TMOTDA    213
      VOLTG=VOLT(KK)                                                    TMOTDA    214
      VANG=ATAN2(GTIMAG,GTREAL)*57.29578                                TMOTDA    215
      VMAG=GTREAL**2+GTIMAG**2                                          TMOTDA    216
      GTV=SQRT(VMAG)                                                    TMOTDA    217
      CM=SQRT(CDM(JY+8)**2+CQM(JY+9)**2)                                TMOTDA    218
      MTYP=IDDAT(JM+1)                                                  TMOTDA    219
      IF(IL.GE.ILDEF)THEN                                               TMOTDA    220
         IL=6                                                           TMOTDA    221
         WRITE(IUX,1360)                                                TMOTDA    222
      ENDIF                                                             TMOTDA    223
      IF(MTYP.LE.5)THEN                                                 TMOTDA    224
      WRITE(IUX,1380)NLF,INAME(KN-2),INAME(KN-1),INAME(KN),MUID,MTYP    TMOTDA    225
     +,GTV,VANG,PDM(1,K)*BASPC,PDM(2,K)*BASPC,TLM(JY+2)*BASPC,CDM(JY+8) TMOTDA    226
     +,CQM(JY+9),CM,DDAT(JM+22),DDAT(JM+23),(XSTATE(JZT+LL),LL=1,3)     TMOTDA    227
      ELSE                                                              TMOTDA    228
      WRITE(IUX,1380)NLF,INAME(KN-2),INAME(KN-1),INAME(KN),MUID,MTYP    TMOTDA    229
     +,GTV,VANG,PDM(1,K)*BASPC,PDM(2,K)*BASPC,TLM(JY+2)*BASPC,CDM(JY+8) TMOTDA    230
     +,CQM(JY+9),CM,DDAT(JM+22),DDAT(JM+23),VC1D(JY+10),VC1Q(JY+11)     TMOTDA    231
     *,XSTATE(JZT+1)                                                    TMOTDA    232
      ENDIF                                                             TMOTDA    233
      IL=IL+1                                                           TMOTDA    234
C                                                                       TMOTDA    235
      IF(NEXTIM(K).LE.0)GOTO 120                                        TMOTDA    236
      K=NEXTIM(K)                                                       TMOTDA    237
      GOTO 110                                                          TMOTDA    238
  120 CONTINUE                                                          TMOTDA    239
C                                                                       TMOTDA    240
  140 CONTINUE                                                          TMOTDA    241
C                                                                       TMOTDA    242
      RETURN                                                            TMOTDA    243
C                                                                       TMOTDA    244
 1360 FORMAT(1H1,47X,'INDUCTION MOTORS INITIAL CONDITIONS',/,48X,35('=')TMOTDA    245
     *,//,'  BUS# STATION NAME  MID TYPE    VMAG   VANG     MW     MX'  TMOTDA    246
     *,'    TMEC     CR     CI     CM     DR     DS    V''D    V''Q'    TMOTDA    247
     *,'   SLIP',/,' ----- ------------ ---- ---- -------',4(' ------') TMOTDA    248
     *,'-',8(' ------'))                                                TMOTDA    249
 1380 FORMAT(I6,1X,3A4,1X,A4,I5,F8.3,F7.2,2F7.1,F8.2,8F7.3)             TMOTDA    250
      END                                                               TMOTDA    251
