23 IMPLICIT DOUBLE PRECISION (
a-
h,
o-
z)
47 2/mn7ext/ u(mne) ,alim(mne) ,blim(mne)
48 3/mn7err/ erp(mni) ,ern(mni) ,werr(mni) ,globcc(mni)
49 4/mn7inx/ nvarl(mne) ,niofex(mne),nexofi(mni)
50 5/mn7int/
x(mni) ,xt(mni) ,dirin(mni)
51 6/mn7fx2/
xs(mni) ,xts(mni) ,dirins(mni)
52 7/mn7der/ grd(mni) ,g2(mni) ,gstep(mni) ,gin(mne) ,dgrd(mni)
53 8/mn7fx3/ grds(mni) ,g2s(mni) ,gsteps(mni)
54 9/mn7fx1/ ipfix(mni) ,npfix
55 a/mn7var/ vhmat(mnihl)
56 b/mn7vat/ vthmat(mnihl)
57 c/mn7sim/
p(mni,mni+1),pstar(mni),pstst(mni) ,pbar(mni),prho(mni)
59 parameter(maxdbg=10, maxstk=10, maxcwd=20,
maxp=30, maxcpt=101)
62 d/mn7npr/ maxint ,npar ,maxext ,nu
63 e/mn7iou/ isysrd ,isyswr ,isyssa ,npagwd ,npagln ,newpag
64 e/mn7io2/ istkrd(maxstk) ,nstkrd ,istkwr(maxstk) ,nstkwr
65 f/mn7tit/ cfrom ,cstatu ,ctitl ,cword ,cundef ,cvrsn ,covmes
66 g/mn7flg/ isw(7) ,idbg(0:maxdbg) ,nblock ,icomnd
67 h/mn7min/ amin ,
up ,edm ,fval3 ,epsi ,apsi ,dcovar
68 i/mn7cnv/ nfcn ,nfcnmx ,nfcnlc ,nfcnfr ,itaur,istrat,nwrmes(2)
70 k/mn7log/ lwarn ,lrepor ,limset ,lnolim ,lnewmn ,lphead
71 l/mn7cns/ epsmac ,epsma2 ,vlimlo ,vlimhi ,undefi ,bigedm,updflt
72 m/mn7rpt/ xpt(maxcpt) ,ypt(maxcpt)
73 n/mn7cpt/ chpt(maxcpt)
74 o/mn7xcr/ xmidcr ,ymidcr ,xdircr ,ydircr ,ke1cr ,ke2cr
75 CHARACTER ctitl*50, cword*(maxcwd), cundef*10, cfrom*8,
76 + cvrsn*6, covmes(0:3)*22, cstatu*10, chpt*1
77 LOGICAL lwarn, lrepor, limset, lnolim, lnewmn, lphead
79 dimension dsav(mni),
y(mni+1)
82 IF (npar .LE. 0)
RETURN 83 IF (amin .EQ. undefi)
CALL mnamin(fcn,futil)
89 IF (nloop .LE. 0) nloop = npar + 4
102 CALL mnvert(
p,maxint,maxint,npar,ifail)
103 IF (ifail .GE. 1)
GO TO 280
109 12 vthmat(ndex) =
p(
i,
j)
114 dirin(
i) = 2.0*dsav(
i)
116 25
x(
i) = xt(
i) + 2.0*dirin(
i)*(rnum-0.5)
119 IF (isw(5) .GE. 0)
WRITE (isyswr, 1040) loop
120 30
CALL mncalf(fcn,
x,ycalf,futil)
130 x(
i) = xi - dirin(
i) *(rnum-0.5)
133 IF (
y(
i) .LT. amin)
THEN 136 ELSE IF (
y(
i) .GT. amax)
THEN 150 IF (amin .LT. zero)
GO TO 95
151 IF (isw(2) .LE. 2)
GO TO 280
153 IF (sig2 .LT. ep .AND. edm.LT.ep )
GO TO 100
155 IF ((nfcn-npfn) .GT. nfcnmx)
GO TO 300
160 59 pb = pb + wg *
p(
i,
j)
161 pbar(
i) = pb - wg *
p(
i,jh)
162 60 pstar(
i)=(1.+alpha)*pbar(
i)-alpha*
p(
i,jh)
163 CALL mncalf(fcn,pstar,ycalf,futil)
165 IF(ystar.GE.amin)
GO TO 70
168 61 pstst(
i)=gamma*pstar(
i)+(1.-gamma)*pbar(
i)
169 CALL mncalf(fcn,pstst,ycalf,futil)
171 66
IF (ystst .LT.
y(jl))
GO TO 67
172 CALL mnrazz(ystar,pstar,
y,jh,jl)
174 67
CALL mnrazz(ystst,pstst,
y,jh,jl)
177 70
IF (ystar .GE.
y(jh))
GO TO 73
179 CALL mnrazz(ystar,pstar,
y,jh,jl)
180 IF (jhold .NE. jh)
GO TO 50
183 74 pstst(
i)=beta*
p(
i,jh)+(1.-beta)*pbar(
i)
184 CALL mncalf(fcn,pstst,ycalf,futil)
186 IF(ystst.GT.
y(jh))
GO TO 30
188 IF (ystst .LT. amin)
GO TO 67
189 CALL mnrazz(ystst,pstst,
y,jh,jl)
192 95
IF (isw(5) .GE. 0)
WRITE (isyswr,1000)
196 CALL fcn(nparx,gin,amin,u,4,futil)
199 dirin(
i) = reg*dsav(
i)
200 IF (abs(
x(
i)-xt(
i)) .GT. dirin(
i))
GO TO 150
203 150 nfcnmx = nfcnmx + npfn - nfcn
206 IF (amin .GE. apsi)
GO TO 325
208 dirin(
i) = 0.1 *dsav(
i)
209 IF (abs(
x(
i)-xt(
i)) .GT. dirin(
i))
GO TO 250
211 230
IF (amin .LT. apsi)
GO TO 350
215 IF (isw(2) .GE. 1)
THEN 217 dcovar = max(dcovar,
half)
222 nfcnmx = nfcnmx + npfn - nfcn
223 cstatu =
'NEW MINIMU' 224 IF (isw(5) .GE. 0)
WRITE (isyswr,1030)
227 280
IF (isw(5) .GT. 0)
WRITE (isyswr,1020)
230 325
DO 330
i= 1, npar
231 dirin(
i) = 0.01*dsav(
i)
236 IF (isw(5) .GT. 0)
WRITE (isyswr,1010)
239 IF (isw(2) .LT. 2)
GO TO 380
240 IF (loop .LT. nloop .AND. isw(1) .LT. 1)
GO TO 20
244 1000
FORMAT (54
h an improvement on the previous minimum has been found)
245 1010
FORMAT (51
h improve has returned
to region of original minimum)
246 1020
FORMAT (/44
h covariance matrix was not positive-definite)
247 1030
FORMAT (/38
h improve has found
a truly new minimum/1
h ,37(1
h*)/)
248 1040
FORMAT (/18
h start attempt no.,i2, 20
h to find new minimum)
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data h g *is for param c g data up(2, 1)/7.0d0/
dE dx *! Nuc Int sampling table e
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon true
subroutine mnvert(A, L, M, N, IFAIL)
real(4), dimension(:), allocatable, save h
subroutine mnprin(INKODE, FVAL)
! constants thru Cosmos real ! if multiplied to deg radian Torad ! light velocity m sec ! infinty ! kg m2 *Togpcm2 g cm2 ! g cm2 *Tokgpm2 kg m2 ! cm *Tom m ! m *Tocm cm ! g cm3 *Tokgpm3 kg m3 ! kg m3 *Togpcm3 g cm3 ! sec *Tonsec nsec ! Tesla m ! Avogadro *A2deninv ! mfp *n * xs
subroutine mnamin(FCN, FUTIL)
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer to
subroutine mncalf(FCN, PVEC, YCALF, FUTIL)
latitude latitude this system is used *****************************************************************! type coord sequence union map real y
dE dx *! Nuc Int sampling table d
subroutine mnsimp(FCN, FUTIL)
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
dE dx *! Nuc Int sampling table g
subroutine mnrazz(YNEW, PNEW, Y, JH, JL)
subroutine mnrn15(VAL, INSEED)
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
dE dx *! Nuc Int sampling table f
dE dx *! Nuc Int sampling table c