CFPRIME LSTPDA                                                          LSTPDA      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 LSTPDA(IU16,IEBK)                                      LSTPDA      3
CD                                                                      LSTPDA      4
CD    TO LOAD STP DATA FROM ARRAYS JJTPDA, JJTDAT, JJPDAT, TDDAT TO     LSTPDA      5
CD    ARRAYS JTPDAT, JTDAT, JPDAT AND DDAT.                             LSTPDA      6
CD                                                                      LSTPDA      7
CD    INPUT OF THE ROUTINE ARE:                                         LSTPDA      8
CD                                                                      LSTPDA      9
CD    1. IU16 IS UNIT FOR ERROR AND WARNING MESSAGE PRINTING            LSTPDA     10
CD    2. IEBK IS THE ERROR INDICATOR (NOT USED)                         LSTPDA     11
CD                                                                      LSTPDA     12
      INCLUDE 'PARX.INS'                                                LSTPDA     13
      INCLUDE 'CNPT.INS'                                                LSTPDA     14
      INCLUDE 'CNMDAT.INS'                                              LSTPDA     15
      INCLUDE 'CNB19.INS'                                               LSTPDA     16
      INCLUDE 'CNSTP.INS'                                               LSTPDA     17
      INCLUDE 'CNFLAG.INS'                                              LSTPDA     18
      INCLUDE 'CNPARX.INS'                                              LSTPDA     19
      INCLUDE 'CNREN.INS'                                               LSTPDA     20
      INCLUDE 'CNMNEW.INS'                                              LSTPDA     21
      INCLUDE 'CNUDM.INS'                                               LSTPDA     22
      INCLUDE 'CNJPT.INS'                                               LSTPDA     23
      INCLUDE 'CNJDAT.INS'                                              LSTPDA     24
      INCLUDE 'CNTMDA.INS'                                              LSTPDA     25
      INCLUDE 'CNLFDA.INS'                                              LSTPDA     26
      INCLUDE 'CNMSG.INS'                                               LSTPDA     27
C                                                                       LSTPDA     28
C                                                                       LSTPDA     29
      CHARACTER*80 SIMBUF                                               LSTPDA     30
      CHARACTER*4 KCKT1                                                 LSTPDA     31
      EQUIVALENCE (ICKT1,KCKT1)                                         LSTPDA     32
C                                                                       LSTPDA     33
      LDEB=(JDEB(8).NE.0)                                               LSTPDA     34
C                                                                       LSTPDA     35
C     LOADING STP DATA                                                  LSTPDA     36
C                                                                       LSTPDA     37
      DO 300 J=1,JTCPS                                                  LSTPDA     38
C                                                                       LSTPDA     39
      IF(JSTTP(J).GT.2)GOTO 300                                         LSTPDA     40
      LTN=JJTPDA(J)                                                     LSTPDA     41
      NLF1=ITDDAT(LTN+1)                                                LSTPDA     42
      NLF2=ITDDAT(LTN+2)                                                LSTPDA     43
      ICKT1=ITDDAT(LTN+3)                                               LSTPDA     44
      NTTYPX=ITDDAT(LTN+4)                                              LSTPDA     45
      NPTYPX=ITDDAT(LTN+5)                                              LSTPDA     46
      ITABT=ITDDAT(LTN+6)                                               LSTPDA     47
      ITABP=ITDDAT(LTN+7)                                               LSTPDA     48
      IDIVX=ITDDAT(LTN+20)                                              LSTPDA     49
C                                                                       LSTPDA     50
      NTCPS=NTCPS+1                                                     LSTPDA     51
      IF(NTCPS.GT.NXSTP)GOTO 340                                        LSTPDA     52
      JTPDAT(NTCPS)=JLN                                                 LSTPDA     53
      IDDAT(JLN+1)=NLF1                                                 LSTPDA     54
      IDDAT(JLN+2)=NLF2                                                 LSTPDA     55
      IDDAT(JLN+3)=ICKT1                                                LSTPDA     56
      IDDAT(JLN+4)=NTTYPX                                               LSTPDA     57
      IDDAT(JLN+5)=NPTYPX                                               LSTPDA     58
      IDDAT(JLN+6)=ITABT                                                LSTPDA     59
      IDDAT(JLN+7)=ITABP                                                LSTPDA     60
      IDDAT(JLN+20)=IDIVX                                               LSTPDA     61
      DO 90 LL=8,11                                                     LSTPDA     62
  90  DDAT(JLN+LL)=TDDAT(LTN+LL)                                        LSTPDA     63
      LTN=LTN+20                                                        LSTPDA     64
      JLN=JLN+20                                                        LSTPDA     65
      IF(ITABT.GT.0) THEN                                               LSTPDA     66
      DO 100 LL=1,8                                                     LSTPDA     67
 100  DDAT(JLN+LL)=TDDAT(LTN+LL)                                        LSTPDA     68
         IF(ITABT.GT.4) THEN                                            LSTPDA     69
         DO 110 LL=9,16                                                 LSTPDA     70
 110     DDAT(JLN+LL)=TDDAT(LTN+LL)                                     LSTPDA     71
            IF(ITABT.GT.8) THEN                                         LSTPDA     72
            DO 120 LL=17,24                                             LSTPDA     73
 120        DDAT(JLN+LL)=TDDAT(LTN+LL)                                  LSTPDA     74
               IF(ITABT.GT.12) THEN                                     LSTPDA     75
               DO 130 LL=25,32                                          LSTPDA     76
 130           DDAT(JLN+LL)=TDDAT(LTN+LL)                               LSTPDA     77
                  IF(ITABT.GT.16) THEN                                  LSTPDA     78
                  DO 140 LL=33,40                                       LSTPDA     79
 140              DDAT(JLN+LL)=TDDAT(LTN+LL)                            LSTPDA     80
                  ENDIF                                                 LSTPDA     81
               ENDIF                                                    LSTPDA     82
            ENDIF                                                       LSTPDA     83
         ENDIF                                                          LSTPDA     84
         LTN=LTN+2*ITABT                                                LSTPDA     85
         JLN=JLN+2*ITABT                                                LSTPDA     86
      ENDIF                                                             LSTPDA     87
      IF(ITABP.GT.0) THEN                                               LSTPDA     88
      DO 150 LL=1,8                                                     LSTPDA     89
 150  DDAT(JLN+LL)=TDDAT(LTN+LL)                                        LSTPDA     90
         IF(ITABP.GT.4) THEN                                            LSTPDA     91
         DO 160 LL=9,16                                                 LSTPDA     92
 160     DDAT(JLN+LL)=TDDAT(LTN+LL)                                     LSTPDA     93
            IF(ITABP.GT.8) THEN                                         LSTPDA     94
            DO 170 LL=17,24                                             LSTPDA     95
 170        DDAT(JLN+LL)=TDDAT(LTN+LL)                                  LSTPDA     96
                IF(ITABP.GT.12) THEN                                    LSTPDA     97
                DO 180 LL=25,32                                         LSTPDA     98
 180            DDAT(JLN+LL)=TDDAT(LTN+LL)                              LSTPDA     99
                  IF(ITABP.GT.16) THEN                                  LSTPDA    100
                  DO 190 LL=33,40                                       LSTPDA    101
 190              DDAT(JLN+LL)=TDDAT(LTN+LL)                            LSTPDA    102
                  ENDIF                                                 LSTPDA    103
               ENDIF                                                    LSTPDA    104
            ENDIF                                                       LSTPDA    105
         ENDIF                                                          LSTPDA    106
         LTN=LTN+2*ITABP                                                LSTPDA    107
         JLN=JLN+2*ITABP                                                LSTPDA    108
      ENDIF                                                             LSTPDA    109
C                                                                       LSTPDA    110
      IF (NTTYPX.EQ.0.AND.NPTYPX.EQ.0) GO TO 330                        LSTPDA    111
C                                                                       LSTPDA    112
C     LOADING STC DATA                                                  LSTPDA    113
C                                                                       LSTPDA    114
      IF(NTTYPX.NE.50) GOTO 250                                         LSTPDA    115
C                                                                       LSTPDA    116
C     USER DEFINED STC DATA                                             LSTPDA    117
C                                                                       LSTPDA    118
      JTDAT(NTCPS)=JLN                                                  LSTPDA    119
      JLN1=0                                                            LSTPDA    120
      LTN1=0                                                            LSTPDA    121
      NUF=7                                                             LSTPDA    122
      CALL LUDMDA(NUF,JLN1,LTN)                                         LSTPDA    123
      IF(NUF.EQ.900) GO TO 400                                          LSTPDA    124
  250 CONTINUE                                                          LSTPDA    125
C                                                                       LSTPDA    126
C     STANDARD STC DATA (FOR FUTURE USE)                                LSTPDA    127
C                                                                       LSTPDA    128
C     READING SPS DATA                                                  LSTPDA    129
C                                                                       LSTPDA    130
      IF(NPTYPX.NE.50) GO TO 280                                        LSTPDA    131
C                                                                       LSTPDA    132
C     USER DEFINED SPS DATA                                             LSTPDA    133
C                                                                       LSTPDA    134
      JPDAT(NTCPS)=JLN                                                  LSTPDA    135
      JLN1=0                                                            LSTPDA    136
      LTN1=0                                                            LSTPDA    137
      NUF=8                                                             LSTPDA    138
      CALL LUDMDA(NUF,JLN1,LTN)                                         LSTPDA    139
      IF(NUF.EQ.900) GO TO 400                                          LSTPDA    140
      CALL MCHECK (NLF1,14,JLN,'LSTPDA')                                LSTPDA    141
      GOTO 300                                                          LSTPDA    142
  280 CONTINUE                                                          LSTPDA    143
C                                                                       LSTPDA    144
C     STANDARD SPS DATA (FOR FUTURE)                                    LSTPDA    145
C                                                                       LSTPDA    146
      GOTO 300                                                          LSTPDA    147
C                                                                       LSTPDA    148
  300 CONTINUE                                                          LSTPDA    149
C                                                                       LSTPDA    150
      RETURN                                                            LSTPDA    151
C                                                                       LSTPDA    152
  330 CONTINUE                                                          LSTPDA    153
      IF(KLFO.EQ.0)THEN                                                 LSTPDA    154
      WRITE(MSG(1),1020) NLF1,NLF2,KCKT1                                LSTPDA    155
      ELSE                                                              LSTPDA    156
      J=MNEW(NLF1)                                                      LSTPDA    157
      K=MNEW(NLF2)                                                      LSTPDA    158
      JJ=J*8                                                            LSTPDA    159
      KK=K*8                                                            LSTPDA    160
      WRITE(MSG(1),1030) NAMES(JJ-2),NAMES(JJ-1),NAMES(JJ)              LSTPDA    161
     &,NAMES(KK-2),NAMES(KK-1),NAMES(KK),KCKT1                          LSTPDA    162
      ENDIF                                                             LSTPDA    163
      WRITE(MSG(2),1070)                                                LSTPDA    164
      CALL PRTMSG(2)                                                    LSTPDA    165
      SIMBUF='LSTPDA: STP TYPE ERROR'                                   LSTPDA    166
      CALL ASTOP(SIMBUF,22)                                             LSTPDA    167
C                                                                       LSTPDA    168
  340 CONTINUE                                                          LSTPDA    169
      IF(KLFO.EQ.0)THEN                                                 LSTPDA    170
      WRITE(MSG(1),1020) NLF1,NLF2,KCKT1                                LSTPDA    171
      ELSE                                                              LSTPDA    172
      J=MNEW(NLF1)                                                      LSTPDA    173
      K=MNEW(NLF2)                                                      LSTPDA    174
      JJ=J*8                                                            LSTPDA    175
      KK=K*8                                                            LSTPDA    176
      WRITE(MSG(1),1030) NAMES(JJ-2),NAMES(JJ-1),NAMES(JJ)              LSTPDA    177
     &,NAMES(KK-2),NAMES(KK-1),NAMES(KK),KCKT1                          LSTPDA    178
      ENDIF                                                             LSTPDA    179
      WRITE(MSG(2),1040) NXSTP                                          LSTPDA    180
      CALL PRTMSG(2)                                                    LSTPDA    181
      SIMBUF='LSTPDA: TOO MANY STP DEVICE'                              LSTPDA    182
      CALL ASTOP(SIMBUF,27)                                             LSTPDA    183
C                                                                       LSTPDA    184
  400 CONTINUE                                                          LSTPDA    185
      IF(KLFO.EQ.0)THEN                                                 LSTPDA    186
      WRITE(MSG(1),1020) NLF1,NLF2,KCKT1                                LSTPDA    187
      ELSE                                                              LSTPDA    188
      J=MNEW(NLF1)                                                      LSTPDA    189
      K=MNEW(NLF2)                                                      LSTPDA    190
      JJ=J*8                                                            LSTPDA    191
      KK=K*8                                                            LSTPDA    192
      WRITE(MSG(1),1030) NAMES(JJ-2),NAMES(JJ-1),NAMES(JJ)              LSTPDA    193
     &,NAMES(KK-2),NAMES(KK-1),NAMES(KK),KCKT1                          LSTPDA    194
      ENDIF                                                             LSTPDA    195
      WRITE(MSG(2),1050)                                                LSTPDA    196
      CALL PRTMSG(2)                                                    LSTPDA    197
      SIMBUF='LSTPDA: STP CONTROL DATA ERROR'                           LSTPDA    198
      CALL ASTOP(SIMBUF,30)                                             LSTPDA    199
C                                                                       LSTPDA    200
 1020 FORMAT(' *** ERROR STP BETWEEN BUSES ',2I6,1X,A2)                 LSTPDA    201
 1030 FORMAT(' *** ERROR STP BETWEEN BUSES ',2(3A4,1X),A2)              LSTPDA    202
 1040 FORMAT(11X,'EXCEEDS THE LIMIT OF ',I4)                            LSTPDA    203
 1050 FORMAT(11X,'CONTROL MODEL DATA ERROR.')                           LSTPDA    204
 1070 FORMAT(11X,'BOTH STC AND SPS TYPES CANNOT BE ZERO.')              LSTPDA    205
      END                                                               LSTPDA    206
