source: trunk/MagicSoft/Simulation/Corsika/Mmcs/amotry.f@ 15369

Last change on this file since 15369 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: 2.2 KB
Line 
1 DOUBLE PRECISION FUNCTION AMOTRY(P,Y,PSUM,MP,NP,NDIM,FUNK,IHI,FAC)
2
3C-----------------------------------------------------------------------
4C
5C REFERENCE : NUMERICAL RECIPES, W.H. PRESS ET AL.,
6C CAMBRIDGE UNIVERSITY PRESS, 1992 ISBN 0 521 43064 X
7C ADAPTED FOR DOUBLE PRECISION
8C THIS SUBROUTINE IS CALLED FROM AMOEBA
9C-----------------------------------------------------------------------
10
11 IMPLICIT NONE
12*KEEP,RUNPAR.
13 COMMON /RUNPAR/ FIXHEI,THICK0,HILOECM,HILOELB,
14 * STEPFC,NRRUN,NSHOW,PATAPE,MONIIN,
15 * MONIOU,MDEBUG,NUCNUC,
16 * CETAPE,
17 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
18 * N1STTR,MDBASE,
19 * DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
20 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
21 * ,GHEISH,GHESIG
22 COMMON /RUNPAC/ DSN,HOST,USER
23 DOUBLE PRECISION FIXHEI,THICK0,HILOECM,HILOELB
24 REAL STEPFC
25 INTEGER NRRUN,NSHOW,PATAPE,MONIIN,MONIOU,MDEBUG,NUCNUC,
26 * SHOWNO,ISHW,NOPART,NRECS,NBLKS,MAXPRT,NDEBDL,
27 * N1STTR,MDBASE
28 INTEGER CETAPE
29 CHARACTER*79 DSN
30 CHARACTER*20 HOST,USER
31
32 LOGICAL DEBDEL,DEBUG,FDECAY,FEGS,FIRSTI,FIXINC,FIXTAR,
33 * FIX1I,FMUADD,FNKG,FPRINT,FDBASE
34 * ,GHEISH,GHESIG
35*KEND.
36
37 INTEGER MP,NP,NMAX
38 PARAMETER (NMAX=20)
39 DOUBLE PRECISION FAC,P(MP,NP),PSUM(NP),Y(MP),FUNK
40 DOUBLE PRECISION FAC1,FAC2,YTRY,PTRY(NMAX)
41 INTEGER IHI,NDIM,J
42 EXTERNAL FUNK
43CU USES FUNK
44C-----------------------------------------------------------------------
45
46 IF ( DEBUG ) WRITE(MDEBUG,*) 'AMOTRY:'
47
48 FAC1 = (1.D0-FAC)/NDIM
49 FAC2 = FAC1-FAC
50 DO 11 J=1,NDIM
51 PTRY(J) = PSUM(J) * FAC1 - P(IHI,J) * FAC2
52 11 CONTINUE
53 YTRY = FUNK(PTRY)
54 IF ( YTRY .LT. Y(IHI) ) THEN
55 Y(IHI) = YTRY
56 DO 12 J=1,NDIM
57 PSUM(J) = PSUM(J) - P(IHI,J) + PTRY(J)
58 P(IHI,J) = PTRY(J)
59 12 CONTINUE
60 ENDIF
61 AMOTRY = YTRY
62 RETURN
63 END
Note: See TracBrowser for help on using the repository browser.