CFPRIME STPINT                                                          STPINT      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 STPINT(*)                                              STPINT      3
CD                                                                      STPINT      4
CD    THIS ROUTINE PERFORMS THE INITIALIZATION OF ALL STP               STPINT      5
CD                                                                      STPINT      6
      INCLUDE 'PARX.INS'                                                STPINT      7
      INCLUDE 'CNPT.INS'                                                STPINT      8
      INCLUDE 'CNIPTR.INS'                                              STPINT      9
      INCLUDE 'CNSTN.INS'                                               STPINT     10
      INCLUDE 'CNB1.INS'                                                STPINT     11
      INCLUDE 'CNB4.INS'                                                STPINT     12
      INCLUDE 'CNB19.INS'                                               STPINT     13
      INCLUDE 'CNSTP.INS'                                               STPINT     14
      INCLUDE 'CNUDM.INS'                                               STPINT     15
C                                                                       STPINT     16
      INCLUDE 'CNXSTA.INS'                                              STPINT     17
      INCLUDE 'CNMDAT.INS'                                              STPINT     18
      INCLUDE 'CNVOLT.INS'                                              STPINT     19
      INCLUDE 'CNNNEW.INS'                                              STPINT     20
      INCLUDE 'CNMYVA.INS'                                              STPINT     21
      INCLUDE 'CNYVAR.INS'                                              STPINT     22
      INCLUDE 'CNQSTA.INS'                                              STPINT     23
      INCLUDE 'CNFLAG.INS'                                              STPINT     24
      INCLUDE 'CNUNIT.INS'                                              STPINT     25
      INCLUDE 'CNMSG.INS'                                               STPINT     26
C                                                                       STPINT     27
      CHARACTER*2 LCKT                                                  STPINT     28
      INTEGER*4 JCKID                                                   STPINT     29
      CHARACTER*4 CKID                                                  STPINT     30
      EQUIVALENCE (JCKID,CKID)                                          STPINT     31
C                                                                       STPINT     32
      LDEB=(JDEB(263).NE.0)                                             STPINT     33
C                                                                       STPINT     34
      X1=0.0                                                            STPINT     35
      X2=0.0                                                            STPINT     36
      Y1=0.0                                                            STPINT     37
      Y2=0.0                                                            STPINT     38
C                                                                       STPINT     39
      DO 180 N=1,NTCPS                                                  STPINT     40
      IF(JY+24+2*NXUDB.GT.NSI) RETURN 1                                 STPINT     41
      JTP=JTPDAT(N)                                                     STPINT     42
      JVSTP(N)=JY                                                       STPINT     43
      K1=IDDAT(JTP+1)                                                   STPINT     44
      K2=IDDAT(JTP+2)                                                   STPINT     45
      JCKID=IDDAT(JTP+3)                                                STPINT     46
      LCKT(1:2)=CKID(3:4)                                               STPINT     47
      K13=K1*3                                                          STPINT     48
      K23=K2*3                                                          STPINT     49
      NLF1=NOLD(K1)                                                     STPINT     50
      NLF2=NOLD(K2)                                                     STPINT     51
      VR1=REAL(VOLT(K1))                                                STPINT     52
      VI1=AIMAG(VOLT(K1))                                               STPINT     53
      VM1=SQRT(VR1**2+VI1**2)                                           STPINT     54
      VR2=REAL(VOLT(K2))                                                STPINT     55
      VI2=AIMAG(VOLT(K2))                                               STPINT     56
      VM2=SQRT(VR2**2+VI2**2)                                           STPINT     57
      NTTYPN=IDDAT(JTP+4)                                               STPINT     58
      NPTYPN=IDDAT(JTP+5)                                               STPINT     59
      ITABT=IDDAT(JTP+6)                                                STPINT     60
      ITABP=IDDAT(JTP+7)                                                STPINT     61
      IF(NTTYPN.EQ.0) DDAT(JTP+8)=0.5                                   STPINT     62
      IF(NPTYPN.EQ.0) DDAT(JTP+10)=2.0                                  STPINT     63
      ATT=DDAT(JTP+8)                                                   STPINT     64
      XTT=DDAT(JTP+9)                                                   STPINT     65
      ATP=DDAT(JTP+10)                                                  STPINT     66
      XTP=DDAT(JTP+11)                                                  STPINT     67
      GSTP=DDAT(JTP+12)                                                 STPINT     68
      BSTP=DDAT(JTP+13)                                                 STPINT     69
      TSTP=DDAT(JTP+14)                                                 STPINT     70
      RSTP=DDAT(JTP+15)                                                 STPINT     71
      IDIVX=IDDAT(JTP+20)                                               STPINT     72
      JTP1=JTP                                                          STPINT     73
      JTP=JTP+20                                                        STPINT     74
C                                                                       STPINT     75
      IF(ATT.LE.0.0.OR.ATT.GT.0.5.OR.ATP.LE.0.0.OR.ATP.GT.2.0) THEN     STPINT     76
      WRITE(MSG(1),1040) N,NLF1,INAME(K13-2),INAME(K13-1),INAME(K13)    STPINT     77
      WRITE(MSG(2),1041) NLF2,INAME(K23-2),INAME(K23-1),INAME(K23),LCKT STPINT     78
      WRITE(MSG(4),1043) ATT,ATP                                        STPINT     79
      WRITE(MSG(3),1042)                                                STPINT     80
      CALL PRTMSG(4)                                                    STPINT     81
      MSG(1)='STPINT: STP RANGE ERROR'                                  STPINT     82
      CALL ASTOP(MSG(1),23)                                             STPINT     83
      ENDIF                                                             STPINT     84
      IF(XTT.LT.0.0.OR.XTT.GT.1.0.OR.XTP.LT.0.0.OR.XTP.GT.1.0) THEN     STPINT     85
      WRITE(MSG(1),1040) N,NLF1,INAME(K13-2),INAME(K13-1),INAME(K13)    STPINT     86
      WRITE(MSG(2),1041) NLF2,INAME(K23-2),INAME(K23-1),INAME(K23),LCKT STPINT     87
      WRITE(MSG(4),1051) XTT,XTP                                        STPINT     88
      WRITE(MSG(3),1050)                                                STPINT     89
      CALL PRTMSG(4)                                                    STPINT     90
      MSG(1)='STPINT: STP TAPPED POSITION ERROR'                        STPINT     91
      CALL ASTOP(MSG(1),33)                                             STPINT     92
      ENDIF                                                             STPINT     93
C                                                                       STPINT     94
      YSTP=SQRT(GSTP**2+BSTP**2)                                        STPINT     95
      ASTP=ATAN2(-BSTP,GSTP)                                            STPINT     96
      IF(RSTP.LT.0.0) THEN                                              STPINT     97
         RSTP=-1.0/RSTP                                                 STPINT     98
         TSTP=-TSTP                                                     STPINT     99
      ENDIF                                                             STPINT    100
      SINF=SIN(TSTP)                                                    STPINT    101
      COSF=COS(TSTP)                                                    STPINT    102
      IF(XTP.LT.0.9999) THEN                                            STPINT    103
         AA1=ATAN(SINF/(RSTP*XTP/(1.0-XTP)+COSF))                       STPINT    104
      ELSE                                                              STPINT    105
         AA1=0.0                                                        STPINT    106
      ENDIF                                                             STPINT    107
      AA2=-TSTP+AA1                                                     STPINT    108
      COSF1=COS(AA1)                                                    STPINT    109
      COSF2=COS(AA2)                                                    STPINT    110
      RATIOX=COSF2/COSF1/RSTP                                           STPINT    111
      IF(XTT.LT.0.9999) THEN                                            STPINT    112
         A1RE=1.0+(1.0-RATIOX)/(XTT/(1.0-XTT)+RATIOX)                   STPINT    113
         A2RE=1.0-(A1RE-1.0)*XTT/(1.0-XTT)                              STPINT    114
      ELSE                                                              STPINT    115
         A1RE=1.0                                                       STPINT    116
         A2RE=RATIOX                                                    STPINT    117
      ENDIF                                                             STPINT    118
      A1IM=A1RE*TAN(AA1)                                                STPINT    119
      A2IM=A2RE*TAN(AA2)                                                STPINT    120
      TSTCN=(A1RE-A2RE)/ATT                                             STPINT    121
      TSPSN=(A1IM-A2IM)/ATP                                             STPINT    122
C                                                                       STPINT    123
      FACT1=A1RE**2+A1IM**2                                             STPINT    124
      FACT2=A2RE**2+A2IM**2                                             STPINT    125
      A1M=SQRT(FACT1)                                                   STPINT    126
      A2M=SQRT(FACT2)                                                   STPINT    127
      Y12=YSTP/A1M/A2M                                                  STPINT    128
      AY12=ASTP+AA1-AA2                                                 STPINT    129
      AY21=ASTP-AA1+AA2                                                 STPINT    130
      G110=GSTP/FACT1                                                   STPINT    131
      B110=-BSTP/FACT1                                                  STPINT    132
      G120=-Y12*COS(AY12)                                               STPINT    133
      B120=-Y12*SIN(AY12)                                               STPINT    134
      G210=-Y12*COS(AY21)                                               STPINT    135
      B210=-Y12*SIN(AY21)                                               STPINT    136
      G220=GSTP/FACT2                                                   STPINT    137
      B220=-BSTP/FACT2                                                  STPINT    138
      CR1=G110*VR1-B110*VI1+G120*VR2-B120*VI2                           STPINT    139
      CI1=B110*VR1+G110*VI1+B120*VR2+G120*VI2                           STPINT    140
      CR2=G210*VR1-B210*VI1+G220*VR2-B220*VI2                           STPINT    141
      CI2=B210*VR1+G210*VI1+B220*VR2+G220*VI2                           STPINT    142
      CM1=SQRT(CR1**2+CI1**2)                                           STPINT    143
      CM2=SQRT(CR2**2+CI2**2)                                           STPINT    144
      PM1=VR1*CR1+VI1*CI1                                               STPINT    145
      PM2=VR2*CR2+VI2*CI2                                               STPINT    146
      QM1=VI1*CR1-VR1*CI1                                               STPINT    147
      QM2=VI2*CR2-VR2*CI2                                               STPINT    148
      VA1=0.0                                                           STPINT    149
      VA2=0.0                                                           STPINT    150
      IF(VM1.GT.0.05)VA1=ATAN2(VI1,VR1)                                 STPINT    151
      IF(VM2.GT.0.05)VA2=ATAN2(VI2,VR2)                                 STPINT    152
      IDDAT(JTP1+16)=0                                                  STPINT    153
      DDAT(JTP1+17)=VA1                                                 STPINT    154
      IDDAT(JTP1+18)=0                                                  STPINT    155
      DDAT(JTP1+19)=VA2                                                 STPINT    156
C                                                                       STPINT    157
      A1RE=1.0+ATT*(1.0-XTT)*TSTCN                                      STPINT    158
      A1IM=ATP*(1.0-XTP)*TSPSN                                          STPINT    159
      A1M=SQRT(A1RE**2+A1IM**2)                                         STPINT    160
      AA1=ATAN2(A1IM,A1RE)                                              STPINT    161
      A2RE=1.0-ATT*XTT*TSTCN                                            STPINT    162
      A2IM=-ATP*XTP*TSPSN                                               STPINT    163
      A2M=SQRT(A2RE**2+A2IM**2)                                         STPINT    164
      AA2=ATAN2(A2IM,A2RE)                                              STPINT    165
      FACT1=A1M**2                                                      STPINT    166
      FACT2=A2M**2                                                      STPINT    167
      Y12=YSTP/A1M/A2M                                                  STPINT    168
      AY12=ASTP+AA1-AA2                                                 STPINT    169
      AY21=ASTP-AA1+AA2                                                 STPINT    170
      G11=GSTP/FACT1                                                    STPINT    171
      B11=-BSTP/FACT1                                                   STPINT    172
      G12=-Y12*COS(AY12)                                                STPINT    173
      B12=-Y12*SIN(AY12)                                                STPINT    174
      G21=-Y12*COS(AY21)                                                STPINT    175
      B21=-Y12*SIN(AY21)                                                STPINT    176
      G22=GSTP/FACT2                                                    STPINT    177
      B22=-BSTP/FACT2                                                   STPINT    178
C                                                                       STPINT    179
      IF(ITABT.GT.0) THEN                                               STPINT    180
         NTAB=2*ITABT                                                   STPINT    181
         TN=TSTCN                                                       STPINT    182
         DO 100 I=2,ITABT                                               STPINT    183
         NTAB=2*I                                                       STPINT    184
         Y2=DDAT(JTP+NTAB)                                              STPINT    185
         X2=DDAT(JTP+NTAB-1)                                            STPINT    186
         Y1=DDAT(JTP+NTAB-2)                                            STPINT    187
         X1=DDAT(JTP+NTAB-3)                                            STPINT    188
         IF(X1.LT.-1.0.OR.X2.LE.X1.OR.X2.GT.1.0.OR.Y1.LE.0.0.OR.        STPINT    189
     &      Y2.LE.0.0) THEN                                             STPINT    190
      WRITE(MSG(1),1100) NLF1,INAME(K13-2),INAME(K13-1),INAME(K13)      STPINT    191
      WRITE(MSG(2),1041) NLF2,INAME(K23-2),INAME(K23-1),INAME(K23),LCKT STPINT    192
      WRITE(MSG(3),1102)                                                STPINT    193
      WRITE(MSG(4),1103)                                                STPINT    194
      WRITE(MSG(5),1104)                                                STPINT    195
      CALL PRTMSG(5)                                                    STPINT    196
      MSG(1)='STPINT: STC IMP. CORR. TABLE ERROR'                       STPINT    197
      CALL ASTOP(MSG(1),34)                                             STPINT    198
         ENDIF                                                          STPINT    199
         IF(TN.LE.X2) GO TO 110                                         STPINT    200
  100    CONTINUE                                                       STPINT    201
  110    YSTP=YSTP*(Y1+(TN-X1)*(Y2-Y1)/(X2-X1))                         STPINT    202
         JTP=JTP+2*ITABT                                                STPINT    203
      ENDIF                                                             STPINT    204
      IF(ITABP.GT.0) THEN                                               STPINT    205
         NTAB=2*ITABP                                                   STPINT    206
         TN=TSPSN                                                       STPINT    207
         DO 120 I=2,ITABP                                               STPINT    208
         NTAB=2*I                                                       STPINT    209
         Y2=DDAT(JTP+NTAB)                                              STPINT    210
         X2=DDAT(JTP+NTAB-1)                                            STPINT    211
         Y1=DDAT(JTP+NTAB-2)                                            STPINT    212
         X1=DDAT(JTP+NTAB-3)                                            STPINT    213
         IF(X1.LT.-1.0.OR.X2.LE.X1.OR.X2.GT.1.0.OR.Y1.LE.0.0.OR.        STPINT    214
     &      Y2.LE.0.0) THEN                                             STPINT    215
      WRITE(MSG(1),1100) NLF1,INAME(K13-2),INAME(K13-1),INAME(K13)      STPINT    216
      WRITE(MSG(2),1041) NLF2,INAME(K23-2),INAME(K23-1),INAME(K23),LCKT STPINT    217
      WRITE(MSG(3),1130)                                                STPINT    218
      WRITE(MSG(4),1131)                                                STPINT    219
      WRITE(MSG(5),1132)                                                STPINT    220
      CALL PRTMSG(5)                                                    STPINT    221
      MSG(1)='STPINT: SPS IMP. CORR. TABLE ERROR'                       STPINT    222
      CALL ASTOP(MSG(1),34)                                             STPINT    223
         ENDIF                                                          STPINT    224
         IF(TN.LE.X2) GO TO 130                                         STPINT    225
  120    CONTINUE                                                       STPINT    226
  130    YSTP=YSTP*(Y1+(TN-X1)*(Y2-Y1)/(X2-X1))                         STPINT    227
      ENDIF                                                             STPINT    228
C                                                                       STPINT    229
      DDAT(JTP1+12)=YSTP                                                STPINT    230
      DDAT(JTP1+13)=ASTP                                                STPINT    231
      RT0=COS(ASTP)/YSTP                                                STPINT    232
      XT0=-SIN(ASTP)/YSTP                                               STPINT    233
C                                                                       STPINT    234
      YVAR(JY+1)=G11                                                    STPINT    235
      YVAR(JY+2)=B11                                                    STPINT    236
      YVAR(JY+3)=G12                                                    STPINT    237
      YVAR(JY+4)=B12                                                    STPINT    238
      YVAR(JY+5)=G21                                                    STPINT    239
      YVAR(JY+6)=B21                                                    STPINT    240
      YVAR(JY+7)=G22                                                    STPINT    241
      YVAR(JY+8)=B22                                                    STPINT    242
      YVAR(JY+9)=G110                                                   STPINT    243
      YVAR(JY+10)=B110                                                  STPINT    244
      YVAR(JY+11)=G120                                                  STPINT    245
      YVAR(JY+12)=B120                                                  STPINT    246
      YVAR(JY+13)=G210                                                  STPINT    247
      YVAR(JY+14)=B210                                                  STPINT    248
      YVAR(JY+15)=G220                                                  STPINT    249
      YVAR(JY+16)=B220                                                  STPINT    250
      JY=JY+16                                                          STPINT    251
C                                                                       STPINT    252
      JVSTC(N)=JY                                                       STPINT    253
      JYTC=JY                                                           STPINT    254
      TSTC(JYTC+2)=TSTCN                                                STPINT    255
      TSTC(JYTC+4)=0.0                                                  STPINT    256
      JXSTC(N)=JSTATE                                                   STPINT    257
      IF(NTTYPN.EQ.50) THEN                                             STPINT    258
         CALL FMOVE(0,VALIN,VALIN,80)                                   STPINT    259
         VALIN(1)=CM1                                                   STPINT    260
         VALIN(2)=CM2                                                   STPINT    261
         VALIN(3)=PM1                                                   STPINT    262
         VALIN(4)=PM2                                                   STPINT    263
         VALIN(7)=VM1                                                   STPINT    264
         VALIN(8)=VM2                                                   STPINT    265
         VALIN(9)=VA1                                                   STPINT    266
         VALIN(10)=VA2                                                  STPINT    267
         VALIN(15)=QM1                                                  STPINT    268
         VALIN(16)=QM2                                                  STPINT    269
C                                                                       STPINT    270
         JE0=JTDAT(N)                                                   STPINT    271
         JE1=JE0+1                                                      STPINT    272
         NUF=7                                                          STPINT    273
         VMG=0.0                                                        STPINT    274
         CALL UDMINT(NUF,VMG,NLF1,K13,LCKT)                             STPINT    275
C                                                                       STPINT    276
         IF(LDEB) WRITE(IUD6,1150) (I,VALIN(I),I=1,80)                  STPINT    277
C                                                                       STPINT    278
C     STORE THE REQUIRED INPUTS AND OUTPUTS                             STPINT    279
C                                                                       STPINT    280
         IOUT=IDDAT(JE7+1)                                              STPINT    281
         VREF(JYTC+1)=VALIN(20)                                         STPINT    282
         TSTC(JYTC+4)=TSTC(JYTC+2)-VALOUT(IOUT)                         STPINT    283
         TSTC(JYTC+2)=VALOUT(IOUT)                                      STPINT    284
         SSTC(JYTC+3)=VALIN(11)                                         STPINT    285
         DO 140 J=1,NXUDB                                               STPINT    286
         YVAR(JY+J+4)=VALOUT(J)                                         STPINT    287
  140    CONTINUE                                                       STPINT    288
         GO TO 150                                                      STPINT    289
      ENDIF                                                             STPINT    290
  150 CONTINUE                                                          STPINT    291
      JY=JY+4+NXUDB                                                     STPINT    292
      JVSPS(N)=JY                                                       STPINT    293
      JYPS=JY                                                           STPINT    294
      TSPS(JYPS+2)=TSPSN                                                STPINT    295
      TSPS(JYPS+4)=0.0                                                  STPINT    296
      JXSPS(N)=JSTATE                                                   STPINT    297
      IF(NPTYPN.EQ.50) THEN                                             STPINT    298
         CALL FMOVE(0,VALIN,VALIN,80)                                   STPINT    299
         VALIN(1)=CM1                                                   STPINT    300
         VALIN(2)=CM2                                                   STPINT    301
         VALIN(3)=PM1                                                   STPINT    302
         VALIN(4)=PM2                                                   STPINT    303
         VALIN(7)=VM1                                                   STPINT    304
         VALIN(8)=VM2                                                   STPINT    305
         VALIN(9)=VA1                                                   STPINT    306
         VALIN(10)=VA2                                                  STPINT    307
         VALIN(15)=QM1                                                  STPINT    308
         VALIN(16)=QM2                                                  STPINT    309
C                                                                       STPINT    310
         JE0=JPDAT(N)                                                   STPINT    311
         JE1=JE0+1                                                      STPINT    312
         NUF=8                                                          STPINT    313
         VMG=0.0                                                        STPINT    314
         CALL UDMINT(NUF,VMG,NLF1,K13,LCKT)                             STPINT    315
C                                                                       STPINT    316
         IF(LDEB) WRITE(IUD6,1150) (I,VALIN(I),I=1,80)                  STPINT    317
C                                                                       STPINT    318
C     STORE THE REQUIRED INPUTS AND OUTPUTS                             STPINT    319
C                                                                       STPINT    320
         IOUT=IDDAT(JE7+1)                                              STPINT    321
         VREF(JYPS+1)=VALIN(20)                                         STPINT    322
         TSPS(JYPS+4)=TSPS(JYPS+2)-VALOUT(IOUT)                         STPINT    323
         TSPS(JYPS+2)=VALOUT(IOUT)                                      STPINT    324
         SSPS(JYPS+3)=VALIN(12)                                         STPINT    325
         DO 160 J=1,NXUDB                                               STPINT    326
         YVAR(JY+J+4)=VALOUT(J)                                         STPINT    327
  160    CONTINUE                                                       STPINT    328
         GO TO 170                                                      STPINT    329
      ENDIF                                                             STPINT    330
  170 CONTINUE                                                          STPINT    331
      JY=JY+4+NXUDB                                                     STPINT    332
  180 CONTINUE                                                          STPINT    333
      JXSTC(NTCPS+1)=JSTATE                                             STPINT    334
      RETURN                                                            STPINT    335
C                                                                       STPINT    336
 1040 FORMAT(' *** ERROR IN STP:',I3,' AT FR BUS#',I5,' STATION:',3A4)  STPINT    337
 1041 FORMAT(5X,'TO BUS:',I5,' STATION:',3A4,' CID:',A2)                STPINT    338
 1042 FORMAT(5X,'ATT OR ATP IS OUTSIDE 0.0 & 0.5 OR 2.0 PU LIMITS.')    STPINT    339
 1043 FORMAT(5X,'ATT=',F10.5,' ATP=',F10.5)                             STPINT    340
 1050 FORMAT(5X,'XTT OR XTP IS OUTSIDE 0.0 & 1.0 PU LIMITS.')           STPINT    341
 1051 FORMAT(5X,'XTT=',F10.5,' XTP=',F10.5)                             STPINT    342
 1100 FORMAT(' *** ERROR STC AT FR BUS#',I5,' STATION: ',3A4)           STPINT    343
 1102 FORMAT(5X,'TT VALUES MUST BE IN INCREASING ORDER.')               STPINT    344
 1103 FORMAT(5X                                                         STPINT    345
     *,'TT VALUES SHOULD BE LIMITED BETWEEN -1.0 AND 1.0, AND FT')      STPINT    346
 1104 FORMAT(5X,'VALUES POSITIVE (USUALLY CENTRED AROUND 1.0).')        STPINT    347
 1130 FORMAT(5X,'TP VALUES MUST BE IN INCREASING ORDER.')               STPINT    348
 1131 FORMAT(5X                                                         STPINT    349
     *,'TP VALUES SHOULD BE LIMITED BETWEEN -1.0 AND 1.0, AND FP')      STPINT    350
 1132 FORMAT(5X,'VALUES POSITIVE (USUALLY CENTRED AROUND 1.0).')        STPINT    351
 1150 FORMAT(1X,'INPUT VALUES: ',/,I5,F10.3)                            STPINT    352
      END                                                               STPINT    353
