CFPRIME VDLMON                                                          VDLMON      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 VDLMON(IDISW)                                          VDLMON      3
CD                                                                      VDLMON      4
CD    THIS SUBROUTINE CHECKS THE STATUS OF THE VOLTAGE DIFFERENCE LOAD  VDLMON      5
CD    SHEDDING RELAY DURING THE SIMULATION.                             VDLMON      6
CD                                                                      VDLMON      7
CD                                                                      VDLMON      8
CD     LVDLDR           Starting position of IDATPT array for VDLDR     VDLMON      9
CD                      relay scheme, LVDLDR is in the common labelled  VDLMON     10
CD                      PT of include file CNPT.                        VDLMON     11
CD                                                                      VDLMON     12
CD     NVDLDR           Finishing position of IDATPT array for VDLDR    VDLMON     13
CD                      relay scheme, NVDLDR is in the common labelled  VDLMON     14
CD                      AUTO of include file CNAUTO.                    VDLMON     15
CD                                                                      VDLMON     16
CD                                                                      VDLMON     17
CD     let k = k-th VDLDR RELAY                                         VDLMON     18
CD                                                                      VDLMON     19
CD     N = IDATPT(k)    The array that stores the start position of     VDLMON     20
CD                      the K-TH VDLDR relay scheme data                VDLMON     21
CD                                                                      VDLMON     22
CD                                                                      VDLMON     23
CD                                                                      VDLMON     24
CD    IADATA(N+1)=IRVSW  IF= 0 THE VOLTAGE DEVIATION HAS NOT YET        VDLMON     25
CD                             EXCEEDED RVDRP1                          VDLMON     26
CD                       IF= 1 THE VOLTAGE DEVIATION HAS BEEN EXCEEDED  VDLMON     27
CD                             FOR LESS THAN RVTIM1 SECONDS             VDLMON     28
CD                       IF= 2 THE RELAY HAS TRIGGERED BUT THE BREAKER  VDLMON     29
CD                             TIME DELAY HAS NOT EXPIRED.              VDLMON     30
CD                       IF= 3 LOAD AND BEEN DROPPED AND THE RELAY IS   VDLMON     31
CD                             INACTIVE                                 VDLMON     32
CD                                                                      VDLMON     33
CD    IADATA(N+2)=IRVBNO PROGRAM BUS NUMBER WHERE RELAY IS LOCATED.     VDLMON     34
CD                                                                      VDLMON     35
CD    ADATA(N+3)=RVSHNT  IF= 'S', THEN THE REACTIVE LOAD TO BE DROPPED  VDLMON     36
CD                                AS ENTERED ON THE RV CARD IS ASSUMED  VDLMON     37
CD                                TO BE AT THE NOMINAL VALUE (VOLTAGE   VDLMON     38
CD                                = 1 PER UNIT).  THE PROGRAM WILL      VDLMON     39
CD                                CONVERT THIS VALUE TO THE PROPER PER  VDLMON     40
CD                                UNIT ADMITTANCE AT THE TIME THE LOAD  VDLMON     41
CD                                IS DROPPED.                           VDLMON     42
CD                                                                      VDLMON     43
CD   IADATA(N+4)=IFLAG   IF=0 : CONTROL BOTH LOACAL AND REMOTE RELAYS   VDLMON     44
CD                         =1 : CONTROL THE REMOTE RELAYS ONLY          VDLMON     45
CD                                                                      VDLMON     46
CD   IADATA(N+5)=IDRRR   NO. OF REMOTE RELAY ATTRACHED.                 VDLMON     47
CD                                                                      VDLMON     48
CD   IADATA(N+6)         REMOTE RELAY TRIP FLAG                         VDLMON     49
CD                                                                      VDLMON     50
CD   ADATA(N+7)=RVDRP1   VOLTAGE DEVIATION IN PER UNIT REQUIRED TO      VDLMON     51
CD                       TRIGGER THE RELAY.                             VDLMON     52
CD                                                                      VDLMON     53
CD   ADATA(N+8)=RVTIM1   TIME DURATION IN CYCLES THAT THE VOLTAGE       VDLMON     54
CD                       DEVIATION MUST EXCEED RVDRP1 BEFORE THE RELAY  VDLMON     55
CD                       TRIGGERS.                                      VDLMON     56
CD                                                                      VDLMON     57
CD   ADATA(N+9)=RVPDP1   AMOUNT OF REAL BUS LOAD, IN PER UNIT, TO BE    VDLMON     58
CD                       DROPPED.                                       VDLMON     59
CD                                                                      VDLMON     60
CD   ADATA(N+10)=RVQDP1  AMOUNT OF REACTIVE BUS LOAD, IN PER UNIT, TO   VDLMON     61
CD                       BE DROPPED.                                    VDLMON     62
CD                                                                      VDLMON     63
CD   ADATA(N+11)=RVBDY1  BREAKER TIME DELAY IN CYCLES.  DELAY TIME      VDLMON     64
CD                       BETWEEN RELAY TRIG AND LOAD BEING DROPPED.     VDLMON     65
CD                                                                      VDLMON     66
CD   ADATA(K+12)=RVCLK1  TIMER FOR HOW LONG THE DEVIATION HAS EXCEEDED  VDLMON     67
CD                       RVDRP1.                                        VDLMON     68
CD                                                                      VDLMON     69
CD   ADATA(N+13)=RVSTAN  STEADY STATE (T = 0.0) VOLTAGE                 VDLMON     70
CD                                                                      VDLMON     71
CD   ADATA(N+14)=RVCLK2  TIMER FOR THE BREAKER TIME DELAY.              VDLMON     72
CD                                                                      VDLMON     73
CD                                                                      VDLMON     74
C                                                                       VDLMON     75
      INCLUDE 'PARX.INS'                                                VDLMON     76
      INCLUDE 'CNPT.INS'                                                VDLMON     77
      INCLUDE 'CNVOLT.INS'                                              VDLMON     78
      INCLUDE 'CNAUTO.INS'                                              VDLMON     79
      INCLUDE 'CNB8.INS'                                                VDLMON     80
      INCLUDE 'CNB4.INS'                                                VDLMON     81
C                                                                       VDLMON     82
      LOGICAL IDISW                                                     VDLMON     83
      COMPLEX VOLTK                                                     VDLMON     84
CD                                                                      VDLMON     85
CD    NOTE:                                                             VDLMON     86
CD                                                                      VDLMON     87
CD     DO NOT CHECK RELAYS IF A FAULT IS APPLIED IESC=3                 VDLMON     88
C                                                                       VDLMON     89
      IF(IDISW)RETURN                                                   VDLMON     90
C                                                                       VDLMON     91
      DO 180 I=LVDLDR,NVDLDR                                            VDLMON     92
C                                                                       VDLMON     93
      K=IDATPT(I)                                                       VDLMON     94
C                                                                       VDLMON     95
      IF(IADATA(K+1).GT.9)GOTO 180                                      VDLMON     96
C                                                                       VDLMON     97
      IDRRR=IADATA(K+5)                                                 VDLMON     98
CD                                                                      VDLMON     99
CD     IF IRVSW=3 THIS RELAY HAS ALREADY DROPPED LOAD                   VDLMON    100
CD                                                                      VDLMON    101
      IF(IADATA(K+1).GE.3)GOTO 170                                      VDLMON    102
      NPROG=IADATA(K+2)                                                 VDLMON    103
CD                                                                      VDLMON    104
CD     IF IRVSW=2 RELAY HAS TRIPPED AND BREAKER DELAY TIMER HAS START   VDLMON    105
CD                                                                      VDLMON    106
      IF(IADATA(K+1).EQ.2)GOTO 120                                      VDLMON    107
C                                                                       VDLMON    108
      VOLTK=VOLT(NPROG)                                                 VDLMON    109
      VMAG=CABS(VOLTK)                                                  VDLMON    110
CD                                                                      VDLMON    111
CD     IF IRVSW=0, THE BUS VOLTAGE HAS NOT YET EXCEEDED THE TRIP        VDLMON    112
CD     DEVIATION                                                        VDLMON    113
CD                                                                      VDLMON    114
      VDELTA=ADATA(K+13)-VMAG                                           VDLMON    115
C                                                                       VDLMON    116
C    FOR UNDER-VOLTAGE                                                  VDLMON    117
C                                                                       VDLMON    118
      IF(ADATA(K+7).GT.0.0)THEN                                         VDLMON    119
        IF( VDELTA.LT.ADATA(K+7) )THEN                                  VDLMON    120
         IADATA(K+1)=0                                                  VDLMON    121
         ADATA(K+12)=0.0                                                VDLMON    122
         GOTO 180                                                       VDLMON    123
        ENDIF                                                           VDLMON    124
      ELSE                                                              VDLMON    125
        IF( VDELTA.GT.ADATA(K+7) )THEN                                  VDLMON    126
         IADATA(K+1)=0                                                  VDLMON    127
         ADATA(K+12)=0.0                                                VDLMON    128
         GOTO 180                                                       VDLMON    129
        ENDIF                                                           VDLMON    130
      ENDIF                                                             VDLMON    131
C                                                                       VDLMON    132
      IF(IADATA(K+1).EQ.1)GOTO 100                                      VDLMON    133
      IADATA(K+1)=1                                                     VDLMON    134
      ADATA(K+12)=TS+ADATA(K+8)                                         VDLMON    135
CD                                                                      VDLMON    136
CD     IF IRVSW=1 VOLTAGE HAS EXCEEDED TRIP DEVIATION AND UNDERVOLTAGE  VDLMON    137
CD     TIMER IS RUNNING                                                 VDLMON    138
CD                                                                      VDLMON    139
 100  IF(TS.LT.ADATA(K+12))THEN                                         VDLMON    140
         GOTO 180                                                       VDLMON    141
      ELSE                                                              VDLMON    142
         IADATA(K+1)=2                                                  VDLMON    143
         ADATA(K+14)=TS+ADATA(K+11)                                     VDLMON    144
C                                                                       VDLMON    145
C            REMOTE RELAY ACTIVIATED, NOT ALL TRIPPED                   VDLMON    146
C                                                                       VDLMON    147
         IF(IDRRR.NE.0)THEN                                             VDLMON    148
          KADD=K+14                                                     VDLMON    149
          CALL RTIMER(KADD,IDRRR)                                       VDLMON    150
         ENDIF                                                          VDLMON    151
      ENDIF                                                             VDLMON    152
CD                                                                      VDLMON    153
CD     IF IRVSW=2, THE RELAY HAS TRIPPED, SO CHECK TO SEE IF THE        VDLMON    154
CD     BREAKER DELAY TIME HAS BEEN REACHED. IF SO, DROP LOAD.           VDLMON    155
C                                                                       VDLMON    156
  120 IF(TS.LT.ADATA(K+14))GOTO 180                                     VDLMON    157
      IADATA(K+1)=3                                                     VDLMON    158
C                                                                       VDLMON    159
      IF(IADATA(K+4).EQ.0)THEN                                          VDLMON    160
C                                                                       VDLMON    161
        PDROP=ADATA(K+9)                                                VDLMON    162
        QDROP=ADATA(K+10)                                               VDLMON    163
CD                                                                      VDLMON    164
CD     IF RVSHNT=1 , CONVERT QDROP FROM NOMINAL VALUE TO                VDLMON    165
CD     VALUE AT PRESENT BUS VOLTAGE                                     VDLMON    166
CD                                                                      VDLMON    167
        IF(IADATA(K+3).NE.0)THEN                                        VDLMON    168
          VSQNOW=VMAG*VMAG                                              VDLMON    169
          QDROP=QDROP*VSQNOW                                            VDLMON    170
        ENDIF                                                           VDLMON    171
CD                                                                      VDLMON    172
CD     WRITE LOAD DROPPING DATA TO IAWSF FILE                           VDLMON    173
CD                                                                      VDLMON    174
        IF(IASWX.EQ.0)THEN                                              VDLMON    175
         WRITE(ISWFA,2010) TS                                           VDLMON    176
         NAWR=NAWR+1                                                    VDLMON    177
         IASWX=1                                                        VDLMON    178
        ENDIF                                                           VDLMON    179
        WRITE(ISWFA,2020) NPROG,IADATA(K+3),PDROP,QDROP                 VDLMON    180
        NAWR=NAWR+1                                                     VDLMON    181
      ENDIF                                                             VDLMON    182
C                                                                       VDLMON    183
 170  CONTINUE                                                          VDLMON    184
C                                                                       VDLMON    185
       IF(IADATA(K+1).EQ.4)GOTO 180                                     VDLMON    186
       IF(IDRRR.NE.0)THEN                                               VDLMON    187
         KADD=K+14                                                      VDLMON    188
         IPOINT=6                                                       VDLMON    189
         KBUS=K                                                         VDLMON    190
         CALL RETRIP(KADD,KBUS,IDRRR,IPOINT)                            VDLMON    191
         IF(IADATA(KBUS+IPOINT).EQ.-1)IADATA(K+1)=4                     VDLMON    192
        ENDIF                                                           VDLMON    193
C                                                                       VDLMON    194
 180  CONTINUE                                                          VDLMON    195
C                                                                       VDLMON    196
      RETURN                                                            VDLMON    197
C                                                                       VDLMON    198
 2010 FORMAT(F10.5)                                                     VDLMON    199
 2020 FORMAT('SLDD',2I5,2F10.5)                                         VDLMON    200
C                                                                       VDLMON    201
      END                                                               VDLMON    202
