source: trunk/MagicSoft/Simulation/Corsika/Mmcs/heigh.f@ 17165

Last change on this file since 17165 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: 4.4 KB
Line 
1C=======================================================================
2
3 DOUBLE PRECISION FUNCTION HEIGH( ARG )
4
5C-----------------------------------------------------------------------
6C HEIGH(T AS FUNCTION OF THICKNESS)
7C
8C CALCULATES HEIGHT DEPENDING ON THICKNESS OF ATMOSPHERE
9C (US STANDARD ATMOSPHERE)
10C THIS FUNCTION IS CALLED FROM MAIN, BOX2, BOX3, ININKG, INPRM,
11C MUTRAC, AND UPDATE
12C ARGUMENT:
13C ARG = MASS OVERLAY IN G/CM**2
14C-----------------------------------------------------------------------
15
16 IMPLICIT NONE
17
18*KEEP,ATMOS.
19 COMMON /ATMOS/ AATM,BATM,CATM,DATM
20 DOUBLE PRECISION AATM(5),BATM(5),CATM(5),DATM(5)
21*KEEP,RUNPAR.
22 COMMON /RUNPAR/ FIXHEI,THICK0,HILOECM,HILOELB,
23 * STEPFC,NRRUN,NSHOW,PATAPE,MONIIN,
24 * MONIOU,MDEBUG,NUCNUC,
25 * CETAPE,
26 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
27 * N1STTR,MDBASE,
28 * DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
29 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
30 * ,GHEISH,GHESIG
31 COMMON /RUNPAC/ DSN,HOST,USER
32 DOUBLE PRECISION FIXHEI,THICK0,HILOECM,HILOELB
33 REAL STEPFC
34 INTEGER NRRUN,NSHOW,PATAPE,MONIIN,MONIOU,MDEBUG,NUCNUC,
35 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
36 * N1STTR,MDBASE
37 INTEGER CETAPE
38 CHARACTER*79 DSN
39 CHARACTER*20 HOST,USER
40
41 LOGICAL DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
42 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
43 * ,GHEISH,GHESIG
44c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
45c Try
46c------------------------------------------------------------
47*KEEP,PARPAR.
48 COMMON /PARPAR/ CURPAR,SECPAR,PRMPAR,OUTPAR,C,
49 * E00,E00PN,PTOT0,PTOT0N,THICKH,ITYPE,LEVL
50 DOUBLE PRECISION CURPAR(14),SECPAR(14),PRMPAR(14),OUTPAR(14),
51 * C(50),E00,E00PN,PTOT0,PTOT0N,THICKH
52 INTEGER ITYPE,LEVL
53c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
54*KEND.
55C*******************************************************************
56C Modificado por Aitor (5-febrero-98)
57
58 common /aitor/ aitoth
59 double precision aitoth
60C*******************************************************************
61
62
63 DOUBLE PRECISION ARG,H,R,RT
64 PARAMETER (RT=6348.0D5)
65
66C-----------------------------------------------------------------------
67
68CC IF ( DEBUG ) WRITE(MDEBUG,*) 'HEIGH : ARG=',SNGL(ARG)
69
70
71c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
72c>> Modification (HZA trick) cancelled >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
73c>> JCG Wed Sep 21 10:49:14 MET DST 1998 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
74c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
75 IF ( ARG .GT. 631.1D0 ) THEN
76 HEIGH = CATM(1) * LOG ( BATM(1) / (ARG - AATM(1)) )
77 ELSEIF ( ARG .GT. 271.7D0 ) THEN
78 HEIGH = CATM(2) * LOG ( BATM(2) / (ARG - AATM(2)) )
79 ELSEIF ( ARG .GT. 3.0395D0 ) THEN
80 HEIGH = CATM(3) * LOG ( BATM(3) / (ARG - AATM(3)) )
81 ELSEIF ( ARG .GT. 0.00128292D0 ) THEN
82 HEIGH = CATM(4) * LOG ( BATM(4) / (ARG - AATM(4)) )
83 ELSE
84 HEIGH = (AATM(5) - ARG) * DATM(5)
85 ENDIF
86c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
87c IF ( ARG .GT. 631.1D0 ) THEN
88c H = CATM(1) * LOG ( BATM(1) / (ARG - AATM(1)) )
89c ELSEIF ( ARG .GT. 271.7D0 ) THEN
90c H = CATM(2) * LOG ( BATM(2) / (ARG - AATM(2)) )
91c ELSEIF ( ARG .GT. 3.0395D0 ) THEN
92c H = CATM(3) * LOG ( BATM(3) / (ARG - AATM(3)) )
93c ELSEIF ( ARG .GT. 0.00128292D0 ) THEN
94c H = CATM(4) * LOG ( BATM(4) / (ARG - AATM(4)) )
95c ELSE
96c H = (AATM(5) - ARG) * DATM(5)
97c ENDIF
98c
99cC************************************************************************
100cC Modificacion hecha por Aitor (5-febrero-98)
101c
102c HEIGH = (COS(aitoth))**2 * (-RT + SQRT(RT**2 +
103c * ((H**2 + (2.0D0*RT*H))/(COS(aitoth))**2)))
104c>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
105
106C************************************************************************
107
108C R = SQRT(CURPAR(7)**2+CURPAR(8)**2)
109C HEIGH = SQRT((RT+H)**2-R**2)-RT
110c print *,'HEIGH>>',ARG,r,heigh,curpar(7),curpar(8)
111
112 RETURN
113 END
Note: See TracBrowser for help on using the repository browser.