CFPRIME IUDB31                                                          IUDB31      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 IUDB31(IORD,NLF1,KN1,CID)                              IUDB31      3
CD                                                                      IUDB31      4
CD    TO PERFORM INITIALIZATION FOR USER DEFINED BLOCK TYPE 31 (TYPE E1 IUDB31      5
CD    EXCITER END BLOCK) IN A USER DEFINED EXCITER MODEL.               IUDB31      6
CD                                                                      IUDB31      7
CD    EACH ENTRY POINT IN THIS SUBROUTINE HAS SIMILAR FUNCTION AND IS   IUDB31      8
CD    FOR A DIFFERENT TYPE OF EXCITER END BLOCK APPLICABLE TO A USER    IUDB31      9
CD    DEFINED EXCITER MODEL.                                            IUDB31     10
CD                                                                      IUDB31     11
      INCLUDE 'PARX.INS'                                                IUDB31     12
      INCLUDE 'CNMDAT.INS'                                              IUDB31     13
      INCLUDE 'CNMSTA.INS'                                              IUDB31     14
      INCLUDE 'CNXSTA.INS'                                              IUDB31     15
      INCLUDE 'CNSTN.INS'                                               IUDB31     16
      INCLUDE 'CNYVAR.INS'                                              IUDB31     17
      INCLUDE 'CNUNIT.INS'                                              IUDB31     18
      INCLUDE 'CNFLAG.INS'                                              IUDB31     19
      INCLUDE 'CNUDM.INS'                                               IUDB31     20
      INCLUDE 'CNEXC.INS'                                               IUDB31     21
      INCLUDE 'CNMSG.INS'                                               IUDB31     22
C                                                                       IUDB31     23
      CHARACTER*2 CID                                                   IUDB31     24
C                                                                       IUDB31     25
      LDEB=(JDEB(262).NE.0)                                             IUDB31     26
C                                                                       IUDB31     27
      NINP=0                                                            IUDB31     28
      NEXTB=0                                                           IUDB31     29
      JORD=JUDE(IORD)                                                   IUDB31     30
      KORD=JSTATE+KUDE(IORD)+1                                          IUDB31     31
      JEI=JEB+2                                                         IUDB31     32
      IF(DDAT(JEI+2).LE.0.0) THEN                                       IUDB31     33
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31     34
     *                     ,CID                                         IUDB31     35
         WRITE(MSG(2),1030) IORD,BLNAM1,BLNAM2                          IUDB31     36
         CALL PRTMSG(2)                                                 IUDB31     37
         MSG(1)='IUDB31: UDM ERROR'                                     IUDB31     38
         CALL ASTOP(MSG(1),17)                                          IUDB31     39
      ENDIF                                                             IUDB31     40
      J2=JE5-2                                                          IUDB31     41
      DO 110 J=1,INTUD                                                  IUDB31     42
      J2=J2+2                                                           IUDB31     43
      IDD=IDDAT(J2+2)                                                   IUDB31     44
      IDD=IABS(IDD)                                                     IUDB31     45
      IF(IDD.EQ.IORD) THEN                                              IUDB31     46
         XDAT=1.0                                                       IUDB31     47
         IF(IDDAT(J2+2).LT.0) XDAT=-1.0                                 IUDB31     48
         IOUT=IDDAT(J2+1)                                               IUDB31     49
         IF(JUDE(IOUT).EQ.0) THEN                                       IUDB31     50
            NEXTB=IOUT                                                  IUDB31     51
            XDATN=XDAT                                                  IUDB31     52
            NINP=NINP+1                                                 IUDB31     53
         ELSE                                                           IUDB31     54
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31     55
     *                     ,CID                                         IUDB31     56
         WRITE(MSG(2),1090) IORD,BLNAM1,BLNAM2                          IUDB31     57
         CALL PRTMSG(2)                                                 IUDB31     58
         MSG(1)='IUDB31: UDM ERROR'                                     IUDB31     59
         CALL ASTOP(MSG(1),17)                                          IUDB31     60
         ENDIF                                                          IUDB31     61
      ENDIF                                                             IUDB31     62
  110 CONTINUE                                                          IUDB31     63
      J3=JE6-3                                                          IUDB31     64
      DO 120 J=1,INPUD                                                  IUDB31     65
      J3=J3+3                                                           IUDB31     66
      IF(IDDAT(J3+1).EQ.IORD) THEN                                      IUDB31     67
         IIN=IDDAT(J3+2)                                                IUDB31     68
         IF(IIN.EQ.20) THEN                                             IUDB31     69
            XDATN=DDAT(J3+3)                                            IUDB31     70
            NINP=NINP+1                                                 IUDB31     71
         ELSE                                                           IUDB31     72
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31     73
     *                     ,CID                                         IUDB31     74
         WRITE(MSG(2),1001) IORD,BLNAM1,BLNAM2                          IUDB31     75
         WRITE(MSG(3),1002)                                             IUDB31     76
         CALL PRTMSG(3)                                                 IUDB31     77
         MSG(1)='IUDB31: UDM ERROR'                                     IUDB31     78
         CALL ASTOP(MSG(1),17)                                          IUDB31     79
         ENDIF                                                          IUDB31     80
      ENDIF                                                             IUDB31     81
  120 CONTINUE                                                          IUDB31     82
      IF(NINP.EQ.0) THEN                                                IUDB31     83
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31     84
     *                     ,CID                                         IUDB31     85
         WRITE(MSG(2),1010) IORD,BLNAM1,BLNAM2                          IUDB31     86
         CALL PRTMSG(2)                                                 IUDB31     87
         MSG(1)='IUDB31: UDM ERROR'                                     IUDB31     88
         CALL ASTOP(MSG(1),17)                                          IUDB31     89
      ENDIF                                                             IUDB31     90
      IF(NINP.GT.1) THEN                                                IUDB31     91
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31     92
     *                     ,CID                                         IUDB31     93
         WRITE(MSG(2),1050) IORD,BLNAM1,BLNAM2                          IUDB31     94
         CALL PRTMSG(2)                                                 IUDB31     95
         MSG(1)='IUDB31: UDM ERROR'                                     IUDB31     96
         CALL ASTOP(MSG(1),17)                                          IUDB31     97
      ENDIF                                                             IUDB31     98
C                                                                       IUDB31     99
C     DATA PREPARATIONS AND INPUT DATA PRINTOUT                         IUDB31    100
C                                                                       IUDB31    101
      IF(IDDAT(JEI+5).EQ.0)THEN                                         IUDB31    102
      IF (LDEB)                                                         IUDB31    103
     *WRITE(IUD6,1020) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1),CID    IUDB31    104
     &,IORD,BLNAM1,BLNAM2,BLTYP,DDAT(JEI+1),DDAT(JEI+2)                 IUDB31    105
     &,DDAT(JEI+3),DDAT(JEI+4),DDAT(JEI+6),VALOUT(IORD)                 IUDB31    106
      ELSE                                                              IUDB31    107
      IF (LDEB)                                                         IUDB31    108
     *WRITE(IUD6,1060) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1),CID    IUDB31    109
     &,IORD,BLNAM1,BLNAM2,BLTYP,DDAT(JEI+1),DDAT(JEI+2),DDAT(JEI+3)     IUDB31    110
     &,DDAT(JEI+4),DDAT(JEI+5),DDAT(JEI+6),VALOUT(IORD)                 IUDB31    111
         IF(IDDAT(JEI+3).EQ.0.OR.IDDAT(JEI+4).EQ.0)THEN                 IUDB31    112
            AEX=0.0                                                     IUDB31    113
            BEX=1.0                                                     IUDB31    114
            WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1)           IUDB31    115
     *                        ,INAME(KN1),CID                           IUDB31    116
            WRITE(MSG(2),1071)                                          IUDB31    117
            WRITE(MSG(3),1072)                                          IUDB31    118
            CALL PRTMSG(3)                                              IUDB31    119
         ELSE                                                           IUDB31    120
            SERAT=(DDAT(JEI+3)/DDAT(JEI+4))/0.75                        IUDB31    121
            BEX=LOG(SERAT)/(0.25*DDAT(JEI+5))                           IUDB31    122
            AEX=(DDAT(JEI+3)*DDAT(JEI+5))/EXP(BEX*DDAT(JEI+5))          IUDB31    123
         ENDIF                                                          IUDB31    124
         DDAT(JEI+3)=AEX                                                IUDB31    125
         DDAT(JEI+4)=BEX                                                IUDB31    126
         DDAT(JEI+5)=0.0                                                IUDB31    127
      ENDIF                                                             IUDB31    128
C                                                                       IUDB31    129
      VE=VALOUT(IORD)                                                   IUDB31    130
      SE=DDAT(JEI+3)*EXP(DDAT(JEI+4)*VE)/VE                             IUDB31    131
      SEKX=VE*(SE+DDAT(JEI+1))                                          IUDB31    132
      VR=SEKX                                                           IUDB31    133
      IF(VE.LT.DDAT(JEI+6))THEN                                         IUDB31    134
         WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    135
     *                     ,CID                                         IUDB31    136
         WRITE(MSG(2),1110)                                             IUDB31    137
         CALL PRTMSG(2)                                                 IUDB31    138
      ENDIF                                                             IUDB31    139
C                                                                       IUDB31    140
      IF(NEXTB.NE.0) THEN                                               IUDB31    141
         VALOUT(NEXTB)=VR/XDATN                                         IUDB31    142
      ELSE                                                              IUDB31    143
         VALIN(20)=VR/XDATN                                             IUDB31    144
      ENDIF                                                             IUDB31    145
      XSTATE(KORD)=VE                                                   IUDB31    146
      VALIN(19)=VR                                                      IUDB31    147
C                                                                       IUDB31    148
      IF(LDEB)WRITE(IUD6,1040) KORD,JORD,XSTATE(KORD)                   IUDB31    149
C                                                                       IUDB31    150
      RETURN                                                            IUDB31    151
C                                                                       IUDB31    152
C---------------------------------------------------------------------- IUDB31    153
C                                                                       IUDB31    154
      ENTRY IUDB32(IORD,NLF1,KN1,CID)                                   IUDB31    155
CD                                                                      IUDB31    156
CD    FOR BLOCK TYPE 32 (TYPE E2 EXCITER END BLOCK).                    IUDB31    157
CD                                                                      IUDB31    158
      LDEB=(JDEB(262).NE.0)                                             IUDB31    159
C                                                                       IUDB31    160
      NINP=0                                                            IUDB31    161
      NEXTB=0                                                           IUDB31    162
      JORD=JUDE(IORD)                                                   IUDB31    163
      KORD=JSTATE+KUDE(IORD)+1                                          IUDB31    164
      JEI=JEB+2                                                         IUDB31    165
      IF(DDAT(JEI+2).LE.0.0) THEN                                       IUDB31    166
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    167
     *                     ,CID                                         IUDB31    168
         WRITE(MSG(2),1030) IORD,BLNAM1,BLNAM2                          IUDB31    169
         CALL PRTMSG(2)                                                 IUDB31    170
         MSG(1)='IUDB32: UDM ERROR'                                     IUDB31    171
         CALL ASTOP(MSG(1),17)                                          IUDB31    172
      ENDIF                                                             IUDB31    173
      J2=JE5-2                                                          IUDB31    174
      DO 130 J=1,INTUD                                                  IUDB31    175
      J2=J2+2                                                           IUDB31    176
      IDD=IDDAT(J2+2)                                                   IUDB31    177
      IDD=IABS(IDD)                                                     IUDB31    178
      IF(IDD.EQ.IORD) THEN                                              IUDB31    179
         XDAT=1.0                                                       IUDB31    180
         IF(IDDAT(J2+2).LT.0) XDAT=-1.0                                 IUDB31    181
         IOUT=IDDAT(J2+1)                                               IUDB31    182
         IF(JUDE(IOUT).EQ.0) THEN                                       IUDB31    183
            NEXTB=IOUT                                                  IUDB31    184
            XDATN=XDAT                                                  IUDB31    185
            NINP=NINP+1                                                 IUDB31    186
         ELSE                                                           IUDB31    187
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    188
     *                     ,CID                                         IUDB31    189
         WRITE(MSG(2),1090) IORD,BLNAM1,BLNAM2                          IUDB31    190
         CALL PRTMSG(2)                                                 IUDB31    191
         MSG(1)='IUDB32: UDM ERROR'                                     IUDB31    192
         CALL ASTOP(MSG(1),17)                                          IUDB31    193
         ENDIF                                                          IUDB31    194
      ENDIF                                                             IUDB31    195
  130 CONTINUE                                                          IUDB31    196
      J3=JE6-3                                                          IUDB31    197
      DO 140 J=1,INPUD                                                  IUDB31    198
      J3=J3+3                                                           IUDB31    199
      IF(IDDAT(J3+1).EQ.IORD) THEN                                      IUDB31    200
         IIN=IDDAT(J3+2)                                                IUDB31    201
         IF(IIN.EQ.20) THEN                                             IUDB31    202
            XDATN=DDAT(J3+3)                                            IUDB31    203
            NINP=NINP+1                                                 IUDB31    204
         ELSE                                                           IUDB31    205
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    206
     *                     ,CID                                         IUDB31    207
         WRITE(MSG(2),1001) IORD,BLNAM1,BLNAM2                          IUDB31    208
         WRITE(MSG(3),1002)                                             IUDB31    209
         CALL PRTMSG(3)                                                 IUDB31    210
         MSG(1)='IUDB32: UDM ERROR'                                     IUDB31    211
         CALL ASTOP(MSG(1),17)                                          IUDB31    212
         ENDIF                                                          IUDB31    213
      ENDIF                                                             IUDB31    214
  140 CONTINUE                                                          IUDB31    215
      IF(NINP.EQ.0) THEN                                                IUDB31    216
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    217
     *                     ,CID                                         IUDB31    218
         WRITE(MSG(2),1010) IORD,BLNAM1,BLNAM2                          IUDB31    219
         CALL PRTMSG(2)                                                 IUDB31    220
         MSG(1)='IUDB32: UDM ERROR'                                     IUDB31    221
         CALL ASTOP(MSG(1),17)                                          IUDB31    222
      ENDIF                                                             IUDB31    223
      IF(NINP.GT.1) THEN                                                IUDB31    224
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    225
     *                     ,CID                                         IUDB31    226
         WRITE(MSG(2),1050) IORD,BLNAM1,BLNAM2                          IUDB31    227
         CALL PRTMSG(2)                                                 IUDB31    228
         MSG(1)='IUDB32: UDM ERROR'                                     IUDB31    229
         CALL ASTOP(MSG(1),17)                                          IUDB31    230
      ENDIF                                                             IUDB31    231
C                                                                       IUDB31    232
C     DATA PREPARATIONS AND INPUT DATA PRINTOUT                         IUDB31    233
C                                                                       IUDB31    234
      IF(IDDAT(JEI+5).NE.0)THEN                                         IUDB31    235
         IF(IDDAT(JEI+3).EQ.0.OR.IDDAT(JEI+4).EQ.0)THEN                 IUDB31    236
            AEX=0.0                                                     IUDB31    237
            BEX=1.0                                                     IUDB31    238
            WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1)           IUDB31    239
     *                        ,INAME(KN1),CID                           IUDB31    240
            WRITE(MSG(2),1071)                                          IUDB31    241
            WRITE(MSG(3),1072)                                          IUDB31    242
            CALL PRTMSG(3)                                              IUDB31    243
         ELSE                                                           IUDB31    244
            SERAT=(DDAT(JEI+3)/DDAT(JEI+4))/0.75                        IUDB31    245
            BEX=LOG(SERAT)/(0.25*DDAT(JEI+5))                           IUDB31    246
            AEX=(DDAT(JEI+3)*DDAT(JEI+5))/EXP(BEX*DDAT(JEI+5))          IUDB31    247
         ENDIF                                                          IUDB31    248
         DDAT(JEI+3)=AEX                                                IUDB31    249
         DDAT(JEI+4)=BEX                                                IUDB31    250
         DDAT(JEI+5)=0.0                                                IUDB31    251
      ENDIF                                                             IUDB31    252
C                                                                       IUDB31    253
      VE=VALOUT(IORD)                                                   IUDB31    254
      XSTATE(KORD)=VE                                                   IUDB31    255
      SE=DDAT(JEI+3)*EXP(DDAT(JEI+4)*VE)/VE                             IUDB31    256
      RX=1.0/(SE+1.0)                                                   IUDB31    257
      DDAT(JEI+1)=RX-1.0                                                IUDB31    258
      DDAT(JEI+3)=RX*DDAT(JEI+3)                                        IUDB31    259
      IF(VE.LT.DDAT(JEI+6)) THEN                                        IUDB31    260
         WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    261
     *                     ,CID                                         IUDB31    262
         WRITE(MSG(2),1110)                                             IUDB31    263
         CALL PRTMSG(2)                                                 IUDB31    264
      ENDIF                                                             IUDB31    265
C                                                                       IUDB31    266
      IF(LDEB)WRITE(IUD6,1040) KORD,JORD,XSTATE(KORD)                   IUDB31    267
C                                                                       IUDB31    268
      RETURN                                                            IUDB31    269
C                                                                       IUDB31    270
C-----------------------------------------------------------------------IUDB31    271
C                                                                       IUDB31    272
      ENTRY IUDB33(IORD,NLF1,KN1,CID)                                   IUDB31    273
CD                                                                      IUDB31    274
CD    FOR BLOCK TYPE 33 AND 35 (TYPES E3 AND E5 EXCITER END BLOCKS).    IUDB31    275
CD                                                                      IUDB31    276
      LDEB=(JDEB(262).NE.0)                                             IUDB31    277
C                                                                       IUDB31    278
      NINP=0                                                            IUDB31    279
      NEXTB=0                                                           IUDB31    280
      JORD=JUDE(IORD)                                                   IUDB31    281
      KORD=JSTATE+KUDE(IORD)+1                                          IUDB31    282
      JEI=JEB+2                                                         IUDB31    283
      IF(DDAT(JEI+2).LE.0.0) THEN                                       IUDB31    284
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    285
     *                     ,CID                                         IUDB31    286
         WRITE(MSG(2),1030) IORD,BLNAM1,BLNAM2                          IUDB31    287
         CALL PRTMSG(2)                                                 IUDB31    288
         MSG(1)='IUDB33: UDM ERROR'                                     IUDB31    289
         CALL ASTOP(MSG(1),17)                                          IUDB31    290
      ENDIF                                                             IUDB31    291
      J2=JE5-2                                                          IUDB31    292
      DO 150 J=1,INTUD                                                  IUDB31    293
      J2=J2+2                                                           IUDB31    294
      IDD=IDDAT(J2+2)                                                   IUDB31    295
      IDD=IABS(IDD)                                                     IUDB31    296
      IF(IDD.EQ.IORD) THEN                                              IUDB31    297
         XDAT=1.0                                                       IUDB31    298
         IF(IDDAT(J2+2).LT.0) XDAT=-1.0                                 IUDB31    299
         IOUT=IDDAT(J2+1)                                               IUDB31    300
         IF(JUDE(IOUT).EQ.0) THEN                                       IUDB31    301
            NEXTB=IOUT                                                  IUDB31    302
            XDATN=XDAT                                                  IUDB31    303
            NINP=NINP+1                                                 IUDB31    304
         ELSE                                                           IUDB31    305
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    306
     *                     ,CID                                         IUDB31    307
         WRITE(MSG(2),1090) IORD,BLNAM1,BLNAM2                          IUDB31    308
         CALL PRTMSG(2)                                                 IUDB31    309
         MSG(1)='IUDB33: UDM ERROR'                                     IUDB31    310
         CALL ASTOP(MSG(1),17)                                          IUDB31    311
         ENDIF                                                          IUDB31    312
      ENDIF                                                             IUDB31    313
  150 CONTINUE                                                          IUDB31    314
      J3=JE6-3                                                          IUDB31    315
      DO 160 J=1,INPUD                                                  IUDB31    316
      J3=J3+3                                                           IUDB31    317
      IF(IDDAT(J3+1).EQ.IORD) THEN                                      IUDB31    318
         IIN=IDDAT(J3+2)                                                IUDB31    319
         IF(IIN.EQ.20) THEN                                             IUDB31    320
            XDATN=DDAT(J3+3)                                            IUDB31    321
            NINP=NINP+1                                                 IUDB31    322
         ELSE                                                           IUDB31    323
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    324
     *                     ,CID                                         IUDB31    325
         WRITE(MSG(2),1001) IORD,BLNAM1,BLNAM2                          IUDB31    326
         WRITE(MSG(3),1002)                                             IUDB31    327
         CALL PRTMSG(3)                                                 IUDB31    328
         MSG(1)='IUDB33: UDM ERROR'                                     IUDB31    329
         CALL ASTOP(MSG(1),17)                                          IUDB31    330
         ENDIF                                                          IUDB31    331
      ENDIF                                                             IUDB31    332
  160 CONTINUE                                                          IUDB31    333
      IF(NINP.EQ.0) THEN                                                IUDB31    334
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    335
     *                     ,CID                                         IUDB31    336
         WRITE(MSG(2),1010) IORD,BLNAM1,BLNAM2                          IUDB31    337
         CALL PRTMSG(2)                                                 IUDB31    338
         MSG(1)='IUDB33: UDM ERROR'                                     IUDB31    339
         CALL ASTOP(MSG(1),17)                                          IUDB31    340
      ENDIF                                                             IUDB31    341
      IF(NINP.GT.1) THEN                                                IUDB31    342
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    343
     *                     ,CID                                         IUDB31    344
         WRITE(MSG(2),1050) IORD,BLNAM1,BLNAM2                          IUDB31    345
         CALL PRTMSG(2)                                                 IUDB31    346
         MSG(1)='IUDB33: UDM ERROR'                                     IUDB31    347
         CALL ASTOP(MSG(1),17)                                          IUDB31    348
      ENDIF                                                             IUDB31    349
C                                                                       IUDB31    350
C     DATA PREPARATIONS AND INPUT DATA PRINTOUT                         IUDB31    351
C                                                                       IUDB31    352
      EFDN=VALOUT(IORD)                                                 IUDB31    353
      IF(IDDAT(JEI+5).NE.0)THEN                                         IUDB31    354
         IF(IDDAT(JEI+3).EQ.0.OR.IDDAT(JEI+4).EQ.0)THEN                 IUDB31    355
            AEX=0.0                                                     IUDB31    356
            BEX=1.0                                                     IUDB31    357
            WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1)           IUDB31    358
     *                        ,INAME(KN1),CID                           IUDB31    359
            WRITE(MSG(2),1071)                                          IUDB31    360
            WRITE(MSG(3),1072)                                          IUDB31    361
            CALL PRTMSG(3)                                              IUDB31    362
         ELSE                                                           IUDB31    363
            SERAT=(DDAT(JEI+3)/DDAT(JEI+4))/0.75                        IUDB31    364
            BEX=LOG(SERAT)/(0.25*DDAT(JEI+5))                           IUDB31    365
            AEX=(DDAT(JEI+3)*DDAT(JEI+5))/EXP(BEX*DDAT(JEI+5))          IUDB31    366
         ENDIF                                                          IUDB31    367
         DDAT(JEI+3)=AEX                                                IUDB31    368
         DDAT(JEI+4)=BEX                                                IUDB31    369
         DDAT(JEI+5)=0.0                                                IUDB31    370
      ENDIF                                                             IUDB31    371
C                                                                       IUDB31    372
      IF (IDDAT(JEI+6).EQ.0)THEN                                        IUDB31    373
         VTH=EFDN                                                       IUDB31    374
      ELSE                                                              IUDB31    375
         CFKC=EFDN*DDAT(JEI+6)                                          IUDB31    376
         VTH=EFDN+0.577*CFKC                                            IUDB31    377
         FACT=CFKC/VTH                                                  IUDB31    378
         IF(FACT.LT.0.433) GO TO 170                                    IUDB31    379
         VTH=EFDN/1.732+CFKC                                            IUDB31    380
         FACT=CFKC/VTH                                                  IUDB31    381
         IF(FACT.GT.0.75) GO TO 170                                     IUDB31    382
         VTH=(EFDN*EFDN+CFKC*CFKC)/0.75                                 IUDB31    383
         VTH=SQRT(VTH)                                                  IUDB31    384
         FACT=CFKC/VTH                                                  IUDB31    385
         IF(FACT.LE.0.75.AND.FACT.GE.0.433) GO TO 170                   IUDB31    386
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    387
     *                     ,CID                                         IUDB31    388
         WRITE(MSG(2),1400) IORD,BLNAM1,BLNAM2                          IUDB31    389
         WRITE(MSG(3),1401) VTH,FACT                                    IUDB31    390
         CALL PRTMSG(3)                                                 IUDB31    391
         MSG(1)='IUDB33: UDM ERROR'                                     IUDB31    392
         CALL ASTOP(MSG(1),17)                                          IUDB31    393
      ENDIF                                                             IUDB31    394
  170 VE=VTH+EFDN*DDAT(JEI+8)                                           IUDB31    395
C                                                                       IUDB31    396
      SE=DDAT(JEI+3)*EXP(DDAT(JEI+4)*VE)                                IUDB31    397
      SEKX=SE+VE*DDAT(JEI+1)                                            IUDB31    398
      SEKX=SEKX+EFDN*(DDAT(JEI+7)-DDAT(JEI+8))                          IUDB31    399
C                                                                       IUDB31    400
      VR=SEKX                                                           IUDB31    401
      IF(NEXTB.NE.0) THEN                                               IUDB31    402
         VALOUT(NEXTB)=VR/XDATN                                         IUDB31    403
      ELSE                                                              IUDB31    404
         VALIN(20)=VR/XDATN                                             IUDB31    405
      ENDIF                                                             IUDB31    406
      XSTATE(KORD)=VE                                                   IUDB31    407
      VALIN(19)=VR                                                      IUDB31    408
      IF(VE.LT.DDAT(JEI+11)) THEN                                       IUDB31    409
         WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    410
     *                     ,CID                                         IUDB31    411
         WRITE(MSG(2),1410)                                             IUDB31    412
         WRITE(MSG(3),1411) VE                                          IUDB31    413
         CALL PRTMSG(3)                                                 IUDB31    414
      ENDIF                                                             IUDB31    415
C                                                                       IUDB31    416
      IF(LDEB)WRITE(IUD6,1040) KORD,JORD,XSTATE(KORD)                   IUDB31    417
C                                                                       IUDB31    418
      RETURN                                                            IUDB31    419
C                                                                       IUDB31    420
C-----------------------------------------------------------------------IUDB31    421
C                                                                       IUDB31    422
      ENTRY IUDB34(IORD,NLF1,KN1,CID)                                   IUDB31    423
CD                                                                      IUDB31    424
CD    FOR BLOCK TYPE 34 (TYPE E4 EXCITER END BLOCK).                    IUDB31    425
CD                                                                      IUDB31    426
      LDEB=(JDEB(262).NE.0)                                             IUDB31    427
C                                                                       IUDB31    428
      NINP=0                                                            IUDB31    429
      NEXTB=0                                                           IUDB31    430
      JORD=JUDE(IORD)                                                   IUDB31    431
      KORD=JSTATE+KUDE(IORD)+1                                          IUDB31    432
      JEI=JEB+2                                                         IUDB31    433
      IF(DDAT(JEI+2).LE.0.0) THEN                                       IUDB31    434
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    435
     *                     ,CID                                         IUDB31    436
         WRITE(MSG(2),1030) IORD,BLNAM1,BLNAM2                          IUDB31    437
         CALL PRTMSG(2)                                                 IUDB31    438
         MSG(1)='IUDB34: UDM ERROR'                                     IUDB31    439
         CALL ASTOP(MSG(1),17)                                          IUDB31    440
      ENDIF                                                             IUDB31    441
      IF(IDDAT(JEI+9).EQ.0) DDAT(JEI+9)=999.9                           IUDB31    442
      J2=JE5-2                                                          IUDB31    443
      DO 180 J=1,INTUD                                                  IUDB31    444
      J2=J2+2                                                           IUDB31    445
      IDD=IDDAT(J2+2)                                                   IUDB31    446
      IDD=IABS(IDD)                                                     IUDB31    447
      IF(IDD.EQ.IORD) THEN                                              IUDB31    448
         XDAT=1.0                                                       IUDB31    449
         IF(IDDAT(J2+2).LT.0) XDAT=-1.0                                 IUDB31    450
         IOUT=IDDAT(J2+1)                                               IUDB31    451
         IF(JUDE(IOUT).EQ.0) THEN                                       IUDB31    452
            NEXTB=IOUT                                                  IUDB31    453
            XDATN=XDAT                                                  IUDB31    454
            NINP=NINP+1                                                 IUDB31    455
         ELSE                                                           IUDB31    456
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    457
     *                     ,CID                                         IUDB31    458
         WRITE(MSG(2),1090) IORD,BLNAM1,BLNAM2                          IUDB31    459
         CALL PRTMSG(2)                                                 IUDB31    460
         MSG(1)='IUDB34: UDM ERROR'                                     IUDB31    461
         CALL ASTOP(MSG(1),17)                                          IUDB31    462
         ENDIF                                                          IUDB31    463
      ENDIF                                                             IUDB31    464
  180 CONTINUE                                                          IUDB31    465
      J3=JE6-3                                                          IUDB31    466
      DO 190 J=1,INPUD                                                  IUDB31    467
      J3=J3+3                                                           IUDB31    468
      IF(IDDAT(J3+1).EQ.IORD) THEN                                      IUDB31    469
         IIN=IDDAT(J3+2)                                                IUDB31    470
         IF(IIN.EQ.20) THEN                                             IUDB31    471
            XDATN=DDAT(J3+3)                                            IUDB31    472
            NINP=NINP+1                                                 IUDB31    473
         ELSE                                                           IUDB31    474
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    475
     *                     ,CID                                         IUDB31    476
         WRITE(MSG(2),1001) IORD,BLNAM1,BLNAM2                          IUDB31    477
         WRITE(MSG(3),1002)                                             IUDB31    478
         CALL PRTMSG(3)                                                 IUDB31    479
         MSG(1)='IUDB34: UDM ERROR'                                     IUDB31    480
         CALL ASTOP(MSG(1),17)                                          IUDB31    481
         ENDIF                                                          IUDB31    482
      ENDIF                                                             IUDB31    483
  190 CONTINUE                                                          IUDB31    484
      IF(NINP.EQ.0) THEN                                                IUDB31    485
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    486
     *                     ,CID                                         IUDB31    487
         WRITE(MSG(2),1010) IORD,BLNAM1,BLNAM2                          IUDB31    488
         CALL PRTMSG(2)                                                 IUDB31    489
         MSG(1)='IUDB34: UDM ERROR'                                     IUDB31    490
         CALL ASTOP(MSG(1),17)                                          IUDB31    491
      ENDIF                                                             IUDB31    492
      IF(NINP.GT.1) THEN                                                IUDB31    493
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    494
     *                     ,CID                                         IUDB31    495
         WRITE(MSG(2),1050) IORD,BLNAM1,BLNAM2                          IUDB31    496
         CALL PRTMSG(2)                                                 IUDB31    497
         MSG(1)='IUDB34: UDM ERROR'                                     IUDB31    498
         CALL ASTOP(MSG(1),17)                                          IUDB31    499
      ENDIF                                                             IUDB31    500
C                                                                       IUDB31    501
C     DATA PREPARATIONS AND INPUT DATA PRINTOUT                         IUDB31    502
C                                                                       IUDB31    503
      EFDN=VALOUT(IORD)                                                 IUDB31    504
      IF(IDDAT(JEI+5).EQ.0)THEN                                         IUDB31    505
      ELSE                                                              IUDB31    506
         IF(IDDAT(JEI+3).EQ.0.OR.IDDAT(JEI+4).EQ.0)THEN                 IUDB31    507
            AEX=0.0                                                     IUDB31    508
            BEX=1.0                                                     IUDB31    509
            WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1)           IUDB31    510
     *                        ,INAME(KN1),CID                           IUDB31    511
            WRITE(MSG(2),1071)                                          IUDB31    512
            WRITE(MSG(3),1072)                                          IUDB31    513
            CALL PRTMSG(3)                                              IUDB31    514
         ELSE                                                           IUDB31    515
            SERAT=(DDAT(JEI+3)/DDAT(JEI+4))/0.75                        IUDB31    516
            BEX=LOG(SERAT)/(0.25*DDAT(JEI+5))                           IUDB31    517
            AEX=(DDAT(JEI+3)*DDAT(JEI+5))/EXP(BEX*DDAT(JEI+5))          IUDB31    518
         ENDIF                                                          IUDB31    519
         DDAT(JEI+3)=AEX                                                IUDB31    520
         DDAT(JEI+4)=BEX                                                IUDB31    521
         DDAT(JEI+5)=0.0                                                IUDB31    522
      ENDIF                                                             IUDB31    523
C                                                                       IUDB31    524
      IF (IDDAT(JEI+6).EQ.0)THEN                                        IUDB31    525
         VTH=EFDN                                                       IUDB31    526
      ELSE                                                              IUDB31    527
         CFKC=EFDN*DDAT(JEI+6)                                          IUDB31    528
         VTH=EFDN+0.577*CFKC                                            IUDB31    529
         FACT=CFKC/VTH                                                  IUDB31    530
         IF(FACT.LT.0.433) GO TO 200                                    IUDB31    531
         VTH=EFDN/1.732+CFKC                                            IUDB31    532
         FACT=CFKC/VTH                                                  IUDB31    533
         IF(FACT.GT.0.75) GO TO 200                                     IUDB31    534
         VTH=(EFDN*EFDN+CFKC*CFKC)/0.75                                 IUDB31    535
         VTH=SQRT(VTH)                                                  IUDB31    536
         FACT=CFKC/VTH                                                  IUDB31    537
         IF(FACT.LE.0.75.AND.FACT.GE.0.433) GO TO 200                   IUDB31    538
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    539
     *                     ,CID                                         IUDB31    540
         WRITE(MSG(2),1400) IORD,BLNAM1,BLNAM2                          IUDB31    541
         WRITE(MSG(3),1401) VTH,FACT                                    IUDB31    542
         CALL PRTMSG(3)                                                 IUDB31    543
         MSG(1)='IUDB34: UDM ERROR'                                     IUDB31    544
         CALL ASTOP(MSG(1),17)                                          IUDB31    545
      ENDIF                                                             IUDB31    546
  200 VE=VTH+EFDN*DDAT(JEI+8)                                           IUDB31    547
C                                                                       IUDB31    548
      SE=DDAT(JEI+3)*EXP(DDAT(JEI+4)*VE)                                IUDB31    549
      SEKX=SE+VE*DDAT(JEI+1)                                            IUDB31    550
      VEMAX=(DDAT(JEI+9)-(DDAT(JEI+7)-DDAT(JEI+8))*EFDN)*VE/SEKX        IUDB31    551
      IF(VEMAX.LE.DDAT(JEI+11)) THEN                                    IUDB31    552
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    553
     *                     ,CID                                         IUDB31    554
         WRITE(MSG(2),1570) IORD,BLNAM1,BLNAM2                          IUDB31    555
         WRITE(MSG(3),1720) VEMAX,DDAT(JEI+11)                          IUDB31    556
         CALL PRTMSG(3)                                                 IUDB31    557
         MSG(1)='IUDB34: UDM ERROR'                                     IUDB31    558
         CALL ASTOP(MSG(1),17)                                          IUDB31    559
      ENDIF                                                             IUDB31    560
      DDAT(JEI+10)=VEMAX                                                IUDB31    561
      SEKX=SEKX+EFDN*(DDAT(JEI+7)-DDAT(JEI+8))                          IUDB31    562
C                                                                       IUDB31    563
      VR=SEKX/(DDAT(JEI+12)*EFDN)                                       IUDB31    564
      IF(NEXTB.NE.0) THEN                                               IUDB31    565
         VALOUT(NEXTB)=VR/XDATN                                         IUDB31    566
      ELSE                                                              IUDB31    567
         VALIN(20)=VR/XDATN                                             IUDB31    568
      ENDIF                                                             IUDB31    569
      XSTATE(KORD)=VE                                                   IUDB31    570
      VALIN(19)=VR                                                      IUDB31    571
      IF(VE.GT.VEMAX.OR.VE.LT.DDAT(JEI+11))THEN                         IUDB31    572
         WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    573
     *                     ,CID                                         IUDB31    574
         WRITE(MSG(2),1560) IORD,BLNAM1,BLNAM2                          IUDB31    575
         WRITE(MSG(3),1710) VE,VEMAX,DDAT(JEI+11)                       IUDB31    576
         CALL PRTMSG(3)                                                 IUDB31    577
      ENDIF                                                             IUDB31    578
C                                                                       IUDB31    579
      IF(LDEB)WRITE(IUD6,1040) KORD,JORD,XSTATE(KORD)                   IUDB31    580
C                                                                       IUDB31    581
      RETURN                                                            IUDB31    582
C                                                                       IUDB31    583
C-----------------------------------------------------------------------IUDB31    584
C                                                                       IUDB31    585
      ENTRY IUDB36(IORD,NLF1,KN1,CID)                                   IUDB31    586
CD                                                                      IUDB31    587
CD    FOR BLOCK TYPE 36 (TYPE E6 EXCITER END BLOCK).                    IUDB31    588
CD                                                                      IUDB31    589
      LDEB=(JDEB(262).NE.0)                                             IUDB31    590
C                                                                       IUDB31    591
      NINP=0                                                            IUDB31    592
      NEXTB=0                                                           IUDB31    593
      JORD=JUDE(IORD)                                                   IUDB31    594
      KORD=JSTATE+KUDE(IORD)+1                                          IUDB31    595
      JEI=JEB+2                                                         IUDB31    596
      IF(DDAT(JEI+2).LE.0.0) THEN                                       IUDB31    597
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    598
     *                     ,CID                                         IUDB31    599
         WRITE(MSG(2),1030) IORD,BLNAM1,BLNAM2                          IUDB31    600
         CALL PRTMSG(2)                                                 IUDB31    601
         MSG(1)='IUDB36: UDM ERROR'                                     IUDB31    602
         CALL ASTOP(MSG(1),17)                                          IUDB31    603
      ENDIF                                                             IUDB31    604
      IF(IDDAT(JEI+9).EQ.0) DDAT(JEI+9)=999.9                           IUDB31    605
      J2=JE5-2                                                          IUDB31    606
      DO 210 J=1,INTUD                                                  IUDB31    607
      J2=J2+2                                                           IUDB31    608
      IDD=IDDAT(J2+2)                                                   IUDB31    609
      IDD=IABS(IDD)                                                     IUDB31    610
      IF(IDD.EQ.IORD) THEN                                              IUDB31    611
         XDAT=1.0                                                       IUDB31    612
         IF(IDDAT(J2+2).LT.0) XDAT=-1.0                                 IUDB31    613
         IOUT=IDDAT(J2+1)                                               IUDB31    614
         IF(JUDE(IOUT).EQ.0) THEN                                       IUDB31    615
            NEXTB=IOUT                                                  IUDB31    616
            XDATN=XDAT                                                  IUDB31    617
            NINP=NINP+1                                                 IUDB31    618
         ELSE                                                           IUDB31    619
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    620
     *                     ,CID                                         IUDB31    621
         WRITE(MSG(2),1090) IORD,BLNAM1,BLNAM2                          IUDB31    622
         CALL PRTMSG(2)                                                 IUDB31    623
         MSG(1)='IUDB36: UDM ERROR'                                     IUDB31    624
         CALL ASTOP(MSG(1),17)                                          IUDB31    625
         ENDIF                                                          IUDB31    626
      ENDIF                                                             IUDB31    627
  210 CONTINUE                                                          IUDB31    628
      J3=JE6-3                                                          IUDB31    629
      DO 220 J=1,INPUD                                                  IUDB31    630
      J3=J3+3                                                           IUDB31    631
      IF(IDDAT(J3+1).EQ.IORD) THEN                                      IUDB31    632
         IIN=IDDAT(J3+2)                                                IUDB31    633
         IF(IIN.EQ.20) THEN                                             IUDB31    634
            XDATN=DDAT(J3+3)                                            IUDB31    635
            NINP=NINP+1                                                 IUDB31    636
         ELSE                                                           IUDB31    637
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    638
     *                     ,CID                                         IUDB31    639
         WRITE(MSG(2),1001) IORD,BLNAM1,BLNAM2                          IUDB31    640
         WRITE(MSG(3),1002)                                             IUDB31    641
         CALL PRTMSG(3)                                                 IUDB31    642
         MSG(1)='IUDB36: UDM ERROR'                                     IUDB31    643
         CALL ASTOP(MSG(1),17)                                          IUDB31    644
         ENDIF                                                          IUDB31    645
      ENDIF                                                             IUDB31    646
  220 CONTINUE                                                          IUDB31    647
      IF(NINP.EQ.0) THEN                                                IUDB31    648
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    649
     *                     ,CID                                         IUDB31    650
         WRITE(MSG(2),1010) IORD,BLNAM1,BLNAM2                          IUDB31    651
         CALL PRTMSG(2)                                                 IUDB31    652
         MSG(1)='IUDB36: UDM ERROR'                                     IUDB31    653
         CALL ASTOP(MSG(1),17)                                          IUDB31    654
      ENDIF                                                             IUDB31    655
      IF(NINP.GT.1) THEN                                                IUDB31    656
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    657
     *                     ,CID                                         IUDB31    658
         WRITE(MSG(2),1050) IORD,BLNAM1,BLNAM2                          IUDB31    659
         CALL PRTMSG(2)                                                 IUDB31    660
         MSG(1)='IUDB36: UDM ERROR'                                     IUDB31    661
         CALL ASTOP(MSG(1),17)                                          IUDB31    662
      ENDIF                                                             IUDB31    663
C                                                                       IUDB31    664
C     DATA PREPARATIONS AND INPUT DATA PRINTOUT                         IUDB31    665
C                                                                       IUDB31    666
      EFDN=VALOUT(IORD)                                                 IUDB31    667
      IF(IDDAT(JEI+5).NE.0)THEN                                         IUDB31    668
         IF(IDDAT(JEI+3).EQ.0.OR.IDDAT(JEI+4).EQ.0)THEN                 IUDB31    669
            AEX=0.0                                                     IUDB31    670
            BEX=1.0                                                     IUDB31    671
            WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1)           IUDB31    672
     *                        ,INAME(KN1),CID                           IUDB31    673
            WRITE(MSG(2),1071)                                          IUDB31    674
            WRITE(MSG(3),1072)                                          IUDB31    675
            CALL PRTMSG(3)                                              IUDB31    676
         ELSE                                                           IUDB31    677
            SERAT=(DDAT(JEI+3)/DDAT(JEI+4))/0.75                        IUDB31    678
            BEX=LOG(SERAT)/(0.25*DDAT(JEI+5))                           IUDB31    679
            AEX=(DDAT(JEI+3)*DDAT(JEI+5))/EXP(BEX*DDAT(JEI+5))          IUDB31    680
         ENDIF                                                          IUDB31    681
         DDAT(JEI+3)=AEX                                                IUDB31    682
         DDAT(JEI+4)=BEX                                                IUDB31    683
         DDAT(JEI+5)=0.0                                                IUDB31    684
      ENDIF                                                             IUDB31    685
C                                                                       IUDB31    686
      IF(IDDAT(JEI+6).EQ.0)THEN                                         IUDB31    687
         VTH=EFDN                                                       IUDB31    688
      ELSE                                                              IUDB31    689
         CFKC=EFDN*DDAT(JEI+6)                                          IUDB31    690
         VTH=EFDN+0.577*CFKC                                            IUDB31    691
         FACT=CFKC/VTH                                                  IUDB31    692
         IF(FACT.LT.0.433) GO TO 230                                    IUDB31    693
         VTH=EFDN/1.732+CFKC                                            IUDB31    694
         FACT=CFKC/VTH                                                  IUDB31    695
         IF(FACT.GT.0.75) GO TO 230                                     IUDB31    696
         VTH=(EFDN*EFDN+CFKC*CFKC)/0.75                                 IUDB31    697
         VTH=SQRT(VTH)                                                  IUDB31    698
         FACT=CFKC/VTH                                                  IUDB31    699
         IF(FACT.LE.0.75.AND.FACT.GE.0.433) GO TO 230                   IUDB31    700
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    701
     *                     ,CID                                         IUDB31    702
         WRITE(MSG(2),1400) IORD,BLNAM1,BLNAM2                          IUDB31    703
         WRITE(MSG(3),1401) VTH,FACT                                    IUDB31    704
         CALL PRTMSG(3)                                                 IUDB31    705
         MSG(1)='IUDB36: UDM ERROR'                                     IUDB31    706
         CALL ASTOP(MSG(1),17)                                          IUDB31    707
      ENDIF                                                             IUDB31    708
  230 VE=VTH+EFDN*DDAT(JEI+8)                                           IUDB31    709
C                                                                       IUDB31    710
      SE=DDAT(JEI+3)*EXP(DDAT(JEI+4)*VE)                                IUDB31    711
      SEKX=SE+VE*DDAT(JEI+1)                                            IUDB31    712
      VEMAX=(DDAT(JEI+9)-(DDAT(JEI+7)-DDAT(JEI+8))*EFDN)*VE/SEKX        IUDB31    713
      IF(VEMAX.LE.DDAT(JEI+11)) THEN                                    IUDB31    714
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    715
     *                     ,CID                                         IUDB31    716
         WRITE(MSG(2),1570) IORD,BLNAM1,BLNAM2                          IUDB31    717
         WRITE(MSG(3),1720) VEMAX,DDAT(JEI+11)                          IUDB31    718
         CALL PRTMSG(3)                                                 IUDB31    719
         MSG(1)='IUDB36: UDM ERROR'                                     IUDB31    720
         CALL ASTOP(MSG(1),17)                                          IUDB31    721
      ENDIF                                                             IUDB31    722
      DDAT(JEI+10)=VEMAX                                                IUDB31    723
      SEKX=SEKX+EFDN*(DDAT(JEI+7)-DDAT(JEI+8))                          IUDB31    724
C                                                                       IUDB31    725
      VR=SEKX                                                           IUDB31    726
      IF(NEXTB.NE.0) THEN                                               IUDB31    727
         VALOUT(NEXTB)=VR/XDATN                                         IUDB31    728
      ELSE                                                              IUDB31    729
         VALIN(20)=VR/XDATN                                             IUDB31    730
      ENDIF                                                             IUDB31    731
      XSTATE(KORD)=VE                                                   IUDB31    732
      VALIN(19)=VR                                                      IUDB31    733
      IF(VE.GT.VEMAX.OR.VE.LT.DDAT(JEI+11))THEN                         IUDB31    734
         WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    735
     *                     ,CID                                         IUDB31    736
         WRITE(MSG(2),1560) IORD,BLNAM1,BLNAM2                          IUDB31    737
         WRITE(MSG(3),1710) VE,VEMAX,DDAT(JEI+11)                       IUDB31    738
         CALL PRTMSG(3)                                                 IUDB31    739
      ENDIF                                                             IUDB31    740
C                                                                       IUDB31    741
      IF(LDEB)WRITE(IUD6,1040) KORD,JORD,XSTATE(KORD)                   IUDB31    742
C                                                                       IUDB31    743
      RETURN                                                            IUDB31    744
C                                                                       IUDB31    745
C-----------------------------------------------------------------------IUDB31    746
C                                                                       IUDB31    747
      ENTRY IUDB37(IORD,NLF1,KN1,CID)                                   IUDB31    748
CD                                                                      IUDB31    749
CD    FOR BLOCK TYPE 37 (TYPE E7 EXCITER END BLOCK).                    IUDB31    750
CD                                                                      IUDB31    751
      LDEB=(JDEB(262).NE.0)                                             IUDB31    752
C                                                                       IUDB31    753
      NINP=0                                                            IUDB31    754
      NEXTB=0                                                           IUDB31    755
      JORD=JUDE(IORD)                                                   IUDB31    756
      KORD=JSTATE+KUDE(IORD)+1                                          IUDB31    757
      JEI=JEB+2                                                         IUDB31    758
      IF(DDAT(JEI+2).LE.0.0) THEN                                       IUDB31    759
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    760
     *                     ,CID                                         IUDB31    761
         WRITE(MSG(2),1030) IORD,BLNAM1,BLNAM2                          IUDB31    762
         CALL PRTMSG(2)                                                 IUDB31    763
         MSG(1)='IUDB37: UDM ERROR'                                     IUDB31    764
         CALL ASTOP(MSG(1),17)                                          IUDB31    765
      ENDIF                                                             IUDB31    766
      IF(IDDAT(JEI+3).EQ.0) DDAT(JEI+3)=999.9                           IUDB31    767
      J2=JE5-2                                                          IUDB31    768
      DO 240 J=1,INTUD                                                  IUDB31    769
      J2=J2+2                                                           IUDB31    770
      IDD=IDDAT(J2+2)                                                   IUDB31    771
      IDD=IABS(IDD)                                                     IUDB31    772
      IF(IDD.EQ.IORD) THEN                                              IUDB31    773
         XDAT=1.0                                                       IUDB31    774
         IF(IDDAT(J2+2).LT.0) XDAT=-1.0                                 IUDB31    775
         IOUT=IDDAT(J2+1)                                               IUDB31    776
         IF(JUDE(IOUT).EQ.0) THEN                                       IUDB31    777
            NEXTB=IOUT                                                  IUDB31    778
            XDATN=XDAT                                                  IUDB31    779
            NINP=NINP+1                                                 IUDB31    780
         ELSE                                                           IUDB31    781
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    782
     *                     ,CID                                         IUDB31    783
         WRITE(MSG(2),1090) IORD,BLNAM1,BLNAM2                          IUDB31    784
         CALL PRTMSG(2)                                                 IUDB31    785
         MSG(1)='IUDB37: UDM ERROR'                                     IUDB31    786
         CALL ASTOP(MSG(1),17)                                          IUDB31    787
         ENDIF                                                          IUDB31    788
      ENDIF                                                             IUDB31    789
  240 CONTINUE                                                          IUDB31    790
      J3=JE6-3                                                          IUDB31    791
      DO 250 J=1,INPUD                                                  IUDB31    792
      J3=J3+3                                                           IUDB31    793
      IF(IDDAT(J3+1).EQ.IORD) THEN                                      IUDB31    794
         IIN=IDDAT(J3+2)                                                IUDB31    795
         IF(IIN.EQ.20) THEN                                             IUDB31    796
            XDATN=DDAT(J3+3)                                            IUDB31    797
            NINP=NINP+1                                                 IUDB31    798
         ELSE                                                           IUDB31    799
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    800
     *                     ,CID                                         IUDB31    801
         WRITE(MSG(2),1001) IORD,BLNAM1,BLNAM2                          IUDB31    802
         WRITE(MSG(3),1002)                                             IUDB31    803
         CALL PRTMSG(3)                                                 IUDB31    804
         MSG(1)='IUDB37: UDM ERROR'                                     IUDB31    805
         CALL ASTOP(MSG(1),17)                                          IUDB31    806
         ENDIF                                                          IUDB31    807
      ENDIF                                                             IUDB31    808
  250 CONTINUE                                                          IUDB31    809
      IF(NINP.EQ.0) THEN                                                IUDB31    810
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    811
     *                     ,CID                                         IUDB31    812
         WRITE(MSG(2),1010) IORD,BLNAM1,BLNAM2                          IUDB31    813
         CALL PRTMSG(2)                                                 IUDB31    814
         MSG(1)='IUDB37: UDM ERROR'                                     IUDB31    815
         CALL ASTOP(MSG(1),17)                                          IUDB31    816
      ENDIF                                                             IUDB31    817
      IF(NINP.GT.1) THEN                                                IUDB31    818
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    819
     *                     ,CID                                         IUDB31    820
         WRITE(MSG(2),1050) IORD,BLNAM1,BLNAM2                          IUDB31    821
         CALL PRTMSG(2)                                                 IUDB31    822
         MSG(1)='IUDB37: UDM ERROR'                                     IUDB31    823
         CALL ASTOP(MSG(1),17)                                          IUDB31    824
      ENDIF                                                             IUDB31    825
C                                                                       IUDB31    826
C     DATA PREPARATIONS AND INPUT DATA PRINTOUT                         IUDB31    827
C                                                                       IUDB31    828
      EFDN=VALOUT(IORD)                                                 IUDB31    829
C                                                                       IUDB31    830
      IF(NRBUS.EQ.0) THEN                                               IUDB31    831
         VRE=VALIN(6)                                                   IUDB31    832
         VIM=VALIN(7)                                                   IUDB31    833
      ELSE                                                              IUDB31    834
         VM=VALIN(21)                                                   IUDB31    835
         AM=VALIN(31)                                                   IUDB31    836
         VRE=VM*COS(AM)                                                 IUDB31    837
         VIM=VM*SIN(AM)                                                 IUDB31    838
      ENDIF                                                             IUDB31    839
      CRE=VALIN(8)*BASPRN                                               IUDB31    840
      CIM=VALIN(9)*BASPRN                                               IUDB31    841
C                                                                       IUDB31    842
      DDAT(JEI+5)=DDAT(JEI+5)/BASPRN                                    IUDB31    843
      VSC1=VRE*DDAT(JEI+4)-CIM*DDAT(JEI+5)                              IUDB31    844
      VSC2=VIM*DDAT(JEI+4)+CRE*DDAT(JEI+5)                              IUDB31    845
      VSC=SQRT(VSC1*VSC1+VSC2*VSC2)                                     IUDB31    846
      XIN=DDAT(JEI+6)*EFDN/VSC                                          IUDB31    847
      IF(XIN.GT.0.750)THEN                                              IUDB31    848
         FIN=1.732*(1.0-XIN)                                            IUDB31    849
      ELSEIF(XIN.GT.0.433)THEN                                          IUDB31    850
         FIN=SQRT(0.75-XIN*XIN)                                         IUDB31    851
      ELSE                                                              IUDB31    852
         FIN=1.0-0.577*XIN                                              IUDB31    853
      ENDIF                                                             IUDB31    854
      VB=VSC*FIN                                                        IUDB31    855
      SEKX=EFDN*DDAT(JEI+1)                                             IUDB31    856
CC                                                                      IUDB31    857
CC    CODE FOR OLD TYPE ST2 EXCITER                                     IUDB31    858
CC                                                                      IUDB31    859
CC      VR=SEKX-VB                                                      IUDB31    860
CC                                                                      IUDB31    861
      VR=SEKX/VB                                                        IUDB31    862
C                                                                       IUDB31    863
      IF(NEXTB.NE.0) THEN                                               IUDB31    864
         VALOUT(NEXTB)=VR/XDATN                                         IUDB31    865
      ELSE                                                              IUDB31    866
         VALIN(20)=VR/XDATN                                             IUDB31    867
      ENDIF                                                             IUDB31    868
      XSTATE(KORD)=EFDN                                                 IUDB31    869
      VALIN(19)=VR                                                      IUDB31    870
C                                                                       IUDB31    871
      IF(LDEB)WRITE(IUD6,1040) KORD,JORD,XSTATE(KORD)                   IUDB31    872
C                                                                       IUDB31    873
      RETURN                                                            IUDB31    874
C                                                                       IUDB31    875
C-----------------------------------------------------------------------IUDB31    876
C                                                                       IUDB31    877
      ENTRY IUDB38(IORD,NLF1,KN1,CID)                                   IUDB31    878
CD                                                                      IUDB31    879
CD    FOR BLOCK TYPE 38 (TYPE E8 EXCITER END BLOCK).                    IUDB31    880
CD                                                                      IUDB31    881
      LDEB=(JDEB(262).NE.0)                                             IUDB31    882
C                                                                       IUDB31    883
      NINP=0                                                            IUDB31    884
      NEXTB=0                                                           IUDB31    885
      JORD=JUDE(IORD)                                                   IUDB31    886
      JEI=JEB+2                                                         IUDB31    887
      IF(IDDAT(JEI+9).EQ.0) DDAT(JEI+9)=999.9                           IUDB31    888
      IF(IDDAT(JEI+10).EQ.0) DDAT(JEI+10)=999.9                         IUDB31    889
      J2=JE5-2                                                          IUDB31    890
      DO 260 J=1,INTUD                                                  IUDB31    891
      J2=J2+2                                                           IUDB31    892
      IDD=IDDAT(J2+2)                                                   IUDB31    893
      IDD=IABS(IDD)                                                     IUDB31    894
      IF(IDD.EQ.IORD) THEN                                              IUDB31    895
         XDAT=1.0                                                       IUDB31    896
         IF(IDDAT(J2+2).LT.0) XDAT=-1.0                                 IUDB31    897
         IOUT=IDDAT(J2+1)                                               IUDB31    898
         IF(JUDE(IOUT).EQ.0) THEN                                       IUDB31    899
            NEXTB=IOUT                                                  IUDB31    900
            XDATN=XDAT                                                  IUDB31    901
            NINP=NINP+1                                                 IUDB31    902
         ELSE                                                           IUDB31    903
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    904
     *                     ,CID                                         IUDB31    905
         WRITE(MSG(2),1090) IORD,BLNAM1,BLNAM2                          IUDB31    906
         CALL PRTMSG(2)                                                 IUDB31    907
         MSG(1)='IUDB38: UDM ERROR'                                     IUDB31    908
         CALL ASTOP(MSG(1),17)                                          IUDB31    909
         ENDIF                                                          IUDB31    910
      ENDIF                                                             IUDB31    911
  260 CONTINUE                                                          IUDB31    912
      J3=JE6-3                                                          IUDB31    913
      DO 270 J=1,INPUD                                                  IUDB31    914
      J3=J3+3                                                           IUDB31    915
      IF(IDDAT(J3+1).EQ.IORD) THEN                                      IUDB31    916
         IIN=IDDAT(J3+2)                                                IUDB31    917
         IF(IIN.EQ.20) THEN                                             IUDB31    918
            XDATN=DDAT(J3+3)                                            IUDB31    919
            NINP=NINP+1                                                 IUDB31    920
         ELSE                                                           IUDB31    921
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    922
     *                     ,CID                                         IUDB31    923
         WRITE(MSG(2),1001) IORD,BLNAM1,BLNAM2                          IUDB31    924
         WRITE(MSG(3),1002)                                             IUDB31    925
         CALL PRTMSG(3)                                                 IUDB31    926
         MSG(1)='IUDB38: UDM ERROR'                                     IUDB31    927
         CALL ASTOP(MSG(1),17)                                          IUDB31    928
         ENDIF                                                          IUDB31    929
      ENDIF                                                             IUDB31    930
  270 CONTINUE                                                          IUDB31    931
      IF(NINP.EQ.0) THEN                                                IUDB31    932
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    933
     *                     ,CID                                         IUDB31    934
         WRITE(MSG(2),1010) IORD,BLNAM1,BLNAM2                          IUDB31    935
         CALL PRTMSG(2)                                                 IUDB31    936
         MSG(1)='IUDB38: UDM ERROR'                                     IUDB31    937
         CALL ASTOP(MSG(1),17)                                          IUDB31    938
      ENDIF                                                             IUDB31    939
      IF(NINP.GT.1) THEN                                                IUDB31    940
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31    941
     *                     ,CID                                         IUDB31    942
         WRITE(MSG(2),1050) IORD,BLNAM1,BLNAM2                          IUDB31    943
         CALL PRTMSG(2)                                                 IUDB31    944
         MSG(1)='IUDB38: UDM ERROR'                                     IUDB31    945
         CALL ASTOP(MSG(1),17)                                          IUDB31    946
      ENDIF                                                             IUDB31    947
C                                                                       IUDB31    948
C     DATA PREPARATIONS AND INPUT DATA PRINTOUT                         IUDB31    949
C                                                                       IUDB31    950
      EFDN=VALOUT(IORD)                                                 IUDB31    951
C                                                                       IUDB31    952
      IF(EFDN.GT.DDAT(JEI+9))THEN                                       IUDB31    953
            WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1)           IUDB31    954
     *                        ,INAME(KN1),CID                           IUDB31    955
            WRITE(MSG(2),1930)                                          IUDB31    956
            CALL PRTMSG(2)                                              IUDB31    957
      ENDIF                                                             IUDB31    958
C                                                                       IUDB31    959
      IF(NRBUS.EQ.0) THEN                                               IUDB31    960
         VRE=VALIN(6)                                                   IUDB31    961
         VIM=VALIN(7)                                                   IUDB31    962
      ELSE                                                              IUDB31    963
         VM=VALIN(21)                                                   IUDB31    964
         AM=VALIN(31)                                                   IUDB31    965
         VRE=VM*COS(AM)                                                 IUDB31    966
         VIM=VM*SIN(AM)                                                 IUDB31    967
      ENDIF                                                             IUDB31    968
      CRE=VALIN(8)*BASPRN                                               IUDB31    969
      CIM=VALIN(9)*BASPRN                                               IUDB31    970
C                                                                       IUDB31    971
      DDAT(JEI+2)=DDAT(JEI+2)/BASPRN                                    IUDB31    972
      DDAT(JEI+3)=DDAT(JEI+3)/BASPRN                                    IUDB31    973
      DDAT(JEI+5)=DDAT(JEI+5)*0.0174533                                 IUDB31    974
      XKPR=DDAT(JEI+4)*COS(DDAT(JEI+5))                                 IUDB31    975
      XKPI=DDAT(JEI+4)*SIN(DDAT(JEI+5))                                 IUDB31    976
      VSC1=VRE*XKPR-VIM*XKPI-CIM*(DDAT(JEI+3)                           IUDB31    977
     &+XKPR*DDAT(JEI+2))-CRE*XKPI*DDAT(JEI+2)                           IUDB31    978
      VSC2=VRE*XKPI+VIM*XKPR+CRE*(DDAT(JEI+3)                           IUDB31    979
     &+XKPR*DDAT(JEI+2))-CIM*XKPI*DDAT(JEI+2)                           IUDB31    980
      VSC=SQRT(VSC1*VSC1+VSC2*VSC2)                                     IUDB31    981
      XIN=DDAT(JEI+6)*EFDN/VSC                                          IUDB31    982
      IF(XIN.GT.0.750)THEN                                              IUDB31    983
         FIN=1.732*(1.0-XIN)                                            IUDB31    984
      ELSEIF(XIN.GT.0.433)THEN                                          IUDB31    985
         FIN=SQRT(0.75-XIN*XIN)                                         IUDB31    986
      ELSE                                                              IUDB31    987
         FIN=1.0-0.577*XIN                                              IUDB31    988
      ENDIF                                                             IUDB31    989
      VB=VSC*FIN                                                        IUDB31    990
C                                                                       IUDB31    991
      IF(VB.GT.DDAT(JEI+10))THEN                                        IUDB31    992
            WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1)           IUDB31    993
     *                        ,INAME(KN1),CID                           IUDB31    994
            WRITE(MSG(2),1970) VB                                       IUDB31    995
            CALL PRTMSG(2)                                              IUDB31    996
      ENDIF                                                             IUDB31    997
      VR=EFDN/VB                                                        IUDB31    998
C                                                                       IUDB31    999
      IF(NEXTB.NE.0) THEN                                               IUDB31   1000
         VALOUT(NEXTB)=VR/XDATN                                         IUDB31   1001
      ELSE                                                              IUDB31   1002
         VALIN(20)=VR/XDATN                                             IUDB31   1003
      ENDIF                                                             IUDB31   1004
      VALIN(19)=VR                                                      IUDB31   1005
C                                                                       IUDB31   1006
      IF(LDEB)WRITE(IUD6,1940) JORD                                     IUDB31   1007
C                                                                       IUDB31   1008
      RETURN                                                            IUDB31   1009
C                                                                       IUDB31   1010
C-----------------------------------------------------------------------IUDB31   1011
C                                                                       IUDB31   1012
      ENTRY IUDB39(IORD,NLF1,KN1,CID)                                   IUDB31   1013
CD                                                                      IUDB31   1014
CD    FOR BLOCK TYPE 39 (TYPE E15 EXCITER END BLOCK).                   IUDB31   1015
CD                                                                      IUDB31   1016
      LDEB=(JDEB(262).NE.0)                                             IUDB31   1017
C                                                                       IUDB31   1018
      NINP=0                                                            IUDB31   1019
      NEXTB=0                                                           IUDB31   1020
      JORD=JUDE(IORD)                                                   IUDB31   1021
      JEI=JEB+2                                                         IUDB31   1022
      IF(IDDAT(JEI+3).EQ.0.AND.IDDAT(JEI+4).EQ.0) THEN                  IUDB31   1023
         DDAT(JEI+3)=999.9                                              IUDB31   1024
         DDAT(JEI+4)=-999.9                                             IUDB31   1025
      ENDIF                                                             IUDB31   1026
      IF(DDAT(JEI+3).LE.DDAT(JEI+4)) THEN                               IUDB31   1027
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1028
     *                     ,CID                                         IUDB31   1029
         WRITE(MSG(2),1570) IORD,BLNAM1,BLNAM2                          IUDB31   1030
         WRITE(MSG(3),2070) DDAT(JEI+3),DDAT(JEI+4)                     IUDB31   1031
         CALL PRTMSG(3)                                                 IUDB31   1032
         MSG(1)='IUDB39: UDM ERROR'                                     IUDB31   1033
         CALL ASTOP(MSG(1),17)                                          IUDB31   1034
      ENDIF                                                             IUDB31   1035
      J2=JE5-2                                                          IUDB31   1036
      DO 280 J=1,INTUD                                                  IUDB31   1037
      J2=J2+2                                                           IUDB31   1038
      IDD=IDDAT(J2+2)                                                   IUDB31   1039
      IDD=IABS(IDD)                                                     IUDB31   1040
      IF(IDD.EQ.IORD) THEN                                              IUDB31   1041
         XDAT=1.0                                                       IUDB31   1042
         IF(IDDAT(J2+2).LT.0) XDAT=-1.0                                 IUDB31   1043
         IOUT=IDDAT(J2+1)                                               IUDB31   1044
         IF(JUDE(IOUT).EQ.0) THEN                                       IUDB31   1045
            NEXTB=IOUT                                                  IUDB31   1046
            XDATN=XDAT                                                  IUDB31   1047
            NINP=NINP+1                                                 IUDB31   1048
         ELSE                                                           IUDB31   1049
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1050
     *                     ,CID                                         IUDB31   1051
         WRITE(MSG(2),1090) IORD,BLNAM1,BLNAM2                          IUDB31   1052
         CALL PRTMSG(2)                                                 IUDB31   1053
         MSG(1)='IUDB39: UDM ERROR'                                     IUDB31   1054
         CALL ASTOP(MSG(1),17)                                          IUDB31   1055
         ENDIF                                                          IUDB31   1056
      ENDIF                                                             IUDB31   1057
  280 CONTINUE                                                          IUDB31   1058
      J3=JE6-3                                                          IUDB31   1059
      DO 290 J=1,INPUD                                                  IUDB31   1060
      J3=J3+3                                                           IUDB31   1061
      IF(IDDAT(J3+1).EQ.IORD) THEN                                      IUDB31   1062
         IIN=IDDAT(J3+2)                                                IUDB31   1063
         IF(IIN.EQ.20) THEN                                             IUDB31   1064
            XDATN=DDAT(J3+3)                                            IUDB31   1065
            NINP=NINP+1                                                 IUDB31   1066
         ELSE                                                           IUDB31   1067
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1068
     *                     ,CID                                         IUDB31   1069
         WRITE(MSG(2),1001) IORD,BLNAM1,BLNAM2                          IUDB31   1070
         WRITE(MSG(3),1002)                                             IUDB31   1071
         CALL PRTMSG(3)                                                 IUDB31   1072
         MSG(1)='IUDB39: UDM ERROR'                                     IUDB31   1073
         CALL ASTOP(MSG(1),17)                                          IUDB31   1074
         ENDIF                                                          IUDB31   1075
      ENDIF                                                             IUDB31   1076
  290 CONTINUE                                                          IUDB31   1077
      IF(NINP.EQ.0) THEN                                                IUDB31   1078
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1079
     *                     ,CID                                         IUDB31   1080
         WRITE(MSG(2),1010) IORD,BLNAM1,BLNAM2                          IUDB31   1081
         CALL PRTMSG(2)                                                 IUDB31   1082
         MSG(1)='IUDB39: UDM ERROR'                                     IUDB31   1083
         CALL ASTOP(MSG(1),17)                                          IUDB31   1084
      ENDIF                                                             IUDB31   1085
      IF(NINP.GT.1) THEN                                                IUDB31   1086
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1087
     *                     ,CID                                         IUDB31   1088
         WRITE(MSG(2),1050) IORD,BLNAM1,BLNAM2                          IUDB31   1089
         CALL PRTMSG(2)                                                 IUDB31   1090
         MSG(1)='IUDB39: UDM ERROR'                                     IUDB31   1091
         CALL ASTOP(MSG(1),17)                                          IUDB31   1092
      ENDIF                                                             IUDB31   1093
C                                                                       IUDB31   1094
C     DATA PREPARATIONS AND INPUT DATA PRINTOUT                         IUDB31   1095
C                                                                       IUDB31   1096
      EFDN=VALOUT(IORD)                                                 IUDB31   1097
C                                                                       IUDB31   1098
      VR=EFDN/VALIN(1)                                                  IUDB31   1099
      IF(VR.GT.DDAT(JEI+3).OR.VR.LT.DDAT(JEI+4))THEN                    IUDB31   1100
            WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1)           IUDB31   1101
     *                        ,INAME(KN1),CID                           IUDB31   1102
            WRITE(MSG(2),2030) VR                                       IUDB31   1103
            CALL PRTMSG(2)                                              IUDB31   1104
      ENDIF                                                             IUDB31   1105
C                                                                       IUDB31   1106
      IF(NEXTB.NE.0) THEN                                               IUDB31   1107
         VALOUT(NEXTB)=VR/XDATN                                         IUDB31   1108
      ELSE                                                              IUDB31   1109
         VALIN(20)=VR/XDATN                                             IUDB31   1110
      ENDIF                                                             IUDB31   1111
      VALIN(19)=VR                                                      IUDB31   1112
C                                                                       IUDB31   1113
      IF(LDEB)WRITE(IUD6,1940) JORD                                     IUDB31   1114
C                                                                       IUDB31   1115
      RETURN                                                            IUDB31   1116
C                                                                       IUDB31   1117
C-----------------------------------------------------------------------IUDB31   1118
C                                                                       IUDB31   1119
      ENTRY IUDB40(IORD,NLF1,KN1,CID)                                   IUDB31   1120
CD                                                                      IUDB31   1121
CD    FOR BLOCK TYPE 40 (TYPE E30 EXCITER END BLOCK).                   IUDB31   1122
CD                                                                      IUDB31   1123
      LDEB=(JDEB(262).NE.0)                                             IUDB31   1124
C                                                                       IUDB31   1125
      NINP=0                                                            IUDB31   1126
      NEXTB=0                                                           IUDB31   1127
      JORD=JUDE(IORD)                                                   IUDB31   1128
      KORD=JSTATE+KUDE(IORD)+1                                          IUDB31   1129
      JEI=JEB+2                                                         IUDB31   1130
      AKA=DDAT(JEI+1)                                                   IUDB31   1131
      ATA=DDAT(JEI+2)                                                   IUDB31   1132
      ETV=DDAT(JEI+5)                                                   IUDB31   1133
      AKC=DDAT(JEI+6)                                                   IUDB31   1134
      IF(ATA.LE.0.0) THEN                                               IUDB31   1135
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1136
     *                     ,CID                                         IUDB31   1137
         WRITE(MSG(2),1030) IORD,BLNAM1,BLNAM2                          IUDB31   1138
         CALL PRTMSG(2)                                                 IUDB31   1139
         MSG(1)='IUDB40: UDM ERROR'                                     IUDB31   1140
         CALL ASTOP(MSG(1),17)                                          IUDB31   1141
      ENDIF                                                             IUDB31   1142
      IF(IDDAT(JEI+1).EQ.0) THEN                                        IUDB31   1143
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1144
     *                     ,CID                                         IUDB31   1145
         WRITE(MSG(2),2170) IORD,BLNAM1,BLNAM2                          IUDB31   1146
         CALL PRTMSG(2)                                                 IUDB31   1147
         MSG(1)='IUDB40: UDM ERROR'                                     IUDB31   1148
         CALL ASTOP(MSG(1),17)                                          IUDB31   1149
      ENDIF                                                             IUDB31   1150
      IF(IDDAT(JEI+3).EQ.0.AND.IDDAT(JEI+4).EQ.0) THEN                  IUDB31   1151
         DDAT(JEI+3)=999.9                                              IUDB31   1152
         DDAT(JEI+4)=-999.9                                             IUDB31   1153
      ENDIF                                                             IUDB31   1154
      VRMAX=DDAT(JEI+3)                                                 IUDB31   1155
      VRMIN=DDAT(JEI+4)                                                 IUDB31   1156
      IF(VRMAX.LE.VRMIN) THEN                                           IUDB31   1157
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1158
     *                     ,CID                                         IUDB31   1159
         WRITE(MSG(2),1570) IORD,BLNAM1,BLNAM2                          IUDB31   1160
         WRITE(MSG(3),2180) VRMAX,VRMIN                                 IUDB31   1161
         CALL PRTMSG(3)                                                 IUDB31   1162
         MSG(1)='IUDB40: UDM ERROR'                                     IUDB31   1163
         CALL ASTOP(MSG(1),17)                                          IUDB31   1164
      ENDIF                                                             IUDB31   1165
      J2=JE5-2                                                          IUDB31   1166
      DO 300 J=1,INTUD                                                  IUDB31   1167
      J2=J2+2                                                           IUDB31   1168
      IDD=IDDAT(J2+2)                                                   IUDB31   1169
      IDD=IABS(IDD)                                                     IUDB31   1170
      IF(IDD.EQ.IORD) THEN                                              IUDB31   1171
         XDAT=1.0                                                       IUDB31   1172
         IF(IDDAT(J2+2).LT.0) XDAT=-1.0                                 IUDB31   1173
         IOUT=IDDAT(J2+1)                                               IUDB31   1174
         IF(JUDE(IOUT).EQ.0) THEN                                       IUDB31   1175
            NEXTB=IOUT                                                  IUDB31   1176
            XDATN=XDAT                                                  IUDB31   1177
            NINP=NINP+1                                                 IUDB31   1178
         ELSE                                                           IUDB31   1179
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1180
     *                     ,CID                                         IUDB31   1181
         WRITE(MSG(2),1090) IORD,BLNAM1,BLNAM2                          IUDB31   1182
         CALL PRTMSG(2)                                                 IUDB31   1183
         MSG(1)='IUDB40: UDM ERROR'                                     IUDB31   1184
         CALL ASTOP(MSG(1),17)                                          IUDB31   1185
         ENDIF                                                          IUDB31   1186
      ENDIF                                                             IUDB31   1187
  300 CONTINUE                                                          IUDB31   1188
      J3=JE6-3                                                          IUDB31   1189
      DO 310 J=1,INPUD                                                  IUDB31   1190
      J3=J3+3                                                           IUDB31   1191
      IF(IDDAT(J3+1).EQ.IORD) THEN                                      IUDB31   1192
         IIN=IDDAT(J3+2)                                                IUDB31   1193
         IF(IIN.EQ.20) THEN                                             IUDB31   1194
            XDATN=DDAT(J3+3)                                            IUDB31   1195
            NINP=NINP+1                                                 IUDB31   1196
         ELSE                                                           IUDB31   1197
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1198
     *                     ,CID                                         IUDB31   1199
         WRITE(MSG(2),1001) IORD,BLNAM1,BLNAM2                          IUDB31   1200
         WRITE(MSG(3),1002)                                             IUDB31   1201
         CALL PRTMSG(3)                                                 IUDB31   1202
         MSG(1)='IUDB40: UDM ERROR'                                     IUDB31   1203
         CALL ASTOP(MSG(1),17)                                          IUDB31   1204
         ENDIF                                                          IUDB31   1205
      ENDIF                                                             IUDB31   1206
  310 CONTINUE                                                          IUDB31   1207
      IF(NINP.EQ.0) THEN                                                IUDB31   1208
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1209
     *                     ,CID                                         IUDB31   1210
         WRITE(MSG(2),1010) IORD,BLNAM1,BLNAM2                          IUDB31   1211
         CALL PRTMSG(2)                                                 IUDB31   1212
         MSG(1)='IUDB40: UDM ERROR'                                     IUDB31   1213
         CALL ASTOP(MSG(1),17)                                          IUDB31   1214
      ENDIF                                                             IUDB31   1215
      IF(NINP.GT.1) THEN                                                IUDB31   1216
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1217
     *                     ,CID                                         IUDB31   1218
         WRITE(MSG(2),1050) IORD,BLNAM1,BLNAM2                          IUDB31   1219
         CALL PRTMSG(2)                                                 IUDB31   1220
         MSG(1)='IUDB40: UDM ERROR'                                     IUDB31   1221
         CALL ASTOP(MSG(1),17)                                          IUDB31   1222
      ENDIF                                                             IUDB31   1223
C                                                                       IUDB31   1224
C     DATA PREPARATIONS AND INPUT DATA PRINTOUT                         IUDB31   1225
C                                                                       IUDB31   1226
      EFDN=VALOUT(IORD)                                                 IUDB31   1227
      DLIM=AKC*EFDN                                                     IUDB31   1228
      IF(IDDAT(JEI+5).EQ.0) THEN                                        IUDB31   1229
         RATIO=1.0                                                      IUDB31   1230
      ELSE                                                              IUDB31   1231
         RATIO=VALIN(4)/ETV                                             IUDB31   1232
      ENDIF                                                             IUDB31   1233
      VEMAX=VRMAX*RATIO-DLIM                                            IUDB31   1234
      VEMIN=VRMIN*RATIO+DLIM                                            IUDB31   1235
      DDAT(JEI+9)=VEMAX                                                 IUDB31   1236
      DDAT(JEI+10)=VEMIN                                                IUDB31   1237
      IF(VEMAX.LE.VEMIN) THEN                                           IUDB31   1238
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1239
     *                     ,CID                                         IUDB31   1240
         WRITE(MSG(2),1570) IORD,BLNAM1,BLNAM2                          IUDB31   1241
         WRITE(MSG(3),1720) VEMAX,DDAT(JEI+10)                          IUDB31   1242
         CALL PRTMSG(3)                                                 IUDB31   1243
         MSG(1)='IUDB40: UDM ERROR'                                     IUDB31   1244
         CALL ASTOP(MSG(1),17)                                          IUDB31   1245
      ENDIF                                                             IUDB31   1246
      IF(EFDN.GT.VEMAX.OR.EFDN.LT.VEMIN) THEN                           IUDB31   1247
            WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1)           IUDB31   1248
     *                        ,INAME(KN1),CID                           IUDB31   1249
            WRITE(MSG(2),2200) IORD,BLNAM1,BLNAM2                       IUDB31   1250
            CALL PRTMSG(2)                                              IUDB31   1251
      ENDIF                                                             IUDB31   1252
C                                                                       IUDB31   1253
      VR=EFDN/DDAT(JEI+1)                                               IUDB31   1254
C                                                                       IUDB31   1255
      IF(NEXTB.NE.0) THEN                                               IUDB31   1256
         VALOUT(NEXTB)=VR/XDATN                                         IUDB31   1257
      ELSE                                                              IUDB31   1258
         VALIN(20)=VR/XDATN                                             IUDB31   1259
      ENDIF                                                             IUDB31   1260
      XSTATE(KORD)=EFDN                                                 IUDB31   1261
      VALIN(19)=VR                                                      IUDB31   1262
C                                                                       IUDB31   1263
      IF(LDEB)WRITE(IUD6,1040) KORD,JORD,XSTATE(KORD)                   IUDB31   1264
C                                                                       IUDB31   1265
      RETURN                                                            IUDB31   1266
C                                                                       IUDB31   1267
C-----------------------------------------------------------------------IUDB31   1268
C                                                                       IUDB31   1269
      ENTRY IUDB41(IORD,NLF1,KN1,CID)                                   IUDB31   1270
CD                                                                      IUDB31   1271
CD    FOR BLOCK TYPE 41 (TYPE E31 EXCITER END BLOCK).                   IUDB31   1272
CD                                                                      IUDB31   1273
      LDEB=(JDEB(262).NE.0)                                             IUDB31   1274
C                                                                       IUDB31   1275
      NINP=0                                                            IUDB31   1276
      NEXTB=0                                                           IUDB31   1277
      JORD=JUDE(IORD)                                                   IUDB31   1278
      JEI=JEB+2                                                         IUDB31   1279
      IF(IDDAT(JEI+1).EQ.0.OR.IDDAT(JEI+2).EQ.0) THEN                   IUDB31   1280
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1281
     *                     ,CID                                         IUDB31   1282
         WRITE(MSG(2),2330) IORD,BLNAM1,BLNAM2                          IUDB31   1283
         WRITE(MSG(3),2331) DDAT(JEI+1),DDAT(JEI+2)                     IUDB31   1284
         CALL PRTMSG(3)                                                 IUDB31   1285
         MSG(1)='IUDB41: UDM ERROR'                                     IUDB31   1286
         CALL ASTOP(MSG(1),17)                                          IUDB31   1287
      ENDIF                                                             IUDB31   1288
      IF(IDDAT(JEI+3).EQ.0.AND.IDDAT(JEI+4).EQ.0) THEN                  IUDB31   1289
         DDAT(JEI+3)=999.9                                              IUDB31   1290
         DDAT(JEI+4)=-999.9                                             IUDB31   1291
      ENDIF                                                             IUDB31   1292
      IF(DDAT(JEI+3).LE.DDAT(JEI+4)) THEN                               IUDB31   1293
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1294
     *                     ,CID                                         IUDB31   1295
         WRITE(MSG(2),1570) IORD,BLNAM1,BLNAM2                          IUDB31   1296
         WRITE(MSG(3),2320) DDAT(JEI+3),DDAT(JEI+4)                     IUDB31   1297
         CALL PRTMSG(3)                                                 IUDB31   1298
         MSG(1)='IUDB41: UDM ERROR'                                     IUDB31   1299
         CALL ASTOP(MSG(1),17)                                          IUDB31   1300
      ENDIF                                                             IUDB31   1301
      J2=JE5-2                                                          IUDB31   1302
      DO 320 J=1,INTUD                                                  IUDB31   1303
      J2=J2+2                                                           IUDB31   1304
      IDD=IDDAT(J2+2)                                                   IUDB31   1305
      IDD=IABS(IDD)                                                     IUDB31   1306
      IF(IDD.EQ.IORD) THEN                                              IUDB31   1307
         XDAT=1.0                                                       IUDB31   1308
         IF(IDDAT(J2+2).LT.0) XDAT=-1.0                                 IUDB31   1309
         IOUT=IDDAT(J2+1)                                               IUDB31   1310
         IF(JUDE(IOUT).EQ.0) THEN                                       IUDB31   1311
            NEXTB=IOUT                                                  IUDB31   1312
            XDATN=XDAT                                                  IUDB31   1313
            NINP=NINP+1                                                 IUDB31   1314
         ELSE                                                           IUDB31   1315
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1316
     *                     ,CID                                         IUDB31   1317
         WRITE(MSG(2),1090) IORD,BLNAM1,BLNAM2                          IUDB31   1318
         CALL PRTMSG(2)                                                 IUDB31   1319
         MSG(1)='IUDB41: UDM ERROR'                                     IUDB31   1320
         CALL ASTOP(MSG(1),17)                                          IUDB31   1321
         ENDIF                                                          IUDB31   1322
      ENDIF                                                             IUDB31   1323
  320 CONTINUE                                                          IUDB31   1324
      J3=JE6-3                                                          IUDB31   1325
      DO 330 J=1,INPUD                                                  IUDB31   1326
      J3=J3+3                                                           IUDB31   1327
      IF(IDDAT(J3+1).EQ.IORD) THEN                                      IUDB31   1328
         IIN=IDDAT(J3+2)                                                IUDB31   1329
         IF(IIN.EQ.20) THEN                                             IUDB31   1330
            XDATN=DDAT(J3+3)                                            IUDB31   1331
            NINP=NINP+1                                                 IUDB31   1332
         ELSE                                                           IUDB31   1333
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1334
     *                     ,CID                                         IUDB31   1335
         WRITE(MSG(2),1001) IORD,BLNAM1,BLNAM2                          IUDB31   1336
         WRITE(MSG(3),1002)                                             IUDB31   1337
         CALL PRTMSG(3)                                                 IUDB31   1338
         MSG(1)='IUDB41: UDM ERROR'                                     IUDB31   1339
         CALL ASTOP(MSG(1),17)                                          IUDB31   1340
         ENDIF                                                          IUDB31   1341
      ENDIF                                                             IUDB31   1342
  330 CONTINUE                                                          IUDB31   1343
      IF(NINP.EQ.0) THEN                                                IUDB31   1344
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1345
     *                     ,CID                                         IUDB31   1346
         WRITE(MSG(2),1010) IORD,BLNAM1,BLNAM2                          IUDB31   1347
         CALL PRTMSG(2)                                                 IUDB31   1348
         MSG(1)='IUDB41: UDM ERROR'                                     IUDB31   1349
         CALL ASTOP(MSG(1),17)                                          IUDB31   1350
      ENDIF                                                             IUDB31   1351
      IF(NINP.GT.1) THEN                                                IUDB31   1352
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1353
     *                     ,CID                                         IUDB31   1354
         WRITE(MSG(2),1050) IORD,BLNAM1,BLNAM2                          IUDB31   1355
         CALL PRTMSG(2)                                                 IUDB31   1356
         MSG(1)='IUDB41: UDM ERROR'                                     IUDB31   1357
         CALL ASTOP(MSG(1),17)                                          IUDB31   1358
      ENDIF                                                             IUDB31   1359
C                                                                       IUDB31   1360
C     DATA PREPARATIONS AND INPUT DATA PRINTOUT                         IUDB31   1361
C                                                                       IUDB31   1362
      EFDN=VALOUT(IORD)                                                 IUDB31   1363
      FACT=VALIN(4)*DDAT(JEI+2)-DDAT(JEI+6)*EFDN                        IUDB31   1364
      IF(FACT.LE.0.0.AND.FACT.GE.0.0) THEN                              IUDB31   1365
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1366
     *                     ,CID                                         IUDB31   1367
         WRITE(MSG(2),2340) IORD,BLNAM1,BLNAM2                          IUDB31   1368
         WRITE(MSG(3),2341)                                             IUDB31   1369
         CALL PRTMSG(3)                                                 IUDB31   1370
         MSG(1)='IUDB41: UDM ERROR'                                     IUDB31   1371
         CALL ASTOP(MSG(1),17)                                          IUDB31   1372
      ENDIF                                                             IUDB31   1373
      SINF=EFDN/FACT                                                    IUDB31   1374
      IF(ABS(SINF).GT.1.0)THEN                                          IUDB31   1375
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1376
     *                     ,CID                                         IUDB31   1377
         WRITE(MSG(2),2350) IORD,BLNAM1,BLNAM2,SINF                     IUDB31   1378
         CALL PRTMSG(2)                                                 IUDB31   1379
         MSG(1)='IUDB41: UDM ERROR'                                     IUDB31   1380
         CALL ASTOP(MSG(1),17)                                          IUDB31   1381
      ENDIF                                                             IUDB31   1382
      PHIX=ASIN(SINF)                                                   IUDB31   1383
      IF(PHIX.GT.DDAT(JEI+3).OR.PHIX.LT.DDAT(JEI+4))THEN                IUDB31   1384
            WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1)           IUDB31   1385
     *                        ,INAME(KN1),CID                           IUDB31   1386
            WRITE(MSG(2),2280)                                          IUDB31   1387
            CALL PRTMSG(2)                                              IUDB31   1388
      ENDIF                                                             IUDB31   1389
      VR=PHIX*DDAT(JEI+2)/DDAT(JEI+1)                                   IUDB31   1390
C                                                                       IUDB31   1391
      IF(NEXTB.NE.0) THEN                                               IUDB31   1392
         VALOUT(NEXTB)=VR/XDATN                                         IUDB31   1393
      ELSE                                                              IUDB31   1394
         VALIN(20)=VR/XDATN                                             IUDB31   1395
      ENDIF                                                             IUDB31   1396
      VALIN(19)=VR                                                      IUDB31   1397
C                                                                       IUDB31   1398
      IF(LDEB)WRITE(IUD6,1940) JORD                                     IUDB31   1399
C                                                                       IUDB31   1400
      RETURN                                                            IUDB31   1401
C                                                                       IUDB31   1402
C-----------------------------------------------------------------------IUDB31   1403
C                                                                       IUDB31   1404
      ENTRY IUDB42(IORD,NLF1,KN1,CID)                                   IUDB31   1405
CD                                                                      IUDB31   1406
CD    FOR BLOCK TYPE 42 (TYPE E34 EXCITER END BLOCK).                   IUDB31   1407
CD                                                                      IUDB31   1408
      LDEB=(JDEB(262).NE.0)                                             IUDB31   1409
C                                                                       IUDB31   1410
      NINP=0                                                            IUDB31   1411
      NEXTB=0                                                           IUDB31   1412
      JORD=JUDE(IORD)                                                   IUDB31   1413
      JEI=JEB+2                                                         IUDB31   1414
      IF(IDDAT(JEI+3).EQ.0.AND.IDDAT(JEI+4).EQ.0) THEN                  IUDB31   1415
         DDAT(JEI+3)=999.9                                              IUDB31   1416
         DDAT(JEI+4)=-999.9                                             IUDB31   1417
      ENDIF                                                             IUDB31   1418
      IF(DDAT(JEI+3).LE.DDAT(JEI+4)) THEN                               IUDB31   1419
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1420
     *                     ,CID                                         IUDB31   1421
         WRITE(MSG(2),1570) IORD,BLNAM1,BLNAM2                          IUDB31   1422
         WRITE(MSG(3),2320) DDAT(JEI+3),DDAT(JEI+4)                     IUDB31   1423
         CALL PRTMSG(3)                                                 IUDB31   1424
         MSG(1)='IUDB42: UDM ERROR'                                     IUDB31   1425
         CALL ASTOP(MSG(1),17)                                          IUDB31   1426
      ENDIF                                                             IUDB31   1427
      J2=JE5-2                                                          IUDB31   1428
      DO 340 J=1,INTUD                                                  IUDB31   1429
      J2=J2+2                                                           IUDB31   1430
      IDD=IDDAT(J2+2)                                                   IUDB31   1431
      IDD=IABS(IDD)                                                     IUDB31   1432
      IF(IDD.EQ.IORD) THEN                                              IUDB31   1433
         XDAT=1.0                                                       IUDB31   1434
         IF(IDDAT(J2+2).LT.0) XDAT=-1.0                                 IUDB31   1435
         IOUT=IDDAT(J2+1)                                               IUDB31   1436
         IF(JUDE(IOUT).EQ.0) THEN                                       IUDB31   1437
            NEXTB=IOUT                                                  IUDB31   1438
            XDATN=XDAT                                                  IUDB31   1439
            NINP=NINP+1                                                 IUDB31   1440
         ELSE                                                           IUDB31   1441
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1442
     *                     ,CID                                         IUDB31   1443
         WRITE(MSG(2),1090) IORD,BLNAM1,BLNAM2                          IUDB31   1444
         CALL PRTMSG(2)                                                 IUDB31   1445
         MSG(1)='IUDB42: UDM ERROR'                                     IUDB31   1446
         CALL ASTOP(MSG(1),17)                                          IUDB31   1447
         ENDIF                                                          IUDB31   1448
      ENDIF                                                             IUDB31   1449
  340 CONTINUE                                                          IUDB31   1450
      J3=JE6-3                                                          IUDB31   1451
      DO 350 J=1,INPUD                                                  IUDB31   1452
      J3=J3+3                                                           IUDB31   1453
      IF(IDDAT(J3+1).EQ.IORD) THEN                                      IUDB31   1454
         IIN=IDDAT(J3+2)                                                IUDB31   1455
         IF(IIN.EQ.20) THEN                                             IUDB31   1456
            XDATN=DDAT(J3+3)                                            IUDB31   1457
            NINP=NINP+1                                                 IUDB31   1458
         ELSE                                                           IUDB31   1459
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1460
     *                     ,CID                                         IUDB31   1461
         WRITE(MSG(2),1001) IORD,BLNAM1,BLNAM2                          IUDB31   1462
         WRITE(MSG(3),1002)                                             IUDB31   1463
         CALL PRTMSG(3)                                                 IUDB31   1464
         MSG(1)='IUDB42: UDM ERROR'                                     IUDB31   1465
         CALL ASTOP(MSG(1),17)                                          IUDB31   1466
         ENDIF                                                          IUDB31   1467
      ENDIF                                                             IUDB31   1468
  350 CONTINUE                                                          IUDB31   1469
      IF(NINP.EQ.0) THEN                                                IUDB31   1470
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1471
     *                     ,CID                                         IUDB31   1472
         WRITE(MSG(2),1010) IORD,BLNAM1,BLNAM2                          IUDB31   1473
         CALL PRTMSG(2)                                                 IUDB31   1474
         MSG(1)='IUDB42: UDM ERROR'                                     IUDB31   1475
         CALL ASTOP(MSG(1),17)                                          IUDB31   1476
      ENDIF                                                             IUDB31   1477
      IF(NINP.GT.1) THEN                                                IUDB31   1478
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1479
     *                     ,CID                                         IUDB31   1480
         WRITE(MSG(2),1050) IORD,BLNAM1,BLNAM2                          IUDB31   1481
         CALL PRTMSG(2)                                                 IUDB31   1482
         MSG(1)='IUDB42: UDM ERROR'                                     IUDB31   1483
         CALL ASTOP(MSG(1),17)                                          IUDB31   1484
      ENDIF                                                             IUDB31   1485
C                                                                       IUDB31   1486
C     DATA PREPARATIONS AND INPUT DATA PRINTOUT                         IUDB31   1487
C                                                                       IUDB31   1488
      EFDN=VALOUT(IORD)                                                 IUDB31   1489
      VEMAX=VALIN(4)*DDAT(JEI+3)-DDAT(JEI+6)*EFDN                       IUDB31   1490
      VEMIN=VALIN(4)*DDAT(JEI+4)                                        IUDB31   1491
      IF(VEMAX.LE.VEMIN) THEN                                           IUDB31   1492
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1493
     *                     ,CID                                         IUDB31   1494
         WRITE(MSG(2),2480)                                             IUDB31   1495
         CALL PRTMSG(2)                                                 IUDB31   1496
         MSG(1)='IUDB42: UDM ERROR'                                     IUDB31   1497
         CALL ASTOP(MSG(1),17)                                          IUDB31   1498
      ENDIF                                                             IUDB31   1499
C                                                                       IUDB31   1500
      IF(EFDN.GT.VEMAX.OR.EFDN.LT.VEMIN)THEN                            IUDB31   1501
            WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1)           IUDB31   1502
     *                        ,INAME(KN1),CID                           IUDB31   1503
            WRITE(MSG(2),2430)                                          IUDB31   1504
            CALL PRTMSG(2)                                              IUDB31   1505
      ENDIF                                                             IUDB31   1506
      VR=EFDN                                                           IUDB31   1507
C                                                                       IUDB31   1508
      IF(NEXTB.NE.0) THEN                                               IUDB31   1509
         VALOUT(NEXTB)=VR/XDATN                                         IUDB31   1510
      ELSE                                                              IUDB31   1511
         VALIN(20)=VR/XDATN                                             IUDB31   1512
      ENDIF                                                             IUDB31   1513
      VALIN(19)=VR                                                      IUDB31   1514
C                                                                       IUDB31   1515
      IF(LDEB)WRITE(IUD6,1940) JORD                                     IUDB31   1516
C                                                                       IUDB31   1517
      RETURN                                                            IUDB31   1518
C                                                                       IUDB31   1519
C-----------------------------------------------------------------------IUDB31   1520
C                                                                       IUDB31   1521
      ENTRY IUDB43(IORD,NLF1,KN1,CID)                                   IUDB31   1522
CD                                                                      IUDB31   1523
CD    FOR BLOCK TYPE 43 (TYPE RHL EXCITER END BLOCK).                   IUDB31   1524
CD                                                                      IUDB31   1525
      LDEB=(JDEB(262).NE.0)                                             IUDB31   1526
C                                                                       IUDB31   1527
      NINP=0                                                            IUDB31   1528
      NEXTB=0                                                           IUDB31   1529
      JORD=JUDE(IORD)                                                   IUDB31   1530
      JEI=JEB+2                                                         IUDB31   1531
      IF(DDAT(JEI+1).LE.0.0) THEN                                       IUDB31   1532
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1533
     *                     ,CID                                         IUDB31   1534
         WRITE(MSG(2),2580) IORD,BLNAM1,BLNAM2                          IUDB31   1535
         CALL PRTMSG(2)                                                 IUDB31   1536
         MSG(1)='IUDB43: UDM ERROR'                                     IUDB31   1537
         CALL ASTOP(MSG(1),17)                                          IUDB31   1538
      ENDIF                                                             IUDB31   1539
      VRMAX=DDAT(JEI+2)                                                 IUDB31   1540
      VRMIN=DDAT(JEI+3)                                                 IUDB31   1541
      IF(VRMAX.LE.VRMIN) THEN                                           IUDB31   1542
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1543
     *                     ,CID                                         IUDB31   1544
         WRITE(MSG(2),2560) IORD,BLNAM1,BLNAM2                          IUDB31   1545
         WRITE(MSG(3),2180) VRMAX,VRMIN                                 IUDB31   1546
         CALL PRTMSG(3)                                                 IUDB31   1547
         MSG(1)='IUDB43: UDM ERROR'                                     IUDB31   1548
         CALL ASTOP(MSG(1),17)                                          IUDB31   1549
      ENDIF                                                             IUDB31   1550
      J2=JE5-2                                                          IUDB31   1551
      DO 360 J=1,INTUD                                                  IUDB31   1552
      J2=J2+2                                                           IUDB31   1553
      IDD=IDDAT(J2+2)                                                   IUDB31   1554
      IDD=IABS(IDD)                                                     IUDB31   1555
      IF(IDD.EQ.IORD) THEN                                              IUDB31   1556
         XDAT=1.0                                                       IUDB31   1557
         IF(IDDAT(J2+2).LT.0) XDAT=-1.0                                 IUDB31   1558
         IOUT=IDDAT(J2+1)                                               IUDB31   1559
         IF(NINP.EQ.0) THEN                                             IUDB31   1560
            IF(JUDE(IOUT).EQ.0) THEN                                    IUDB31   1561
               NEXTB=IOUT                                               IUDB31   1562
               XDATN=XDAT                                               IUDB31   1563
               NINP=NINP+1                                              IUDB31   1564
            ELSE                                                        IUDB31   1565
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1566
     *                     ,CID                                         IUDB31   1567
         WRITE(MSG(2),2530) IORD,BLNAM1,BLNAM2                          IUDB31   1568
         CALL PRTMSG(2)                                                 IUDB31   1569
         MSG(1)='IUDB43: UDM ERROR'                                     IUDB31   1570
         CALL ASTOP(MSG(1),17)                                          IUDB31   1571
            ENDIF                                                       IUDB31   1572
         ELSE                                                           IUDB31   1573
            NINP=NINP+1                                                 IUDB31   1574
         ENDIF                                                          IUDB31   1575
      ENDIF                                                             IUDB31   1576
  360 CONTINUE                                                          IUDB31   1577
      J3=JE6-3                                                          IUDB31   1578
      DO 370 J=1,INPUD                                                  IUDB31   1579
      J3=J3+3                                                           IUDB31   1580
      IF(IDDAT(J3+1).EQ.IORD) THEN                                      IUDB31   1581
         IIN=IDDAT(J3+2)                                                IUDB31   1582
         IF(NINP.EQ.0) THEN                                             IUDB31   1583
            IF(IIN.EQ.20) THEN                                          IUDB31   1584
               XDATN=DDAT(J3+3)                                         IUDB31   1585
               NINP=NINP+1                                              IUDB31   1586
            ELSE                                                        IUDB31   1587
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1588
     *                     ,CID                                         IUDB31   1589
         WRITE(MSG(2),1001) IORD,BLNAM1,BLNAM2                          IUDB31   1590
         WRITE(MSG(3),1002)                                             IUDB31   1591
         CALL PRTMSG(3)                                                 IUDB31   1592
         MSG(1)='IUDB43: UDM ERROR'                                     IUDB31   1593
         CALL ASTOP(MSG(1),17)                                          IUDB31   1594
            ENDIF                                                       IUDB31   1595
         ELSE                                                           IUDB31   1596
            IF(IIN.EQ.20)THEN                                           IUDB31   1597
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1598
     *                     ,CID                                         IUDB31   1599
         WRITE(MSG(2),1001) IORD,BLNAM1,BLNAM2                          IUDB31   1600
         WRITE(MSG(3),2570)                                             IUDB31   1601
         CALL PRTMSG(3)                                                 IUDB31   1602
         MSG(1)='IUDB43: UDM ERROR'                                     IUDB31   1603
         CALL ASTOP(MSG(1),17)                                          IUDB31   1604
            ELSE                                                        IUDB31   1605
               NINP=NINP+1                                              IUDB31   1606
            ENDIF                                                       IUDB31   1607
         ENDIF                                                          IUDB31   1608
      ENDIF                                                             IUDB31   1609
  370 CONTINUE                                                          IUDB31   1610
      IF(NINP.EQ.0) THEN                                                IUDB31   1611
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1612
     *                     ,CID                                         IUDB31   1613
         WRITE(MSG(2),1010) IORD,BLNAM1,BLNAM2                          IUDB31   1614
         CALL PRTMSG(2)                                                 IUDB31   1615
         MSG(1)='IUDB43: UDM ERROR'                                     IUDB31   1616
         CALL ASTOP(MSG(1),17)                                          IUDB31   1617
      ENDIF                                                             IUDB31   1618
      IF(NINP.GT.2) THEN                                                IUDB31   1619
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1620
     *                     ,CID                                         IUDB31   1621
         WRITE(MSG(2),2550) IORD,BLNAM1,BLNAM2                          IUDB31   1622
         CALL PRTMSG(2)                                                 IUDB31   1623
         MSG(1)='IUDB43: UDM ERROR'                                     IUDB31   1624
         CALL ASTOP(MSG(1),17)                                          IUDB31   1625
      ENDIF                                                             IUDB31   1626
C                                                                       IUDB31   1627
C     DATA PREPARATIONS AND INPUT DATA PRINTOUT                         IUDB31   1628
C                                                                       IUDB31   1629
      VALO=VALOUT(IORD)                                                 IUDB31   1630
      IF(NEXTB.NE.0) THEN                                               IUDB31   1631
         VALOUT(NEXTB)=VALO                                             IUDB31   1632
      ELSE                                                              IUDB31   1633
         VALIN(20)=VALO                                                 IUDB31   1634
      ENDIF                                                             IUDB31   1635
C                                                                       IUDB31   1636
      IF(LDEB)WRITE(IUD6,1940) JORD                                     IUDB31   1637
C                                                                       IUDB31   1638
      RETURN                                                            IUDB31   1639
C                                                                       IUDB31   1640
C-----------------------------------------------------------------------IUDB31   1641
C                                                                       IUDB31   1642
      ENTRY IUDB71(IORD,INDEX,NLF1,KN1,CID)                             IUDB31   1643
CD                                                                      IUDB31   1644
CD    FOR BLOCK TYPE 71 (FEEDBACK LOOP EXCITER END BLOCK).              IUDB31   1645
CD                                                                      IUDB31   1646
      LDEB=(JDEB(262).NE.0)                                             IUDB31   1647
C                                                                       IUDB31   1648
      LL1=0                                                             IUDB31   1649
      LL2=0                                                             IUDB31   1650
      VALI=0.0                                                          IUDB31   1651
      JORD=JUDE(IORD)                                                   IUDB31   1652
      KORD=JSTATE+KUDE(IORD)+1                                          IUDB31   1653
      JEI=JEB+2                                                         IUDB31   1654
      IF(IDDAT(JEI+1).EQ.0.OR.IDDAT(JEI+4).EQ.0.OR.                     IUDB31   1655
     *   IDDAT(JEI+5).EQ.0) THEN                                        IUDB31   1656
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1657
     *                     ,CID                                         IUDB31   1658
         WRITE(MSG(2),2170) IORD,BLNAM1,BLNAM2                          IUDB31   1659
         CALL PRTMSG(2)                                                 IUDB31   1660
         MSG(1)='IUDB71: UDM ERROR'                                     IUDB31   1661
         CALL ASTOP(MSG(1),17)                                          IUDB31   1662
      ENDIF                                                             IUDB31   1663
      VMAX1=DDAT(JEI+7)                                                 IUDB31   1664
      VMIN1=DDAT(JEI+8)                                                 IUDB31   1665
      VMAX2=DDAT(JEI+9)                                                 IUDB31   1666
      VMIN2=DDAT(JEI+10)                                                IUDB31   1667
      IF(VMAX1.LE.0.0.AND.VMAX1.GE.0.0.AND.                             IUDB31   1668
     *   VMIN1.LE.0.0.AND.VMIN1.GE.0.0) LL1=1                           IUDB31   1669
      IF(VMAX2.LE.0.0.AND.VMAX2.GE.0.0.AND.                             IUDB31   1670
     *   VMIN2.LE.0.0.AND.VMIN2.GE.0.0) LL2=1                           IUDB31   1671
      IF(VMAX1.LE.VMIN1.AND.LL1.EQ.0) THEN                              IUDB31   1672
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1673
     *                     ,CID                                         IUDB31   1674
         WRITE(MSG(2),1570) IORD,BLNAM1,BLNAM2                          IUDB31   1675
         WRITE(MSG(3),2670) VMAX1,VMIN1                                 IUDB31   1676
         CALL PRTMSG(3)                                                 IUDB31   1677
         MSG(1)='IUDB71: UDM ERROR'                                     IUDB31   1678
         CALL ASTOP(MSG(1),17)                                          IUDB31   1679
      ENDIF                                                             IUDB31   1680
      IF(VMAX2.LE.VMIN2.AND.LL2.EQ.0) THEN                              IUDB31   1681
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1682
     *                     ,CID                                         IUDB31   1683
         WRITE(MSG(2),1570) IORD,BLNAM1,BLNAM2                          IUDB31   1684
         WRITE(MSG(3),2670) VMAX2,VMIN2                                 IUDB31   1685
         CALL PRTMSG(3)                                                 IUDB31   1686
         MSG(1)='IUDB71: UDM ERROR'                                     IUDB31   1687
         CALL ASTOP(MSG(1),17)                                          IUDB31   1688
      ENDIF                                                             IUDB31   1689
C                                                                       IUDB31   1690
      IF(INDEX.EQ.1) THEN                                               IUDB31   1691
         J2=JE5-2                                                       IUDB31   1692
         DO 380 J=1,INTUD                                               IUDB31   1693
         J2=J2+2                                                        IUDB31   1694
         IDD=IDDAT(J2+2)                                                IUDB31   1695
         IDD=IABS(IDD)                                                  IUDB31   1696
         IF(IDD.EQ.IORD) THEN                                           IUDB31   1697
            XDAT=1.0                                                    IUDB31   1698
            IF(IDDAT(J2+2).LT.0) XDAT=-1.0                              IUDB31   1699
            IOUT=IDDAT(J2+1)                                            IUDB31   1700
            VALI=VALI+VALOUT(IOUT)*XDAT                                 IUDB31   1701
         ENDIF                                                          IUDB31   1702
  380    CONTINUE                                                       IUDB31   1703
      ENDIF                                                             IUDB31   1704
      J3=JE6-3                                                          IUDB31   1705
      DO 390 J=1,INPUD                                                  IUDB31   1706
      J3=J3+3                                                           IUDB31   1707
      IF(IDDAT(J3+1).EQ.IORD) THEN                                      IUDB31   1708
         IIN=IDDAT(J3+2)                                                IUDB31   1709
         VALI=VALI+VALIN(IIN)*DDAT(J3+3)                                IUDB31   1710
      ENDIF                                                             IUDB31   1711
  390 CONTINUE                                                          IUDB31   1712
C                                                                       IUDB31   1713
      XSTATE(KORD)=-VALI                                                IUDB31   1714
      XSTATE(KORD+1)=0.0                                                IUDB31   1715
      VALO=0.0                                                          IUDB31   1716
      IF(LL2.EQ.0) THEN                                                 IUDB31   1717
         IF(VALI.LT.0.0) THEN                                           IUDB31   1718
            XSTATE(KORD)=VMIN2                                          IUDB31   1719
            WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1)           IUDB31   1720
     *                        ,INAME(KN1),CID                           IUDB31   1721
            WRITE(MSG(2),2680)                                          IUDB31   1722
            WRITE(MSG(3),2681)                                          IUDB31   1723
            CALL PRTMSG(3)                                              IUDB31   1724
            VALO=DDAT(JEI+1)*(VALI+VMIN2)                               IUDB31   1725
            IF(IDDAT(JEI+3).NE.0) XSTATE(KORD+1)=                       IUDB31   1726
     &      VALO*(1.0-DDAT(JEI+2)/DDAT(JEI+3))                          IUDB31   1727
            IF(LL1.EQ.0) THEN                                           IUDB31   1728
               VALO1=VALO*DDAT(JEI+4)                                   IUDB31   1729
               IF(VALO1.GT.VMAX1) VALO1=VMAX1                           IUDB31   1730
               VALO1=VALO1*DDAT(JEI+5)                                  IUDB31   1731
               IF(VALO1.GT.0.0) THEN                                    IUDB31   1732
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1733
     *                     ,CID                                         IUDB31   1734
         WRITE(MSG(2),2700) IORD,BLNAM1,BLNAM2                          IUDB31   1735
         WRITE(MSG(3),2710)                                             IUDB31   1736
         CALL PRTMSG(3)                                                 IUDB31   1737
         MSG(1)='IUDB71: UDM ERROR'                                     IUDB31   1738
         CALL ASTOP(MSG(1),17)                                          IUDB31   1739
               ENDIF                                                    IUDB31   1740
            ENDIF                                                       IUDB31   1741
         ELSE                                                           IUDB31   1742
            XSTATE(KORD)=VMAX2                                          IUDB31   1743
            WRITE(MSG(1),1070) NLF1,INAME(KN1-2),INAME(KN1-1)           IUDB31   1744
     *                        ,INAME(KN1),CID                           IUDB31   1745
            WRITE(MSG(2),2680)                                          IUDB31   1746
            WRITE(MSG(3),2690)                                          IUDB31   1747
            CALL PRTMSG(3)                                              IUDB31   1748
            VALO=DDAT(JEI+1)*(VALI+VMAX2)                               IUDB31   1749
            IF(IDDAT(JEI+3).NE.0) XSTATE(KORD+1)=                       IUDB31   1750
     &      VALO*(1.0-DDAT(JEI+2)/DDAT(JEI+3))                          IUDB31   1751
            IF(LL1.EQ.0) THEN                                           IUDB31   1752
               VALO1=VALO*DDAT(JEI+4)                                   IUDB31   1753
               IF(VALO1.LT.VMIN1) VALO1=VMIN1                           IUDB31   1754
               VALO1=VALO1*DDAT(JEI+5)                                  IUDB31   1755
               IF(VALO1.LT.0.0) THEN                                    IUDB31   1756
         WRITE(MSG(1),1000) NLF1,INAME(KN1-2),INAME(KN1-1),INAME(KN1)   IUDB31   1757
     *                     ,CID                                         IUDB31   1758
         WRITE(MSG(2),2700) IORD,BLNAM1,BLNAM2                          IUDB31   1759
         WRITE(MSG(3),2710)                                             IUDB31   1760
         CALL PRTMSG(3)                                                 IUDB31   1761
         MSG(1)='IUDB71: UDM ERROR'                                     IUDB31   1762
         CALL ASTOP(MSG(1),17)                                          IUDB31   1763
               ENDIF                                                    IUDB31   1764
            ENDIF                                                       IUDB31   1765
         ENDIF                                                          IUDB31   1766
      ENDIF                                                             IUDB31   1767
      VALOUT(IORD)=VALO                                                 IUDB31   1768
C                                                                       IUDB31   1769
C                                                                       IUDB31   1770
      IDDAT(JEI+11)=LL1                                                 IUDB31   1771
      IDDAT(JEI+12)=LL2                                                 IUDB31   1772
C                                                                       IUDB31   1773
      IF(LDEB)WRITE(IUD6,1040) KORD,JORD,XSTATE(KORD),XSTATE(KORD+1)    IUDB31   1774
C                                                                       IUDB31   1775
      RETURN                                                            IUDB31   1776
 1000 FORMAT(' *** ERROR: USER DEFINED MODEL AT BUS:',I5,' STATION: '   IUDB31   1777
     *,3A4,' ID:',A4)                                                   IUDB31   1778
 1001 FORMAT(11X,'BLOCK#',I3,'(',2A4,') HAS WRONG INPUT SIGNAL.')       IUDB31   1779
 1002 FORMAT(11X,'THE ONLY POSSIBLE INPUT IS "VREF".')                  IUDB31   1780
 1010 FORMAT(11X,'BLOCK#',I3,'(',2A4,') HAS NO INPUT CONNECTION')       IUDB31   1781
 1020 FORMAT(1X,'BLOCK#= ',I2,'  NAME= ',2A4,'  TYPE= ',A3,/,           IUDB31   1782
     &' KE=',F8.3,'  TE=',F8.3,'  AEX=',F10.5,'  BEX=',F10.5,'  ETMIN=' IUDB31   1783
     &,F8.3,'  OUTPUT=',F8.3,' (EFD)')                                  IUDB31   1784
 1030 FORMAT(11X,'BLOCK#',I3,'(',2A4                                    IUDB31   1785
     *,') HAS ZERO OR NEGATIVE TIME CONSTANT.')                         IUDB31   1786
 1040 FORMAT(1X,'KORD,JORD,XSTATE(KORD): ',2I5,2F10.3)                  IUDB31   1787
 1050 FORMAT(11X,'BLOCK#',I3,'(',2A4                                    IUDB31   1788
     *,') HAS MORE THAN ONE INPUT CONNECTIONS')                         IUDB31   1789
 1060 FORMAT(1X,'BLOCK#= ',I2,' NAME= ',2A4,' TYPE= ',A3,/,             IUDB31   1790
     &'  KE=',F8.3,'  TE=',F8.3,'  SE(VSAT)=',F10.5,'  SE(0.75*VSAT)='  IUDB31   1791
     &,F10.5,'  VSAT=',F8.3,'  ETMIN=',F8.3,'  OUTPUT=',F8.3,' (EFD)')  IUDB31   1792
 1070 FORMAT(' *** WARNING USER DEFINED MODEL AT BUS:'                  IUDB31   1793
     &,I5,' STATION: ',3A4,'ID:',A4)                                    IUDB31   1794
 1071 FORMAT(14X,'AT LEAST ONE SATURATION DATA IS ZERO.')               IUDB31   1795
 1072 FORMAT(14X,'NO SATURATION WILL BE REPRESENTED.')                  IUDB31   1796
 1110 FORMAT(14X,'WARNING: EFD IS LESS THAN ETMIN.')                    IUDB31   1797
 1410 FORMAT(14X,'IN BLOCK#',I3,'(',2A4                                 IUDB31   1798
     *,') VE IS INITIALLY LESS THAN VEMIN.')                            IUDB31   1799
 1411 FORMAT(14X,'VE=',F10.5)                                           IUDB31   1800
 1560 FORMAT(14X,'BLOCK#',I3,'(',2A4                                    IUDB31   1801
     *,') VE IS INITIALLY OUTSIDE ITS LIMITS.')                         IUDB31   1802
 1710 FORMAT(14X,'VE=',G12.5,' VEMAX=',G12.5,' VEMIN=',G12.5)           IUDB31   1803
 1930 FORMAT(14X,'EFD IS LARGER THAN EFMAX.')                           IUDB31   1804
 1970 FORMAT(14X,'VB IS LARGER THAN VBMAX. VB=',F10.5)                  IUDB31   1805
 2030 FORMAT(14X,'VR IS OUTSIDE ITS LIMITS. VR=',F10.5)                 IUDB31   1806
 2200 FORMAT(14X,'BLOCK#',I3,'(',2A4,') EFD IS OUTSIDE LIMITS.')        IUDB31   1807
 2430 FORMAT(14X,'EFD IS OUTSIDE ITS LIMITS.')                          IUDB31   1808
 2280 FORMAT(14X,'PHI IS OUTSIDE ITS LIMITS. PHI=',F10.5)               IUDB31   1809
 2680 FORMAT(14X,'BLOCK#',I3,'(',2A4,') HAS INTEGRATOR')                IUDB31   1810
 2681 FORMAT(14X,'INITIAL OUTPUT AT MINIMUM LIMIT.')                    IUDB31   1811
 2690 FORMAT(14X,'INITIAL OUTPUT AT MAXIMUM LIMIT.')                    IUDB31   1812
 1090 FORMAT(11X,'BLOCK#',I3,'(',2A4                                    IUDB31   1813
     *,')  VREF IS NOT CONNECTED TO AVR PATH')                          IUDB31   1814
 1400 FORMAT(11X,'BLOCK#',I3,'(',2A4                                    IUDB31   1815
     *,') EXCITER FEX FUNCTION OUT OF RANGE.')                          IUDB31   1816
 1401 FORMAT(11X,'VTH=',F10.5,'  IN=',F10.5)                            IUDB31   1817
 1570 FORMAT(11X,'BLOCK#',I3,'(',2A4,') HAS XCROSSING LIMITS.')         IUDB31   1818
 1720 FORMAT(11X,'VEMAX=',F10.5,' VEMIN=',F10.5)                        IUDB31   1819
 2070 FORMAT(11X,'EFDMAX=',F10.5,' EFDMIN=',F10.5)                      IUDB31   1820
 2180 FORMAT(11X,'VRMAX=',F10.5,' VRMIN=',F10.5)                        IUDB31   1821
 2320 FORMAT(11X,'PHIMAX=',F10.5,' PHIMIN=',F10.5)                      IUDB31   1822
 2670 FORMAT(11X,'MAX= ',F10.5,' MIN= ',F10.5)                          IUDB31   1823
 1940 FORMAT(1X,'JORD: ',I5)                                            IUDB31   1824
 2170 FORMAT(11X,'BLOCK#',I3,'(',2A4,') HAS ZERO GAIN.')                IUDB31   1825
 2330 FORMAT(11X,'BLOCK#',I3,'(',2A4,') KA OR VAMAX IS ZERO.')          IUDB31   1826
 2331 FORMAT(11X,'KA=',F10.5,' VAMAX=',F10.5)                           IUDB31   1827
 2340 FORMAT(11X,'BLOCK#',I3,'(',2A4                                    IUDB31   1828
     *,') VT*VAMAX-KC*IFD IS INITIALLY ZERO.')                          IUDB31   1829
 2341 FORMAT(11X,'MODIFY VAMAX OR KC.')                                 IUDB31   1830
 2350 FORMAT(11X,'BLOCK#',I3,'(',2A4                                    IUDB31   1831
     *,') SINPHI=',F10.5,' IS UNACCEPTABLE VALUE.')                     IUDB31   1832
 2480 FORMAT(11X,'VEMAX AND VEMIN ARE XCROSSING.')                      IUDB31   1833
 2530 FORMAT(11X,'BLOCK#',I3,'(',2A4                                    IUDB31   1834
     *,')  VREF IS NOT CONNECTED TO REG. PATH')                         IUDB31   1835
 2550 FORMAT(11X,'BLOCK#',I3,'(',2A4                                    IUDB31   1836
     *,') HAS MORE THAN TWO INPUT CONNECTIONS')                         IUDB31   1837
 2560 FORMAT(11X,'RHL BLOCK#',I3,'(',2A4                                IUDB31   1838
     *,') VRMAX MUST BE LARGER THAN VRMIN.')                            IUDB31   1839
 2570 FORMAT(11X                                                        IUDB31   1840
     *,'"VREF" CANNOT BE CONNECTED TO THE SECOND INPUT OF RHL.')        IUDB31   1841
 2580 FORMAT(11X,'RHL BLOCK#',I3,'(',2A4                                IUDB31   1842
     *,') KV MUST BE LARGER THAN ZERO.')                                IUDB31   1843
 2700 FORMAT(11X,'BLOCK#',I3,'(',2A4                                    IUDB31   1844
     &,') CANNOT BE INITIALIZED PROPERLY.')                             IUDB31   1845
 2710 FORMAT(11X,'CHECK THE NEGATIVE GAINS OR OFFSET LIMITS.')          IUDB31   1846
      END                                                               IUDB31   1847
