CFPRIME MLNDAT                                                          MLNDAT      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 MLNDAT(IUX,IREC,IEBK)                                  MLNDAT      3
CD                                                                      MLNDAT      4
CD    TO READ MONITORED LINE DATA FROM FILE.                            MLNDAT      5
CD                                                                      MLNDAT      6
CD      IRD()    :  RELAY ID                                            MLNDAT      7
CD      LINMON(1):                                                      MLNDAT      8
CD      MLFTB(1) :  LINE TYPE | LINE STATUS                             MLNDAT      9
CD      MLFTB(2) :  (AFTER RENET) FROM BUS NUMBER | TO BUS NUMBER       MLNDAT     10
CD      MLFTB(6) :  (PRIOR TO RENET) FROM BUS LOADFLOW BUS NUMBER       MLNDAT     11
CD      MLFTB(7) :  (PRIOR TO RENET) TO BUS LOADFLOW BUS NUMBER         MLNDAT     12
CD                                                                      MLNDAT     13
CD      MACKT(3) :  SECTION # | CKT ID                                  MLNDAT     14
CD      MTYIRS(4):  SECTION LINE NUMBER | RELAY DATA FLAG               MLNDAT     15
CD                  RELAY DATA FLAG(IRS)                                MLNDAT     16
CD                     IRS=0:  RELAY TO BE CIRCLE WITH A REACH          MLNDAT     17
CD                             OF 125% OF THE LINE                      MLNDAT     18
CD                     IRS=1:  RELAY DATA FROM CARD                     MLNDAT     19
CD                     IRS=2:  RELAY DATA FROM RELAY DATA BASE          MLNDAT     20
CD      JRSKRS(5):  RELAY FLAG(JRS)                                     MLNDAT     21
CD                     JRS=0:  RELAY DIDN'T TRIP                        MLNDAT     22
CD                     JRS=1:  RELAY TRIPED                             MLNDAT     23
CD                     JRS=2:  RELAY TRIPED                             MLNDAT     24
CD                     JRS=3:  RELAY TRIPED                             MLNDAT     25
CD                  KRS                                                 MLNDAT     26
CD                     KRS= 3: RELAY DATA FROM PROGRAM                  MLNDAT     27
CD                     KRS= 2: RELAY DATA FROM CARD                     MLNDAT     28
CD                     KRS= 1: ERROR -- RELAY NOT IN DATA BASE          MLNDAT     29
CD                     KRS= (RELAY ID NO.)+10    SPECIFIED SETTING DATE MLNDAT     30
CD                     KRS= (RELAY ID NO.)+32768 NO SPECIFIED SETTING   MLNDAT     31
CD                                               DATE                   MLNDAT     32
CD      GLM(6)   :  R OF EQUIVALENT ADMITTANCE                          MLNDAT     33
CD      BLM(7)   :  X OF EQUIVALENT ADMITTANCE                          MLNDAT     34
CD      BLCF(8)  :  R OF SHUNT COMPONENT                                MLNDAT     35
CD      BLT(9)   :  X OF SHUNT COMPONENT                                MLNDAT     36
CD      RADX(10),KRADX(10):  RADIUS OF COMPOSITE CIRCLE                 MLNDAT     37
CD      RORIG(11):  R OF COMPOSITE CIRCLE CENTRE                        MLNDAT     38
CD      XORIG(12):  X OF COMPOSITE CIRCLE CENTRE                        MLNDAT     39
CD                                                                      MLNDAT     40
C                                                                       MLNDAT     41
      INCLUDE 'PARX.INS'                                                MLNDAT     42
      INCLUDE 'CNPT.INS'                                                MLNDAT     43
      INCLUDE 'CNMON.INS'                                               MLNDAT     44
      INCLUDE 'CNFLAG.INS'                                              MLNDAT     45
      INCLUDE 'CNPARX.INS'                                              MLNDAT     46
      INCLUDE 'CNUNIT.INS'                                              MLNDAT     47
      INCLUDE 'CNMSG.INS'                                               MLNDAT     48
      INCLUDE 'CNFRUN.INS'                                              MLNDAT     49
C                                                                       MLNDAT     50
      CHARACTER*4 IRADX(MONL*12),IRORIG(MONL*12),IXORIG(MONL*12)        MLNDAT     51
      EQUIVALENCE                                                       MLNDAT     52
     &(RADX(1),IRADX(1)),(RORIG(1),IRORIG(1)),(XORIG(1),IXORIG(1))      MLNDAT     53
      CHARACTER*4 KNAME1,KNAME2,KNAME3                                  MLNDAT     54
      CHARACTER*4 ICKT                                                  MLNDAT     55
      CHARACTER*80 CARD                                                 MLNDAT     56
      CHARACTER*12 BNAME1,BNAME2                                        MLNDAT     57
      CHARACTER*5 EDATA                                                 MLNDAT     58
      DATA EDATA/'EDATA'/                                               MLNDAT     59
C                                                                       MLNDAT     60
      LDEB=.FALSE.                                                      MLNDAT     61
C                                                                       MLNDAT     62
  100 CONTINUE                                                          MLNDAT     63
C                                                                       MLNDAT     64
C   READING MONITORED LINES                                             MLNDAT     65
C                                                                       MLNDAT     66
      IF(IUX.NE.0)THEN                                                  MLNDAT     67
        CALL GETLIN(IUX,CARD)                                           MLNDAT     68
      ELSE                                                              MLNDAT     69
        IF(IREC.EQ.0) RETURN                                            MLNDAT     70
        READ(IU56,REC=IREC) CARD                                        MLNDAT     71
        IREC=INXPTR(IREC)                                               MLNDAT     72
      ENDIF                                                             MLNDAT     73
      IF(CARD(1:5).EQ.EDATA) RETURN                                     MLNDAT     74
      LSTATU=0                                                          MLNDAT     75
      IF(KLFO.EQ.0)THEN                                                 MLNDAT     76
         READ(CARD,2000) NLFF,NLFT,ICKT                                 MLNDAT     77
     &       ,IRS,KNAME1,KNAME2,KNAME3,CCRAD,CCROR,CCXOR                MLNDAT     78
      ELSE                                                              MLNDAT     79
         READ(CARD,2010) BNAME1,BNAME2,ICKT                             MLNDAT     80
     &       ,IRS,KNAME1,KNAME2,KNAME3,CCRAD,CCROR,CCXOR                MLNDAT     81
         CALL CHKBUS(BNAME1,NLFF)                                       MLNDAT     82
         CALL CHKBUS(BNAME2,NLFT)                                       MLNDAT     83
C                                                                       MLNDAT     84
         IF(NLFF.EQ.0.OR.NLFT.EQ.0)THEN                                 MLNDAT     85
            LSTATU=10                                                   MLNDAT     86
            WRITE(MSG(1),2110)                                          MLNDAT     87
            CALL PRTMSG(1)                                              MLNDAT     88
         ENDIF                                                          MLNDAT     89
      ENDIF                                                             MLNDAT     90
      NPFL=NPFL+1                                                       MLNDAT     91
      NPFL12=NPFL*12                                                    MLNDAT     92
      IF(NPFL.GT.MXMONL) GOTO 100                                       MLNDAT     93
      MLFTB(NPFL12-11)=LSTATU                                           MLNDAT     94
      MLFTB(NPFL12-6) =NLFF                                             MLNDAT     95
      MLFTB(NPFL12-5) =NLFT                                             MLNDAT     96
      CALL PACK(ICKT(1:2),0,JCKID)                                      MLNDAT     97
      MACKT(NPFL12-9)=JCKID                                             MLNDAT     98
      IF(IRS.EQ.1)THEN                                                  MLNDAT     99
C                                                                       MLNDAT    100
C   IRS=1 RELAY DATA FROM CARD                                          MLNDAT    101
C                                                                       MLNDAT    102
         RADX(NPFL12-2)=CCRAD                                           MLNDAT    103
         RORIG(NPFL12-1)=CCROR                                          MLNDAT    104
         XORIG(NPFL12)=CCXOR                                            MLNDAT    105
      ELSEIF(IRS.NE.0)THEN                                              MLNDAT    106
C                                                                       MLNDAT    107
C   IRS=2 RELAY DATA FROM RELAY DATA BASE                               MLNDAT    108
C                                                                       MLNDAT    109
         IRADX(NPFL12-2)=KNAME1                                         MLNDAT    110
         IRORIG(NPFL12-1)=KNAME2                                        MLNDAT    111
         IXORIG(NPFL12)=KNAME3                                          MLNDAT    112
      ENDIF                                                             MLNDAT    113
C                                                                       MLNDAT    114
      MTYIRS(NPFL12-8)=IRS                                              MLNDAT    115
      JRSKRS(NPFL12-7)=0                                                MLNDAT    116
C                                                                       MLNDAT    117
      GOTO 100                                                          MLNDAT    118
C                                                                       MLNDAT    119
 2000 FORMAT(2I5,1X,A4,I5,3A4,3F10.5)                                   MLNDAT    120
 2010 FORMAT(A12,1X,A12,A4,I5,3A4,3F10.5)                               MLNDAT    121
 2110 FORMAT(' *** ERROR NO SUCH LINE FLOW CARD')                       MLNDAT    122
      END                                                               MLNDAT    123
