CFPRIME INMXL1                                                          INMXL1      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 INMXL1                                                 INMXL1      3
CD                                                                      INMXL1      4
CD    TO PERFORM INITIALIZATION AND DATA CHECK FOR MAXIMUM EXCITATION   INMXL1      5
CD    CURRENT LIMITER.                                                  INMXL1      6
CD                                                                      INMXL1      7
CD    THE DATA STRUCTURE AFTER THE INITIALIZATION IS GIVEN BELOW.       INMXL1      8
CD                                                                      INMXL1      9
CD   7.1 Over excitation current limiter type 1                         INMXL1     10
CD                                                                      INMXL1     11
CD     Over Excitation current limiter data                             INMXL1     12
CD                                                                      INMXL1     13
CD     DDAT(JMX+ 1)   = K                                               INMXL1     14
CD     DDAT(JMX+ 2)   = TA                                              INMXL1     15
CD     DDAT(JMX+ 3)   = TB                                              INMXL1     16
CD     DDAT(JMX+ 4)   = U                                               INMXL1     17
CD     DDAT(JMX+ 5)   = IFLMAX                                          INMXL1     18
CD     DDAT(JMX+ 6)   = IFLMIN                                          INMXL1     19
CD     DDAT(JMX+ 7)   = T1                                              INMXL1     20
CD     DDAT(JMX+ 8)   = T2 or RATE                                      INMXL1     21
CD                                                                      INMXL1     22
CD     Over Excitation current limiter states                           INMXL1     23
CD                                                                      INMXL1     24
CD     XSTATE(JMXS+1) = TB block                                        INMXL1     25
CD                                                                      INMXL1     26
CD     Over Excitation current limiter Y-variables                      INMXL1     27
CD                                                                      INMXL1     28
CD     VMXL(JYMX+1)   = output of maximum excitation current limiter    INMXL1     29
CD     YIFL(JYMX+2)   = definite integral of vector current from the    INMXL1     30
CD                      triggering time to the current time             INMXL1     31
CD                                                                      INMXL1     32
      INCLUDE 'PARX.INS'                                                INMXL1     33
      INCLUDE 'CNMDAT.INS'                                              INMXL1     34
      INCLUDE 'CNMSTA.INS'                                              INMXL1     35
      INCLUDE 'CNXSTA.INS'                                              INMXL1     36
      INCLUDE 'CNEXC.INS'                                               INMXL1     37
      INCLUDE 'CNMYVA.INS'                                              INMXL1     38
      INCLUDE 'CNYVAR.INS'                                              INMXL1     39
      INCLUDE 'CNFLAG.INS'                                              INMXL1     40
      INCLUDE 'CNUNIT.INS'                                              INMXL1     41
      INCLUDE 'CNSTN.INS'                                               INMXL1     42
      INCLUDE 'CNB1.INS'                                                INMXL1     43
      INCLUDE 'CNB4.INS'                                                INMXL1     44
      INCLUDE 'CNMSG.INS'                                               INMXL1     45
C                                                                       INMXL1     46
      DATA BIG/99.9/                                                    INMXL1     47
C                                                                       INMXL1     48
      LDEB=(JDEB(76).NE.0)                                              INMXL1     49
C                                                                       INMXL1     50
      IF (LDEB) WRITE(IUD6,2010) (DDAT(JMX+I),I=1,10)                   INMXL1     51
C                                                                       INMXL1     52
C  INPUT TIME CONSTANTS CHECK AND RESET                                 INMXL1     53
C                                                                       INMXL1     54
      IF(DDAT(JMX+3).LT.TMIN.AND.IDDAT(JMX+3).NE.0)THEN                 INMXL1     55
         WRITE(MSG(1),9000) NLF,INAME(KN-2),INAME(KN-1),INAME(KN)       INMXL1     56
     *                     ,NDGC(N)                                     INMXL1     57
         WRITE(MSG(2),9020) 'TB',DDAT(JMX+3),TMIN                       INMXL1     58
         IF(MTFLAG.EQ.0) THEN                                           INMXL1     59
            CALL PRTMSG(2)                                              INMXL1     60
         ELSE                                                           INMXL1     61
            WRITE(MSG(3),9030) 'TB',0.0                                 INMXL1     62
            CALL PRTMSG(3)                                              INMXL1     63
            DDAT(JMX+3)=0.0                                             INMXL1     64
         ENDIF                                                          INMXL1     65
      ENDIF                                                             INMXL1     66
C                                                                       INMXL1     67
C  INITIALIZE UNDEFINED PARAMETERS                                      INMXL1     68
C                                                                       INMXL1     69
      IF (IDDAT(JMX+4).EQ.0) DDAT(JMX+4)=BIG                            INMXL1     70
      IF (IDDAT(JMX+5).EQ.0) DDAT(JMX+5)=99.0                           INMXL1     71
      IF (IDDAT(JMX+6).EQ.0) DDAT(JMX+6)=1.0                            INMXL1     72
      IF (IDDAT(JMX+7).EQ.0) DDAT(JMX+7)=2.0                            INMXL1     73
      IF (DDAT(JMX+8).LT.0.0) THEN                                      INMXL1     74
         DDAT(JMX+9)=DDAT(JMX+8)                                        INMXL1     75
         DDAT(JMX+8)=DDAT(JMX+7)+(DDAT(JMX+6)-DDAT(JMX+5))/DDAT(JMX+9)  INMXL1     76
      ELSE                                                              INMXL1     77
         IF (IDDAT(JMX+8).EQ.0) DDAT(JMX+8)=20.0                        INMXL1     78
         DDAT(JMX+9)=(DDAT(JMX+5)-DDAT(JMX+6))/(DDAT(JMX+7)-            INMXL1     79
     +                DDAT(JMX+8))                                      INMXL1     80
      ENDIF                                                             INMXL1     81
C                                                                       INMXL1     82
C  INITIALIZE THE STATES                                                INMXL1     83
C                                                                       INMXL1     84
      IF (EFDN.GE.DDAT(JMX+6)) THEN                                     INMXL1     85
         DDAT(JMX+10)=0.0                                               INMXL1     86
      ELSE                                                              INMXL1     87
         DDAT(JMX+10)=-1.0                                              INMXL1     88
      END IF                                                            INMXL1     89
C                                                                       INMXL1     90
      XSTATE(JSTATE+1)=0.0                                              INMXL1     91
      VMXL(JYMX+1)=0.0                                                  INMXL1     92
      YIFL(JYMX+2)=0.0                                                  INMXL1     93
C                                                                       INMXL1     94
      IF (LDEB) THEN                                                    INMXL1     95
         WRITE(IUD6,2010) (DDAT(JMX+I),I=1,10)                          INMXL1     96
         WRITE(IUD6,2020) (XSTATE(JSTATE+I),I=1,1)                      INMXL1     97
         WRITE(IUD6,2030) (YVAR(JYMX+I),I=1,2)                          INMXL1     98
      ENDIF                                                             INMXL1     99
C                                                                       INMXL1    100
      JSTATE=JSTATE+1                                                   INMXL1    101
      JY=JY+2                                                           INMXL1    102
C                                                                       INMXL1    103
 2010 FORMAT(1X,'INMXL1-DB:DDAT   ',9G12.5)                             INMXL1    104
 2020 FORMAT(1X,'INMXL1-DB:XSTATE ',9G12.5)                             INMXL1    105
 2030 FORMAT(1X,'INMXL1-DB:Y-VAR  ',9G12.5)                             INMXL1    106
 9000 FORMAT(' *** WARNING GENERATOR AT BUS: ',I5,' STATION: ',3A4      INMXL1    107
     *,' GID:',A4)                                                      INMXL1    108
 9020 FORMAT(5X,'MXL ',A,'=',F8.6,' IS BELOW THE LIMIT VALUE OF '       INMXL1    109
     *,F4.2)                                                            INMXL1    110
 9030 FORMAT(5X,A,' HAS BEEN SET TO ',F4.2)                             INMXL1    111
C                                                                       INMXL1    112
      RETURN                                                            INMXL1    113
      END                                                               INMXL1    114
