CFPRIME VDLDAT                                                          VDLDAT      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 VDLDAT(IEBK)                                           VDLDAT      3
CD                                                                      VDLDAT      4
CD    TO READ VOLTAGE DIFFERENCE LOAD DROPPING RELAY AND THE REMOTE     VDLDAT      5
CD    RELAY.                                                            VDLDAT      6
CD                                                                      VDLDAT      7
CD                                                                      VDLDAT      8
CD     LVDLDR           Starting position of IDATPT array for VDLDR     VDLDAT      9
CD                      relay scheme, LVDLDR is in the common labelled  VDLDAT     10
CD                      PT of include file CNPT.                        VDLDAT     11
CD                                                                      VDLDAT     12
CD     NVDLDR           Finishing position of IDATPT array for VDLDR    VDLDAT     13
CD                      relay scheme, NVDLDR is in the common labelled  VDLDAT     14
CD                      AUTO of include file CNAUTO.                    VDLDAT     15
CD                                                                      VDLDAT     16
CD                                                                      VDLDAT     17
CD     let k = k-th VDLDR RELAY                                         VDLDAT     18
CD                                                                      VDLDAT     19
CD     N = IDATPT(k)    The array that stores the start position of     VDLDAT     20
CD                      the K-TH VDLDR relay scheme data                VDLDAT     21
CD                                                                      VDLDAT     22
CD                                                                      VDLDAT     23
CD                                                                      VDLDAT     24
CD    IADATA(N+1)=IRVSW  IF= 0 THE VOLTAGE DEVIATION HAS NOT YET        VDLDAT     25
CD                             EXCEEDED RVDRP1                          VDLDAT     26
CD                       IF= 1 THE VOLTAGE DEVIATION HAS BEEN EXCEEDED  VDLDAT     27
CD                             FOR LESS THAN RVTIM1 SECONDS             VDLDAT     28
CD                       IF= 2 THE RELAY HAS TRIGGERED BUT THE BREAKER  VDLDAT     29
CD                             TIME DELAY HAS NOT EXPIRED.              VDLDAT     30
CD                       IF= 3 LOAD AND BEEN DROPPED AND THE RELAY IS   VDLDAT     31
CD                             INACTIVE                                 VDLDAT     32
CD                                                                      VDLDAT     33
CD    IADATA(N+2)=IRVBNO PROGRAM BUS NUMBER WHERE RELAY IS LOCATED.     VDLDAT     34
CD                                                                      VDLDAT     35
CD    ADATA(N+3)=RVSHNT  IF= 'S', THEN THE REACTIVE LOAD TO BE DROPPED  VDLDAT     36
CD                                AS ENTERED ON THE RV CARD IS ASSUMED  VDLDAT     37
CD                                TO BE AT THE NOMINAL VALUE (VOLTAGE   VDLDAT     38
CD                                = 1 PER UNIT).  THE PROGRAM WILL      VDLDAT     39
CD                                CONVERT THIS VALUE TO THE PROPER PER  VDLDAT     40
CD                                UNIT ADMITTANCE AT THE TIME THE LOAD  VDLDAT     41
CD                                IS DROPPED.                           VDLDAT     42
CD                                                                      VDLDAT     43
CD   IADATA(N+4)=IFLAG   IF=0 : CONTROL BOTH LOACAL AND REMOTE RELAYS   VDLDAT     44
CD                         =1 : CONTROL THE REMOTE RELAYS ONLY          VDLDAT     45
CD                                                                      VDLDAT     46
CD   IADATA(N+5)=IDRRR   NO. OF REMOTE RELAY ATTRACHED.                 VDLDAT     47
CD                                                                      VDLDAT     48
CD   IADATA(N+6)         REMOTE RELAY TRIP FLAG                         VDLDAT     49
CD                                                                      VDLDAT     50
CD   ADATA(N+7)=RVDRP1   VOLTAGE DEVIATION IN PER UNIT REQUIRED TO      VDLDAT     51
CD                       TRIGGER THE RELAY.                             VDLDAT     52
CD                                                                      VDLDAT     53
CD   ADATA(N+8)=RVTIM1   TIME DURATION IN CYCLES THAT THE VOLTAGE       VDLDAT     54
CD                       DEVIATION MUST EXCEED RVDRP1 BEFORE THE RELAY  VDLDAT     55
CD                       TRIGGERS.                                      VDLDAT     56
CD                                                                      VDLDAT     57
CD   ADATA(N+9)=RVPDP1   AMOUNT OF REAL BUS LOAD, IN PER UNIT, TO BE    VDLDAT     58
CD                       DROPPED.                                       VDLDAT     59
CD                                                                      VDLDAT     60
CD   ADATA(N+10)=RVQDP1  AMOUNT OF REACTIVE BUS LOAD, IN PER UNIT, TO   VDLDAT     61
CD                       BE DROPPED.                                    VDLDAT     62
CD                                                                      VDLDAT     63
CD   ADATA(N+11)=RVBDY1  BREAKER TIME DELAY IN CYCLES.  DELAY TIME      VDLDAT     64
CD                       BETWEEN RELAY TRIG AND LOAD BEING DROPPED.     VDLDAT     65
CD                                                                      VDLDAT     66
CD   ADATA(K+12)=RVCLK1  TIMER FOR HOW LONG THE DEVIATION HAS EXCEEDED  VDLDAT     67
CD                       RVDRP1.                                        VDLDAT     68
CD                                                                      VDLDAT     69
CD   ADATA(N+13)=RVSTAN  STEADY STATE (T = 0.0) VOLTAGE                 VDLDAT     70
CD                                                                      VDLDAT     71
CD   ADATA(N+14)=RVCLK2  TIMER FOR THE BREAKER TIME DELAY.              VDLDAT     72
CD                                                                      VDLDAT     73
C                                                                       VDLDAT     74
C                                                                       VDLDAT     75
      INCLUDE 'PARX.INS'                                                VDLDAT     76
      INCLUDE 'CNPT.INS'                                                VDLDAT     77
      INCLUDE 'CNMNEW.INS'                                              VDLDAT     78
      INCLUDE 'CNAUTO.INS'                                              VDLDAT     79
      INCLUDE 'CNLFDA.INS'                                              VDLDAT     80
      INCLUDE 'CNB19.INS'                                               VDLDAT     81
      INCLUDE 'CNFLAG.INS'                                              VDLDAT     82
      INCLUDE 'CNPARX.INS'                                              VDLDAT     83
      INCLUDE 'CNREN.INS'                                               VDLDAT     84
      INCLUDE 'CNUNIT.INS'                                              VDLDAT     85
      INCLUDE 'CNMSG.INS'                                               VDLDAT     86
C                                                                       VDLDAT     87
      CHARACTER*80 CARD,CARD3                                           VDLDAT     88
      CHARACTER*12 BUSNAM                                               VDLDAT     89
      CHARACTER*3 ESC,MPI                                               VDLDAT     90
      CHARACTER*5 EDATA                                                 VDLDAT     91
      DATA EDATA/'EDATA'/,ESC/'ESC'/,MPI/'MPI'/                         VDLDAT     92
C                                                                       VDLDAT     93
      LDEB=(JDEB(14).NE.0)                                              VDLDAT     94
C                                                                       VDLDAT     95
      LVDLDR=LRTEMP                                                     VDLDAT     96
C                                                                       VDLDAT     97
C  READING VOLTAGE DIFFERENCE LOAD DROPPING RELAY DATA                  VDLDAT     98
C                                                                       VDLDAT     99
  110 CONTINUE                                                          VDLDAT    100
      CALL GETLIN(IU54,CARD)                                            VDLDAT    101
      IF(CARD(1:5).NE.EDATA)THEN                                        VDLDAT    102
       IF(KLFO.EQ.0)THEN                                                VDLDAT    103
       READ (CARD,3000) NLF,ISOPT,IFLAG                                 VDLDAT    104
           IF(MNEW(NLF).EQ.0)THEN                                       VDLDAT    105
           IEBK=1                                                       VDLDAT    106
           MSG(1)=' *** ERROR AT THE CARD:'                             VDLDAT    107
           MSG(2)=CARD                                                  VDLDAT    108
           CALL PRTMSG(2)                                               VDLDAT    109
           CALL GETLIN(IU54,CARD)                                       VDLDAT    110
           GOTO 110                                                     VDLDAT    111
           ENDIF                                                        VDLDAT    112
       ELSE                                                             VDLDAT    113
       READ (CARD,3040) BUSNAM,ISOPT,IFLAG                              VDLDAT    114
       CALL CHKBUS(BUSNAM,NLF)                                          VDLDAT    115
           IF(NLF.EQ.0)THEN                                             VDLDAT    116
           IEBK=1                                                       VDLDAT    117
           MSG(1)=' *** ERROR AT THE CARD:'                             VDLDAT    118
           MSG(2)=CARD                                                  VDLDAT    119
           CALL PRTMSG(2)                                               VDLDAT    120
           CALL GETLIN(IU54,CARD)                                       VDLDAT    121
           GOTO 110                                                     VDLDAT    122
           ENDIF                                                        VDLDAT    123
       ENDIF                                                            VDLDAT    124
C                                                                       VDLDAT    125
C     STORE THE DATA INTO THE PERMANENT ARRAY                           VDLDAT    126
C                                                                       VDLDAT    127
      IF(NAUT.LT.MAXSET)THEN                                            VDLDAT    128
C                                                                       VDLDAT    129
      LDSTAT=0                                                          VDLDAT    130
      NPROG=MNEW(NLF)                                                   VDLDAT    131
      IF(JBSTAT(NPROG).GT.2)LDSTAT=10                                   VDLDAT    132
C                                                                       VDLDAT    133
      NAUT=NAUT+1                                                       VDLDAT    134
C                                                                       VDLDAT    135
      NAUTB=NAUTB+1                                                     VDLDAT    136
      NAUBUS(NAUTB)=NLF                                                 VDLDAT    137
      LRTEMP=LRTEMP+1                                                   VDLDAT    138
      IDATPT(LRTEMP)=JLNA                                               VDLDAT    139
      IADATA(JLNA+1)=LDSTAT                                             VDLDAT    140
      IADATA(JLNA+2)=NLF                                                VDLDAT    141
      IADATA(JLNA+3)=ISOPT                                              VDLDAT    142
      IADATA(JLNA+4)=IFLAG                                              VDLDAT    143
      JSWITC=JLNA+5                                                     VDLDAT    144
      CALL GETLIN(IU54,CARD)                                            VDLDAT    145
      READ(CARD,3050) (ADATA(JLNA+LL),LL=7,11)                          VDLDAT    146
      JLNA=JLNA+14                                                      VDLDAT    147
C                                                                       VDLDAT    148
C   READ IN THE REMOTE RELAYS                                           VDLDAT    149
C                                                                       VDLDAT    150
 150  CALL GETLIN(IU54,CARD)                                            VDLDAT    151
      IF(CARD(1:3).EQ.ESC) GOTO 110                                     VDLDAT    152
      IF(CARD(1:3).EQ.MPI) CALL GETLIN(IU54,CARD3)                      VDLDAT    153
      CALL SWIDAT(CARD,CARD3,KSWITC,IEBK)                               VDLDAT    154
      IADATA(JSWITC)=KSWITC                                             VDLDAT    155
      GOTO 150                                                          VDLDAT    156
C                                                                       VDLDAT    157
      ELSE                                                              VDLDAT    158
      WRITE(MSG(1),3020) MAXSET                                         VDLDAT    159
      MSG(2)=CARD                                                       VDLDAT    160
      CALL PRTMSG(2)                                                    VDLDAT    161
      CALL GETLIN(IU54,CARD)                                            VDLDAT    162
      IEBK=1                                                            VDLDAT    163
C                                                                       VDLDAT    164
C   READ IN AND SKIP THE REMOTE RELAYS                                  VDLDAT    165
C                                                                       VDLDAT    166
 160  CALL GETLIN(IU54,CARD)                                            VDLDAT    167
      IF(CARD(1:3).EQ.ESC) GOTO 110                                     VDLDAT    168
      IF(CARD(1:3).EQ.MPI) CALL GETLIN(IU54,CARD3)                      VDLDAT    169
      GOTO 160                                                          VDLDAT    170
      ENDIF                                                             VDLDAT    171
      ENDIF                                                             VDLDAT    172
C                                                                       VDLDAT    173
      IF(LRTEMP.NE.LVDLDR)THEN                                          VDLDAT    174
      LVDLDR=LVDLDR+1                                                   VDLDAT    175
      NVDLDR=LRTEMP                                                     VDLDAT    176
      ELSE                                                              VDLDAT    177
      LVDLDR=0                                                          VDLDAT    178
      NVDLDR=0                                                          VDLDAT    179
      ENDIF                                                             VDLDAT    180
C                                                                       VDLDAT    181
      IF(IEBK.EQ.0)RETURN                                               VDLDAT    182
C                                                                       VDLDAT    183
      CARD='VDLDAT: VOLTAGE DIFFERENCE LOAD DROPPING RELAY DATA ERROR'  VDLDAT    184
      CALL ASTOP(CARD,57)                                               VDLDAT    185
C                                                                       VDLDAT    186
 3000 FORMAT(3I5)                                                       VDLDAT    187
 3020 FORMAT(' *** ERROR NO. OF RELAY SCHEME EXCEEDS ',I5)              VDLDAT    188
 3040 FORMAT(A12,2I5)                                                   VDLDAT    189
 3050 FORMAT(8F10.5)                                                    VDLDAT    190
      END                                                               VDLDAT    191
