CFPRIME DE15                                                            DE15        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 DE15(H)                                                DE15        3
CD                                                                      DE15        4
CD    TO CALCULATE THE DERIVATIVES OF THE STATES OF TYPE 15 EXCITER,    DE15        5
CD    USED BY BOTH RUNGE-KUTTA AND TRAPEZOIDAL METHOD.                  DE15        6
CD                                                                      DE15        7
CD    THE DATA STRUCTURE FOR THIS TYPE OF EXCITER IS GIVEN BELOW.       DE15        8
CD                                                                      DE15        9
CD   3.11 Exciter type 15                                               DE15       10
CD                                                                      DE15       11
CD     Exciter data                                                     DE15       12
CD                                                                      DE15       13
CD     IDDAT(JE+ 1)   = IVTN         : sensing bus number               DE15       14
CD     DDAT(JE+ 2)    = KA                                              DE15       15
CD     DDAT(JE+ 3)    = TA                                              DE15       16
CD     DDAT(JE+ 4)    = KF                                              DE15       17
CD     DDAT(JE+ 5)    = TF                                              DE15       18
CD     DDAT(JE+ 6)    = (reserved for future use)                       DE15       19
CD     DDAT(JE+ 7)    = (reserved for future use)                       DE15       20
CD     DDAT(JE+ 8)    = TF1                                             DE15       21
CD     DDAT(JE+ 9)    = TF2                                             DE15       22
CD     DDAT(JE+10)    = TB                                              DE15       23
CD     DDAT(JE+11)    = VRMAX                                           DE15       24
CD     DDAT(JE+12)    = VRMIN                                           DE15       25
CD     DDAT(JE+13)    = EFDMAX                                          DE15       26
CD     DDAT(JE+14)    = EFDMIN                                          DE15       27
CD     DDAT(JE+15)    = (reserved for future use)                       DE15       28
CD     DDAT(JE+16)    = (reserved for future use)                       DE15       29
CD     DDAT(JE+17)    = (reserved for future use)                       DE15       30
CD     DDAT(JE+18)    = TR                                              DE15       31
CD     DDAT(JE+19)    = RC                                              DE15       32
CD     DDAT(JE+20)    = XC                                              DE15       33
CD                                                                      DE15       34
CD     Exciter states                                                   DE15       35
CD                                                                      DE15       36
CD     XSTATE(JES+1)  = TR block     : compulsory                       DE15       37
CD     XSTATE(JES+2)  = TF block     : compulsory                       DE15       38
CD     XSTATE(JES+3)  = TB block     : compulsory                       DE15       39
CD     XSTATE(JES+4)  = TA block     : compulsory                       DE15       40
CD     XSTATE(JES+5)  = TF2 block    : compulsory                       DE15       41
CD                                                                      DE15       42
CD     Exciter Y-variables                                              DE15       43
CD                                                                      DE15       44
CD     VREG(JYE+1)    = VC (input to the TR block)                      DE15       45
CD     VREF(JYE+2)    = reference value                                 DE15       46
CD     VRFIN(JYE+3)   = output of TA block                              DE15       47
CD                                                                      DE15       48
      INCLUDE 'PARX.INS'                                                DE15       49
      INCLUDE 'CNPT.INS'                                                DE15       50
      INCLUDE 'CNVOLT.INS'                                              DE15       51
      INCLUDE 'CNIPTR.INS'                                              DE15       52
      INCLUDE 'CNMDAT.INS'                                              DE15       53
      INCLUDE 'CNB3.INS'                                                DE15       54
      INCLUDE 'CNB5.INS'                                                DE15       55
      INCLUDE 'CNB8.INS'                                                DE15       56
      INCLUDE 'CNB9.INS'                                                DE15       57
      INCLUDE 'CNB10.INS'                                               DE15       58
      INCLUDE 'CNB19.INS'                                               DE15       59
      INCLUDE 'CNEXC.INS'                                               DE15       60
      INCLUDE 'CNXSTA.INS'                                              DE15       61
      INCLUDE 'CNQSTA.INS'                                              DE15       62
      INCLUDE 'CNMYVA.INS'                                              DE15       63
      INCLUDE 'CNYVAR.INS'                                              DE15       64
      INCLUDE 'CNFLAG.INS'                                              DE15       65
      INCLUDE 'CNUNIT.INS'                                              DE15       66
      INCLUDE 'CNPREV.INS'                                              DE15       67
      INCLUDE 'CNIMPR.INS'                                              DE15       68
C                                                                       DE15       69
      LOGICAL SLOGIC                                                    DE15       70
C                                                                       DE15       71
C     DESIGN IF SMALLER TIME STEP SHOULD BE TAKEN                       DE15       72
C                                                                       DE15       73
      LDEB=.FALSE.                                                      DE15       74
C                                                                       DE15       75
      DELT=0.0                                                          DE15       76
      IF (IDDAT(JE+24).NE.0) THEN                                       DE15       77
         IF (H.LE.DDAT(JE+25)) THEN                                     DE15       78
            SLOGIC=.FALSE.                                              DE15       79
            KTM=1                                                       DE15       80
         ELSE                                                           DE15       81
            SLOGIC=.TRUE.                                               DE15       82
            KTM=INT(H/DDAT(JE+25)/KSBINT)+1                             DE15       83
            DELT=H/KTM/KSBINT                                           DE15       84
         END IF                                                         DE15       85
      ELSE                                                              DE15       86
         SLOGIC=.FALSE.                                                 DE15       87
         KTM=1                                                          DE15       88
      END IF                                                            DE15       89
C                                                                       DE15       90
      VRMAX=DDAT(JE+11)                                                 DE15       91
      VRMIN=DDAT(JE+12)                                                 DE15       92
C                                                                       DE15       93
      DO 500 ITM=1,KTM                                                  DE15       94
C                                                                       DE15       95
C     RATE FEEDBACK BLOCK(S)                                            DE15       96
C                                                                       DE15       97
      XRATE=VRFIN(JYE+3)                                                DE15       98
C                                                                       DE15       99
      IF (IDDAT(JE+5).NE.0) THEN                                        DE15      100
         DSTATE(LSTATE+2)=(XRATE-XSTATE(JSTATE+2))/DDAT(JE+5)           DE15      101
         V2=DSTATE(LSTATE+2)*DDAT(JE+4)                                 DE15      102
      ELSE                                                              DE15      103
         V2=0.0                                                         DE15      104
         DSTATE(LSTATE+2)=0.0                                           DE15      105
         XSTATE(JSTATE+2)=XRATE                                         DE15      106
      END IF                                                            DE15      107
C                                                                       DE15      108
      IF (IDDAT(JE+9).NE.0) THEN                                        DE15      109
         DSTATE(LSTATE+5)=(V2-XSTATE(JSTATE+5))/DDAT(JE+9)              DE15      110
         V2=XSTATE(JSTATE+5)+DSTATE(LSTATE+5)*DDAT(JE+8)                DE15      111
      ELSE                                                              DE15      112
         DSTATE(LSTATE+5)=0.0                                           DE15      113
         XSTATE(JSTATE+5)=V2                                            DE15      114
      END IF                                                            DE15      115
C                                                                       DE15      116
      VSUM=VREF(JYE+2)-V1                                               DE15      117
      IF (ISTABN.GT.0) VSUM=VSUM+VSS(JYS+1)                             DE15      118
      IF (IUALN.NE.0) VSUM=VSUM+VUAL(JYU+1)                             DE15      119
      IF (ITEBN.NE.0) VSUM=VSUM+TEB(JYTB+1)                             DE15      120
      IF (IMXLN.NE.0) VSUM=VSUM-VMXL(JYMX+1)                            DE15      121
C                                                                       DE15      122
      V3=VSUM-V2                                                        DE15      123
C                                                                       DE15      124
C     AMPILIFIER BLOCK                                                  DE15      125
C                                                                       DE15      126
      IF (IDDAT(JE+10).NE.0) THEN                                       DE15      127
         DSTATE(LSTATE+3)=(V3-XSTATE(JSTATE+3))/DDAT(JE+10)             DE15      128
         V3=XSTATE(JSTATE+3)                                            DE15      129
      ELSE                                                              DE15      130
         DSTATE(LSTATE+3)=0.0                                           DE15      131
         XSTATE(JSTATE+3)=V3                                            DE15      132
      END IF                                                            DE15      133
C                                                                       DE15      134
      VR=DDAT(JE+2)*V3                                                  DE15      135
      IF (IDDAT(JE+3).NE.0) THEN                                        DE15      136
         DSTATE(LSTATE+4)=(VR-XSTATE(JSTATE+4))/DDAT(JE+3)              DE15      137
         VR=XSTATE(JSTATE+4)                                            DE15      138
      ELSE                                                              DE15      139
         DSTATE(LSTATE+4)=0.0                                           DE15      140
      END IF                                                            DE15      141
C                                                                       DE15      142
      IF (VR.GE.VRMAX) THEN                                             DE15      143
         VR=VRMAX                                                       DE15      144
         IF (DSTATE(LSTATE+4).GT.0.0) THEN                              DE15      145
            DSTATE(LSTATE+4)=0.0                                        DE15      146
            QSTATE(JSTATE+4)=0.0                                        DE15      147
         END IF                                                         DE15      148
      ELSE IF (VR.LE.VRMIN) THEN                                        DE15      149
         VR=VRMIN                                                       DE15      150
         IF (DSTATE(LSTATE+4).LT.0.0) THEN                              DE15      151
            DSTATE(LSTATE+4)=0.0                                        DE15      152
            QSTATE(JSTATE+4)=0.0                                        DE15      153
         END IF                                                         DE15      154
      END IF                                                            DE15      155
C                                                                       DE15      156
      IF (IDDAT(JE+3).EQ.0) XSTATE(JSTATE+4)=VR                         DE15      157
      VRFINJ=VR                                                         DE15      158
C                                                                       DE15      159
C     EULER FORWARD METHOD                                              DE15      160
C                                                                       DE15      161
      IF (SLOGIC) THEN                                                  DE15      162
         DO 310 JX=2,5                                                  DE15      163
            XSTATE(JSTATE+JX)=XSTATE(JSTATE+JX)+DELT*DSTATE(LSTATE+JX)  DE15      164
  310    CONTINUE                                                       DE15      165
         IF (XSTATE(JSTATE+4).GT.VRMAX) THEN                            DE15      166
            XSTATE(JSTATE+4)=VRMAX                                      DE15      167
         ELSE IF (XSTATE(JSTATE+4).LT.VRMIN) THEN                       DE15      168
            XSTATE(JSTATE+4)=VRMIN                                      DE15      169
         END IF                                                         DE15      170
         IF (IDDAT(JE+3).NE.0) THEN                                     DE15      171
            VRFINJ=XSTATE(JSTATE+4)                                     DE15      172
         ELSE IF (IDDAT(JE+10).NE.0) THEN                               DE15      173
            VRFINJ=XSTATE(JSTATE+3)*DDAT(JE+2)                          DE15      174
         ELSE                                                           DE15      175
            VRFINJ=(VSUM-DSTATE(LSTATE+2)*DDAT(JE+4))*DDAT(JE+2)        DE15      176
         END IF                                                         DE15      177
         IF (VRFINJ.GT.VRMAX) THEN                                      DE15      178
            VRFINJ=VRMAX                                                DE15      179
         ELSE IF (VRFINJ.LT.VRMIN) THEN                                 DE15      180
            VRFINJ=VRMIN                                                DE15      181
         END IF                                                         DE15      182
      END IF                                                            DE15      183
C                                                                       DE15      184
      VRFIN(JYE+3)=VRFINJ                                               DE15      185
C                                                                       DE15      186
  500 CONTINUE                                                          DE15      187
C                                                                       DE15      188
C     IF STATES WERE UPDATED BY INNER LOOP, FOOL THE RKG                DE15      189
C                                                                       DE15      190
      IF (SLOGIC) THEN                                                  DE15      191
         DSTATE(LSTATE+2)=0.0                                           DE15      192
         DSTATE(LSTATE+3)=0.0                                           DE15      193
         DSTATE(LSTATE+4)=0.0                                           DE15      194
         DSTATE(LSTATE+5)=0.0                                           DE15      195
      END IF                                                            DE15      196
C                                                                       DE15      197
C     UPDATE THE EFDN                                                   DE15      198
C                                                                       DE15      199
      IF (VR.GT.DDAT(JE+13)) THEN                                       DE15      200
         VR=DDAT(JE+13)                                                 DE15      201
      ELSE IF (VR.LT.DDAT(JE+14)) THEN                                  DE15      202
         VR=DDAT(JE+14)                                                 DE15      203
      END IF                                                            DE15      204
C                                                                       DE15      205
      EFD(JYG+4)=VR*VREG(JYE+1)                                         DE15      206
C                                                                       DE15      207
      LSTATE=LSTATE+5                                                   DE15      208
C                                                                       DE15      209
      RETURN                                                            DE15      210
C                                                                       DE15      211
      ENTRY DEI15(H)                                                    DE15      212
CD                                                                      DE15      213
CD    TO CALCULATE THE DERIVATIVES OF THE STATES OF TYPE 15 EXCITER,    DE15      214
CD    USED BY TRAPEZOIDAL METHOD.                                       DE15      215
CD                                                                      DE15      216
C                                                                       DE15      217
C     DESIGN IF SMALLER TIME STEP SHOULD BE TAKEN                       DE15      218
C                                                                       DE15      219
      DELT=0.0                                                          DE15      220
      IF (IDDAT(JE+24).NE.0) THEN                                       DE15      221
         IF (H.LE.DDAT(JE+25)) THEN                                     DE15      222
            SLOGIC=.FALSE.                                              DE15      223
            KTM=1                                                       DE15      224
         ELSE                                                           DE15      225
            SLOGIC=.TRUE.                                               DE15      226
            KTM=INT(H/DDAT(JE+25))+1                                    DE15      227
            DELT=H/KTM                                                  DE15      228
            IF (NITER.EQ.0) THEN                                        DE15      229
               DO 90 JX=2,5                                             DE15      230
                  XSTATE(JSTATE+JX)=XPREV(1,JSTATE+JX)                  DE15      231
   90          CONTINUE                                                 DE15      232
            END IF                                                      DE15      233
         END IF                                                         DE15      234
      ELSE                                                              DE15      235
         SLOGIC=.FALSE.                                                 DE15      236
         KTM=1                                                          DE15      237
      END IF                                                            DE15      238
C                                                                       DE15      239
C     BYPASS IF SUBDIVISION IS ON AND NITER > 0                         DE15      240
C                                                                       DE15      241
      IF (SLOGIC.AND.NITER.GT.0) THEN                                   DE15      242
         VR=VRFIN(JYE+3)                                                DE15      243
         GOTO 130                                                       DE15      244
      END IF                                                            DE15      245
C                                                                       DE15      246
      VRMAX=DDAT(JE+11)                                                 DE15      247
      VRMIN=DDAT(JE+12)                                                 DE15      248
C                                                                       DE15      249
      DO 100 ITM=1,KTM                                                  DE15      250
C                                                                       DE15      251
C     RATE FEEDBACK BLOCK(S)                                            DE15      252
C                                                                       DE15      253
      XRATE=VRFIN(JYE+3)                                                DE15      254
C                                                                       DE15      255
      IF (IDDAT(JE+5).NE.0) THEN                                        DE15      256
         DSTATE(LSTATE+2)=(XRATE-XSTATE(JSTATE+2))/DDAT(JE+5)           DE15      257
         V2=DSTATE(LSTATE+2)*DDAT(JE+4)                                 DE15      258
      ELSE                                                              DE15      259
         V2=0.0                                                         DE15      260
         DSTATE(LSTATE+2)=0.0                                           DE15      261
         XSTATE(JSTATE+2)=XRATE                                         DE15      262
      END IF                                                            DE15      263
C                                                                       DE15      264
      IF (IDDAT(JE+9).NE.0) THEN                                        DE15      265
         DSTATE(LSTATE+5)=(V2-XSTATE(JSTATE+5))/DDAT(JE+9)              DE15      266
         V2=XSTATE(JSTATE+5)+DSTATE(LSTATE+5)*DDAT(JE+8)                DE15      267
      ELSE                                                              DE15      268
         DSTATE(LSTATE+5)=0.0                                           DE15      269
         XSTATE(JSTATE+5)=V2                                            DE15      270
      END IF                                                            DE15      271
C                                                                       DE15      272
      VSUM=VREF(JYE+2)-V1                                               DE15      273
      IF (ISTABN.GT.0) VSUM=VSUM+VSS(JYS+1)                             DE15      274
      IF (IUALN.NE.0) VSUM=VSUM+VUAL(JYU+1)                             DE15      275
      IF (ITEBN.NE.0) VSUM=VSUM+TEB(JYTB+1)                             DE15      276
      IF (IMXLN.NE.0) VSUM=VSUM-VMXL(JYMX+1)                            DE15      277
C                                                                       DE15      278
      V3=VSUM-V2                                                        DE15      279
C                                                                       DE15      280
C     AMPILIFIER BLOCK                                                  DE15      281
C                                                                       DE15      282
      IF (IDDAT(JE+10).NE.0) THEN                                       DE15      283
         DSTATE(LSTATE+3)=(V3-XSTATE(JSTATE+3))/DDAT(JE+10)             DE15      284
         V3=XSTATE(JSTATE+3)                                            DE15      285
      ELSE                                                              DE15      286
         DSTATE(LSTATE+3)=0.0                                           DE15      287
         XSTATE(JSTATE+3)=V3                                            DE15      288
      END IF                                                            DE15      289
C                                                                       DE15      290
      VR=DDAT(JE+2)*V3                                                  DE15      291
      IF (IDDAT(JE+3).NE.0) THEN                                        DE15      292
         DSTATE(LSTATE+4)=(VR-XSTATE(JSTATE+4))/DDAT(JE+3)              DE15      293
         VR=XSTATE(JSTATE+4)                                            DE15      294
      ELSE                                                              DE15      295
         DSTATE(LSTATE+4)=0.0                                           DE15      296
      END IF                                                            DE15      297
C                                                                       DE15      298
      IF (VR.GE.VRMAX) THEN                                             DE15      299
         VR=VRMAX                                                       DE15      300
         IF (DSTATE(LSTATE+4).GT.0.0) DSTATE(LSTATE+4)=0.0              DE15      301
      ELSE IF (VR.LE.VRMIN) THEN                                        DE15      302
         VR=VRMIN                                                       DE15      303
         IF (DSTATE(LSTATE+4).LT.0.0) DSTATE(LSTATE+4)=0.0              DE15      304
      END IF                                                            DE15      305
C                                                                       DE15      306
      IF (IDDAT(JE+3).EQ.0) XSTATE(JSTATE+4)=VR                         DE15      307
      VRFINJ=VR                                                         DE15      308
C                                                                       DE15      309
C     EULER FORWARD METHOD                                              DE15      310
C                                                                       DE15      311
      IF (SLOGIC) THEN                                                  DE15      312
         DO 110 JX=2,5                                                  DE15      313
            XSTATE(JSTATE+JX)=XSTATE(JSTATE+JX)+DELT*DSTATE(LSTATE+JX)  DE15      314
  110    CONTINUE                                                       DE15      315
         IF (XSTATE(JSTATE+4).GT.VRMAX) THEN                            DE15      316
            XSTATE(JSTATE+4)=VRMAX                                      DE15      317
         ELSE IF (XSTATE(JSTATE+4).LT.VRMIN) THEN                       DE15      318
            XSTATE(JSTATE+4)=VRMIN                                      DE15      319
         END IF                                                         DE15      320
         IF (IDDAT(JE+3).NE.0) THEN                                     DE15      321
            VRFINJ=XSTATE(JSTATE+4)                                     DE15      322
         ELSE IF (IDDAT(JE+10).NE.0) THEN                               DE15      323
            VRFINJ=XSTATE(JSTATE+3)*DDAT(JE+2)                          DE15      324
         ELSE                                                           DE15      325
            VRFINJ=(VSUM-DSTATE(LSTATE+2)*DDAT(JE+4))*DDAT(JE+2)        DE15      326
         END IF                                                         DE15      327
         IF (VRFINJ.GT.VRMAX) THEN                                      DE15      328
            VRFINJ=VRMAX                                                DE15      329
         ELSE IF (VRFINJ.LT.VRMIN) THEN                                 DE15      330
            VRFINJ=VRMIN                                                DE15      331
         END IF                                                         DE15      332
      END IF                                                            DE15      333
C                                                                       DE15      334
      VRFIN(JYE+3)=VRFINJ                                               DE15      335
C                                                                       DE15      336
  100 CONTINUE                                                          DE15      337
C                                                                       DE15      338
C     IF STATES WERE UPDATED BY INNER LOOP, FOOL THE RKG                DE15      339
C                                                                       DE15      340
  130 IF (SLOGIC) THEN                                                  DE15      341
         DSTATE(LSTATE+2)=0.0                                           DE15      342
         DSTATE(LSTATE+3)=0.0                                           DE15      343
         DSTATE(LSTATE+4)=0.0                                           DE15      344
         DSTATE(LSTATE+5)=0.0                                           DE15      345
      END IF                                                            DE15      346
C                                                                       DE15      347
C     UPDATE THE EFDN                                                   DE15      348
C                                                                       DE15      349
      IF (VR.GT.DDAT(JE+13)) THEN                                       DE15      350
         VR=DDAT(JE+13)                                                 DE15      351
      ELSE IF (VR.LT.DDAT(JE+14)) THEN                                  DE15      352
         VR=DDAT(JE+14)                                                 DE15      353
      END IF                                                            DE15      354
C                                                                       DE15      355
      EFD(JYG+4)=VR*VREG(JYE+1)                                         DE15      356
C                                                                       DE15      357
      LSTATE=LSTATE+5                                                   DE15      358
C                                                                       DE15      359
      RETURN                                                            DE15      360
      END                                                               DE15      361
