source: branches/start/MagicSoft/Simulation/Corsika/Mmcs/tarint.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.0 KB
Line 
1 SUBROUTINE TARINT
2
3C-----------------------------------------------------------------------
4C TAR(GET) INT(ERACTIONS)
5C
6C ROUTINE DETERMINES HOW MANY INTERACTIONS OCCUR IN TARGET
7C THIS SUBROUTINE IS CALLED FROM HDPM
8C-----------------------------------------------------------------------
9
10 IMPLICIT DOUBLE PRECISION (A-H,O-Z)
11*KEEP,DPMFLG.
12 COMMON /DPMFLG/ NFLAIN,NFLDIF,NFLPI0,NFLCHE,NFLPIF,NFRAGM
13 INTEGER NFLAIN,NFLDIF,NFLPI0,NFLCHE,NFLPIF,NFRAGM
14*KEEP,GNUPR.
15 COMMON /GNUPR/ SE14,SE16,SE40
16 DOUBLE PRECISION SE14(3,14),SE16(3,16),SE40(3,40)
17*KEEP,INTER.
18 COMMON /INTER/ AVCH,AVCH3,DC0,DLOG,DMLOG,ECMDIF,ECMDPM,ELAB,
19 * FNEUT,FNEUT2,GNU,PLAB,POSC2,POSC3,POSN2,POSN3,
20 * RC3TO2,S,SEUGF,SEUGP,SLOG,SLOGSQ,SMLOG,
21 * WIDC2,WIDC3,WIDN2,WIDN3,YCM,YY0,ZN,
22 * IDIF,ITAR
23 DOUBLE PRECISION AVCH,AVCH3,DC0,DLOG,DMLOG,ECMDIF,ECMDPM,ELAB,
24 * FNEUT,FNEUT2,GNU,PLAB,POSC2,POSC3,POSN2,POSN3,
25 * RC3TO2,S,SEUGF,SEUGP,SLOG,SLOGSQ,SMLOG,
26 * WIDC2,WIDC3,WIDN2,WIDN3,YCM,YY0,ZN
27 INTEGER IDIF,ITAR
28*KEEP,PARPAR.
29 COMMON /PARPAR/ CURPAR,SECPAR,PRMPAR,OUTPAR,C,
30 * E00,E00PN,PTOT0,PTOT0N,THICKH,ITYPE,LEVL
31 DOUBLE PRECISION CURPAR(14),SECPAR(14),PRMPAR(14),OUTPAR(14),
32 * C(50),E00,E00PN,PTOT0,PTOT0N,THICKH
33 INTEGER ITYPE,LEVL
34*KEEP,RANDPA.
35 COMMON /RANDPA/ FAC,U1,U2,RD,NSEQ,ISEED,KNOR
36 DOUBLE PRECISION FAC,U1,U2
37 REAL RD(3000)
38 INTEGER ISEED(103,10),NSEQ
39 LOGICAL KNOR
40*KEEP,REST.
41 COMMON /REST/ CONTNE,TAR,LT
42 DOUBLE PRECISION CONTNE(3),TAR
43 INTEGER LT
44*KEEP,RUNPAR.
45 COMMON /RUNPAR/ FIXHEI,THICK0,HILOECM,HILOELB,
46 * STEPFC,NRRUN,NSHOW,PATAPE,MONIIN,
47 * MONIOU,MDEBUG,NUCNUC,
48 * CETAPE,
49 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
50 * N1STTR,MDBASE,
51 * DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
52 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
53 * ,GHEISH,GHESIG
54 COMMON /RUNPAC/ DSN,HOST,USER
55 DOUBLE PRECISION FIXHEI,THICK0,HILOECM,HILOELB
56 REAL STEPFC
57 INTEGER NRRUN,NSHOW,PATAPE,MONIIN,MONIOU,MDEBUG,NUCNUC,
58 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
59 * N1STTR,MDBASE
60 INTEGER CETAPE
61 CHARACTER*79 DSN
62 CHARACTER*20 HOST,USER
63
64 LOGICAL DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
65 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
66 * ,GHEISH,GHESIG
67*KEEP,SIGM.
68 COMMON /SIGM/ SIGMA,SIGANN,SIGAIR,FRACTN,FRCTNO
69 DOUBLE PRECISION SIGMA,SIGANN,SIGAIR,FRACTN,FRCTNO
70*KEND.
71
72C-----------------------------------------------------------------------
73
74 IF ( DEBUG ) WRITE(MDEBUG,*) 'TARINT: ITYPE,TAR,NFLAIN',
75 * ITYPE,SNGL(TAR),NFLAIN
76
77C NFLAIN EQUAL 0 : NUMBER OF INTERACTIONS IN TARGET CHOSEN RANDOMLY
78 IF ( NFLAIN .EQ. 0 ) THEN
79C SIGMA IS ALREADY CALCULATED IN BOX2
80 DELSIG = SIGMA - 45.D0
81 DSIGSQ = DELSIG**2
82
83C CHOOSE RANDOM NUMBER
84 CALL RMMAR( RD,1,1 )
85 IF ( DEBUG ) WRITE(MDEBUG,*)'TARINT: DELSIG,DSIGSQ,RD(1),TAR=',
86 * SNGL(DELSIG),SNGL(DSIGSQ),RD(1),SNGL(TAR)
87
88C DO INTERACTION WITH CHOSEN TARGET ( N, O, AR )
89 PROB = 0.D0
90C TREAT INTERACTION WITH NITROGEN TARGET
91 IF ( TAR .EQ. 14.D0 ) THEN
92C SUM OF PROBABILITIES FOR COLLISION WITH NITROGEN TARGET
93 DO 6151 JL = 1,14
94 PROB = PROB +
95 * SE14(1,JL) + SE14(2,JL)*DELSIG + SE14(3,JL)*DSIGSQ
96 IF ( RD(1) .LE. PROB ) GOTO 7332
97 6151 CONTINUE
98
99C TREAT INTERACTION WITH OXYGEN TARGET
100 ELSEIF ( TAR .EQ. 16.D0 ) THEN
101C SUM OF PROBABILITIES FOR COLLISION WITH OXYGEN TARGET
102 DO 6152 JL = 1,16
103 PROB = PROB +
104 * SE16(1,JL) + SE16(2,JL)*DELSIG + SE16(3,JL)*DSIGSQ
105 IF ( RD(1) .LE. PROB ) GOTO 7332
106 6152 CONTINUE
107
108C TREAT INTERACTION WITH ARGON TARGET
109 ELSEIF ( TAR .EQ. 40.D0 ) THEN
110C SUM OF PROBABILITIES FOR COLLISION WITH ARGON TARGET
111 DO 6153 JL = 1,40
112 PROB = PROB +
113 * SE40(1,JL) + SE40(2,JL)*DELSIG + SE40(3,JL)*DSIGSQ
114 IF ( RD(1) .LE. PROB ) GOTO 7332
115 6153 CONTINUE
116 ELSE
117 WRITE(MONIOU,*) 'TARINT: UNKNOWN TARGET = ',SNGL(TAR)
118 ENDIF
119 JL = 1
120
121C NUMBER OF COLLISIONS IN TARGET
122 7332 CONTINUE
123 GNU = DBLE(JL)
124
125 ELSE
126C NFLAIN EQUAL 1 : AVERAGE NUMBER OF INTERACTIONS IN TARGET IS TAKEN
127C NEW PARAMETRIZATION OF J.N.CAPDEVIELLE (MARCH 93)
128 GNU = (0.4826D0 + 3.522D-2 * SLOG) * TAR**0.31D0
129 ENDIF
130 IF ( DEBUG ) WRITE(MDEBUG,*)
131 * 'TARINT: # COLLISIONS IN TARGET=',SNGL(GNU)
132
133 RETURN
134 END
Note: See TracBrowser for help on using the repository browser.