PAGE

1
07-12-107
10:12:51
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

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

program he_sim7
*
* Program to generate a SimIon 7 geometry file for a HEEPS-E detector fr
* 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 mode
* Version 1.099 Tuesday April 24, 2007 - clean-up, get magnetic stuff s
* Version 1.092 Monday April 23, 2007 - HT/HM/BT screens & screen locat
* 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 setu
* Version 1.067 Wednesday March 28, 2007 - Grounded Screen, Magnet Elec
* Version 1.062 Wednesday March 21, 2007 - Filenames, defaults for diff
* Version 1.057 Tuesday March 13, 2007 - Use of .GEM file
* Version 1.055 Tuesday March 13, 2007 - scaling related issues & Upper
*------------------------ 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 thet
* Version 1.043 Tuesday July 26, 2005 - removed small geometry glitch j
* Version 1.042 Tuesday July 26, 2005 - user input to override paramete
* Version 1.037 Monday July 25, 2005 - First version to (apparently) ge
* Version 0.030 Monday July 25, 2005 - first to get Top Hat reasonably
* Version 0.020 Friday July 22, 2005 - first to generate three electrod
* Version 0.011 Thursday July 21, 2005 - first to generate inner hemisp
*---------------------------------------------------------------------* To Do (no particular order)

#

#
#
#

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

* (.F67, partial) Change output filename at run time
* read parameter file, generate .GEM
* (.F50, done) make TopHat top electrode to inner hemisphere spacing a v
* (.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 deg
*; gamma - (sometimes alpha) angle of entrance electrodes from parallel,
*; offset - distance from exit plane to bottom of simulation region, nom
*; 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'

PAGE
2
07-12-107
10:12:51
Line#

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

**** Begin listing of def.inc
1
2
real dRs,dRi,dRo,dtheta,dgamma,doffset,dHatRad,dNumPnts,dVoltage
3
real thetaRad,gammaRad,scaling,separation,dbscreensp,dbextra
4
real dgammau,dgammal,dthetai,dthetao,dextra,dscreen
5
real dbthickness,dbspace,dbVoltage,dMags,dMagRi,dMagRo
6
common /defaults/ dRs,dRi,dRo,dtheta,dgamma,doffset,dHatRad,
7
& dNumPnts,dVoltage,thetaRad,gammaRad,scaling,separation,
8
& dgammau,dgammal,dthetai,dthetao,dextra,dscreen,dbscreensp,
9
& 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
& NumPntsY,Ro1d,Hotan,Hotand,Hi2du,Hi3du,u,HatRadS,WSoblend,
24
& HiSep,HiSepu,HiSepdu,HiSepd,HidSep,scale,extra,screen,
25
& iRs,iRi,iRo,itheta,igamma,ioffset,iHatRad,iNumPnts,
26
& igammau,igammal,ithetai,ithetao,diNumPnts,Pi,
27
& Rs,Ri,Ro,theta,gamma,offset,HatRad,NumPnts,Voltage,
28
& gammau,gammal,thetai,thetao,RiRs,RoRs,RoPlRs,
29
& bextra,bscreen,bVoltage,bscreenspace,bthickness,bspace,
30
& bRiRs,bRoRs,bRoPlRs,magstart,magstop,Mags,MagRi,MagRo,
31
& 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)

PAGE
3
07-12-107
10:12:51
Line#

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

9
integer iHotan,iHotand,iHi2du,iHi3du,iHatRadS,iWSoblend
10
integer iHiSep,iHiSepu,iHiSepdu,iHiSepd,iHidSep
11
integer iRiRs,iRoRs,iRoPlRs
12
integer iextra,ibscreenspace,ibextra,ibthickness,ibspace
13
integer ibVoltage,ibscreen,ibRiRs,ibRoRs,ibRoPlRs
14
integer imagstart,imagstop,iMags,iMagRi,iMagRo,iscreen2
15
integer imRiRs,imRoRs,imRoPlRs
16
common /iworking/idelta,ih,ihplus,iWi,iWo,iHo,iWSi,iWSo,iRoPlus,
17
&
ihBlend,iwBlend,iRiPlus,iVoltage,iHo1d,iHi3d,ihBlend1d,iHi1d,
18
&
iWo2dcot,iWo2dcotclip,iNumPntsX,iNumPntsY,iRo1d,iHi5d,
19
&
iHotan,ihotand,ihi2du,ihi3du,iHatRads,iWSoblend,iscreen,
20
&
iHiSep,iHiSepu,iHiSepdu,iHiSepd,iHidSep,iRiRs,iRoRs,iRoPlRs,
21
&
iextra,ibscreenspace,ibextra,ibthickness,ibspace,ibVoltage,
22
&
ibscreen,ibRiRs,ibRoRs,ibRoPlRs,imagstart,imagstop,iMags,
23
&
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
81
82
83
84
85
86
87

*; Ho1d = Ho + 1.0*delta
*; Hotan = Ho - tan(gamma)*(HatRad-Wo)
*; Hotand = Ho - tan(gamma)*(HatRad-Wo) - delta
**; Ho2d = Ho - 2.0*delta
**; Ho3d = Ho - 3.0*delta
**; Ho4d = Ho - 4.0*delta
*; outer IS HatRad
*; Hi1d = Hi + 1.0*delta

88
89
90
91
92
93
94
95
96
97
98
99
100

*; 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

101
102

*; hBlend1d = hBlend + 1.0*delta
*; WSoblend = (WSo + Rs) /2.0

PAGE
4
07-12-107
10:12:51
Line#
103
104
105
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

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

character*66 banner(5)
character*20 atemp,char1*1
character*127 fname,fname2
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.

#

137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159

useb = .false.
magscr2 = .true.
*
*---- initialize default Heeps-E analyser geometry parameters - mils & d
* 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)'

PAGE
5
07-12-107
10:12:51
Line#
160
161
162
163
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

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

print *,' Medium energy ions: HM(m), (High energy: HH(h))'
print *,' y to keep current values '
print *,' '
if (electrons) then
print *, 'ELECTRONS or Ions? (E/g/i/t/m/h/b): b for Beeps,'
print *,' g for HEBIGGER, r for HEBIGGER, o for Old HEBIG, '
print *,' i for Heeps thermal Ion, m for HM medium energy,'
print *,' t for Heeps Thermal ion, h for HH high energy'
else
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.

194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216

bigger = .true.
oldbig = .false.
Voltage = 1000.0
uset = .false.
usem = .false.
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()

PAGE
6
07-12-107
10:12:51
Line#
217
218
219
220
221
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

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

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.
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.
&

251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273

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
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.

PAGE
7
07-12-107
10:12:51
Line#
274
275
276
277
278
279
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

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

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.'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()

308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330

call dwrking()

else

uset
usem
useh
useb

=
=
=
=

.true.
.false.
.false.
.false.

call ht_defaults()
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.

PAGE
8
07-12-107
10:12:51
Line#
331
332
333
334
335
336
337
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

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

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
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

363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387

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
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

PAGE
9
07-12-107
10:12:51
Line#
388
389
390
391
392
393
394
395
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

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

goto 9333
elseif (atemp.ne.' ') then
read (atemp,7010,err=9104) temp
if (temp.ge.0.0) theta = temp
endif
thetai = theta
thetao = theta

*---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

422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444

*---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
elseif (atemp.ne.' ') then
read (atemp,7010,err=9111) temp
if (temp.ge.0.0) gammau = temp
endif
*---if (.not.electrons) then
9118
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

PAGE 10
07-12-107
10:12:51
Line#
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477

Source Line

9106

Microsoft Fortran PowerStation Compiler. Version 4.0

if (temp.ge.0.0) screen = temp
endif
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
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

478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501

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))
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))

PAGE 11
07-12-107
10:12:51
Line#
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

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
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

536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558

*---9116

*---9117

endif
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
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

PAGE 12
07-12-107
10:12:51
Line#
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

elseif (atemp.ne.' ') then
read (atemp,7010,err=9117) temp
if (temp.gt.0.0) bthickness = temp
endif
*---9120

*---9119

*---9121

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
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

#

593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615

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
9122
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'
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 '

PAGE 13
07-12-107
10:12:51
Line#
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

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 '
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

650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672

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
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)

PAGE 14
07-12-107
10:12:51
Line#

#

673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

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 fil
* or use default (HE_nnnnn)
*
* 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'

707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729

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
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))

PAGE 15
07-12-107
10:12:51
Line#

#
#

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

730
731
732
733
734
735
736
737

*---------------------------------------------------------------------* write out output .GEM file
*----* write out .GEM file comments; these include all the comments in the m
* generated precursor file and additional auto-generated comments from t
* program, including an echo of the parameters
*
*======================================================================

738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762

*
* 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'
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'

763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786

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)'
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'

PAGE 16
07-12-107
10:12:51
Line#
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

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.'
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

821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843

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) '; '
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

PAGE 17
07-12-107
10:12:51
Line#
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

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, '
&
//'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) '; '

878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900

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'
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

PAGE 18
07-12-107
10:12:51
Line#
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934

*
*
*

*
*

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

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
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

935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957

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 '
&
//' [mil] = ',ibscreen
endif
*
*=======================================================================
* Unit 10 writes to XXnnnnnn.GEM where XX=HE, HT, HM, HH or BT
&

PAGE 19
07-12-107
10:12:51
Line#
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

* 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 '
& //'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
*
*======================================================================

992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014

*
* 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
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

PAGE 20
07-12-107
10:12:51
Line#
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047

*
*
*

*
*

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

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
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

1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071

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 -- '
& // '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'

PAGE 21
07-12-107
10:12:51
Line#
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

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,
&
',',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'

1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128

&

// ' 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'
& // 'trode (inner) nominal 1000V
electrode(HV)'
write (10,7005) '
rotate_fill(',360,') { ;Cylindrical'

PAGE 22
07-12-107
10:12:51
Line#
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
# 1146
1147
1148
1149
# 1150
# 1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

&

// ' 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 exclusion
* ? WHY ?
*
write (10,7009) '
notin{ Box2D(',0,-iRi,iRi,
*
&
0,') }
; exclude left side
notin{ Box2D(0,0,Ri,0) } '
**
write (10,7009) '
notin{ Box2D(',-iRi,-iRi,iR
**
&
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) } '

1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173

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) ' '

*

1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185

*======================================================================
*
* 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'
write (10,7001) '
;2D geometry is '

&

PAGE 23
07-12-107
10:12:51
Line#
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
# 1213
1214
1215
1216
1217
1218
1219

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

&

// '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) '
'
& //
'
; (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 encroac
* 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,

1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242

*
&
*
* These two
write
&
write
&
write

iHatRad,'

; Hotan, HatRad,'

points MUST match the first two points in the WITHIN (next)
(10,7007) '
',iHotan,
iHatRad,'
; Hotan, HatRad,'
(10,7008) '
',iHo,iWo,
') }
; Ho, Wo) } Point "E" '
(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,

PAGE 24
07-12-107
10:12:51
Line#
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

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) } '
write (10,7001) '
'
& // '
;more glitch removal in cross-over space '
write (10,7007) '
notin{ PolyLine ( ',iHo,
&
0,'
; Ho, 0, '
write (10,7007) '
',
&
iHo,iWo,'
; Ho, Wo, '
write (10,7007) '
',
&
iHo1d,iWo,'
; Ho1d, Wo, '
write (10,7007) '
',iHo1d,
&
0,'
; Ho1d, 0,
'
write (10,7008) '
',iHo,
&

1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299

&
0,') }
; Ho, 0) } '
*
* 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 '

PAGE 25
07-12-107
10:12:51
Line#
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
# 1329
1330
1331
1332
1333

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

&

// '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 below
* (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) '
notin{ PolyLine ( ',iHidSep,0,
'
; h+Separation, 0,'
write (10,7007) '
',iHidSep,
& iWSo,'
; h+Separation, Wo+Rs, '
write (10,7007) '
',iHidSep,
&
iHatRadS,'
; Hi+Separation, HatRad '
&

*
* next two points must be same as second and third points in WITHIN abov
* (opposite order)
write (10,7007) '
',iHiSepu,
&
iHatRadS,'
; Hi+Separation+u, HatRad '
write (10,7007) '
',iHiSep,

1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356

&

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'

PAGE 26
07-12-107
10:12:51
Line#

#
#

#
#

#
#
#
#
#
#
#

1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

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,
; iscreen, 0,
-00003, 00671,
; iscreen, Ri+Rs
-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+R
-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,
& ') }
; iscreen, 0) }'
within{ PolyLine ( -00003, 00726,
-00003, 00836,
-00005, 00836,
-00005, 00726,
-00003, 00726) }
within{ PolyLine ( -00063, 00774,
-00063, 00874,

; iscreen, Ro+R
; iscreen, RoPl
; iscreen-2, Ro
; iscreen-2, Ro
; iscreen, Ro+R
; iscreen, Ro+Rs+
; iscreen, RoPlus

# 1391
# 1392
# 1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413

*
*
*

-00065, 00874,
; iscreen-2, RoPl
-00065, 00774,
; iscreen-2, Ro+R
-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) ';_______________________________________________'
& // '______________________________'

PAGE 27
07-12-107
10:12:51
Line#
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

write (11,7001) '
write (11,7005) '
&

;define magnet area'
electrode(',iMags,
') {
;magnet faces '
fill { '

write (11,7001) '
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 '
*----write (11,7005) '
electrode(',0,
&
') {
;magnet faces 2'
write (11,7001) '
fill { '
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,') { '
*

1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470

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,
&

PAGE 28
07-12-107
10:12:51
Line#

#
#
#
#
#
#

#
#

1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

&

') {
;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 '
& // '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,
; -iscreen2, 0,
-00003, 00671,
; -iscreen2, Ri+
-00005, 00671,
; -iscreen2-2, R
-00005, 00000,
; -iscreen2-2, 0
-00003, 00000) }
; -iscreen2, 0)
within{ PolyLine ( -00580, 00000,
; -iscreen2, 0,
-00580, 00724,
; -iscreen2, Ri+R
-00582, 00724,
; -iscreen2-2, Ri
-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 '
write (10,7007) '
',-iscreen2-2,
& 0,'
; -iscreen2-2, 0'
write (10,7008) '
',-iscreen2,0,
& ') }
; -iscreen2, 0) }'
within{ PolyLine ( -00003, 00726,
-00003, 00836,

; -iscreen2, Ro
; -iscreen2, RoP

#
#
#
#
#
#
#
#

1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527

**
**
**
*
*
*
*
*

-00005, 00836,
; -iscreen2-2, R
-00005, 00726,
; -iscreen2-2, R
-00003, 00726) }
; -iscreen2, Ro+
within{ PolyLine ( -00580, 00774,
; -iscreen2, Ro+R
-00580, 00874,
; -iscreen2, RoPl
-00582, 00874,
; -iscreen2-2, Ro
-00582, 00774,
; -iscreen2-2, Ro
-00580, 00774) }
; -iscreen2, Ro+R
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'

PAGE 29
07-12-107
10:12:51
Line#

#
#
#
#
#
#

1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561

Source Line

*
*-----

Microsoft Fortran PowerStation Compiler. Version 4.0
;

if (magscr2) then

write (10,7001) ';_______________________________________________'
// '______________________________'
write (10,7001) '
;define magnet screen electrode, which'
& // ' 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,
; -ibscreen, 0,
-00003, 00671,
; -ibscreen, Ri+
-00005, 00671,
; -ibscreen-2, R
-00005, 00000,
; -ibscreen-2, 0
-00003, 00000) }
; -ibscreen, 0)
within{ PolyLine ( -00580, 00000,
; -ibscreen, 0,
-00580, 00724,
; -ibscreen, Ri+R
-00582, 00724,
; -ibscreen-2, Ri
-00582, 00000,
; -ibscreen-2, 0
-00580, 00000) }
; -ibscreen, 0) }
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 '

#
#
#
#
#
#
#
#
#
#

1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584

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

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

',-ibscreen-2,
',-ibscreen,0,

within{ PolyLine ( -00003, 00726,
; -ibscreen, Ro
-00003, 00836,
; -ibscreen, RoP
-00005, 00836,
; -ibscreen-2, R
-00005, 00726,
; -ibscreen-2, R
-00003, 00726) }
; -ibscreen, Ro+
within{ PolyLine ( -00580, 00774,
; -ibscreen, Ro+R
-00580, 00874,
; -ibscreen, RoPl
-00582, 00874,
; -ibscreen-2, Ro
-00582, 00774,
; -ibscreen-2, Ro
-00580, 00774) }
; -ibscreen, Ro+R
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,'

PAGE 30
07-12-107
10:12:51
Line#
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
# 1612
1613
1614
1615
1616
1617
1618

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

write (10,7008) '
imRoRs,') }
; -ibscreen, mRo+Rs) }'

&

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

*-----

}

',-ibscreen,

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

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 comm
* repeat or exit
*----* Presently UNimplemented -- just close test file and stop
close (unit=10,status='keep',err=9901)
9901 continue
if (useb) then

1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641

close (unit=11,status='keep',err=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)
9902

PAGE 31
07-12-107
10:12:51
Line#
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
MAIN
Name

Source Line

7010
7014
7017
7018
7023
7024
7025
7027
7028
7029

format
format
format
format
format
format
format
format
format
format
end

Microsoft Fortran PowerStation Compiler. Version 4.0

(e13.0)
(a,i6.5,a,i6.5,a,i6.5,a)
(a,i6.5,',',i6.5,',',i6.5)
(a,i6.5,',',i6.5,',',i6.5,a)
(a,g13.4)
(a,g13.4,a,g13.4,a)
(a,g13.4,a)
(a,g13.4,',',g13.4,',',a)
(a,g13.4,',',g13.4,a)
(a,g13.4,',',g13.4,',',g13.4,',',g13.4,a)

Local symbols

ATEMP . . . .
BANNER. . . .
BEXTRA. . . .
BIGGER. . . .
BSCREENSPACE.
BTHICKNESS. .
CHAR1 . . . .
DEGREES . . .
DELTA . . . .
DGAMMA. . . .
DGAMMAL . . .
DGAMMAU . . .
DRIVE . . . .
DTHETA. . . .
DTHETAI . . .
DTHETAO . . .
ELECTRONS . .
EXT . . . . .

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

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

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

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

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

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

Class

Type

local
local
WORKING(300)
local
WORKING(312)
WORKING(316)
local
local
WORKING(0)
DEFAULTS(16)
DEFAULTS(56)
DEFAULTS(52)
local
DEFAULTS(12)
DEFAULTS(60)
DEFAULTS(64)
local
local

MULTI*20
MULTI*1
REAL*4
INTEGER*4
REAL*4
REAL*4
MULTI*1
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
MULTI*1
REAL*4
REAL*4
REAL*4
INTEGER*4
MULTI*3

Size
20
330
4
4
4
4
1
4
4
4
4
4
1
4
4
4
4
3

EXTRA . .
FILE. . .
FNAME . .
FNAME2. .
GAMMA . .
GAMMAL. .
GAMMAU. .
H . . . .
HATRAD. .
HBLEND. .
HBLEND1D.
HI. . . .
HI1D. . .
HI2D. . .
HI2DU . .
HI3D. . .
HI3DU . .
HI5D. . .
HIDSEP. .
HISEP . .
HISEPD. .
HISEPDU .
HISEPU. .

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

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

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

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

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

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

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

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

WORKING(168)
local
local
local
WORKING(252)
WORKING(276)
WORKING(272)
WORKING(4)
WORKING(260)
WORKING(36)
WORKING(88)
WORKING(4)
WORKING(44)
WORKING(8)
WORKING(120)
WORKING(80)
WORKING(124)
WORKING(84)
WORKING(156)
WORKING(140)
WORKING(152)
WORKING(148)
WORKING(144)

REAL*4
MULTI*8
MULTI*127
MULTI*127
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4

4
8
127
127
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4

PAGE 32
07-12-107
10:12:51
Line#

MAIN
Name

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

Local symbols

HO. . . . . .
HO1D. . . . .
HOTAN . . . .
HOTAND. . . .
HPLUS . . . .
I . . . . . .
IATEMP. . . .
IBEXTRA . . .
IBRIRS. . . .
IBROPLRS. . .
IBRORS. . . .
IBSCREEN. . .
IBSCREENSPACE
IBSPACE . . .
IBTHICKNESS .
IBVOLTAGE . .
IDEGREES. . .
IDELTA. . . .
IEXTRA. . . .
IGAMMA. . . .
IGAMMAL . . .
IGAMMAU . . .
IH. . . . . .
IHATRAD . . .
IHATRADS. . .
IHBLEND . . .
IHBLEND1D . .
IHI . . . . .

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

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

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

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

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

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

Class

Type

WORKING(20)
WORKING(76)
WORKING(112)
WORKING(116)
WORKING(8)
local
local
IWORKING(160)
IWORKING(180)
IWORKING(188)
IWORKING(184)
IWORKING(176)
IWORKING(156)
IWORKING(168)
IWORKING(164)
IWORKING(172)
local
IWORKING(0)
IWORKING(152)
WORKING(192)
WORKING(212)
WORKING(208)
IWORKING(4)
WORKING(200)
IWORKING(108)
IWORKING(36)
IWORKING(60)
IWORKING(4)

REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*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

IHI1D . .
IHI2D . .
IHI2DU. .
IHI3D . .
IHI3DU. .
IHI5D . .
IHIDSEP .
IHISEP. .
IHISEPD .
IHISEPDU.
IHISEPU .
IHO . . .
IHO1D . .
IHOTAN. .
IHOTAND .
IHPLUS. .
IMAGRI. .
IMAGRO. .
IMAGS . .
IMAGSTART
IMAGSTOP.
IMRIRS. .
IMROPLRS.
IMRORS. .

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

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

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

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

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

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

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

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

IWORKING(64)
IWORKING(8)
IWORKING(100)
IWORKING(56)
IWORKING(104)
IWORKING(88)
IWORKING(136)
IWORKING(120)
IWORKING(132)
IWORKING(128)
IWORKING(124)
IWORKING(20)
IWORKING(52)
IWORKING(92)
IWORKING(96)
IWORKING(8)
IWORKING(204)
IWORKING(208)
IWORKING(200)
IWORKING(192)
IWORKING(196)
IWORKING(216)
IWORKING(224)
IWORKING(220)

INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*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

PAGE 33
07-12-107
10:12:51
Line#
MAIN
Name

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

Local symbols

INUMPNTS. . .
INUMPNTSX . .
INUMPNTSY . .
IOUTER. . . .
IRI . . . . .
IRIPLUS . . .
IRIRS . . . .
IRO . . . . .
IRO1D . . . .
IROPLRS . . .
IROPLUS . . .
IRORS . . . .
IRS . . . . .
ISCREEN . . .
ISCREEN2. . .
ITEMP . . . .
ITHETA. . . .
IVOLTAGE. . .
IWBLEND . . .
IWI . . . . .
IWO . . . . .
IWO2DCOT. . .
IWO2DCOTCLIP.
IWSI. . . . .
IWSO. . . . .
IWSOBLEND . .
IZI . . . . .
IZO . . . . .
MAGRI . . . .

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

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

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

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

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

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

Class

Type

WORKING(204)
IWORKING(76)
IWORKING(80)
WORKING(200)
WORKING(180)
IWORKING(44)
IWORKING(140)
WORKING(184)
IWORKING(84)
IWORKING(148)
IWORKING(32)
IWORKING(144)
WORKING(176)
IWORKING(116)
IWORKING(212)
local
WORKING(188)
IWORKING(48)
IWORKING(40)
IWORKING(12)
IWORKING(16)
IWORKING(68)
IWORKING(72)
IWORKING(24)
IWORKING(28)
IWORKING(112)
local
local
WORKING(348)

INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*4
INTEGER*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

MAGRO . . .
MAGSCR2 . .
MAGSTART. .
MAGSTOP . .
NUMPNTS . .
NUMPNTSX. .
NUMPNTSY. .
OFFSET. . .
OLDBIG. . .
OUTER . . .
PATH. . . .
PI. . . . .
RI. . . . .
RIPLUS. . .
RO. . . . .
ROPLUS. . .
RS. . . . .
SCALE . . .
SCALING . .
SCREEN. . .
SEPARATION.
TEMP. . . .
THETA . . .

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

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

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

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

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

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

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

WORKING(352)
local
WORKING(336)
WORKING(340)
WORKING(264)
WORKING(100)
WORKING(104)
WORKING(256)
local
WORKING(260)
local
WORKING(228)
WORKING(240)
WORKING(72)
WORKING(244)
WORKING(32)
WORKING(236)
WORKING(160)
DEFAULTS(44)
WORKING(172)
DEFAULTS(48)
local
WORKING(248)

REAL*4
INTEGER*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
INTEGER*4
REAL*4
MULTI*64
REAL*8
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4
REAL*8
REAL*4
REAL*4
REAL*4
REAL*4
REAL*4

4
4
4
4
4
4
4
4
4
4
64
8
4
4
4
4
4
8
4
4
4
4
4

PAGE 34
07-12-107
10:12:51
Line#
MAIN
Name

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

Local symbols

THETAI. . .
THETAO. . .
USEB. . . .
USEH. . . .
USEM. . . .
USET. . . .
VOLTAGE . .
WBLEND. . .
WI. . . . .
WO. . . . .
WO2DCOT . .
WO2DCOTCLIP
WSI . . . .
WSO . . . .
ZI. . . . .
ZO. . . . .

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

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

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

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

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

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

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

Global Symbols
Name
BT_DEFAULTS@0 .
BUMPFILENAME@16
CHFREE. . . . .
CWRKING@4 . . .
DEFAULTS. . . .
DWRKING@0 . . .

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

Class

Type

WORKING(280)
WORKING(284)
local
local
local
local
WORKING(268)
WORKING(40)
WORKING(12)
WORKING(16)
WORKING(92)
WORKING(96)
WORKING(24)
WORKING(28)
local
local

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

Class

Type

extern
extern
extern
extern
common
extern

***
CHAR*(*)
***
***
***
***

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

Size
***
***
***
***
108
***

F90_CLOSE . . .
F90_ENDIREAD. .
F90_ENDREAD . .
F90_ENDWRITE. .
F90_INQUIRE_U .
F90_IREADS. . .
F90_OPEN. . . .
F90_READ. . . .
F90_WRITE . . .
FNJOIN@40 . . .
FNSEP@40. . . .
HEB_DEFAULTS@0.
HE_DEFAULTS@0 .
HH_DEFAULTS@0 .
HM_DEFAULTS@0 .
HOWTO@0 . . . .
HT_DEFAULTS@0 .
IWORKING. . . .
IWRKING@0 . . .
LWRITE_CH . . .
LWRITE_I. . . .
LWRITE_L. . . .
LWRITE_R. . . .

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

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

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

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

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

extern
extern
extern
extern
extern
extern
extern
extern
extern
extern
extern
extern
extern
extern
extern
extern
extern
common
extern
extern
extern
extern
extern

INTEGER*0
INTEGER*0
INTEGER*0
INTEGER*0
INTEGER*0
INTEGER*0
INTEGER*0
INTEGER*0
INTEGER*0
***
***
***
***
***
***
***
***
***
***
INTEGER*0
INTEGER*0
INTEGER*0
INTEGER*0

***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
228
***
***
***
***
***

PAGE 35
07-12-107
10:12:51
Line#

Source Line

Microsoft Fortran PowerStation Compiler. Version 4.0

Global Symbols
Name
MAIN. . . . . . . .
OLD_HEB_DEFAULTS@0.
OLD_HT_DEFAULTS@0 .
READ_CH . . . . . .
READ_R. . . . . . .
WORKING . . . . . .
WRITE_CH. . . . . .
WRITE_D . . . . . .
WRITE_I . . . . . .
WRITE_R . . . . . .
No errors detected

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

Class

Type

FUNCT
extern
extern
extern
extern
common
extern
extern
extern
extern

***
***
***
INTEGER*0
INTEGER*0
***
INTEGER*0
INTEGER*0
INTEGER*0
INTEGER*0

Size
***
***
***
***
***
372
***
***
***
***