CFPRIME RECLSE                                                          RECLSE      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 RECLSE(H)                                              RECLSE      3
CD                                                                      RECLSE      4
CD    THIS SUBROUTINE ACTIVATES THE AUTO LINE RECLOSING LOGIC.          RECLSE      5
CD                                                                      RECLSE      6
      INCLUDE 'PARX.INS'                                                RECLSE      7
      INCLUDE 'CNPT.INS'                                                RECLSE      8
      INCLUDE 'CNB4.INS'                                                RECLSE      9
      INCLUDE 'CNAUTO.INS'                                              RECLSE     10
      INCLUDE 'CNFLAG.INS'                                              RECLSE     11
      INCLUDE 'CNUNIT.INS'                                              RECLSE     12
C                                                                       RECLSE     13
      INTEGER NRCLSE(MAXCHM*5)                                          RECLSE     14
      EQUIVALENCE(RCLSE(1),NRCLSE(1))                                   RECLSE     15
C                                                                       RECLSE     16
      INTEGER*4 ITFK                                                    RECLSE     17
      INTEGER*2 IFRTO(2)                                                RECLSE     18
      CHARACTER*2 ICKT                                                  RECLSE     19
      EQUIVALENCE (ITFK,IFRTO(1),ICKT)                                  RECLSE     20
C                                                                       RECLSE     21
      LDEB=.FALSE.                                                      RECLSE     22
C      LDEB=(JDEB(37))                                                  RECLSE     23
C                                                                       RECLSE     24
      DO 100 I=1,NDLR                                                   RECLSE     25
      IK=I*5                                                            RECLSE     26
      ITFK=NRCLSE(IK-2)                                                 RECLSE     27
      IRCLSE=IFRTO(2)                                                   RECLSE     28
C                                                                       RECLSE     29
      IF(IRCLSE.EQ.1)THEN                                               RECLSE     30
       IF(RCLSE(IK).LE.(TS+H) )THEN                                     RECLSE     31
        IBUS=NRCLSE(IK-4)                                               RECLSE     32
        JBUS=NRCLSE(IK-3)                                               RECLSE     33
        NJSELI=NRCLSE(IK-1)                                             RECLSE     34
        IFRTO(2)=2                                                      RECLSE     35
        NRCLSE(IK-2)=ITFK                                               RECLSE     36
C                                                                       RECLSE     37
       IF(IASWX.EQ.0)THEN                                               RECLSE     38
        WRITE(ISWFA,1100)TS                                             RECLSE     39
        NAWR=NAWR+1                                                     RECLSE     40
        IASWX=1                                                         RECLSE     41
       ENDIF                                                            RECLSE     42
C                                                                       RECLSE     43
       IF(NJSELI.NE.0)THEN                                              RECLSE     44
        WRITE(ISWFA,1200)IBUS,JBUS,ICKT                                 RECLSE     45
       ELSE                                                             RECLSE     46
        WRITE(ISWFA,1300)IBUS,JBUS,ICKT                                 RECLSE     47
       ENDIF                                                            RECLSE     48
        NAWR=NAWR+1                                                     RECLSE     49
        ENDIF                                                           RECLSE     50
       ENDIF                                                            RECLSE     51
 100    CONTINUE                                                        RECLSE     52
C        NDLR=NDLR-K1                                                   RECLSE     53
      RETURN                                                            RECLSE     54
C                                                                       RECLSE     55
 1100   FORMAT(F10.5)                                                   RECLSE     56
 1200   FORMAT('RPIA',2I5,1X,2A2)                                       RECLSE     57
 1300   FORMAT('RLIA',2I5,1X,2A2)                                       RECLSE     58
      END                                                               RECLSE     59
