C                                                                      
C KINEMATICS OF NUCLEAR REACTIONS AND SCATTERING                        
C                                                                       
C NON-RELATIVISTIC KINEMATIC                                            
C 
      REAL*8 LABCM3,LABCM4 
      common/input/A1,A2,A3,A4,EP,QVALUE,THETA
      common/output/ANGLE3,E3,E4,ANGLE4,LABCM3,LABCM4,V3,V4
C
      PI=3.1415927                                                      
C
C
C satangd output >>> fort.21 <<<
C
C
      write(21,200)
  200 format(3H' '/10HX:Th^c$m$ /15HY:El$a$b$(MeV) )
      write(21,201)
  201 format(2Hc:/29Hc: Lab-Energy versus CM-Angle/2Hc:)
      write(21,202)
c  202 format(17HH:    X      Y,l0)
  202 format(25HH:    X      Y,l0   Y1,d0)
C
C
      WRITE(6,100)                                                      
 100  FORMAT(1X,' A1 = ')                                              
      READ(5,*) A1                                                      
      WRITE(6,101)                                                      
 101  FORMAT(1X,' A2 = ')                                               
      READ(5,*) A2                                                      
      WRITE(6,102)                                                      
 102  FORMAT(1X,' A3 = ')                                               
      READ(5,*) A3                                                      
      WRITE(6,103)                                                      
 103  FORMAT(1X,' A4 = ')                                              
      READ(5,*) A4                                                      
      WRITE(6,104)                                                      
 104  FORMAT(1X,' ELAB (MEV) =')                                        
      READ(5,*) EP                                                      
C
C
      QVALUE=(A1+A2-A3-A4)*931.478 
C
      WRITE(6,108) A1,A2,A3,A4,EP,QVALUE                                
 108  FORMAT(1X,'A1= ',F4.0,' A2= ',F4.0,' A3= ',F4.0,' A4=',F4.0,      
     1' EP = ',F7.2,'(MEV) Q-VALUE = ',F7.2,' (MEV)'/)                  
      WRITE(6,109)                                                      
 109  FORMAT(5X,'TH-CM      TH-3   E-3(MEV)   E-4(MEV)    TH-4',        
     1'    LAB/CM(3) LAB/CM(4) V-3/c    V-4/c'/) 
C                       
      DO 1 I=10,170,10                                                  
      THET=FLOAT(I)                                                     
      THETA=FLOAT(I)*PI/180.                                           
C
      CALL AKIN
C
C PYRAMIDE - counter   >> TOF <<
C
      D=4.685
      ANGLE=70.5*PI/180.
C
      R3=D/(COS(TH3)*COS(ANGLE)+SIN(TH3)*SIN(ANGLE))
      R4=D/(COS(TH4)*COS(ANGLE)+SIN(TH4)*SIN(ANGLE))
C
      T3=(R3/V3)*10**9
      T4=(R4/V4)*10**9
      TOF=T3-T4
C
      WRITE(6,110) THET,ANGLE3,E3,E4,ANGLE4,LABCM3,LABCM4,V3,V4
 110  FORMAT(1X,7F10.3,2E10.3)
C
C  
      WRITE(21,203) THET,E3,E4
 203  FORMAT(1X,3F10.3)                                        
c
C
c      WRITE(6,111) R3,R4,T3,T4,TOF
c  111 FORMAT(1X,'R3=',F10.3,'cm',' R4=',F10.3,'cm',
c     1' T3=',F10.3,'ns',' T4=',F10.3,'ns',' TOF=',F10.3,'ns') 
c      WRITE(6,111) T3,T4,TOF
c  111 FORMAT(1X,
c     1' T3=',F10.3,'ns',' T4=',F10.3,'ns',' TOF=',F10.3,'ns') 
C
C
    1 CONTINUE   
C
C
      write(21,211) 
  211 format(39hW:th^4$:/X(9) Y(1150) s(6) POS(0.7,0.5))
      write(21,213) 
  213 format(37hW:th^3$:/X(9) Y(50) s(6) POS(0.7,0.5))
C
      DO 2 I=25,175,25                                                  
C
C
      THET=FLOAT(I)                                                     
      THETA=FLOAT(I)*PI/180.                                           
C
      CALL AKIN
C
      write(21,212) ANGLE4,THET
  212 format(2hW:,f5.1,3h/X(,f4.0,27h) Y(1150) s(5) POS(0.7,0.5))
      write(21,214) ANGLE3,THET
  214 format(2hW:,f5.1,3h/X(,f4.0,25h) Y(50) s(5) POS(0.7,0.5))
C
C
    2 CONTINUE   
C
C
      write(21,220)
  220 format(43hP: XMIN(0.) XMAX(180.) YMIN(0.) YMAX(1200.)) 
      write(21,221)
  221 format(38HP: SHIF(0) SYMB(6) SCAL(0.6) FORM(1.2))
      write(21,222)
  222 format(35HP: POLY(2) AXFA(1.2) CMOD(3) UN(MM))
      write(21,223)
  223 format(28HP: XIN YIN XLI YLI NOSP TICI)
      write(21,224)
  224 format(9HP: WEI(0))
C
C
C                                                      
      STOP                                                             
      END                                                              
C 
      SUBROUTINE AKIN
C                                                                       
      REAL*8 LABCM3,LABCM4 
      common/input/A1,A2,A3,A4,EP,QVALUE,THETA
      common/output/ANGLE3,E3,E4,ANGLE4,LABCM3,LABCM4,V3,V4
C 
      PI=3.1415927                                                      
      Q=0.                                                                      
C 
      ECM=EP*A2/(A1+A2)                                                 
      VS=SQRT(2.*A1*EP)/(A1+A2)                                         
      V3CM=SQRT(2.*A4*(ECM+Q)/(A3*(A1+A2)))                            
      V4CM=SQRT(2.*A3*(ECM+Q)/(A4*(A1+A2)))                             
C                                                                       
C ENERGY AND ANGLE IN LAB-SYSTEM                                        
C                                                                      
      V32=VS**2+V3CM**2+2.*VS*V3CM*COS(THETA)                          
      E3=A3*V32/2.                                                      
      TH3=ACOS((VS+V3CM*COS(THETA))/SQRT(V32))                          
      E4=EP-E3+QVALUE                                                   
      V42=2.*E4/A4                                                      
      TH4=ACOS((VS-V4CM*COS(THETA))/SQRT(V42))                         
C                                                                       
C SOLID ANGLE IN LAB SYSTEM                                             
C                                                                       
      LABCM3=(SIN(TH3)**2)*COS(THETA-TH3)/(SIN(THETA)**2)               
      LABCM4=(SIN(TH4)**2)*COS(PI-THETA-TH4)/(SIN(PI-THETA)**2)         
C                                                                       
      ANGLE3=TH3*180./PI                                                
      ANGLE4=TH4*180./PI                                                
C
C VELOCITIES
C
      V3=1.389E+9*SQRT(E3/A3)
      V4=1.389E+9*SQRT(E4/A4)
      v3=v3/2.997925e+10
      v4=v4/2.997925e+10
C                                                      
      RETURN                                                             
      END                                                              
