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