CFPRIME LUDMDA                                                          LUDMDA      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 LUDMDA(NUF,JLN1,LTN)                                   LUDMDA      3
CD                                                                      LUDMDA      4
CD    TO LOAD THE COMMON DATA OF AN USER DEFINED AC MODELS DATA TO      LUDMDA      5
CD    DDAT ARRAY.                                                       LUDMDA      6
CD                                                                      LUDMDA      7
      INCLUDE 'PARX.INS'                                                LUDMDA      8
      INCLUDE 'CNPT.INS'                                                LUDMDA      9
      INCLUDE 'CNMDAT.INS'                                              LUDMDA     10
      INCLUDE 'CNB19.INS'                                               LUDMDA     11
      INCLUDE 'CNFLAG.INS'                                              LUDMDA     12
      INCLUDE 'CNPARX.INS'                                              LUDMDA     13
      INCLUDE 'CNUNIT.INS'                                              LUDMDA     14
      INCLUDE 'CNUDM.INS'                                               LUDMDA     15
      INCLUDE 'CNTMDA.INS'                                              LUDMDA     16
      INCLUDE 'CNMSG.INS'                                               LUDMDA     17
C                                                                       LUDMDA     18
      CHARACTER*80 SIMBUF                                               LUDMDA     19
      CHARACTER*12 BUSNAM                                               LUDMDA     20
      CHARACTER*4 IENAME(20),IGNAME(20),ISNAME(20),IRNAME(20)           LUDMDA     21
     &,ITNAME(20),IPNAME(20),IDNAME(20),IUNAME(60),IXNAME(80)           LUDMDA     22
      CHARACTER*3 BTYPE(71),UNAM(9)                                     LUDMDA     23
      INTEGER*4 IBUSN(3)                                                LUDMDA     24
C                                                                       LUDMDA     25
      EQUIVALENCE (IBUSN(1),BUSNAM,BLNAME)                              LUDMDA     26
C                                                                       LUDMDA     27
      EQUIVALENCE (IUNAME(1),IXNAME(21))                                LUDMDA     28
C                                                                       LUDMDA     29
C     USER DEFINED DEVICE NAMES                                         LUDMDA     30
C                                                                       LUDMDA     31
      DATA UNAM/'EXC','PSS','EXL','GOV','SVC','RAN','STC','SPS','SDB'/  LUDMDA     32
C                                                                       LUDMDA     33
C     BLOCK TYPE NAMES                                                  LUDMDA     34
C                                                                       LUDMDA     35
      DATA BTYPE/' GN',' IN',' PI',' WO',' LL',' SW',' HV',' LV','MUL', LUDMDA     36
     1           'DIV','IVL','DEL','SIN','COS','TAN','ASN','ACS','ATN', LUDMDA     37
     2           'EXP','LOG','ABS',' SS','NLF',' TF','DIG','A/D','LSW', LUDMDA     38
     3           'TIM','HYS','CTR',' E1',' E2',' E3',' E4',' E5',' E6', LUDMDA     39
     4           ' E7',' E8','E15','E30','E31','E34','RHL',' T1',' T4', LUDMDA     40
     5           'T20','T22','OF2','OF1',' LF','SD1','SD2','SD3','SD4', LUDMDA     41
     6           'SD5','SD6','SD7','SD8','SD9','   ','   ','   ','   ', LUDMDA     42
     7           '   ','   ','   ','   ','   ','POW','COM',' FL'/       LUDMDA     43
C                                                                       LUDMDA     44
C     INPUT SIGNAL NAMES OF GENERATOR EXCITATION SYSTEM, PSS AND UEL    LUDMDA     45
C                                                                       LUDMDA     46
      DATA IENAME/'  VC','  AC','PACC','  VT','  AT','  VD','  VQ',     LUDMDA     47
     1            '  ID','  IQ','  PT','  QT','  DW','CONT','TIME',     LUDMDA     48
     2            ' EFD',' IFD','  VS','  VU','  VF','VREF'/            LUDMDA     49
C                                                                       LUDMDA     50
C     INPUT SIGNAL NAMES OF GENERATOR PRIME MOVER                       LUDMDA     51
C                                                                       LUDMDA     52
      DATA IGNAME/'  VG',' VG2','PACC','  VT','  AT','  VD','  VQ',     LUDMDA     53
     1            '  ID','  IQ','  PT','  QT','  DW','CONT','TIME',     LUDMDA     54
     2            '    ','    ','    ','    ','    ','VREF'/            LUDMDA     55
C                                                                       LUDMDA     56
C     INPUT SIGNAL NAMES OF SVC                                         LUDMDA     57
C                                                                       LUDMDA     58
      DATA ISNAME/'ISVC','ITCR','QSVC','QTCR','BSVC','BTCR','VSVC',     LUDMDA     59
     1            '    ','ASVC','    ','STCR','SSVC','CONT','TIME',     LUDMDA     60
     2            '    ','    ','    ','    ','    ','VREF'/            LUDMDA     61
C                                                                       LUDMDA     62
C     INPUT SIGNAL NAMES OF RANI                                        LUDMDA     63
C                                                                       LUDMDA     64
      DATA IRNAME/'IRAN','ITCR','QRAN','QTCR','BRAN','BTCR','  V1',     LUDMDA     65
     1            '  V2','  A1','  A2','STCR','SRAN','CONT','TIME',     LUDMDA     66
     2            'GRAN','PRAN','XRAN','    ','    ','VREF'/            LUDMDA     67
C                                                                       LUDMDA     68
C     INPUT SIGNAL NAMES OF STC                                         LUDMDA     69
C                                                                       LUDMDA     70
      DATA ITNAME/'  I1','  I2','  P1','  P2','TSTC','    ','  V1',     LUDMDA     71
     1            '  V2','  A1','  A2','SSTC','    ','CONT','TIME',     LUDMDA     72
     2            '  Q1','  Q2','    ','    ','    ','VREF'/            LUDMDA     73
C                                                                       LUDMDA     74
C     INPUT SIGNAL NAMES OF STP                                         LUDMDA     75
C                                                                       LUDMDA     76
      DATA IPNAME/'  I1','  I2','  P1','  P2','    ','TSPS','  V1',     LUDMDA     77
     1            '  V2','  A1','  A2','SSTC','    ','CONT','TIME',     LUDMDA     78
     2            '  Q1','  Q2','    ','    ','    ','VREF'/            LUDMDA     79
C                                                                       LUDMDA     80
C     INPUT SIGNAL NAMES OF SDB                                         LUDMDA     81
C                                                                       LUDMDA     82
      DATA IDNAME/'ISDB','    ','MSDB','    ','YSDB','    ','VSDB',     LUDMDA     83
     1            '    ','ASDB','    ','    ','SSDB','CONT','TIME',     LUDMDA     84
     2            '    ','    ','    ','    ','    ','    '/            LUDMDA     85
C                                                                       LUDMDA     86
C     INTERNAL NAMES OF USER DEFINED AC DYNAMIC MODEL BLOCKS            LUDMDA     87
C                                                                       LUDMDA     88
      DATA IUNAME/'VR01','VR02','VR03','VR04','VR05','VR06','VR07',     LUDMDA     89
     1            'VR08','VR09','VR10','AR01','AR02','AR03','AR04',     LUDMDA     90
     2            'AR05','AR06','AR07','AR08','AR09','AR10','IR01',     LUDMDA     91
     3            'IR02','IR03','IR04','IR05','IR06','IR07','IR08',     LUDMDA     92
     4            'IR09','IR10','PR01','PR02','PR03','PR04','PR05',     LUDMDA     93
     5            'PR06','PR07','PR08','PR09','PR10','QR01','QR02',     LUDMDA     94
     6            'QR03','QR04','QR05','QR06','QR07','QR08','QR09',     LUDMDA     95
     7            'QR10','PF01','PF02','PF03','PF04','PF05','PF06',     LUDMDA     96
     8            'PF07','PF08','PF09','PF10'/                          LUDMDA     97
CD                                                                      LUDMDA     98
CD   NUF=1 USER DEFINED EXCITER                                         LUDMDA     99
CD      =2              STABILIZER                                      LUDMDA    100
CD      =3              UEL (JLN1=0), OEL (JLN1=1)                      LUDMDA    101
CD      =4              GOVERNOR     (HPLP NEEDS JLN1)                  LUDMDA    102
CD      =5              SVC                                             LUDMDA    103
CD      =6*             RANI         (NEEDS JLN1)                       LUDMDA    104
CD      =7              STC                                             LUDMDA    105
CD      =8              STP                                             LUDMDA    106
CD      =9              SDB                                             LUDMDA    107
CD                                                                      LUDMDA    108
      LDEB=(JDEB(268).NE.0)                                             LUDMDA    109
C                                                                       LUDMDA    110
      IF(IUDCM.GE.NUDCM) THEN                                           LUDMDA    111
         WRITE(MSG(1),1290) UNAM(NUF),NUDCM                             LUDMDA    112
         WRITE(MSG(2),1300)                                             LUDMDA    113
         CALL PRTMSG(2)                                                 LUDMDA    114
         SIMBUF='LUDMDA: UDM DATA ERROR'                                LUDMDA    115
         CALL ASTOP(SIMBUF,22)                                          LUDMDA    116
      ENDIF                                                             LUDMDA    117
      IUDCM=IUDCM+1                                                     LUDMDA    118
      LTN1=0                                                            LUDMDA    119
      ISVC1=0                                                           LUDMDA    120
      NBEND=0                                                           LUDMDA    121
      IF(NUF.LE.3) THEN                                                 LUDMDA    122
         DO 100 J=1,20                                                  LUDMDA    123
         IXNAME(J)=IENAME(J)                                            LUDMDA    124
  100    CONTINUE                                                       LUDMDA    125
      ELSEIF(NUF.EQ.4) THEN                                             LUDMDA    126
         DO 110 J=1,20                                                  LUDMDA    127
         IXNAME(J)=IGNAME(J)                                            LUDMDA    128
  110    CONTINUE                                                       LUDMDA    129
      ELSEIF(NUF.EQ.5) THEN                                             LUDMDA    130
         DO 120 J=1,20                                                  LUDMDA    131
         IXNAME(J)=ISNAME(J)                                            LUDMDA    132
  120    CONTINUE                                                       LUDMDA    133
      ELSEIF(NUF.EQ.6) THEN                                             LUDMDA    134
         DO 130 J=1,20                                                  LUDMDA    135
         IXNAME(J)=IRNAME(J)                                            LUDMDA    136
  130    CONTINUE                                                       LUDMDA    137
      ELSEIF(NUF.EQ.7) THEN                                             LUDMDA    138
         DO 140 J=1,20                                                  LUDMDA    139
         IXNAME(J)=ITNAME(J)                                            LUDMDA    140
  140    CONTINUE                                                       LUDMDA    141
      ELSEIF(NUF.EQ.8) THEN                                             LUDMDA    142
         DO 150 J=1,20                                                  LUDMDA    143
         IXNAME(J)=IPNAME(J)                                            LUDMDA    144
  150    CONTINUE                                                       LUDMDA    145
      ELSEIF(NUF.EQ.9) THEN                                             LUDMDA    146
         DO 160 J=1,20                                                  LUDMDA    147
         IXNAME(J)=IDNAME(J)                                            LUDMDA    148
  160    CONTINUE                                                       LUDMDA    149
      ENDIF                                                             LUDMDA    150
CD                                                                      LUDMDA    151
CD    STEP 1. LOAD REMOTE BUSES                                         LUDMDA    152
CD                                                                      LUDMDA    153
      JLNB=JLN+1                                                        LUDMDA    154
      JLN=JLN+1                                                         LUDMDA    155
      LTN=LTN+1                                                         LUDMDA    156
      LTNB=LTN                                                          LUDMDA    157
      NITEM=ITDDAT(LTNB)                                                LUDMDA    158
C                                                                       LUDMDA    159
C     LOADING REMOTE BUSES                                              LUDMDA    160
C                                                                       LUDMDA    161
      DO 170 K=1,NITEM                                                  LUDMDA    162
      IF(KLFO.EQ.0)THEN                                                 LUDMDA    163
      LTN=LTN+1                                                         LUDMDA    164
      NLF=ITDDAT(LTN)                                                   LUDMDA    165
      ELSE                                                              LUDMDA    166
      IBUSN(1)=ITDDAT(LTN+1)                                            LUDMDA    167
      IBUSN(2)=ITDDAT(LTN+2)                                            LUDMDA    168
      IBUSN(3)=ITDDAT(LTN+3)                                            LUDMDA    169
      CALL CHKBUS(BUSNAM,NLF)                                           LUDMDA    170
      LTN=LTN+3                                                         LUDMDA    171
      ENDIF                                                             LUDMDA    172
      JLN=JLN+3                                                         LUDMDA    173
      IDDAT(JLN-2)=NLF                                                  LUDMDA    174
 170  CONTINUE                                                          LUDMDA    175
C                                                                       LUDMDA    176
      IDDAT(JLNB)=NITEM                                                 LUDMDA    177
CD                                                                      LUDMDA    178
CD    STEP 2. LOAD REMOTE LINES                                         LUDMDA    179
CD                                                                      LUDMDA    180
      JLN=JLN+1                                                         LUDMDA    181
      JLNB=JLN                                                          LUDMDA    182
      LTN=LTN+1                                                         LUDMDA    183
      LTNB=LTN                                                          LUDMDA    184
      NITEM=ITDDAT(LTNB)                                                LUDMDA    185
C                                                                       LUDMDA    186
      DO 250 J=1,NITEM                                                  LUDMDA    187
C                                                                       LUDMDA    188
      IF(KLFO.EQ.0)THEN                                                 LUDMDA    189
C                                                                       LUDMDA    190
C   BUS NUMBER CASE                                                     LUDMDA    191
C                                                                       LUDMDA    192
      NLFF=ITDDAT(LTN+1)                                                LUDMDA    193
      NLFT=ITDDAT(LTN+2)                                                LUDMDA    194
      ITFK=ITDDAT(LTN+3)                                                LUDMDA    195
      LTN=LTN+3                                                         LUDMDA    196
C                                                                       LUDMDA    197
      ELSE                                                              LUDMDA    198
C                                                                       LUDMDA    199
C   BUS NAME CASE                                                       LUDMDA    200
C                                                                       LUDMDA    201
      IBUSN(1)=ITDDAT(LTN+1)                                            LUDMDA    202
      IBUSN(2)=ITDDAT(LTN+2)                                            LUDMDA    203
      IBUSN(3)=ITDDAT(LTN+3)                                            LUDMDA    204
      CALL CHKBUS(BUSNAM,NLFF)                                          LUDMDA    205
      IBUSN(1)=ITDDAT(LTN+4)                                            LUDMDA    206
      IBUSN(2)=ITDDAT(LTN+5)                                            LUDMDA    207
      IBUSN(3)=ITDDAT(LTN+6)                                            LUDMDA    208
      CALL CHKBUS(BUSNAM,NLFT)                                          LUDMDA    209
      ITFK=ITDDAT(LTN+7)                                                LUDMDA    210
      LTN=LTN+7                                                         LUDMDA    211
C                                                                       LUDMDA    212
      ENDIF                                                             LUDMDA    213
C                                                                       LUDMDA    214
      IDDAT(JLN+1)=NLFF                                                 LUDMDA    215
      IDDAT(JLN+2)=NLFT                                                 LUDMDA    216
      IDDAT(JLN+3)=ITFK                                                 LUDMDA    217
      IDDAT(JLN+4)=0                                                    LUDMDA    218
      JLN=JLN+4                                                         LUDMDA    219
C                                                                       LUDMDA    220
 250  CONTINUE                                                          LUDMDA    221
C                                                                       LUDMDA    222
      IDDAT(JLNB)=NITEM                                                 LUDMDA    223
C                                                                       LUDMDA    224
CD                                                                      LUDMDA    225
CD    STEP 3. LOAD INDIVIDUAL BLOCKS                                    LUDMDA    226
CD                                                                      LUDMDA    227
      JLN=JLN+1                                                         LUDMDA    228
      JLNB=JLN                                                          LUDMDA    229
      LTN=LTN+1                                                         LUDMDA    230
      LTNB=LTN                                                          LUDMDA    231
      IBEND=0                                                           LUDMDA    232
      IVREF=0                                                           LUDMDA    233
      NBLOCK=ITDDAT(LTNB)                                               LUDMDA    234
C                                                                       LUDMDA    235
      IF(NBLOCK.GT.NXUDB)THEN                                           LUDMDA    236
      WRITE(MSG(1),1280) UNAM(NUF),NXUDB                                LUDMDA    237
      WRITE(MSG(2),1285)                                                LUDMDA    238
      CALL PRTMSG(2)                                                    LUDMDA    239
      SIMBUF='LUDMDA: USER DEFINED MODEL HAS TOO MANY BLOCKS'           LUDMDA    240
      CALL ASTOP(SIMBUF,48)                                             LUDMDA    241
      ENDIF                                                             LUDMDA    242
C                                                                       LUDMDA    243
      DO 490 K=1,NBLOCK                                                 LUDMDA    244
C     BLNAME=IBUSN(1)::IBUSN(2)                                         LUDMDA    245
      IBUSN(1)=ITDDAT(LTN+1)                                            LUDMDA    246
      IBUSN(2)=ITDDAT(LTN+2)                                            LUDMDA    247
      J=ITDDAT(LTN+3)                                                   LUDMDA    248
      BLTYP=BTYPE(J)                                                    LUDMDA    249
C                                                                       LUDMDA    250
C NUF        1   2   3   4   5   6   7   8   9                          LUDMDA    251
      GOTO(300,310,310,320,330,340,350,350,360),NUF                     LUDMDA    252
C                                                                       LUDMDA    253
  300  CONTINUE                                                         LUDMDA    254
       IF(J.LE.43.OR.J.GE.65)GOTO 380                                   LUDMDA    255
       WRITE(MSG(1),1230) UNAM(NUF),K,BLNAME,BLTYP                      LUDMDA    256
       CALL PRTMSG(1)                                                   LUDMDA    257
       SIMBUF='LUDMDA: UDM DATA ERROR'                                  LUDMDA    258
       CALL ASTOP(SIMBUF,22)                                            LUDMDA    259
  310  CONTINUE                                                         LUDMDA    260
       IF(J.LE.30.OR.(J.GE.65.AND.J.LE.70))GOTO 380                     LUDMDA    261
       WRITE(MSG(1),1230) UNAM(NUF),K,BLNAME,BLTYP                      LUDMDA    262
       CALL PRTMSG(1)                                                   LUDMDA    263
       SIMBUF='LUDMDA: UDM DATA ERROR'                                  LUDMDA    264
       CALL ASTOP(SIMBUF,22)                                            LUDMDA    265
  320  CONTINUE                                                         LUDMDA    266
       IF((J.GT.30.AND.J.LT.44).OR.(J.GT.47.AND.J.LT.65).OR.J.EQ.71)    LUDMDA    267
     & THEN                                                             LUDMDA    268
       WRITE(MSG(1),1230) UNAM(NUF),K,BLNAME,BLTYP                      LUDMDA    269
       CALL PRTMSG(1)                                                   LUDMDA    270
       SIMBUF='LUDMDA: UDM DATA ERROR'                                  LUDMDA    271
       CALL ASTOP(SIMBUF,22)                                            LUDMDA    272
       ELSE                                                             LUDMDA    273
       GOTO 380                                                         LUDMDA    274
       ENDIF                                                            LUDMDA    275
  330  CONTINUE                                                         LUDMDA    276
       IF((J.GT.30.AND.J.LT.48).OR.(J.GT.58.AND.J.LT.65).OR.J.EQ.54     LUDMDA    277
     &    .OR.J.EQ.55.OR.J.EQ.56.OR.J.EQ.71) THEN                       LUDMDA    278
       WRITE(MSG(1),1230) UNAM(NUF),K,BLNAME,BLTYP                      LUDMDA    279
       CALL PRTMSG(1)                                                   LUDMDA    280
       SIMBUF='LUDMDA: UDM DATA ERROR'                                  LUDMDA    281
       CALL ASTOP(SIMBUF,22)                                            LUDMDA    282
       ELSE                                                             LUDMDA    283
       GOTO 380                                                         LUDMDA    284
       ENDIF                                                            LUDMDA    285
  340  CONTINUE                                                         LUDMDA    286
       IF((J.GT.30.AND.J.LT.48).OR.(J.GT.59.AND.J.LT.65).OR.J.EQ.54     LUDMDA    287
     &    .OR.J.EQ.55.OR.J.EQ.58.OR.J.EQ.71) THEN                       LUDMDA    288
       WRITE(MSG(1),1230) UNAM(NUF),K,BLNAME,BLTYP                      LUDMDA    289
       CALL PRTMSG(1)                                                   LUDMDA    290
       SIMBUF='LUDMDA: UDM DATA ERROR'                                  LUDMDA    291
       CALL ASTOP(SIMBUF,22)                                            LUDMDA    292
       ELSE                                                             LUDMDA    293
       GOTO 380                                                         LUDMDA    294
       ENDIF                                                            LUDMDA    295
  350  CONTINUE                                                         LUDMDA    296
       IF((J.GT.30.AND.J.LT.54).OR.(J.GT.54.AND.J.LT.65)                LUDMDA    297
     &    .OR.J.EQ.71) THEN                                             LUDMDA    298
       WRITE(MSG(1),1230) UNAM(NUF),K,BLNAME,BLTYP                      LUDMDA    299
       CALL PRTMSG(1)                                                   LUDMDA    300
       SIMBUF='LUDMDA: UDM DATA ERROR'                                  LUDMDA    301
       CALL ASTOP(SIMBUF,22)                                            LUDMDA    302
       ELSE                                                             LUDMDA    303
       GOTO 380                                                         LUDMDA    304
       ENDIF                                                            LUDMDA    305
  360  CONTINUE                                                         LUDMDA    306
       IF((J.GT.30.AND.J.LT.55).OR.(J.GT.55.AND.J.LT.65)                LUDMDA    307
     &    .OR.J.EQ.71) THEN                                             LUDMDA    308
       WRITE(MSG(1),1230) UNAM(NUF),K,BLNAME,BLTYP                      LUDMDA    309
       CALL PRTMSG(1)                                                   LUDMDA    310
       SIMBUF='LUDMDA: UDM DATA ERROR'                                  LUDMDA    311
       CALL ASTOP(SIMBUF,22)                                            LUDMDA    312
       ELSE                                                             LUDMDA    313
       GOTO 380                                                         LUDMDA    314
       ENDIF                                                            LUDMDA    315
  380  CONTINUE                                                         LUDMDA    316
C                                                                       LUDMDA    317
       IDDAT(JLN+1)=IBUSN(1)                                            LUDMDA    318
       IDDAT(JLN+17)=IBUSN(2)                                           LUDMDA    319
       IDDAT(JLN+2)=J                                                   LUDMDA    320
C                                                                       LUDMDA    321
C     READING THE FIRST LINE DATA                                       LUDMDA    322
C                                                                       LUDMDA    323
            IF(J.EQ.22) THEN                                            LUDMDA    324
               NAA=ITDDAT(LTN+4)                                        LUDMDA    325
               NBB=ITDDAT(LTN+5)                                        LUDMDA    326
               IDDAT(JLN+3)=NAA                                         LUDMDA    327
               IDDAT(JLN+4)=NBB                                         LUDMDA    328
               IDDAT(JLN+5)=JLSS                                        LUDMDA    329
               DO 391 LK=1,NAA                                          LUDMDA    330
               DO 390 LL=1,NAA                                          LUDMDA    331
  390          SSMAT(JLSS+LL)=TDDAT(LTN+LL+17)                          LUDMDA    332
               IF(LDEB) WRITE (IUD6,1220) (SSMAT(JLSS+LJ),LJ=1,NAA)     LUDMDA    333
               LTN=LTN+NAA                                              LUDMDA    334
               JLSS=JLSS+NAA                                            LUDMDA    335
  391          CONTINUE                                                 LUDMDA    336
               DO 410 LK=1,NAA                                          LUDMDA    337
               DO 400 LL=1,NBB                                          LUDMDA    338
  400          SSMAT(JLSS+LL)=TDDAT(LTN+LL+17)                          LUDMDA    339
               IF(LDEB) WRITE (IUD6,1220) (SSMAT(JLSS+LJ),LJ=1,NBB)     LUDMDA    340
               LTN=LTN+NBB                                              LUDMDA    341
               JLSS=JLSS+NBB                                            LUDMDA    342
  410          CONTINUE                                                 LUDMDA    343
               DO 420 LL=1,NAA                                          LUDMDA    344
  420          SSMAT(JLSS+LL)=TDDAT(LTN+LL+17)                          LUDMDA    345
               IF(LDEB) WRITE (IUD6,1220) (SSMAT(JLSS+LJ),LJ=1,NAA)     LUDMDA    346
               LTN=LTN+NAA                                              LUDMDA    347
               JLSS=JLSS+NAA                                            LUDMDA    348
               DO 440 LK=1,NAA                                          LUDMDA    349
               DO 430 LL=1,NBB                                          LUDMDA    350
  430          SSMAT(JLSS+LL)=TDDAT(LTN+LL+17)                          LUDMDA    351
               IF(LDEB) WRITE (IUD6,1220) (SSMAT(JLSS+LJ),LJ=1,NBB)     LUDMDA    352
               LTN=LTN+NBB                                              LUDMDA    353
               JLSS=JLSS+NBB                                            LUDMDA    354
  440          CONTINUE                                                 LUDMDA    355
C                                                                       LUDMDA    356
            ELSEIF(J.EQ.24.OR.J.EQ.26) THEN                             LUDMDA    357
               DO 450 LL=4,9                                            LUDMDA    358
  450          DDAT(JLN-1+LL)=TDDAT(LTN+LL)                             LUDMDA    359
               IF(LDEB) WRITE(IUD6,1150) IDDAT(JLN+3),                  LUDMDA    360
     &         (DDAT(JLN+LJ+2),LJ=2,6)                                  LUDMDA    361
            ELSEIF(J.EQ.30)THEN                                         LUDMDA    362
               DO 455 LL=4,10                                           LUDMDA    363
  455          DDAT(JLN-1+LL)=TDDAT(LTN+LL)                             LUDMDA    364
               IF(LDEB) WRITE(IUD6,1310) (DDAT(LTN+LJ+2),LJ=1,4)        LUDMDA    365
     &         ,IDDAT(LTN+7),IDDAT(LTN+8),IDDAT(LTN+9)                  LUDMDA    366
            ELSEIF(J.EQ.53)THEN                                         LUDMDA    367
               DO 460 LL=4,9                                            LUDMDA    368
  460          DDAT(JLN-1+LL)=TDDAT(LTN+LL)                             LUDMDA    369
               IF(LDEB) WRITE(IUD6,1240) (DDAT(LTN+LJ+2),LJ=1,5)        LUDMDA    370
     &         ,IDDAT(LTN+8)                                            LUDMDA    371
            ELSEIF(J.EQ.54)THEN                                         LUDMDA    372
               DDAT(JLN+3)=TDDAT(LTN+4)                                 LUDMDA    373
               DDAT(JLN+4)=TDDAT(LTN+5)                                 LUDMDA    374
               IDDAT(JLN+5)=ITDDAT(LTN+6)                               LUDMDA    375
               IDDAT(JLN+6)=ITDDAT(LTN+7)                               LUDMDA    376
               IF(LDEB) WRITE(IUD6,1260) DDAT(JLN+3),DDAT(JLN+4)        LUDMDA    377
     &         ,IDDAT(JLN+5),IDDAT(JLN+6)                               LUDMDA    378
            ELSEIF(J.EQ.55.OR.J.EQ.56)THEN                              LUDMDA    379
               DDAT(JLN+3)=TDDAT(LTN+4)                                 LUDMDA    380
               DDAT(JLN+4)=TDDAT(LTN+5)                                 LUDMDA    381
               DDAT(JLN+5)=TDDAT(LTN+6)                                 LUDMDA    382
               IDDAT(JLN+6)=ITDDAT(LTN+7)                               LUDMDA    383
               IDDAT(JLN+7)=ITDDAT(LTN+8)                               LUDMDA    384
               IF(LDEB) WRITE(IUD6,1250) (DDAT(JLN+LJ+2),LJ=1,3)        LUDMDA    385
     &         ,IDDAT(JLN+6),IDDAT(JLN+7)                               LUDMDA    386
            ELSEIF(J.EQ.58.OR.J.EQ.59)THEN                              LUDMDA    387
               DDAT(JLN+3)=TDDAT(LTN+4)                                 LUDMDA    388
               DDAT(JLN+4)=TDDAT(LTN+5)                                 LUDMDA    389
               DDAT(JLN+5)=TDDAT(LTN+6)                                 LUDMDA    390
               IDDAT(JLN+6)=ITDDAT(LTN+7)                               LUDMDA    391
               IDDAT(JLN+7)=ITDDAT(LTN+8)                               LUDMDA    392
               IDDAT(JLN+8)=ITDDAT(LTN+9)                               LUDMDA    393
               IF(LDEB) WRITE(IUD6,1320) (DDAT(LTN+LJ+2),LJ=1,3)        LUDMDA    394
     &         ,(IDDAT(JLN+LJ+5),LJ=1,3)                                LUDMDA    395
            ELSEIF(J.EQ.70)THEN                                         LUDMDA    396
               DDAT(JLN+3)=TDDAT(LTN+4)                                 LUDMDA    397
               DDAT(JLN+4)=TDDAT(LTN+5)                                 LUDMDA    398
               IDDAT(JLN+5)=ITDDAT(LTN+6)                               LUDMDA    399
               IDDAT(JLN+6)=ITDDAT(LTN+7)                               LUDMDA    400
               IDDAT(JLN+7)=ITDDAT(LTN+8)                               LUDMDA    401
               IF(LDEB) WRITE(IUD6,1330) (DDAT(LTN+LJ+2),LJ=1,2)        LUDMDA    402
     &         ,(IDDAT(JLN+LJ+4),LJ=1,3)                                LUDMDA    403
            ELSE                                                        LUDMDA    404
               DO 470 LL=4,9                                            LUDMDA    405
 470           DDAT(JLN-1+LL)=TDDAT(LTN+LL)                             LUDMDA    406
               IF(LDEB) WRITE (IUD6,1080) (DDAT(JLN+2),LJ=1,6)          LUDMDA    407
            ENDIF                                                       LUDMDA    408
            IF(J.EQ.12) THEN                                            LUDMDA    409
             IDEL=IDEL+1                                                LUDMDA    410
             IDDAT(JLN+5)=IDEL                                          LUDMDA    411
            ENDIF                                                       LUDMDA    412
C                                                                       LUDMDA    413
C     READING THE REST OF THE DATA                                      LUDMDA    414
C                                                                       LUDMDA    415
            IF(J.EQ.24.OR.J.EQ.33.OR.J.EQ.34.OR.J.EQ.35.OR.J.EQ.36.OR.  LUDMDA    416
     &      J.EQ.38.OR.J.EQ.25.OR.(J.EQ.26.AND.ITDDAT(LTN+4).GT.5).OR.  LUDMDA    417
     &      J.EQ.44.OR.J.EQ.45.OR.J.EQ.46.OR.J.EQ.47.OR.J.EQ.29.OR.     LUDMDA    418
     &      J.EQ.53.OR.J.EQ.23.OR.J.EQ.71)THEN                          LUDMDA    419
               IF(J.EQ.45) THEN                                         LUDMDA    420
                  DO 481 LL=10,13                                       LUDMDA    421
 481              DDAT(JLN-1+LL)=TDDAT(LTN+LL)                          LUDMDA    422
                  IDDAT(JLN+13)=ITDDAT(LTN+14)                          LUDMDA    423
                  IDDAT(JLN+14)=ITDDAT(LTN+15)                          LUDMDA    424
                  IF(LDEB) WRITE (IUD6,1081) (DDAT(JLN+LJ),LJ=9,12)     LUDMDA    425
     &            ,IDDAT(JLN+13),IDDAT(JLN+14)                          LUDMDA    426
               ELSE                                                     LUDMDA    427
                  DO 480 LL=10,15                                       LUDMDA    428
 480              DDAT(JLN-1+LL)=TDDAT(LTN+LL)                          LUDMDA    429
                  IF(LDEB) WRITE (IUD6,1080) (DDAT(JLN+LJ),LJ=9,14)     LUDMDA    430
               ENDIF                                                    LUDMDA    431
            ENDIF                                                       LUDMDA    432
            LTN=LTN+17                                                  LUDMDA    433
            IF(J.EQ.25)THEN                                             LUDMDA    434
            SSMAT(JLSS+13)=DDAT(JLN+3)                                  LUDMDA    435
            IDDAT(JLN+3)=JLSS                                           LUDMDA    436
            JLSS=JLSS+13                                                LUDMDA    437
            ENDIF                                                       LUDMDA    438
            IF(J.EQ.44) THEN                                            LUDMDA    439
             SSMAT(JLSS+1)=DDAT(JLN+14)                                 LUDMDA    440
             IDDAT(JLN+14)=JLSS                                         LUDMDA    441
             SSMAT(JLSS+3)=TDDAT(LTN+1)                                 LUDMDA    442
             SSMAT(JLSS+4)=TDDAT(LTN+2)                                 LUDMDA    443
             SSMAT(JLSS+5)=TDDAT(LTN+3)                                 LUDMDA    444
             SSMAT(JLSS+6)=TDDAT(LTN+4)                                 LUDMDA    445
             SSMAT(JLSS+7)=TDDAT(LTN+5)                                 LUDMDA    446
             SSMAT(JLSS+8)=TDDAT(LTN+6)                                 LUDMDA    447
             SSMAT(JLSS+9)=TDDAT(LTN+7)                                 LUDMDA    448
             SSMAT(JLSS+10)=TDDAT(LTN+8)                                LUDMDA    449
             LTN=LTN+8                                                  LUDMDA    450
             JLSS=JLSS+11                                               LUDMDA    451
            ENDIF                                                       LUDMDA    452
            IF(J.EQ.46) THEN                                            LUDMDA    453
             SSMAT(JLSS+1)=DDAT(JLN+9)                                  LUDMDA    454
             SSMAT(JLSS+2)=DDAT(JLN+10)                                 LUDMDA    455
             SSMAT(JLSS+3)=DDAT(JLN+11)                                 LUDMDA    456
             SSMAT(JLSS+4)=DDAT(JLN+12)                                 LUDMDA    457
             SSMAT(JLSS+5)=DDAT(JLN+13)                                 LUDMDA    458
             SSMAT(JLSS+6)=DDAT(JLN+14)                                 LUDMDA    459
             IDDAT(JLN+14)=JLSS                                         LUDMDA    460
             JLSS=JLSS+6                                                LUDMDA    461
            ENDIF                                                       LUDMDA    462
            JLN=JLN+17                                                  LUDMDA    463
C                                                                       LUDMDA    464
            IF(J.GT.30.AND.J.NE.43.AND.J.NE.48.AND.J.NE.49.AND.J.NE.50  LUDMDA    465
     &        .AND.J.LT.65 )THEN                                        LUDMDA    466
               NBEND=K                                                  LUDMDA    467
               IBEND=IBEND+1                                            LUDMDA    468
               IF(NUF.EQ.5.AND.J.EQ.57) ISVC1=1                         LUDMDA    469
               IF(NUF.EQ.6) THEN                                        LUDMDA    470
                  IF(J.EQ.56) THEN                                      LUDMDA    471
                     IDDAT(JLN1)=1                                      LUDMDA    472
                  ELSEIF(J.EQ.59) THEN                                  LUDMDA    473
                     IDDAT(JLN1)=2                                      LUDMDA    474
                  ELSEIF(J.EQ.57) THEN                                  LUDMDA    475
                     IDDAT(JLN1)=3                                      LUDMDA    476
                  ELSE                                                  LUDMDA    477
                     IDDAT(JLN1)=0                                      LUDMDA    478
                  ENDIF                                                 LUDMDA    479
              ENDIF                                                     LUDMDA    480
              IF(J.EQ.45) THEN                                          LUDMDA    481
                 JLN1=45                                                LUDMDA    482
                 LTN1=LTN                                               LUDMDA    483
              ENDIF                                                     LUDMDA    484
            ENDIF                                                       LUDMDA    485
C                                                                       LUDMDA    486
 490   CONTINUE                                                         LUDMDA    487
C                                                                       LUDMDA    488
      IF(NUF.NE.2.AND.NUF.NE.3.AND.IBEND.EQ.0) THEN                     LUDMDA    489
         WRITE(MSG(1),1090) UNAM(NUF)                                   LUDMDA    490
         CALL PRTMSG(1)                                                 LUDMDA    491
         SIMBUF='LUDMDA: UDM DATA ERROR'                                LUDMDA    492
         CALL ASTOP(SIMBUF,22)                                          LUDMDA    493
      ENDIF                                                             LUDMDA    494
      IF(NUF.EQ.2.OR.NUF.EQ.3) THEN                                     LUDMDA    495
         IF(IBEND.NE.0) THEN                                            LUDMDA    496
            WRITE(MSG(1),1270) UNAM(NUF)                                LUDMDA    497
            CALL PRTMSG(1)                                              LUDMDA    498
            SIMBUF='LUDMDA: UDM DATA ERROR'                             LUDMDA    499
            CALL ASTOP(SIMBUF,22)                                       LUDMDA    500
         ENDIF                                                          LUDMDA    501
      ENDIF                                                             LUDMDA    502
      IF(IBEND.GT.1) THEN                                               LUDMDA    503
         WRITE(MSG(1),1100) UNAM(NUF)                                   LUDMDA    504
         CALL PRTMSG(1)                                                 LUDMDA    505
         SIMBUF='LUDMDA: UDM DATA ERROR'                                LUDMDA    506
         CALL ASTOP(SIMBUF,22)                                          LUDMDA    507
      ENDIF                                                             LUDMDA    508
C                                                                       LUDMDA    509
      IDDAT(JLNB)=NBLOCK                                                LUDMDA    510
C                                                                       LUDMDA    511
C     LEAVING ROOM FOR KINPU POINTER, BLOCK SOLUTION ORDERS, BLOCKS     LUDMDA    512
C     WITH NON-WIND UP LIMITER AND THEIR STATE NUMBER                   LUDMDA    513
C                                                                       LUDMDA    514
      JLN=JLN+3*(NBLOCK)+1                                              LUDMDA    515
C                                                                       LUDMDA    516
CD                                                                      LUDMDA    517
CD    STEP 4. LOAD BLOCK INTERCONNECTIONS DATA                          LUDMDA    518
CD                                                                      LUDMDA    519
      LTN=LTN+1                                                         LUDMDA    520
      LTNB=LTN                                                          LUDMDA    521
      JLN=JLN+1                                                         LUDMDA    522
      JLNB=JLN                                                          LUDMDA    523
C                                                                       LUDMDA    524
      NCONEC=ITDDAT(LTNB)                                               LUDMDA    525
C                                                                       LUDMDA    526
      DO 550 J=1,NCONEC                                                 LUDMDA    527
C                                                                       LUDMDA    528
      IDDAT(JLN+1)=ITDDAT(LTN+1)                                        LUDMDA    529
      IDDAT(JLN+2)=ITDDAT(LTN+2)                                        LUDMDA    530
      LTN=LTN+2                                                         LUDMDA    531
      JLN=JLN+2                                                         LUDMDA    532
C                                                                       LUDMDA    533
 550  CONTINUE                                                          LUDMDA    534
C                                                                       LUDMDA    535
      IDDAT(JLNB)=NCONEC                                                LUDMDA    536
C                                                                       LUDMDA    537
CD                                                                      LUDMDA    538
CD    STEP 5. LOAD BLOCK INPUT DATA                                     LUDMDA    539
CD                                                                      LUDMDA    540
      LTN=LTN+1                                                         LUDMDA    541
      LTNB=LTN                                                          LUDMDA    542
      JLN=JLN+1                                                         LUDMDA    543
      JLNB=JLN                                                          LUDMDA    544
C                                                                       LUDMDA    545
      NINPUT=ITDDAT(LTNB)                                               LUDMDA    546
      DO 700 J=1,NINPUT                                                 LUDMDA    547
      LTN=LTN+3                                                         LUDMDA    548
      LB=ITDDAT(LTN-2)                                                  LUDMDA    549
      K=ITDDAT(LTN-1)                                                   LUDMDA    550
      X=TDDAT(LTN)                                                      LUDMDA    551
      JLN=JLN+3                                                         LUDMDA    552
      IDDAT(JLN-2)=LB                                                   LUDMDA    553
      IDDAT(JLN-1)=K                                                    LUDMDA    554
      DDAT(JLN)=X                                                       LUDMDA    555
      IF(NUF.EQ.2.OR.NUF.EQ.3) THEN                                     LUDMDA    556
               IF(K.EQ.15.OR.K.EQ.19.OR.K.EQ.20) THEN                   LUDMDA    557
                  WRITE(MSG(1),1060) UNAM(NUF),IDDAT(JLN-2),IXNAME(K)   LUDMDA    558
                  CALL PRTMSG(1)                                        LUDMDA    559
                  SIMBUF='LUDMDA: UDM DATA ERROR'                       LUDMDA    560
                  CALL ASTOP(SIMBUF,22)                                 LUDMDA    561
               ENDIF                                                    LUDMDA    562
               IF(NUF.EQ.3.AND.JLN1.EQ.0.AND.K.EQ.17) THEN              LUDMDA    563
                  WRITE(MSG(1),1060) UNAM(NUF),IDDAT(JLN-2),IXNAME(K)   LUDMDA    564
                  CALL PRTMSG(1)                                        LUDMDA    565
                  SIMBUF='LUDMDA: UDM DATA ERROR'                       LUDMDA    566
                  CALL ASTOP(SIMBUF,22)                                 LUDMDA    567
               ENDIF                                                    LUDMDA    568
               IF(NUF.EQ.3.AND.JLN1.EQ.1.AND.(K.EQ.17.OR.K.EQ.18)) THEN LUDMDA    569
                  WRITE(MSG(1),1060) UNAM(NUF),IDDAT(JLN-2),IXNAME(K)   LUDMDA    570
                  CALL PRTMSG(1)                                        LUDMDA    571
                  SIMBUF='LUDMDA: UDM DATA ERROR'                       LUDMDA    572
                  CALL ASTOP(SIMBUF,22)                                 LUDMDA    573
               ENDIF                                                    LUDMDA    574
      ELSEIF(NUF.EQ.5)THEN                                              LUDMDA    575
               IF(ISVC1.EQ.0) THEN                                      LUDMDA    576
                  IF(K.EQ.12) THEN                                      LUDMDA    577
                     WRITE(MSG(1),1060) UNAM(NUF),IDDAT(JLN-2),IXNAME(K)LUDMDA    578
                     CALL PRTMSG(1)                                     LUDMDA    579
                     SIMBUF='LUDMDA: UDM DATA ERROR'                    LUDMDA    580
                     CALL ASTOP(SIMBUF,22)                              LUDMDA    581
                  ENDIF                                                 LUDMDA    582
               ELSEIF(ISVC1.EQ.1) THEN                                  LUDMDA    583
                  IF(K.EQ.2.OR.K.EQ.4.OR.K.EQ.6.OR.K.EQ.11) THEN        LUDMDA    584
                     WRITE(MSG(1),1060) UNAM(NUF),IDDAT(JLN-2),IXNAME(K)LUDMDA    585
                     CALL PRTMSG(1)                                     LUDMDA    586
                     SIMBUF='LUDMDA: UDM DATA ERROR'                    LUDMDA    587
                     CALL ASTOP(SIMBUF,22)                              LUDMDA    588
                  ENDIF                                                 LUDMDA    589
               ENDIF                                                    LUDMDA    590
      ELSEIF(NUF.EQ.6)THEN                                              LUDMDA    591
               IF(IDDAT(JLN1).EQ.0) THEN                                LUDMDA    592
                  IF(K.EQ.12.OR.K.EQ.15.OR.K.EQ.16.OR.K.EQ.17) THEN     LUDMDA    593
                     WRITE(MSG(1),1060) UNAM(NUF),IDDAT(JLN-2),IXNAME(K)LUDMDA    594
                     CALL PRTMSG(1)                                     LUDMDA    595
                     SIMBUF='LUDMDA: UDM DATA ERROR'                    LUDMDA    596
                     CALL ASTOP(SIMBUF,22)                              LUDMDA    597
                  ENDIF                                                 LUDMDA    598
               ELSEIF(IDDAT(JLN1).EQ.1) THEN                            LUDMDA    599
                  IF(K.EQ.2.OR.K.EQ.3.OR.K.EQ.4.OR.K.EQ.5.OR.           LUDMDA    600
     &               K.EQ.6.OR.K.EQ.11.OR.K.EQ.17) THEN                 LUDMDA    601
                     WRITE(MSG(1),1060) UNAM(NUF),IDDAT(JLN-2),IXNAME(K)LUDMDA    602
                     CALL PRTMSG(1)                                     LUDMDA    603
                     SIMBUF='LUDMDA: UDM DATA ERROR'                    LUDMDA    604
                     CALL ASTOP(SIMBUF,22)                              LUDMDA    605
                  ENDIF                                                 LUDMDA    606
               ELSEIF(IDDAT(JLN1).EQ.2)THEN                             LUDMDA    607
                  IF(K.EQ.2.OR.K.EQ.4.OR.K.EQ.5.OR.K.EQ.6.OR.K.EQ.11    LUDMDA    608
     &               .OR.K.EQ.15.OR.K.EQ.16) THEN                       LUDMDA    609
                     WRITE(MSG(1),1060) UNAM(NUF),IDDAT(JLN-2),IXNAME(K)LUDMDA    610
                     CALL PRTMSG(1)                                     LUDMDA    611
                     SIMBUF='LUDMDA: UDM DATA ERROR'                    LUDMDA    612
                     CALL ASTOP(SIMBUF,22)                              LUDMDA    613
                  ENDIF                                                 LUDMDA    614
               ELSEIF(IDDAT(JLN1).EQ.3)THEN                             LUDMDA    615
                  IF(K.EQ.2.OR.K.EQ.4.OR.K.EQ.6.OR.K.EQ.11              LUDMDA    616
     &               .OR.K.EQ.15.OR.K.EQ.16.OR.K.EQ.17) THEN            LUDMDA    617
                     WRITE(MSG(1),1060) UNAM(NUF),IDDAT(JLN-2),IXNAME(K)LUDMDA    618
                     CALL PRTMSG(1)                                     LUDMDA    619
                     SIMBUF='LUDMDA: UDM DATA ERROR'                    LUDMDA    620
                     CALL ASTOP(SIMBUF,22)                              LUDMDA    621
                  ENDIF                                                 LUDMDA    622
               ENDIF                                                    LUDMDA    623
      ELSEIF(NUF.EQ.7)THEN                                              LUDMDA    624
                  IF(K.EQ.6.OR.K.EQ.12) THEN                            LUDMDA    625
                     WRITE(MSG(1),1060) UNAM(NUF),IDDAT(JLN-2),IXNAME(K)LUDMDA    626
                     CALL PRTMSG(1)                                     LUDMDA    627
                     SIMBUF='LUDMDA: UDM DATA ERROR'                    LUDMDA    628
                     CALL ASTOP(SIMBUF,22)                              LUDMDA    629
                  ENDIF                                                 LUDMDA    630
      ELSEIF(NUF.EQ.8)THEN                                              LUDMDA    631
                  IF(K.EQ.5.OR.K.EQ.11) THEN                            LUDMDA    632
                     WRITE(MSG(1),1060) UNAM(NUF),IDDAT(JLN-2),IXNAME(K)LUDMDA    633
                     CALL PRTMSG(1)                                     LUDMDA    634
                     SIMBUF='LUDMDA: UDM DATA ERROR'                    LUDMDA    635
                     CALL ASTOP(SIMBUF,22)                              LUDMDA    636
                  ENDIF                                                 LUDMDA    637
      ENDIF                                                             LUDMDA    638
      IF(K.EQ.20) IVREF=IVREF+1                                         LUDMDA    639
      IF(LDEB)WRITE(IUD6,1020) IDDAT(JLN-2),DDAT(JLN)                   LUDMDA    640
C                                                                       LUDMDA    641
 700  CONTINUE                                                          LUDMDA    642
C                                                                       LUDMDA    643
      IF(NUF.NE.2.AND.NUF.NE.3.AND.NUF.NE.9.AND.IVREF.EQ.0) THEN        LUDMDA    644
         WRITE(MSG(1),1160) UNAM(NUF)                                   LUDMDA    645
         SIMBUF='LUDMDA: UDM DATA ERROR'                                LUDMDA    646
         CALL ASTOP(SIMBUF,22)                                          LUDMDA    647
      ENDIF                                                             LUDMDA    648
      IF(IVREF.GT.1) THEN                                               LUDMDA    649
         WRITE(MSG(1),1170) UNAM(NUF)                                   LUDMDA    650
         SIMBUF='LUDMDA: UDM DATA ERROR'                                LUDMDA    651
         CALL ASTOP(SIMBUF,22)                                          LUDMDA    652
      ENDIF                                                             LUDMDA    653
C                                                                       LUDMDA    654
      IDDAT(JLNB)=NINPUT                                                LUDMDA    655
CD                                                                      LUDMDA    656
CD    STEP 6. LOAD OUTPUT BLOCK DATA                                    LUDMDA    657
CD                                                                      LUDMDA    658
      IF(NUF.EQ.2)THEN                                                  LUDMDA    659
         IDDAT(JLN+1)=ITDDAT(LTN+1)                                     LUDMDA    660
         IDDAT(JLN+2)=ITDDAT(LTN+2)                                     LUDMDA    661
         IF(LDEB)WRITE(IUD6,1200) IDDAT(JLN+1),IDDAT(JLN+2)             LUDMDA    662
         JLN=JLN+2                                                      LUDMDA    663
      ELSEIF(NUF.EQ.3) THEN                                             LUDMDA    664
         IDDAT(JLN+1)=ITDDAT(LTN+1)                                     LUDMDA    665
         IF(LDEB)WRITE(IUD6,1200) IDDAT(JLN+1)                          LUDMDA    666
         JLN=JLN+1                                                      LUDMDA    667
      ELSE                                                              LUDMDA    668
         IDDAT(JLN+1)=NBEND                                             LUDMDA    669
         IF(LDEB)WRITE(IUD6,1200) IDDAT(JLN+1)                          LUDMDA    670
         JLN=JLN+1                                                      LUDMDA    671
      ENDIF                                                             LUDMDA    672
      IF(LDEB)WRITE(IUD6,1000) UNAM(NUF),JLN                            LUDMDA    673
      LTN=LTN1                                                          LUDMDA    674
      RETURN                                                            LUDMDA    675
C                                                                       LUDMDA    676
 1000 FORMAT (1X,'END READ UD ',A3,' DATA, JLN',I5)                     LUDMDA    677
 1020 FORMAT (1X,I4,2X,F10.5)                                           LUDMDA    678
 1060 FORMAT(' *** ERROR AT UD:',A3,', INPUT SIGNAL "',A4               LUDMDA    679
     *,'" (TO BLOCK#',I3,') IS NOT ALLOWED')                            LUDMDA    680
 1080 FORMAT(20X,6F10.5)                                                LUDMDA    681
 1081 FORMAT(20X,4F10.5,2I10)                                           LUDMDA    682
 1090 FORMAT(' *** ERROR AT UD:',A3,', NO END BLOCK HAS BEEN DEFINED')  LUDMDA    683
 1100 FORMAT(' *** ERROR AT UD:',A3                                     LUDMDA    684
     *,', MORE THAN ONE END BLOCK HAS BEEN DEFINED')                    LUDMDA    685
 1150 FORMAT(29X,I1,5F10.5)                                             LUDMDA    686
 1160 FORMAT(' *** ERROR AT UD:',A3                                     LUDMDA    687
     *,', NO BLOCK HAS "VREF" INPUT')                                   LUDMDA    688
 1170 FORMAT(' *** ERROR AT UD:',A3                                     LUDMDA    689
     *,', "VREF" INPUT HAS BEEN USED MORE THAN ONCE')                   LUDMDA    690
 1200 FORMAT (16I5)                                                     LUDMDA    691
 1220 FORMAT (8F10.5)                                                   LUDMDA    692
 1230 FORMAT(' *** ERROR AT UD:',A3,' BLOCK#',I2,' (',2A4               LUDMDA    693
     *,') HAS UNACCEPTABLE TYPE. TYPE=',A3)                             LUDMDA    694
 1240 FORMAT(20X,5F10.5,9X,I1)                                          LUDMDA    695
 1250 FORMAT(20X,3F10.5,2I5)                                            LUDMDA    696
 1260 FORMAT(20X,2F10.5,2I5)                                            LUDMDA    697
 1270 FORMAT(' *** ERROR NO END BLOCK IS ALLOWED FOR UD ',A3)           LUDMDA    698
 1280 FORMAT(' *** ERROR AT UD:',A3                                     LUDMDA    699
     *,', NUMBER OF BLOCKS EXCEED THE LIMIT OF',I4)                     LUDMDA    700
 1285 FORMAT(11X,'INCREASE NXUDB IN PARX.INS')                          LUDMDA    701
 1290 FORMAT(' *** ERROR AT UD:',A3                                     LUDMDA    702
     *,', NUMBER OF UD MODELS EXCEEDS THE LIMIT OF',I5)                 LUDMDA    703
 1300 FORMAT(11X,'INCREASE NUDCM IN PARX.INS')                          LUDMDA    704
 1310 FORMAT(20X,4F10.5,3I5)                                            LUDMDA    705
 1320 FORMAT(20X,3F10.5,3I5)                                            LUDMDA    706
 1330 FORMAT(20X,2F10.5,3I5)                                            LUDMDA    707
      END                                                               LUDMDA    708
