CFPRIME DPAMON                                                          DPAMON      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
                                                                        DPAMON      3
      SUBROUTINE DPAMON(H)                                              DPAMON      4
CD                                                                      DPAMON      5
CD THIS SUBROUTINE CHECKS THE STATUS OF ALL THE POWER ANGLE             DPAMON      6
CD RELAYS.                                                              DPAMON      7
CD                                                                      DPAMON      8
CD ROUTINE INPUTS:                                                      DPAMON      9
CD                                                                      DPAMON     10
CD     H : IS THE INTEGRATION STEP SIZE IN SECONDS                      DPAMON     11
CD                                                                      DPAMON     12
      INCLUDE 'PARX.INS'                                                DPAMON     13
      INCLUDE 'CNPT.INS'                                                DPAMON     14
      INCLUDE 'CNAUTO.INS'                                              DPAMON     15
      INCLUDE 'CNIPTR.INS'                                              DPAMON     16
      INCLUDE 'CNSTN.INS'                                               DPAMON     17
      INCLUDE 'CNVOLT.INS'                                              DPAMON     18
      INCLUDE 'CNFLAG.INS'                                              DPAMON     19
      INCLUDE 'CNB4.INS'                                                DPAMON     20
      INCLUDE 'CNB19.INS'                                               DPAMON     21
      INCLUDE 'CNUNIT.INS'                                              DPAMON     22
C                                                                       DPAMON     23
      CHARACTER*2 CID                                                   DPAMON     24
      LOGICAL RESULT                                                    DPAMON     25
C                                                                       DPAMON     26
      COMPLEX VOLTK                                                     DPAMON     27
      DIMENSION VOLTX(2)                                                DPAMON     28
      EQUIVALENCE (VOLTK,VOLTX(1)),(VOLTX(1),VREAL),(VOLTX(2),VIMAG)    DPAMON     29
C                                                                       DPAMON     30
C                                                                       DPAMON     31
      LDEB=(JDEB(37).NE.0)                                              DPAMON     32
      DO 2400 I = LDPDA,NDPDA                                           DPAMON     33
      K=IDATPT(I)                                                       DPAMON     34
      ICD1 = IADATA(K+1)                                                DPAMON     35
      IF(ICD1.GT.9)GOTO 2400                                            DPAMON     36
      ICD4 = IADATA(K+7)                                                DPAMON     37
CD                                                                      DPAMON     38
CD    ICD IS A STATUS FLAG                                              DPAMON     39
CD                                                                      DPAMON     40
CD     IF ICD1 = 4,BOTH LOCAL AND REMOTE TRIPPED                        DPAMON     41
CD                                                                      DPAMON     42
       IF(ICD1 .EQ. 4)GOTO 2400                                         DPAMON     43
CD                                                                      DPAMON     44
CD     IF ICD1 = 3, LOCAL LINE TRIPPED AND REMOTE TRIPPING IN PROGRESS  DPAMON     45
CD                                                                      DPAMON     46
      IF(ICD1 .EQ. 3) GO TO 2250                                        DPAMON     47
C                                                                       DPAMON     48
CD     IF ICD1 = 2 TRIP CONDITION MEET BREAKER TIMER STARTED            DPAMON     49
CD                                                                      DPAMON     50
CD     IF ICD1= 1 RELAY IN OPERATION MODE                               DPAMON     51
CD                                                                      DPAMON     52
CD     IF ICD1 = 0 RELAY IN STANDBY MODE                                DPAMON     53
CD                                                                      DPAMON     54
C                                                                       DPAMON     55
      IBUS = IADATA(K+2)                                                DPAMON     56
      JBUS = IADATA(K+3)                                                DPAMON     57
      ITFK = IADATA(K+4)                                                DPAMON     58
      CALL UNPACK(CID,JJJ,ITFK)                                         DPAMON     59
      IABUS= IADATA(K+5)                                                DPAMON     60
      NLFI = NOLD(IBUS)                                                 DPAMON     61
      NLFJ = NOLD(JBUS)                                                 DPAMON     62
      NLFA = NOLD(IABUS)                                                DPAMON     63
      NI3 = IBUS * 3                                                    DPAMON     64
      NJ3 = JBUS * 3                                                    DPAMON     65
      NA3 = IABUS * 3                                                   DPAMON     66
C                                                                       DPAMON     67
      IF(ICD1 .EQ. 2)GO TO 2150                                         DPAMON     68
C                                                                       DPAMON     69
      VOLTK=VOLT(IBUS)                                                  DPAMON     70
      EI = VREAL                                                        DPAMON     71
      FI = VIMAG                                                        DPAMON     72
      VOLTK=VOLT(JBUS)                                                  DPAMON     73
      EJ = VREAL                                                        DPAMON     74
      FJ = VIMAG                                                        DPAMON     75
      GIJ = ADATA(K+32)                                                 DPAMON     76
      BIJ = ADATA(K+33)                                                 DPAMON     77
      GIO = ADATA(K+34)                                                 DPAMON     78
      BIO = ADATA(K+35)                                                 DPAMON     79
      GT = GIO + GIJ                                                    DPAMON     80
      BT = BIO+BIJ                                                      DPAMON     81
C * * *                                                                 DPAMON     82
C * * * CALCULATE POWER FLOW ON LINE CONTAINING RELAY                   DPAMON     83
C * * *                                                                 DPAMON     84
      C1R = EI*GT - FI*BT                                               DPAMON     85
      C1I = EI*BT + FI*GT                                               DPAMON     86
      C2R = EJ*GIJ - FJ*BIJ                                             DPAMON     87
      C2I = EJ*BIJ + FJ*GIJ                                             DPAMON     88
      CTR = C1R-C2R                                                     DPAMON     89
      CTI = C1I - C2I                                                   DPAMON     90
      PI = EI*CTR + FI*CTI                                              DPAMON     91
C                                                                       DPAMON     92
C   CALCULATE BUS ANGLE                                                 DPAMON     93
C                                                                       DPAMON     94
      VOLTK=VOLT(IABUS)                                                 DPAMON     95
      EJ = VREAL                                                        DPAMON     96
      FJ = VIMAG                                                        DPAMON     97
      ANGLE=0.0                                                         DPAMON     98
      IF(EJ.NE.0.0)ANGLE=ATAN2(FJ,EJ)*57.2958                           DPAMON     99
      IF(ANGLE.LT.0.0)ANGLE=ANGLE+360                                   DPAMON    100
C                                                                       DPAMON    101
C  DELTA P DELTA ANGLE LOGIC ( DPDARE MODEL )                           DPAMON    102
C                                                                       DPAMON    103
C         The main modeling logic                                       DPAMON    104
C                                                                       DPAMON    105
      IF (ICD1 .EQ. 0.)THEN                                             DPAMON    106
         POWERP=ADATA(K+21)+ADATA(K+9)                                  DPAMON    107
         POWERM=ADATA(K+21)-ADATA(K+9)                                  DPAMON    108
C                                                                       DPAMON    109
         RESULT=ADATA(K+8).EQ.1. .AND. PI .GT. POWERP                   DPAMON    110
     #   .OR.   ADATA(K+8).EQ.2. .AND. PI .LT. POWERM                   DPAMON    111
     #   .OR.   ADATA(K+8).EQ.3. .AND. PI .GT. POWERP                   DPAMON    112
     #   .OR.   ADATA(K+8).EQ.4. .AND. PI .LT. POWERM                   DPAMON    113
     #   .OR.  ADATA(K+13).EQ.1. .AND. PI .GT. POWERP                   DPAMON    114
     #   .OR.  ADATA(K+13).EQ.2. .AND. PI .LT. POWERM                   DPAMON    115
     #   .OR.  ADATA(K+13).EQ.3. .AND. PI .GT. POWERP                   DPAMON    116
     #   .OR.  ADATA(K+13).EQ.4. .AND. PI .LT. POWERM                   DPAMON    117
         IF (RESULT)THEN                                                DPAMON    118
           IADATA(K+1) = 1                                              DPAMON    119
           ADATA(K+23) = TS+ADATA(K+19)-.5*H                            DPAMON    120
           WRITE (IU6, 7000) NLFI, INAME(NI3 - 2), INAME(NI3 - 1),      DPAMON    121
     +                       INAME(NI3), NLFJ, INAME(NJ3 - 2),          DPAMON    122
     +                       INAME(NJ3 - 1), INAME(NJ3), CID,           DPAMON    123
     +                       NLFA, INAME(NA3 - 2), INAME(NA3 - 1),      DPAMON    124
     +                       INAME(NA3)                                 DPAMON    125
           WRITE (IU6, 7100) TS                                         DPAMON    126
         ENDIF                                                          DPAMON    127
      ENDIF                                                             DPAMON    128
C                                                                       DPAMON    129
C      RELAY MODE INDICATOR = OPERATION                                 DPAMON    130
C                                                                       DPAMON    131
      IF (IADATA(K+1) .EQ. 1)THEN                                       DPAMON    132
C                                                                       DPAMON    133
C        1)  When trip blocking TSr expires, turn trip block TSr flag onDPAMON    134
C                                                                       DPAMON    135
         IF (TS .GE. ADATA(K+23))  ADATA(K+24) = 1.                     DPAMON    136
C                                                                       DPAMON    137
C        Test power comparators                                         DPAMON    138
C                                                                       DPAMON    139
         POWERM=ADATA(K+21)-ADATA(K+10)                                 DPAMON    140
         POWERP=ADATA(K+21)+ADATA(K+10)                                 DPAMON    141
C                                                                       DPAMON    142
         RESULT=ADATA(K+8) .EQ. 1. .AND. PI .GT. POWERP                 DPAMON    143
     #     .OR. ADATA(K+8) .EQ. 2. .AND. PI .LT. POWERM                 DPAMON    144
     #     .OR. ADATA(K+8) .EQ. 3. .AND. PI .GT. POWERP                 DPAMON    145
     #     .OR. ADATA(K+8) .EQ. 4. .AND. PI .LT. POWERM                 DPAMON    146
C                                                                       DPAMON    147
C        POWER COMPARATOR FLAG CLASS X = TRIP X                         DPAMON    148
C                                                                       DPAMON    149
         IF (RESULT .AND. ADATA(K+26) .EQ. 0.)THEN                      DPAMON    150
           ADATA(K+26) = 1.                                             DPAMON    151
           WRITE (IU6, 7000) NLFI, INAME(NI3 - 2), INAME(NI3 - 1),      DPAMON    152
     +                       INAME(NI3), NLFJ, INAME(NJ3 - 2),          DPAMON    153
     +                       INAME(NJ3 - 1), INAME(NJ3), CID,           DPAMON    154
     +                       NLFA, INAME(NA3 - 2), INAME(NA3 - 1),      DPAMON    155
     +                       INAME(NA3)                                 DPAMON    156
           WRITE (IU6, 7200) TS                                         DPAMON    157
         ENDIF                                                          DPAMON    158
C                                                                       DPAMON    159
C        POWER COMPARATOR FLAG CLASS X = OFF                            DPAMON    160
C                                                                       DPAMON    161
         IF ((.NOT. RESULT) .AND. ADATA(K+26) .EQ. 1.)THEN              DPAMON    162
           ADATA(K+26) = 0.                                             DPAMON    163
           WRITE (IU6, 7000) NLFI, INAME(NI3 - 2), INAME(NI3 - 1),      DPAMON    164
     +                       INAME(NI3), NLFJ, INAME(NJ3 - 2),          DPAMON    165
     +                       INAME(NJ3 - 1), INAME(NJ3), CID,           DPAMON    166
     +                       NLFA, INAME(NA3 - 2), INAME(NA3 - 1),      DPAMON    167
     +                       INAME(NA3)                                 DPAMON    168
           WRITE (IU6, 7300) TS                                         DPAMON    169
         ENDIF                                                          DPAMON    170
C                                                                       DPAMON    171
         POWERP=ADATA(K+21)+ADATA(K+15)                                 DPAMON    172
         POWERM=ADATA(K+21)-ADATA(K+15)                                 DPAMON    173
C                                                                       DPAMON    174
         RESULT = ADATA(K+13).EQ.1. .AND. PI .GT. POWERP                DPAMON    175
     #    .OR.    ADATA(K+13).EQ.2. .AND. PI .LT. POWERM                DPAMON    176
     #    .OR.    ADATA(K+13).EQ.3. .AND. PI .GT. POWERP                DPAMON    177
     #    .OR.    ADATA(K+13).EQ.4. .AND. PI .LT. POWERM                DPAMON    178
C                                                                       DPAMON    179
C        POWER COMPARATOR FLAG CLASS Y = TRIP Y                         DPAMON    180
C                                                                       DPAMON    181
         IF (RESULT .AND. ADATA(K+29) .EQ. 0.)THEN                      DPAMON    182
           ADATA(K+29) = 1.                                             DPAMON    183
           WRITE (IU6, 7000) NLFI, INAME(NI3 - 2), INAME(NI3 - 1),      DPAMON    184
     +                       INAME(NI3), NLFJ, INAME(NJ3 - 2),          DPAMON    185
     +                       INAME(NJ3 - 1), INAME(NJ3), CID,           DPAMON    186
     +                       NLFA, INAME(NA3 - 2), INAME(NA3 - 1),      DPAMON    187
     +                       INAME(NA3)                                 DPAMON    188
           WRITE (IU6, 7400) TS                                         DPAMON    189
         ENDIF                                                          DPAMON    190
C                                                                       DPAMON    191
C        POWER COMPARATOR FLAG CLASS Y = OFF                            DPAMON    192
C                                                                       DPAMON    193
         IF ((.NOT. RESULT) .AND. ADATA(K+29) .EQ. 1.)THEN              DPAMON    194
           ADATA(K+29) = 0.                                             DPAMON    195
           WRITE (IU6, 7000) NLFI, INAME(NI3 - 2), INAME(NI3 - 1),      DPAMON    196
     +                       INAME(NI3), NLFJ, INAME(NJ3 - 2),          DPAMON    197
     +                       INAME(NJ3 - 1), INAME(NJ3), CID,           DPAMON    198
     +                       NLFA, INAME(NA3 - 2), INAME(NA3 - 1),      DPAMON    199
     +                       INAME(NA3)                                 DPAMON    200
           WRITE (IU6, 7500) TS                                         DPAMON    201
         ENDIF                                                          DPAMON    202
C                                                                       DPAMON    203
C        3)  TEST ANGLE COMPARATORS                                     DPAMON    204
C                                                                       DPAMON    205
C        ANGLE COMPARATOR FLAG X .NE. ANGLE X                           DPAMON    206
C                                                                       DPAMON    207
         IF (ADATA(K+27) .NE. 2.)THEN                                   DPAMON    208
           ANGLEP = ADATA(K+22)+ADATA(K+11)                             DPAMON    209
           ANGLEM = ADATA(K+22)-ADATA(K+11)                             DPAMON    210
           RESULT = ADATA(K+8).EQ.1. .AND. ANGLE .LT. ANGLEM .OR.       DPAMON    211
     #              ADATA(K+8).EQ.2. .AND. ANGLE .GT. ANGLEP .OR.       DPAMON    212
     #              ADATA(K+8).EQ.3. .AND. ANGLE .GT. ANGLEP .OR.       DPAMON    213
     #              ADATA(K+8).EQ.4. .AND. ANGLE .LT. ANGLEM            DPAMON    214
           IF (RESULT)THEN                                              DPAMON    215
C                                                                       DPAMON    216
C          ANGLE COMP. X .NE. ANGLE X                                   DPAMON    217
C                                                                       DPAMON    218
              IF (ADATA(K+27) .EQ. 0.)THEN                              DPAMON    219
                 ADATA(K+27) = 1.                                       DPAMON    220
                 ADATA(K+25) = TS+ADATA(K+12)-.5*H                      DPAMON    221
                 WRITE (IU6, 7000) NLFI, INAME(NI3 - 2),                DPAMON    222
     +                  INAME(NI3 - 1), INAME(NI3), NLFJ,               DPAMON    223
     +                  INAME(NJ3 - 2), INAME(NJ3 - 1), INAME(NJ3),     DPAMON    224
     +                  CID, NLFA, INAME(NA3 - 2),                      DPAMON    225
     +                  INAME(NA3 - 1), INAME(NA3)                      DPAMON    226
                 WRITE (IU6, 7600) TS                                   DPAMON    227
              ELSE                                                      DPAMON    228
                 IF (TS .GE. ADATA(K+25))ADATA(K+27)=2.0                DPAMON    229
              ENDIF                                                     DPAMON    230
           ELSE                                                         DPAMON    231
C                                                                       DPAMON    232
C      ANGLE COMPARATOR FLAG X = OFF                                    DPAMON    233
C                                                                       DPAMON    234
              IF (ADATA(K+27) .NE. 0.) THEN                             DPAMON    235
                ADATA(K+27) = 0.                                        DPAMON    236
                WRITE (IU6, 7000) NLFI, INAME(NI3 - 2), INAME(NI3 - 1), DPAMON    237
     +                            INAME(NI3), NLFJ, INAME(NJ3 - 2),     DPAMON    238
     +                            INAME(NJ3 - 1), INAME(NJ3), CID,      DPAMON    239
     +                            NLFA, INAME(NA3 - 2), INAME(NA3 - 1), DPAMON    240
     +                            INAME(NA3)                            DPAMON    241
                WRITE (IU6, 7700) TS                                    DPAMON    242
              ENDIF                                                     DPAMON    243
C                                                                       DPAMON    244
           ENDIF                                                        DPAMON    245
C                                                                       DPAMON    246
         ENDIF                                                          DPAMON    247
C                                                                       DPAMON    248
C  ! ANGLE COMPARATOR FLAG Y .NE. ANGLE Y                               DPAMON    249
C                                                                       DPAMON    250
         IF (ADATA(K+30) .NE. 2.)THEN                                   DPAMON    251
            POWERP=ADATA(K+22)+ADATA(K+16)                              DPAMON    252
            POWERM=ADATA(K+22)-ADATA(K+16)                              DPAMON    253
C                                                                       DPAMON    254
            RESULT = ADATA(K+13).EQ.1. .AND. ANGLE .LT. POWERM          DPAMON    255
     #       .OR.    ADATA(K+13).EQ.2. .AND. ANGLE .GT. POWERP          DPAMON    256
     #       .OR.    ADATA(K+13).EQ.3. .AND. ANGLE .GT. POWERP          DPAMON    257
     #       .OR.    ADATA(K+13).EQ.4. .AND. ANGLE .LT. POWERM          DPAMON    258
C                                                                       DPAMON    259
            IF(RESULT)THEN                                              DPAMON    260
C                                                                       DPAMON    261
              IF (ADATA(K+30) .EQ. 0.)THEN                              DPAMON    262
                ADATA(K+30) = 1.                                        DPAMON    263
                ADATA(K+28) = TS+ADATA(K+17)-.5*H                       DPAMON    264
                WRITE (IU6, 7000) NLFI, INAME(NI3 - 2),                 DPAMON    265
     +                 INAME(NI3 - 1), INAME(NI3), NLFJ,                DPAMON    266
     +                 INAME(NJ3 - 2), INAME(NJ3 - 1), INAME(NJ3),      DPAMON    267
     +                 CID, NLFA, INAME(NA3 - 2),                       DPAMON    268
     +                 INAME(NA3 - 1), INAME(NA3)                       DPAMON    269
                WRITE (IU6, 7800) TS                                    DPAMON    270
              ELSE                                                      DPAMON    271
                IF (TS .GE. ADATA(K+28))ADATA(K+30) = 2.                DPAMON    272
              ENDIF                                                     DPAMON    273
C                                                                       DPAMON    274
            ELSE                                                        DPAMON    275
C                                                                       DPAMON    276
C           ANGLE COMPARATOR FLAG Y = OFF                               DPAMON    277
C                                                                       DPAMON    278
              IF(ADATA(K+30) .NE. 0.) THEN                              DPAMON    279
                ADATA(K+30) = 0.                                        DPAMON    280
                WRITE (IU6, 7000) NLFI, INAME(NI3 - 2), INAME(NI3 - 1), DPAMON    281
     +                            INAME(NI3), NLFJ, INAME(NJ3 - 2),     DPAMON    282
     +                            INAME(NJ3 - 1), INAME(NJ3), CID,      DPAMON    283
     +                            NLFA, INAME(NA3 - 2), INAME(NA3 - 1), DPAMON    284
     +                            INAME(NA3)                            DPAMON    285
                WRITE (IU6, 7900) TS                                    DPAMON    286
             ENDIF                                                      DPAMON    287
C                                                                       DPAMON    288
            ENDIF                                                       DPAMON    289
C                                                                       DPAMON    290
         ENDIF                                                          DPAMON    291
C                                                                       DPAMON    292
C        4)  SIMULATE THE "AND" GATE FOR THE TRIPPING CONDITION         DPAMON    293
C                                                                       DPAMON    294
         RESULT = ADATA(K+24).EQ.1. .AND. ADATA(K+26).EQ.1.             DPAMON    295
     #            .AND. ADATA(K+27).EQ.2.                               DPAMON    296
C                                                                       DPAMON    297
C        CLASS X  CONDITONS SATISFIED                                   DPAMON    298
C                                                                       DPAMON    299
         IF (RESULT) THEN                                               DPAMON    300
C                                                                       DPAMON    301
C        RELAY MODE = 3 TRIP CONDITIONS MET                             DPAMON    302
C                                                                       DPAMON    303
            IADATA(K+1) = 2                                             DPAMON    304
            ADATA(K+31) = TS+ADATA(K+20)-.5*H                           DPAMON    305
            WRITE (IU6, 7000) NLFI, INAME(NI3 - 2), INAME(NI3 - 1),     DPAMON    306
     +                        INAME(NI3), NLFJ, INAME(NJ3 - 2),         DPAMON    307
     +                        INAME(NJ3 - 1), INAME(NJ3), CID,          DPAMON    308
     +                        NLFA, INAME(NA3 - 2), INAME(NA3 - 1),     DPAMON    309
     +                        INAME(NA3)                                DPAMON    310
            WRITE (IU6, 8000) TS                                        DPAMON    311
         ENDIF                                                          DPAMON    312
C                                                                       DPAMON    313
C        CLASS Y  CONDITIONS SATISFIED                                  DPAMON    314
C                                                                       DPAMON    315
         RESULT = ADATA(K+24) .EQ.1. .AND. ADATA(K+29).EQ.1.            DPAMON    316
     #            .AND. ADATA(K+30).EQ.2.                               DPAMON    317
C                                                                       DPAMON    318
         IF (RESULT)THEN                                                DPAMON    319
            IADATA(K+1) = 2                                             DPAMON    320
            ADATA(K+31) = TS+ADATA(K+20)-.5*H                           DPAMON    321
            WRITE (IU6, 7000) NLFI, INAME(NI3 - 2), INAME(NI3 - 1),     DPAMON    322
     +                        INAME(NI3), NLFJ, INAME(NJ3 - 2),         DPAMON    323
     +                        INAME(NJ3 - 1), INAME(NJ3), CID,          DPAMON    324
     +                        NLFA, INAME(NA3 - 2), INAME(NA3 - 1),     DPAMON    325
     +                        INAME(NA3)                                DPAMON    326
            WRITE (IU6, 8100) TS                                        DPAMON    327
         ENDIF                                                          DPAMON    328
C                                                                       DPAMON    329
C                                                                       DPAMON    330
C        TRIP CONDITIONS MET, START LOCAL AND REMOTE BREAKER TIMERS     DPAMON    331
C                                                                       DPAMON    332
         IF(IADATA(K+1).EQ.2)THEN                                       DPAMON    333
            IF(ICD4.NE.0)THEN                                           DPAMON    334
              KADD=K+36                                                 DPAMON    335
              CALL RTIMER(KADD,ICD4)                                    DPAMON    336
            ENDIF                                                       DPAMON    337
         ENDIF                                                          DPAMON    338
C                                                                       DPAMON    339
C                                                                       DPAMON    340
C     ENDIF FOR THE OPERATION MODE                                      DPAMON    341
C                                                                       DPAMON    342
      ENDIF                                                             DPAMON    343
C                                                                       DPAMON    344
C     TRIP CONDITIONS MET                                               DPAMON    345
C                                                                       DPAMON    346
 2150 CONTINUE                                                          DPAMON    347
C                                                                       DPAMON    348
      IF (IADATA(K+1) .EQ. 2)THEN                                       DPAMON    349
C                                                                       DPAMON    350
C                                                                       DPAMON    351
C         RELAY MODE = LINE WOULD HAVE TRIPPED                          DPAMON    352
C                                                                       DPAMON    353
         IF (TS .GE. ADATA(K+31))THEN                                   DPAMON    354
C                                                                       DPAMON    355
           IADATA(K+1) = 3                                              DPAMON    356
           IF(IADATA(K+6).EQ.0)THEN                                     DPAMON    357
              WRITE (IU6, 7000) NLFI, INAME(NI3 - 2), INAME(NI3 - 1),   DPAMON    358
     +                          INAME(NI3), NLFJ, INAME(NJ3 - 2),       DPAMON    359
     +                          INAME(NJ3 - 1), INAME(NJ3), CID,        DPAMON    360
     +                          NLFA, INAME(NA3 - 2), INAME(NA3 - 1),   DPAMON    361
     +                          INAME(NA3)                              DPAMON    362
              WRITE (IU6, 8200) TS                                      DPAMON    363
           ELSE                                                         DPAMON    364
C                                                                       DPAMON    365
C           RELAY MODE INDICATOR = LINE TRIPPED                         DPAMON    366
C           GET THE LINE INFORMATION AND WRITE INTO IU12                DPAMON    367
C                                                                       DPAMON    368
            NJSELI=IADATA(K+36)                                         DPAMON    369
C                                                                       DPAMON    370
            IF(IASWX.EQ.0)THEN                                          DPAMON    371
              WRITE(ISWFA,1100)TS                                       DPAMON    372
              NAWR=NAWR+1                                               DPAMON    373
              IASWX=1                                                   DPAMON    374
            ENDIF                                                       DPAMON    375
C                                                                       DPAMON    376
            WRITE (IU6, 7000) NLFI, INAME(NI3 - 2), INAME(NI3 - 1),     DPAMON    377
     +                        INAME(NI3), NLFJ, INAME(NJ3 - 2),         DPAMON    378
     +                        INAME(NJ3 - 1), INAME(NJ3), CID,          DPAMON    379
     +                        NLFA, INAME(NA3 - 2), INAME(NA3 - 1),     DPAMON    380
     +                        INAME(NA3)                                DPAMON    381
            WRITE (IU6, 8300) TS                                        DPAMON    382
C                                                                       DPAMON    383
            IF(NJSELI.NE.0)THEN                                         DPAMON    384
              WRITE(ISWFA,1200)IBUS,JBUS,CID                            DPAMON    385
            ELSE                                                        DPAMON    386
              WRITE(ISWFA,1300)IBUS,JBUS,CID                            DPAMON    387
            ENDIF                                                       DPAMON    388
            NAWR=NAWR+1                                                 DPAMON    389
C                                                                       DPAMON    390
           ENDIF                                                        DPAMON    391
C                                                                       DPAMON    392
         ENDIF                                                          DPAMON    393
C                                                                       DPAMON    394
      ENDIF                                                             DPAMON    395
C                                                                       DPAMON    396
C                                                                       DPAMON    397
C       ICD4 IS THE NUMBER OF REMOTE RELAYS ATTACHED TO THIS LOCAL      DPAMON    398
C       RELAY.  TTIMR1 IS THE TRANSFER TRIP TIMER.                      DPAMON    399
C                                                                       DPAMON    400
 2250 IF(ICD4.EQ.0) GO TO 2350                                          DPAMON    401
       IF(IADATA(K+1).GE.2)THEN                                         DPAMON    402
         KADD=K+36                                                      DPAMON    403
         KBUS=K                                                         DPAMON    404
         IPOINT=18                                                      DPAMON    405
C                                                                       DPAMON    406
C   CALL RETRIP TO PROCESS REMOTE RELAY LOGIC                           DPAMON    407
C                                                                       DPAMON    408
         CALL RETRIP(KADD,KBUS,ICD4,IPOINT)                             DPAMON    409
         IF(IADATA(KBUS+IPOINT).EQ.-1)THEN                              DPAMON    410
           IADATA(K+1)=4                                                DPAMON    411
         ENDIF                                                          DPAMON    412
       ENDIF                                                            DPAMON    413
C                                                                       DPAMON    414
 2350 CONTINUE                                                          DPAMON    415
 2400 CONTINUE                                                          DPAMON    416
      RETURN                                                            DPAMON    417
 1100   FORMAT(F10.5)                                                   DPAMON    418
 1200   FORMAT('DPIA',2I5,1X,A2)                                        DPAMON    419
 1300   FORMAT('DLIA',2I5,1X,A2)                                        DPAMON    420
C                                                                       DPAMON    421
7000    FORMAT (' *** DPDA CIRCUIT FROM: ', I6, 1X, 3A4, '  TO: ',      DPAMON    422
     +          I6, 1X, 3A4, '  ID: ', A2, /,                           DPAMON    423
     +          '             ANGLE BUS: ', I6, 1X, 3A4)                DPAMON    424
7100    FORMAT ('     SET TO OPERATING MODE AT TIME = ', F8.4)          DPAMON    425
7200    FORMAT ('     CLASS-X DP TRIP CONDITION IS SATISFIED AT ',      DPAMON    426
     +          'TIME = ', F8.4)                                        DPAMON    427
7300    FORMAT ('     CLASS-X DP TRIP CONDITION IS RESET AT ',          DPAMON    428
     +          'TIME = ', F8.4)                                        DPAMON    429
7400    FORMAT ('     CLASS-Y DP TRIP CONDITION IS SATISFIED AT ',      DPAMON    430
     +          'TIME = ', F8.4)                                        DPAMON    431
7500    FORMAT ('     CLASS-Y DP TRIP CONDITION IS RESET AT ',          DPAMON    432
     +          'TIME = ', F8.4)                                        DPAMON    433
7600    FORMAT ('     CLASS-X DA TRIP CONDITION IS SATISFIED AT ',      DPAMON    434
     +          'TIME = ', F8.4)                                        DPAMON    435
7700    FORMAT ('     CLASS-X DA TRIP CONDITION IS RESET AT ',          DPAMON    436
     +          'TIME = ', F8.4)                                        DPAMON    437
7800    FORMAT ('     CLASS-Y DA TRIP CONDITION IS SATISFIED AT ',      DPAMON    438
     +          'TIME = ', F8.4)                                        DPAMON    439
7900    FORMAT ('     CLASS-Y DA TRIP CONDITION IS RESET AT ',          DPAMON    440
     +          'TIME = ', F8.4)                                        DPAMON    441
8000    FORMAT ('     CLASS-X BREAKER TIMER STARTED AT TIME = ', F8.4)  DPAMON    442
8100    FORMAT ('     CLASS-Y BREAKER TIMER STARTED AT TIME = ', F8.4)  DPAMON    443
8200    FORMAT ('     *** MONITOR ONLY ***', /,                         DPAMON    444
     +          '     WOULD HAVE TRIPPED AT TIME = ', F8.4)             DPAMON    445
8300    FORMAT ('     TRIPPED AT TIME = ', F8.4)                        DPAMON    446
C                                                                       DPAMON    447
        END                                                             DPAMON    448
