CFPRIME WDYNDA                                                          WDYNDA      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 WDYNDA(FILENA,LENPAR,IUY,KLAYER)                       WDYNDA      3
CD                                                                      WDYNDA      4
CD    THIS IS THE MAIN DRIVER TO WRITE THE DYNAMIC DATA TO A            WDYNDA      5
CD    USER SPECIFIED FILE.                                              WDYNDA      6
CD                                                                      WDYNDA      7
      INCLUDE 'PARX.INS'                                                WDYNDA      8
      INCLUDE 'CNB0.INS'                                                WDYNDA      9
      INCLUDE 'CNPT.INS'                                                WDYNDA     10
      INCLUDE 'CNREN.INS'                                               WDYNDA     11
      INCLUDE 'CNMNEW.INS'                                              WDYNDA     12
      INCLUDE 'CNB19.INS'                                               WDYNDA     13
      INCLUDE 'CNFLAG.INS'                                              WDYNDA     14
      INCLUDE 'CNLSTA.INS'                                              WDYNDA     15
      INCLUDE 'CNJPT.INS'                                               WDYNDA     16
      INCLUDE 'CNJDAT.INS'                                              WDYNDA     17
      INCLUDE 'CNLUN.INS'                                               WDYNDA     18
      INCLUDE 'CNUNIT.INS'                                              WDYNDA     19
      INCLUDE 'CNULTC.INS'                                              WDYNDA     20
      INCLUDE 'CNFRUN.INS'                                              WDYNDA     21
      INCLUDE 'CNMSG.INS'                                               WDYNDA     22
C                                                                       WDYNDA     23
C                                                                       WDYNDA     24
      CHARACTER*80 EMSG,STRING,TITLE(6)                                 WDYNDA     25
      CHARACTER*12 BUSNAM,CASEID                                        WDYNDA     26
C                                                                       WDYNDA     27
      CHARACTER*7 SUBPMT                                                WDYNDA     28
      CHARACTER*50 FILENA, LFILE                                        WDYNDA     29
C                                                                       WDYNDA     30
      CHARACTER*5 DESC,BSTA,CIBUS,EDATA,IEND                            WDYNDA     31
      CHARACTER*12 BUSR1(5)                                             WDYNDA     32
      DIMENSION NIBL(16)                                                WDYNDA     33
C                                                                       WDYNDA     34
      EQUIVALENCE (TITLE(1), ITITLE(1,1))                               WDYNDA     35
      EQUIVALENCE (CASEID, ICASID(1))                                   WDYNDA     36
C                                                                       WDYNDA     37
      DATA DESC/' DESC'/,BSTA/' BSTA'/,EDATA/'EDATA'/,                  WDYNDA     38
     +     CIBUS/' IBUS'/,IEND/'  END'/                                 WDYNDA     39
C                                                                       WDYNDA     40
C                                                                       WDYNDA     41
      LDEB=(JDEB(4).NE.0)                                               WDYNDA     42
C                                                                       WDYNDA     43
      SUBPMT='       '                                                  WDYNDA     44
      IEBK=0                                                            WDYNDA     45
C                                                                       WDYNDA     46
      WRITE(LOUT,*)                                                     WDYNDA     47
      WRITE(LOUT,*) ' *** WARNING ONLY AC DYNAMIC DATA CAN BE EXPORTED' WDYNDA     48
      WRITE(LOUT,*) '     IN THE NEW DYNAMIC DATA FILE. MTDC DATA WILL' WDYNDA     49
      WRITE(LOUT,*) '     BE IGNORED AND MUST BE SEPARATELY INCLUDED',  WDYNDA     50
     *              ' INTO'                                             WDYNDA     51
      WRITE(LOUT,*) '     THE NEW DYNAMIC DATA FILE.'                   WDYNDA     52
      WRITE(LOUT,*)                                                     WDYNDA     53
C                                                                       WDYNDA     54
      STRING='ENTER THE NEW DYNAMIC DATA FILE NAME:'                    WDYNDA     55
      EMSG  ='ERROR IN OPENING THE NEW DYNAMIC DATA FILE'               WDYNDA     56
C                                                                       WDYNDA     57
C     SET IKEY FOR UNKNOWN FILE                                         WDYNDA     58
C                                                                       WDYNDA     59
      IKEY=10                                                           WDYNDA     60
      JLENG=0                                                           WDYNDA     61
C                                                                       WDYNDA     62
      WRITE(LOUT,*)                                                     WDYNDA     63
C                                                                       WDYNDA     64
      IF(CFLRUN)THEN                                                    WDYNDA     65
        CALL PARSIU (FILENA, LEN, IU, LO)                               WDYNDA     66
        IF (IU .LT. 0) RETURN                                           WDYNDA     67
        IF (IU .GT. 0) THEN                                             WDYNDA     68
          LFILE = FILENA(1:LO)                                          WDYNDA     69
          FILENA = LFILE                                                WDYNDA     70
          IU57 = IU                                                     WDYNDA     71
          CALL FBOKEP (IU57, IBACK)                                     WDYNDA     72
          IF (IBACK .LT. 0) RETURN                                      WDYNDA     73
        ENDIF                                                           WDYNDA     74
        LO = INDEX (FILENA, ' ')                                        WDYNDA     75
        CALL OPENRE (IU57, FILENA, JLENG, IKEY, ISTAT, LO)              WDYNDA     76
        IF (ISTAT .NE. 0) THEN                                          WDYNDA     77
          MSG(1) = ' *** ERROR IN OPENING THE NEW DYNAMIC DATA FILE'    WDYNDA     78
          CALL PRTMSG(1)                                                WDYNDA     79
          RETURN                                                        WDYNDA     80
        ELSE                                                            WDYNDA     81
          LUNITS(IU57) = .TRUE.                                         WDYNDA     82
        ENDIF                                                           WDYNDA     83
      ELSE                                                              WDYNDA     84
        CALL FILEMG(IU57,37,STRING,42,EMSG,SUBPMT,IKEY,JLENG,IEBK)      WDYNDA     85
        IF(IEBK.NE.0)RETURN                                             WDYNDA     86
      ENDIF                                                             WDYNDA     87
C                                                                       WDYNDA     88
        IUX=IU57                                                        WDYNDA     89
C                                                                       WDYNDA     90
      WRITE(LOUT,'(/A/)')                                               WDYNDA     91
     &'  WRITING NEW AC DYNAMIC DATA FILE.  WAIT ...'                   WDYNDA     92
C                                                                       WDYNDA     93
      IF(JNT.EQ.0)THEN                                                  WDYNDA     94
         MSG(1)=' NO GENERATOR HAS BEEN READ REQUEST HAS BEEN IGNORED'  WDYNDA     95
         CALL PRTMSG(1)                                                 WDYNDA     96
         RETURN                                                         WDYNDA     97
      ENDIF                                                             WDYNDA     98
C                                                                       WDYNDA     99
CD                                                                      WDYNDA    100
CD    STEP 1. WRITE CASE ID AND TITLES                                  WDYNDA    101
CD                                                                      WDYNDA    102
      WRITE(IUX,'(A5)') DESC                                            WDYNDA    103
      IF(CASEID.EQ.' ') CASEID='CASE ID'                                WDYNDA    104
      IF(TITLE(1).EQ.' '.AND.TITLE(2).EQ.' '.AND.TITLE(3).EQ.' '.AND.   WDYNDA    105
     +   TITLE(4).EQ.' '.AND.TITLE(5).EQ.' '.AND.TITLE(6).EQ.' ')THEN   WDYNDA    106
        TITLE(1)='TITLE - 1'                                            WDYNDA    107
        TITLE(2)='TITLE - 2'                                            WDYNDA    108
        TITLE(3)='TITLE - 3'                                            WDYNDA    109
        TITLE(4)='TITLE - 4'                                            WDYNDA    110
        TITLE(5)='TITLE - 5'                                            WDYNDA    111
        TITLE(6)='TITLE - 6'                                            WDYNDA    112
      ENDIF                                                             WDYNDA    113
      WRITE(IUX,'(A12)') CASEID                                         WDYNDA    114
      DO 100 II=1,6                                                     WDYNDA    115
        WRITE(IUX,'(A80)') TITLE(II)                                    WDYNDA    116
100   CONTINUE                                                          WDYNDA    117
      WRITE(IUX,'(A5)') EDATA                                           WDYNDA    118
CD                                                                      WDYNDA    119
CD    STEP 2. WRITE BSTA                                                WDYNDA    120
CD                                                                      WDYNDA    121
      IF(IBGSTA.NE.0)THEN                                               WDYNDA    122
        WRITE(IUX,'(A5)') BSTA                                          WDYNDA    123
        WRITE(IUX,'(I5)') 1                                             WDYNDA    124
        WRITE(IUX,'(A5)') EDATA                                         WDYNDA    125
      ENDIF                                                             WDYNDA    126
CD                                                                      WDYNDA    127
CD    STEP 3. WRITE GENERATOR DATA.                                     WDYNDA    128
CD                                                                      WDYNDA    129
      IF(JNT.NE.0)THEN                                                  WDYNDA    130
      WRITE(LOUT,1000)                                                  WDYNDA    131
      CALL WDGEDA(ICODE,IUX,IUY,IEBK)                                   WDYNDA    132
      WRITE(LOUT,1010) JNT                                              WDYNDA    133
      ENDIF                                                             WDYNDA    134
C                                                                       WDYNDA    135
 120  CONTINUE                                                          WDYNDA    136
CD                                                                      WDYNDA    137
CD    STEP 4. WRITE INFINITE BUS DATA.                                  WDYNDA    138
CD                                                                      WDYNDA    139
C                                                                       WDYNDA    140
      IF(JIFBUS.NE.0)THEN                                               WDYNDA    141
C                                                                       WDYNDA    142
      WRITE(LOUT,1040)                                                  WDYNDA    143
      WRITE(IUX,1250) CIBUS                                             WDYNDA    144
C                                                                       WDYNDA    145
      NITEM=JIFBUS                                                      WDYNDA    146
C                                                                       WDYNDA    147
      JL=0                                                              WDYNDA    148
C                                                                       WDYNDA    149
      IF(KLFO.EQ.0)THEN                                                 WDYNDA    150
C                                                                       WDYNDA    151
C   BUS NUMBER CASE                                                     WDYNDA    152
C                                                                       WDYNDA    153
 210  IFIN=MIN0(NITEM,16)                                               WDYNDA    154
      DO 220 J=1,IFIN                                                   WDYNDA    155
      JL=JL+J                                                           WDYNDA    156
      NIBL(J)=NIFBUS(JL)                                                WDYNDA    157
 220  CONTINUE                                                          WDYNDA    158
      WRITE(IUX,1230)(NIBL(J),J=1,IFIN)                                 WDYNDA    159
      NITEM=NITEM-IFIN                                                  WDYNDA    160
      IF(NITEM.GT.0)GOTO 210                                            WDYNDA    161
C                                                                       WDYNDA    162
      ELSE                                                              WDYNDA    163
C                                                                       WDYNDA    164
C   BUS NAME CASE                                                       WDYNDA    165
C                                                                       WDYNDA    166
 240  IFIN=MIN0(NITEM,5)                                                WDYNDA    167
      DO 250 J=1,IFIN                                                   WDYNDA    168
      JL=JL+J                                                           WDYNDA    169
      NLF=NIFBUS(JL)                                                    WDYNDA    170
      CALL CHKNAM(BUSNAM,NLF)                                           WDYNDA    171
      BUSR1(J)=BUSNAM                                                   WDYNDA    172
 250  CONTINUE                                                          WDYNDA    173
      WRITE(IUX,1240) (BUSR1(J),J=1,IFIN)                               WDYNDA    174
      NITEM=NITEM-IFIN                                                  WDYNDA    175
      IF(NITEM.GT.0)GOTO 240                                            WDYNDA    176
C                                                                       WDYNDA    177
      ENDIF                                                             WDYNDA    178
C                                                                       WDYNDA    179
      WRITE(IUX,1250) EDATA                                             WDYNDA    180
      WRITE(LOUT,1050) JIFBUS                                           WDYNDA    181
C                                                                       WDYNDA    182
      ENDIF                                                             WDYNDA    183
C                                                                       WDYNDA    184
CD                                                                      WDYNDA    185
CD    STEP 5. WRITE INDUCTION MOTOR DATA.                               WDYNDA    186
CD                                                                      WDYNDA    187
      IF(JMOTL.NE.0)THEN                                                WDYNDA    188
      WRITE(LOUT,1060)                                                  WDYNDA    189
      CALL WIMODA(IUX,IUY,IEBK)                                         WDYNDA    190
         WRITE(LOUT,1070) JMOTL                                         WDYNDA    191
      ENDIF                                                             WDYNDA    192
CD                                                                      WDYNDA    193
CD    STEP 6. WRITE SVC DATA.                                           WDYNDA    194
CD                                                                      WDYNDA    195
      IF (JSVC.NE.0) THEN                                               WDYNDA    196
         WRITE(LOUT,1080)                                               WDYNDA    197
         CALL WSVCDA(IUX,IUY,IEBK)                                      WDYNDA    198
         WRITE(LOUT,1090) JSVC                                          WDYNDA    199
      ENDIF                                                             WDYNDA    200
C                                                                       WDYNDA    201
CD                                                                      WDYNDA    202
CD    STEP 7. WRITE ULTC DATA.                                          WDYNDA    203
CD                                                                      WDYNDA    204
      IF (NULTC .NE. 0) THEN                                            WDYNDA    205
         WRITE(LOUT,1190)                                               WDYNDA    206
         CALL WULTCD(IUX,IUY,IEBK)                                      WDYNDA    207
         WRITE(LOUT,1200) NULTC                                         WDYNDA    208
      ENDIF                                                             WDYNDA    209
C                                                                       WDYNDA    210
CD                                                                      WDYNDA    211
CD    STEP 8. WRITE RANI DATA.                                          WDYNDA    212
CD                                                                      WDYNDA    213
      IF(JRANI.NE.0)THEN                                                WDYNDA    214
      WRITE(LOUT,1100)                                                  WDYNDA    215
      CALL WRANDA(IUX,IUY,IEBK)                                         WDYNDA    216
      WRITE(LOUT,1110) JRANI                                            WDYNDA    217
      ENDIF                                                             WDYNDA    218
CD                                                                      WDYNDA    219
CD    STEP 9. WRITE STP DATA.                                           WDYNDA    220
CD                                                                      WDYNDA    221
      IF(JTCPS.NE.0)THEN                                                WDYNDA    222
      WRITE(LOUT,1120)                                                  WDYNDA    223
      CALL WSTPDA(IUX,IUY,IEBK)                                         WDYNDA    224
      WRITE(LOUT,1130) JTCPS                                            WDYNDA    225
      ENDIF                                                             WDYNDA    226
C                                                                       WDYNDA    227
CD                                                                      WDYNDA    228
CD    STEP 10. WRITE SDB DATA.                                          WDYNDA    229
CD                                                                      WDYNDA    230
      IF(JSDB.NE.0)THEN                                                 WDYNDA    231
      WRITE(LOUT,1140)                                                  WDYNDA    232
      CALL WSDBDA(IUX,IUY,IEBK)                                         WDYNDA    233
      WRITE(LOUT,1150) JSDB                                             WDYNDA    234
      ENDIF                                                             WDYNDA    235
C                                                                       WDYNDA    236
CD                                                                      WDYNDA    237
CD    STEP 11. WRITE NONLINEAR LOAD DATA.                               WDYNDA    238
CD                                                                      WDYNDA    239
      IF(JNLD.NE.0)THEN                                                 WDYNDA    240
      WRITE(LOUT,1160)                                                  WDYNDA    241
      CALL WNLBDA(IUX,IUY,IEBK)                                         WDYNDA    242
      WRITE(LOUT,1170) JNLD                                             WDYNDA    243
      ENDIF                                                             WDYNDA    244
C                                                                       WDYNDA    245
 440  CONTINUE                                                          WDYNDA    246
C    ..........................................................         WDYNDA    247
C                                                                       WDYNDA    248
      WRITE(LOUT,1180)                                                  WDYNDA    249
      WRITE(IUX,1250) IEND                                              WDYNDA    250
C                                                                       WDYNDA    251
      RETURN                                                            WDYNDA    252
C                                                                       WDYNDA    253
 1000 FORMAT(/,' WRITING GENERATOR DATA:')                              WDYNDA    254
 1010 FORMAT(1X,I5,2X,'SETS OF GENERATOR DATA HAVE BEEN WRITTEN',//)    WDYNDA    255
 1040 FORMAT(' WRITING INFINITE BUS DATA:')                             WDYNDA    256
 1050 FORMAT(1X,I5,2X,'INFINITE BUSES HAVE BEEN WRITTEN',//)            WDYNDA    257
 1060 FORMAT(' WRITING INDUCTION MOTOR DATA:')                          WDYNDA    258
 1070 FORMAT(1X,I5,2X,'SETS OF INDUCTION MOTOR DATA HAVE BEEN WRITTEN'  WDYNDA    259
     &,//)                                                              WDYNDA    260
 1080 FORMAT(' WRITING SVC DATA:')                                      WDYNDA    261
 1090 FORMAT(1X,I5,2X,'SETS OF SVC DATA HAVE BEEN WRITTEN',//)          WDYNDA    262
 1100 FORMAT(' WRITING RANI DATA:')                                     WDYNDA    263
 1110 FORMAT(1X,I5,2X,'SETS OF RANI DATA HAVE BEEN WRITTEN',//)         WDYNDA    264
 1120 FORMAT(' WRITING STP DATA:')                                      WDYNDA    265
 1130 FORMAT(1X,I5,2X,'SETS OF STP DATA HAVE BEEN WRITTEN',//)          WDYNDA    266
 1140 FORMAT(' WRITING SDB DATA:')                                      WDYNDA    267
 1150 FORMAT(1X,I5,2X,'SETS OF SDB DATA HAVE BEEN WRITTEN',//)          WDYNDA    268
 1160 FORMAT(' WRITING NONLINEAR LOAD DATA:')                           WDYNDA    269
 1170 FORMAT(1X,I5,2X,                                                  WDYNDA    270
     &'SETS OF NONLINEAR LOAD BUS DATA HAVE BEEN WRITTEN',//)           WDYNDA    271
 1180 FORMAT(' ALL DYNAMIC DATA HAVE BEEN WRITTEN',/)                   WDYNDA    272
 1190 FORMAT(' WRITING ULTC DATA:')                                     WDYNDA    273
 1200 FORMAT(1X,I5,2X,'SETS OF ULTC DATA HAVE BEEN WRITTEN',//)         WDYNDA    274
 1230 FORMAT(16I5)                                                      WDYNDA    275
 1240 FORMAT(5A12)                                                      WDYNDA    276
 1250 FORMAT(A5)                                                        WDYNDA    277
C                                                                       WDYNDA    278
      END                                                               WDYNDA    279
C                                                                       WDYNDA    280
      SUBROUTINE WDGEDA(ICODE,IUX,IUY,IEBK)                             WDYNDA    281
CD                                                                      WDYNDA    282
CD    THIS ROUTINE WRITES GENERATOR DYNAMIC DATA IN PROGRAM FORMAT TO   WDYNDA    283
CD    A USER SPECIFIED FILE.                                            WDYNDA    284
CD                                                                      WDYNDA    285
CD    ROUTINE INPUT:                                                    WDYNDA    286
CD                                                                      WDYNDA    287
CD    ICODE - NOT USED IN THE PRESENT VERSION                           WDYNDA    288
CD    IUX IS THE LOGICAL UNIT OF WHICH GENERATOR DATA ARE TO BE WRITTEN WDYNDA    289
CD    IUY IS THE UNIT NUMBER FOR ERROR MESSAGES                         WDYNDA    290
CD                                                                      WDYNDA    291
CD                                                                      WDYNDA    292
      INCLUDE 'PARX.INS'                                                WDYNDA    293
      INCLUDE 'CNPT.INS'                                                WDYNDA    294
      INCLUDE 'CNFLAG.INS'                                              WDYNDA    295
      INCLUDE 'CNB19.INS'                                               WDYNDA    296
      INCLUDE 'CNPARX.INS'                                              WDYNDA    297
      INCLUDE 'CNPBK.INS'                                               WDYNDA    298
      INCLUDE 'CNUNIT.INS'                                              WDYNDA    299
      INCLUDE 'CNUDM.INS'                                               WDYNDA    300
      INCLUDE 'CNMNEW.INS'                                              WDYNDA    301
      INCLUDE 'CNJPT.INS'                                               WDYNDA    302
      INCLUDE 'CNJDAT.INS'                                              WDYNDA    303
      INCLUDE 'CNTMDA.INS'                                              WDYNDA    304
      INCLUDE 'CNGSRC.INS'                                              WDYNDA    305
      INCLUDE 'CNTGED.INS'                                              WDYNDA    306
      INCLUDE 'CNMSG.INS'                                               WDYNDA    307
C                                                                       WDYNDA    308
      CHARACTER*4 NGRI                                                  WDYNDA    309
      CHARACTER*12 BUSNAM,BUSR1,BUSR2,LPGNAM                            WDYNDA    310
      CHARACTER*5 DGEN,EDATA                                            WDYNDA    311
      CHARACTER*4 LPGID                                                 WDYNDA    312
C                                                                       WDYNDA    313
      EQUIVALENCE (ILPGID,LPGID)                                        WDYNDA    314
C                                                                       WDYNDA    315
      DATA DGEN/' DGEN'/,EDATA/'EDATA'/                                 WDYNDA    316
C                                                                       WDYNDA    317
      LDEB=(JDEB(6).NE.0)                                               WDYNDA    318
C                                                                       WDYNDA    319
CD                                                                      WDYNDA    320
CD  IGEN = 0 GENERATOR DATA IN IMPEDANCE AND TIME CONSTANT FORM         WDYNDA    321
CD       = 1 GENERATOR DATA IN PARK'S FORM WITH NO CROSS MUTUAL         WDYNDA    322
CD       = 2 GENERATOR DATA IN PARK'S FORM WITH CROSS MUTUAL            WDYNDA    323
CD       = 3 GENERATOR IN CLASSICAL FORM                                WDYNDA    324
CD                                                                      WDYNDA    325
CD       = 4 H-L PRESSURE REPRESENTATION WITH HP GENERATOR DATA IN IMPEDWDYNDA    326
CD               TIME CONSTANT FORM                                     WDYNDA    327
CD       = 5 H-L PRESSURE REPRESENTATION WITH HP GENERATOR DATA IN PARK'WDYNDA    328
CD               WITH NO CROSS MUTUAL                                   WDYNDA    329
CD       = 6 H-L PRESSURE REPRESENTATION WITH HP GENERATOR DATA IN PARK'WDYNDA    330
CD               WTIH CROSS MUTUAL                                      WDYNDA    331
CD       = 7 H-L PRESSURE REPERSENTATION WITH HP GENERATOR IN CLASSICAL WDYNDA    332
CD                                                                      WDYNDA    333
CD       = 8 FREQUENCY CONVERTER REPRESENTATION WITH FIRST GENERATOR DATWDYNDA    334
CD           IMPEDANCE AND TIME CONSTANT FORM                           WDYNDA    335
CD       = 9 FREQUENCY CONVERTER REPRESENTATION WITH FIRST GENERATOR DATWDYNDA    336
CD               IN PARK'S FORM WITH NO CROSS MUTUAL                    WDYNDA    337
CD       =10 FREQUENCY CONVERTER REPRESENTATION WITH FIRST GENERATOR DATWDYNDA    338
CD               IN PARK'S FORM WTIH CROSS MUTUAL                       WDYNDA    339
CD       =11 FREQUENCY CONVERTER REPRESENTATION WIHT FIRST GENERATOR DATWDYNDA    340
CD               IN CLASSICAL FORM                                      WDYNDA    341
CD                                                                      WDYNDA    342
CD       =12 SYNCHRONOUS MOTOR DATA IN IMPEDANCE AND TIME CONSTANT FORM WDYNDA    343
CD       =13 SYNCHRONOUS MOTOR DATA IN PARK'S FORM WITH NO CROSS MUTUAL WDYNDA    344
CD       =14 SYNCHRONOUS MOTOR DATA IN PARK'S FORM WITH CROSS MUTUAL    WDYNDA    345
CD                                                                      WDYNDA    346
C                                                                       WDYNDA    347
C  WRITE GENERATOR DATA                                                 WDYNDA    348
C                                                                       WDYNDA    349
      WRITE(IUX,3000) DGEN                                              WDYNDA    350
C                                                                       WDYNDA    351
      DO 1000 I=2,LJNT+1                                                WDYNDA    352
C                                                                       WDYNDA    353
      JG=NTHGEN(I)                                                      WDYNDA    354
C                                                                       WDYNDA    355
      IF(JG.EQ.0)GOTO 1000                                              WDYNDA    356
C                                                                       WDYNDA    357
 100  CONTINUE                                                          WDYNDA    358
C                                                                       WDYNDA    359
      NLF=NGEBUS(JG)                                                    WDYNDA    360
      NGRI=GENID(JG)                                                    WDYNDA    361
      IGEN=IGENDA(1,JG)                                                 WDYNDA    362
      IGVN=IGENDA(2,JG)                                                 WDYNDA    363
      ISATX=IGENDA(3,JG)                                                WDYNDA    364
      IEXX=IGENDA(4,JG)                                                 WDYNDA    365
      ISTABX=IGENDA(5,JG)                                               WDYNDA    366
      IFLTN=IGENDA(6,JG)                                                WDYNDA    367
      IUALN=IGENDA(7,JG)                                                WDYNDA    368
      MASSN=IGENDA(8,JG)                                                WDYNDA    369
      ICBRN=IGENDA(9,JG)                                                WDYNDA    370
      IGSTAN=IGENDA(10,JG)                                              WDYNDA    371
      ITEBN=IGENDA(11,JG)                                               WDYNDA    372
      IMXLN=IGENDA(12,JG)                                               WDYNDA    373
      LVUEL=IGENDA(14,JG)                                               WDYNDA    374
      LVOEL=IGENDA(15,JG)                                               WDYNDA    375
      LVS=IGENDA(16,JG)                                                 WDYNDA    376
C                                                                       WDYNDA    377
      IF(NGSREC.NE.0.AND.IGEN.LT.12)THEN                                WDYNDA    378
      IPFAX=100                                                         WDYNDA    379
      IQFAX=100                                                         WDYNDA    380
      ELSE                                                              WDYNDA    381
      JPQ=0                                                             WDYNDA    382
      IPFAX=IPQFA(1,JG)                                                 WDYNDA    383
      IQFAX=IPQFA(2,JG)                                                 WDYNDA    384
      ENDIF                                                             WDYNDA    385
CD                                                                      WDYNDA    386
CD    WRITE THE FIRST TWO HEADING CARDS                                 WDYNDA    387
CD                                                                      WDYNDA    388
      IF (KLFO.EQ.0) THEN                                               WDYNDA    389
         WRITE(IUX,2020) NLF,NGRI,IPFAX,IQFAX                           WDYNDA    390
      ELSE                                                              WDYNDA    391
         CALL CHKNAM(BUSNAM,NLF)                                        WDYNDA    392
         WRITE(IUX,2190) BUSNAM,NGRI,IPFAX,IQFAX                        WDYNDA    393
      END IF                                                            WDYNDA    394
C                                                                       WDYNDA    395
      WRITE(IUX,2010) IGEN,ISATX,IEXX,ISTABX,IGVN,ITEBN                 WDYNDA    396
     1               ,IMXLN,IGSTAN,IFLTN,IUALN,MASSN,ICBRN              WDYNDA    397
C                                                                       WDYNDA    398
      JJTLN=JGENDA(1,JG)                                                WDYNDA    399
      JJTLN1=JJTLN                                                      WDYNDA    400
CD                                                                      WDYNDA    401
CD    WRITE CLASSICAL GENERATOR DATA                                    WDYNDA    402
CD                                                                      WDYNDA    403
      IF(IGEN.EQ.3.OR.IGEN.EQ.7.OR.IGEN.EQ.11)THEN                      WDYNDA    404
      WRITE(IUX,2100) (TDDAT(JJTLN+LN),LN=1,7)                          WDYNDA    405
      GOTO 720                                                          WDYNDA    406
      ENDIF                                                             WDYNDA    407
C                                                                       WDYNDA    408
      IF(IGEN.EQ.0.OR.IGEN.EQ.4.OR.IGEN.EQ.8.OR.IGEN.EQ.12)THEN         WDYNDA    409
C                                                                       WDYNDA    410
C     DATA IN X'S AND TIME CONSTANT FORM                                WDYNDA    411
C                                                                       WDYNDA    412
      WRITE(IUX,2040) (TDDAT(JJTLN+LL),LL=7,14)                         WDYNDA    413
      WRITE(IUX,2040) (TDDAT(JJTLN+LL),LL=15,18)                        WDYNDA    414
      JJTLN=JJTLN+18                                                    WDYNDA    415
C                                                                       WDYNDA    416
      ELSE                                                              WDYNDA    417
C                                                                       WDYNDA    418
C     DATA IN PARK'S FORM                                               WDYNDA    419
C                                                                       WDYNDA    420
      WRITE(IUX,2040) (TDDAT(JJTLN+KK),KK=7,14)                         WDYNDA    421
      WRITE(IUX,2040) TDDAT(JJTLN+15),                                  WDYNDA    422
     &TDDAT(JJTLN+16),TDDAT(JJTLN+17),TDDAT(JJTLN+18),TDDAT(JJTLN+19)   WDYNDA    423
     &,TDDAT(JJTLN+20),TDDAT(JJTLN+21),TDDAT(JJTLN+22)                  WDYNDA    424
      JJTLN=JJTLN+22                                                    WDYNDA    425
      IF(IGEN.EQ.2.OR.IGEN.EQ.6.OR.IGEN.EQ.10.OR.IGEN.EQ.14)THEN        WDYNDA    426
         WRITE(IUX,2040) TDDAT(JJTLN+1),TDDAT(JJTLN+2)                  WDYNDA    427
         JJTLN=JJTLN+2                                                  WDYNDA    428
      ENDIF                                                             WDYNDA    429
C                                                                       WDYNDA    430
C   ENDIF IGEN.EQ.0                                                     WDYNDA    431
C                                                                       WDYNDA    432
      ENDIF                                                             WDYNDA    433
C                                                                       WDYNDA    434
      IF (ISATX.NE.0) THEN                                              WDYNDA    435
         WRITE(IUX,2040) (TDDAT(JJTLN+LN),LN=1,6)                       WDYNDA    436
         JJTLN=JJTLN+6                                                  WDYNDA    437
      ENDIF                                                             WDYNDA    438
      IF (ISATX.EQ.3.OR.ISATX.EQ.30) THEN                               WDYNDA    439
         WRITE(IUX,2040) (TDDAT(JJTLN+LN),LN=1,6)                       WDYNDA    440
         JJTLN=JJTLN+6                                                  WDYNDA    441
      ENDIF                                                             WDYNDA    442
C                                                                       WDYNDA    443
      MASSN=IGENDA(8,JG)                                                WDYNDA    444
C                                                                       WDYNDA    445
      IF(MASSN.EQ.0)THEN                                                WDYNDA    446
C                                                                       WDYNDA    447
C                           HM          DAMP                            WDYNDA    448
      WRITE(IUX,2110) TDDAT(JJTLN1+1),TDDAT(JJTLN1+2),                  WDYNDA    449
C                                                                       WDYNDA    450
C         CMTL             BMVA         BVR           WXBASE            WDYNDA    451
     +TDDAT(JJTLN1+3),TDDAT(JJTLN1+4),TDDAT(JJTLN1+5),TDDAT(JJTLN1+6)   WDYNDA    452
C                                                                       WDYNDA    453
C                                                                       WDYNDA    454
      ELSE                                                              WDYNDA    455
C                                                                       WDYNDA    456
      JKTLN=JGENDA(7,JG)                                                WDYNDA    457
      DDAT6=TDDAT(JKTLN+6)                                              WDYNDA    458
      DDAT7=TDDAT(JKTLN+7)                                              WDYNDA    459
C                                                                       WDYNDA    460
C                           HM          DAMP                            WDYNDA    461
      WRITE(IUX,2110) TDDAT(JJTLN1+1),TDDAT(JJTLN1+2),                  WDYNDA    462
C                                                                       WDYNDA    463
C         CMTL             BMVA         BVR           WXBASE            WDYNDA    464
     +TDDAT(JJTLN1+3),TDDAT(JJTLN1+4),TDDAT(JJTLN1+5),TDDAT(JJTLN1+6)   WDYNDA    465
C                                                                       WDYNDA    466
C                                                                       WDYNDA    467
C      SPPSS SPGOV                                                      WDYNDA    468
C                                                                       WDYNDA    469
     &,DDAT6,DDAT7                                                      WDYNDA    470
C                                                                       WDYNDA    471
      ICPLLN=MASSN-ITDDAT(JKTLN+1)-ITDDAT(JKTLN+4)-ITDDAT(JKTLN+2)      WDYNDA    472
     &            -ITDDAT(JKTLN+5)-ITDDAT(JKTLN+3)                      WDYNDA    473
C                                                                       WDYNDA    474
      WRITE(IUX,2010) ITDDAT(JKTLN+1),ITDDAT(JKTLN+4)                   WDYNDA    475
     &,ITDDAT(JKTLN+2),ITDDAT(JKTLN+5),ITDDAT(JKTLN+3),ICPLLN           WDYNDA    476
      KK=1                                                              WDYNDA    477
      DO 180 LI=1,MASSN                                                 WDYNDA    478
       KK=KK+6                                                          WDYNDA    479
       WRITE(IUX,2040) (TDDAT(JKTLN+KK+LK),LK=1,6)                      WDYNDA    480
 180  CONTINUE                                                          WDYNDA    481
C                                                                       WDYNDA    482
      ENDIF                                                             WDYNDA    483
C                                                                       WDYNDA    484
      IF(ICBRN.GT.1) THEN                                               WDYNDA    485
      JJTLN=JGENDA(8,JG)                                                WDYNDA    486
      WRITE(IUX,2090) TDDAT(JJTLN+1),TDDAT(JJTLN+2)                     WDYNDA    487
     &                  ,ITDDAT(JJTLN+3),TDDAT(JJTLN+4)                 WDYNDA    488
      ENDIF                                                             WDYNDA    489
C                                                                       WDYNDA    490
      IF (IEXX.EQ.0) GO TO 720                                          WDYNDA    491
      IF (IEXX.EQ.50) GO TO 200                                         WDYNDA    492
      JJTLN=JGENDA(3,JG)                                                WDYNDA    493
      IVTN=ITDDAT(JJTLN+1)                                              WDYNDA    494
      IF (KLFO.EQ.0) THEN                                               WDYNDA    495
         WRITE(IUX,2010) IVTN,LVUEL,LVOEL,LVS                           WDYNDA    496
      ELSE                                                              WDYNDA    497
         CALL CHKNAM(BUSR1,IVTN)                                        WDYNDA    498
         WRITE(IUX,2001) BUSR1,LVUEL,LVOEL,LVS                          WDYNDA    499
      END IF                                                            WDYNDA    500
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=2,9)                          WDYNDA    501
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=10,17)                        WDYNDA    502
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=18,25)                        WDYNDA    503
      IF (IEXX.EQ.4) THEN                                               WDYNDA    504
         WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=26,28)                     WDYNDA    505
      ELSE IF (IEXX.EQ.6.OR.IEXX.EQ.8) THEN                             WDYNDA    506
         WRITE(IUX,2040) TDDAT(JJTLN+26),TDDAT(JJTLN+27)                WDYNDA    507
      ELSE IF(IEXX.EQ.5.OR.IEXX.EQ.3.OR.IEXX.EQ.14) THEN                WDYNDA    508
         WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=26,33)                     WDYNDA    509
      ELSE IF(IEXX.EQ.30) THEN                                          WDYNDA    510
         WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=26,29)                     WDYNDA    511
      ELSE IF(IEXX.EQ.32) THEN                                          WDYNDA    512
         WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=26,33)                     WDYNDA    513
         WRITE(IUX,2040) TDDAT(JJTLN+34),TDDAT(JJTLN+35)                WDYNDA    514
      END IF                                                            WDYNDA    515
      GO TO 220                                                         WDYNDA    516
  200 CONTINUE                                                          WDYNDA    517
C                                                                       WDYNDA    518
C     USER DEFINED EXCITER DATA                                         WDYNDA    519
C                                                                       WDYNDA    520
      JJTLN=JGENDA(3,JG)                                                WDYNDA    521
      WRITE(IUX,2050) TDDAT(JJTLN+1),TDDAT(JJTLN+2),                    WDYNDA    522
     &ITDDAT(JJTLN+3)                                                   WDYNDA    523
      JJTLN=JJTLN+8                                                     WDYNDA    524
      NUF=1                                                             WDYNDA    525
      CALL WUDMDA(NUF,IUX,IU16,JJTLN)                                   WDYNDA    526
C                                                                       WDYNDA    527
  220 CONTINUE                                                          WDYNDA    528
C                                                                       WDYNDA    529
C--  READ STABILIZER DATA IF THERE IS ANY                               WDYNDA    530
C                                                                       WDYNDA    531
      IF (ISTABX.EQ.0) GO TO 540                                        WDYNDA    532
      IF(ISTABX.EQ.50) GO TO 490                                        WDYNDA    533
      JJTLN=JGENDA(4,JG)                                                WDYNDA    534
C                                                                       WDYNDA    535
C     READ IN THE STABILIZER DATA                                       WDYNDA    536
C                                                                       WDYNDA    537
C            1   2   3   4   5   6   7   8   9  10  11  12              WDYNDA    538
      GOTO(230,250,250,230,250,250,350,530,390,410,430,450),ISTABX      WDYNDA    539
C                                                                       WDYNDA    540
 230  CONTINUE                                                          WDYNDA    541
C                                                                       WDYNDA    542
C   TYPE 1 AND 4 STABILIZER                                             WDYNDA    543
C                                                                       WDYNDA    544
      ASSIGN 240 TO I470                                                WDYNDA    545
      GOTO 470                                                          WDYNDA    546
C                                                                       WDYNDA    547
 240  CONTINUE                                                          WDYNDA    548
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=3,10)                         WDYNDA    549
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=11,14)                        WDYNDA    550
      GOTO 530                                                          WDYNDA    551
 250  CONTINUE                                                          WDYNDA    552
C                                                                       WDYNDA    553
C   TYPE 2,3,5 AND 6 STABILIZER                                         WDYNDA    554
C                                                                       WDYNDA    555
      ASSIGN 260 TO I470                                                WDYNDA    556
      GOTO 470                                                          WDYNDA    557
C                                                                       WDYNDA    558
 260  CONTINUE                                                          WDYNDA    559
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=3,10)                         WDYNDA    560
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=11,14)                        WDYNDA    561
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=15,22)                        WDYNDA    562
      GOTO 530                                                          WDYNDA    563
C                                                                       WDYNDA    564
 350  CONTINUE                                                          WDYNDA    565
C                                                                       WDYNDA    566
C     TYPE 7 STABILIZER                                                 WDYNDA    567
C                                                                       WDYNDA    568
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=2,8)                          WDYNDA    569
      GOTO 530                                                          WDYNDA    570
C                                                                       WDYNDA    571
 390  CONTINUE                                                          WDYNDA    572
C                                                                       WDYNDA    573
C     TYPE 9 STABILIZER                                                 WDYNDA    574
C                                                                       WDYNDA    575
      IF(KLFO.EQ.0)THEN                                                 WDYNDA    576
      WRITE(IUX,2010) ITDDAT(JJTLN+1),ITDDAT(JJTLN+2)                   WDYNDA    577
     &               ,ITDDAT(JJTLN+5),ITDDAT(JJTLN+6)                   WDYNDA    578
      ELSE                                                              WDYNDA    579
C                                                                       WDYNDA    580
      NLF1=ITDDAT(JJTLN+1)                                              WDYNDA    581
      CALL CHKNAM(BUSR1,NLF1)                                           WDYNDA    582
      WRITE(IUX,2001) BUSR1,ITDDAT(JJTLN+2)                             WDYNDA    583
     &               ,ITDDAT(JJTLN+5),ITDDAT(JJTLN+6)                   WDYNDA    584
      ENDIF                                                             WDYNDA    585
C                                                                       WDYNDA    586
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=7,14)                         WDYNDA    587
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=15,22)                        WDYNDA    588
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=23,29)                        WDYNDA    589
      GOTO 530                                                          WDYNDA    590
 410  CONTINUE                                                          WDYNDA    591
C                                                                       WDYNDA    592
C   TYPE 10 STABILIZER                                                  WDYNDA    593
C                                                                       WDYNDA    594
      ASSIGN 420 TO I470                                                WDYNDA    595
      GOTO 470                                                          WDYNDA    596
C                                                                       WDYNDA    597
 420  CONTINUE                                                          WDYNDA    598
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=3,9)                          WDYNDA    599
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=10,16)                        WDYNDA    600
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=17,20)                        WDYNDA    601
      GOTO 530                                                          WDYNDA    602
 430  CONTINUE                                                          WDYNDA    603
C                                                                       WDYNDA    604
C   TYPE 11 STABILIZER                                                  WDYNDA    605
C                                                                       WDYNDA    606
      ASSIGN 440 TO I470                                                WDYNDA    607
      GOTO 470                                                          WDYNDA    608
C                                                                       WDYNDA    609
 440  CONTINUE                                                          WDYNDA    610
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=3,9)                          WDYNDA    611
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=10,17)                        WDYNDA    612
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=18,25)                        WDYNDA    613
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=26,30)                        WDYNDA    614
      GOTO 530                                                          WDYNDA    615
 450  CONTINUE                                                          WDYNDA    616
C                                                                       WDYNDA    617
C   TYPE 12 STABILIZER                                                  WDYNDA    618
C                                                                       WDYNDA    619
      IF(KLFO.EQ.0)THEN                                                 WDYNDA    620
      WRITE(IUX,2010) (ITDDAT(JJTLN+LJ),LJ=1,4)                         WDYNDA    621
      ELSE                                                              WDYNDA    622
C                                                                       WDYNDA    623
      NOBS1=ITDDAT(JJTLN+1)                                             WDYNDA    624
      NOBS2=ITDDAT(JJTLN+3)                                             WDYNDA    625
      CALL CHKNAM(BUSR1,NOBS1)                                          WDYNDA    626
      CALL CHKNAM(BUSR2,NOBS2)                                          WDYNDA    627
      WRITE(IUX,2000) BUSR1,ITDDAT(JJTLN+2),BUSR2,ITDDAT(JJTLN+4)       WDYNDA    628
      ENDIF                                                             WDYNDA    629
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=5,12)                         WDYNDA    630
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=13,18)                        WDYNDA    631
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=19,24)                        WDYNDA    632
      GOTO 530                                                          WDYNDA    633
C                                                                       WDYNDA    634
C   COMMON PART OF DATA FOR STABILIZER                                  WDYNDA    635
C   TYPES 1,2,3,4,5,6,10 AND 11                                         WDYNDA    636
C                                                                       WDYNDA    637
 470  CONTINUE                                                          WDYNDA    638
      IF(KLFO.EQ.0)THEN                                                 WDYNDA    639
      WRITE(IUX,2010) (ITDDAT(JJTLN+LJ),LJ=1,2)                         WDYNDA    640
      ELSE                                                              WDYNDA    641
C                                                                       WDYNDA    642
      NOBS1=ITDDAT(JJTLN+1)                                             WDYNDA    643
      CALL CHKNAM(BUSR1,NOBS1)                                          WDYNDA    644
      WRITE(IUX,2000) BUSR1,ITDDAT(JJTLN+2)                             WDYNDA    645
      ENDIF                                                             WDYNDA    646
      GOTO I470                                                         WDYNDA    647
C                                                                       WDYNDA    648
  490 CONTINUE                                                          WDYNDA    649
C                                                                       WDYNDA    650
C     USER DEFINED STABILIZER DATA                                      WDYNDA    651
C                                                                       WDYNDA    652
      JJTLN=JGENDA(4,JG)                                                WDYNDA    653
      WRITE(IUX,2050) TDDAT(JJTLN+1),TDDAT(JJTLN+2),                    WDYNDA    654
     &ITDDAT(JJTLN+3)                                                   WDYNDA    655
      JJTLN=JJTLN+8                                                     WDYNDA    656
      NUF=2                                                             WDYNDA    657
      CALL WUDMDA(NUF,IUX,IU16,JJTLN)                                   WDYNDA    658
C                                                                       WDYNDA    659
  530 CONTINUE                                                          WDYNDA    660
C                                                                       WDYNDA    661
C--  READ TORSIONAL FILTER DATA IF THERE IS ANY                         WDYNDA    662
C                                                                       WDYNDA    663
      IF(IFLTN.NE.0)THEN                                                WDYNDA    664
      JJTLN=JGENDA(5,JG)                                                WDYNDA    665
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=1,8)                          WDYNDA    666
      ENDIF                                                             WDYNDA    667
C                                                                       WDYNDA    668
C--  READ TRANSIEJNT EXCITATION BOOSTER DATA IF THERE IS ANY            WDYNDA    669
C                                                                       WDYNDA    670
  540 CONTINUE                                                          WDYNDA    671
      IF (ITEBN.NE.0) THEN                                              WDYNDA    672
         JJTLN=JGENDA(10,JG)                                            WDYNDA    673
         WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=2,5)                       WDYNDA    674
      ENDIF                                                             WDYNDA    675
C                                                                       WDYNDA    676
C--  READ MAXIMUM EXCITATION LIMITER DATA IF THERE IS ANY               WDYNDA    677
C                                                                       WDYNDA    678
      IF (IMXLN.NE.0) THEN                                              WDYNDA    679
         JJTLN=JGENDA(11,JG)                                            WDYNDA    680
         IF(IMXLN.EQ.50) THEN                                           WDYNDA    681
C                                                                       WDYNDA    682
C     USER DEFINED OVER EXCITATION LIMITER DATA                         WDYNDA    683
C                                                                       WDYNDA    684
            WRITE(IUX,2050) TDDAT(JJTLN+1),TDDAT(JJTLN+2),              WDYNDA    685
     &      ITDDAT(JJTLN+3)                                             WDYNDA    686
            JJTLN=JJTLN+8                                               WDYNDA    687
            NUF=3                                                       WDYNDA    688
            CALL WUDMDA(NUF,IUX,IU16,JJTLN)                             WDYNDA    689
         ELSE                                                           WDYNDA    690
            WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=1,8)                    WDYNDA    691
         ENDIF                                                          WDYNDA    692
      ENDIF                                                             WDYNDA    693
C                                                                       WDYNDA    694
C--  READ UNDER EXCITATION LIMITER DATA IF THERE IS ANY                 WDYNDA    695
C                                                                       WDYNDA    696
      IF (IUALN.EQ.0) GO TO 720                                         WDYNDA    697
      IF (IUALN.EQ.50.AND.ISTABX.NE.50) GO TO 550                       WDYNDA    698
      IF (IUALN.EQ.50) GO TO 720                                        WDYNDA    699
      JJTLN=JGENDA(6,JG)                                                WDYNDA    700
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=1,8)                          WDYNDA    701
      WRITE(IUX,2040) (TDDAT(JJTLN+LJ),LJ=9,16)                         WDYNDA    702
      GO TO 720                                                         WDYNDA    703
  550 CONTINUE                                                          WDYNDA    704
C                                                                       WDYNDA    705
C     USER DEFINED UNDER EXCITATION LIMITER DATA                        WDYNDA    706
C                                                                       WDYNDA    707
      JJTLN=JGENDA(6,JG)                                                WDYNDA    708
      WRITE(IUX,2050) TDDAT(JJTLN+1),TDDAT(JJTLN+2),                    WDYNDA    709
     &ITDDAT(JJTLN+3)                                                   WDYNDA    710
      JJTLN=JJTLN+8                                                     WDYNDA    711
      NUF=3                                                             WDYNDA    712
      CALL WUDMDA(NUF,IUX,IU16,JJTLN)                                   WDYNDA    713
C                                                                       WDYNDA    714
  720 CONTINUE                                                          WDYNDA    715
      IF (IGVN.EQ.0) GO TO 900                                          WDYNDA    716
      JJTLN=JGENDA(2,JG)                                                WDYNDA    717
      IF (IGVN.EQ.50) GO TO 820                                         WDYNDA    718
C   TYPE :    1   2   3   4   5   6   7   8   9  10  11  12  13  14  15 WDYNDA    719
      GOTO (730,730,830,740,750,760,770,780,830,830,830,830,830,830,830 WDYNDA    720
C            16  17  18  19  20  21  22                                 WDYNDA    721
     +     ,830,830,830,830,790,800,800), IGVN                          WDYNDA    722
C                                                                       WDYNDA    723
C  TYPE 1, 2                                                            WDYNDA    724
C                                                                       WDYNDA    725
 730  CONTINUE                                                          WDYNDA    726
      WRITE(IUX,2010) ITDDAT(JJTLN+65),ITDDAT(JJTLN+66)                 WDYNDA    727
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=17,23)                        WDYNDA    728
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=24,28)                        WDYNDA    729
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=47,54)                        WDYNDA    730
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=55,62)                        WDYNDA    731
C                                                                       WDYNDA    732
      IF(TDDAT(JJTLN+63).LT.0.0)THEN                                    WDYNDA    733
      DTYP1=2.0                                                         WDYNDA    734
      ELSE                                                              WDYNDA    735
      DTYP1=1.0                                                         WDYNDA    736
      ENDIF                                                             WDYNDA    737
      IF(TDDAT(JJTLN+64).LT.0.0)THEN                                    WDYNDA    738
      DTYP2=2.0                                                         WDYNDA    739
      ELSE                                                              WDYNDA    740
      DTYP2=1.0                                                         WDYNDA    741
      ENDIF                                                             WDYNDA    742
C                                                                       WDYNDA    743
      WRITE(IUX,2040) DTYP1,ABS(TDDAT(JJTLN+63))                        WDYNDA    744
     &,DTYP2,ABS(TDDAT(JJTLN+64))                                       WDYNDA    745
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=29,36)                        WDYNDA    746
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=37,44)                        WDYNDA    747
C                                                                       WDYNDA    748
      IF(TDDAT(JJTLN+45).LT.0.0)THEN                                    WDYNDA    749
      DTYP1=2.0                                                         WDYNDA    750
      ELSE                                                              WDYNDA    751
      DTYP1=1.0                                                         WDYNDA    752
      ENDIF                                                             WDYNDA    753
      IF(TDDAT(JJTLN+46).LT.0.0)THEN                                    WDYNDA    754
      DTYP2=2.0                                                         WDYNDA    755
      ELSE                                                              WDYNDA    756
      DTYP2=1.0                                                         WDYNDA    757
      ENDIF                                                             WDYNDA    758
C                                                                       WDYNDA    759
      WRITE(IUX,2040) DTYP1,ABS(TDDAT(JJTLN+45))                        WDYNDA    760
     &,DTYP2,ABS(TDDAT(JJTLN+46))                                       WDYNDA    761
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=1,8)                          WDYNDA    762
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=9,16)                         WDYNDA    763
      GO TO 830                                                         WDYNDA    764
C                                                                       WDYNDA    765
C  TYPE 4                                                               WDYNDA    766
C                                                                       WDYNDA    767
 740  CONTINUE                                                          WDYNDA    768
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=1,8)                          WDYNDA    769
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=9,16)                         WDYNDA    770
      IF(IGEN.GE.4.AND.IGEN.LE.7)THEN                                   WDYNDA    771
        LPGLFN=ITDDAT(JJTLN+17)                                         WDYNDA    772
        ILPGID=ITDDAT(JJTLN+18)                                         WDYNDA    773
        IF(KLFO.EQ.0)THEN                                               WDYNDA    774
          WRITE(IUX,2020)LPGLFN,LPGID                                   WDYNDA    775
        ELSE                                                            WDYNDA    776
          CALL CHKNAM(LPGNAM,LPGLFN)                                    WDYNDA    777
          WRITE(IUX,2190)LPGNAM,LPGID                                   WDYNDA    778
        ENDIF                                                           WDYNDA    779
      ELSE                                                              WDYNDA    780
        WRITE(IUX,2040)                                                 WDYNDA    781
      ENDIF                                                             WDYNDA    782
      GO TO 830                                                         WDYNDA    783
C                                                                       WDYNDA    784
C  TYPE 5                                                               WDYNDA    785
C                                                                       WDYNDA    786
 750  CONTINUE                                                          WDYNDA    787
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=1,3)                          WDYNDA    788
      GO TO 830                                                         WDYNDA    789
C                                                                       WDYNDA    790
C  TYPE 6                                                               WDYNDA    791
C                                                                       WDYNDA    792
 760  CONTINUE                                                          WDYNDA    793
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=1,7)                          WDYNDA    794
      GOTO 830                                                          WDYNDA    795
C                                                                       WDYNDA    796
C  TYPE 7                                                               WDYNDA    797
C                                                                       WDYNDA    798
 770  CONTINUE                                                          WDYNDA    799
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=1,8)                          WDYNDA    800
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=9,10)                         WDYNDA    801
      GOTO 830                                                          WDYNDA    802
C                                                                       WDYNDA    803
C  TYPE 8                                                               WDYNDA    804
C                                                                       WDYNDA    805
 780  CONTINUE                                                          WDYNDA    806
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=1,8)                          WDYNDA    807
      WRITE(IUX,2040) TDDAT(JJTLN+9)                                    WDYNDA    808
      GOTO 830                                                          WDYNDA    809
C                                                                       WDYNDA    810
C  TYPE 20                                                              WDYNDA    811
C                                                                       WDYNDA    812
 790  CONTINUE                                                          WDYNDA    813
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=1,8)                          WDYNDA    814
C                                                                       WDYNDA    815
      IF(TDDAT(JJTLN+15).LT.0.0)THEN                                    WDYNDA    816
      DTYP1=2.0                                                         WDYNDA    817
      ELSE                                                              WDYNDA    818
      DTYP1=1.0                                                         WDYNDA    819
      ENDIF                                                             WDYNDA    820
C                                                                       WDYNDA    821
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=9,14),DTYP1,                  WDYNDA    822
     & ABS(TDDAT(JJTLN+15))                                             WDYNDA    823
      WRITE(IUX,2040)                                                   WDYNDA    824
C  GET A DUMMY LINE, DATA ON THIS LINE ARE NOT USED                     WDYNDA    825
C                                                                       WDYNDA    826
      GO TO 830                                                         WDYNDA    827
C                                                                       WDYNDA    828
C  TYPE 21, 22                                                          WDYNDA    829
C                                                                       WDYNDA    830
 800  CONTINUE                                                          WDYNDA    831
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=1,8)                          WDYNDA    832
      WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=9,11)                         WDYNDA    833
      GOTO 830                                                          WDYNDA    834
C                                                                       WDYNDA    835
  820 CONTINUE                                                          WDYNDA    836
C                                                                       WDYNDA    837
C     USER DEFINED GOVERNOR DATA                                        WDYNDA    838
C                                                                       WDYNDA    839
      JJTLN=JJTLN+2                                                     WDYNDA    840
      NUF=4                                                             WDYNDA    841
      CALL WUDMDA(NUF,IUX,IU16,JJTLN)                                   WDYNDA    842
C                                                                       WDYNDA    843
  830 CONTINUE                                                          WDYNDA    844
C                                                                       WDYNDA    845
C-- READ THE GOVERNOR STABILIZER DATA IF THERE IS ANY                   WDYNDA    846
C                                                                       WDYNDA    847
      IF (IGSTAN.GT.0) THEN                                             WDYNDA    848
        JJTLN=JGENDA(9,JG)                                              WDYNDA    849
        WRITE(IUX,2040) (TDDAT(JJTLN+LK),LK=1,6)                        WDYNDA    850
      END IF                                                            WDYNDA    851
C                                                                       WDYNDA    852
  900 CONTINUE                                                          WDYNDA    853
C                                                                       WDYNDA    854
      JG=NEXGEN(JG)                                                     WDYNDA    855
      IF(JG.EQ.0)GOTO 1000                                              WDYNDA    856
      GOTO 100                                                          WDYNDA    857
 1000 CONTINUE                                                          WDYNDA    858
C                                                                       WDYNDA    859
      WRITE(IUX,3000) EDATA                                             WDYNDA    860
C                                                                       WDYNDA    861
      RETURN                                                            WDYNDA    862
C                                                                       WDYNDA    863
 2190 FORMAT(A12,1X,A4,2I5)                                             WDYNDA    864
 2280 FORMAT(3I5,A12,9I5)                                               WDYNDA    865
 2000 FORMAT(A12,I5,A12,5I5)                                            WDYNDA    866
 2001 FORMAT(A12,8I5)                                                   WDYNDA    867
 2010 FORMAT(16I5)                                                      WDYNDA    868
 2020 FORMAT(I5,1X,A4,2I5)                                              WDYNDA    869
 2040 FORMAT(8F10.5)                                                    WDYNDA    870
 2050 FORMAT(2F10.5,I5)                                                 WDYNDA    871
 2090 FORMAT(2F10.5,I10,F10.5)                                          WDYNDA    872
 2100 FORMAT(4F10.5,F10.3,2F10.5)                                       WDYNDA    873
 2110 FORMAT(3F10.5,F10.3,4F10.5)                                       WDYNDA    874
 3000 FORMAT(A5)                                                        WDYNDA    875
      END                                                               WDYNDA    876
C                                                                       WDYNDA    877
      SUBROUTINE WIMODA(IUX,IUY,IEBK)                                   WDYNDA    878
CD                                                                      WDYNDA    879
CD    TO WRITE INDUCTION MOTOR DATA.                                    WDYNDA    880
CD                                                                      WDYNDA    881
      INCLUDE 'PARX.INS'                                                WDYNDA    882
      INCLUDE 'CNMNEW.INS'                                              WDYNDA    883
      INCLUDE 'CNFLAG.INS'                                              WDYNDA    884
      INCLUDE 'CNPARX.INS'                                              WDYNDA    885
      INCLUDE 'CNJPT.INS'                                               WDYNDA    886
      INCLUDE 'CNJDAT.INS'                                              WDYNDA    887
      INCLUDE 'CNTMDA.INS'                                              WDYNDA    888
      INCLUDE 'CNTGED.INS'                                              WDYNDA    889
      INCLUDE 'CNMSG.INS'                                               WDYNDA    890
C                                                                       WDYNDA    891
      CHARACTER*12 BUSNAM                                               WDYNDA    892
      CHARACTER*4  JINDM                                                WDYNDA    893
      CHARACTER*5 MOTO,EDATA                                            WDYNDA    894
      DATA EDATA/'EDATA'/,MOTO/' MOTO'/                                 WDYNDA    895
C                                                                       WDYNDA    896
      LDEB=(JDEB(7).NE.0)                                               WDYNDA    897
C                                                                       WDYNDA    898
C   WRITING INDUCTION MOTOR DATA                                        WDYNDA    899
C                                                                       WDYNDA    900
      WRITE(IUX,1100) MOTO                                              WDYNDA    901
C                                                                       WDYNDA    902
      DO 600 JJMOTL=1,JMOTL                                             WDYNDA    903
C                                                                       WDYNDA    904
      NLF=JMOTB(JJMOTL)                                                 WDYNDA    905
      JINDM=INDMID(JJMOTL)                                              WDYNDA    906
      JJTLN=JJMDAT(JJMOTL)                                              WDYNDA    907
      NTYPE=ITDDAT(JJTLN+1)                                             WDYNDA    908
C                                                                       WDYNDA    909
      IF(KLFO.EQ.0)THEN                                                 WDYNDA    910
C                                                                       WDYNDA    911
      WRITE(IUX,1000) NLF,JINDM,(ITDDAT(JJTLN+J),J=1,4)                 WDYNDA    912
C                                                                       WDYNDA    913
      ELSE                                                              WDYNDA    914
C                                                                       WDYNDA    915
      CALL CHKNAM(BUSNAM,NLF)                                           WDYNDA    916
      WRITE(IUX,1030) BUSNAM,JINDM,(ITDDAT(JJTLN+J),J=1,4)              WDYNDA    917
      ENDIF                                                             WDYNDA    918
C                                                                       WDYNDA    919
      WRITE(IUX,1010) (TDDAT(JJTLN+J),J=5,9),(TDDAT(JJTLN+J),J=27,28)   WDYNDA    920
      WRITE(IUX,1010) (TDDAT(JJTLN+J),J=19,26)                          WDYNDA    921
      WRITE(IUX,1010) (TDDAT(JJTLN+J),J=10,13)                          WDYNDA    922
      WRITE(IUX,1010) (TDDAT(JJTLN+J),J=14,18)                          WDYNDA    923
C                                                                       WDYNDA    924
 600  CONTINUE                                                          WDYNDA    925
C                                                                       WDYNDA    926
      WRITE(IUX,1100) EDATA                                             WDYNDA    927
C                                                                       WDYNDA    928
      RETURN                                                            WDYNDA    929
C                                                                       WDYNDA    930
C                                                                       WDYNDA    931
 1000 FORMAT (I5,1X,A4,4I5)                                             WDYNDA    932
 1010 FORMAT (8F10.5)                                                   WDYNDA    933
 1030 FORMAT (A12,1X,A4,4I5)                                            WDYNDA    934
 1100 FORMAT (A5)                                                       WDYNDA    935
      END                                                               WDYNDA    936
C                                                                       WDYNDA    937
      SUBROUTINE WNLBDA(IUX,IUY,IEBK)                                   WDYNDA    938
CD                                                                      WDYNDA    939
CD    THIS ROUTINE WRITES THE NONLINEAR LOAD DATA                       WDYNDA    940
CD    INTO A USER SPECIFIED FILE.                                       WDYNDA    941
CD                                                                      WDYNDA    942
      INCLUDE 'PARX.INS'                                                WDYNDA    943
      INCLUDE 'CNPARX.INS'                                              WDYNDA    944
      INCLUDE 'CNFLAG.INS'                                              WDYNDA    945
      INCLUDE 'CNJPT.INS'                                               WDYNDA    946
      INCLUDE 'CNJDAT.INS'                                              WDYNDA    947
      INCLUDE 'CNTMDA.INS'                                              WDYNDA    948
      INCLUDE 'CNTGED.INS'                                              WDYNDA    949
      INCLUDE 'CNUNIT.INS'                                              WDYNDA    950
      INCLUDE 'CNMSG.INS'                                               WDYNDA    951
C                                                                       WDYNDA    952
      CHARACTER*12 AFBUS,ATBUS,AFAREA,ATAREA,AFZONE,ATZONE              WDYNDA    953
      CHARACTER*4 JINDLM,JINDSM                                         WDYNDA    954
      CHARACTER*5 CNLBS,EDATA,RANGE                                     WDYNDA    955
      INTEGER JFBUS(3),JTBUS(3),JFAREA(3),JTAREA(3),JFZONE(3),JTZONE(3) WDYNDA    956
      EQUIVALENCE (JFBUS(1),AFBUS),(JTBUS(1),ATBUS)                     WDYNDA    957
      EQUIVALENCE (JFAREA(1),AFAREA),(JTAREA(1),ATAREA)                 WDYNDA    958
      EQUIVALENCE (JFZONE(1),AFZONE),(JTZONE(1),ATZONE)                 WDYNDA    959
C                                                                       WDYNDA    960
      DATA EDATA/'EDATA'/,RANGE/'RANGE'/,CNLBS/' NLBS'/                 WDYNDA    961
C                                                                       WDYNDA    962
      LDEB=(JDEB(9).NE.0)                                               WDYNDA    963
      NTYP=0                                                            WDYNDA    964
C                                                                       WDYNDA    965
      WRITE(IUX,1100) CNLBS                                             WDYNDA    966
C                                                                       WDYNDA    967
      DO 200 KK=1,JNLD                                                  WDYNDA    968
C                                                                       WDYNDA    969
      JJTLN=JJNLD(KK)                                                   WDYNDA    970
      ITYPE=ITDDAT(JJTLN+1)                                             WDYNDA    971
C                                                                       WDYNDA    972
      IF(ITYPE.GT.2)GOTO 120                                            WDYNDA    973
C                                                                       WDYNDA    974
C     INDIVIDUAL BUS CASE                                               WDYNDA    975
C                                                                       WDYNDA    976
      IF(KLFO.EQ.0)THEN                                                 WDYNDA    977
C                                                                       WDYNDA    978
      WRITE(IUX,1000) (ITDDAT(JJTLN+J),J=2,13)                          WDYNDA    979
C                                                                       WDYNDA    980
      NLF=ITDDAT(JJTLN+2)                                               WDYNDA    981
      IPF1=ITDDAT(JJTLN+7)                                              WDYNDA    982
      IQF1=ITDDAT(JJTLN+8)                                              WDYNDA    983
      IPF2=ITDDAT(JJTLN+9)                                              WDYNDA    984
      IQF2=ITDDAT(JJTLN+10)                                             WDYNDA    985
      ICLDP=ITDDAT(JJTLN+11)                                            WDYNDA    986
      ICLDQ=ITDDAT(JJTLN+12)                                            WDYNDA    987
      ITSCP=ITDDAT(JJTLN+13)                                            WDYNDA    988
      JJTLN=JJTLN+13                                                    WDYNDA    989
C                                                                       WDYNDA    990
      ELSE                                                              WDYNDA    991
C                                                                       WDYNDA    992
      JFBUS(1)=ITDDAT(JJTLN+2)                                          WDYNDA    993
      JFBUS(2)=ITDDAT(JJTLN+3)                                          WDYNDA    994
      JFBUS(3)=ITDDAT(JJTLN+4)                                          WDYNDA    995
C                                                                       WDYNDA    996
      WRITE(IUX,1010) AFBUS,(ITDDAT(JJTLN+J),J=5,15)                    WDYNDA    997
C                                                                       WDYNDA    998
      IPF1=ITDDAT(JJTLN+9)                                              WDYNDA    999
      IQF1=ITDDAT(JJTLN+10)                                             WDYNDA   1000
      IPF2=ITDDAT(JJTLN+11)                                             WDYNDA   1001
      IQF2=ITDDAT(JJTLN+12)                                             WDYNDA   1002
      ICLDP=ITDDAT(JJTLN+13)                                            WDYNDA   1003
      ICLDQ=ITDDAT(JJTLN+14)                                            WDYNDA   1004
      ITSCP=ITDDAT(JJTLN+15)                                            WDYNDA   1005
      JJTLN=JJTLN+15                                                    WDYNDA   1006
      ENDIF                                                             WDYNDA   1007
C                                                                       WDYNDA   1008
      IF(IPF1.NE.0.OR.IQF1.NE.0.OR.IPF2.NE.0.OR.IQF2.NE.0)THEN          WDYNDA   1009
C                                                                       WDYNDA   1010
      WRITE(IUX,1020) TDDAT(JJTLN+1),TDDAT(JJTLN+2),TDDAT(JJTLN+3)      WDYNDA   1011
     &,TDDAT(JJTLN+4),TDDAT(JJTLN+5),TDDAT(JJTLN+6),TDDAT(JJTLN+7)      WDYNDA   1012
     &,TDDAT(JJTLN+8)                                                   WDYNDA   1013
      JJTLN=JJTLN+8                                                     WDYNDA   1014
C                                                                       WDYNDA   1015
      ENDIF                                                             WDYNDA   1016
C                                                                       WDYNDA   1017
C--  WRITE COMPOSITE LOAD DATA                                          WDYNDA   1018
C                                                                       WDYNDA   1019
      IF(ICLDP.NE.0.OR.ICLDQ.NE.0)THEN                                  WDYNDA   1020
C                                                                       WDYNDA   1021
      ICLLMP=ITDDAT(JJTLN+1)                                            WDYNDA   1022
      ICLSMP=ITDDAT(JJTLN+2)                                            WDYNDA   1023
      ICLDLP=ITDDAT(JJTLN+3)                                            WDYNDA   1024
      ICLTSQ=ITDDAT(JJTLN+4)                                            WDYNDA   1025
      ICLCPP=ITDDAT(JJTLN+5)                                            WDYNDA   1026
      ICLCPQ=ITDDAT(JJTLN+6)                                            WDYNDA   1027
C                                                                       WDYNDA   1028
      JJLNH=JJTLN                                                       WDYNDA   1029
      JJTLN=JJTLN+10                                                    WDYNDA   1030
C--                                  WRITE LARGE MOTORS                 WDYNDA   1031
      IF(ICLLMP.NE.0)THEN                                               WDYNDA   1032
      JTHLM=ITDDAT(JJTLN+29)                                            WDYNDA   1033
      JINDLM=INDMID(JTHLM)                                              WDYNDA   1034
      NTYPLM=ITDDAT(JJTLN+1)                                            WDYNDA   1035
      ICCLMP=ITDDAT(JJTLN+2)                                            WDYNDA   1036
      ISATLM=ITDDAT(JJTLN+3)                                            WDYNDA   1037
      ILTYPL=ITDDAT(JJTLN+4)                                            WDYNDA   1038
      JLM=JJTLN                                                         WDYNDA   1039
      JJTLN=JJTLN+29                                                    WDYNDA   1040
      ENDIF                                                             WDYNDA   1041
C--                                  WRITE SMALL MOTORS                 WDYNDA   1042
      IF(ICLSMP.NE.0)THEN                                               WDYNDA   1043
      JTHSM=ITDDAT(JJTLN+29)                                            WDYNDA   1044
      JINDSM=INDMID(JTHSM)                                              WDYNDA   1045
      NTYPSM=ITDDAT(JJTLN+1)                                            WDYNDA   1046
      ICLSMP=ITDDAT(JJTLN+2)                                            WDYNDA   1047
      ISATSM=ITDDAT(JJTLN+3)                                            WDYNDA   1048
      ILTYPS=ITDDAT(JJTLN+4)                                            WDYNDA   1049
      JSM=JJTLN                                                         WDYNDA   1050
      JJTLN=JJTLN+29                                                    WDYNDA   1051
      ENDIF                                                             WDYNDA   1052
C                                                                       WDYNDA   1053
      WRITE(IUX,1005) JINDLM,NTYPLM,ICLLMP,ISATLM,ILTYPL                WDYNDA   1054
     1,JINDSM,NTYPSM,ICLSMP,ISATSM,ILTYPS,ICLDLP,ICLTSQ,ICLCPP,ICLCPQ   WDYNDA   1055
      WRITE(IUX,1020) TDDAT(JJLNH+7),TDDAT(JJLNH+8),TDDAT(JJLNH+9)      WDYNDA   1056
     &,TDDAT(JJLNH+10)                                                  WDYNDA   1057
C                                                                       WDYNDA   1058
C--                                  WRITE LARGE MOTORS                 WDYNDA   1059
      IF(ICLLMP.NE.0)THEN                                               WDYNDA   1060
      WRITE(IUX,1020) (TDDAT(JLM+J),J=5,9),(TDDAT(JLM+J),J=27,28)       WDYNDA   1061
      WRITE(IUX,1020) (TDDAT(JLM+J),J=19,26)                            WDYNDA   1062
      WRITE(IUX,1020) (TDDAT(JLM+J),J=10,13)                            WDYNDA   1063
      WRITE(IUX,1020) (TDDAT(JLM+J),J=14,18)                            WDYNDA   1064
      ENDIF                                                             WDYNDA   1065
C--                                  WRITE SMALL MOTORS                 WDYNDA   1066
      IF(ICLSMP.NE.0)THEN                                               WDYNDA   1067
      WRITE(IUX,1020) (TDDAT(JSM+J),J=5,9),(TDDAT(JSM+J),J=27,28)       WDYNDA   1068
      WRITE(IUX,1020) (TDDAT(JSM+J),J=19,26)                            WDYNDA   1069
      WRITE(IUX,1020) (TDDAT(JSM+J),J=10,13)                            WDYNDA   1070
      WRITE(IUX,1020) (TDDAT(JSM+J),J=14,18)                            WDYNDA   1071
      ENDIF                                                             WDYNDA   1072
C                                                                       WDYNDA   1073
C                                                                       WDYNDA   1074
      IF(ICLDLP.NE.0)THEN                                               WDYNDA   1075
      WRITE(IUX,1020) TDDAT(JJTLN+1),TDDAT(JJTLN+2),TDDAT(JJTLN+3)      WDYNDA   1076
      JJTLN=JJTLN+3                                                     WDYNDA   1077
      ENDIF                                                             WDYNDA   1078
      IF(ICLTSQ.NE.0)THEN                                               WDYNDA   1079
      WRITE(IUX,1020) TDDAT(JJTLN+1),TDDAT(JJTLN+2),TDDAT(JJTLN+3)      WDYNDA   1080
      JJTLN=JJTLN+3                                                     WDYNDA   1081
      ENDIF                                                             WDYNDA   1082
C                                                                       WDYNDA   1083
      ENDIF                                                             WDYNDA   1084
C                                                                       WDYNDA   1085
C     WRITE TSCL DATA                                                   WDYNDA   1086
C                                                                       WDYNDA   1087
      IF (ITSCP.NE.0) THEN                                              WDYNDA   1088
         WRITE(IUX,1020) (TDDAT(JJTLN+J),J=2,8)                         WDYNDA   1089
         JJTLN=JJTLN+8                                                  WDYNDA   1090
      END IF                                                            WDYNDA   1091
C                                                                       WDYNDA   1092
C    READ ANOTHER LOAD BUS                                              WDYNDA   1093
C                                                                       WDYNDA   1094
      GOTO 200                                                          WDYNDA   1095
C                                                                       WDYNDA   1096
C     RANGE OF BUS CASE                                                 WDYNDA   1097
C                                                                       WDYNDA   1098
  120 CONTINUE                                                          WDYNDA   1099
C                                                                       WDYNDA   1100
      IF(KLFO.EQ.0)THEN                                                 WDYNDA   1101
      ITDDAT(JJTLN+1)=3                                                 WDYNDA   1102
      IFAREA=ITDDAT(JJTLN+2)                                            WDYNDA   1103
      ITAREA=ITDDAT(JJTLN+3)                                            WDYNDA   1104
      IFZONE=ITDDAT(JJTLN+4)                                            WDYNDA   1105
      ITZONE=ITDDAT(JJTLN+5)                                            WDYNDA   1106
      IFBUS=ITDDAT(JJTLN+6)                                             WDYNDA   1107
      ITBUS=ITDDAT(JJTLN+7)                                             WDYNDA   1108
      WRITE(IUX,1050)RANGE,IFAREA,ITAREA,IFZONE,ITZONE,IFBUS,ITBUS      WDYNDA   1109
      JJTLN=JJTLN+7                                                     WDYNDA   1110
      ELSE                                                              WDYNDA   1111
      ITDDAT(JJTLN+1)=4                                                 WDYNDA   1112
      JFAREA(1)=ITDDAT(JJTLN+2)                                         WDYNDA   1113
      JFAREA(2)=ITDDAT(JJTLN+3)                                         WDYNDA   1114
      JFAREA(3)=ITDDAT(JJTLN+4)                                         WDYNDA   1115
      JTAREA(1)=ITDDAT(JJTLN+5)                                         WDYNDA   1116
      JTAREA(2)=ITDDAT(JJTLN+6)                                         WDYNDA   1117
      JTAREA(3)=ITDDAT(JJTLN+7)                                         WDYNDA   1118
      JFZONE(1)=ITDDAT(JJTLN+8)                                         WDYNDA   1119
      JFZONE(2)=ITDDAT(JJTLN+9)                                         WDYNDA   1120
      JFZONE(3)=ITDDAT(JJTLN+10)                                        WDYNDA   1121
      JTZONE(1)=ITDDAT(JJTLN+11)                                        WDYNDA   1122
      JTZONE(2)=ITDDAT(JJTLN+12)                                        WDYNDA   1123
      JTZONE(3)=ITDDAT(JJTLN+13)                                        WDYNDA   1124
      JFBUS(1)=ITDDAT(JJTLN+14)                                         WDYNDA   1125
      JFBUS(2)=ITDDAT(JJTLN+15)                                         WDYNDA   1126
      JFBUS(3)=ITDDAT(JJTLN+16)                                         WDYNDA   1127
      JTBUS(1)=ITDDAT(JJTLN+17)                                         WDYNDA   1128
      JTBUS(2)=ITDDAT(JJTLN+18)                                         WDYNDA   1129
      JTBUS(3)=ITDDAT(JJTLN+19)                                         WDYNDA   1130
      JJTLN=JJTLN+19                                                    WDYNDA   1131
      WRITE(IUX,1040)RANGE,AFAREA,ATAREA,AFZONE,ATZONE,AFBUS,ATBUS      WDYNDA   1132
      ENDIF                                                             WDYNDA   1133
C                                                                       WDYNDA   1134
      WRITE(IUX,1020) TDDAT(JJTLN+1),TDDAT(JJTLN+2)                     WDYNDA   1135
      JJTLN=JJTLN+2                                                     WDYNDA   1136
C                                                                       WDYNDA   1137
      WRITE(IUX,1030) (ITDDAT(JJTLN+J),J=1,11)                          WDYNDA   1138
C                                                                       WDYNDA   1139
      IPF1=ITDDAT(JJTLN+5)                                              WDYNDA   1140
      IQF1=ITDDAT(JJTLN+6)                                              WDYNDA   1141
      IPF2=ITDDAT(JJTLN+7)                                              WDYNDA   1142
      IQF2=ITDDAT(JJTLN+8)                                              WDYNDA   1143
      ICLDP=ITDDAT(JJTLN+9)                                             WDYNDA   1144
      ICLDQ=ITDDAT(JJTLN+10)                                            WDYNDA   1145
      ITSCP=ITDDAT(JJTLN+11)                                            WDYNDA   1146
      JJTLN=JJTLN+11                                                    WDYNDA   1147
C                                                                       WDYNDA   1148
      IF(IPF1.NE.0.OR.IQF1.NE.0.OR.IPF2.NE.0.OR.IQF2.NE.0)THEN          WDYNDA   1149
C                                                                       WDYNDA   1150
      WRITE(IUX,1020) TDDAT(JJTLN+1),TDDAT(JJTLN+2),TDDAT(JJTLN+3)      WDYNDA   1151
     &,TDDAT(JJTLN+4),TDDAT(JJTLN+5),TDDAT(JJTLN+6),TDDAT(JJTLN+7)      WDYNDA   1152
     &,TDDAT(JJTLN+8)                                                   WDYNDA   1153
      JJTLN=JJTLN+8                                                     WDYNDA   1154
      ENDIF                                                             WDYNDA   1155
C                                                                       WDYNDA   1156
C--  WRITE COMPOSITE LOAD DATA                                          WDYNDA   1157
C                                                                       WDYNDA   1158
      IF(ICLDP.NE.0.OR.ICLDQ.NE.0)THEN                                  WDYNDA   1159
C                                                                       WDYNDA   1160
      ICLLMP=ITDDAT(JJTLN+1)                                            WDYNDA   1161
      ICLSMP=ITDDAT(JJTLN+2)                                            WDYNDA   1162
      ICLDLP=ITDDAT(JJTLN+3)                                            WDYNDA   1163
      ICLTSQ=ITDDAT(JJTLN+4)                                            WDYNDA   1164
      ICLCPP=ITDDAT(JJTLN+5)                                            WDYNDA   1165
      ICLCPQ=ITDDAT(JJTLN+6)                                            WDYNDA   1166
      JJNLH=JJTLN                                                       WDYNDA   1167
      JJTLN=JJTLN+10                                                    WDYNDA   1168
C                                                                       WDYNDA   1169
C--                                  WRITE LARGE MOTORS                 WDYNDA   1170
      IF(ICLLMP.NE.0)THEN                                               WDYNDA   1171
      JTHLM=ITDDAT(JJTLN+29)                                            WDYNDA   1172
      JINDLM=INDMID(JTHLM)                                              WDYNDA   1173
      NTYPLM=ITDDAT(JJTLN+1)                                            WDYNDA   1174
      ICLLMP=ITDDAT(JJTLN+2)                                            WDYNDA   1175
      ISATLM=ITDDAT(JJTLN+3)                                            WDYNDA   1176
      ILTYPL=ITDDAT(JJTLN+4)                                            WDYNDA   1177
      JLM=JJTLN                                                         WDYNDA   1178
      JJTLN=JJTLN+29                                                    WDYNDA   1179
      ENDIF                                                             WDYNDA   1180
C--                                  WRITE SMALL MOTORS                 WDYNDA   1181
      IF(ICLSMP.NE.0)THEN                                               WDYNDA   1182
      JTHSM=ITDDAT(JJTLN+29)                                            WDYNDA   1183
      JINDSM=INDMID(JTHSM)                                              WDYNDA   1184
      NTYPSM=ITDDAT(JJTLN+1)                                            WDYNDA   1185
      ICLSMP=ITDDAT(JJTLN+2)                                            WDYNDA   1186
      ISATSM=ITDDAT(JJTLN+3)                                            WDYNDA   1187
      ILTYPS=ITDDAT(JJTLN+4)                                            WDYNDA   1188
      JSM=JJTLN                                                         WDYNDA   1189
      JJTLN=JJTLN+29                                                    WDYNDA   1190
      ENDIF                                                             WDYNDA   1191
C                                                                       WDYNDA   1192
C                                                                       WDYNDA   1193
      WRITE(IUX,1005) JINDLM,NTYPLM,ICLLMP,ISATLM,ILTYPL                WDYNDA   1194
     1,JINDSM,NTYPSM,ICLSMP,ISATSM,ILTYPS,ICLDLP,ICLTSQ,ICLCPP,ICLCPQ   WDYNDA   1195
C                                                                       WDYNDA   1196
      WRITE(IUX,1020) TDDAT(JJNLH+7),TDDAT(JJNLH+8),TDDAT(JJNLH+9)      WDYNDA   1197
     &,TDDAT(JJNLH+10)                                                  WDYNDA   1198
                                                                        WDYNDA   1199
C                                                                       WDYNDA   1200
C--                                  WRITE LARGE MOTORS                 WDYNDA   1201
      IF(ICLLMP.NE.0)THEN                                               WDYNDA   1202
      WRITE(IUX,1020) (TDDAT(JLM+J),J=5,9),(TDDAT(JLM+J),J=27,28)       WDYNDA   1203
      WRITE(IUX,1020) (TDDAT(JLM+J),J=19,26)                            WDYNDA   1204
      WRITE(IUX,1020) (TDDAT(JLM+J),J=10,13)                            WDYNDA   1205
      WRITE(IUX,1020) (TDDAT(JLM+J),J=14,18)                            WDYNDA   1206
      ENDIF                                                             WDYNDA   1207
C--                                  WRITE SMALL MOTORS                 WDYNDA   1208
      IF(ICLSMP.NE.0)THEN                                               WDYNDA   1209
      WRITE(IUX,1020) (TDDAT(JSM+J),J=5,9),(TDDAT(JSM+J),J=27,28)       WDYNDA   1210
      WRITE(IUX,1020) (TDDAT(JSM+J),J=19,26)                            WDYNDA   1211
      WRITE(IUX,1020) (TDDAT(JSM+J),J=10,13)                            WDYNDA   1212
      WRITE(IUX,1020) (TDDAT(JSM+J),J=14,18)                            WDYNDA   1213
      ENDIF                                                             WDYNDA   1214
C                                                                       WDYNDA   1215
      IF(ICLDLP.NE.0)THEN                                               WDYNDA   1216
      WRITE(IUX,1020) TDDAT(JJTLN+1),TDDAT(JJTLN+2),TDDAT(JJTLN+3)      WDYNDA   1217
      JJTLN=JJTLN+3                                                     WDYNDA   1218
      ENDIF                                                             WDYNDA   1219
      IF(ICLTSQ.NE.0)THEN                                               WDYNDA   1220
      WRITE(IUX,1020) TDDAT(JJTLN+1),TDDAT(JJTLN+2),TDDAT(JJTLN+3)      WDYNDA   1221
      JJTLN=JJTLN+3                                                     WDYNDA   1222
      ENDIF                                                             WDYNDA   1223
      ENDIF                                                             WDYNDA   1224
C                                                                       WDYNDA   1225
C     WRITE TSCL DATA                                                   WDYNDA   1226
C                                                                       WDYNDA   1227
      IF (ITSCP.NE.0) THEN                                              WDYNDA   1228
      WRITE(IUX,1020) (TDDAT(JJTLN+J),J=2,8)                            WDYNDA   1229
      JJTLN=JJTLN+8                                                     WDYNDA   1230
      END IF                                                            WDYNDA   1231
C                                                                       WDYNDA   1232
 200  CONTINUE                                                          WDYNDA   1233
C                                                                       WDYNDA   1234
      WRITE(IUX,1100) EDATA                                             WDYNDA   1235
C                                                                       WDYNDA   1236
      RETURN                                                            WDYNDA   1237
C                                                                       WDYNDA   1238
 1000 FORMAT(16I5)                                                      WDYNDA   1239
 1005 FORMAT(1X,A4,4I5,1X,A4,4I5,4I5)                                   WDYNDA   1240
 1010 FORMAT(A12,11I5)                                                  WDYNDA   1241
 1020 FORMAT(8F10.5)                                                    WDYNDA   1242
 1030 FORMAT(5X,16I5)                                                   WDYNDA   1243
 1040 FORMAT(A5,3(1X,2A12))                                             WDYNDA   1244
 1050 FORMAT(A5,6I5)                                                    WDYNDA   1245
 1100 FORMAT(A5)                                                        WDYNDA   1246
C                                                                       WDYNDA   1247
      END                                                               WDYNDA   1248
C                                                                       WDYNDA   1249
      SUBROUTINE WSVCDA(IUX,IUY,IEBK)                                   WDYNDA   1250
CD                                                                      WDYNDA   1251
CD    THIS ROUTINE WRITES THE SVC DATA INTO A OUTPUT FILE.              WDYNDA   1252
CD                                                                      WDYNDA   1253
CD    ROUTINE INPUTS:                                                   WDYNDA   1254
CD                                                                      WDYNDA   1255
CD    IUX IS THE UNIT OF WHICH THE DATA IS TO BE WRITTEN                WDYNDA   1256
CD    IUY IS THE UNIS OF WHICH THE ERROR AND WARNING MESSAGE ARE WRITTENWDYNDA   1257
CD    IEBK IS THE ERROR INDICATOR                                       WDYNDA   1258
CD                                                                      WDYNDA   1259
      INCLUDE 'PARX.INS'                                                WDYNDA   1260
      INCLUDE 'CNPARX.INS'                                              WDYNDA   1261
      INCLUDE 'CNFLAG.INS'                                              WDYNDA   1262
      INCLUDE 'CNB19.INS'                                               WDYNDA   1263
      INCLUDE 'CNMNEW.INS'                                              WDYNDA   1264
      INCLUDE 'CNPT.INS'                                                WDYNDA   1265
      INCLUDE 'CNJPT.INS'                                               WDYNDA   1266
      INCLUDE 'CNJDAT.INS'                                              WDYNDA   1267
      INCLUDE 'CNTGED.INS'                                              WDYNDA   1268
      INCLUDE 'CNGSRC.INS'                                              WDYNDA   1269
      INCLUDE 'CNTMDA.INS'                                              WDYNDA   1270
      INCLUDE 'CNUNIT.INS'                                              WDYNDA   1271
      INCLUDE 'CNMSG.INS'                                               WDYNDA   1272
C                                                                       WDYNDA   1273
      CHARACTER*5  CNSVC,EDATA                                          WDYNDA   1274
      CHARACTER*12 SVRNA1,SVRNA2,SVRNAM                                 WDYNDA   1275
      CHARACTER GENCKT*2,LCKT*2,NGRI*4                                  WDYNDA   1276
C                                                                       WDYNDA   1277
      DATA EDATA/'EDATA'/,CNSVC/' NSVC'/                                WDYNDA   1278
C                                                                       WDYNDA   1279
C     WRITING SVC DATA                                                  WDYNDA   1280
C                                                                       WDYNDA   1281
      LDEB=(JDEB(8).NE.0)                                               WDYNDA   1282
C                                                                       WDYNDA   1283
      IEBK=0                                                            WDYNDA   1284
C                                                                       WDYNDA   1285
      WRITE(IUX,1100) CNSVC                                             WDYNDA   1286
C                                                                       WDYNDA   1287
      DO 150 K=1,JSVC                                                   WDYNDA   1288
      JJTLN=JJSDAT(K)                                                   WDYNDA   1289
      NLF=JSAB(K)                                                       WDYNDA   1290
      NGRI=SVCID(K)                                                     WDYNDA   1291
      NRTYPX=ITDDAT(JJTLN+9)                                            WDYNDA   1292
      NVSENX=ITDDAT(JJTLN+10)                                           WDYNDA   1293
      IDIVX=ITDDAT(JJTLN+12)                                            WDYNDA   1294
C                                                                       WDYNDA   1295
C                                                                       WDYNDA   1296
C     TRANSFORMER SATURATION                                            WDYNDA   1297
C                                                                       WDYNDA   1298
      IF(NRTYPX.GT.5.AND.NRTYPX.LT.50) THEN                             WDYNDA   1299
C                                                                       WDYNDA   1300
      IQFARX=ITDDAT(JJTLN+11)                                           WDYNDA   1301
C                                                                       WDYNDA   1302
      IF(KLFO.EQ.0)THEN                                                 WDYNDA   1303
C                                                                       WDYNDA   1304
      WRITE(IUX,1000) NLF,NGRI,NRTYPX,IQFARX                            WDYNDA   1305
C                                                                       WDYNDA   1306
      ELSE                                                              WDYNDA   1307
C                                                                       WDYNDA   1308
      CALL CHKNAM(SVRNAM,NLF)                                           WDYNDA   1309
      WRITE(IUX,1060) SVRNAM,NGRI,NRTYPX,IQFARX                         WDYNDA   1310
C                                                                       WDYNDA   1311
      ENDIF                                                             WDYNDA   1312
C                                                                       WDYNDA   1313
C                                                                       WDYNDA   1314
      WRITE(IUX,1010) (TDDAT(JJTLN+J),J=1,4)                            WDYNDA   1315
      JJTLN=JJTLN+12                                                    WDYNDA   1316
      GOTO 150                                                          WDYNDA   1317
C                                                                       WDYNDA   1318
      ENDIF                                                             WDYNDA   1319
C                                                                       WDYNDA   1320
C     STATIC COMPENSATORS                                               WDYNDA   1321
C                                                                       WDYNDA   1322
      IF(NGSREC.EQ.0)THEN                                               WDYNDA   1323
      IQFARX=ITDDAT(JJTLN+11)                                           WDYNDA   1324
      ELSE                                                              WDYNDA   1325
      IQFARX=100                                                        WDYNDA   1326
      ENDIF                                                             WDYNDA   1327
C                                                                       WDYNDA   1328
      IF(KLFO.EQ.0)THEN                                                 WDYNDA   1329
C                                                                       WDYNDA   1330
      WRITE(IUX,1000,IOSTAT=IOS) NLF,NGRI,NRTYPX,IQFARX,IDIVX,NVSENX    WDYNDA   1331
C                                                                       WDYNDA   1332
      ELSE                                                              WDYNDA   1333
C                                                                       WDYNDA   1334
      CALL CHKNAM(SVRNAM,NLF)                                           WDYNDA   1335
      CALL CHKNAM(SVRNA2,NVSENX)                                        WDYNDA   1336
      WRITE(IUX,1060,IOSTAT=IOS) SVRNAM,NGRI,NRTYPX,IQFARX,IDIVX,SVRNA2 WDYNDA   1337
C                                                                       WDYNDA   1338
      ENDIF                                                             WDYNDA   1339
C                                                                       WDYNDA   1340
      IF(NRTYPX.EQ.50)THEN                                              WDYNDA   1341
C                                                                       WDYNDA   1342
C     USER DEFINED SVC DATA                                             WDYNDA   1343
C                                                                       WDYNDA   1344
      JJTLN=JJTLN+12                                                    WDYNDA   1345
      NUF=5                                                             WDYNDA   1346
      CALL WUDMDA(NUF,IUX,IUY,JJTLN)                                    WDYNDA   1347
C                                                                       WDYNDA   1348
      GOTO 150                                                          WDYNDA   1349
C                                                                       WDYNDA   1350
      ELSEIF(NRTYPX.EQ.1) THEN                                          WDYNDA   1351
C                                                                       WDYNDA   1352
      WRITE (IUX,1010,IOSTAT=IOS) (TDDAT(JJTLN+J),J=1,8)                WDYNDA   1353
      JJTLN=JJTLN+12                                                    WDYNDA   1354
      GOTO 150                                                          WDYNDA   1355
C                                                                       WDYNDA   1356
C     WSCC SVC'S                                                        WDYNDA   1357
C                                                                       WDYNDA   1358
      ELSEIF(NRTYPX.EQ.2.OR.NRTYPX.EQ.3)THEN                            WDYNDA   1359
C                                                                       WDYNDA   1360
      WRITE(IUX,1010,IOSTAT=IOS) (TDDAT(JJTLN+J),J=1,7)                 WDYNDA   1361
      WRITE(IUX,1010,IOSTAT=IOS) (TDDAT(JJTLN+J),J=13,19)               WDYNDA   1362
      WRITE(IUX,1010,IOSTAT=IOS) (TDDAT(JJTLN+J),J=21,27)               WDYNDA   1363
      JJTLN=JJTLN+27                                                    WDYNDA   1364
C                                                                       WDYNDA   1365
      IF(NRTYPX.EQ.3) THEN                                              WDYNDA   1366
C                                                                       WDYNDA   1367
      MT1=ITDDAT(JJTLN+1)                                               WDYNDA   1368
      MT2=ITDDAT(JJTLN+2)                                               WDYNDA   1369
C                                                                       WDYNDA   1370
C                                                                       WDYNDA   1371
C     MT1=0 CASE                                                        WDYNDA   1372
C                                                                       WDYNDA   1373
      IF(MT1.EQ.0)THEN                                                  WDYNDA   1374
C                                                                       WDYNDA   1375
        NVSEN1=ITDDAT(JJTLN+3)                                          WDYNDA   1376
        NVSEN2=ITDDAT(JJTLN+4)                                          WDYNDA   1377
        JLCKT=ITDDAT(JJTLN+5)                                           WDYNDA   1378
        CALL UNPACK(LCKT,JJJ,JLCKT)                                     WDYNDA   1379
C                                                                       WDYNDA   1380
        IF(KLFO.EQ.0)THEN                                               WDYNDA   1381
C                                                                       WDYNDA   1382
        WRITE(IUX,1090)(ITDDAT(JJTLN+J),J=1,2),NVSEN1,NVSEN2,LCKT       WDYNDA   1383
C                                                                       WDYNDA   1384
        ELSE                                                            WDYNDA   1385
C                                                                       WDYNDA   1386
        CALL CHKNAM(SVRNA1,NVSEN1)                                      WDYNDA   1387
        CALL CHKNAM(SVRNA2,NVSEN2)                                      WDYNDA   1388
        WRITE(IUX,1120)(ITDDAT(JJTLN+J),J=1,2),SVRNA1,SVRNA2,LCKT       WDYNDA   1389
C                                                                       WDYNDA   1390
        ENDIF                                                           WDYNDA   1391
C                                                                       WDYNDA   1392
C     MT1=1 CASE                                                        WDYNDA   1393
C                                                                       WDYNDA   1394
      ELSEIF(MT1.EQ.1) THEN                                             WDYNDA   1395
C                                                                       WDYNDA   1396
        NSVEN1=ITDDAT(JJTLN+4)                                          WDYNDA   1397
C                                                                       WDYNDA   1398
        IF(KLFO.EQ.0)THEN                                               WDYNDA   1399
C                                                                       WDYNDA   1400
        WRITE(IUX,1150) (ITDDAT(JJTLN+J),J=1,2),TDDAT(JJTLN+3),NVSEN1   WDYNDA   1401
C                                                                       WDYNDA   1402
        ELSE                                                            WDYNDA   1403
C                                                                       WDYNDA   1404
        CALL CHKNAM(SVRNA1,NVSEN1)                                      WDYNDA   1405
        WRITE(IUX,1130) (ITDDAT(JJTLN+J),J=1,2),TDDAT(JJTLN+3),SVRNA1   WDYNDA   1406
C                                                                       WDYNDA   1407
        ENDIF                                                           WDYNDA   1408
C                                                                       WDYNDA   1409
C       MT1=2  CASE                                                     WDYNDA   1410
C                                                                       WDYNDA   1411
        ELSE                                                            WDYNDA   1412
C                                                                       WDYNDA   1413
        IDGEN=ITDDAT(JJTLN+4)                                           WDYNDA   1414
        CALL UNPACK(GENCKT,JJJ,IDGEN)                                   WDYNDA   1415
        NVSEN1=ITDDAT(JJTLN+3)                                          WDYNDA   1416
C                                                                       WDYNDA   1417
        IF(KLFO.EQ.0)THEN                                               WDYNDA   1418
C                                                                       WDYNDA   1419
        WRITE(IUX,1110)(ITDDAT(JJTLN+J),J=1,2),NVSEN1,GENCKT            WDYNDA   1420
C                                                                       WDYNDA   1421
        ELSE                                                            WDYNDA   1422
C                                                                       WDYNDA   1423
        CALL CHKNAM(SVRNA1,NVSEN1)                                      WDYNDA   1424
        WRITE(IUX,1140) (ITDDAT(JJTLN+J),J=1,2),SVRNA1,GENCKT           WDYNDA   1425
C                                                                       WDYNDA   1426
        ENDIF                                                           WDYNDA   1427
C                                                                       WDYNDA   1428
        ENDIF                                                           WDYNDA   1429
C                                                                       WDYNDA   1430
C       COMMON DATA OF TYPE 3 SVC                                       WDYNDA   1431
C                                                                       WDYNDA   1432
        WRITE(IUX,1010,IOSTAT=IOS) (TDDAT(JJTLN+J),J=6,12)              WDYNDA   1433
        WRITE(IUX,1010,IOSTAT=IOS) (TDDAT(JJTLN+J),J=13,16)             WDYNDA   1434
        JJTLN=JJTLN+16                                                  WDYNDA   1435
C                                                                       WDYNDA   1436
        ENDIF                                                           WDYNDA   1437
C                                                                       WDYNDA   1438
      ENDIF                                                             WDYNDA   1439
C                                                                       WDYNDA   1440
C                                                                       WDYNDA   1441
  150 CONTINUE                                                          WDYNDA   1442
C                                                                       WDYNDA   1443
      WRITE(IUX,1100) EDATA                                             WDYNDA   1444
C                                                                       WDYNDA   1445
      RETURN                                                            WDYNDA   1446
C                                                                       WDYNDA   1447
C                                                                       WDYNDA   1448
 1000 FORMAT(I5,1X,A4,4I5)                                              WDYNDA   1449
 1010 FORMAT(8F10.5)                                                    WDYNDA   1450
 1060 FORMAT(A12,1X,A4,I5,2I5,A12)                                      WDYNDA   1451
 1090 FORMAT(4I10,8X,A2)                                                WDYNDA   1452
 1100 FORMAT(A5)                                                        WDYNDA   1453
 1110 FORMAT(3I10,6X,A4)                                                WDYNDA   1454
 1120 FORMAT(2I10,2A12,A2)                                              WDYNDA   1455
 1130 FORMAT(2I10,F10.5,A12)                                            WDYNDA   1456
 1140 FORMAT(2I10,A12,A4)                                               WDYNDA   1457
 1150 FORMAT(2I10,F10.5,I10)                                            WDYNDA   1458
C                                                                       WDYNDA   1459
      END                                                               WDYNDA   1460
C                                                                       WDYNDA   1461
      SUBROUTINE WRANDA(IUX,IUY,IEBK)                                   WDYNDA   1462
CD                                                                      WDYNDA   1463
CD    TO WRITE RANI DATA.                                               WDYNDA   1464
CD                                                                      WDYNDA   1465
CD    ROUT INPUT:                                                       WDYNDA   1466
CD                                                                      WDYNDA   1467
CD    IUX IS THE UNIT OF WHICH RANI DATA IS WRITE                       WDYNDA   1468
CD    IUY IS THE UNIT OF WHICH ERROR AND WARNING MESSAGE WILL BE WRITTENWDYNDA   1469
CD    IEBK IS ERROR INDICATOR                                           WDYNDA   1470
CD    IEBK = 1 WHEN RANI BUSES EXCEED THE PROGRAM LIMIT                 WDYNDA   1471
CD                                                                      WDYNDA   1472
C                                                                       WDYNDA   1473
      INCLUDE 'PARX.INS'                                                WDYNDA   1474
      INCLUDE 'CNFLAG.INS'                                              WDYNDA   1475
      INCLUDE 'CNB19.INS'                                               WDYNDA   1476
C      INCLUDE 'CNMNEW.INS/LIST'                                        WDYNDA   1477
      INCLUDE 'CNJPT.INS'                                               WDYNDA   1478
      INCLUDE 'CNJDAT.INS'                                              WDYNDA   1479
      INCLUDE 'CNTMDA.INS'                                              WDYNDA   1480
      INCLUDE 'CNUNIT.INS'                                              WDYNDA   1481
      INCLUDE 'CNMSG.INS'                                               WDYNDA   1482
      INCLUDE 'CNPARX.INS'                                              WDYNDA   1483
C                                                                       WDYNDA   1484
      CHARACTER*5 EDATA,CNRAN                                           WDYNDA   1485
      CHARACTER*12 RANIA1,RANIA2                                        WDYNDA   1486
      INTEGER IBUSN(3),JBUSN(3)                                         WDYNDA   1487
C                                                                       WDYNDA   1488
      CHARACTER*2 KCKT1                                                 WDYNDA   1489
      EQUIVALENCE (IBUSN(1),RANIA1),(JBUSN(1),RANIA2)                   WDYNDA   1490
C                                                                       WDYNDA   1491
      DATA EDATA/'EDATA'/,CNRAN/' NRAN'/                                WDYNDA   1492
C                                                                       WDYNDA   1493
C     WRITING RANI DATA                                                 WDYNDA   1494
C                                                                       WDYNDA   1495
      LDEB=(JDEB(8).NE.0)                                               WDYNDA   1496
C                                                                       WDYNDA   1497
      WRITE(IUX,1100) CNRAN                                             WDYNDA   1498
C                                                                       WDYNDA   1499
      DO 100 KK=1,JRANI                                                 WDYNDA   1500
C                                                                       WDYNDA   1501
      JJTLN=JJRDAT(KK)                                                  WDYNDA   1502
C                                                                       WDYNDA   1503
      IF(KLFO.EQ.0)THEN                                                 WDYNDA   1504
C                                                                       WDYNDA   1505
      NLF1=ITDDAT(JJTLN+1)                                              WDYNDA   1506
      NLF2=ITDDAT(JJTLN+2)                                              WDYNDA   1507
      JCKID=ITDDAT(JJTLN+3)                                             WDYNDA   1508
      CALL UNPACK(KCKT1,LL,JCKID)                                       WDYNDA   1509
      NRTYPX=ITDDAT(JJTLN+4)                                            WDYNDA   1510
      IBFARX=ITDDAT(JJTLN+5)                                            WDYNDA   1511
      IDIVX=ITDDAT(JJTLN+7)                                             WDYNDA   1512
C                                                                       WDYNDA   1513
      JJTLN=JJTLN+7                                                     WDYNDA   1514
C                                                                       WDYNDA   1515
      WRITE (IUX,1000) NLF1,NLF2,KCKT1,NRTYPX,IBFARX,IDIVX              WDYNDA   1516
C                                                                       WDYNDA   1517
      ELSE                                                              WDYNDA   1518
C                                                                       WDYNDA   1519
      IBUSN(1)=ITDDAT(JJTLN+1)                                          WDYNDA   1520
      IBUSN(2)=ITDDAT(JJTLN+2)                                          WDYNDA   1521
      IBUSN(3)=ITDDAT(JJTLN+3)                                          WDYNDA   1522
      JBUSN(1)=ITDDAT(JJTLN+4)                                          WDYNDA   1523
      JBUSN(2)=ITDDAT(JJTLN+5)                                          WDYNDA   1524
      JBUSN(3)=ITDDAT(JJTLN+6)                                          WDYNDA   1525
      JCKID=ITDDAT(JJTLN+7)                                             WDYNDA   1526
      CALL UNPACK(KCKT1,LL,JCKID)                                       WDYNDA   1527
      NRTYPX=ITDDAT(JJTLN+8)                                            WDYNDA   1528
      IBFARX=ITDDAT(JJTLN+9)                                            WDYNDA   1529
      IDIVX=ITDDAT(JJTLN+11)                                            WDYNDA   1530
C                                                                       WDYNDA   1531
      JJTLN=JJTLN+11                                                    WDYNDA   1532
C                                                                       WDYNDA   1533
      WRITE (IUX,1030) RANIA1,RANIA2,KCKT1,NRTYPX,IBFARX,IDIVX          WDYNDA   1534
C                                                                       WDYNDA   1535
      ENDIF                                                             WDYNDA   1536
C                                                                       WDYNDA   1537
C     WRITE THE USER DEFINED RANI DATA                                  WDYNDA   1538
C                                                                       WDYNDA   1539
      NUF=6                                                             WDYNDA   1540
      CALL WUDMDA(NUF,IUX,IUY,JJTLN)                                    WDYNDA   1541
C                                                                       WDYNDA   1542
 100  CONTINUE                                                          WDYNDA   1543
C                                                                       WDYNDA   1544
      WRITE(IUX,1100) EDATA                                             WDYNDA   1545
C                                                                       WDYNDA   1546
      RETURN                                                            WDYNDA   1547
C                                                                       WDYNDA   1548
 1000 FORMAT(2I5,3X,A2,3I5)                                             WDYNDA   1549
 1010 FORMAT(1X,'*** ERROR RANI BUSES'                                  WDYNDA   1550
     &,' EXCEEDS THE LIMIT OF ',I4)                                     WDYNDA   1551
 1020 FORMAT(' *** RANI BUS NAME ERROR',                                WDYNDA   1552
     &       ' CHECK THE FOLLOWING CARD :')                             WDYNDA   1553
 1030 FORMAT (2A12,4X,A2,3I5)                                           WDYNDA   1554
 1040 FORMAT(' *** WRITE ERROR AT THE CARD:')                           WDYNDA   1555
 1041 FORMAT(11X,'THIS IS THE FIRST CARD OF THE',                       WDYNDA   1556
     & ' RANI DEVICE LAST WRITE:')                                      WDYNDA   1557
 1050 FORMAT(1X,'*** ERROR RANI HAS UNKOWN TYPE',I5)                    WDYNDA   1558
 1070 FORMAT(' *** ERROR BUS NUMBER OF THE ABOVE RANI EXCEEDED',I6)     WDYNDA   1559
 1100 FORMAT(A5)                                                        WDYNDA   1560
      END                                                               WDYNDA   1561
C                                                                       WDYNDA   1562
      SUBROUTINE WSTPDA(IUX,IUY,IEBK)                                   WDYNDA   1563
CD                                                                      WDYNDA   1564
CD    THIS ROUTINE WRITES STP DATA TO A USER SPECIFIED FILE.            WDYNDA   1565
CD                                                                      WDYNDA   1566
CD    ROUTINE INPUTS:                                                   WDYNDA   1567
CD                                                                      WDYNDA   1568
CD    IUX IS THE UNIT OF WHICH STP DATA IS WRITE                        WDYNDA   1569
CD    IUY IS THE UNIT OF WHICH ERROR AND WARNING MESSAGE IS WRITTEN     WDYNDA   1570
CD    IEBK IS THE ERROR INDICATOR                                       WDYNDA   1571
CD                                                                      WDYNDA   1572
      INCLUDE 'PARX.INS'                                                WDYNDA   1573
      INCLUDE 'CNFLAG.INS'                                              WDYNDA   1574
      INCLUDE 'CNB19.INS'                                               WDYNDA   1575
      INCLUDE 'CNMNEW.INS'                                              WDYNDA   1576
      INCLUDE 'CNJPT.INS'                                               WDYNDA   1577
      INCLUDE 'CNJDAT.INS'                                              WDYNDA   1578
      INCLUDE 'CNTMDA.INS'                                              WDYNDA   1579
      INCLUDE 'CNUNIT.INS'                                              WDYNDA   1580
      INCLUDE 'CNMSG.INS'                                               WDYNDA   1581
      INCLUDE 'CNPARX.INS'                                              WDYNDA   1582
C                                                                       WDYNDA   1583
      CHARACTER*5 CNSTP,EDATA                                           WDYNDA   1584
      CHARACTER*12 STPA1,STPA2                                          WDYNDA   1585
      CHARACTER*2 KCKT1                                                 WDYNDA   1586
C                                                                       WDYNDA   1587
      DATA EDATA/'EDATA'/,CNSTP/' NSTP'/                                WDYNDA   1588
C                                                                       WDYNDA   1589
      LDEB=(JDEB(8).NE.0)                                               WDYNDA   1590
C                                                                       WDYNDA   1591
C     WRITING STP DATA                                                  WDYNDA   1592
C                                                                       WDYNDA   1593
      WRITE(IUX,1100) CNSTP                                             WDYNDA   1594
C                                                                       WDYNDA   1595
      DO 150 KK=1,JTCPS                                                 WDYNDA   1596
C                                                                       WDYNDA   1597
      JJTLN=JJTPDA(KK)                                                  WDYNDA   1598
      NLF1=ITDDAT(JJTLN+1)                                              WDYNDA   1599
      NLF2=ITDDAT(JJTLN+2)                                              WDYNDA   1600
      JCKID=ITDDAT(JJTLN+3)                                             WDYNDA   1601
      CALL UNPACK(KCKT1,LL,JCKID)                                       WDYNDA   1602
      NTTYPX=ITDDAT(JJTLN+4)                                            WDYNDA   1603
      NPTYPX=ITDDAT(JJTLN+5)                                            WDYNDA   1604
      ITABT=ITDDAT(JJTLN+6)                                             WDYNDA   1605
      ITABP=ITDDAT(JJTLN+7)                                             WDYNDA   1606
      IDIVX=ITDDAT(JJTLN+20)                                            WDYNDA   1607
C                                                                       WDYNDA   1608
      IF(KLFO.EQ.0)THEN                                                 WDYNDA   1609
      WRITE(IUX,1010) NLF1,NLF2,KCKT1,NTTYPX,NPTYPX,ITABT,ITABP,IDIVX   WDYNDA   1610
      ELSE                                                              WDYNDA   1611
      CALL CHKNAM(STPA1,NLF1)                                           WDYNDA   1612
      CALL CHKNAM(STPA2,NLF2)                                           WDYNDA   1613
      WRITE(IUX,1040) STPA1,STPA2,KCKT1,NTTYPX,NPTYPX                   WDYNDA   1614
     &                                 ,ITABT,ITABP,IDIVX               WDYNDA   1615
      ENDIF                                                             WDYNDA   1616
C                                                                       WDYNDA   1617
      WRITE(IUX,1500) (TDDAT(JJTLN+JJ),JJ=8,11)                         WDYNDA   1618
      JJTLN=JJTLN+20                                                    WDYNDA   1619
C                                                                       WDYNDA   1620
      IF(ITABT.GT.0)THEN                                                WDYNDA   1621
        NLNT=ITABT/4                                                    WDYNDA   1622
        DO 100 LJ=1,NLNT                                                WDYNDA   1623
          WRITE(IUX,1500) (TDDAT(JJTLN+JJ),JJ=1,8)                      WDYNDA   1624
          JJTLN=JJTLN+8                                                 WDYNDA   1625
100     CONTINUE                                                        WDYNDA   1626
        IMORE=MOD(ITABT,4)*2                                            WDYNDA   1627
        WRITE(IUX,1500) (TDDAT(JJTLN+JJ),JJ=1,IMORE)                    WDYNDA   1628
        JJTLN=JJTLN+IMORE                                               WDYNDA   1629
      ENDIF                                                             WDYNDA   1630
C                                                                       WDYNDA   1631
      IF(ITABP.GT.0)THEN                                                WDYNDA   1632
        NLNT=ITABP/4                                                    WDYNDA   1633
        DO 120 LJ=1,NLNT                                                WDYNDA   1634
          WRITE(IUX,1500) (TDDAT(JJTLN+JJ),JJ=1,8)                      WDYNDA   1635
          JJTLN=JJTLN+8                                                 WDYNDA   1636
120     CONTINUE                                                        WDYNDA   1637
        IMORE=MOD(ITABP,4)*2                                            WDYNDA   1638
        WRITE(IUX,1500) (TDDAT(JJTLN+JJ),JJ=1,IMORE)                    WDYNDA   1639
        JJTLN=JJTLN+IMORE                                               WDYNDA   1640
      ENDIF                                                             WDYNDA   1641
C                                                                       WDYNDA   1642
C     WRITING STC DATA                                                  WDYNDA   1643
C                                                                       WDYNDA   1644
      IF(NTTYPX.NE.50) GO TO 130                                        WDYNDA   1645
C                                                                       WDYNDA   1646
C     WRITE USER DEFINED STC DATA                                       WDYNDA   1647
C                                                                       WDYNDA   1648
      NUF=7                                                             WDYNDA   1649
      CALL WUDMDA(NUF,IUX,IUY,JJTLN)                                    WDYNDA   1650
C                                                                       WDYNDA   1651
  130 CONTINUE                                                          WDYNDA   1652
C                                                                       WDYNDA   1653
C     STANDARD STC DATA (FOR FUTURE USE)                                WDYNDA   1654
C                                                                       WDYNDA   1655
C     WRITING SPS DATA                                                  WDYNDA   1656
C                                                                       WDYNDA   1657
      IF(NPTYPX.NE.50) GO TO 140                                        WDYNDA   1658
C                                                                       WDYNDA   1659
C     USER DEFINED SPS DATA                                             WDYNDA   1660
C                                                                       WDYNDA   1661
      JJTLN=JJPDAT(JTCPS)                                               WDYNDA   1662
      NUF=8                                                             WDYNDA   1663
      CALL WUDMDA(NUF,IUX,IUY,JJTLN)                                    WDYNDA   1664
      GO TO 150                                                         WDYNDA   1665
C                                                                       WDYNDA   1666
  140 CONTINUE                                                          WDYNDA   1667
C                                                                       WDYNDA   1668
C     STANDARD SPS DATA (FOR FUTURE)                                    WDYNDA   1669
C                                                                       WDYNDA   1670
      GOTO 150                                                          WDYNDA   1671
C                                                                       WDYNDA   1672
  150 CONTINUE                                                          WDYNDA   1673
C                                                                       WDYNDA   1674
      WRITE(IUX,1100) EDATA                                             WDYNDA   1675
C                                                                       WDYNDA   1676
      RETURN                                                            WDYNDA   1677
C                                                                       WDYNDA   1678
 1500 FORMAT (8F10.5)                                                   WDYNDA   1679
 1010 FORMAT(2I5,3X,A2,5I5)                                             WDYNDA   1680
 1040 FORMAT (2A12,4X,A2,5I5)                                           WDYNDA   1681
 1100 FORMAT(A5)                                                        WDYNDA   1682
      END                                                               WDYNDA   1683
C                                                                       WDYNDA   1684
      SUBROUTINE WSDBDA(IUX,IUY,IEBK)                                   WDYNDA   1685
CD                                                                      WDYNDA   1686
CD    TO READ SDB DATA.                                                 WDYNDA   1687
CD                                                                      WDYNDA   1688
      INCLUDE 'PARX.INS'                                                WDYNDA   1689
      INCLUDE 'CNFLAG.INS'                                              WDYNDA   1690
      INCLUDE 'CNMNEW.INS'                                              WDYNDA   1691
      INCLUDE 'CNJPT.INS'                                               WDYNDA   1692
      INCLUDE 'CNJDAT.INS'                                              WDYNDA   1693
      INCLUDE 'CNTMDA.INS'                                              WDYNDA   1694
      INCLUDE 'CNUNIT.INS'                                              WDYNDA   1695
      INCLUDE 'CNMSG.INS'                                               WDYNDA   1696
      INCLUDE 'CNPARX.INS'                                              WDYNDA   1697
C                                                                       WDYNDA   1698
      CHARACTER*5 CNSDB,EDATA                                           WDYNDA   1699
      CHARACTER*12 SDBA1                                                WDYNDA   1700
      DIMENSION IBUSN(3)                                                WDYNDA   1701
      EQUIVALENCE (IBUSN(1),SDBA1)                                      WDYNDA   1702
C                                                                       WDYNDA   1703
      DATA CNSDB/' NSDB'/,EDATA/'EDATA'/                                WDYNDA   1704
C                                                                       WDYNDA   1705
      LDEB=(JDEB(8).NE.0)                                               WDYNDA   1706
C                                                                       WDYNDA   1707
C     WRITING SDB DATA                                                  WDYNDA   1708
C                                                                       WDYNDA   1709
      WRITE(IUX,1030) CNSDB                                             WDYNDA   1710
C                                                                       WDYNDA   1711
      DO 150 KK=1,JSDB                                                  WDYNDA   1712
C                                                                       WDYNDA   1713
      JJTLN=JSDBDA(KK)                                                  WDYNDA   1714
      IF(KLFO.EQ.0)THEN                                                 WDYNDA   1715
      NLF1=ITDDAT(JJTLN+1)                                              WDYNDA   1716
      NDTYPX=ITDDAT(JJTLN+2)                                            WDYNDA   1717
      IDIVX=ITDDAT(JJTLN+3)                                             WDYNDA   1718
      JJTLN=JJTLN+3                                                     WDYNDA   1719
      WRITE(IUX,1020) NLF1,NDTYPX,IDIVX                                 WDYNDA   1720
      ELSE                                                              WDYNDA   1721
      IBUSN(1)=ITDDAT(JJTLN+1)                                          WDYNDA   1722
      IBUSN(2)=ITDDAT(JJTLN+2)                                          WDYNDA   1723
      IBUSN(3)=ITDDAT(JJTLN+3)                                          WDYNDA   1724
      NDTYPX=ITDDAT(JJTLN+4)                                            WDYNDA   1725
      IDIVX=ITDDAT(JJTLN+5)                                             WDYNDA   1726
      JJTLN=JJTLN+5                                                     WDYNDA   1727
      WRITE(IUX,1050) SDBA1,NDTYPX,IDIVX                                WDYNDA   1728
      ENDIF                                                             WDYNDA   1729
C                                                                       WDYNDA   1730
C     USER DEFINED SDB DATA                                             WDYNDA   1731
C                                                                       WDYNDA   1732
      NUF=9                                                             WDYNDA   1733
      CALL WUDMDA(NUF,IUX,IUY,JJTLN)                                    WDYNDA   1734
C                                                                       WDYNDA   1735
  150 CONTINUE                                                          WDYNDA   1736
C                                                                       WDYNDA   1737
      WRITE(IUX,1030) EDATA                                             WDYNDA   1738
C                                                                       WDYNDA   1739
      RETURN                                                            WDYNDA   1740
C                                                                       WDYNDA   1741
 1020 FORMAT(3I5)                                                       WDYNDA   1742
 1030 FORMAT(A5)                                                        WDYNDA   1743
 1050 FORMAT (A12,I3,I5)                                                WDYNDA   1744
      END                                                               WDYNDA   1745
C                                                                       WDYNDA   1746
      SUBROUTINE WUDMDA(NUF,IUX,IU16X,JJTLN)                            WDYNDA   1747
CD                                                                      WDYNDA   1748
CD    TO WRITE THE COMMON DATA OF AN USER DEFINED AC DYNAMIC MODELS.    WDYNDA   1749
CD                                                                      WDYNDA   1750
CD    ROUTINE INPUTS:                                                   WDYNDA   1751
CD                                                                      WDYNDA   1752
CD    NUF=1 USER DEFINED EXCITER                                        WDYNDA   1753
CD       =2              STABILIZER                                     WDYNDA   1754
CD       =3              UEL , OEL                                      WDYNDA   1755
CD       =4              GOVERNOR                                       WDYNDA   1756
CD       =5              SVC                                            WDYNDA   1757
CD       =6*             RANI                                           WDYNDA   1758
CD       =7              STC                                            WDYNDA   1759
CD       =8              STP                                            WDYNDA   1760
CD       =9              SDB                                            WDYNDA   1761
CD                                                                      WDYNDA   1762
CD    IUX IS THE UNIT OF WHICH THE DATA IS WRITTEN                      WDYNDA   1763
CD    IU16X IS NOT USED IN THE CURRENT VERSION                          WDYNDA   1764
CD    JJTLN IS THE DATA STARTING POSITION                               WDYNDA   1765
CD                                                                      WDYNDA   1766
      INCLUDE 'PARX.INS'                                                WDYNDA   1767
      INCLUDE 'CNPT.INS'                                                WDYNDA   1768
      INCLUDE 'CNB19.INS'                                               WDYNDA   1769
      INCLUDE 'CNFLAG.INS'                                              WDYNDA   1770
      INCLUDE 'CNPARX.INS'                                              WDYNDA   1771
      INCLUDE 'CNUNIT.INS'                                              WDYNDA   1772
      INCLUDE 'CNTMDA.INS'                                              WDYNDA   1773
      INCLUDE 'CNMSG.INS'                                               WDYNDA   1774
C                                                                       WDYNDA   1775
      CHARACTER*80 SIMBUF                                               WDYNDA   1776
      CHARACTER*8 BLNAME                                                WDYNDA   1777
      CHARACTER*12 BUSNAM,BUSR1(2),BUSR2(2),BUSNX(5),LPGNAM             WDYNDA   1778
      CHARACTER*4 INPNA(4),IENAME(20),IGNAME(20),ISNAME(20),IRNAME(20)  WDYNDA   1779
     &,ITNAME(20),IPNAME(20),IDNAME(20),IUNAME(60),IXNAME(80),LPGID     WDYNDA   1780
      CHARACTER*3 INUL3,BLTYP,BTYPE(71),UNAM(9)                         WDYNDA   1781
      CHARACTER*2 KCKT(8)                                               WDYNDA   1782
      INTEGER*4 IBUSN(3),JCKT                                           WDYNDA   1783
      CHARACTER*2 CKT                                                   WDYNDA   1784
      DIMENSION XNSIGN(4),NIBL(16)                                      WDYNDA   1785
C                                                                       WDYNDA   1786
      EQUIVALENCE (IBUSN(1),BUSNAM,BLNAME)                              WDYNDA   1787
C                                                                       WDYNDA   1788
      EQUIVALENCE (IUNAME(1),IXNAME(21))                                WDYNDA   1789
C                                                                       WDYNDA   1790
      EQUIVALENCE (LPGID,ILPGID)                                        WDYNDA   1791
C                                                                       WDYNDA   1792
      DATA INUL3/'   '/                                                 WDYNDA   1793
C                                                                       WDYNDA   1794
C     USER DEFINED DEVICE NAME                                          WDYNDA   1795
C                                                                       WDYNDA   1796
      DATA UNAM/'EXC','PSS','EXL','GOV','SVC','RAN','STC','SPS','SDB'/  WDYNDA   1797
C                                                                       WDYNDA   1798
C     BLOCK TYPE GENERAL AND END BLOCKS                                 WDYNDA   1799
C                                                                       WDYNDA   1800
      DATA BTYPE/' GN',' IN',' PI',' WO',' LL',' SW',' HV',' LV','MUL', WDYNDA   1801
     1           'DIV','IVL','DEL','SIN','COS','TAN','ASN','ACS','ATN', WDYNDA   1802
     2           'EXP','LOG','ABS',' SS','NLF',' TF','DIG','A/D','LSW', WDYNDA   1803
     3           'TIM','HYS','CTR',' E1',' E2',' E3',' E4',' E5',' E6', WDYNDA   1804
     4           ' E7',' E8','E15','E30','E31','E34','RHL',' T1',' T4', WDYNDA   1805
     5           'T20','T22','OF2','OF1',' LF','SD1','SD2','SD3','SD4', WDYNDA   1806
     6           'SD5','SD6','SD7','SD8','SD9','   ','   ','   ','   ', WDYNDA   1807
     7           '   ','   ','   ','   ','   ','POW','COM',' FL'/       WDYNDA   1808
C                                                                       WDYNDA   1809
C     INPUT SIGNAL NAMES OF EXCITATION SYSTEM, PSS AND UEL              WDYNDA   1810
C                                                                       WDYNDA   1811
      DATA IENAME/'  VC','  AC','PACC','  VT','  AT','  VD','  VQ',     WDYNDA   1812
     1            '  ID','  IQ','  PT','  QT','  DW','CONT','TIME',     WDYNDA   1813
     2            ' EFD',' IFD','  VS','  VU','  VF','VREF'/            WDYNDA   1814
C                                                                       WDYNDA   1815
C     INPUT SIGNAL NAMES OF GENERATOR PRIME MOVER                       WDYNDA   1816
C                                                                       WDYNDA   1817
      DATA IGNAME/'  VG',' VG2','PACC','  VT','  AT','  VD','  VQ',     WDYNDA   1818
     1            '  ID','  IQ','  PT','  QT','  DW','CONT','TIME',     WDYNDA   1819
     2            '    ','    ','    ','    ','    ','VREF'/            WDYNDA   1820
C                                                                       WDYNDA   1821
C     INPUT SIGNAL NAMES OF SVC                                         WDYNDA   1822
C                                                                       WDYNDA   1823
      DATA ISNAME/'ISVC','ITCR','QSVC','QTCR','BSVC','BTCR','VSVC',     WDYNDA   1824
     1            '    ','ASVC','    ','STCR','SSVC','CONT','TIME',     WDYNDA   1825
     2            '    ','    ','    ','    ','    ','VREF'/            WDYNDA   1826
C                                                                       WDYNDA   1827
C     INPUT SIGNAL NAMES OF RANI                                        WDYNDA   1828
C                                                                       WDYNDA   1829
      DATA IRNAME/'IRAN','ITCR','QRAN','QTCR','BRAN','BTCR','  V1',     WDYNDA   1830
     1            '  V2','  A1','  A2','STCR','SRAN','CONT','TIME',     WDYNDA   1831
     2            'GRAN','PRAN','XRAN','    ','    ','VREF'/            WDYNDA   1832
C                                                                       WDYNDA   1833
C     INPUT SIGNAL NAMES OF STC                                         WDYNDA   1834
C                                                                       WDYNDA   1835
      DATA ITNAME/'  I1','  I2','  P1','  P2','TSTC','    ','  V1',     WDYNDA   1836
     1            '  V2','  A1','  A2','SSTC','    ','CONT','TIME',     WDYNDA   1837
     2            '  Q1','  Q2','    ','    ','    ','VREF'/            WDYNDA   1838
C                                                                       WDYNDA   1839
C     INPUT SIGNAL NAMES OF SPS                                         WDYNDA   1840
C                                                                       WDYNDA   1841
      DATA IPNAME/'  I1','  I2','  P1','  P2','    ','TSPS','  V1',     WDYNDA   1842
     1            '  V2','  A1','  A2','SSTC','    ','CONT','TIME',     WDYNDA   1843
     2            '  Q1','  Q2','    ','    ','    ','VREF'/            WDYNDA   1844
C                                                                       WDYNDA   1845
C     INPUT SIGNAL NAMES OF SDB                                         WDYNDA   1846
C                                                                       WDYNDA   1847
      DATA IDNAME/'ISDB','    ','MSDB','    ','YSDB','    ','VSDB',     WDYNDA   1848
     1            '    ','ASDB','    ','    ','SSDB','CONT','TIME',     WDYNDA   1849
     2            '    ','    ','    ','    ','    ','    '/            WDYNDA   1850
C                                                                       WDYNDA   1851
      DATA IUNAME/'VR01','VR02','VR03','VR04','VR05','VR06','VR07',     WDYNDA   1852
     1            'VR08','VR09','VR10','AR01','AR02','AR03','AR04',     WDYNDA   1853
     2            'AR05','AR06','AR07','AR08','AR09','AR10','IR01',     WDYNDA   1854
     3            'IR02','IR03','IR04','IR05','IR06','IR07','IR08',     WDYNDA   1855
     4            'IR09','IR10','PR01','PR02','PR03','PR04','PR05',     WDYNDA   1856
     5            'PR06','PR07','PR08','PR09','PR10','QR01','QR02',     WDYNDA   1857
     6            'QR03','QR04','QR05','QR06','QR07','QR08','QR09',     WDYNDA   1858
     7            'QR10','PF01','PF02','PF03','PF04','PF05','PF06',     WDYNDA   1859
     8            'PF07','PF08','PF09','PF10'/                          WDYNDA   1860
C                                                                       WDYNDA   1861
C                                                                       WDYNDA   1862
C                                                                       WDYNDA   1863
      LDEB=(JDEB(268).NE.0)                                             WDYNDA   1864
C                                                                       WDYNDA   1865
CD                                                                      WDYNDA   1866
CD    SETUP IXNAME TABLE ACCORDING TO THE TYPE OF USER DEFINED MODEL    WDYNDA   1867
CD                                                                      WDYNDA   1868
      IF(NUF.LE.3) THEN                                                 WDYNDA   1869
         DO 100 J=1,20                                                  WDYNDA   1870
         IXNAME(J)=IENAME(J)                                            WDYNDA   1871
  100    CONTINUE                                                       WDYNDA   1872
      ELSEIF(NUF.EQ.4) THEN                                             WDYNDA   1873
         DO 110 J=1,20                                                  WDYNDA   1874
         IXNAME(J)=IGNAME(J)                                            WDYNDA   1875
  110    CONTINUE                                                       WDYNDA   1876
      ELSEIF(NUF.EQ.5) THEN                                             WDYNDA   1877
         DO 120 J=1,20                                                  WDYNDA   1878
         IXNAME(J)=ISNAME(J)                                            WDYNDA   1879
  120    CONTINUE                                                       WDYNDA   1880
      ELSEIF(NUF.EQ.6) THEN                                             WDYNDA   1881
         DO 130 J=1,20                                                  WDYNDA   1882
         IXNAME(J)=IRNAME(J)                                            WDYNDA   1883
  130    CONTINUE                                                       WDYNDA   1884
      ELSEIF(NUF.EQ.7) THEN                                             WDYNDA   1885
         DO 140 J=1,20                                                  WDYNDA   1886
         IXNAME(J)=ITNAME(J)                                            WDYNDA   1887
  140    CONTINUE                                                       WDYNDA   1888
      ELSEIF(NUF.EQ.8) THEN                                             WDYNDA   1889
         DO 150 J=1,20                                                  WDYNDA   1890
         IXNAME(J)=IPNAME(J)                                            WDYNDA   1891
  150    CONTINUE                                                       WDYNDA   1892
      ELSEIF(NUF.EQ.9) THEN                                             WDYNDA   1893
         DO 160 J=1,20                                                  WDYNDA   1894
         IXNAME(J)=IDNAME(J)                                            WDYNDA   1895
  160    CONTINUE                                                       WDYNDA   1896
      ENDIF                                                             WDYNDA   1897
CD                                                                      WDYNDA   1898
CD    STEP 1. WRITE REMOTE BUSES                                        WDYNDA   1899
CD                                                                      WDYNDA   1900
      JJTLN=JJTLN+1                                                     WDYNDA   1901
      NITEM=ITDDAT(JJTLN)                                               WDYNDA   1902
C                                                                       WDYNDA   1903
      IF(KLFO.EQ.0)THEN                                                 WDYNDA   1904
C                                                                       WDYNDA   1905
        WRITE(IUX,1200) (ITDDAT(JJTLN+J),J=1,NITEM)                     WDYNDA   1906
        JJTLN=JJTLN+NITEM                                               WDYNDA   1907
C                                                                       WDYNDA   1908
      ELSE                                                              WDYNDA   1909
        KK=0                                                            WDYNDA   1910
 180    IFIN=MIN0(NITEM,5)                                              WDYNDA   1911
        DO 190 J=1,IFIN                                                 WDYNDA   1912
          IBUSN(1)=ITDDAT(JJTLN+1)                                      WDYNDA   1913
          IBUSN(2)=ITDDAT(JJTLN+2)                                      WDYNDA   1914
          IBUSN(3)=ITDDAT(JJTLN+3)                                      WDYNDA   1915
          JJTLN=JJTLN+3                                                 WDYNDA   1916
          BUSNX(J)=BUSNAM                                               WDYNDA   1917
 190    CONTINUE                                                        WDYNDA   1918
        WRITE(IUX,1180) (BUSNX(J),J=1,IFIN)                             WDYNDA   1919
        KK=KK+1                                                         WDYNDA   1920
        NITEM=NITEM-IFIN                                                WDYNDA   1921
        IF(NITEM.GT.0)GOTO 180                                          WDYNDA   1922
        IF(KK.EQ.1.AND.IFIN.EQ.5) WRITE(IUX,1200)                       WDYNDA   1923
C                                                                       WDYNDA   1924
      ENDIF                                                             WDYNDA   1925
C                                                                       WDYNDA   1926
  200 CONTINUE                                                          WDYNDA   1927
C                                                                       WDYNDA   1928
CD                                                                      WDYNDA   1929
CD    STEP 2. WRITE REMOTE LINES                                        WDYNDA   1930
CD                                                                      WDYNDA   1931
      JJTLN=JJTLN+1                                                     WDYNDA   1932
      NITEM=ITDDAT(JJTLN)                                               WDYNDA   1933
C                                                                       WDYNDA   1934
      IF(KLFO.EQ.0)THEN                                                 WDYNDA   1935
C                                                                       WDYNDA   1936
C   BUS NUMBER CASE                                                     WDYNDA   1937
C                                                                       WDYNDA   1938
        KK=0                                                            WDYNDA   1939
 210    IFIN=MIN0(NITEM,5)                                              WDYNDA   1940
        DO 220 J=1,IFIN                                                 WDYNDA   1941
          NIBL(J)=ITDDAT(JJTLN+1)                                       WDYNDA   1942
          NIBL(J+5)=ITDDAT(JJTLN+2)                                     WDYNDA   1943
          JCKT=ITDDAT(JJTLN+3)                                          WDYNDA   1944
          CALL UNPACK(CKT,KKK,JCKT)                                     WDYNDA   1945
          KCKT(J)=CKT                                                   WDYNDA   1946
          JJTLN=JJTLN+3                                                 WDYNDA   1947
 220    CONTINUE                                                        WDYNDA   1948
        WRITE(IUX,1070)(NIBL(J),NIBL(J+5),KCKT(J),J=1,IFIN)             WDYNDA   1949
        KK=KK+1                                                         WDYNDA   1950
        NITEM=NITEM-IFIN                                                WDYNDA   1951
        IF(NITEM.GT.0)GOTO 210                                          WDYNDA   1952
        IF(KK.EQ.1.AND.IFIN.EQ.5) WRITE(IUX,1200)                       WDYNDA   1953
C                                                                       WDYNDA   1954
      ELSE                                                              WDYNDA   1955
C                                                                       WDYNDA   1956
C   BUS NAME CASE                                                       WDYNDA   1957
C                                                                       WDYNDA   1958
        KK=0                                                            WDYNDA   1959
 240    IFIN=MIN0(NITEM,2)                                              WDYNDA   1960
        DO 250 J=1,IFIN                                                 WDYNDA   1961
          IBUSN(1)=ITDDAT(JJTLN+1)                                      WDYNDA   1962
          IBUSN(2)=ITDDAT(JJTLN+2)                                      WDYNDA   1963
          IBUSN(3)=ITDDAT(JJTLN+3)                                      WDYNDA   1964
          BUSR1(J)=BUSNAM                                               WDYNDA   1965
          IBUSN(1)=ITDDAT(JJTLN+4)                                      WDYNDA   1966
          IBUSN(2)=ITDDAT(JJTLN+5)                                      WDYNDA   1967
          IBUSN(3)=ITDDAT(JJTLN+6)                                      WDYNDA   1968
          BUSR2(J)=BUSNAM                                               WDYNDA   1969
          JCKT=ITDDAT(JJTLN+7)                                          WDYNDA   1970
          CALL UNPACK(CKT,KKK,JCKT)                                     WDYNDA   1971
          KCKT(J)=CKT                                                   WDYNDA   1972
 250    CONTINUE                                                        WDYNDA   1973
        WRITE(IUX,1190) (BUSR1(J),BUSR2(J),KCKT(J),J=1,IFIN)            WDYNDA   1974
        KK=KK+1                                                         WDYNDA   1975
        NITEM=NITEM-IFIN                                                WDYNDA   1976
        IF(NITEM.GT.0)GOTO 240                                          WDYNDA   1977
        IF(KK.LT.5.AND.IFIN.EQ.2)WRITE(IUX,1200)                        WDYNDA   1978
C                                                                       WDYNDA   1979
      ENDIF                                                             WDYNDA   1980
CD                                                                      WDYNDA   1981
CD    STEP 3. WRITE INDIVIDUAL BLOCKS                                   WDYNDA   1982
CD                                                                      WDYNDA   1983
      JJTLN=JJTLN+1                                                     WDYNDA   1984
      NBLOCK=ITDDAT(JJTLN)                                              WDYNDA   1985
C                                                                       WDYNDA   1986
      DO 260 KG=1,NBLOCK                                                WDYNDA   1987
C                                                                       WDYNDA   1988
      IBUSN(1)=ITDDAT(JJTLN+1)                                          WDYNDA   1989
      IBUSN(2)=ITDDAT(JJTLN+2)                                          WDYNDA   1990
      J=ITDDAT(JJTLN+3)                                                 WDYNDA   1991
      BLTYP=BTYPE(J)                                                    WDYNDA   1992
C                                                                       WDYNDA   1993
C     WRITING THE FIRST LINE DATA                                       WDYNDA   1994
C                                                                       WDYNDA   1995
      WRITE(SIMBUF(1:20),1210) BLNAME,BLTYP                             WDYNDA   1996
C                                                                       WDYNDA   1997
      IF(J.EQ.22)THEN                                                   WDYNDA   1998
        NAA=ITDDAT(JJTLN+4)                                             WDYNDA   1999
        NBB=ITDDAT(JJTLN+5)                                             WDYNDA   2000
        WRITE(SIMBUF(21:80),1140) NAA,NBB                               WDYNDA   2001
        WRITE(IUX,'(A)')SIMBUF                                          WDYNDA   2002
        DO 400 LL=1,NAA                                                 WDYNDA   2003
          WRITE(IUX,1220) (TDDAT(JJTLN+LJ+17),LJ=1,NAA)                 WDYNDA   2004
          JJTLN=JJTLN+NAA                                               WDYNDA   2005
  400   CONTINUE                                                        WDYNDA   2006
        DO 410 LL=1,NAA                                                 WDYNDA   2007
          WRITE(IUX,1220) (TDDAT(JJTLN+LJ+17),LJ=1,NBB)                 WDYNDA   2008
          JJTLN=JJTLN+NBB                                               WDYNDA   2009
  410   CONTINUE                                                        WDYNDA   2010
        WRITE(IUX,1220) (TDDAT(JJTLN+LJ+17),LJ=1,NAA)                   WDYNDA   2011
        JJTLN=JJTLN+NAA                                                 WDYNDA   2012
        WRITE(IUX,1220) (TDDAT(JJTLN+LJ+17),LJ=1,NBB)                   WDYNDA   2013
        JJTLN=JJTLN+NBB                                                 WDYNDA   2014
C                                                                       WDYNDA   2015
      ELSEIF(J.EQ.24.OR.J.EQ.26) THEN                                   WDYNDA   2016
        WRITE(SIMBUF(21:80),1150) ITDDAT(JJTLN+4),                      WDYNDA   2017
     +                            (TDDAT(JJTLN+LJ+3),LJ=2,6)            WDYNDA   2018
        WRITE(IUX,'(A)')SIMBUF                                          WDYNDA   2019
      ELSEIF(J.EQ.30)THEN                                               WDYNDA   2020
        WRITE(SIMBUF(21:80),1300) (TDDAT(JJTLN+LJ+3),LJ=1,4)            WDYNDA   2021
     &           ,ITDDAT(JJTLN+8),ITDDAT(JJTLN+9),ITDDAT(JJTLN+10)      WDYNDA   2022
        WRITE(IUX,'(A)')SIMBUF                                          WDYNDA   2023
      ELSEIF(J.EQ.53)THEN                                               WDYNDA   2024
        WRITE(SIMBUF(21:80),1240) (TDDAT(JJTLN+LJ+3),LJ=1,5),           WDYNDA   2025
     +                            ITDDAT(JJTLN+9)                       WDYNDA   2026
        WRITE(IUX,'(A)')SIMBUF                                          WDYNDA   2027
      ELSEIF(J.EQ.54)THEN                                               WDYNDA   2028
        WRITE(SIMBUF(21:80),1260) TDDAT(JJTLN+4)                        WDYNDA   2029
     &           ,TDDAT(JJTLN+5),ITDDAT(JJTLN+6),ITDDAT(JJTLN+7)        WDYNDA   2030
        WRITE(IUX,'(A)')SIMBUF                                          WDYNDA   2031
      ELSEIF(J.EQ.55.OR.J.EQ.56)THEN                                    WDYNDA   2032
        WRITE(SIMBUF(21:80),1250) (TDDAT(JJTLN+LJ+3),LJ=1,3)            WDYNDA   2033
     &           ,ITDDAT(JJTLN+7),ITDDAT(JJTLN+8)                       WDYNDA   2034
        WRITE(IUX,'(A)')SIMBUF                                          WDYNDA   2035
      ELSEIF(J.EQ.58.OR.J.EQ.59)THEN                                    WDYNDA   2036
        WRITE(SIMBUF(21:80),1310) (TDDAT(JJTLN+LJ+3),LJ=1,3)            WDYNDA   2037
     &           ,(ITDDAT(JJTLN+LJ+6),LJ=1,3)                           WDYNDA   2038
        WRITE(IUX,'(A)')SIMBUF                                          WDYNDA   2039
      ELSEIF(J.EQ.70)THEN                                               WDYNDA   2040
        WRITE(SIMBUF(21:80),1320) (TDDAT(JJTLN+LJ+3),LJ=1,2)            WDYNDA   2041
     &           ,(ITDDAT(JJTLN+LJ+5),LJ=1,3)                           WDYNDA   2042
        WRITE(IUX,'(A)')SIMBUF                                          WDYNDA   2043
      ELSE                                                              WDYNDA   2044
        WRITE(SIMBUF(21:80),1330) (TDDAT(JJTLN+LJ+3),LJ=1,6)            WDYNDA   2045
        WRITE(IUX,'(A)')SIMBUF                                          WDYNDA   2046
      ENDIF                                                             WDYNDA   2047
C                                                                       WDYNDA   2048
C     WRITING THE REST OF THE DATA                                      WDYNDA   2049
C                                                                       WDYNDA   2050
      IF((J.GE.23.AND.J.LE.25).OR.(J.GE.33.AND.J.LE.36).OR.             WDYNDA   2051
     &(J.GE.44.AND.J.LE.47).OR.J.EQ.29.OR.                              WDYNDA   2052
     & J.EQ.38.OR.(J.EQ.26.AND.ITDDAT(JJTLN+4).GT.5).OR.                WDYNDA   2053
     & J.EQ.53.OR.J.EQ.71)THEN                                          WDYNDA   2054
         IF(J.EQ.45) THEN                                               WDYNDA   2055
            LPGLFN=ITDDAT(JJTLN+14)                                     WDYNDA   2056
            ILPGID=ITDDAT(JJTLN+15)                                     WDYNDA   2057
            IF(KLFO.EQ.0) THEN                                          WDYNDA   2058
               WRITE (IUX,1081) (TDDAT(JJTLN+LJ),LJ=10,13),LPGLFN,LPGID WDYNDA   2059
            ELSE                                                        WDYNDA   2060
               CALL CHKNAM(LPGNAM,LPGLFN)                               WDYNDA   2061
               WRITE (IUX,1082) (TDDAT(JJTLN+LJ),LJ=10,13),LPGNAM,LPGID WDYNDA   2062
            ENDIF                                                       WDYNDA   2063
         ELSE                                                           WDYNDA   2064
           WRITE(IUX,1080) (TDDAT(JJTLN+LJ),LJ=10,15)                   WDYNDA   2065
         ENDIF                                                          WDYNDA   2066
       ENDIF                                                            WDYNDA   2067
C                                                                       WDYNDA   2068
       JJTLN=JJTLN+17                                                   WDYNDA   2069
C                                                                       WDYNDA   2070
C      WRITE EXTRA DATA FOR TYPE 44 BLOCK                               WDYNDA   2071
C                                                                       WDYNDA   2072
       IF(J.EQ.44) THEN                                                 WDYNDA   2073
       WRITE(IUX,1080) (TDDAT(JJTLN+LJ),LJ=1,4)                         WDYNDA   2074
       WRITE(IUX,1080) (TDDAT(JJTLN+LJ),LJ=5,8)                         WDYNDA   2075
       JJTLN=JJTLN+8                                                    WDYNDA   2076
       ENDIF                                                            WDYNDA   2077
C                                                                       WDYNDA   2078
 260   CONTINUE                                                         WDYNDA   2079
C                                                                       WDYNDA   2080
       WRITE(IUX,1200)                                                  WDYNDA   2081
C                                                                       WDYNDA   2082
CD                                                                      WDYNDA   2083
CD    STEP 4. WRITING BLOCK INTERCONNECTIONS                            WDYNDA   2084
CD                                                                      WDYNDA   2085
      JJTLN=JJTLN+1                                                     WDYNDA   2086
C                                                                       WDYNDA   2087
      NCONEC=ITDDAT(JJTLN)                                              WDYNDA   2088
      IEXTRA=MOD(NCONEC,8)                                              WDYNDA   2089
C                                                                       WDYNDA   2090
 520  IFIN=MIN0(NCONEC,8)                                               WDYNDA   2091
      DO 530 J=1,IFIN*2-1,2                                             WDYNDA   2092
      JJTLN=JJTLN+2                                                     WDYNDA   2093
      NIBL(J)=ITDDAT(JJTLN-1)                                           WDYNDA   2094
      NIBL(J+1)=ITDDAT(JJTLN)                                           WDYNDA   2095
 530  CONTINUE                                                          WDYNDA   2096
      WRITE(IUX,1200) (NIBL(J),J=1,IFIN*2)                              WDYNDA   2097
      NCONEC=NCONEC-IFIN                                                WDYNDA   2098
      IF(NCONEC.GT.0)GOTO 520                                           WDYNDA   2099
      IF(IEXTRA.EQ.0)WRITE(IUX,1200)                                    WDYNDA   2100
C                                                                       WDYNDA   2101
CD                                                                      WDYNDA   2102
CD    STEP 5. WRITE BLOCK INPUT DATA                                    WDYNDA   2103
CD                                                                      WDYNDA   2104
      JJTLN=JJTLN+1                                                     WDYNDA   2105
      NINPUT=ITDDAT(JJTLN)                                              WDYNDA   2106
C                                                                       WDYNDA   2107
      IEXTRA=MOD(NINPUT,4)                                              WDYNDA   2108
C                                                                       WDYNDA   2109
 640  IFIN=MIN0(NINPUT,4)                                               WDYNDA   2110
      DO 650 J=1,IFIN                                                   WDYNDA   2111
      JJTLN=JJTLN+3                                                     WDYNDA   2112
      NIBL(J)=ITDDAT(JJTLN-2)                                           WDYNDA   2113
      K=ITDDAT(JJTLN-1)                                                 WDYNDA   2114
      INPNA(J)=IXNAME(K)                                                WDYNDA   2115
      XNSIGN(J)=TDDAT(JJTLN)                                            WDYNDA   2116
 650  CONTINUE                                                          WDYNDA   2117
      WRITE(IUX,1010) (NIBL(J),INPNA(J),XNSIGN(J),J=1,IFIN)             WDYNDA   2118
      NINPUT=NINPUT-IFIN                                                WDYNDA   2119
      IF(NINPUT.GT.0)GOTO 640                                           WDYNDA   2120
      IF(IEXTRA.EQ.0)WRITE(IUX,1010)                                    WDYNDA   2121
C                                                                       WDYNDA   2122
 800  CONTINUE                                                          WDYNDA   2123
C                                                                       WDYNDA   2124
CD                                                                      WDYNDA   2125
CD    STEP 6. WRITE AND SET OUTPUT BLOCK                                WDYNDA   2126
CD                                                                      WDYNDA   2127
      IF(NUF.EQ.2)THEN                                                  WDYNDA   2128
      WRITE(IUX,1200) ITDDAT(JJTLN+1),ITDDAT(JJTLN+2)                   WDYNDA   2129
      ELSEIF(NUF.EQ.3) THEN                                             WDYNDA   2130
      WRITE(IUX,1200) ITDDAT(JJTLN+1)                                   WDYNDA   2131
      ENDIF                                                             WDYNDA   2132
C                                                                       WDYNDA   2133
      RETURN                                                            WDYNDA   2134
 1000 FORMAT (1X,'END WRITE UD ',A3,' DATA, JJTLN',I5)                  WDYNDA   2135
 1010 FORMAT (5(I5,1X,A4,F10.5))                                        WDYNDA   2136
 1020 FORMAT (1X,I4,2X,F10.5)                                           WDYNDA   2137
 1030 FORMAT(1X,'*** ERROR AT UD ',A3                                   WDYNDA   2138
     *,' HAS UNKNOWN SYSTEM INPUT. INPUT=',A5)                          WDYNDA   2139
 1040 FORMAT(1X,'*** ERROR AT UD ',A3                                   WDYNDA   2140
     *,' HAS UNKNOWN TYPE OF BLOCK. TYPE=',A3)                          WDYNDA   2141
 1050 FORMAT(1X,'*** ERROR AT UD ',A3                                   WDYNDA   2142
     *,' INCORRECT BLOCK INTERCONNECTION:')                             WDYNDA   2143
 1051 FORMAT(11X,'FROM BL',I3,'TO BL',I3)                               WDYNDA   2144
 1060 FORMAT(1X,'*** ERROR AT UD ',A3,' INPUT SIGNAL "'                 WDYNDA   2145
     &,A4,'" (TO BLOCK',I3,') IS NOT ALLOWED')                          WDYNDA   2146
 1070 FORMAT(5(2I5,3X,A2))                                              WDYNDA   2147
 1080 FORMAT(20X,6F10.5)                                                WDYNDA   2148
 1081 FORMAT(20X,4F10.5,I5,1X,A4)                                       WDYNDA   2149
 1082 FORMAT(20X,4F10.5,A12,1X,A4)                                      WDYNDA   2150
  1090 FORMAT(1X,'*** ERROR NO END BLOCK HAS BEEN DEFINED FOR UD ',A3)  WDYNDA   2151
 1100 FORMAT(1X                                                         WDYNDA   2152
     *,'*** ERROR MORE THAN ONE END BLOCK HAS BEEN DEFINED FOR UD ',A3) WDYNDA   2153
 1130 FORMAT(1X,'*** ERROR AT UD ',A3                                   WDYNDA   2154
     *,' INTERCONNECTION FROM END BLOCK TO')                            WDYNDA   2155
 1131 FORMAT(11X,'OTHER BLOCKS IS NOT ALLOWED: FROM BL',I3,'TO BL',I3)  WDYNDA   2156
 1140 FORMAT(9X,I1,9X,I1)                                               WDYNDA   2157
 1150 FORMAT(8X,I2,5F10.5)                                              WDYNDA   2158
 1160 FORMAT(' *** ERROR NO BLOCK HAS "VREF" INPUT IN UD ',A3)          WDYNDA   2159
 1170 FORMAT(' *** ERROR "VREF" INPUT HAS BEEN USED MORE THAN ONCE'     WDYNDA   2160
     *,' IN THE UD ',A3)                                                WDYNDA   2161
 1180 FORMAT(5A12)                                                      WDYNDA   2162
 1190 FORMAT(2(2A12,A2))                                                WDYNDA   2163
 1200 FORMAT (16I5)                                                     WDYNDA   2164
 1210 FORMAT(2X,A8,7X,A3)                                               WDYNDA   2165
 1220 FORMAT (8F10.5)                                                   WDYNDA   2166
 1230 FORMAT(1X,'*** ERROR AT UD ',A3,' (',A8                           WDYNDA   2167
     *,') HAS UNACCEPTABLE TYPE ',A3)                                   WDYNDA   2168
 1240 FORMAT(5F10.5,9X,I1)                                              WDYNDA   2169
 1250 FORMAT(3F10.5,2I5)                                                WDYNDA   2170
 1260 FORMAT(2F10.5,2I5)                                                WDYNDA   2171
 1270 FORMAT(1X,'*** ERROR NO END BLOCK IS ALLOWED FOR UD ',A3)         WDYNDA   2172
 1280 FORMAT(1X,'*** ERROR AT UD ',A3                                   WDYNDA   2173
     *,' NUMBER OF BLOCKS EXCEED THE LIMIT OF',I4)                      WDYNDA   2174
 1281 FORMAT(11X,'INCREASE NXUDB IN PARX.INS')                          WDYNDA   2175
C 1290 FORMAT(1X,'UD ',A3,' ERROR'                                      WDYNDA   2176
C     &,/,' NUMBER OF UD MODELS EXCEEDS THE LIMIT OF ',I4               WDYNDA   2177
C     &,/,' INCREASE NUDCM IN PARX.INS')                                WDYNDA   2178
 1300 FORMAT(4F10.5,3I5)                                                WDYNDA   2179
 1310 FORMAT(3F10.5,3I5)                                                WDYNDA   2180
 1320 FORMAT(2F10.5,3I5)                                                WDYNDA   2181
 1330 FORMAT(6F10.5)                                                    WDYNDA   2182
      END                                                               WDYNDA   2183
C                                                                       WDYNDA   2184
      SUBROUTINE WULTCD(IUX,IUY,IEBK)                                   WDYNDA   2185
CD                                                                      WDYNDA   2186
CD    TO READ ULTC DATA.                                                WDYNDA   2187
CD                                                   C                  WDYNDA   2188
CD    ROUTINE INPUTS:                                                   WDYNDA   2189
CD                                                                      WDYNDA   2190
CD     IUX IS THE UNIT OF WHICH DATA IS READ                            WDYNDA   2191
CD     IUY IS NOT USED IN THE CURRENT VERSION                           WDYNDA   2192
CD     IEBK IS AN ERROR INDICATOR                                       WDYNDA   2193
CD       = 0 NO ERROR                                                   WDYNDA   2194
CD       = 1 WHEN NUMBER OF ULTC EXCEEDS PROGRAM LIMIT                  WDYNDA   2195
CD       = 2 WHEN ULTC SECONDARY BUS IS NOT IN LOADFLOW                 WDYNDA   2196
CD       = 3 WHEN ULTC REFERENCE BUS IS NOT IN LOADFLOW                 WDYNDA   2197
CD       = 4 WHEN ULTC PRIMARY BUS OR SECONDARY BUS IS IN LOADFLOW      WDYNDA   2198
CD                                                                      WDYNDA   2199
      INCLUDE 'PARX.INS'                                                WDYNDA   2200
      INCLUDE 'CNPARX.INS'                                              WDYNDA   2201
      INCLUDE 'CNMNEW.INS'                                              WDYNDA   2202
      INCLUDE 'CNLFDA.INS'                                              WDYNDA   2203
      INCLUDE 'CNULTC.INS'                                              WDYNDA   2204
      INCLUDE 'CNTMDA.INS'                                              WDYNDA   2205
      INCLUDE 'CNFLAG.INS'                                              WDYNDA   2206
      INCLUDE 'CNMSG.INS'                                               WDYNDA   2207
C                                                                       WDYNDA   2208
      CHARACTER*12 BSNAMP,BSNAMS,BSNAMR                                 WDYNDA   2209
      CHARACTER*2 ICKT                                                  WDYNDA   2210
      CHARACTER*5 CULTC,EDATA                                           WDYNDA   2211
C                                                                       WDYNDA   2212
      DATA CULTC/' ULTC'/,EDATA/'EDATA'/                                WDYNDA   2213
C                                                                       WDYNDA   2214
      LDEB=.FALSE.                                                      WDYNDA   2215
C                                                                       WDYNDA   2216
      WRITE(IUX,1100) CULTC                                             WDYNDA   2217
C                                                                       WDYNDA   2218
      DO 100 KK=1,NULTC                                                 WDYNDA   2219
C                                                                       WDYNDA   2220
      JJTLN=JTULTC(KK)                                                  WDYNDA   2221
      NLFP=ITDDAT(JJTLN+1)                                              WDYNDA   2222
      NLFS=ITDDAT(JJTLN+2)                                              WDYNDA   2223
      JCKID=ITDDAT(JJTLN+3)                                             WDYNDA   2224
      CALL UNPACK(ICKT,LL,JCKID)                                        WDYNDA   2225
      NLFR=ITDDAT(JJTLN+4)                                              WDYNDA   2226
      IF(NLFR.GT.0)THEN                                                 WDYNDA   2227
      IREG=0                                                            WDYNDA   2228
      ELSE                                                              WDYNDA   2229
      IREG=1                                                            WDYNDA   2230
      NLFR=-NLFR                                                        WDYNDA   2231
      END IF                                                            WDYNDA   2232
      VREF=TDDAT(JJTLN+23)                                              WDYNDA   2233
C                                                                       WDYNDA   2234
      IF (KLFO .EQ. 0) THEN                                             WDYNDA   2235
C                                                                       WDYNDA   2236
        WRITE(IUX,1000) NLFP,NLFS,ICKT,NLFR,IREG,VREF                   WDYNDA   2237
C                                                                       WDYNDA   2238
      ELSE                                                              WDYNDA   2239
C                                                                       WDYNDA   2240
        CALL CHKNAM(BSNAMP,NLFP)                                        WDYNDA   2241
        CALL CHKNAM(BSNAMS,NLFS)                                        WDYNDA   2242
        CALL CHKNAM(BSNAMR,NLFR)                                        WDYNDA   2243
C                                                                       WDYNDA   2244
        WRITE(IUX,1010) BSNAMP,BSNAMS,ICKT,BSNAMR,IREG,VREF             WDYNDA   2245
C                                                                       WDYNDA   2246
      ENDIF                                                             WDYNDA   2247
C                                                                       WDYNDA   2248
      WRITE(IUX,1020) ITDDAT(JJTLN+5),ITDDAT(JJTLN+6)                   WDYNDA   2249
      WRITE(IUX,1030) (TDDAT(JJTLN+J),J=7,12)                           WDYNDA   2250
      WRITE(IUX,1030) TDDAT(JJTLN+13),TDDAT(JJTLN+24),                  WDYNDA   2251
     +                (TDDAT(JJTLN+J),J=14,17)                          WDYNDA   2252
C                                                                       WDYNDA   2253
 100  CONTINUE                                                          WDYNDA   2254
C                                                                       WDYNDA   2255
      WRITE(IUX,1100) EDATA                                             WDYNDA   2256
C                                                                       WDYNDA   2257
      RETURN                                                            WDYNDA   2258
C                                                                       WDYNDA   2259
 1000 FORMAT(2I6,3X,A2,I6,1X,I1,3X,F10.5)                               WDYNDA   2260
 1010 FORMAT(A12,1X,A12,3X,A2,1X,A12,1X,I1,3X,F10.5)                    WDYNDA   2261
 1020 FORMAT(2I5)                                                       WDYNDA   2262
 1030 FORMAT(6F10.5)                                                    WDYNDA   2263
 1100 FORMAT(A5)                                                        WDYNDA   2264
C                                                                       WDYNDA   2265
      END                                                               WDYNDA   2266
