PAGE

1
07-12-:7
10:12:47
Line#

#

#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

program he_sim7
*
* Program to generate a SimIon 7 geometry file for a HEEPS-E detector f
* geometry parameters. Author Kevin G. Rhoads, started July 2005.
*
* SAVE SOURCE FILE WITHOUT TAB CONVERSION
*
*---------------------------------------------------------------------* Version 1.123 Thursday July 12, 2007 - further refine BEEPS model
* Version 1.121 Tuesday May 8, 2007 - refine BEEPS model
* Version 1.113 Monday April 30, 2007 - First ions through a BEEPS mod
* Version 1.099 Tuesday April 24, 2007 - clean-up, get magnetic stuff
* Version 1.092 Monday April 23, 2007 - HT/HM/BT screens & screen loca
* Version 1.083 Wednesday April 4, 2007 - First BT screen
* Version 1.081 Monday April 2, 2007 - More BT stuff, more ION stuff
* Version 1.068 Thusday March 29, 2007 - HE/HT/HM/HH*/BT* defaults set
* Version 1.067 Wednesday March 28, 2007 - Grounded Screen, Magnet Ele
* Version 1.062 Wednesday March 21, 2007 - Filenames, defaults for dif
* Version 1.057 Tuesday March 13, 2007 - Use of .GEM file
* Version 1.055 Tuesday March 13, 2007 - scaling related issues & Uppe
*------------------------ 2006 -> 2007
* Version 1.053 Sunday July 23, 2006 - fixing some consistency checks
*------------------------ 2005 -> 2006
* Version 1.051 Wednesday July 27, 2005
* Version 1.048 Tuesday July 26, 2005 - removing unused (formerly used
* Version 1.044 Tuesday July 26, 2005 - fixed problem of change to the
* Version 1.043 Tuesday July 26, 2005 - removed small geometry glitch
* Version 1.042 Tuesday July 26, 2005 - user input to override paramet
* Version 1.037 Monday July 25, 2005 - First version to (apparently) g
* Version 0.030 Monday July 25, 2005 - first to get Top Hat reasonably
* Version 0.020 Friday July 22, 2005 - first to generate three electro
* Version 0.011 Thursday July 21, 2005 - first to generate inner hemis
*---------------------------------------------------------------------* To Do (no particular order)
* (.F67, partial) Change output filename at run time

#

#
#
#

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57

* read parameter file, generate .GEM
* (.F50, done) make TopHat top electrode to inner hemisphere spacing a
* (.F67, done) add electrode under hemisphere for ION Heepses
* add lower cutoff angle for non-stretched TopHat
* add more comments
* (.F48, done) remove unused variables and old code
*
*---------------------------------------------------------------------* Declarations
*----*
*; Rs - Radius of "stretch" cylinder, nominal 67, range 0->
*; Ri - a.k.a., R1; inner radius of analyzer, nominal 604, range 0->
*; Ro - a.k.a., R2; outer radius of analyzer, nominal 659, range Ri->
*; theta - angle up from exit plane to analyser entrance, nominal 74 de
*; gamma - (sometimes alpha) angle of entrance electrodes from parallel
*; offset - distance from exit plane to bottom of simulation region, no
*; HatRad - radius of "Top Hat", nominal Ro+1*delta (i.e., Ro1d)
*; NumPnts - Number of array points per axis, nominal 1001
*
*; hold default values for associated variables
$include:'def.inc'
***** Begin listing of: def.inc

PAGE
2
07-12-:7
10:12:47
Line#
1
2
3
4
5
6
7
8
9

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

real dRs,dRi,dRo,dtheta,dgamma,doffset,dHatRad,dNumPnts,dVoltage
real thetaRad,gammaRad,scaling,separation,dbscreensp,dbextra
real dgammau,dgammal,dthetai,dthetao,dextra,dscreen
real dbthickness,dbspace,dbVoltage,dMags,dMagRi,dMagRo
common /defaults/ dRs,dRi,dRo,dtheta,dgamma,doffset,dHatRad,
& dNumPnts,dVoltage,thetaRad,gammaRad,scaling,separation,
& dgammau,dgammal,dthetai,dthetao,dextra,dscreen,dbscreensp,
& dbextra,dbthickness,dbspace,dbVoltage,dMags,dMagRi,dMagRo
***** End listing of: def.inc
58 *;------------ derived parameters
59 $include:'wrk.inc'
***** Begin listing of: wrk.inc
1
real delta,h,hplus,Wi,Hi,Wo,Ho,WSi,WSo,RoPlus,hBlend,wBlend,Hi1d
2
equivalence (h,Hi)
3
real gammauRad,gammalRad,uu,ul
4
real thetaiRad,thetaoRad
5
real RiPlus,Ho1d,outer,Hi2d,Hi3d,Hi5d,hBlend1d
6
equivalence (hplus,Hi2d)
7
real Wo2dcot,Wo2dcotclip,NumPntsX,NumPntsY,Ro1d,Ro2d,Hotan
8
equivalence (Ro2d,RoPlus)
9
real Hotand,Hi2du,Hi3du,u,HatRadS,WSoblend,RiRs,RoRs,RoPlRs
10
real HiSep,HiSepu,HiSepdu,HiSepd,HidSep,extra,screen
11
integer iRs,iRi,iRo,itheta,igamma,ioffset,iHatRad,iNumPnts
12
integer igammau,igammal,ithetai,ithetao,diNumPnts
13
real*8 scale,Pi
14
real Rs,Ri,Ro,theta,gamma,offset,HatRad,NumPnts,Voltage
15
equivalence (outer,HatRad)
16
real gammau,gammal,thetai,thetao,screen2
17
real bextra,bscreen,bVoltage,bscreenspace,bthickness,bspace
18
real bRiRs,bRoRs,bRoPlRs,magstart,magstop,Mags,MagRi,MagRo
19
real mRiRs,mRoRs,mRoPlRs
20
common /working/ delta,h,hplus,Wi,Wo,Ho,WSi,WSo,RoPlus,hBlend,
21
& wBlend,Hi1d,gammauRad,gammalRad,uu,ul,thetaiRad,thetaoRad,
22
& RiPlus,Ho1d,Hi3d,Hi5d,hBlend1d,Wo2dcot,Wo2dcotclip,NumPntsX,

23
24
25
26
27
28
29
30
31

& NumPntsY,Ro1d,Hotan,Hotand,Hi2du,Hi3du,u,HatRadS,WSoblend,
& HiSep,HiSepu,HiSepdu,HiSepd,HidSep,scale,extra,screen,
& iRs,iRi,iRo,itheta,igamma,ioffset,iHatRad,iNumPnts,
& igammau,igammal,ithetai,ithetao,diNumPnts,Pi,
& Rs,Ri,Ro,theta,gamma,offset,HatRad,NumPnts,Voltage,
& gammau,gammal,thetai,thetao,RiRs,RoRs,RoPlRs,
& bextra,bscreen,bVoltage,bscreenspace,bthickness,bspace,
& bRiRs,bRoRs,bRoPlRs,magstart,magstop,Mags,MagRi,MagRo,
& screen2,mRiRs,mRoRs,mRoPlRs
***** End listing of: wrk.inc
60 *--61 $include:'iw.inc'
***** Begin listing of: iw.inc
1
2
integer idelta,ih,ihplus,iWi,iHi,iWo,iHo,iWSi,iWSo,iRoPlus
3
equivalence (ih,iHi)
4
integer ihBlend,iwBlend,iRiPlus,iVoltage,iHo1d,iscreen
5
integer iouter,iHi2d,iHi3d,ihBlend1d,iHi1d,iWo2dcot
6
equivalence (ihplus,iHi2d),(iouter,iHatRad)
7
integer iWo2dcotclip,iNumPntsX,iNumPntsY,iRo1d,iRo2d,iHi5d
8
equivalence (iRo2d,iRoPlus)
9
integer iHotan,iHotand,iHi2du,iHi3du,iHatRadS,iWSoblend
10
integer iHiSep,iHiSepu,iHiSepdu,iHiSepd,iHidSep

PAGE
3
07-12-:7
10:12:47
Line#
11
12
13
14
15
16
17
18
19
20
21
22
23

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

integer iRiRs,iRoRs,iRoPlRs
integer iextra,ibscreenspace,ibextra,ibthickness,ibspace
integer ibVoltage,ibscreen,ibRiRs,ibRoRs,ibRoPlRs
integer imagstart,imagstop,iMags,iMagRi,iMagRo,iscreen2
integer imRiRs,imRoRs,imRoPlRs
common /iworking/idelta,ih,ihplus,iWi,iWo,iHo,iWSi,iWSo,iRoPlus,
& ihBlend,iwBlend,iRiPlus,iVoltage,iHo1d,iHi3d,ihBlend1d,iHi1d,
& iWo2dcot,iWo2dcotclip,iNumPntsX,iNumPntsY,iRo1d,iHi5d,
& iHotan,ihotand,ihi2du,ihi3du,iHatRads,iWSoblend,iscreen,
& iHiSep,iHiSepu,iHiSepdu,iHiSepd,iHidSep,iRiRs,iRoRs,iRoPlRs,
& iextra,ibscreenspace,ibextra,ibthickness,ibspace,ibVoltage,
& ibscreen,ibRiRs,ibRoRs,ibRoPlRs,imagstart,imagstop,iMags,
& iMagRi,iMagRo,iscreen2,imRiRs,imRoRs,imRoPlRs
***** End listing of: iw.inc
62
integer itemp
63 *--64 *--65 *; delta = (Ro - Ri)
66 *; h = Ri*sin(theta)
67 *; hplus = 2*delta + Ri*sin(theta)
68 *; Wi = Ri*cos(theta)
69 *; Hi = Ri*sin(theta) [alias for h]
70 *; Wo = Ro*cos(theta)
71 *; Ho = Ro*sin(theta)
72 *; WSi = Rs + Ri*cos(theta)
73 *; WSo = Rs + Ro*cos(theta)
74 *; RoPlus = Ro + 2*delta
75 *; RiRs = Ri + Rs
76 *; RoRs = Ro + Rs
77 *; RoPlRs = RoPlus + Rs
78 *; hBlend = (Hi + Ho)/2.0
79 *; wBlend = (Wi + Wo)/2.0
80 *; Ho1d = Ho + 1.0*delta
81 *; Hotan = Ho - tan(gamma)*(HatRad-Wo)
82 *; Hotand = Ho - tan(gamma)*(HatRad-Wo) - delta

83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

**; Ho2d = Ho - 2.0*delta
**; Ho3d = Ho - 3.0*delta
**; Ho4d = Ho - 4.0*delta
*; outer IS HatRad
*; Hi1d = Hi + 1.0*delta
*; HidSep = Hi + Separation - delta
*; Hi2d = Hi + 2.0*delta
*; HiSep = Hi + Separation
*; u = tan(gamma) * (HatRad - WSo)
*; Hi2du = Hi + 2.0*delta + u
*; HiSepu = Hi + Separation + u
*; Hi3d = Hi + 3.0*delta
*; HiSepd = Hi + Separation + delta
*; Hi3du = Hi + 3.0*delta + u
*; HiSepdu = Hi + Separation + ddelta + u
**; Hi4d = Hi + 4.0*delta
*; Hi5d = Hi + 5.0*delta
**; Hi6d = Hi + 6.0*delta
*; hBlend1d = hBlend + 1.0*delta
*; WSoblend = (WSo + Rs) /2.0
character*66 banner(5)
character*20 atemp,char1*1
character*127 fname,fname2

PAGE
4
07-12-:7
10:12:47
Line#

#

106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

character drive*1,path*64,file*8,ext*3
real temp,zi,zo,degrees
integer i,iatemp,izi,izo,idegrees
logical electrons,usem,useh,useb,uset,bigger,oldbig,magscr2
character*8 bumpfilename
external bumpfilename,fnsep,fnjoin,dwrking,iwrking,cwrking
external ht_defaults,hm_defaults,he_defaults,HowTo
external bt_defaults,hh_defaults,heb_defaults,hr_defaults
external old_heb_defaults,old_hr_defaults
*----*---------------------------------------------------------------------* Initialization, Banner & Copyright
*----*
9001 continue
Banner(1) = ' Heeps-X (non-defl) .GEM (SimIon geometry file) '//
& 'generator'
Banner(2) = ' Version 1.123 Thursday July 12, 2007 Lynch Rocket '
& //'Lab'
Banner(3) = ' author: Kevin G. Rhoads; Language: F77'
Banner(4) = ' Copyright 2007 Dartmouth College - Lynch Rocket Lab
Banner(5) = ' Permission is granted for copying for academic use'
write (*,7002) (banner(i),i=1,5)
Pi = 3.1415926535897932384626d0
scale = 0.0254d0
electrons = .true.
bigger = .false.
oldbig = .false.
uset = .false.
usem = .false.
useh = .false.
useb = .false.
magscr2 = .true.
*
*---- initialize default Heeps-E analyser geometry parameters - mils &

141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163

* d<name> variable holds default value for <name> variable
9002 continue
call he_defaults()
*
*----- copy default values into working variables
call dwrking()
*---------------------------------------------------------------------* get parameters -- from file or interactively
*----* from file - Presently UNimplemented
print *,' '
*---9113 continue
print *,' Please choose ION or ELECTRON and default detector ',
& 'style.'
print *,' Electron detector forms are HE(e) and HEBIGGER(r,g)'
print *,' and the incorrect "old" HEBIG(o)'
print *,' Ion detector forms are HT, HM, (HH) and BT'
print *,' Thermal ions, plain: HT(t,i), mass-resolved: BT(b)'
print *,' Medium energy ions: HM(m), (High energy: HH(h))'
print *,' y to keep current values '
print *,' '
if (electrons) then

PAGE
5
07-12-:7
10:12:47
Line#
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198

Source Line
print
print
print
print

else

Microsoft FORTRAN Optimizing Compiler Version 5.00.03
*, 'ELECTRONS or Ions? (E/g/i/t/m/h/b): b for Beeps,'
*,' g for HEBIGGER, r for HEBIGGER, o for Old HEBIG, '
*,' i for Heeps thermal Ion, m for HM medium energy,'
*,' t for Heeps Thermal ion, h for HH high energy'

print *, 'Electrons or IONS? (e/g/I/t/m/h/b): b for Beeps'
print *,' i for Heeps thermal Ion, m for HM medium energy,'
print *,' t for Heeps Thermal ion, h for HH high energy,'
print *,' g for HEBIGGER, r for HEBIGGER, o for Old HEBIG '
endif
print *,' '
read (*,7001) char1
if (char1.eq.'e'.or.char1.eq.'E') then
print *,' HE - HEEPS Electron detector'
electrons = .true.
bigger = .false.
oldbig = .false.
Voltage = 1000.0
uset = .false.
usem = .false.
useh = .false.
useb = .false.
call he_defaults()
call dwrking()
Banner(1) = ' Heeps-E (non-defl) .GEM (SimIon geometry '//
&
'file) generator'
elseif (char1.eq.'r'.or.char1.eq.'R'.or.
&
char1.eq.'g'.or.char1.eq.'G') then
print *,' HEBIGGER - BIG HEEPS Electron detector'
electrons = .true.
bigger = .true.
oldbig = .false.
Voltage = 1000.0
uset = .false.
usem = .false.

199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221

useh = .false.
useb = .false.
call heb_defaults()
call dwrking()
Banner(1) = ' HE Bigger .GEM (SimIon geometry file) '//
&
'generator'
elseif (char1.eq.'o'.or.char1.eq.'O') then
print *,' OHEBIG - OLD HEBIG HEEPS Electron detector'
electrons = .true.
bigger = .true.
oldbig = .true.
Voltage = 1000.0
uset = .false.
usem = .false.
useh = .false.
useb = .false.
call old_heb_defaults()
call dwrking()
Banner(1) = ' Old HE Bigger .GEM (SimIon geometry file) '//
&
'generator'
elseif (char1.eq.'i'.or.char1.eq.'I') then
print *,' HT - HEEPS Thermal Ion detector'
electrons = .false.

PAGE
6
07-12-:7
10:12:47
Line#
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

bigger = .false.
oldbig = .false.
uset = .true.
usem = .false.
useh = .false.
useb = .false.
call ht_defaults()
call dwrking()
Banner(1) = ' Heeps-T .GEM (SimIon geometry file) generator'
elseif (char1.eq.'j'.or.char1.eq.'J') then
print *,' Old HT - HEEPS Thermal Ion detector'
electrons = .false.
bigger = .false.
oldbig = .false.
uset = .false.
usem = .false.
useh = .false.
useb = .false.
call old_ht_defaults()
call dwrking()
Banner(1) = ' Old Heeps-I .GEM (SimIon geometry file) '//
&
'generator'
elseif (char1.eq.'m'.or.char1.eq.'M') then
print *,' HM - HEEPS Medium energy Ion detector'
electrons = .false.
bigger = .false.
oldbig = .false.
uset = .false.
usem = .true.
useh = .false.
useb = .false.
call hm_defaults()
call dwrking()
Banner(1) = ' Heeps-M .GEM (SimIon geometry file) generator'
elseif (char1.eq.'h'.or.char1.eq.'H') then

257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279

print *,' HH - HEEPS High energy Ion detector'
print *,' HH is presently not implemented, using HM defaults'
electrons = .false.
bigger = .false.
oldbig = .false.
uset = .false.
usem = .false.
useh = .true.
useb = .false.
call hh_defaults()
call dwrking()
Banner(1) = ' Heeps-H .GEM (SimIon geometry file) generator'
elseif (char1.eq.'t'.or.char1.eq.'T') then
print *,' HT - HEEPS Thermal Ion detector'
electrons = .false.
bigger = .false.
oldbig = .false.
uset = .true.
usem = .false.
useh = .false.
useb = .false.
call ht_defaults()
call dwrking()

PAGE
7
07-12-:7
10:12:47
Line#
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

Banner(1) = ' Heeps-T .GEM (SimIon geometry file) generator'
elseif (char1.eq.'b'.or.char1.eq.'B') then
print *,' BT - Mass resolved HEEPS Thermal Ion detector'
print *,' a.k.a., BEEPS-T; this is HT with added magnetics'
print *,' BT definitions are not finished, work in progress'
electrons = .false.
bigger = .false.
oldbig = .false.
uset = .false.
usem = .false.
useb = .true.
useh = .false.
call bt_defaults()
call dwrking()
Banner(1) = ' Beeps-T .GEM (SimIon geometry file) generator'
elseif (char1.eq.'y'.or.char1.eq.'Y') then
* Do nothing, keep prior value
elseif (char1.eq.'n'.or.char1.eq.'N') then
* Reverse prior value
electrons = .not. electrons
bigger = .false.
oldbig = .false.
if (electrons) then
uset = .false.
usem = .false.
useh = .false.
useb = .false.
call he_defaults()
call dwrking()
else
uset = .true.
usem = .false.
useh = .false.
useb = .false.
call ht_defaults()

315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337

call dwrking()
endif
else
* Do nothing, keep prior value
endif
**---if (usem) then
magscr2 = .false.
elseif (useh) then
magscr2 = .false.
elseif (useb) then
magscr2 = .true.
elseif (uset) then
magscr2 = .false.
elseif (electrons) then
magscr2 = .false.
endif
*---9101 continue
print *,' Rs (stretch cyl. radius [mil]) = ',Rs
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then

PAGE
8
07-12-:7
10:12:47
Line#
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

goto 9332
elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9101) temp
if (temp.ge.0.0) Rs = temp
endif

*---9102 continue
print *,' Ri (inner R for analyzer [mil]) = ',Ri
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9102) temp
if (temp.ge.0.0) then
Ri = temp
delta = Ro-Ri
separation = 2.0*delta
endif
endif
*---9103 continue
print *,' Ro (outer R for analyzer [mil]) = ',Ro
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then

372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395

read (atemp,7010,err=9103) temp
if (temp.ge.0.0) then
Ro = temp
delta = Ro-Ri
separation = 2.0*delta
endif
endif

*---9104 continue
print *,' theta (analyzer angular extent [degrees] {inner} )= ',
&
theta
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9104) temp
if (temp.ge.0.0) theta = temp
endif
thetai = theta
thetao = theta
*----

PAGE
9
07-12-:7
10:12:47
Line#
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

9112 continue
print *,' theta {outer} angle [degrees])= ',thetao
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9112) temp
if (temp.ge.0.0) thetao = temp
endif
*---9105 continue
print *,' gamma (entrance expansion angle [degrees] {lower}) = ',
&
gamma
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9105) temp
if (temp.ge.0.0) gamma = temp
endif
gammau = gamma
gammal = gamma
*---9111 continue
print *,' gammau upper angle [degrees] = ',gammau
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
goto 9333

431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453

elseif (atemp.ne.' ') then
read (atemp,7010,err=9111) temp
if (temp.ge.0.0) gammau = temp
endif
*----

if (.not.electrons) then
continue
print *,'spacing to screen [mil]) = ',screen
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9118) temp
if (temp.ge.0.0) screen = temp
endif
9106
continue
print *,' extra width for screen aperature [mil]) = ',extra
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
9118

PAGE 10
07-12-:7
10:12:47
Line#
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9106) temp
extra = temp
endif
endif
9107 continue
print *,' NumPnts (Number of Points [unitless]) = ',NumPnts
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9107) temp
if (temp.ge.0.0) NumPnts = temp
endif
*---HatRad = max(HatRad,Ro + 1.0*(Ro-Ri))
9109 continue
print *,' HatRad (Radius of Top Hat [mil]) = ',HatRad
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9109) temp
if (temp.ge.0.0) HatRad = temp
endif
*---9114 continue
print *,' offset (shift up from zero plane [mil]) = ',offset
read (*,7001) atemp
iatemp = ichar(atemp(1:1))

489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511

if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9114) temp
if (temp.ge.0.0) offset = temp
endif
*---9110 continue
print *,' Separation (TopHat vs. inner [mil]) = ',Separation
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9110) temp
if (temp.ge.0.0) Separation = temp
endif
*---9108 continue
print *,' Scaling (Geom scaling factor [unitless]) = ',Scaling
read (*,7001) atemp

PAGE 11
07-12-:7
10:12:47
Line#
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9108) temp
if (temp.ge.0.0) Scaling = temp
endif
*------------------9332 continue
if (useb) then
*---9115
continue
print *,' Space to top of magnets [mil] = ',bscreenspace
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9115) temp
if (temp.gt.0.0) bscreenspace = temp
endif
*---9116
continue
print *,' bextra [mil] = ',bextra
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then

547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569

*---9117

*---9120

read (atemp,7010,err=9116) temp
if (temp.gt.0.0) bextra = temp
endif
continue
print *,' Magnet thickness [mil] = ',bthickness
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9117) temp
if (temp.gt.0.0) bthickness = temp
endif
continue
print *,' Magnet ring outer radius [mil] = ',MagRo
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332

PAGE 12
07-12-:7
10:12:47
Line#
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604

Source Line

*---9119

*---9121

9122

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9120) temp
if (temp.gt.0.0) MagRo = temp
endif
continue
print *,' Magnet ring inner radius [mil] = ',MagRi
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9119) temp
if (temp.gt.0.0) MagRi = temp
endif
continue
print *,' Electrode screen ABOVE magnets? ',magscr2
read (*,7001) atemp
iatemp = ichar(atemp(1:1))
if (useb.and.iatemp.eq.2) then
goto 9332
elseif (iatemp.eq.4) then
goto 9333
elseif (atemp.ne.' ') then
i = 0
continue
i = i + 1
char1 = atemp(i:i)
if (char1.eq.' '.and.i.lt.20) goto 9122
magscr2 = char1.eq.'T' .or. char1.eq.'t'

#

605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627

magscr2 = char1.eq.'Y' .or. char1.eq.'y' .or. magscr2
endif
endif
*------------------9333 continue
*---------------------------------------------------------------------* check for consistency, over/under-constrained, use defaults as needed
*----* Presently Mostly UNimplemented
if (theta.lt.0.0.or.theta.gt.90.0) then
print *,' theta out of range, reverting to default '
theta = dtheta
endif
if (thetai.lt.0.0.or.thetai.gt.90.0) then
print *,' thetai out of range, reverting to default '
thetai = dthetai
endif
if (thetao.lt.0.0.or.thetao.gt.90.0) then
print *,' thetao out of range, reverting to default '
thetao = dthetao
endif
if (gamma.lt.0.0.or.gamma.gt.90.0) then
print *,' gamma out of range, reverting to default '

PAGE 13
07-12-:7
10:12:47
Line#
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661

Source Line

*

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

gamma = dgamma
endif
if (gammau.lt.0.0.or.gammau.gt.90.0) then
print *,' gammau out of range, reverting to default '
gammau = dgammau
endif
if (gammal.lt.0.0.or.gammal.gt.90.0) then
print *,' gammal out of range, reverting to default '
gammal = dgammal
endif
if (Ri.gt.Ro) then
print *,' Ri > Ro, swapping '
temp = Ri
Ri = Ro
Ro = temp
endif
if (scaling.ne.1.0.and.scaling.gt.0.0) then
Print *,' Rescaling geometry by ',scaling
Rs = Rs*scaling
Ri = Ri*scaling
Ro = Ro*scaling
offset = offset*scaling
NumPnts = NumPnts*scaling
HatRad = HatRad*scaling
NumPnts = max(HatRad+Rs,NumPnts)
separation = separation*scaling
endif
if (electrons) then
Voltage = 1000.0
iVoltage = 1000
else
Voltage = -1000.0
iVoltage = -1000

#

662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685

endif
*
*;------------ compute derived parameters from working variables
itemp = 0
9003 continue
itemp = itemp + 1
call cwrking(useb)
if ( (.not.useb.and.iNumPntsX.gt.iNumPnts)
&
.or.(iNumPntsY.gt.iNumPnts)
&
.or.(iNumPntsX.gt.(iNumPnts*3/2+1)) ) then
NumPnts = max(NumPnts,NumPntsX,NumPntsY)
print *,' '
print *,' Expanding PA size to ',NumPnts
* NO MORE than one interation of this
if (itemp.lt.2) goto 9003
endif
*
*---- round to nearest integer for both basic and derived parameters
call iwrking()
*
*---------------------------------------------------------------------* determine output filename -- ask if interactive, derive from input fi
* or use default (HE_nnnnn)
*

PAGE 14
07-12-:7
10:12:47
Line#
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

* Presently partially implemented, basename based on detector defaults
* bump numbers used for uniqueness
*
*----* Open
if (electrons) then
fname = 'HE000000.GEM'
if (bigger) then
fname = 'HEBIG000.GEM'
if (oldbig) then
fname = 'OHEBIG00.GEM'
endif
endif
elseif (uset) then
fname = 'HT000000.GEM'
elseif (usem) then
fname = 'HM000000.GEM'
elseif (useh) then
fname = 'HH000000.GEM'
elseif (useb) then
fname = 'BT000000.GEM'
else
fname = 'HI000000.GEM'
endif
9004 continue
open (unit=10,file=fname,status='new',iostat=i)
if (i.ne.0) then
call fnsep(fname,drive,path,file,ext)
file = bumpfilename(file)
call fnjoin(fname,drive,path,file,ext)
goto 9004
endif
inquire (unit=10,name=fname2,iostat=i)
if (i.ne.0) then
fname2 = fname

721
722
723
724
725

#
#

726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743

endif
if (useb) then
call fnsep(fname,drive,path,file,ext)
file(1:1) = 'M'
call fnjoin(fname,drive,path,file,ext)
open (unit=11,file=fname,status='unknown',iostat=i)
endif
print *,' '
print *,' Output to ',fname2(1:len_trim(fname2))
*---------------------------------------------------------------------* write out output .GEM file
*----* write out .GEM file comments; these include all the comments in the
* generated precursor file and additional auto-generated comments from
* program, including an echo of the parameters
*
*======================================================================
*
* Unit 10 writes to XXnnnnnn.GEM where XX=HE, HT, HM, HH or BT
if (electrons) then
write (10,7001) ';BEGIN autogenerated Top Hat Heeps-E GEM file'
elseif (uset) then
write (10,7001) ';BEGIN autogenerated Top Hat Heeps-T GEM file'

PAGE 15
07-12-:7
10:12:47
Line#
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

elseif (usem) then
write (10,7001) ';BEGIN autogenerated Top Hat Heeps-M GEM file'
elseif (useh) then
write (10,7001) ';BEGIN autogenerated Top Hat Heeps-H GEM file'
elseif (useb) then
write (10,7001) ';BEGIN autogenerated Top Hat Beeps-T GEM file'
else
write (10,7001) ';BEGIN autogenerated Top Hat Heeps-X GEM file'
endif
write (10,7001) (';'//banner(i),i=1,5)
write (10,7001) ';_______________________________________________
& // '______________________________'
* Unit 11 writes to MTnnnnnn.GEM for second magnetic PA for BEEPS
if (useb) then
write (11,7001) ';BEGIN autogenerated Top Hat Beeps-T GEM file2
write (11,7001) (';'//banner(i),i=1,5)
write (11,7001) ';_______________________________________________
& // '______________________________'
write (11,7001) ';This is the MAGNETIC PA GEM file that goes with
write (11,7001) '; '//fname2(1:len_trim(fname2))
write (11,7001) ';_______________________________________________
& // '______________________________'
endif
*----call HowTo()
*----* Unit 10 writes to XXnnnnnn.GEM where XX=HE, HT, HM, HH or BT
write (10,7001) ';_______________________________________________
& // '______________________________'
if (electrons) then
write (10,7001) ';Generated Heeps-E SimIon7 Geometry file (.GEM)'
elseif (uset) then
write (10,7001) ';Generated Heeps-T SimIon7 Geometry file (.GEM)'
elseif (usem) then
write (10,7001) ';Generated Heeps-M SimIon7 Geometry file (.GEM)'

779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801

elseif (useh) then
write (10,7001) ';Generated Heeps-H SimIon7 Geometry file (.GEM)'
elseif (useb) then
write (10,7001) ';Generated Beeps-T SimIon7 Geometry file (.GEM)'
else
write (10,7001) ';Generated Heeps-X SimIon7 Geometry file (.GEM)'
endif
write (10,7001) '; based on manually generated file HEBIG.GEM'
write (10,7001) '; and previously developed HT, HM, HH, BT, HE'
write (10,7001) '; designs developed at UNH '
write (10,7001) '; '
write (10,7001) '; Original author Kevin G. Rhoads
July 2005'
write (10,7001) '; '
write (10,7001) '; We are designing Top Hat detector/analyser in'
& //' mils, with nominally 1001'
write (10,7001)'; sized arrays where sizes are nominally in mils.
& //' Geometries can be rescaled'
write (10,7001) '; in SimIon afterwards if needed. Dimensions '
& //'are rounded to nearest mil.'
write (10,7001) '; Nominal High Voltage, HV, is 1000V. This is '
& //'easy to rescale in SimIon,'
write (10,7001) '; but is also a specifiable parameter. Angles '
& //'are in degrees.'

PAGE 16
07-12-:7
10:12:47
Line#
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

write (10,7001) '; '
*
* Unit 10 writes to XXnnnnnn.GEM where XX=HE, HT, HM, HH or BT
* write out .GEM file parameters, with present values
write (10,7001) '; Design parameters: (rounded to integer)'
write (10,7003) '; Rs - Radius of "stretch" cylinder, nominal 67,
& //' actual ',iRs
write (10,7003) '; Ri - a.k.a., R1; inner radius of analyzer, '
& //'nominal 604, actual ',iRi
write (10,7003) '; Ro - a.k.a., R2; outer radius of analyzer, '
& //'nominal 659, actual ',iRo
write (10,7003) '; theta - angle up from exit plane to analyser '
& //'entrance, nominal 74 degrees, actual ',itheta
write (10,7003) '; gamma - (sometimes alpha) angle of entrance '
& //'electrodes from parallel, nominal 6 degrees, actual ',igamma
write (10,7003) '; gammau- (sometimes alpha) angle of entrance '
& //'electrodes from parallel, nominal 6 degrees, actual ',igammau
write (10,7003) '; gammal- (sometimes alpha) angle of entrance '
& //'electrodes from parallel, nominal 6 degrees, actual ',igammal
write (10,7023) '; offset - distance from exit plane to bottom of
& //' simulation region, nominal 6.35, actual ',offset
write (10,7003) '; HatRad - radius of "Top Hat", nom. Ro+2*delta
& //'(i.e., RoPlus), value ',iRoPlus
write (10,7003) '; NumPnts - Number of array points per axis, '
& //'nominal 1001, actual ',iNumPnts
*----* Unit 10 writes to XXnnnnnn.GEM where XX=HE, HT, HM, HH or BT
if (electrons) then
write (10,7003) '; Voltage - HV electrode voltage, nominal '
&
//' 1000, actual ',iVoltage
write (10,7001) '; ELECTRON detector specifics'
else
write (10,7003) '; Voltage - HV electrode voltage, nominal'
&
//' -1000, actual ',iVoltage
write (10,7001) '; '

837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859

write (10,7001) '; ION detector specifics'
if (usem) then
write (10,7003) '; Spacing down to screen electrode [mil]
&
//', nominal -70, actual ',iscreen
else
write (10,7003) '; Spacing down to screen electrode [mil]
&
//', nominal -63, actual ',iscreen
endif
write (10,7003) '; Aperture width extra space, '
&
//'nominal 0, actual ',iextra
* Unit 10 writes to XXnnnnnn.GEM where XX=HE, HT, HM, HH or BT
* Unit 11 writes to MTnnnnnn.GEM for second magnetic PA for BEEPS
if (useb) then
write (10,7001) '; '
write (10,7001) '; BEEPS (ion mass analyser) specifics:'
write (10,7003) '; Space to top of magnets [mil] = ',
&
ibscreenspace
write (10,7003) '; bextra [mil] = ',ibextra
write (10,7003) '; Magnet thickness [mil] = ',
&
ibthickness
write (10,7003) '; Space from bottom of magnets to screen
&
//' [mil] = ',ibspace
write (10,7003) '; bVoltage - magnet section voltage, '

PAGE 17
07-12-:7
10:12:47
Line#
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894

Source Line
&

Microsoft FORTRAN Optimizing Compiler Version 5.00.03
//'nominal -1000, actual ',ibVoltage
write (10,7003) '; MagRi [mil] = ',iMagRi
write (10,7003) '; MagRo [mil] = ',iMagRo

*
* Unit 11 writes to MTnnnnnn.GEM for second magnetic PA for BEEPS
* write BEEPS parameters out as comments in second PA .GEM file also
write (11,7003) '; Space to top of magnets [mil] = ',
&
ibscreenspace
write (11,7003) '; bextra [mil] = ',ibextra
write (11,7003) '; Magnet thickness [mil] = ',
&
ibthickness
write (11,7003) '; Space from bottom of magnets to screen
&
//' [mil] = ',ibspace
write (11,7003) '; bVoltage - magnet section voltage, '
&
//'nominal -1000, actual ',ibVoltage
write (11,7003) '; MagRi [mil] = ',iMagRi
write (11,7003) '; MagRo [mil] = ',iMagRo
write (11,7001) '; '
write (11,7001) ';------------ derived parameters'
endif
endif
*
*======================================================================
*
* write out .GEM file derived parameters, with present values
* Unit 10 writes to XXnnnnnn.GEM where XX=HE, HT, HM, HH or BT
* Unit 11 writes to MTnnnnnn.GEM for second magnetic PA for BEEPS
write (10,7001) '; '
write (10,7001) ';------------ derived parameters'
write (10,7003) '; delta = (Ro - Ri); value ',idelta
write (10,7003) '; h = Ri*sin(theta); value ',ih
write (10,7001) '; Hi2d is the same as hplus'
write (10,7003) '; hplus = 2*delta+Ri*sin(theta); value ',ihplus
write (10,7003) '; Wi = Ri*cos(theta); value ',iWi
write (10,7001) '; Hi is the same as h'

895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917

*
*
*

write (10,7003) '; Hi = Ri*sin(theta) [alias for h]; value ',iHi
write (10,7003) '; Wo = Ro*cos(theta); value ',iWo
write (10,7003) '; Ho = Ro*sin(theta); value ',iHo
write (10,7003) '; WSi = Rs + Ri*cos(theta); value ',iWSi
write (10,7003) '; WSo = Rs + Ro*cos(theta); value ',iWSo
write (10,7003) '; RoPlus = Ro + 2*delta; value ',iRoPlus
write (10,7003) '; hBlend = (Hi + Ho)/2.0; value ',ihBlend
write (10,7003) '; wBlend = (Wi + Wo)/2.0; value ',iwBlend
write (10,7003) '; RiPlus = Ri + 2*delta; value ',iRiPlus
write (10,7003) '; RoPlus = Ro + 2*delta; value ',iRoPlus
write (10,7003) '; hBlend = (Hi + Ho)/2.0; value ',ihBlend
write (10,7003) '; wBlend = (Wi + Wo)/2.0; value ',iwBlend
write (10,7003) '; Ho1d = Ho + 1.0*delta; value ',iHo1d
write (10,7003) '; Hotan = Ho - tan(gamma)*HatRad; value ',iHotan
write (10,7003) '; Hotand = Hotan -delta; value ',iHotand
write (10,7003) '; Ho2d = Ho - 2.0*delta; value ',iHo2d
write (10,7003) '; Ho3d = Ho - 3.0*delta; value ',iHo3d
write (10,7003) '; Ho4d = Ho - 4.0*delta; value ',iHo4d
write (10,7003) '; outer = HatRad; value ',iouter
write (10,7003) '; Hi1d = Hi + 1.0*delta; value ',iHi1d
write (10,7003) '; HidSep = Hi+Separation-delta; value ',iHidSep
write (10,7001) '; ----- Hi2d is the same as hplus '
write (10,7003) '; Hi2d = Hi + 2.0*delta; value ',iHi2d

PAGE 18
07-12-:7
10:12:47
Line#
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

write (10,7003) '; HiSep = Hi + Separation; value ',iHiSep
write (10,7003) '; Hi2du = Hi + 2.0*delta + u; value ',iHi2du
write (10,7003) '; HiSepu = Hi+Separation+u; value ',iHiSepu
write (10,7003) '; Hi3d = Hi + 3.0*delta; value ',iHi3d
write (10,7003) '; HiSepd = Hi+Separation+delta; value ',iHiSepd
write (10,7003) '; Hi3du = Hi + 3.0*delta + u; value ',iHi3du
write (10,7003) '; HiSepdu = Hi + Separation + delta + u; value '
&
iHiSepdu
*
write (10,7003) '; Hi4d = Hi + 4.0*delta; value ',iHi4d
write (10,7003) '; Hi5d = Hi + 5.0*delta; value ',iHi5d
*
write (10,7003) '; Hi6d = Hi + 6.0*delta; value ',iHi6d
write (10,7003) '; hBlend1d = hBlend + 1.0*delta; value ',
&
ihBlend1d
write (10,7003) '; Wo2dcot = Wo + 2.0*delta*cot(gamma); value ',
&
iWo2dcot
write (10,7003) '; Wo2dcotclip = min(Wo2dcot,HatRad,NumPnts-Rs);'
& // ' value ',iWo2dcotclip
write (10,7003) '; NumPntsX = max(NumPnts,Hi5d,Ho1d), value ',
& iNumPntsX
write (10,7003) '; NumPntsY = max(NumPnts,Wo2dcotclip,WSo,RoPlus)
& // ', value ',iNumPntsY
*----* Unit 11 writes to MTnnnnnn.GEM for second magnetic PA for BEEPS
if (useb) then
write (10,7003) '; Analyser exit plane to top of magnets '
&
//'[mil] = ',imagstart
write (10,7003) '; Analyser exit plane to bottom of magnets '
&
//'[mil] = ',imagstop
write (10,7003) '; Analyser exit plane to magnet screen '
&
//' [mil] = ',ibscreen
write (11,7003) '; Analyser exit plane to top of magnets '
&
//'[mil] = ',imagstart
write (11,7003) '; Analyser exit plane to bottom of magnets '
&
//'[mil] = ',imagstop
write (11,7003) '; Analyser exit plane to magnet screen '

953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975

&

endif

//' [mil] = ',ibscreen

*
*======================================================================
* Unit 10 writes to XXnnnnnn.GEM where XX=HE, HT, HM, HH or BT
* Unit 11 writes to MTnnnnnn.GEM for second magnetic PA for BEEPS
* write out .GEM file parameters, with present values
write (10,7001) ';_______________________________________________
& // '______________________________'
write (10,7001) '; Design parameters: '
write (10,7023) '; Rs - Radius of "stretch" cylinder, nominal 67,
& //' actual ',Rs
write (10,7023) '; Ri - a.k.a., R1; inner radius of analyzer, '
& //'nominal 604, actual ',Ri
write (10,7023) '; Ro - a.k.a., R2; outer radius of analyzer, '
& //'nominal 659, actual ',Ro
write (10,7023) '; theta - angle up from exit plane to analyser '
& //'entrance, nominal 74 degrees, actual ',theta
write (10,7023) '; gamma - (sometimes alpha) angle of entrance '
& //'electrodes from parallel, nominal 6 degrees, actual ',gamma
write (10,7023) '; gammau- (sometimes alpha) angle of entrance '
& //'electrodes from parallel, nominal 6 degrees, actual ',gammau
write (10,7023) '; gammal- (sometimes alpha) angle of entrance '

PAGE 19
07-12-:7
10:12:47
Line#
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

& //'electrodes from parallel, nominal 6 degrees, actual ',gammal
if (useb) then
write (10,7023) '; offset - distance from exit plane to bot'
&
//'tom of simulation region, nominal 18.05, actual ',offset
else
write (10,7023) '; offset - distance from exit plane to bot'
&
//'tom of simulation region, nominal 6.35, actual ',offset
endif
write (10,7023) '; HatRad - radius of "Top Hat", nom. Ro+2*delta
& //'(i.e., RoPlus), value ',RoPlus
write (10,7023) '; NumPnts - Number of array points per axis, '
& //'nominal 1001, actual ',NumPnts
write (10,7023) '; Voltage - HV electrode voltage, nominal '
& //' 1000, actual ',Voltage

*
*======================================================================
*
* Unit 10 writes to XXnnnnnn.GEM where XX=HE, HT, HM, HH or BT
* Unit 11 writes to MTnnnnnn.GEM for second magnetic PA for BEEPS
* write out .GEM file derived parameters, with present values
write (10,7001) ';------------ derived parameters'
write (10,7023) '; delta = (Ro - Ri); value ',delta
write (10,7023) '; h = Ri*sin(theta); value ',h
write (10,7001) '; Hi2d is the same as hplus'
write (10,7023) '; hplus = 2*delta+Ri*sin(theta); value ',hplus
write (10,7023) '; Wi = Ri*cos(theta); value ',Wi
write (10,7001) '; Hi is the same as h'
write (10,7023) '; Hi = Ri*sin(theta) [alias for h]; value ',Hi
write (10,7023) '; Wo = Ro*cos(theta); value ',Wo
write (10,7023) '; Ho = Ro*sin(theta); value ',Ho
write (10,7023) '; WSi = Rs + Ri*cos(theta); value ',WSi
write (10,7023) '; WSo = Rs + Ro*cos(theta); value ',WSo
write (10,7023) '; RoPlus = Ro + 2*delta; value ',RoPlus
write (10,7023) '; hBlend = (Hi + Ho)/2.0; value ',hBlend
write (10,7023) '; wBlend = (Wi + Wo)/2.0; value ',wBlend

1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033

*
*
*

write (10,7023) '; RiPlus = Ri + 2*delta; value ',RiPlus
write (10,7023) '; RoPlus = Ro + 2*delta; value ',RoPlus
write (10,7023) '; hBlend = (Hi + Ho)/2.0; value ',hBlend
write (10,7023) '; wBlend = (Wi + Wo)/2.0; value ',wBlend
write (10,7023) '; Ho1d = Ho + 1.0*delta; value ',Ho1d
write (10,7023) '; Hotan = Ho - tan(gamma)*HatRad; value ',Hotan
write (10,7023) '; Hotand = Hotan -delta; value ',Hotand
write (10,7023) '; Ho2d = Ho - 2.0*delta; value ',Ho2d
write (10,7023) '; Ho3d = Ho - 3.0*delta; value ',Ho3d
write (10,7023) '; Ho4d = Ho - 4.0*delta; value ',Ho4d
write (10,7023) '; outer = HatRad; value ',outer
write (10,7023) '; Hi1d = Hi + 1.0*delta; value ',Hi1d
write (10,7023) '; HidSep = Hi+Separation-delta; value ',HidSep
write (10,7001) '; ----- Hi2d is the same as hplus '
write (10,7023) '; Hi2d = Hi + 2.0*delta; value ',Hi2d
write (10,7023) '; HiSep = Hi + Separation; value ',HiSep
write (10,7023) '; Hi2du = Hi + 2.0*delta + u; value ',Hi2du
write (10,7023) '; HiSepu = Hi+Separation+u; value ',HiSepu
write (10,7023) '; Hi3d = Hi + 3.0*delta; value ',Hi3d
write (10,7023) '; HiSepd = Hi+Separation+delta; value ',HiSepd
write (10,7023) '; Hi3du = Hi + 3.0*delta + u; value ',Hi3du
write (10,7023) '; HiSepdu = Hi + Separation + delta + u; value '
&
HiSepdu

PAGE 20
07-12-:7
10:12:47
Line#
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068

Source Line
*
*

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

write (10,7023) '; Hi4d = Hi + 4.0*delta; value ',Hi4d
write (10,7023) '; Hi5d = Hi + 5.0*delta; value ',Hi5d
write (10,7023) '; Hi6d = Hi + 6.0*delta; value ',Hi6d
write (10,7023) '; hBlend1d = hBlend + 1.0*delta; value ',
&
hBlend1d
write (10,7023) '; Wo2dcot = Wo + 2.0*delta*cot(gamma); value ',
&
Wo2dcot
write (10,7023) '; Wo2dcotclip = min(Wo2dcot,HatRad,NumPnts-Rs);'
& // ' value ',Wo2dcotclip
write (10,7023) '; NumPntsX = max(NumPnts,Hi5d,Ho1d), value ',
& NumPntsX
write (10,7023) '; NumPntsY = max(NumPnts,Wo2dcotclip,WSo,RoPlus)
& // ', value ',NumPntsY
write (10,7003) '; iNumPntsX = ',iNumPntsX
write (10,7003) '; iNumPntsY = ',iNumPntsY
if (useb) then
write (10,*) '; magstart [mil] = ',magstart
write (10,*) '; magstop [mil] = ',magstop
write (10,*) '; imagstart [mil] = ',imagstart
write (10,*) '; imagstop [mil] = ',imagstop
endif

*
*
* Unit 10 writes to XXnnnnnn.GEM where XX=HE, HT, HM, HH or BT
* write out .GEM file version history
write (10,7001) ' '
write (10,7001) ';_______________________________________________
& // '______________________________'
write (10,7001) '; VERSION HISTORY of manually generated versions
write (10,7001) '; Fifth version Tuesday March 12, 2007 -- kgr '
& // '-- finishing comments, starting on Fortran to autogenerate
& // 'TopHat .GEMs'
write (10,7001) '; Fourth version Tuesday July 19, 2005 -- kgr -& // ' starting on Top Hat grounded electrode'
write (10,7001) '; Third version Tuesday July 19, 2005 -- kgr --

1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091

&

// 'starting on grounded electrodes, outer hemisphere first'
write (10,7001) '; Second version Monday July 18, 2005 -- kgr -& // 'start defining electrodes, got inner HV electrode done'
write (10,7001) '; First version Monday July 18, 2005 -- kgr -- '
& // 'just get most basic stuff'
write (10,7001) ' '
write (10,7001) ';_______________________________________________
& // '______________________________'
*
*======================================================================
*
* write out .GEM file Potential Array definition
if (.not.useb) then
* Unit 10 writes to XXnnnnnn.GEM where XX=HE, HT, HM, HH or BT
write (10,7004) 'PA_Define (',iNumPntsX,',',iNumPntsY,
&
',1,Cylindrical,Y,Electrostatic) ;define a 2D poten'
&
// 'tial array with cylindrical symmetry, Y mirrored'
else
write (10,7004) 'PA_Define (',iNumPntsX,',',iNumPntsY,
&
',1,Cylindrical,Y,Electrostatic) ;define a 2D poten'
&
// 'tial array with cylindrical symmetry, Y mirrored'
* Unit 11 writes to MTnnnnnn.GEM for second magnetic PA for BEEPS
write (11,7014) 'PA_Define (',iNumPntsX,',',iNumPntsY,

PAGE 21
07-12-:7
10:12:47
Line#

Source Line

1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126

&
&

*
*
*

Microsoft FORTRAN Optimizing Compiler Version 5.00.03
',',iNumPntsY,',Planar,None,Magnetostatic) ;define '
// 'a 3D potential array No mirroring'
write (10,7004) 'PA_Define (',iNumPntsX*3/2,',',iNumPntsY,
',1,Cylindrical,Y,Electrostatic) ;define a 2D poten'
// 'tial array with cylindrical symmetry, Y mirrored'

&
&
endif
write (10,7001) ' '

*
* write out locate command to shift origin and comment for same
write (10,7024) 'Locate (',offset,',0,0,',scale,
& ',0,0,0) { ; (1) shift'
& //' origin up the X axis to leave space for outgoing electrons
& // 'from analyzer toward MCP'
write (10,7001) ';Locate (offset,0,0,.0254,0,0,0) { ; (1) shift'
& // ' origin to (0,0)'' (Point B)'
write (10,7001) ' '
if (useb) then
write (11,7024) 'Locate (',offset,',0,0,',scale,
& ',0,0,0) { ; (1) shift'
& //' origin up the X axis to leave space for outgoing electrons
& // 'from analyzer toward MCP'
write (11,7001) ';Locate (offset,0,0,.0254,0,0,0) { ; (1) shift'
& // ' origin to (0,0)'' (Point B)'
write (11,7001) ' '
endif
*
*======================================================================
*
* Unit 10 writes to XXnnnnnn.GEM where XX=HE, HT, HM, HH or BT
* write out commands to create inner hemisphere electrode
write (10,7001) ';_______________________________________________
& // '______________________________'
write (10,7001) '
;define inner "hemisphere" electrode, '
& // 'which is the electrode driven at High Voltage'
write (10,7005) '
electrode(',iVoltage,') {
;HV elec

1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
# 1146
1147
1148
1149

&

// 'trode (inner) nominal 1000V
electrode(HV)'
write (10,7005) '
rotate_fill(',360,') { ;Cylindrical
& // ' symmetry, so rotate 360 degrees about X-axis'
write (10,7001) '
;2D geometry is
& // 'defined in X-Y plane, and Z does not exist in definitions'
write (10,7001) '
;3D cylindrical
& // 'form is generated by mirroring Y to -Y and rotating Y into
& // 'Z about X'
write (10,7001) '
;(Why did they '
& // 'not make Z the axis for the cylinder?)'
write (10,7005) '
Locate (0,',iRs,',0,1,0,0,0) {
& // '; (2.5) shift origin out Y-axis to edge of cylinder'
write (10,7001) '
;Locate (0,Rs,0,1,0,0,0) (2.
& // '5) move origin to (0,0)'''' (Point C) '
write (10,7001) '
; (3) include in HV 1/4 circ
& // 'ular arc at Ri [3]'
write (10,7009) '
within{ Circle(',0,0,iRi,iRi
&
') } ; within{ Circle(0,0,Ri,Ri) }'
*
* Get a "hole" in inner electrode with either of the following exclusio
* ? WHY ?
*
write (10,7009) '
notin{ Box2D(',0,-iRi,iRi,
*
&
0,') }
; exclude left side
notin{ Box2D(0,0,Ri,0) } '

PAGE 22
07-12-:7
10:12:47
Line#
# 1150
# 1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184

Source Line
**
**

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

write (10,7009) '
notin{ Box2D(',-iRi,-iRi,i
&
0,') }
; exclude left side
notin{ Box2D(-Ri,-Ri,Ri,0)
write (10,7009) '
notin{ Box2D(',-iRi,-iRi,0,
&
iRi,') } ; exclude bottom region notin{ Box2D(-Ri,-Ri,0,Ri) }'
write (10,7009) '
notin{ Box2D(',ih,-iRi,
& ihPlus,iRi,') }; exclude top region
notin{ Box2D(h,-Ri,'
& // 'h+2*delta,Ri) } '
write (10,7001) '
& // '
;(5) exclude 2* delta high rectangular region [2]'
write (10,7001) '
} ;END locate(0,Rs,0,1,0,0,0) '
write (10,7009) '
within{ Box2D(',0,0,ih,iRs,
&
') }
;within { Box2D(0,0,h,Rs) } '
write (10,7001) '
; (2) include in HV cylinder [1]
& // ' that makes this a "stretched" TopHat'
write (10,7001) '
; Box2D(0,0,h,Rs) when rotated
& // 'is cylinder, h high, Rs radius'
write (10,7009) '
within{ Box2D(',0,0,ih,iwsoblend
&
') }
;within { Box2D(0,0,h,(Rs+WSo)/2) } '
write (10,7001) '
; force overlap '
write (10,7001) '
} ;END rotate_fill(360)'
write (10,7001) ' '
write (10,7001) '
} ;END electrode(HV)'
write (10,7001) ' '

*
*======================================================================
*
* write out commands to create outer hemisphere electrode
write (10,7001) ';_______________________________________________
& // '______________________________'
write (10,7001) '
;define outer "hemisphere" electrode, '
& // 'which is grounded and includes lower Top Hat'
write (10,7005) '
electrode(',0,') {
;grounded '
& // 'electrode (outer) nominal 0V '
write (10,7005) '
rotate_fill(',360,') { ;Cylindrical
& // ' symmetry, so rotate 360 degrees about X-axis'

1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207

write (10,7001) '
;2D geometry is
// 'defined in X-Y plane, and Z does not exist in definitions'
write (10,7001) '
;3D cylindrical
& // 'form is generated by mirroring Y to -Y and rotating Y into
& // 'Z about X'
write (10,7001) '
;(Why did they '
& // 'not make Z the axis for the cylinder?)'
write (10,7005) '
Locate (0,',iRs,',0,1,0,0,0) {
& // '; (2.5) shift origin out Y-axis to edge of cylinder'
write (10,7001) '
;Locate (0,Rs,0,1,0,0,0) (2.
& // '5) move origin to (0,0)'''' (Point C) '
write (10,7009) '
within{ Circle(',0,0,iRo1d,
&
iRo1d,') }
; within{ Circle(0,0,Ro1d,Ro1d) }'
write (10,7009) '
notin{ Circle(',0,0,iRo,iRo,
&
') }
; notin{ Circle(0,0,Ro,Ro) } ; (4) exclude gap betw
& // 'een Ri and Ro (delta width) [4] '
write (10,7009) '
notin{ Box2D(',-iRoPlus,
&
-iRoPlus,0,iRoPlus,') } ; exclude left and bottom regions
& // 'notin{ Box2D(-RoPlus,-RoPlus,0,RoPlus) }'
write (10,7009) '
notin{ Box2D(',iHi1d,
&
-iRoPlus,iRoPlus,iRo,') }; exclude top region
notin{ '
& // 'Box2D(h+delta,-RoPlus,RoPlus,Ro) } '
write (10,7001) '
'
&

PAGE 23
07-12-:7
10:12:47
Line#

Source Line

1208
1209
1210
1211
1212
# 1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242

&
&

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

//
'
; (5) exclude 2* delta'
// ' high rectangular region [2] '
write (10,7001) '
;force exclusion of crud '
& // 'along upper surface of lower Top Hat electrode'

*
* make sure top surface of lower Top Hat is well defined with no encroa
* from outer cylinder (exclusion next is copy of later exclusion)
write (10,7007) '
notin{ PolyLine ( ',iHo,iWo
&
'
; Ho, Wo, Point "E" '
write (10,7007) '
',iHo,
&
iHatRad,'
; Ho, HatRad, '
*
write (10,7007) '
',iHotan
*
&
iHatRad,'
; Hotan, HatRad,'
*
* These two points MUST match the first two points in the WITHIN (next)
write (10,7007) '
',iHotan,
&
iHatRad,'
; Hotan, HatRad,'
write (10,7008) '
',iHo,iWo
&
') }
; Ho, Wo) } Point "E" '
write (10,7001) '
'
*
* lower portion of "Top Hat"
& // ';lower portion of "Top Hat" next '
write (10,7007) '
within{ PolyLine ( ',iHo,iWo
&
'
; Ho, Wo, Point "E" '
write (10,7007) '
',iHotan,
&
iHatRad,'
; Hotan, HatRad,'
write (10,7007) '
',iHotand
&
iHatRad,'
; Hotan-delta, HatRad, '
write (10,7008) '
',iHo,iWo
&
') }
; Ho, Wo) } Point "E" '
write (10,7007) '
'
; Ho, Wo, Point "E" '

&

notin{ PolyLine ( ',iHo,iWo

1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265

write (10,7007) '
iWo,'
; Ho+delta, Wo, '
write (10,7007) '
&
iHatRad,'
; Ho+delta, HatRad, '
&

*
* These two
write
&
write
&

',iHo1d,
',iHo1d,

points MUST match the first two points in the WITHIN (prior
(10,7007) '
',iHotan,
iHatRad,'
; Hotan, HatRad, '
(10,7008) '
',iHo,iWo
') }
; Ho, Wo) } Point "E" '

write (10,7001) '
// '
;remove any glitches in cross-over space '
write (10,7007) '
notin{ PolyLine ( ',ihBlend
&
iwBlend,'
; hBlend, wBlend, '
write (10,7007) '
',
&
ihBlend1d,iwBlend,'
; hBlend+delta, wBlend, '
write (10,7007) '
',
&
ihBlend1d,0,'
; hBlend+delta, 0, '
write (10,7007) '
',
&
ihBlend,0,'
; hBlend, 0, '
write (10,7008) '
',ihBlend
&
iwBlend,') }
; hBlend, wBlend) } '
&

PAGE 24
07-12-:7
10:12:47
Line#

Source Line

1266
1267

&

1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

write (10,7001) '
// '
;more glitch removal in cross-over space '

write (10,7007) '
0,'
; Ho, 0, '
write (10,7007) '
&
iHo,iWo,'
; Ho, Wo, '
write (10,7007) '
&
iHo1d,iWo,'
; Ho1d, Wo,
write (10,7007) '
&
0,'
; Ho1d, 0,
'
write (10,7008) '
&
0,') }
; Ho, 0) } '

notin{ PolyLine ( ',iHo,

&

',
'

',
',iHo1d,
',iHo,

*
* close definition of electrode
write (10,7001) '
} ;END locate(0,Rs...'
write (10,7001) '
} ;END rotate_fill(360)'
write (10,7001) '
} ;END electrode(0) outer, lower TopHat
write (10,7001) ' '
*
*======================================================================
*
* write out commands to create upper TopHat electrode
write (10,7001) ';_______________________________________________
& // '______________________________'
write (10,7001) '
;define upper "Top Hat" electrode, which
& // ' is grounded'
write (10,7005) '
electrode(',0,') {
;grounded elect
& // 'rode (Top Hat) nominal 0V'
write (10,7005) '
rotate_fill(',360,') { ;Cylindrical
& // ' symmetry, so rotate 360 degrees about X-axis'
write (10,7001) '
;2D geometry is
& // 'defined in X-Y plane, and Z does not exist in definitions'
write (10,7001) '
;3D cylindrical
& // 'form is generated by mirroring Y to -Y and rotating Y into

1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323

&

// 'Z about X'
write (10,7001) '
& // 'not make Z the axis for the cylinder?)'
write (10,7007) '
'
; Hi+separation, 0,'

&

;(Why did they '

within{ PolyLine ( ',iHiSep,0,

*
* next two points must be same as fourth and fifth points in NOTIN belo
* (opposite order)
write (10,7007) '
',iHiSep,iWSo
& '
; Hi+Separation, Wo+Rs, Point "F"'
write (10,7007) '
',iHiSepu,
& iHatRadS,'
; Hi+Separation+u, HatRad '
write (10,7007) '
',iHiSepdu,
& iHatRadS,'
; Hi+Separation+delta+u, HatRad '
write (10,7007) '
',iHiSepd,
& iWSo,'
; Hi+Separation+delta, Wo+Rs, Point "F" +delta'
write (10,7007) '
',iHiSepd,0,
& '
; Hi+Separation+delta, 0,'
write (10,7008) '
',iHiSep,0,
& ') }
; Hi+Separation, 0) }'
write (10,7007) '
'
; h+Separation, 0,'

&

notin{ PolyLine ( ',iHidSep,0,

PAGE 25
07-12-:7
10:12:47
Line#
1324
1325
1326
1327
1328
# 1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

write (10,7007) '
iWSo,'
; h+Separation, Wo+Rs, '
write (10,7007) '
&
iHatRadS,'
; Hi+Separation, HatRad '
&

',iHidSep,
',iHidSep,

*
* next two points must be same as second and third points in WITHIN abo
* (opposite order)
write (10,7007) '
',iHiSepu,
&
iHatRadS,'
; Hi+Separation+u, HatRad '
write (10,7007) '
',iHiSep,
& iWSo,'
; Hi+Separation, Wo+Rs,
Point "F" '
write (10,7007) '
',iHiSep,0,
& '
; Hi+Separation, 0, '
write (10,7008) '
',iHidSep,0,
& ') }
; Hi+Separation-delta, 0) } '
write (10,7001) '
write (10,7001) '

}

} ;END rotate_fill(360)'
;END electrode(0) upper TopHat'

*
*======================================================================
*
* write out commands to create screen electrode IF doing IONS
if (.not.electrons) then
write (10,7001) ';_______________________________________________
& // '______________________________'
write (10,7001) '
;define ground screen electrode, which'
& // ' is (Duh!) grounded'
write (10,7005) '
electrode(',0,') {
;grounded elect
& // 'rode - ground screen '
write (10,7005) '
rotate_fill(',360,') { ;Cylindrical
& // ' symmetry, so rotate 360 degrees about X-axis'
write (10,7001) '
;2D geometry is
& // 'defined in X-Y plane, and Z does not exist in definitions'
write (10,7001) '
;3D cylindrical
& // 'form is generated by mirroring Y to -Y and rotating Y into

#
#

#
#

1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381

&

// 'Z about X'
write (10,7001) '
& // 'not make Z the axis for the cylinder?)'
**
**
**
**
**
*
*
*
*
*

;(Why did they '

within{ PolyLine ( -00003, 00000,
; iscreen, 0,
-00003, 00671,
; iscreen, Ri+R
-00005, 00671,
; iscreen-2, Ri
-00005, 00000,
; iscreen-2, 0,
-00003, 00000) }
; iscreen, 0) }
within{ PolyLine ( -00063, 00000,
; iscreen, 0,
-00063, 00724,
; iscreen, Ri+Rs
-00065, 00724,
; iscreen-2, Ri+
-00065, 00000,
; iscreen-2, 0
-00063, 00000) }
; iscreen, 0) }
write (10,7007) '
within{ PolyLine ( ',iscreen,0,
& '
; iscreen, 0,'
write (10,7007) '
',iscreen,
& iRiRs,'
; iscreen, Ri+Rs-extra '
write (10,7007) '
',iscreen-2,
& iRiRs,'
; iscreen-2, Ri+Rs-extra '
write (10,7007) '
',iscreen-2,
& 0,'
; iscreen-2, 0'
write (10,7008) '
',iscreen,0,

PAGE 26
07-12-:7
10:12:47
Source Line

1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416

&

#
#
#
#
#
#
#
#
#
#

Line#

**
**
**
**
**
*
*
*
*
*

') }

Microsoft FORTRAN Optimizing Compiler Version 5.00.03
; iscreen, 0) }'

within{ PolyLine ( -00003, 00726,
; iscreen, Ro+
-00003, 00836,
; iscreen, RoP
-00005, 00836,
; iscreen-2, R
-00005, 00726,
; iscreen-2, R
-00003, 00726) }
; iscreen, Ro+
within{ PolyLine ( -00063, 00774,
; iscreen, Ro+Rs
-00063, 00874,
; iscreen, RoPlu
-00065, 00874,
; iscreen-2, RoP
-00065, 00774,
; iscreen-2, Ro+
-00063, 00774) }
; iscreen, Ro+Rs
write (10,7007) '
within{ PolyLine ( ',iscreen,
& iRoRs,'
; iscreen, Ro+Rs+extra,'
write (10,7007) '
',iscreen,
& iRoPlRs,'
; iscreen, RoPlus+Rs,'
write (10,7007) '
',iscreen-2,
& iRoPlRs,'
; iscreen-2, RoPlus+Rs, '
write (10,7007) '
',iscreen-2,
& iRoRs,'
; iscreen-2, Ro+Rs+extra,'
write (10,7008) '
',iscreen,
& iRoRs,') }
; iscreen, Ro+Rs+extra) }'

write (10,7001) '
} ;END rotate_fill(360)'
write (10,7001) '
} ;END electrode(0) grounded screen'
endif
*======================================================================
*
* write out commands to create Magnet area - BEEPS
if (useb) then
write (11,7001) ';_______________________________________________
& // '______________________________'
write (11,7001) '
;define magnet area'
write (11,7005) '
electrode(',iMags,
&
') {
;magnet faces '

1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439

write (11,7001) '
fill { '
yi = MagRi
zi = 0.0
*
iyi = iMagRi
izi = nint(zi)
*
yo = MagRo
zo = 2.0
*
iyo = iMagRo
izo = nint(zo)
do 6001 i = 0,14
degrees = 9.1 + i * 24.0
idegrees = nint(degrees)
write (11,7025) '
locate(0,0,0,.0254,0,0,',
&
degrees,') { '
write (11,7017) '
within{ Box3D ( ',-imagstop,
&
iMagRi,izi
write (11,7018) '
',-imagstart
&
iMagRo,izo,' ) } '
write (11,7001) '
} ; locate '
6001 continue
write (11,7001) '
} ; fill'
write (11,7001) '
} ;END Magnet faces '
*----*

PAGE 27
07-12-:7
10:12:47
Line#
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

write (11,7005) '
&

electrode(',0,
') {
;magnet faces 2'
fill { '

write (11,7001) '
do 6002 i = 0,14
degrees = 0.0 + i * 24.0
idegrees = nint(degrees)
write (11,7025) '
locate(0,0,0,.0254,0,0,',
&
degrees,') { '
write (11,7017) '
within{ Box3D ( ',-imagstop,
&
iMagRi,izi
write (11,7018) '
',-imagstart
&
iMagRo,izo,' ) } '
write (11,7001) '
} ; locate '
6002 continue
write (11,7001) '
} ; fill'
write (11,7001) '
} ;END Magnet faces 2'
endif
*
if (useb) then
*======================================================================
*
* write out commands to create SECOND screen electrode IF doing BEEPS
* and possibly a THIRD screen (second and third are at same potential)
*
if (useb) then
if (magscr2) then
*----write (10,7001) ';_______________________________________________
& // '______________________________'
write (10,7001) '
;define extra magnet screen electrode, '
& // 'which is NOT grounded'
write (10,7005) '
electrode(',ibVoltage,
&
') {
;extra magnet screen electrode '
write (10,7005) '
rotate_fill(',360,') { ;Cylindrical
& // ' symmetry, so rotate 360 degrees about X-axis'
write (10,7001) '
;2D geometry is

#
#
#
#
#
#

1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497

&

// 'defined in X-Y plane, and Z does not exist
write (10,7001) '
& // 'form is generated by mirroring Y to -Y and
& // 'Z about X'
write (10,7001) '
& // 'not make Z the axis for the cylinder?)'
**
**
**
**
**
*
*
*
*
*

in definitions'
;3D cylindrical
rotating Y into
;(Why did they '

within{ PolyLine ( -00003, 00000,
; -iscreen2, 0,
-00003, 00671,
; -iscreen2, Ri
-00005, 00671,
; -iscreen2-2,
-00005, 00000,
; -iscreen2-2,
-00003, 00000) }
; -iscreen2, 0)
within{ PolyLine ( -00580, 00000,
; -iscreen2, 0,
-00580, 00724,
; -iscreen2, Ri+
-00582, 00724,
; -iscreen2-2, R
-00582, 00000,
; -iscreen2-2, 0
-00580, 00000) }
; -iscreen2, 0)
write (10,7007) '
within{ PolyLine ( ',-iscreen2,0
& '
; -iscreen2, 0,'
write (10,7007) '
',-iscreen2,
& ibRiRs,'
; -iscreen2, bRi+Rs '
write (10,7007) '
',-iscreen2-2
& ibRiRs,'
; -iscreen2-2, bRi+Rs '

PAGE 28
07-12-:7
10:12:47
Line#

#
#
#
#
#
#
#
#
#
#

1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

write (10,7007) '
0,'
; -iscreen2-2, 0'
write (10,7008) '
& ') }
; -iscreen2, 0) }'

',-iscreen2-2

&

**
**
**
**
**
*
*
*
*
*

',-iscreen2,0

within{ PolyLine ( -00003, 00726,
; -iscreen2, R
-00003, 00836,
; -iscreen2, Ro
-00005, 00836,
; -iscreen2-2,
-00005, 00726,
; -iscreen2-2,
-00003, 00726) }
; -iscreen2, Ro
within{ PolyLine ( -00580, 00774,
; -iscreen2, Ro+
-00580, 00874,
; -iscreen2, RoP
-00582, 00874,
; -iscreen2-2, R
-00582, 00774,
; -iscreen2-2, R
-00580, 00774) }
; -iscreen2, Ro+
write (10,7007) '
within{ PolyLine ( ',-iscreen2,
& ibRoRs,'
; -iscreen2, bRo+Rs,'
write (10,7007) '
',-iscreen2,
& ibRoPlRs,'
; -iscreen2, bRoPlus+Rs, '
write (10,7007) '
',-iscreen2-2
& ibRoPlRs,'
; -iscreen2-2, bRoPlus+Rs, '
write (10,7007) '
',-iscreen2-2
& ibRoRs,'
; -iscreen2-2, bRo+Rs,'
write (10,7008) '
',-iscreen2,
& ibRoRs,') }
; -iscreen2, bRo+Rs) }'
write (10,7001) '
write (10,7001) '

*-----

endif

*
*-----

;

}

} ;END rotate_fill(360)'
;define extra magnet screen electrode

if (magscr2) then

write (10,7001) ';_______________________________________________
// '______________________________'
write (10,7001) '
;define magnet screen electrode, which'

&

#
#
#
#
#
#

1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555

&

// ' is NOT grounded'
write (10,7005) '

electrode(',ibVoltage,
') {
;magnet screen electrode '
write (10,7005) '
rotate_fill(',360,') { ;Cylindrical
& // ' symmetry, so rotate 360 degrees about X-axis'
write (10,7001) '
;2D geometry is
& // 'defined in X-Y plane, and Z does not exist in definitions'
write (10,7001) '
;3D cylindrical
& // 'form is generated by mirroring Y to -Y and rotating Y into
& // 'Z about X'
write (10,7001) '
;(Why did they '
& // 'not make Z the axis for the cylinder?)'
&

**
**
**
**
**
*
*
*
*
*

within{ PolyLine ( -00003, 00000,
-00003, 00671,
-00005, 00671,
-00005, 00000,
-00003, 00000) }
within{ PolyLine ( -00580, 00000,
-00580, 00724,
-00582, 00724,
-00582, 00000,
-00580, 00000) }

;
;
;
;
;
;
;
;
;
;

-ibscreen, 0,
-ibscreen, Ri
-ibscreen-2,
-ibscreen-2,
-ibscreen, 0)
-ibscreen, 0,
-ibscreen, Ri+
-ibscreen-2, R
-ibscreen-2, 0
-ibscreen, 0)

PAGE 29
07-12-:7
10:12:47
Line#

#
#
#
#
#
#
#
#
#
#

1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

write (10,7007) '
within{ PolyLine ( ',-ibscreen,0
'
; -ibscreen, 0,'
write (10,7007) '
',-ibscreen,
& imRiRs,'
; -ibscreen, mRi+Rs '
write (10,7007) '
',-ibscreen-2
& imRiRs,'
; -ibscreen-2, mRi+Rs '
write (10,7007) '
',-ibscreen-2
& 0,'
; -ibscreen-2, 0'
write (10,7008) '
',-ibscreen,0
& ') }
; -ibscreen, 0) }'
&

**
**
**
**
**
*
*
*
*
*

within{ PolyLine ( -00003, 00726,
; -ibscreen, R
-00003, 00836,
; -ibscreen, Ro
-00005, 00836,
; -ibscreen-2,
-00005, 00726,
; -ibscreen-2,
-00003, 00726) }
; -ibscreen, Ro
within{ PolyLine ( -00580, 00774,
; -ibscreen, Ro+
-00580, 00874,
; -ibscreen, RoP
-00582, 00874,
; -ibscreen-2, R
-00582, 00774,
; -ibscreen-2, R
-00580, 00774) }
; -ibscreen, Ro+
write (10,7007) '
within{ PolyLine ( ',-ibscreen,
& imRoRs,'
; -ibscreen, mRo+Rs,'
write (10,7007) '
',-ibscreen,
& imRoPlRs,'
; -ibscreen, mRoPlus+Rs, '
write (10,7007) '
',-ibscreen-2
& imRoPlRs,'
; -ibscreen-2, mRoPlus+Rs, '
write (10,7007) '
',-ibscreen-2
& imRoRs,'
; -ibscreen-2, mRo+Rs,'
write (10,7008) '
',-ibscreen,
& imRoRs,') }
; -ibscreen, mRo+Rs) }'

*-----

write (10,7001) '
write (10,7001) '

}

} ;END rotate_fill(360)'
;define magnet screen electrode'

1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
# 1612
1613

endif
*
if (useb) then
*======================================================================
*
*---------------------------------------------------------------------write (10,7001) '} ;END Locate (offset,0,0,.0254,0,0,0) { ; (1)'
& // ' shift orig'
write (10,7001) ';END of autogenerated Top Hat Heeps-X GEM file'
write (10,7001) ';_______________________________________________
& // '______________________________'
if (useb) then
write (11,7001) '} ;END Locate (offset,0,0,.0254,0,0,0) { ; (1)'
& // ' shift orig'
write (11,7001) ';END of autogenerated Top Hat Heeps-X GEM file'
write (11,7001) ';_______________________________________________
& // '______________________________'
endif
*
*======================================================================
*
*---------------------------------------------------------------------* ?Do another?, ask if interactive else check for more filenames on com
* repeat or exit

PAGE 30
07-12-:7
10:12:47
Line#
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648

Source Line

Microsoft FORTRAN Optimizing Compiler Version 5.00.03

*----* Presently UNimplemented -- just close test file and stop
close (unit=10,status='keep',err=9901)
9901 continue
if (useb) then
close (unit=11,status='keep',err=9902)
9902
continue
endif
print *,' '
print *,' Output is complete, program terminating.'
print *,' '
stop ' Live long and prosper'
*---------------------------------------------------------------------* error handlers
*----*---------------------------------------------------------------------* Formats
*----7001 format (a)
7002 format (a66)
7003 format (a,i6.5)
7004 format (a,i6.5,a,i6.5,a)
7005 format (a,i6.5,a)
7006 format (a,i6.5,a,g16.6,a)
* 7006 format (a,i6.5,',',i6.5,',',i6.5,',',i6.5,',',a)
7007 format (a,i6.5,',',i6.5,',',a)
7008 format (a,i6.5,',',i6.5,a)
7009 format (a,i6.5,',',i6.5,',',i6.5,',',i6.5,a)
7010 format (e13.0)
7014 format (a,i6.5,a,i6.5,a,i6.5,a)
7017 format (a,i6.5,',',i6.5,',',i6.5)
7018 format (a,i6.5,',',i6.5,',',i6.5,a)
7023 format (a,g13.4)
7024 format (a,g13.4,a,g13.4,a)
7025 format (a,g13.4,a)

1649
1650
1651
1652
main

7027 format (a,g13.4,',',g13.4,',',a)
7028 format (a,g13.4,',',g13.4,a)
7029 format (a,g13.4,',',g13.4,',',g13.4,',',g13.4,a)
end
Local Symbols

Name
BANNER. .
IATEMP. .
USET. . .
IDEGREES.
I . . . .
CHAR1 . .
FNAME2. .
FILE. . .
ZI. . . .
FNAME . .
ZO. . . .
IZI . . .
PATH. . .

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.

Class

Type

local
local
local
local
local
local
local
local
local
local
local
local
local

CHAR*66
INTEGER*4
LOGICAL*4
INTEGER*4
INTEGER*4
CHAR*1
CHAR*127
CHAR*8
REAL*4
CHAR*127
REAL*4
INTEGER*4
CHAR*64

Size

Offset

330
4
4
4
4
1
127
8
4
127
4
4
64

0000
0002
0006
000a
000e
0012
0014
0094
009c
00a0
0120
0124
0128

PAGE 31
07-12-:7
10:12:47
Microsoft FORTRAN Optimizing Compiler Version 5.00.03
main

Local Symbols

Name

Class

Type

Size

Offset

MAGSCR2 .
USEB. . .
ELECTRONS
BIGGER. .
OLDBIG. .
EXT . . .
IZO . . .
USEH. . .
TEMP. . .
ATEMP . .
USEM. . .
DRIVE . .
DEGREES .
ITEMP . .
IMAGSTOP.
OUTER . .
BRORS . .
IMAGS . .
BROPLRS .
HI2D. . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

local
local
local
local
local
local
local
local
local
local
local
local
local
local
IWORKIN
WORKING
WORKING
IWORKIN
WORKING
WORKING

LOGICAL*4
LOGICAL*4
LOGICAL*4
LOGICAL*4
LOGICAL*4
CHAR*3
INTEGER*4
LOGICAL*4
REAL*4
CHAR*20
LOGICAL*4
CHAR*1
REAL*4
INTEGER*4
INTEGER*4
REAL*4
REAL*4
INTEGER*4
REAL*4
REAL*4

4
4
4
4
4
3
4
4
4
20
4
1
4
4
4
4
4
4
4
4

0168
016c
0170
0174
0178
017c
0180
0184
0188
018c
01a0
01a4
01a6
01aa
00c4
0104
0148
00c8
014c
0008

IMAGRI. .
MAGSTART.
HI3D. . .
IMAGRO. .
MAGSTOP .
HI5D. . .
ISCREEN2.
MAGS. . .
HBLEND1D.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

IWORKIN
WORKING
WORKING
IWORKIN
WORKING
WORKING
IWORKIN
WORKING
WORKING

INTEGER*4
REAL*4
REAL*4
INTEGER*4
REAL*4
REAL*4
INTEGER*4
REAL*4
REAL*4

4
4
4
4
4
4
4
4
4

00cc
0150
0050
00d0
0154
0054
00d4
0158
0058

MAGRI . . .
IMRIRS. . .
WO2DCOT . .
MAGRO . . .
WO2DCOTCLIP
IMRORS. . .
IMROPLRS. .
NUMPNTSX. .
MRIRS . . .
MRORS . . .
NUMPNTSY. .
MROPLRS . .
RO1D. . . .
RO2D. . . .
HOTAN . . .
IDELTA. . .
HOTAND. . .
IH. . . . .
HI2DU . . .
IHPLUS. . .
IWI . . . .
HI3DU . . .
DRS . . . .
IHI . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

WORKING
IWORKIN
WORKING
WORKING
WORKING
IWORKIN
IWORKIN
WORKING
WORKING
WORKING
WORKING
WORKING
WORKING
WORKING
WORKING
IWORKIN
WORKING
IWORKIN
WORKING
IWORKIN
IWORKIN
WORKING
DEFAULT
IWORKIN

REAL*4
INTEGER*4
REAL*4
REAL*4
REAL*4
INTEGER*4
INTEGER*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
INTEGER*4
REAL*4
INTEGER*4
REAL*4
INTEGER*4
INTEGER*4
REAL*4
REAL*4
INTEGER*4

4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4

015c
00d8
005c
0160
0060
00dc
00e0
0064
0168
016c
0068
0170
006c
0020
0070
0000
0074
0004
0078
0008
000c
007c
0000
0004

PAGE 32
07-12-:7
10:12:47
Microsoft FORTRAN Optimizing Compiler Version 5.00.03
main

Local Symbols

Name
U . . . .
IWO . . .
DRI . . .
HATRADS .
DRO . . .
IHO . . .
WSOBLEND.
IWSI. . .
DTHETA. .
RIRS. . .
DGAMMA. .
RORS. . .
IWSO. . .
IROPLUS .
ROPLRS. .
DOFFSET .
HISEP . .
DHATRAD .
IHBLEND .
DNUMPNTS.
HISEPU. .
IWBLEND .
IRIPLUS .
DVOLTAGE.
HISEPDU .
HISEPD. .
IVOLTAGE.
THETARAD.
HIDSEP. .
GAMMARAD.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

Class

Type

WORKING
IWORKIN
DEFAULT
WORKING
DEFAULT
IWORKIN
WORKING
IWORKIN
DEFAULT
WORKING
DEFAULT
WORKING
IWORKIN
IWORKIN
WORKING
DEFAULT
WORKING
DEFAULT
IWORKIN
DEFAULT
WORKING
IWORKIN
IWORKIN
DEFAULT
WORKING
WORKING
IWORKIN
DEFAULT
WORKING
DEFAULT

REAL*4
INTEGER*4
REAL*4
REAL*4
REAL*4
INTEGER*4
REAL*4
INTEGER*4
REAL*4
REAL*4
REAL*4
REAL*4
INTEGER*4
INTEGER*4
REAL*4
REAL*4
REAL*4
REAL*4
INTEGER*4
REAL*4
REAL*4
INTEGER*4
INTEGER*4
REAL*4
REAL*4
REAL*4
INTEGER*4
REAL*4
REAL*4
REAL*4

Size
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4

Offset
0080
0010
0004
0084
0008
0014
0088
0018
000c
0120
0010
0124
001c
0020
0128
0014
008c
0018
0024
001c
0090
0028
002c
0020
0094
0098
0030
0024
009c
0028

IHO1D . . .
ISCREEN . .
EXTRA . . .
SCALING . .
SEPARATION.
IOUTER. . .
SCREEN. . .
IRS . . . .
DBSCREENSP.
IHI2D . . .
IRI . . . .
IHI3D . . .

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.

IWORKIN
IWORKIN
WORKING
DEFAULT
DEFAULT
WORKING
WORKING
WORKING
DEFAULT
IWORKIN
WORKING
IWORKIN

INTEGER*4
INTEGER*4
REAL*4
REAL*4
REAL*4
INTEGER*4
REAL*4
INTEGER*4
REAL*4
INTEGER*4
INTEGER*4
INTEGER*4

4
4
4
4
4
4
4
4
4
4
4
4

0034
0074
00a8
002c
0030
00c8
00ac
00b0
004c
0008
00b4
0038

DBEXTRA . . .
DGAMMAU . . .
IHBLEND1D . .
IRO . . . . .
ITHETA. . . .
DGAMMAL . . .
IHI1D . . . .
IGAMMA. . . .
IWO2DCOT. . .
DTHETAI . . .
IWO2DCOTCLIP.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.

DEFAULT
DEFAULT
IWORKIN
WORKING
WORKING
DEFAULT
IWORKIN
WORKING
IWORKIN
DEFAULT
IWORKIN

REAL*4
REAL*4
INTEGER*4
INTEGER*4
INTEGER*4
REAL*4
INTEGER*4
INTEGER*4
INTEGER*4
REAL*4
INTEGER*4

4
4
4
4
4
4
4
4
4
4
4

0050
0034
003c
00b8
00bc
0038
0040
00c0
0044
003c
0048

PAGE 33
07-12-:7
10:12:47
Microsoft FORTRAN Optimizing Compiler Version 5.00.03
main

Local Symbols

Name
IOFFSET . .
DTHETAO . .
IHATRAD . .
INUMPNTSX .
DEXTRA. . .
INUMPNTS. .
INUMPNTSY .
DSCREEN . .
DBTHICKNESS
IRO1D . . .
IGAMMAU . .
IGAMMAL . .
DBSPACE . .
IRO2D . . .
DBVOLTAGE .
IHI5D . . .
ITHETAI . .
DMAGS . . .
ITHETAO . .
IHOTAN. . .
DMAGRI. . .
IHOTAND . .
DINUMPNTS .
DMAGRO. . .
SCALE . . .
IHI2DU. . .
IHI3DU. . .
PI. . . . .
DELTA . . .
RS. . . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

Class

Type

WORKING
DEFAULT
WORKING
IWORKIN
DEFAULT
WORKING
IWORKIN
DEFAULT
DEFAULT
IWORKIN
WORKING
WORKING
DEFAULT
IWORKIN
DEFAULT
IWORKIN
WORKING
DEFAULT
WORKING
IWORKIN
DEFAULT
IWORKIN
WORKING
DEFAULT
WORKING
IWORKIN
IWORKIN
WORKING
WORKING
WORKING

INTEGER*4
REAL*4
INTEGER*4
INTEGER*4
REAL*4
INTEGER*4
INTEGER*4
REAL*4
REAL*4
INTEGER*4
INTEGER*4
INTEGER*4
REAL*4
INTEGER*4
REAL*4
INTEGER*4
INTEGER*4
REAL*4
INTEGER*4
INTEGER*4
REAL*4
INTEGER*4
INTEGER*4
REAL*4
REAL*8
INTEGER*4
INTEGER*4
REAL*8
REAL*4
REAL*4

Size
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
8
4
4
8
4
4

Offset
00c4
0040
00c8
004c
0044
00cc
0050
0048
0054
0054
00d0
00d4
0058
0020
005c
0058
00d8
0060
00dc
005c
0064
0060
00e0
0068
00a0
0064
0068
00e4
0000
00ec

IHATRADS.
IWSOBLEND
RI. . . .
H . . . .
RO. . . .
HPLUS . .
IHISEP. .
THETA . .
WI. . . .
IHISEPU .
GAMMA . .
IHISEPDU.
HI. . . .
WO. . . .
OFFSET. .
IHISEPD .
HATRAD. .
HO. . . .
IHIDSEP .
NUMPNTS .
WSI . . .
IRIRS . .
WSO . . .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

IWORKIN
IWORKIN
WORKING
WORKING
WORKING
WORKING
IWORKIN
WORKING
WORKING
IWORKIN
WORKING
IWORKIN
WORKING
WORKING
WORKING
IWORKIN
WORKING
WORKING
IWORKIN
WORKING
WORKING
IWORKIN
WORKING

INTEGER*4
INTEGER*4
REAL*4
REAL*4
REAL*4
REAL*4
INTEGER*4
REAL*4
REAL*4
INTEGER*4
REAL*4
INTEGER*4
REAL*4
REAL*4
REAL*4
INTEGER*4
REAL*4
REAL*4
INTEGER*4
REAL*4
REAL*4
INTEGER*4
REAL*4

4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4

006c
0070
00f0
0004
00f4
0008
0078
00f8
000c
007c
00fc
0080
0004
0010
0100
0084
0104
0014
0088
0108
0018
008c
001c

PAGE 34
07-12-:7
10:12:47
Microsoft FORTRAN Optimizing Compiler Version 5.00.03
main

Local Symbols

Name
VOLTAGE . . .
IRORS . . . .
GAMMAU. . . .
IROPLRS . . .
ROPLUS. . . .
GAMMAL. . . .
HBLEND. . . .
IEXTRA. . . .
THETAI. . . .
WBLEND. . . .
IBSCREENSPACE
IBEXTRA . . .
HI1D. . . . .
THETAO. . . .
IBTHICKNESS .
SCREEN2 . . .
GAMMAURAD . .
IBSPACE . . .
GAMMALRAD . .
BEXTRA. . . .
UU. . . . . .
IBVOLTAGE . .
BSCREEN . . .
UL. . . . . .
BVOLTAGE. . .
IBSCREEN. . .
BSCREENSPACE.
THETAIRAD . .
IBRIRS. . . .
BTHICKNESS. .

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

Class

Type

WORKING
IWORKIN
WORKING
IWORKIN
WORKING
WORKING
WORKING
IWORKIN
WORKING
WORKING
IWORKIN
IWORKIN
WORKING
WORKING
IWORKIN
WORKING
WORKING
IWORKIN
WORKING
WORKING
WORKING
IWORKIN
WORKING
WORKING
WORKING
IWORKIN
WORKING
WORKING
IWORKIN
WORKING

REAL*4
INTEGER*4
REAL*4
INTEGER*4
REAL*4
REAL*4
REAL*4
INTEGER*4
REAL*4
REAL*4
INTEGER*4
INTEGER*4
REAL*4
REAL*4
INTEGER*4
REAL*4
REAL*4
INTEGER*4
REAL*4
REAL*4
REAL*4
INTEGER*4
REAL*4
REAL*4
REAL*4
INTEGER*4
REAL*4
REAL*4
INTEGER*4
REAL*4

Size
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4

Offset
010c
0090
0110
0094
0020
0114
0024
0098
0118
0028
009c
00a0
002c
011c
00a4
0164
0030
00a8
0034
012c
0038
00ac
0130
003c
0134
00b0
0138
0040
00b4
013c

THETAORAD
IBRORS. .
BSPACE. .
IBROPLRS.
RIPLUS. .
IMAGSTART
HO1D. . .
BRIRS . .

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.

WORKING
IWORKIN
WORKING
IWORKIN
WORKING
IWORKIN
WORKING
WORKING

REAL*4
INTEGER*4
REAL*4
INTEGER*4
REAL*4
INTEGER*4
REAL*4
REAL*4

Class

Type

extern
extern
extern
common
extern
extern
extern
extern
extern

***
CHAR*8
***
***
***
***
***
***
***

4
4
4
4
4
4
4
4

0044
00b8
0140
00bc
0048
00c0
004c
0144

Global Symbols
Name
BT_DEFAULTS .
BUMPFILENAME.
CWRKING . . .
DEFAULTS. . .
DWRKING . . .
FNJOIN. . . .
FNSEP . . . .
HEB_DEFAULTS.
HE_DEFAULTS .

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.

Size

Offset

***
***
***
108
***
***
***
***
***

***
***
***
0000
***
***
***
***
***

PAGE 35
07-12-:7
10:12:47
Microsoft FORTRAN Optimizing Compiler Version 5.00.03
Global Symbols
Name
HH_DEFAULTS . . .
HM_DEFAULTS . . .
HOWTO . . . . . .
HT_DEFAULTS . . .
IWORKING. . . . .
IWRKING . . . . .
OLD_HEB_DEFAULTS.
OLD_HT_DEFAULTS .
WORKING . . . . .
main. . . . . . .

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

Code size = 43e5 (17381)
Data size = 741d (29725)
Bss size = 01ae (430)

.
.
.
.
.
.
.
.
.
.

No errors detected

Class

Type

Size

Offset

extern
extern
extern
extern
common
extern
extern
extern
common
FSUBRT

***
***
***
***
***
***
***
***
***
***

***
***
***
***
228
***
***
***
372
***

***
***
***
***
0000
***
***
***
0000
0000