COSMOS v7.655  COSMOSv7655
(AirShowerMC)
mnpsdf.f
Go to the documentation of this file.
1 *
2 * $Id: mnpsdf.F,v 1.2 1996/03/15 18:02:50 james Exp $
3 *
4 * $Log: mnpsdf.F,v $
5 * Revision 1.2 1996/03/15 18:02:50 james
6 * Modified Files:
7 * mnderi.F eliminate possible division by zero
8 * mnexcm.F suppress print on STOP when print flag=-1
9 * set FVAL3 to flag if FCN already called with IFLAG=3
10 * mninit.F set version 96.03
11 * mnlims.F remove arguments, not needed
12 * mnmigr.F VLEN -> LENV in debug print statement
13 * mnparm.F move call to MNRSET to after NPAR redefined, to zero all
14 * mnpsdf.F eliminate possible division by zero
15 * mnscan.F suppress printout when print flag =-1
16 * mnset.F remove arguments in call to MNLIMS
17 * mnsimp.F fix CSTATU so status is PROGRESS only if new minimum
18 * mnvert.F eliminate possible division by zero
19 *
20 * Revision 1.1.1.1 1996/03/07 14:31:31 mclareni
21 * Minuit
22 *
23 *
24  SUBROUTINE mnpsdf
25 *
26 * $Id: d506dp.inc,v 1.1.1.1 1996/03/07 14:31:32 mclareni Exp $
27 *
28 * $Log: d506dp.inc,v $
29 * Revision 1.1.1.1 1996/03/07 14:31:32 mclareni
30 * Minuit
31 *
32 *
33 *
34 *
35 * d506dp.inc
36 *
37 C ************ DOUBLE PRECISION VERSION *************
38  IMPLICIT DOUBLE PRECISION (a-h,o-z)
39 CC calculates the eigenvalues of v to see if positive-def.
40 CC if not, adds constant along diagonal to make positive.
41 *
42 * $Id: d506cm.inc,v 1.1.1.1 1996/03/07 14:31:32 mclareni Exp $
43 *
44 * $Log: d506cm.inc,v $
45 * Revision 1.1.1.1 1996/03/07 14:31:32 mclareni
46 * Minuit
47 *
48 *
49 *
50 *
51 * d506cm.inc
52 *
53  parameter(mne=100 , mni=50)
54  parameter(mnihl=mni*(mni+1)/2)
55  CHARACTER*10 CPNAM
56  COMMON
57  1/mn7nam/ cpnam(mne)
58  2/mn7ext/ u(mne) ,alim(mne) ,blim(mne)
59  3/mn7err/ erp(mni) ,ern(mni) ,werr(mni) ,globcc(mni)
60  4/mn7inx/ nvarl(mne) ,niofex(mne),nexofi(mni)
61  5/mn7int/ x(mni) ,xt(mni) ,dirin(mni)
62  6/mn7fx2/ xs(mni) ,xts(mni) ,dirins(mni)
63  7/mn7der/ grd(mni) ,g2(mni) ,gstep(mni) ,gin(mne) ,dgrd(mni)
64  8/mn7fx3/ grds(mni) ,g2s(mni) ,gsteps(mni)
65  9/mn7fx1/ ipfix(mni) ,npfix
66  a/mn7var/ vhmat(mnihl)
67  b/mn7vat/ vthmat(mnihl)
68  c/mn7sim/ p(mni,mni+1),pstar(mni),pstst(mni) ,pbar(mni),prho(mni)
69 C
70  parameter(maxdbg=10, maxstk=10, maxcwd=20, maxp=30, maxcpt=101)
71  parameter(zero=0.0, one=1.0, half=0.5)
72  COMMON
73  d/mn7npr/ maxint ,npar ,maxext ,nu
74  e/mn7iou/ isysrd ,isyswr ,isyssa ,npagwd ,npagln ,newpag
75  e/mn7io2/ istkrd(maxstk) ,nstkrd ,istkwr(maxstk) ,nstkwr
76  f/mn7tit/ cfrom ,cstatu ,ctitl ,cword ,cundef ,cvrsn ,covmes
77  g/mn7flg/ isw(7) ,idbg(0:maxdbg) ,nblock ,icomnd
78  h/mn7min/ amin ,up ,edm ,fval3 ,epsi ,apsi ,dcovar
79  i/mn7cnv/ nfcn ,nfcnmx ,nfcnlc ,nfcnfr ,itaur,istrat,nwrmes(2)
80  j/mn7arg/ word7(maxp)
81  k/mn7log/ lwarn ,lrepor ,limset ,lnolim ,lnewmn ,lphead
82  l/mn7cns/ epsmac ,epsma2 ,vlimlo ,vlimhi ,undefi ,bigedm,updflt
83  m/mn7rpt/ xpt(maxcpt) ,ypt(maxcpt)
84  n/mn7cpt/ chpt(maxcpt)
85  o/mn7xcr/ xmidcr ,ymidcr ,xdircr ,ydircr ,ke1cr ,ke2cr
86  CHARACTER CTITL*50, CWORD*(maxcwd), CUNDEF*10, CFROM*8,
87  + cvrsn*6, covmes(0:3)*22, cstatu*10, chpt*1
88  LOGICAL LWARN, LREPOR, LIMSET, LNOLIM, LNEWMN, LPHEAD
89  CHARACTER CHBUFF*12
90  dimension s(mni)
91  epsmin = 1.0e-6
92  epspdf = max(epsmin, epsma2)
93  dgmin = vhmat(1)
94 C Check if negative or zero on diagonal
95  DO 200 i= 1, npar
96  ndex = i*(i+1)/2
97  IF (vhmat(ndex) .LE. zero) THEN
98  WRITE (chbuff(1:3),'(I3)') i
99  CALL mnwarn('W',cfrom,
100  +'Negative diagonal element'//chbuff(1:3)//' in Error Matrix')
101  ENDIF
102  IF (vhmat(ndex) .LT. dgmin) dgmin = vhmat(ndex)
103  200 CONTINUE
104  IF (dgmin .LE. zero) THEN
105  dg = (one+epspdf) - dgmin
106  WRITE (chbuff,'(E12.2)') dg
107  CALL mnwarn('W',cfrom,
108  + chbuff//' added to diagonal of error matrix')
109  ELSE
110  dg = zero
111  ENDIF
112 C Store VHMAT in P, make sure diagonal pos.
113  DO 213 i= 1, npar
114  ndex = i*(i-1)/2
115  ndexd = ndex + i
116  vhmat(ndexd) = vhmat(ndexd) + dg
117  IF (vhmat(ndexd) .LE. zero) vhmat(ndexd) = 1.0
118  s(i) = 1.0/sqrt(vhmat(ndexd))
119  DO 213 j= 1, i
120  ndex = ndex + 1
121  213 p(i,j) = vhmat(ndex) * s(i)*s(j)
122 C call eigen (p,p,maxint,npar,pstar,-npar)
123  CALL mneig(p,maxint,npar,maxint,pstar,epspdf,ifault)
124  pmin = pstar(1)
125  pmax = pstar(1)
126  DO 215 ip= 2, npar
127  IF (pstar(ip) .LT. pmin) pmin = pstar(ip)
128  IF (pstar(ip) .GT. pmax) pmax = pstar(ip)
129  215 CONTINUE
130  pmax = max(abs(pmax), one)
131  IF ((pmin .LE. zero .AND. lwarn) .OR. isw(5) .GE. 2) THEN
132  WRITE (isyswr,550)
133  WRITE (isyswr,551) (pstar(ip),ip=1,npar)
134  ENDIF
135  IF (pmin .GT. epspdf*pmax) GO TO 217
136  IF (isw(2) .EQ. 3) isw(2)=2
137  padd = 1.0e-3*pmax - pmin
138  DO 216 ip= 1, npar
139  ndex = ip*(ip+1)/2
140  216 vhmat(ndex) = vhmat(ndex) *(1.0 + padd)
141  cstatu= 'NOT POSDEF'
142  WRITE (chbuff,'(G12.5)') padd
143  CALL mnwarn('W',cfrom,
144  + 'MATRIX FORCED POS-DEF BY ADDING '//chbuff//' TO DIAGONAL.')
145  217 CONTINUE
146 C
147  550 FORMAT (' EIGENVALUES OF SECOND-DERIVATIVE MATRIX:' )
148  551 FORMAT (7x,6e12.4)
149  RETURN
150  END
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
nodes z
subroutine mneig(A, NDIMA, N, MITS, WORK, PRECIS, IFAULT)
Definition: mneig.f:10
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
Definition: cblkMuInt.h:130
nodes i
! 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
Definition: Zglobalc.h:18
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
struct ob o[NpMax]
Definition: Zprivate.h:34
subroutine mnpsdf
Definition: mnpsdf.f:25
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
nodes a
dE dx *! Nuc Int sampling table b
Definition: cblkMuInt.h:130
block data include Zlatfit h c fitting region data data data data data d0 data data d0 data data m
Definition: ZlatfitBD.h:35
dE dx *! Nuc Int sampling table h
Definition: cblkMuInt.h:130
dE dx *! Nuc Int sampling table g
Definition: cblkMuInt.h:130
!onst int maxp
Definition: Zprivate.h:3
subroutine mnwarn(COPT, CORG, CMES)
Definition: mnwarn.f:10
integer n
Definition: Zcinippxc.h:1
integer, parameter half
Definition: csoftenPiK.f:108
! 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
Definition: Zptcl.h:21
dE dx *! Nuc Int sampling table f
Definition: cblkMuInt.h:130
dE dx *! Nuc Int sampling table c
Definition: cblkMuInt.h:130