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