CFPRIME BREAK                                                           BREAK       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  BREAK (JONE, JTWO)                                    BREAK       3
CD -------------------------------------------------------------------  BREAK       4
CD                                                                      BREAK       5
CD              *****     BREAK   ROUTINE   *****                       BREAK       6
CD                                                                      BREAK       7
CD -------------------------------------------------------------------  BREAK       8
CD                                                                      BREAK       9
CD       PURPOSE:  Temporarily removes the link to the wrong loop, so   BREAK      10
CD                 that the outer most loop may be found.               BREAK      11
CD                                                                      BREAK      12
CD                                                                      BREAK      13
CD       DEFINITION OF LOCAL VARIABLES:                                 BREAK      14
CD                 LAST   -  previous pointer.                          BREAK      15
CD                 NEXT   -  current pointer.                           BREAK      16
CD          (P)    JONE    -  first block of loop.                      BREAK      17
CD          (P)    JTWO    -  last block of loop.                       BREAK      18
CD                                                                      BREAK      19
CD -------------------------------------------------------------------  BREAK      20
      INCLUDE 'PARX.INS'                                                BREAK      21
      INCLUDE 'UDCA.INS'                                                BREAK      22
      INCLUDE 'UDCE.INS'                                                BREAK      23
      INCLUDE 'UDCH.INS'                                                BREAK      24
C                                                                       BREAK      25
C---------------------------------------------------------------------  BREAK      26
C     Remove JTWO as input to JONE.                                     BREAK      27
C                                                                       BREAK      28
      NEXT = INTOP(JONE)                                                BREAK      29
      LAST = NEXT                                                       BREAK      30
20    IF(NEXT.EQ.0) GOTO 40                                             BREAK      31
         IF(INNUM(NEXT).EQ.JTWO)THEN                                    BREAK      32
            IF(NEXT.EQ.INTOP(JONE))THEN                                 BREAK      33
               INTOP(JONE) = IPOINT(NEXT)                               BREAK      34
            ELSE                                                        BREAK      35
               IPOINT(LAST) = IPOINT(NEXT)                              BREAK      36
            END IF                                                      BREAK      37
            IPOINT(NEXT) = IFREE                                        BREAK      38
            IFREE = NEXT                                                BREAK      39
            NEXT = 0                                                    BREAK      40
         ELSE                                                           BREAK      41
            LAST = NEXT                                                 BREAK      42
            NEXT = IPOINT(NEXT)                                         BREAK      43
         END IF                                                         BREAK      44
         GOTO 20                                                        BREAK      45
40    CONTINUE                                                          BREAK      46
C                                                                       BREAK      47
C     Remove JONE as output of JTWO.                                    BREAK      48
C                                                                       BREAK      49
      NEXT = IOUTOP(JTWO)                                               BREAK      50
      LAST = NEXT                                                       BREAK      51
60    IF(NEXT.EQ.0) GOTO 80                                             BREAK      52
         IF(IOUTNU(NEXT).EQ.JONE)THEN                                   BREAK      53
            IF(NEXT.EQ.IOUTOP(JTWO))THEN                                BREAK      54
               IOUTOP(JTWO) = JOPOIN(NEXT)                              BREAK      55
            ELSE                                                        BREAK      56
               JOPOIN(LAST) = JOPOIN(NEXT)                              BREAK      57
            END IF                                                      BREAK      58
            JOPOIN(NEXT) = IFREE                                        BREAK      59
            IFREE = NEXT                                                BREAK      60
            NEXT = 0                                                    BREAK      61
         ELSE                                                           BREAK      62
            LAST = NEXT                                                 BREAK      63
            NEXT = JOPOIN(NEXT)                                         BREAK      64
         END IF                                                         BREAK      65
         GOTO 60                                                        BREAK      66
80    CONTINUE                                                          BREAK      67
C                                                                       BREAK      68
C---------------------------------------------------------------------  BREAK      69
C                                                                       BREAK      70
      RETURN                                                            BREAK      71
C                                                                       BREAK      72
C---------------------------------------------------------------------  BREAK      73
C                                                                       BREAK      74
      END                                                               BREAK      75
