23 IMPLICIT DOUBLE PRECISION (
a-
h,
o-
z)
50 2/mn7ext/ u(mne) ,alim(mne) ,blim(mne)
51 3/mn7err/ erp(mni) ,ern(mni) ,werr(mni) ,globcc(mni)
52 4/mn7inx/ nvarl(mne) ,niofex(mne),nexofi(mni)
53 5/mn7int/
x(mni) ,xt(mni) ,dirin(mni)
54 6/mn7fx2/
xs(mni) ,xts(mni) ,dirins(mni)
55 7/mn7der/ grd(mni) ,g2(mni) ,gstep(mni) ,gin(mne) ,dgrd(mni)
56 8/mn7fx3/ grds(mni) ,g2s(mni) ,gsteps(mni)
57 9/mn7fx1/ ipfix(mni) ,npfix
58 a/mn7var/ vhmat(mnihl)
59 b/mn7vat/ vthmat(mnihl)
60 c/mn7sim/
p(mni,mni+1),pstar(mni),pstst(mni) ,pbar(mni),prho(mni)
62 parameter(maxdbg=10, maxstk=10, maxcwd=20,
maxp=30, maxcpt=101)
65 d/mn7npr/ maxint ,npar ,maxext ,nu
66 e/mn7iou/ isysrd ,isyswr ,isyssa ,npagwd ,npagln ,newpag
67 e/mn7io2/ istkrd(maxstk) ,nstkrd ,istkwr(maxstk) ,nstkwr
68 f/mn7tit/ cfrom ,cstatu ,ctitl ,cword ,cundef ,cvrsn ,covmes
69 g/mn7flg/ isw(7) ,idbg(0:maxdbg) ,nblock ,icomnd
70 h/mn7min/ amin ,
up ,edm ,fval3 ,epsi ,apsi ,dcovar
71 i/mn7cnv/ nfcn ,nfcnmx ,nfcnlc ,nfcnfr ,itaur,istrat,nwrmes(2)
73 k/mn7log/ lwarn ,lrepor ,limset ,lnolim ,lnewmn ,lphead
74 l/mn7cns/ epsmac ,epsma2 ,vlimlo ,vlimhi ,undefi ,bigedm,updflt
75 m/mn7rpt/ xpt(maxcpt) ,ypt(maxcpt)
76 n/mn7cpt/ chpt(maxcpt)
77 o/mn7xcr/ xmidcr ,ymidcr ,xdircr ,ydircr ,ke1cr ,ke2cr
78 CHARACTER ctitl*50, cword*(maxcwd), cundef*10, cfrom*8,
79 + cvrsn*6, covmes(0:3)*22, cstatu*10, chpt*1
80 LOGICAL lwarn, lrepor, limset, lnolim, lnewmn, lphead
83 dimension xbest(mni), xmid(mni)
85 IF (mxfail .LE. 0) mxfail=100+20*npar
87 IF (amin .EQ. undefi)
CALL mnamin(fcn,futil)
89 IF (alpha .LE. zero) alpha=3.
90 IF (isw(5) .GE. 1)
WRITE (isyswr, 3) mxfail,mxstep,alpha
91 3
FORMAT (
' MNSEEK: MONTE CARLO MINIMIZATION USING METROPOLIS',
92 +
' ALGORITHM'/
' TO STOP AFTER',i6,
' SUCCESSIVE FAILURES, OR',
93 + i7,
' STEPS'/
' MAXIMUM STEP SIZE IS',f9.3,
' ERROR BARS.')
95 IF (isw(5) .GE. 2)
CALL mnprin(2,amin)
106 dirin(ipar) = 2.0*alpha*werr(ipar)
107 IF (nvarl(iext) .GT. 1)
THEN 110 IF (dxdi .EQ. zero) dxdi=1.
111 dirin(ipar) = 2.0*alpha*werr(ipar)/dxdi
112 IF (abs(dirin(ipar)).GT.twopi) dirin(ipar)=twopi
115 10 xbest(ipar) =
x(ipar)
117 DO 500 istep= 1, mxstep
118 IF (ifail .GE. mxfail)
GO TO 600
122 100
x(ipar) = xmid(ipar) + 0.5*(rnum1+rnum2-1.)*dirin(ipar)
124 CALL fcn(nparx,gin,ftry,u,4,futil)
126 IF (ftry .LT. flast)
THEN 127 IF (ftry .LT. amin)
THEN 128 cstatu =
'IMPROVEMNT' 131 200 xbest(ib) =
x(ib)
133 IF (isw(5) .GE. 2)
CALL mnprin(2,amin)
141 IF (bar .LT. log(rnum))
GO TO 500
152 IF (isw(5) .GT. 1)
WRITE (isyswr,601) ifail
153 601
FORMAT(
' MNSEEK:',i5,
' SUCCESSIVE UNSUCCESSFUL TRIALS.')
155 700
x(ib) = xbest(ib)
157 IF (isw(5) .GE. 1)
CALL mnprin(2,amin)
158 IF (isw(5) .EQ. 0)
CALL mnprin(0,amin)
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
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
subroutine mndxdi(PINT, IPAR, DXDI)
dE dx *! Nuc Int sampling table d
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 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