23 IMPLICIT DOUBLE PRECISION (
a-
h,
o-
z)
48 2/mn7ext/ u(mne) ,alim(mne) ,blim(mne)
49 3/mn7err/ erp(mni) ,ern(mni) ,werr(mni) ,globcc(mni)
50 4/mn7inx/ nvarl(mne) ,niofex(mne),nexofi(mni)
51 5/mn7int/
x(mni) ,xt(mni) ,dirin(mni)
52 6/mn7fx2/
xs(mni) ,xts(mni) ,dirins(mni)
53 7/mn7der/ grd(mni) ,g2(mni) ,gstep(mni) ,gin(mne) ,dgrd(mni)
54 8/mn7fx3/ grds(mni) ,g2s(mni) ,gsteps(mni)
55 9/mn7fx1/ ipfix(mni) ,npfix
56 a/mn7var/ vhmat(mnihl)
57 b/mn7vat/ vthmat(mnihl)
58 c/mn7sim/
p(mni,mni+1),pstar(mni),pstst(mni) ,pbar(mni),prho(mni)
60 parameter(maxdbg=10, maxstk=10, maxcwd=20,
maxp=30, maxcpt=101)
63 d/mn7npr/ maxint ,npar ,maxext ,nu
64 e/mn7iou/ isysrd ,isyswr ,isyssa ,npagwd ,npagln ,newpag
65 e/mn7io2/ istkrd(maxstk) ,nstkrd ,istkwr(maxstk) ,nstkwr
66 f/mn7tit/ cfrom ,cstatu ,ctitl ,cword ,cundef ,cvrsn ,covmes
67 g/mn7flg/ isw(7) ,idbg(0:maxdbg) ,nblock ,icomnd
68 h/mn7min/ amin ,
up ,edm ,fval3 ,epsi ,apsi ,dcovar
69 i/mn7cnv/ nfcn ,nfcnmx ,nfcnlc ,nfcnfr ,itaur,istrat,nwrmes(2)
71 k/mn7log/ lwarn ,lrepor ,limset ,lnolim ,lnewmn ,lphead
72 l/mn7cns/ epsmac ,epsma2 ,vlimlo ,vlimhi ,undefi ,bigedm,updflt
73 m/mn7rpt/ xpt(maxcpt) ,ypt(maxcpt)
74 n/mn7cpt/ chpt(maxcpt)
75 o/mn7xcr/ xmidcr ,ymidcr ,xdircr ,ydircr ,ke1cr ,ke2cr
76 CHARACTER ctitl*50, cword*(maxcwd), cundef*10, cfrom*8,
77 + cvrsn*6, covmes(0:3)*22, cstatu*10, chpt*1
78 LOGICAL lwarn, lrepor, limset, lnolim, lnewmn, lphead
79 CHARACTER chere*10, charal*28, chsign*4
80 parameter(chere=
'MNCROS ', mlsb=3, maxitr=15, tlr=0.01)
81 dimension flsb(mlsb),alsb(mlsb), coeff(3)
84 DATA charal/
' .ABCDEFGHIJKLMNOPQRSTUVWXYZ'/
85 ldebug = (idbg(6) .GE. 1)
96 IF (ke2cr .EQ. 0)
THEN 110 IF (ke2cr .EQ. 0)
GO TO 100
115 IF (nvarl(kex) .LE. 1)
GO TO 100
116 IF (zdir .EQ. zero)
GO TO 100
118 IF (zdir .GT. zero) zlim = blim(kex)
119 aulim = min(aulim,(zlim-zmid)/zdir)
126 IF (aulim .LT. aopt+tla) limset = .
true.
127 CALL mneval(fcn,anext,fnext,ierev,futil)
129 IF (ldebug)
WRITE (isyswr,
'(A,I8,A,F10.5,A,2F10.5)')
130 +
' MNCROS: calls=',nfcn,
' AIM=',aim,
' F,A=',fnext,aopt
131 IF (ierev .GT. 0)
GO TO 900
132 IF (limset .AND. fnext .LE. aim)
GO TO 930
136 chpt(ipt)= charal(ipt:ipt)
139 fnext = max(fnext,aminsv+0.1*
up)
140 aopt = sqrt((
up)/(fnext-aminsv)) - 1.0
141 IF (abs(fnext-aim) .LT. tlf)
GO TO 800
144 IF (aopt .GT. one) aopt = one
146 IF (aopt .GT. aulim)
THEN 150 CALL mneval(fcn,aopt,fnext,ierev,futil)
152 IF (ldebug)
WRITE (isyswr,
'(A,I8,A,F10.5,A,2F10.5)')
153 +
' MNCROS: calls=',nfcn,
' AIM=',aim,
' F,A=',fnext,aopt
154 IF (ierev .GT. 0)
GO TO 900
155 IF (limset .AND. fnext .LE. aim)
GO TO 930
160 chpt(ipt)= charal(ipt:ipt)
162 dfda = (flsb(2)-flsb(1))/ (alsb(2)-alsb(1))
164 IF (dfda .GT. zero)
GO TO 460
165 300
CALL mnwarn(
'D',chere,
'Looking for slope of the right sign')
170 aopt = alsb(1) + 0.2*
REAL(it)
172 IF (aopt .GT. aulim)
THEN 176 CALL mneval(fcn,aopt,fnext,ierev,futil)
178 IF (ldebug)
WRITE (isyswr,
'(A,I8,A,F10.5,A,2F10.5)')
179 +
' MNCROS: calls=',nfcn,
' AIM=',aim,
' F,A=',fnext,aopt
180 IF (ierev .GT. 0)
GO TO 900
181 IF (limset .AND. fnext .LE. aim)
GO TO 930
186 chpt(ipt)= charal(ipt:ipt)
188 dfda = (flsb(2)-flsb(1))/ (alsb(2)-alsb(1))
189 IF (dfda .GT. zero)
GO TO 450
191 CALL mnwarn(
'W',chere,
'Cannot find slope of the right sign')
195 460 aopt = alsb(2) + (aim-flsb(2))/dfda
196 fdist = min(abs(aim -flsb(1)),abs(aim -flsb(2)))
197 adist = min(abs(aopt-alsb(1)),abs(aopt-alsb(2)))
199 IF (abs(aopt) .GT. one) tla = tlr*abs(aopt)
200 IF (adist .LT. tla .AND. fdist .LT. tlf)
GO TO 800
201 IF (ipt .GE. maxitr)
GO TO 950
202 bmin = min(alsb(1),alsb(2)) - 1.0
203 IF (aopt .LT. bmin) aopt = bmin
204 bmax = max(alsb(1),alsb(2)) + 1.0
205 IF (aopt .GT. bmax) aopt = bmax
208 IF (aopt .GT. aulim)
THEN 212 CALL mneval(fcn,aopt,fnext,ierev,futil)
214 IF (ldebug)
WRITE (isyswr,
'(A,I8,A,F10.5,A,2F10.5)')
215 +
' MNCROS: calls=',nfcn,
' AIM=',aim,
' F,A=',fnext,aopt
216 IF (ierev .GT. 0)
GO TO 900
217 IF (limset .AND. fnext .LE. aim)
GO TO 930
222 chpt(ipt)= charal(ipt:ipt)
226 ecarmn = abs(fnext-aim)
231 ecart = abs(flsb(
i) - aim)
232 IF (ecart .GT. ecarmx)
THEN 236 IF (ecart .LT. ecarmn)
THEN 240 IF (flsb(
i) .LT. aim) noless = noless + 1
244 IF (noless.EQ.1 .OR. noless.EQ.2)
GO TO 500
246 IF (noless .EQ. 0 .AND. ibest .NE. 3)
GO TO 950
249 IF (noless .EQ. 3 .AND. ibest .NE. 3)
THEN 255 alsb(iworst) = alsb(3)
256 flsb(iworst) = flsb(3)
257 dfda = (flsb(2)-flsb(1))/ (alsb(2)-alsb(1))
260 500
CALL mnpfit(alsb,flsb,3,coeff,sdev)
261 IF (coeff(3) .LE. zero)
CALL mnwarn (
'D',chere,
262 +
'Curvature is negative near contour line.')
263 determ = coeff(2)**2 - 4.*coeff(3)*(coeff(1)-aim)
264 IF (determ .LE. zero)
THEN 265 CALL mnwarn(
'D',chere,
'Problem 2, impossible determinant')
270 x1 = (-coeff(2) + rt)/(2.*coeff(3))
271 x2 = (-coeff(2) - rt)/(2.*coeff(3))
272 s1 = coeff(2) + 2.*
x1*coeff(3)
273 s2 = coeff(2) + 2.*
x2*coeff(3)
274 IF (s1*s2 .GT. zero)
WRITE (isyswr,
'(A)')
' MNCONTour problem 1' 277 IF (s2 .GT. zero)
THEN 283 IF (abs(aopt) .GT. one) tla = tlr*abs(aopt)
284 IF (abs(aopt-alsb(ibest)) .LT. tla .AND.
285 & abs(flsb(ibest)-aim) .LT. tlf)
GO TO 800
286 IF (ipt .GE. maxitr)
GO TO 950
293 ecarmn = abs(aim-flsb(1))
295 ecart = abs(flsb(
i) - aim)
296 IF (ecart .LT. ecarmn)
THEN 300 IF (ecart .GT. ecarmx) ecarmx = ecart
301 IF (flsb(
i) .GT. aim)
THEN 302 IF (iright .EQ. 0)
THEN 304 ELSE IF (flsb(
i) .GT. flsb(iright))
THEN 310 ELSE IF (ileft .EQ. 0)
THEN 312 ELSE IF (flsb(
i) .LT. flsb(ileft))
THEN 320 IF (ecarmx .GT. 10.*abs(flsb(iout)-aim))
321 & aopt =
half*aopt +
half*
half*(alsb(iright)+alsb(ileft))
324 IF (slope*smalla .GT. tlf) smalla = tlf/slope
325 aleft = alsb(ileft) + smalla
326 aright = alsb(iright) - smalla
328 IF (aopt .LT. aleft) aopt = aleft
329 IF (aopt .GT. aright) aopt = aright
330 IF (aleft .GT. aright)aopt =
half*(aleft + aright)
333 IF (aopt .GT. aulim)
THEN 338 CALL mneval(fcn,aopt,fnext,ierev,futil)
340 IF (ldebug)
WRITE (isyswr,
'(A,I8,A,F10.5,A,2F10.5)')
341 +
' MNCROS: calls=',nfcn,
' AIM=',aim,
' F,A=',fnext,aopt
342 IF (ierev .GT. 0)
GO TO 900
343 IF (limset .AND. fnext .LE. aim)
GO TO 930
347 chpt(ipt)= charal(ipt:ipt)
361 900
IF (ierev .EQ. 1)
GO TO 940
376 IF (ypt(
i) .GT. aim+
up)
THEN 383 IF (xdircr .LT. zero) chsign =
'NEGA' 384 IF (ke2cr .EQ. 0)
WRITE (isyswr,
'(2X,A,A,I3)')
385 + chsign,
'TIVE MINOS ERROR, PARAMETER ',ke1cr
386 IF (itoohi .EQ. 1)
WRITE (isyswr,
'(10X,A)')
387 +
'POINTS LABELLED "+" WERE TOO HIGH TO PLOT.' 388 IF (iercr .EQ. 1)
WRITE (isyswr,
'(10X,A)')
389 +
'RIGHTMOST POINT IS UP AGAINST LIMIT.' 390 CALL mnplot(xpt,ypt,chpt,ipt,isyswr,npagwd,npagln)
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
block data include Zlatfit h c fitting region data x1(1)/0.03/
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/
subroutine mneval(FCN, ANEXT, FNEXT, IEREV, FUTIL)
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
real(4), dimension(:), allocatable, save h
! 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
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
dE dx *! Nuc Int sampling table d
subroutine mnpfit(PARX2P, PARY2P, NPAR2P, COEF2P, SDEV2P)
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
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 ! knockon is considered Obsolete *PhotoProd false
dE dx *! Nuc Int sampling table g
block data include Zlatfit h c fitting region data x2(1)/0.5/data x1(2)/0.3/
subroutine mnwarn(COPT, CORG, CMES)
subroutine mnplot(XPT, YPT, CHPT, NXYPT, NUNIT, NPAGWD, NPAGLN)
! 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