CFPRIME ADDCHR                                                          ADDCHR      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 ADDCHR (IBLK, NEW, IOLD)                               ADDCHR      3
CD                                                                      ADDCHR      4
CD    TO CREATE A NEW ENTRY IN A CHARACTER LIST                         ADDCHR      5
CD                                                                      ADDCHR      6
      INCLUDE 'CNUNIT.INS'                                              ADDCHR      7
      INCLUDE 'PARX.INS'                                                ADDCHR      8
      INCLUDE 'UDCA.INS'                                                ADDCHR      9
      INCLUDE 'UDCB.INS'                                                ADDCHR     10
      INCLUDE 'UDCC.INS'                                                ADDCHR     11
      INCLUDE 'UDCD.INS'                                                ADDCHR     12
      INCLUDE 'UDCH.INS'                                                ADDCHR     13
      INCLUDE 'UDCI.INS'                                                ADDCHR     14
      INCLUDE 'CNFLAG.INS'                                              ADDCHR     15
      INCLUDE 'CNMSG.INS'                                               ADDCHR     16
C                                                                       ADDCHR     17
      CHARACTER*20  SUBNAM                                              ADDCHR     18
C                                                                       ADDCHR     19
      LDEB=.FALSE.                                                      ADDCHR     20
C                                                                       ADDCHR     21
      IF(SDBG)THEN                                                      ADDCHR     22
         SUBNAM = 'ADDCHR ROUTINE.'                                     ADDCHR     23
      ELSE                                                              ADDCHR     24
         SUBNAM = ' '                                                   ADDCHR     25
      END IF                                                            ADDCHR     26
C                                                                       ADDCHR     27
C                                                                       ADDCHR     28
      NEW = IUDCFR                                                      ADDCHR     29
      IF(NEW.EQ.0)THEN                                                  ADDCHR     30
         WRITE(MSG(1),9000) SUBNAM                                      ADDCHR     31
         WRITE(MSG(2),9200)                                             ADDCHR     32
         WRITE(MSG(3),9210)                                             ADDCHR     33
         WRITE(MSG(4),9220)                                             ADDCHR     34
         CALL PRTMSG(5)                                                 ADDCHR     35
         MSG(1)='TERMINATED DUE TO ARRAY DIMENSIONS'                    ADDCHR     36
         CALL ASTOP(MSG(1),34)                                          ADDCHR     37
      END IF                                                            ADDCHR     38
C                                                                       ADDCHR     39
      IUDCFR = IUDCNX(IUDCFR)                                           ADDCHR     40
C                                                                       ADDCHR     41
      IF(IUDCPT(IBLK).EQ.0)THEN                                         ADDCHR     42
         IUDCPT(IBLK) = NEW                                             ADDCHR     43
      ELSE                                                              ADDCHR     44
         IUDCNX(IOLD) = NEW                                             ADDCHR     45
      END IF                                                            ADDCHR     46
C                                                                       ADDCHR     47
      IUDCNX(NEW) = 0                                                   ADDCHR     48
      IOLD = NEW                                                        ADDCHR     49
C BUG !                                                                 ADDCHR     50
C      UIDENT(NEW) = ' '                                                ADDCHR     51
C                                                                       ADDCHR     52
C---------------------------------------------------------------------  ADDCHR     53
C                                                                       ADDCHR     54
      RETURN                                                            ADDCHR     55
C                                                                       ADDCHR     56
C---------------------------------------------------------------------  ADDCHR     57
C                                                                       ADDCHR     58
 9000 FORMAT(' *** MTDC ERROR  ',A)                                     ADDCHR     59
 9200 FORMAT(5X                                                         ADDCHR     60
     *,'THE MAXIMUM STORAGE FOR THE CHARACTER LINKED LIST')             ADDCHR     61
 9210 FORMAT(5X,'HAS BEEN EXCEEDED. TO CHANGE THE SIZE OF THIS LIST,')  ADDCHR     62
 9220 FORMAT(5X                                                         ADDCHR     63
     *,'CHANGE THE NUDCC PARAMETER IN INCLUDE PARX.')                   ADDCHR     64
C                                                                       ADDCHR     65
C---------------------------------------------------------------------  ADDCHR     66
C                                                                       ADDCHR     67
      END                                                               ADDCHR     68
