EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lminew.F
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file lminew.F
1 
2 C **********************************************************************
3 
4  SUBROUTINE lminew
5 
6  IMPLICIT NONE
7 
8 C...This is the MINUIT routine MINNEW.
9 C C THIS IS THE MAIN PROGRAM, DISGUISED AS A SUBROUTINE FOR
10 
11 CC REASONS OF COMPATIBILITY BETWEEN SYSTEMS. IT INITIALIZES
12 CC SOME CONSTANTS IN COMMON INCLUDING THE LOGICAL I/O UNIT NOS.)
13 CC THEN VERIFIES THAT FCN GIVES THE SAME VALUE WHEN CALLED
14 CC TWICE WITH THE SAME ARGUMENTS, AND PASSES CONTROL TO LMCMND.
15 CC
16 
17  COMMON /lpflag/ lst3
18  INTEGER lst3
19  SAVE /lpflag/
20 
21  COMMON
22  1/lmmine/ erp(30) ,ern(30)
23  2/lmpari/ x(15) ,xt(15) ,dirin(15) ,maxint ,npar
24  3/lmpare/ u(30) ,werr(30) ,maxext ,nu
25  4/lmlimi/ alim(30) ,blim(30) ,lcode(30) ,lcorsp(30) ,limset
26  5/lmvari/ v(15,15)
27  7/lmfix / ipfix(15),xs(15) ,xts(15) ,dirins(15) ,npfix
28  7/lmfix2/ grds(15) ,g2s(15) ,gsteps(15),aberfs(15)
29  c/lmcasc/ y(16) ,jh ,jl
30  f/lmderi/ gin(30) ,grd(15) ,g2(15) ,gstep(15) ,aberf(15)
31  g/lmsimv/ p(15,16) ,pstar(15),pstst(15) ,pbar(15) ,prho(15)
32  j/lmvart/ vt(15,15)
33  COMMON
34  6/lmunit/ isysrd ,isyswr ,isyspu
35  8/lmtitl/ title(13),date(2) ,isw(7) ,nblock
36  9/lmconv/ epsi ,apsi ,vtest ,nstepq ,nfcn ,nfcnmx
37  a/lmcard/ cword ,cword2 ,cword3 ,word7(7)
38  b/lmmini/ amin ,up ,newmin ,itaur ,sigma,epsmac
39 
40  REAL erp,ern
41  INTEGER maxint,npar
42  REAL x,xt,dirin
43  INTEGER maxext ,nu
44  REAL u,werr
45  INTEGER lcode,lcorsp,limset
46  REAL alim,blim
47  REAL v
48  INTEGER ipfix,npfix
49  REAL xs,xts,dirins
50  REAL grds,g2s,gsteps,aberfs
51  REAL y
52  INTEGER jh,jl
53  REAL gin,grd,g2,gstep,aberf
54  REAL p,pstar,pstst,pbar,prho
55  REAL vt
56 ***** COMMON
57  INTEGER isysrd ,isyswr ,isyspu
58  REAL title,date
59  INTEGER isw,nblock
60  REAL epsi ,apsi ,vtest
61  INTEGER nstepq ,nfcn ,nfcnmx
62  REAL cword ,cword2 ,cword3 ,word7
63  REAL amin ,up ,sigma,epsmac
64  INTEGER newmin ,itaur
65  REAL f
66  INTEGER i
67 
68 C UNIT NUMBERS FOR CARD READER, PRINTER, PUNCH
69 C
70  isysrd = 5
71  isyswr = 6
72  isyspu = 7
73  maxint=15
74  maxext=30
75 C DETERMINE MACHINE ACCURACY EPSMAC
76  epsmac = 0.5
77  DO 33 i= 1, 100
78  epsmac = epsmac * 0.5
79  IF ((1.0+epsmac) .EQ. 1.0) go to 35
80  33 CONTINUE
81  epsmac = 1.0e-6
82  35 epsmac = 2.0 * epsmac
83 C . . . . . . . . .
84  110 CONTINUE
85  nfcn = 1
86  CALL lmidat
87  CALL lminto(x)
88  IF(lst3.GE.5) WRITE (isyswr,120)
89  120 FORMAT (/,'0FIRST ENTRY TO FCN ')
90  CALL lsigmx(npar,gin,amin,u,1)
91  CALL lsigmx(npar,gin,amin,u,4)
92  CALL lmprin(1,amin)
93  CALL lsigmx(npar,gin,f ,u,4)
94  IF (f .NE. amin) go to 160
95  nfcn = 3
96  CALL lmcmnd
97  RETURN
98  160 CONTINUE
99  IF(lst3.GE.1) WRITE (isyswr,880) amin, f
100  IF(lst3.GE.2) stop
101  880 FORMAT('0FOR THE ABOVE VALUES OF THE PARAMETERS, FCN IS TIME-',
102  +'DEPENDENT',/,'0F = ',e22.14,' FOR FIRST CALL',/,' F =',e22.14,
103  +' FOR SECOND')
104  END