CFPRIME DLSDAT                                                          DLSDAT      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 DLSDAT(IEBK)                                           DLSDAT      3
CD                                                                      DLSDAT      4
CD    THIS SUBROUTINE READS IN THE DOUBLE LENS SHAPE OUT-OF-STEP RELAY  DLSDAT      5
CD    DATA                                                              DLSDAT      6
CD                                                                      DLSDAT      7
CD     LDLSO           Starting position of IDATPT array  of DIST relay DLSDAT      8
CD                     scheme, LDLSO  is in the common labelled PT of   DLSDAT      9
CD                     include file CNPT.                               DLSDAT     10
CD                                                                      DLSDAT     11
CD     NDLSO           Finishing position of IDATPT array of DIST relay DLSDAT     12
CD                     scheme, NDLSO  is in common labelled AUTO of     DLSDAT     13
CD                     include file CNAUTO.                             DLSDAT     14
CD                                                                      DLSDAT     15
      INCLUDE 'PARX.INS'                                                DLSDAT     16
      INCLUDE 'CNPT.INS'                                                DLSDAT     17
      INCLUDE 'CNMNEW.INS'                                              DLSDAT     18
      INCLUDE 'CNAUTO.INS'                                              DLSDAT     19
      INCLUDE 'CNLFDA.INS'                                              DLSDAT     20
      INCLUDE 'CNB19.INS'                                               DLSDAT     21
      INCLUDE 'CNFLAG.INS'                                              DLSDAT     22
      INCLUDE 'CNPARX.INS'                                              DLSDAT     23
      INCLUDE 'CNREN.INS'                                               DLSDAT     24
      INCLUDE 'CNUNIT.INS'                                              DLSDAT     25
      INCLUDE 'CNMSG.INS'                                               DLSDAT     26
C                                                                       DLSDAT     27
      CHARACTER*80 CARD1,CARD                                           DLSDAT     28
      CHARACTER*12 BNAME1,BNAME2                                        DLSDAT     29
      CHARACTER*2 CID2                                                  DLSDAT     30
      INTEGER*4 ICID                                                    DLSDAT     31
      CHARACTER*5 EDATA                                                 DLSDAT     32
      CHARACTER*3 ESC,MPI                                               DLSDAT     33
      DATA ESC/'ESC'/,MPI/'MPI'/                                        DLSDAT     34
      DATA EDATA/'EDATA'/                                               DLSDAT     35
C                                                                       DLSDAT     36
      LDEB=.FALSE.                                                      DLSDAT     37
C                                                                       DLSDAT     38
C     READ IN THE RELAY DATA CARDS                                      DLSDAT     39
C                                                                       DLSDAT     40
      LDLSO=LRTEMP                                                      DLSDAT     41
  110 CONTINUE                                                          DLSDAT     42
      CALL GETLIN(IU54,CARD1)                                           DLSDAT     43
      IF(CARD1(1:5).EQ.EDATA) GOTO 300                                  DLSDAT     44
      IF(KLFO.EQ.0)THEN                                                 DLSDAT     45
            READ (CARD1,2010) NLFI,NLFJ,CID2,IFLAG,IOCF                 DLSDAT     46
      ELSE                                                              DLSDAT     47
            READ (CARD1,2020) BNAME1,BNAME2,CID2,TFLAG,IOCF             DLSDAT     48
            CALL CHKBUS(BNAME1,NLFI)                                    DLSDAT     49
            CALL CHKBUS(BNAME2,NLFJ)                                    DLSDAT     50
      ENDIF                                                             DLSDAT     51
      IF(NLFI.EQ.0.OR.NLFJ.EQ.0.OR.                                     DLSDAT     52
     *   MNEW(NLFI).EQ.0.OR.MNEW(NLFJ).EQ.0)THEN                        DLSDAT     53
         WRITE(MSG(1),2030)                                             DLSDAT     54
         GOTO 200                                                       DLSDAT     55
      ENDIF                                                             DLSDAT     56
C                                                                       DLSDAT     57
C     STORE THE DATA INTO THE PERMANENT ARRAY                           DLSDAT     58
C                                                                       DLSDAT     59
      IF(NAUT.GE.MAXSET)THEN                                            DLSDAT     60
         WRITE(MSG(1),2040) MAXSET                                      DLSDAT     61
         GOTO 200                                                       DLSDAT     62
      ENDIF                                                             DLSDAT     63
C                                                                       DLSDAT     64
      NAUT=NAUT+1                                                       DLSDAT     65
      NAUTB=NAUTB+2                                                     DLSDAT     66
      NAUBUS(NAUTB-1)=NLFI                                              DLSDAT     67
      NAUBUS(NAUTB)=NLFJ                                                DLSDAT     68
      LRTEMP=LRTEMP+1                                                   DLSDAT     69
      IDATPT(LRTEMP)=JLNA                                               DLSDAT     70
C                                                                       DLSDAT     71
      LDSTAT=0                                                          DLSDAT     72
      NPROG=MNEW(NLFI)                                                  DLSDAT     73
      IF(JBSTAT(NPROG).GT.2)LDSTAT=10                                   DLSDAT     74
      IF(LDSTAT.EQ.0)THEN                                               DLSDAT     75
      NPROG=MNEW(NLFJ)                                                  DLSDAT     76
      IF(JBSTAT(NPROG).GT.2)LDSTAT=10                                   DLSDAT     77
      ENDIF                                                             DLSDAT     78
      IADATA(JLNA+1)=LDSTAT                                             DLSDAT     79
      IADATA(JLNA+2)=NLFI                                               DLSDAT     80
      IADATA(JLNA+3)=NLFJ                                               DLSDAT     81
      CALL PACK(CID2,0,ICID)                                            DLSDAT     82
      IADATA(JLNA+4)=ICID                                               DLSDAT     83
      IADATA(JLNA+5)=IFLAG                                              DLSDAT     84
      IADATA(JLNA+6)=IOCF                                               DLSDAT     85
C                                                                       DLSDAT     86
      CALL GETLIN(IU54,CARD)                                            DLSDAT     87
      READ(CARD,2050) (ADATA(JLNA+J),J=8,14)                            DLSDAT     88
      JSWITC=JLNA+7                                                     DLSDAT     89
      JLNA=JLNA+22                                                      DLSDAT     90
      KSWITC=0                                                          DLSDAT     91
C                                                                       DLSDAT     92
C    READ IN THE REMOTE RELAYS                                          DLSDAT     93
C                                                                       DLSDAT     94
 150  CALL GETLIN(IU54,CARD)                                            DLSDAT     95
      IF(CARD(1:3).EQ.ESC)THEN                                          DLSDAT     96
         IADATA(JSWITC)=KSWITC                                          DLSDAT     97
      ELSE                                                              DLSDAT     98
         IF(CARD(1:3).EQ.MPI) CALL GETLIN(IU54,CARD1)                   DLSDAT     99
         CALL SWIDAT(CARD,CARD1,KSWITC,IEBK)                            DLSDAT    100
         GOTO 150                                                       DLSDAT    101
      ENDIF                                                             DLSDAT    102
      GOTO 110                                                          DLSDAT    103
C                                                                       DLSDAT    104
 200  IEBK=1                                                            DLSDAT    105
      MSG(2)=CARD1                                                      DLSDAT    106
      CALL PRTMSG(2)                                                    DLSDAT    107
      KSWITC=0                                                          DLSDAT    108
 115  CALL GETLIN(IU54,CARD)                                            DLSDAT    109
      IF(CARD(1:3).EQ.ESC) GOTO 110                                     DLSDAT    110
      GOTO 115                                                          DLSDAT    111
C                                                                       DLSDAT    112
 300  CONTINUE                                                          DLSDAT    113
      IF(LRTEMP.NE.LDLSO)THEN                                           DLSDAT    114
         LDLSO=LDLSO+1                                                  DLSDAT    115
         NDLSO=LRTEMP                                                   DLSDAT    116
      ELSE                                                              DLSDAT    117
         LDLSO=0                                                        DLSDAT    118
         NDLSO=0                                                        DLSDAT    119
      ENDIF                                                             DLSDAT    120
C                                                                       DLSDAT    121
      RETURN                                                            DLSDAT    122
C                                                                       DLSDAT    123
 2020 FORMAT(2A12,A2,3X,3I5)                                            DLSDAT    124
 2010 FORMAT(2I5,A2,3X,3I5)                                             DLSDAT    125
 2030 FORMAT(' *** ERROR  DOUBLE LENS SHAPE RELAY TRIPPING BUS',        DLSDAT    126
     &' NOT FOUND.')                                                    DLSDAT    127
 2040 FORMAT(' *** ERROR   RELAY SCHEME EXCEEDS THE LIMIT OF ',I3)      DLSDAT    128
 2050 FORMAT(8F10.5)                                                    DLSDAT    129
C                                                                       DLSDAT    130
      END                                                               DLSDAT    131
