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