Generate test files.
Create text and binary files.
80
81 IMPLICIT NONE
82 REAL(mps) :: dbar
83 REAL(mps) :: det
84 REAL(mps) :: displ
85 REAL(mps) :: drift
86 REAL(mps) :: eps
87 REAL(mps) :: eta
88 REAL(mps) :: gran
89 REAL(mps) :: one
90 REAL(mps) :: ww
91 REAL(mps) :: x
92 REAL(mps) :: xbar
93 INTEGER(mpi) :: i
94 INTEGER(mpi) :: icount
95 INTEGER(mpi) :: ios
96 INTEGER(mpi) :: ip
97 INTEGER(mpi) :: ipl
98 INTEGER(mpi) :: labelt
99 INTEGER(mpi) :: luns
100 INTEGER(mpi) :: lunt
101 INTEGER(mpi) :: ncount
102 INTEGER(mpi) :: nrecds
103 INTEGER(mpi) :: nthits
104
105 REAL(mpd) :: s1
106 REAL(mpd) :: s2
107 REAL(mpd) :: sw
108 REAL(mpd) :: sv
109 REAL(mpd) :: sum1
110 REAL(mpd) :: sum2
111 REAL(mps) :: derlc(2)
112 REAL(mps) :: dergl(2)
113 INTEGER(mpi) :: label(2)
114 LOGICAL :: ex1
115 LOGICAL :: ex2
116 LOGICAL :: ex3
117
118
119 INQUIRE(file='mp2str.txt',iostat=ios,exist=ex1)
120 INQUIRE(file='mp2con.txt',iostat=ios,exist=ex2)
121
122 INQUIRE(file='mp2tst.bin',iostat=ios,exist=ex3)
123
124 WRITE(*,*) ' '
125 WRITE(*,*) 'Generating test data for mp II...'
126 WRITE(*,*) ' '
127
128 IF(ex3) CALL system('rm mp2tst.bin')
129
130 IF(.NOT.ex1) OPEN(unit=7,access='SEQUENTIAL',form='FORMATTED', &
131 file='mp2str.txt')
132 IF(.NOT.ex2) OPEN(unit=9,access='SEQUENTIAL',form='FORMATTED', &
133 file='mp2con.txt')
134 OPEN(unit=51,access='SEQUENTIAL',form='UNFORMATTED', file='mp2tst.bin')
135
140 END DO
141
142 ipl=7
145
146
147
148 displ=0.1
149 drift=0.02
153 END DO
156
157
158
159 IF(.NOT.ex1) THEN
160 luns=7
161 WRITE(luns,101) '* Default test steering file'
162 WRITE(luns,101) 'fortranfiles ! following bin files are fortran'
163 WRITE(luns,101) 'mp2con.txt ! constraints text file '
164 WRITE(luns,101) 'mp2tst.bin ! binary data file'
165 WRITE(luns,101) 'Cfiles ! following bin files are Cfiles'
166
167
168
169 WRITE(luns,101) '*hugecut 50.0 !cut factor in iteration 0'
170 WRITE(luns,101) '*chisqcut 1.0 1.0 ! cut factor in iterations 1 and 2'
171 WRITE(luns,101) '*entries 10 ! lower limit on number of entries/parameter'
172 WRITE(luns,101) &
173 '*pairentries 10 ! lower limit on number of parameter pairs', &
174 ' ! (not yet!)'
175 WRITE(luns,101) '*printrecord 1 2 ! debug printout for records'
176 WRITE(luns,101) &
177 '*printrecord -1 -1 ! debug printout for bad data records'
178 WRITE(luns,101) &
179 '*outlierdownweighting 2 ! number of internal iterations (> 1)'
180 WRITE(luns,101) '*dwfractioncut 0.2 ! 0 < value < 0.5'
181 WRITE(luns,101) '*presigma 0.01 ! default value for presigma'
182 WRITE(luns,101) '*regularisation 1.0 ! regularisation factor'
183 WRITE(luns,101) '*regularisation 1.0 0.01 ! regularisation factor, pre-sigma'
184
185 WRITE(luns,101) ' '
186 WRITE(luns,101) '*bandwidth 0 ! width of precond. band matrix'
187 WRITE(luns,101) 'method diagonalization 3 0.001 ! diagonalization '
188 WRITE(luns,101) 'method fullMINRES 3 0.01 ! minimal residual '
189 WRITE(luns,101) 'method sparseMINRES 3 0.01 ! minimal residual '
190 WRITE(luns,101) '*mrestol 1.0D-8 ! epsilon for MINRES'
191 WRITE(luns,101) 'method inversion 3 0.001 ! Gauss matrix inversion'
192 WRITE(luns,101) '* last method is applied'
193 WRITE(luns,101) '*matiter 3 ! recalculate matrix in iterations'
194 WRITE(luns,101) ' '
195 WRITE(luns,101) 'end ! optional for end-of-data'
196 ENDIF
197
198 lunt=9
199 one=1.0
200 IF(.NOT.ex2) WRITE(lunt,*) 'Constraint 0.0'
202 labelt=10+i*2
204 IF(.NOT.ex2) WRITE(lunt,103) labelt,one
205 END DO
206
207 sw=0.0_mpd
208 sv=0.0_mpd
209 s1=0.0_mpd
210 s2=0.0_mpd
211 IF(.NOT.ex2) WRITE(lunt,*) 'Constraint 0.0'
215 labelt=10+i*2
217 ww=(x-xbar)/dbar
218 IF(.NOT.ex2) WRITE(lunt,103) labelt,ww
221 sw=sw+ww
222 sv=sv+ww*ww
223 END DO
224
225
226 det=real(real(
nplan,mpd)*sv-sw*sw,mps)
227 eps=real(sv*s1-sw*s2,mps)/det
228 eta=real(real(
nplan,mpd)*s2-sw*s1,mps)/det
231 ww=(x-xbar)/dbar
233 END DO
234
235 sum1=0.0
236 sum2=0.0
240 ww=(x-xbar)/dbar
242 END DO
243
244
245
246
247 ncount=10000
248 nthits=0
249 nrecds=0
250
251 DO icount=1,ncount
252 ip=0
253 IF(icount == 8759) ip=1
254
255
257
259 derlc(1)=1.0
261 dergl(1)=1.0
263 label(1)=10+
ihits(i)*2
264 label(2)=500 +
ihits(i)
266 nthits=nthits+1
267 END DO
268 CALL endle
269 nrecds=nrecds+1
270 END DO
271
272
273 IF(.NOT.ex1) THEN
274 rewind(7)
275 CLOSE (7)
276 END IF
277 IF(.NOT.ex2) THEN
278 rewind(9)
279 CLOSE (9)
280 END IF
281 rewind(51)
282 CLOSE (51)
283
284
285
286
287
288
289
290
291 WRITE(*,*) ' '
292 WRITE(*,*) ' '
293 WRITE(*,*) ncount,' tracks generated with ',nthits,' hits.'
294 WRITE(*,*) nrecds,' records written.'
295 WRITE(*,*) ' '
296101 FORMAT(a)
297
298103 FORMAT(i8,f10.5)
subroutine mille(nlc, derlc, ngl, dergl, label, rmeas, sigma)
Add data block to record. Called from user code.
subroutine genlin(ip)
Generate line and measurements.
real(mps), parameter thck
thickness of plane
real(mps), parameter effp
plane efficiency
real(mps), parameter sgmp
measurement sigma