CFPRIME SLBINT                                                          SLBINT      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 SLBINT(IEBK)                                           SLBINT      3
CD                                                                      SLBINT      4
CD    THIS SUBROUTINE INTIALIZES THE LINE BLINDER OUT-OF-STEP           SLBINT      5
CD    RELAY. IT ALSO SEARCHES THE REMOTE RELAY TABLES TO FIND THE       SLBINT      6
CD    INDICES OF THE REMOTE RELAYS CONTROL BY FOR THIS RELAY.           SLBINT      7
CD                                                                      SLBINT      8
CD     LSLBOR           Starting position of IDATPT array  of SLBO relaySLBINT      9
CD                     scheme, LSLBOR  is in the common labelled PT of  SLBINT     10
CD                     include file CNPT.                               SLBINT     11
CD                                                                      SLBINT     12
CD     NSLBOR           Finishing position of IDATPT array of SLBO relaySLBINT     13
CD                     scheme, NSLBOR  is in common labelled AUTO of    SLBINT     14
CD                     include file CNAUTO.                             SLBINT     15
CD                                                                      SLBINT     16
      INCLUDE 'PARX.INS'                                                SLBINT     17
      INCLUDE 'CNPT.INS'                                                SLBINT     18
      INCLUDE 'CNAUTO.INS'                                              SLBINT     19
      INCLUDE 'CNNNEW.INS'                                              SLBINT     20
      INCLUDE 'CNSTN.INS'                                               SLBINT     21
      INCLUDE 'CNB19.INS'                                               SLBINT     22
      INCLUDE 'CNUNIT.INS'                                              SLBINT     23
      INCLUDE 'CNLFDA.INS'                                              SLBINT     24
      INCLUDE 'CNSELI.INS'                                              SLBINT     25
      INCLUDE 'CNMSG.INS'                                               SLBINT     26
C                                                                       SLBINT     27
      CHARACTER*2 ICKT,CKK                                              SLBINT     28
      INTEGER*4 ICID                                                    SLBINT     29
      DATA ANGCON/0.017453/                                             SLBINT     30
C                                                                       SLBINT     31
C     REORDER BUS NUMBERS IN DISTANCE RELAY TABLE                       SLBINT     32
C                                                                       SLBINT     33
      DO 1000 I=LSLBOR,NSLBOR                                           SLBINT     34
C                                                                       SLBINT     35
      K=IDATPT(I)                                                       SLBINT     36
C                                                                       SLBINT     37
      IF(IADATA(K+1).GT.9)GOTO 1000                                     SLBINT     38
C                                                                       SLBINT     39
      NLFI=IADATA(K+2)                                                  SLBINT     40
      NLFJ=IADATA(K+3)                                                  SLBINT     41
      NPROGI=NNEW(NLFI)                                                 SLBINT     42
      NPROGJ=NNEW(NLFJ)                                                 SLBINT     43
      IADATA(K+1)=1                                                     SLBINT     44
      IADATA(K+2)=NPROGI                                                SLBINT     45
      IADATA(K+3)=NPROGJ                                                SLBINT     46
      NI3=NPROGI*3                                                      SLBINT     47
      NJ3=NPROGJ*3                                                      SLBINT     48
      ICID=IADATA(K+4)                                                  SLBINT     49
      CALL UNPACK(ICKT,JJJ,ICID)                                        SLBINT     50
      IDRRR=IADATA(K+7)                                                 SLBINT     51
C                                                                       SLBINT     52
      CALL LOLINE(NPROGI,NPROGJ,ICKT,JNL)                               SLBINT     53
      IF(JNL.EQ.0)THEN                                                  SLBINT     54
       IEBK=1                                                           SLBINT     55
       WRITE(MSG(1),3220) NLFI,INAME(NI3-2),INAME(NI3-1),INAME(NI3)     SLBINT     56
       WRITE(MSG(2),3230)                                               SLBINT     57
     *    NLFJ,INAME(NJ3-2),INAME(NJ3-1),INAME(NJ3),ICKT                SLBINT     58
       CALL PRTMSG(2)                                                   SLBINT     59
       GOTO 1000                                                        SLBINT     60
      ENDIF                                                             SLBINT     61
C                                                                       SLBINT     62
C                                                                       SLBINT     63
C     LOAD THE LINE PARAMETER INTO STORAGE                              SLBINT     64
C                                                                       SLBINT     65
       JNL5=IABS(JNL)                                                   SLBINT     66
       JNL5=JNL5*5                                                      SLBINT     67
       ITFK=LFTB(JNL5-4)                                                SLBINT     68
       CALL UNPACK(CKK,NJSELI,ITFK)                                     SLBINT     69
       IADATA(K+28)=NJSELI                                              SLBINT     70
       IF(NJSELI.NE.0)THEN                                              SLBINT     71
        ADATA(K+24)=EQPI(1,NJSELI)                                      SLBINT     72
        ADATA(K+25)=EQPI(2,NJSELI)                                      SLBINT     73
        ADATA(K+26)=EQPI(3,NJSELI)                                      SLBINT     74
        ADATA(K+27)=EQPI(4,NJSELI)                                      SLBINT     75
       ELSE                                                             SLBINT     76
        ADATA(K+24)=GA(JNL5-2)                                          SLBINT     77
        ADATA(K+25)=BA(JNL5-1)                                          SLBINT     78
        ADATA(K+26)=0.                                                  SLBINT     79
        ADATA(K+27)=BCHG(JNL5)/2.                                       SLBINT     80
       ENDIF                                                            SLBINT     81
C                                                                       SLBINT     82
C    CONVERT CYCLE INTO SEC.                                            SLBINT     83
C                                                                       SLBINT     84
       ADATA(K+8)=ADATA(K+8)/FQBASE                                     SLBINT     85
       ADATA(K+16)=ADATA(K+16)/FQBASE                                   SLBINT     86
C                                                                       SLBINT     87
C   CONVERT DEG TO RAD                                                  SLBINT     88
C                                                                       SLBINT     89
       ADATA(K+9)=ADATA(K+9)*ANGCON                                     SLBINT     90
       ADATA(K+12)=ADATA(K+12)*ANGCON                                   SLBINT     91
       ADATA(K+20)=ADATA(K+20)*ANGCON                                   SLBINT     92
       ADATA(K+23)=ADATA(K+23)*ANGCON                                   SLBINT     93
C                                                                       SLBINT     94
C  INITIALIZE THE ZONE FLAG                                             SLBINT     95
C                                                                       SLBINT     96
       IADATA(K+31)=5                                                   SLBINT     97
C                                                                       SLBINT     98
C     IF THE NO. OF REMOTE TRIPPING SCHEME IS NON-ZERO THEN             SLBINT     99
C                                                                       SLBINT    100
      IF(IDRRR.NE.0)THEN                                                SLBINT    101
       KSHIFT=K+36                                                      SLBINT    102
       CALL REMINT(KSHIFT,IDRRR)                                        SLBINT    103
      ENDIF                                                             SLBINT    104
C                                                                       SLBINT    105
 1000 CONTINUE                                                          SLBINT    106
C                                                                       SLBINT    107
      RETURN                                                            SLBINT    108
 3220 FORMAT(' *** ERROR  LINE BETWEEN BUS: ',I5,' STATION: '           SLBINT    109
     *,3A4,' AND')                                                      SLBINT    110
 3230 FORMAT(14X,'BUS: ',I5,' STATION: ',3A4,' ID: ',A2                 SLBINT    111
     *,' CANNOT BE FOUND')                                              SLBINT    112
      END                                                               SLBINT    113
