CFPRIME DUDB44                                                          DUDB44      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 DUDB44(LORD,KORD)                                      DUDB44      3
CD                                                                      DUDB44      4
CD    TO CALCULATE THE DERIVATIVES OF THE STATES OF USER DEFINED BLOCK  DUDB44      5
CD    TYPE 44 (TYPE T1 GOVERNOR END BLOCK) IN A USER DEFINED GOVERNOR   DUDB44      6
CD    MODEL, USED BY BOTH RUNGE-KUTTA AND TRAPEZOIDAL METHOD.           DUDB44      7
CD                                                                      DUDB44      8
CD    EACH ENTRY POINT IN THIS SUBROUTINE HAS SIMILAR FUNCTION AND IS   DUDB44      9
CD    FOR A DIFFERENT TYPE OF GOVERNOR END BLOCK APPLICABLE TO A USER   DUDB44     10
CD    DEFINED GOVERNOR MODEL.                                           DUDB44     11
CD                                                                      DUDB44     12
      INCLUDE 'PARX.INS'                                                DUDB44     13
      INCLUDE 'CNPARX.INS'                                              DUDB44     14
      INCLUDE 'CNB4.INS'                                                DUDB44     15
      INCLUDE 'CNB8.INS'                                                DUDB44     16
      INCLUDE 'CNB19.INS'                                               DUDB44     17
      INCLUDE 'CNG3.INS'                                                DUDB44     18
      INCLUDE 'CNEXC.INS'                                               DUDB44     19
      INCLUDE 'CNMDAT.INS'                                              DUDB44     20
      INCLUDE 'CNMSTA.INS'                                              DUDB44     21
      INCLUDE 'CNXSTA.INS'                                              DUDB44     22
      INCLUDE 'CNSTN.INS'                                               DUDB44     23
      INCLUDE 'CNYVAR.INS'                                              DUDB44     24
      INCLUDE 'CNUNIT.INS'                                              DUDB44     25
      INCLUDE 'CNFLAG.INS'                                              DUDB44     26
      INCLUDE 'CNUDM.INS'                                               DUDB44     27
C                                                                       DUDB44     28
      LDEB=(JDEB(264).NE.0)                                             DUDB44     29
C                                                                       DUDB44     30
      IORD=IDDAT(JE4+LORD)                                              DUDB44     31
      JEI=JEB+2                                                         DUDB44     32
      JLS=IDDAT(JEI+12)                                                 DUDB44     33
C                                                                       DUDB44     34
      II=0                                                              DUDB44     35
      VALI2=0.0                                                         DUDB44     36
      KINT=KINPU                                                        DUDB44     37
      KINPU=KINPU+IDDAT(JEI+13)                                         DUDB44     38
      IF(KINT.LT.KINPU) THEN                                            DUDB44     39
         DO 110 J=KINT+1,KINPU                                          DUDB44     40
         XDAT=GAINS(J)                                                  DUDB44     41
         IOUT=INPUTS(J)                                                 DUDB44     42
         II=II+1                                                        DUDB44     43
         IF(II.EQ.1) THEN                                               DUDB44     44
            VALI1=VALOUT(IOUT)*XDAT                                     DUDB44     45
            GO TO 110                                                   DUDB44     46
         ENDIF                                                          DUDB44     47
         VALI2=VALOUT(IOUT)*XDAT                                        DUDB44     48
  110    CONTINUE                                                       DUDB44     49
      ENDIF                                                             DUDB44     50
      KINP=KINPU                                                        DUDB44     51
      KINPU=KINPU+IDDAT(JEI+14)                                         DUDB44     52
      IF(KINP.LT.KINPU) THEN                                            DUDB44     53
         DO 120 J=KINP+1,KINPU                                          DUDB44     54
         XDAT=GAINS(J)                                                  DUDB44     55
         IIN=INPUTS(J)                                                  DUDB44     56
         II=II+1                                                        DUDB44     57
         IF(II.EQ.1) THEN                                               DUDB44     58
            VALI1=VALIN(IIN)*XDAT                                       DUDB44     59
            GO TO 120                                                   DUDB44     60
         ENDIF                                                          DUDB44     61
         VALI2=VALIN(IIN)*XDAT                                          DUDB44     62
  120    CONTINUE                                                       DUDB44     63
      ENDIF                                                             DUDB44     64
C                                                                       DUDB44     65
      VALIN(1)=VALI1                                                    DUDB44     66
      VALIN(2)=VALI2                                                    DUDB44     67
C                                                                       DUDB44     68
      XPN1=SSMAT(JLS+7)                                                 DUDB44     69
      YFA1=SSMAT(JLS+8)                                                 DUDB44     70
      XPN2=SSMAT(JLS+9)                                                 DUDB44     71
      YFA2=SSMAT(JLS+10)                                                DUDB44     72
      XPIN=VALI2                                                        DUDB44     73
      CALL NLCHAR                                                       DUDB44     74
      FAIV0=YOUT                                                        DUDB44     75
C                                                                       DUDB44     76
      XPN1=SSMAT(JLS+3)                                                 DUDB44     77
      YFA1=SSMAT(JLS+4)                                                 DUDB44     78
      XPN2=SSMAT(JLS+5)                                                 DUDB44     79
      YFA2=SSMAT(JLS+6)                                                 DUDB44     80
      XPIN=VALI1                                                        DUDB44     81
      CALL NLCHAR                                                       DUDB44     82
      FACV0=YOUT                                                        DUDB44     83
C                                                                       DUDB44     84
C     HP FLOW                                                           DUDB44     85
C                                                                       DUDB44     86
      XHPN1=FACV0*SSMAT(JLS+11)*DDAT(JEI+8)                             DUDB44     87
      XHPN2=(DDAT(JEI+8)-1.0)*XSTATE(JSTATE+KORD+2)                     DUDB44     88
      XHPN=XHPN1-XHPN2                                                  DUDB44     89
      IF(XHPN.LT.0.0.AND.DDAT(JEI+9).GT.0.0) XHPN=0.0                   DUDB44     90
      DSTATE(LSTATE+KORD+1)=(XHPN-XSTATE(JSTATE+KORD+1))/DDAT(JEI+1)    DUDB44     91
C                                                                       DUDB44     92
C     A - FACTOR FOR IV FLOW                                            DUDB44     93
C                                                                       DUDB44     94
      RIPRH=(1.0-(DDAT(JEI+11)/100.0))*(XSTATE(JSTATE+KORD+3)/XSTATE    DUDB44     95
     +(JSTATE+KORD+2))                                                  DUDB44     96
      IF(RIPRH.LT.SSMAT(JLS+1)) RIPRH=SSMAT(JLS+1)                      DUDB44     97
      IF (RIPRH.GT.1.0) RIPRH=1.0                                       DUDB44     98
      XK1=2.0/DDAT(JEI+10)                                              DUDB44     99
      XK2=(DDAT(JEI+10)+1.0)/DDAT(JEI+10)                               DUDB44    100
      XEKK=(RIPRH**XK1)-(RIPRH**XK2)                                    DUDB44    101
      IF(XEKK.LE.0.0) XEKK=1.E-7                                        DUDB44    102
      XEKK=SQRT(XEKK)                                                   DUDB44    103
      AIV0=SSMAT(JLS+2)*XEKK                                            DUDB44    104
C                                                                       DUDB44    105
C     IV FLOW                                                           DUDB44    106
C                                                                       DUDB44    107
      FLWIV=FAIV0*XSTATE(JSTATE+KORD+2)*AIV0                            DUDB44    108
C                                                                       DUDB44    109
C     RH PRESSURE                                                       DUDB44    110
C                                                                       DUDB44    111
      DSTATE(LSTATE+KORD+2)=(XSTATE(JSTATE+KORD+1)-FLWIV)/DDAT(JEI+2)   DUDB44    112
C                                                                       DUDB44    113
C     IP(OR INLET PIPING) FLOW                                          DUDB44    114
C                                                                       DUDB44    115
      IF (IDDAT(JEI+3).EQ.0) THEN                                       DUDB44    116
         DSTATE(LSTATE+KORD+3)=0.0                                      DUDB44    117
         XSTATE(JSTATE+KORD+3)=FLWIV                                    DUDB44    118
      ELSE                                                              DUDB44    119
         DSTATE(LSTATE+KORD+3)=(FLWIV-XSTATE(JSTATE+KORD+3))/DDAT(JEI+3)DUDB44    120
      END IF                                                            DUDB44    121
C                                                                       DUDB44    122
C     LP FLOW                                                           DUDB44    123
C                                                                       DUDB44    124
      DSTATE(LSTATE+KORD+4)=(XSTATE(JSTATE+KORD+3)-XSTATE               DUDB44    125
     &(JSTATE+KORD+4))/DDAT(JEI+4)                                      DUDB44    126
C                                                                       DUDB44    127
      VALOUT(IORD)=(DDAT(JEI+5)*XSTATE(JSTATE+KORD+1)+DDAT(JEI+6)*XSTATEDUDB44    128
     &(JSTATE+KORD+3)+(1.0-DDAT(JEI+5)-DDAT(JEI+6))*XSTATE(JSTATE+KORD+4DUDB44    129
     &))*DDAT(JEI+7)                                                    DUDB44    130
      KORD=KORD+4                                                       DUDB44    131
C                                                                       DUDB44    132
      IF(LDEB) WRITE(IUD6,1000) KORD,LORD,IORD,VALOUT(IORD)             DUDB44    133
C                                                                       DUDB44    134
      RETURN                                                            DUDB44    135
 1000 FORMAT(1X,'KORD,LORD,IORD,VALOUT(IORD): ',3I5,F10.3)              DUDB44    136
C                                                                       DUDB44    137
C-----------------------------------------------------------------------DUDB44    138
C                                                                       DUDB44    139
      ENTRY DUDB45(LORD,KORD)                                           DUDB44    140
CD                                                                      DUDB44    141
CD    FOR BLOCK TYPE 45 (TYPE T4 GOVERNOR END BLOCK).                   DUDB44    142
CD                                                                      DUDB44    143
      LDEB=(JDEB(264).NE.0)                                             DUDB44    144
C                                                                       DUDB44    145
      IORD=IDDAT(JE4+LORD)                                              DUDB44    146
      JEI=JEB+2                                                         DUDB44    147
      KINT=KINPU                                                        DUDB44    148
      KINPU=KINPU+IDDAT(JEI+13)                                         DUDB44    149
      IF(KINT.LT.KINPU) THEN                                            DUDB44    150
         J=KINT+1                                                       DUDB44    151
         XDAT=GAINS(J)                                                  DUDB44    152
         IOUT=INPUTS(J)                                                 DUDB44    153
         VALI=VALOUT(IOUT)*XDAT                                         DUDB44    154
         GO TO 150                                                      DUDB44    155
      ENDIF                                                             DUDB44    156
      KINP=KINPU                                                        DUDB44    157
      KINPU=KINPU+IDDAT(JEI+14)                                         DUDB44    158
      IF(KINP.LT.KINPU) THEN                                            DUDB44    159
         J=KINP+1                                                       DUDB44    160
         XDAT=GAINS(J)                                                  DUDB44    161
         IIN=INPUTS(J)                                                  DUDB44    162
         VALI=VALIN(IIN)*XDAT                                           DUDB44    163
      ENDIF                                                             DUDB44    164
  150 CONTINUE                                                          DUDB44    165
C                                                                       DUDB44    166
      VALIN(1)=VALI                                                     DUDB44    167
      IF(ICONTA(2,N+1).EQ.5) THEN                                       DUDB44    168
         JGV5=JCONTA(2,N+1)                                             DUDB44    169
         IDDAT(JGV5)=JSTATE+KORD                                        DUDB44    170
      END IF                                                            DUDB44    171
C                                                                       DUDB44    172
      KORD=KORD+1                                                       DUDB44    173
      IF(DDAT(JEI+1).GT.0.0)THEN                                        DUDB44    174
         DSTATE(LSTATE+KORD)=(VALI-XSTATE(JSTATE+KORD))/DDAT(JEI+1)     DUDB44    175
      ELSE                                                              DUDB44    176
         DSTATE(LSTATE+KORD)=0.0                                        DUDB44    177
         XSTATE(JSTATE+KORD)=VALI                                       DUDB44    178
      ENDIF                                                             DUDB44    179
C                                                                       DUDB44    180
      KORD=KORD+1                                                       DUDB44    181
      IF(DDAT(JEI+2).GT.0.0)THEN                                        DUDB44    182
         DSTATE(LSTATE+KORD)=(XSTATE(JSTATE+KORD-1)-XSTATE(JSTATE+KORD))DUDB44    183
     &   /DDAT(JEI+2)                                                   DUDB44    184
      ELSE                                                              DUDB44    185
         DSTATE(LSTATE+KORD)=0.0                                        DUDB44    186
         XSTATE(JSTATE+KORD)=XSTATE(JSTATE+KORD-1)                      DUDB44    187
      ENDIF                                                             DUDB44    188
C                                                                       DUDB44    189
      KORD=KORD+1                                                       DUDB44    190
      IF(DDAT(JEI+3).GT.0.0)THEN                                        DUDB44    191
         DSTATE(LSTATE+KORD)=(XSTATE(JSTATE+KORD-1)-XSTATE(JSTATE+KORD))DUDB44    192
     &   /DDAT(JEI+3)                                                   DUDB44    193
      ELSE                                                              DUDB44    194
         DSTATE(LSTATE+KORD)=0.0                                        DUDB44    195
         XSTATE(JSTATE+KORD)=XSTATE(JSTATE+KORD-1)                      DUDB44    196
      ENDIF                                                             DUDB44    197
C                                                                       DUDB44    198
      KORD=KORD+1                                                       DUDB44    199
      IF(DDAT(JEI+4).GT.0.0)THEN                                        DUDB44    200
         DSTATE(LSTATE+KORD)=(XSTATE(JSTATE+KORD-1)-XSTATE(JSTATE+KORD))DUDB44    201
     &   /DDAT(JEI+4)                                                   DUDB44    202
      ELSE                                                              DUDB44    203
         DSTATE(LSTATE+KORD)=0.0                                        DUDB44    204
         XSTATE(JSTATE+KORD)=XSTATE(JSTATE+KORD-1)                      DUDB44    205
      ENDIF                                                             DUDB44    206
C                                                                       DUDB44    207
      VALOUT(IORD)=(XSTATE(JSTATE+KORD-3)*DDAT(JEI+8)+                  DUDB44    208
     &XSTATE(JSTATE+KORD-2)*DDAT(JEI+9)+XSTATE(JSTATE+KORD-1)*          DUDB44    209
     &DDAT(JEI+10)+XSTATE(JSTATE+KORD)*DDAT(JEI+11))*DDAT(JEI+7)        DUDB44    210
      IF(LDEB) WRITE(IUD6,1010) KORD,LORD,IORD,VALOUT(IORD)             DUDB44    211
C                                                                       DUDB44    212
      RETURN                                                            DUDB44    213
 1010 FORMAT(1X,'KORD,LORD,IORD,VALOUT(IORD): ',3I5,F10.3)              DUDB44    214
C                                                                       DUDB44    215
C-----------------------------------------------------------------------DUDB44    216
C                                                                       DUDB44    217
      ENTRY DUDB46(LORD,KORD)                                           DUDB44    218
CD                                                                      DUDB44    219
CD    FOR BLOCK TYPE 46 (TYPE T20 GOVERNOR END BLOCK).                  DUDB44    220
CD                                                                      DUDB44    221
      LDEB=(JDEB(264).NE.0)                                             DUDB44    222
C                                                                       DUDB44    223
      IORD=IDDAT(JE4+LORD)                                              DUDB44    224
      JEI=JEB+2                                                         DUDB44    225
      KINT=KINPU                                                        DUDB44    226
      KINPU=KINPU+IDDAT(JEI+13)                                         DUDB44    227
      IF(KINT.LT.KINPU) THEN                                            DUDB44    228
         J=KINT+1                                                       DUDB44    229
         XDAT=GAINS(J)                                                  DUDB44    230
         IOUT=INPUTS(J)                                                 DUDB44    231
         VALI=VALOUT(IOUT)*XDAT                                         DUDB44    232
         GO TO 160                                                      DUDB44    233
      ENDIF                                                             DUDB44    234
      KINP=KINPU                                                        DUDB44    235
      KINPU=KINPU+IDDAT(JEI+14)                                         DUDB44    236
      IF(KINP.LT.KINPU) THEN                                            DUDB44    237
         J=KINP+1                                                       DUDB44    238
         XDAT=GAINS(J)                                                  DUDB44    239
         IIN=INPUTS(J)                                                  DUDB44    240
         VALI=VALIN(IIN)*XDAT                                           DUDB44    241
      ENDIF                                                             DUDB44    242
  160 CONTINUE                                                          DUDB44    243
C                                                                       DUDB44    244
      VALIN(1)=VALI                                                     DUDB44    245
C                                                                       DUDB44    246
      KORD=KORD+1                                                       DUDB44    247
      IF(DDAT(JEI+2).GT.0.0) THEN                                       DUDB44    248
         DSTATE(LSTATE+KORD)=(VALI*DDAT(JEI+7)-                         DUDB44    249
     &   XSTATE(JSTATE+KORD))/DDAT(JEI+2)                               DUDB44    250
      ELSE                                                              DUDB44    251
         DSTATE(LSTATE+KORD)=0.0                                        DUDB44    252
         XSTATE(JSTATE+KORD)=VALI*DDAT(JEI+7)                           DUDB44    253
      ENDIF                                                             DUDB44    254
      KORD=KORD+1                                                       DUDB44    255
      XS2=XSTATE(JSTATE+KORD)                                           DUDB44    256
      UDG=XS2/XSTATE(JSTATE+KORD-1)                                     DUDB44    257
      UDG=UDG*UDG                                                       DUDB44    258
      DSTATE(LSTATE+KORD)=(DDAT(JEI+3)-UDG)/DDAT(JEI+1)                 DUDB44    259
      WDWO=1.0/(1.0+VALIN(12)/WXBASE)                                   DUDB44    260
      VALOUT(IORD)=(XS2-DDAT(JEI+8))*UDG*WDWO*DDAT(JEI+6)               DUDB44    261
C                                                                       DUDB44    262
      IF(LDEB) WRITE(IUD6,1020) KORD,LORD,IORD,VALOUT(IORD)             DUDB44    263
C                                                                       DUDB44    264
      RETURN                                                            DUDB44    265
 1020 FORMAT(1X,'KORD,LORD,IORD,VALOUT(IORD): ',3I5,F10.3)              DUDB44    266
C                                                                       DUDB44    267
C-----------------------------------------------------------------------DUDB44    268
C                                                                       DUDB44    269
      ENTRY DUDB47(LORD,KORD)                                           DUDB44    270
CD                                                                      DUDB44    271
CD    FOR BLOCK TYPE 47 (TYPE T22 GOVERNOR END BLOCK).                  DUDB44    272
CD                                                                      DUDB44    273
      LDEB=(JDEB(264).NE.0)                                             DUDB44    274
C                                                                       DUDB44    275
      IORD=IDDAT(JE4+LORD)                                              DUDB44    276
      JEI=JEB+2                                                         DUDB44    277
      TTW=DDAT(JEI+1)/2.0                                               DUDB44    278
      LL=IDDAT(JEI+8)                                                   DUDB44    279
      KINT=KINPU                                                        DUDB44    280
      KINPU=KINPU+IDDAT(JEI+13)                                         DUDB44    281
      IF(KINT.LT.KINPU) THEN                                            DUDB44    282
         J=KINT+1                                                       DUDB44    283
         XDAT=GAINS(J)                                                  DUDB44    284
         IOUT=INPUTS(J)                                                 DUDB44    285
         VALI=VALOUT(IOUT)*XDAT                                         DUDB44    286
         GO TO 170                                                      DUDB44    287
      ENDIF                                                             DUDB44    288
      KINP=KINPU                                                        DUDB44    289
      KINPU=KINPU+IDDAT(JEI+14)                                         DUDB44    290
      IF(KINP.LT.KINPU) THEN                                            DUDB44    291
         J=KINP+1                                                       DUDB44    292
         XDAT=GAINS(J)                                                  DUDB44    293
         IIN=INPUTS(J)                                                  DUDB44    294
         VALI=VALIN(IIN)*XDAT                                           DUDB44    295
      ENDIF                                                             DUDB44    296
  170 CONTINUE                                                          DUDB44    297
C                                                                       DUDB44    298
      VALIN(1)=VALI                                                     DUDB44    299
      IF(LL.EQ.0) THEN                                                  DUDB44    300
         GMAX=DDAT(JEI+5)                                               DUDB44    301
         IF(VALI.GT.GMAX) THEN                                          DUDB44    302
            VALI=GMAX                                                   DUDB44    303
            GO TO 180                                                   DUDB44    304
         ENDIF                                                          DUDB44    305
         GMIN=DDAT(JEI+6)                                               DUDB44    306
         IF(VALI.LT.GMIN) VALI=GMIN                                     DUDB44    307
      ENDIF                                                             DUDB44    308
  180 CONTINUE                                                          DUDB44    309
      KORD=KORD+1                                                       DUDB44    310
      IF(TTW.GT.0.0) GO TO 190                                          DUDB44    311
      DSTATE(LSTATE+KORD)=0.0                                           DUDB44    312
      XSTATE(JSTATE+KORD)=VALI*DDAT(JEI+2)                              DUDB44    313
      VALO=VALI*(DDAT(JEI+2)+DDAT(JEI+3))                               DUDB44    314
      GO TO 200                                                         DUDB44    315
  190 DSTATE(LSTATE+KORD)=(VALI*DDAT(JEI+2)-XSTATE(JSTATE+KORD))/TTW    DUDB44    316
      VALO=XSTATE(JSTATE+KORD)+VALI*DDAT(JEI+3)                         DUDB44    317
  200 CONTINUE                                                          DUDB44    318
      VALO=VALO-VALIN(12)*DDAT(JEI+4)/WXBASE                            DUDB44    319
      VALOUT(IORD)=VALO*DDAT(JEI+7)                                     DUDB44    320
      IF(LDEB) WRITE(IUD6,1030) KORD,LORD,IORD,VALOUT(IORD)             DUDB44    321
C                                                                       DUDB44    322
      RETURN                                                            DUDB44    323
 1030 FORMAT(1X,'KORD,LORD,IORD,VALOUT(IORD): ',3I5,F10.3)              DUDB44    324
      END                                                               DUDB44    325
