source: branches/start/MagicSoft/Simulation/Corsika/Mmcs/mscat.f@ 18569

Last change on this file since 18569 was 286, checked in by harald, 25 years ago
This is the start point for further developments of the Magic Monte Carlo Simulation written by Jose Carlos Gonzales. Now it is under control of one CVS repository for the whole collaboration. Everyone should use this CVS repository for further developments.
File size: 5.4 KB
Line 
1 SUBROUTINE MSCAT
2C VERSION 4.00 -- 26 JAN 1986/1900
3C******************************************************************
4 COMMON/ELECIN/EKELIM,ICOMP,EKE0,EKE1,CMFP0,CMFP1,RANGE0,RANGE1, XR
5 *0,TEFF0,BLCC,XCC,PICMP0(1),PICMP1(1),EICMP0(1),EICMP1(1),MPEEM(1),
6 * ESIG0(500),ESIG1(500),PSIG0(500),PSIG1(500),EDEDX0(500),EDEDX1(50
7 *0),PDEDX0(500),PDEDX1(500),EBR10(500),EBR11(500),PBR10(500),PBR11(
8 *500),PBR20(500),PBR21(500),TMXS0(500),TMXS1(500),CMFPE0(1),CMFPE1(
9 *1),CMFPP0(1),CMFPP1(1),ERANG0(1),ERANG1(1),PRANG0(1),PRANG1(1),CXC
10 *2E0(1),CXC2E1(1),CXC2P0(1),CXC2P1(1),CLXAE0(1),CLXAE1(1),CLXAP0(1)
11 *,CLXAP1(1), THR0(1,1),THR1(1,1),THR2(1,1),THRI0(1,1),THRI1(1,1),TH
12 *RI2(1,1),FSTEP(16),FSQR(16),MSMAP(200), VERT1(1000),VERT2(100,16),
13 *MSTEPS,JRMAX,MXV1, MXV2,NBLC,NRNTH,NRNTHI,BLC0,BLC1,RTHR0,RTHR1,RT
14 *HRI0,RTHRI1
15*KEEP,EPCONT.
16 COMMON/EPCONT/ EDEP,RATIO,TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP,IDISC,
17 * IROLD,IRNEW,RHOFAC, EOLD,ENEW,EKE,ELKE,BETA2,GLE,
18 * TSCAT,IAUSFL
19 DOUBLE PRECISION EDEP,RATIO
20 REAL TSTEP,TUSTEP,USTEP,TVSTEP,VSTEP,RHOFAC,EOLD,ENEW,
21 * EKE,ELKE,BETA2,GLE,TSCAT
22 INTEGER IDISC,IROLD,IRNEW,IAUSFL(29)
23*KEND.
24 COMMON/MISC/KMPI,KMPO,DUNIT,NOSCAT,MED(6),RHOR(6),IRAYLR(6)
25 COMMON/MULTS/NG21,B0G21,B1G21,G210(7),G211(7),G212(7), NG22,B0G22,
26 *B1G22,G220(8),G221(8),G222(8), NG31,B0G31,B1G31,G310(11),G311(11),
27 *G312(11), NG32,B0G32,B1G32,G320(25),G321(25),G322(25), NBGB,B0BGB,
28 *B1BGB,BGB0(8),BGB1(8),BGB2(8)
29*KEEP,RANDPA.
30 COMMON /RANDPA/ FAC,U1,U2,RD,NSEQ,ISEED,KNOR
31 DOUBLE PRECISION FAC,U1,U2
32 REAL RD(3000)
33 INTEGER ISEED(103,10),NSEQ
34 LOGICAL KNOR
35*KEEP,RUNPAR.
36 COMMON /RUNPAR/ FIXHEI,THICK0,HILOECM,HILOELB,
37 * STEPFC,NRRUN,NSHOW,PATAPE,MONIIN,
38 * MONIOU,MDEBUG,NUCNUC,
39 * CETAPE,
40 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
41 * N1STTR,MDBASE,
42 * DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
43 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
44 * ,GHEISH,GHESIG
45 COMMON /RUNPAC/ DSN,HOST,USER
46 DOUBLE PRECISION FIXHEI,THICK0,HILOECM,HILOELB
47 REAL STEPFC
48 INTEGER NRRUN,NSHOW,PATAPE,MONIIN,MONIOU,MDEBUG,NUCNUC,
49 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
50 * N1STTR,MDBASE
51 INTEGER CETAPE
52 CHARACTER*79 DSN
53 CHARACTER*20 HOST,USER
54
55 LOGICAL DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
56 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
57 * ,GHEISH,GHESIG
58*KEEP,STACKE.
59 COMMON/STACKE/ E,TIME,X,Y,Z,U,V,W,DNEAR,IQ,IGEN,IR,IOBS,LPCTE,NP
60 DOUBLE PRECISION E(60),TIME(60)
61 REAL X(60),Y(60),Z(60),U(60),V(60),W(60),DNEAR(60)
62 INTEGER IQ(60),IGEN(60),IR(60),IOBS(60),LPCTE(60),NP
63*KEND.
64 COMMON/THRESH/RMT2,RMSQ,ESCD2,AP,API,AE,UP,UE,TE,THMOLL
65 COMMON/UPHIIN/SINC0,SINC1,SIN0(20002),SIN1(20002)
66 COMMON/UPHIOT/THETA,SINTHE,COSTHE,SINPHI, COSPHI,PI,TWOPI,PI5D2
67 DOUBLE PRECISION PZERO,PRM,PRMT2,RMI,VC
68 COMMON/USEFUL/PZERO,PRM,PRMT2,RMI,VC,RM,MEDIUM,MEDOLD,IBLOBE,ICALL
69 COMMON/ACLOCK/NCLOCK,JCLOCK
70C_____IF (NCLOCK.GT.JCLOCK) THEN
71C______WRITE(MDEBUG,* )' MSCAT: NP=',NP,' IR=',IR(NP),' IOBS=',IOBS(NP)
72C______CALL AUSGB2
73C_____END IF
74 VSTEFF=TVSTEP*RHOFAC
75 OMEGA0=BLCC*VSTEFF/BETA2
76 IF ((OMEGA0.LE.1.0)) THEN
77 SINTHE=0.0
78 COSTHE=1.0
79 THETA=0.0
80 NOSCAT=NOSCAT+1
81 RETURN
82 END IF
83 BLC=LOG(OMEGA0)
84 IF (BLC.LE.1.30685) THEN
85 B=1.530394*BLC
86 ELSE
87 IB=B0BGB+BLC*B1BGB
88 IF (IB.GT.NBGB) THEN
89 WRITE(KMPO,940)IB
90940 FORMAT('MSCAT: NBGB<IB=',I5)
91 END IF
92 B=BGB0(IB)+BLC*(BGB1(IB)+BLC*BGB2(IB))
93 END IF
94 XR=XCC*SQRT(MAX(0.,VSTEFF*B))/(EOLD*BETA2)
95 IF (B.GT.2.0) THEN
96 BI=1./B
97 BMD=1./(1.0+1.75*BI)
98 BM1=(1.0-2.0*BI)*BMD
99 BM2=(1.0+0.025*BI)*BMD
100 ELSE
101 BI=0.5
102 BM1=(1.-2./B)*0.53333333
103 BM2=0.54
104 END IF
105951 CONTINUE
106 CALL RMMAR(RMS1,1,2)
107 IF (RMS1.LE.BM1) THEN
108 CALL RMMAR(RMS2,1,2)
109 IF((RMS2.EQ.0.0))RMS2=1.E-30
110 THR=SQRT(MAX(0.,-LOG(RMS2)))
111 ELSE IF((RMS1.LE.BM2)) THEN
112 CALL RMMAR(RD,3,2)
113 RMS3=RD(1)
114 RMS4=RD(2)
115 RMS5=RD(3)
116 ETA=MAX(RMS3,RMS4)
117 I31=B0G31+ETA*B1G31
118 G31=G310(I31)+ETA*(G311(I31)+ETA*G312(I31))
119 I32=B0G32+ETA*B1G32
120 G32=G320(I32)+ETA*(G321(I32)+ETA*G322(I32))
121 G3=G31+G32*BI
122 IF((RMS5.GT.G3))GO TO951
123 THR=1.0/ETA
124 ELSE
125 CALL RMMAR(RD,2,2)
126 RMS6=RD(1)
127 RMS7=RD(2)
128 THR=RMS6
129 I21=B0G21+THR*B1G21
130 G21=G210(I21)+THR*(G211(I21)+THR*G212(I21))
131 I22=B0G22+THR*B1G22
132 G22=G220(I22)+THR*(G221(I22)+THR*G222(I22))
133 G2=G21+G22*BI
134 IF((RMS7.GT.G2))GO TO951
135 END IF
136 THETA=THR*XR
137 IF((THETA.GE.PI))GO TO951
138 LTHETA=SINC1*THETA+SINC0
139 SINTHE=SIN1(LTHETA)*THETA+SIN0(LTHETA)
140 CALL RMMAR(RMS8,1,2)
141 IF(((RMS8*RMS8*THETA.LE.SINTHE)))GO TO952
142 GO TO 951
143952 CONTINUE
144 CTHET=PI5D2-THETA
145 LCTHET=SINC1*CTHET+SINC0
146 COSTHE=SIN1(LCTHET)*CTHET+SIN0(LCTHET)
147 RETURN
148 END
Note: See TracBrowser for help on using the repository browser.