C   21/03/79 C9091701   MEMBER NAME  CHANLI   (JADEGS)      FORTRAN
      SUBROUTINE CHANLI
      IMPLICIT INTEGER*2 (H)
C---
C---     PROGRAM TO CHANGE LIMITS OF PATTERN RECOGNITION CONSTANTS
C---     UNDER GRAPHICS FOR JADE EXPERIMENT
C---------------------- J.OLSSON 21.3.79,     LATEST CHANGE 02.8.79
C---
      COMMON /CWORK1/ HWORK(100)
#include "cgraph.for"
#include "cpatlm.for"
C----------------------------------------------
C  MACRO CPATLM .... PATTERN RECOGNITION LIMITS
C----------------------------------------------
C     COMMON /CPATLM/ PATRLM( 5), FLINLM(10), TRELLM(20), ZFITLM(10),
C    *                BKK(20) , XYF(20) , IGFP(20) , XBKK(40) , IMCERT
C     INTEGER IXYF(20),LMPATR(2), LMFLIN(2),LMTREL(2),LMZFIT(2),IBKK(20)
C     DIMENSION GFP(20)
C     EQUIVALENCE     (PATRLM(1),LMPATR(1))
C    *               ,(FLINLM(1),LMFLIN(1)) , (TRELLM(1),LMTREL(1))
C    *               ,(ZFITLM(1),LMZFIT(1)) , (BKK(1),IBKK(1))
C    *               ,(XYF(1),IXYF(1))      , (GFP(1),IGFP(1))
C----------- END OF MACRO CPATLM --------------
      DIMENSION PLIM(146),KLIM(146)
      EQUIVALENCE(PLIM(1),PATRLM(1)),(PLIM(1),KLIM(1))
C
1     CALL TRMOUT(80,'ENTER 0 TO RETURN, 1 TO SHOW CURRENT VALUES, 2 TO
     $CHANGE A VALUE, 3 TO RESET^')
      NN = TERNUM(DUMM) + 1
      IF(NN.LT.1.OR.NN.GT.4) GO TO 1
      GO TO (100,200,300,400),NN
200   CONTINUE
      WRITE(JUSCRN,201) (LMPATR(I),I=1,5)
      WRITE(JUSCRN,202) (PATRLM(I),I=1,5)
201   FORMAT(' LMPATR ',5I8)
202   FORMAT(' PATRLM ',5E11.4)
      WRITE(JUSCRN,203) (LMFLIN(I),I=1,10)
      WRITE(JUSCRN,204) (FLINLM(I),I=1,10)
203   FORMAT(' LMFLIN ',5I8)
204   FORMAT(' FLINLM ',5E11.4)
      WRITE(JUSCRN,205) (LMTREL(I),I=1,20)
      WRITE(JUSCRN,206) (TRELLM(I),I=1,20)
205   FORMAT(' LMTREL ',5I8)
206   FORMAT(' TRELLM ',5E11.4)
      WRITE(JUSCRN,207) (LMZFIT(I),I=1,10)
      WRITE(JUSCRN,208) (ZFITLM(I),I=1,10)
207   FORMAT(' LMZFIT ',5I8)
208   FORMAT(' ZFITLM ',5E11.4)
      WRITE(JUSCRN,209) (IBKK(I),I=1,20)
      WRITE(JUSCRN,210) (BKK(I),I=1,20)
209   FORMAT(' IBKK ',5I8)
210   FORMAT(' BKK ',5E11.4)
      WRITE(JUSCRN,211) (IXYF(I),I=1,20)
      WRITE(JUSCRN,212) (XYF(I),I=1,20)
211   FORMAT(' IXYF ',5I8)
212   FORMAT(' XYF ',5E11.4)
      WRITE(JUSCRN,215) (IGFP(I),I=1,20)
      WRITE(JUSCRN,216) (GFP(I),I=1,20)
215   FORMAT(' IGFP ',5I8)
216   FORMAT(' GFP ',5E11.4)
      WRITE(JUSCRN,213) (XBKK(I),I=1,40)
213   FORMAT(' XBKK ',5E11.4)
      WRITE(JUSCRN,214) IMCERT
214   FORMAT(' IMCERT ',I4)
      GO TO 1
300   CALL TRMOUT(80,'COMMON CPATLM IS STRUCTURED AS FOLLOWS:^')
      CALL TRMOUT(80,'PATRLM(5),FLINLM(10),TRELLM(20),ZFITLM(10),^')
      CALL TRMOUT(80,'BKK(20),XYF(20),GFP(20),XBKK(40),IMCERT^')
      CALL TRMOUT(80,'ENTER RELATIV POSITION IN COMMON AND DESIRED VALUE
     $^')
      CALL TRMOUT(80,'FOR REALS, ENTER NEGATIV RELATIV POSITION AND DESI
     $RED VALUE^')
      CALL TONUM(NCO,ACO)
      IF(NCO.GT.0.AND.NCO.LT.147) GO TO 310
      IF(NCO.GE.0) GO TO 300
      NCO = IABS(NCO)
      IF(NCO.GT.146) GO TO 300
      OLDVAL = PLIM(NCO)
      PLIM(NCO) = ACO
      WRITE(JUSCRN,301) NCO,OLDVAL,PLIM(NCO)
301   FORMAT(' VAR.',I3,' CHANGED FROM ',E11.4,' TO NEW VALUE ',E11.4)
      GO TO 1
310   IOLVAL = KLIM(NCO)
      KLIM(NCO) = ACO
      WRITE(JUSCRN,311) NCO,IOLVAL,KLIM(NCO)
311   FORMAT(' VAR.',I3,' CHANGED FROM ',I10,' TO NEW VALUE ',I10)
      GO TO 1
400   CALL INPATR
      GO TO 1
100   RETURN
      END
