         SUBROUTINE CRACK(NPARA,OCCUP,OCCA,IN,IOUT,VALUE,IVALUE,ND)             
C                                                                               
C    THIS ROUTINE IS CALLED IF PARAMETER SELECTION CARD WAS  READ.   IT         
C    CRACKS OUT THE INFORMATION ABOUT  DAMPING  OR  RESET PARAMETERS TO         
C    ZERO. DAMPING IS DESIRED IF IPARA(I) IS GREATER 4,  RESET TO  ZERO         
C               IF IPARA(I) IS EQUAL TWO OR THREE.                              
C                                                                               
C                   BY UDO ZUCKER  NOVEMBER 1980                                
C                                                                               
C     INPUT VARIABLE                                                            
C     --------------                                                            
C                                                                               
C     NPARA = NUMBER OF PARAMETERS READ IN.                                     
C     OCCUP = ARRAY OF DIM 60.  TOTAL OCCUPANCY OF SITE                         
C     OCCA  = ARRAY OF DIM 60.  OCCUPANCY OF SITE A. ONLY IF MULTIPLE.          
C     IN    = STANDARD INPUT UNIT         IOUT =  STANDARD OUTPUT UNIT          
C     VALUE = DATA CONSISTS OF DAMPING FACTORS                                  
C     IVALUE= DATA CONSISTS OF DAMPING VALUES FOR OPUTPUT (HOLLERITH)           
C     ND    = NUMBER OF DAMPED PARAMETERS.                                      
C                                                                               
      REAL NAME1,NAME2,NAME1N,NAME2N                                            
      DOUBLE PRECISION POP,POPA,OUTPT,OUTPTN,XXYZ,BBETA,CCR,DDR,EER,FFR,        
     & BISO                                                                     
C                                                                               
      DIMENSION VALUE(5),ER(21,6), FR(28,6), NP(6), OCCUP(60), OCCA(60),        
     & NAME1(200), NAME2(200), OUTPT(200),NAME1N(200),NAME2N(200),OUTPTN        
     & (200),XXYZ(3),BBETA(6),CCR(10),DDR(15),EER(21),FFR(28),IVALUE(5)         
C                                                                               
      COMMON/A/BETA(6,60),G(3,3),ISOT(60),NATOM,TAG(2,60),TITLE(18),XYZ(        
     &3,60),PI,CR(10,60),DR(15,60),ALF(60),ITTYP(60)                            
      COMMON/LSMAT/B(200),IEXT,IPARA(1000),MRANK,KCYL,LABEL(3),JSCRF(10         
     &), NRSF, SIGMA, MDEGN, MAXIMA, IALFA(60), RDAMP(200), IDAMP(200),         
     & A(2200)                                                                  
      COMMON/G/BUFF(1023),FCURVE(9,20),IFMT(18),IWT,NSCAT,BETFAC,WVLNTH,        
     & WTFAC                                                                    
C                                                                               
      EQUIVALENCE (DR(1,41),ER),(DR(7,49),FR),(NAME1,BUFF),(NAME2,BUFF(         
     & 201)),(OUTPT,BUFF(401)),(NAME1N,BUFF(601)),(NAME2N,BUFF(801))            
C                                                                               
      DATA NO,NP/4H    ,5,10,20,35,56,84/                                       
C                                                                               
C                                                                               
      DATA POP,POPA          /8HPOP(TOT),8HPOP( A )/                            
C                                                                               
      DATA XXYZ   /8HX       ,8HY       ,8HZ       /                            
      DATA BISO   /8HISO. B  /                                                  
      DATA BBETA  /8HB11     ,8HB22     ,8HB33     ,8HB12     ,                 
     &             8HB13     ,8HB23     /                                       
      DATA CCR /8HC 111   ,8HC 222   ,8HC 333   ,8HC 112   ,8HC 122   ,         
     &          8HC 113   ,8HC 133   ,8HC 223   ,8HC 233   ,8HC 123   /         
      DATA DDR /8HD1111   ,8HD2222   ,8HD3333   ,8HD1112   ,8HD1113   ,         
     &          8HD1122   ,8HD1123   ,8HD1133   ,8HD1222   ,8HD1223   ,         
     &          8HD1233   ,8HD1333   ,8HD2223   ,8HD2233   ,8HD2333   /         
      DATA EER /8HE11111  ,8HE22222  ,8HE33333  ,8HE11112  ,8HE11113  ,         
     &          8HE11122  ,8HE11123  ,8HE11133  ,8HE11222  ,8HE11223  ,         
     &          8HE11233  ,8HE11333  ,8HE12222  ,8HE12223  ,8HE12233  ,         
     &          8HE12333  ,8HE13333  ,8HE22223  ,8HE22233  ,8HE22333  ,         
     &          8HE23333  /                                                     
      DATA FFR /8HF111111 ,8HF222222 ,8HF333333 ,8HF111112 ,8HF111113 ,         
     &          8HF111122 ,8HF111123 ,8HF111133 ,8HF111222 ,8HF111223 ,         
     &          8HF111233 ,8HF111333 ,8HF112222 ,8HF112223 ,8HF112233 ,         
     &          8HF112333 ,8HF113333 ,8HF122222 ,8HF122223 ,8HF122233 ,         
     &          8HF122333 ,8HF123333 ,8HF133333 ,8HF222223 ,8HF222233 ,         
     &          8HF222333 ,8HF223333 ,8HF233333 /                               
                                                                                
C                                                                               
C                                                                               
 2000 FORMAT(2F8.0)                                                             
 3000 FORMAT(/30H0DAMPING SELECTION INFORMATION/1X,29(1H-)//                    
     &16H PROGRAMME DAMPS,I5,26H  PARAMETER(S) (SEE LIST)./1H )                 
 4000 FORMAT(/28H0PARAMETER RESET INFORMATION/1X,27(1H-)//                      
     & 48H PROGRAMME SET THE FOLLOWING PARAMETERS TO ZERO.//1H )                
 4100 FORMAT((1H0,4(A8,5X,1H(,2A3,1H),9X)))                                     
 5000 FORMAT(/34H0SET OF PARAMETERS WITH NEW VALUES/1X,33(1H-)//                
     &44H0NEW VALUES ARE SHOWN IN THE PARAMETER LIST./ 1H )                     
 9001 FORMAT(/13H0ERRORMESSAGE/1X,12(1H-)//23H IN THE CURRENT VERSION,          
     &46H OF THE PROGRAMME ONLY 200 PARAMATERS ALLOWED.//                       
     &16H JOB TERMINATED.)                                                      
C---- INITIALIZE                                                                
C                                                                               
      LAST = 0                                                                  
      J    = 1                                                                  
      NR0  = 1                                                                  
      NRN  = 1                                                                  
      MR   = MRANK + 1                                                          
C                                                                               
C---- DO A LOOP OVER ALL PARAMETER SWITCHES READ.                               
C                                                                               
      DO 1 I = 1,NPARA                                                          
C                                                                               
C---- DID IPARA(I) CARRY ANY INFORMATION?                                       
C                                                                               
      IF(IPARA(I)) 2,1,2                                                        
C---- YES, BUT WAS THE INFORMATION SPECIAL?                                     
    2 IF(IPARA(I)-1) 4,3,4                                                      
C---- NO, ONLY REFINEMENT SWITCH WITHOUT DAMPING.                               
    3 IF(MR.GT.200) GOTO 9000                                                   
      IDAMP(MR) = NO                                                            
      RDAMP(MR) = 1.0                                                           
      MR = MR + 1                                                               
      GOTO 1                                                                    
C                                                                               
C---- YES, DAMPING OR RESET INFORMATION?                                        
C                                                                               
    4 IF(IPARA(I)-4) 100,99,1000                                                
C                                                                               
C---- RESET INFORMATION.                                                        
C                                                                               
C---- IN CASE OF IPARA=4 FURTHER REFINEMENT SELECTED.                           
C                                                                               
   99 IDAMP(MR)=NO                                                              
      RDAMP(MR)=1.0                                                             
      MR = MR + 1                                                               
C                                                                               
C---- NOW CRACK OUT ATOMNUMBER AND KIND OF PARAMETER.                           
C                                                                               
  100 IF(I.LE.LAST+NP(ISOT(J)+1)) GOTO 101                                      
      LAST = LAST + NP(ISOT(J)+1)                                               
      J    =  J   + 1                                                           
      GOTO 100                                                                  
C                                                                               
C---- J IS NUMBER OF ATOM, INDEX WILL BE NUMBER OF PARAMETER OF THIS            
C     ATOM.                                                                     
C                                                                               
  101 INDEX = I - LAST                                                          
C                                                                               
C---- RESET CORRESPONDING PARAMETER                                             
C                                                                               
      IF(INDEX-1)102,102,103                                                    
C                                                                               
C---- IT IS A POPULATION PARAMETER                                              
C                                                                               
  102 IF(IPARA(I).GT.2) GOTO 1002                                               
      OCCUP(J) = 0.0                                                            
      OCCA(J)  = 0.0                                                            
C                                                                               
C---- NO PARAMETER OF THIS ATOM MAY REFINED, IF POPULATION = 0.                 
C                                                                               
      DO 1021  ID = 1,NP(ISOT(J)+1)-1                                           
 1021 IPARA(ID+I) = 0                                                           
C---- SET OUTPUT                                                                
      OUTPT(NR0) = POP                                                          
      NAME1(NR0) = TAG(1,J)                                                     
      NAME2(NR0) = TAG(2,J)                                                     
      NR0 = NR0 + 1                                                             
      IPARA(I) = 0                                                              
      GOTO 1                                                                    
C---- SET OUTPUT FOR NEW VALUE AND READ IT.                                     
 1002 READ(IN,2000)OCCUP(J),OCCA(J)                                             
      IF(IPARA(I).EQ.3) IPARA(I)=0                                              
      IF(IPARA(I).EQ.4) IPARA(I)=1                                              
      OUTPTN(NRN) = POP                                                         
      NAME1N(NRN) = TAG(1,J)                                                    
      NAME2N(NRN) = TAG(2,J)                                                    
      NRN = NRN + 1                                                             
      IF(OCCA(J).LT.1.E-7) GOTO 1                                               
      OUTPT(NRN)  =  POPA                                                       
      NAME1N(NRN) =  TAG(1,J)                                                   
      NAME2N(NRN) =  TAG(2,J)                                                   
      NRN = NRN + 1                                                             
      GOTO 1                                                                    
C                                                                               
  103 IF(INDEX-4) 104,104,105                                                   
C                                                                               
C---- IT IS A LOCATION PARAMETER                                                
C                                                                               
  104 INDEX = INDEX -1                                                          
      IF(IPARA(I).GT.2) GOTO 1004                                               
      XYZ(INDEX,J) = 0.0                                                        
C---- SET OUTPUT                                                                
      OUTPT(NR0) = XXYZ(INDEX)                                                  
      NAME1(NR0) = TAG(1,J)                                                     
      NAME2(NR0) = TAG(2,J)                                                     
      IPARA(I) = 0                                                              
      NR0 = NR0 + 1                                                             
      GOTO 1                                                                    
C---- SET OUTPUT FOR NEW VALUE AND READ IT.                                     
 1004 READ(IN,2000) XYZ(INDEX,J)                                                
      IF(IPARA(I).EQ.3) IPARA(I)=0                                              
      IF(IPARA(I).EQ.4) IPARA(I)=1                                              
      OUTPTN(NRN) = XXYZ(INDEX)                                                 
      NAME1N(NRN) = TAG(1,J)                                                    
      NAME2N(NRN) = TAG(2,J)                                                    
      NRN = NRN + 1                                                             
      GOTO 1                                                                    
C                                                                               
  105 IF(INDEX-10) 106,106,107                                                  
C                                                                               
C---- IT IS A THERMAL PARAMETER OF SECOND ORDER.                                
C                                                                               
  106 INDEX = INDEX - 4                                                         
      IF(IPARA(I).GT.2) GOTO 1006                                               
      BETA(INDEX,J) = 0.0                                                       
C---- SET OUTPUT                                                                
      OUTPT(NR0) = BBETA(INDEX)                                                 
      IF(ISOT(J).EQ.0) OUTPT(NR0) = BISO                                        
      NAME1(NR0) = TAG(1,J)                                                     
      NAME2(NR0) = TAG(2,J)                                                     
      IPARA(I) = 0                                                              
      NR0 = NR0 + 1                                                             
      GOTO 1                                                                    
C---- SET OUTPUT FOR NEW VALUE AND READ IT.                                     
 1006 READ(IN,2000) BETA(INDEX,J)                                               
      IF(IPARA(I).EQ.3) IPARA(I) = 0                                            
      IF(IPARA(I).EQ.4) IPARA(I) = 1                                            
      OUTPTN(NRN) = BBETA(INDEX)                                                
      IF(ISOT(J).EQ.0) OUTPT(NR0) = BISO                                        
      NAME1N(NRN) = TAG(1,J)                                                    
      NAME2N(NRN) = TAG(2,J)                                                    
      NRN = NRN + 1                                                             
      GOTO 1                                                                    
C                                                                               
  107 IF(INDEX-20) 108,108,109                                                  
C                                                                               
C---- IT IS A THIRD CUMULANT COEF.                                              
C                                                                               
  108 INDEX = INDEX - 10                                                        
      IF(IPARA(I).GT.2) GOTO 1008                                               
      CR(INDEX,J) = 0.0                                                         
C---- SET OUTPUT                                                                
      OUTPT(NR0) = CCR(INDEX)                                                   
      NAME1(NR0) = TAG(1,J)                                                     
      NAME2(NR0) = TAG(2,J)                                                     
      IPARA(I) = 0                                                              
      NR0 = NR0 + 1                                                             
      GOTO 1                                                                    
C---- SET OUTPUT FOR NEW VALUE AND READ IT.                                     
 1008 READ(IN,2000) CR(INDEX,J)                                                 
      IF(IPARA(I).EQ.3) IPARA(I) = 0                                            
      IF(IPARA(I).EQ.4) IPARA(I) = 1                                            
      OUTPTN(NRN) = CCR(INDEX)                                                  
      NAME1N(NRN) = TAG(1,J)                                                    
      NAME2N(NRN) = TAG(2,J)                                                    
      NRN = NRN + 1                                                             
      GOTO 1                                                                    
C                                                                               
  109 IF(INDEX-35) 110,110,111                                                  
C                                                                               
C---- IT IS A FOURTH ORDER CUMULANT COEF.                                       
C                                                                               
  110 INDEX = INDEX - 20                                                        
      IF(IPARA(I).GT.2) GOTO 1010                                               
      DR(INDEX,J) = 0.0                                                         
C---- SET OUTPUT                                                                
      OUTPT(NR0) = DDR(INDEX)                                                   
      NAME1(NR0) = TAG(1,J)                                                     
      NAME2(NR0) = TAG(2,J)                                                     
      IPARA(I) = 0                                                              
      NR0 = NR0 + 1                                                             
      GOTO 1                                                                    
C---- SET OUTPUT FOR NEW VALUE AND READ IT.                                     
 1010 READ(IN,2000) DR(INDEX,J)                                                 
      IF(IPARA(I).EQ.3) IPARA(I) = 0                                            
      IF(IPARA(I).EQ.4) IPARA(I) = 1                                            
      OUTPTN(NRN) = DDR(INDEX)                                                  
      NAME1N(NRN) = TAG(1,J)                                                    
      NAME2N(NRN) = TAG(2,J)                                                    
      NRN = NRN + 1                                                             
      GOTO 1                                                                    
C                                                                               
  111 IF(INDEX-56) 112,112,113                                                  
C                                                                               
C---- IT IS A FIFTH CUMULANT COEF.                                              
C                                                                               
  112 INDEX = INDEX - 35                                                        
      IF(IPARA(I).GT.2) GOTO 1012                                               
      ER(INDEX,J) = 0.0                                                         
C---- SET OUTPUT                                                                
      OUTPT(NR0) = EER(INDEX)                                                   
      NAME1(NR0) = TAG(1,J)                                                     
      NAME2(NR0) = TAG(2,J)                                                     
      IPARA(I) = 0                                                              
      NR0 = NR0 + 1                                                             
      GOTO 1                                                                    
C---- SET OUTPUT FOR NEW VALUE AND READ IT.                                     
 1012 READ(IN,2000) ER(INDEX,J)                                                 
      IF(IPARA(I).EQ.3) IPARA(I) = 0                                            
      IF(IPARA(I).EQ.4) IPARA(I) = 1                                            
      OUTPTN(NRN) = EER(INDEX)                                                  
      NAME1N(NRN) = TAG(1,J)                                                    
      NAME2N(NRN) = TAG(2,J)                                                    
      NRN = NRN + 1                                                             
      GOTO 1                                                                    
C                                                                               
C---- IT IS A SIXTH ORDER CUMULANT COEF.                                        
C                                                                               
  113 INDEX = INDEX - 56                                                        
      IF(IPARA(I).GT.2) GOTO 1014                                               
      FR(INDEX,J) = 0.0                                                         
C---- SET OUTPUT                                                                
      OUTPT(NR0) = FFR(INDEX)                                                   
      NAME1(NR0) = TAG(1,J)                                                     
      NAME2(NR0) = TAG(2,J)                                                     
      IPARA(I) = 0                                                              
      NR0 = NR0 + 1                                                             
      GOTO 1                                                                    
C---- SET OUTPUT FOR NEW VALUE AND READ IT.                                     
 1014 READ(IN,2000) FR(INDEX,J)                                                 
      IF(IPARA(I).EQ.3) IPARA(I) = 0                                            
      IF(IPARA(I).EQ.4) IPARA(I) = 1                                            
      OUTPTN(NRN) = FFR(INDEX)                                                  
      NAME1N(NRN) = TAG(1,J)                                                    
      NAME2N(NRN) = TAG(2,J)                                                    
      NRN = NRN + 1                                                             
      GOTO 1                                                                    
C                                                                               
C                                                                               
C---- PART OF DAMPING                                                           
C                                                                               
 1000 IF(MR.GT.200) GOTO 9000                                                   
      RDAMP(MR)=VALUE(IPARA(I)-4)                                               
      IDAMP(MR)=IVALUE(IPARA(I)-4)                                              
      IPARA(I) = 1                                                              
      ND = ND + 1                                                               
      MR = MR + 1                                                               
      GOTO 1                                                                    
C                                                                               
    1 CONTINUE                                                                  
C                                                                               
C---- FINISH OUTPUT ARRAYS.                                                     
C                                                                               
      IF(ND.EQ.0) GOTO 1100                                                     
C                                                                               
      WRITE(IOUT,3000)ND                                                        
 1100 IF(NR0.EQ.1) GOTO 1200                                                    
      WRITE(IOUT,4000)                                                          
      WRITE(IOUT,4100)(OUTPT(I),NAME1(I),NAME2(I),I=1,NR0-1)                    
 1200 IF(NRN.EQ.1) GOTO 1300                                                    
      WRITE(IOUT,5000)                                                          
      WRITE(IOUT,4100)(OUTPTN(I),NAME1N(I),NAME2N(I),I=1,NRN-1)                 
C                                                                               
 1300 RETURN                                                                    
C                                                                               
C---- ERROR PART                                                                
C                                                                               
 9000 WRITE(IOUT,9001)                                                          
      CALL EXIT                                                                 
C                                                                               
      RETURN                                                                    
      END                                                                       
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
