Screamer Project  V3.3.1
Screamer Structure
 All Files Functions Variables
rdscrelem.f
Go to the documentation of this file.
1 c-----------------------------------------------------------------------
2 c rdscrelem.f version 1.0 created 06/15/2005 by Mathias Bavay
3 c-----------------------------------------------------------------------
4 c-----------------------------------------------------------------------
5 c
6 c This subroutine reads the electrical elements called in the input
7 c deck. It defines the number of branches in the input deck and defines
8 c the number of blocks in each branch. This number of blocks will
9 c define the number of nodes in the problem.
10 c
11 c Modifications:
12 c 2008-07-16 RBS: itabnum does not seem to be initialized
13 c it is only called in this routine
14 c 2008-12-08 RBS: Many formats from zdemfmt.h included herein
15 c 2012-04-03 RBS: Added a new variable element, R2Wall
16 c 2014-03-11 RBS: Added L2 as an allowed variable element in RLS
17 c 2014-03-11 RBS: Fixed error in block print nublk changed to nublks in
18 c several locations in variable resistors
19 c 2014-03-11 RBS: Change the log output to show inductance as well as
20 c resistance in the variable resistor/ind table model
21 c-----------------------------------------------------------------------
22 c readscreamerelements calls the following subroutines:
23 c
24 c print_bad_line
25 c text_to_real
26 c strip
27 c nshellparm
28 c sphfoilparm
29 c gaspuffparm
30 c get_next_line
31 c show_end_of_file
32 c read_lsf_parms
33 c read_pwl_parms
34 c readctab
35 c readtablem
36 c abdiodeparm
37 c magparm
38 c
39 c-----------------------------------------------------------------------
40 
41  subroutine readscreamerelements(status)
42 
43 c
44 c Include the common blocks which are to be filled by the
45 c this subroutine.
46 c
47  include 'zdemmax.h'
48  include 'zdemcomm.h'
49  include 'zdemout.h'
50 c
51 c Include the files with the keywords and the integer flags as parameters.
52 c
53  include 'zdemparm.h'
54  include 'zdempprm.h'
55  include 'zdemenv.h'
56  include 'zdemfmt.h'
57  include 'rdscrdat.h'
58 c
59 c Define passed variables
60 c
61  integer status
62 c
63  status = 0
64 c write(*,*) 'rdscrelem: keyword = ', keyword
65  if (keyword .eq. k_branch) then
66 c
67 c Fill block counter array (NBK) for last branch. Then reset block counter and
68 c increment branch counter.
69 c
70  status = k_found
71 c If a new branch is seen then the number of blocks in the prior branch
72 c is stored in nbk(nbrns). The branch counter is incremented.
73  nbk(nbrns) = nblks
74  nblks = 0
75  nublks = 0
76  nbrns = nbrns + 1
77  lcirblk = 999
78  lastblk = 999
79 c call print_title
80  write(9,'(A/A,i2,A)')
81  & ' ','************ Branch ',nbrns,' ************'
82 c
83 c-----------------------------------------------------------------------
84 c Transmission line with linearly or exponentially varying impedance.
85 c Two, three, or four parameters may be entered
86 c ( Tau, Zin, Zout, Tres or Tau, Zin, Zout or Tau, Zin).
87 c If Zout is not entered, it is assumed equal to Zin and the impedance is
88 c constant over the line. If Zout is entered, the impedance is assumed
89 c to vary over the line. If Tres is not entered, the default resolution
90 c time is used.
91 c
92  else if (keyword .eq. k_transline) then
93  status = k_found
94  nblks = nblks + 1
95  nublks = nublks + 1
96  lcirblk = transline
97  lastblk = transline
98  ntransline = ntransline + 1
99  iin(1,nblks,nbrns) = transline
100 c
101 c Get the keyword for linear or exponential
102 c
103  keyword = field(2)(1:keyword_len)
104  if (keyword .eq. k_linearz) then
105  itrl_type(ntransline) = linearz
106  trllabel = 'linearly '
107  else if (keyword .eq. k_exponentialz) then
108  itrl_type(ntransline) = exponentialz
109  trllabel = 'exponentially'
110  else
111  call print_bad_line(currline, nlines, numerr)
112  status=305
113  return
114  end if
115 c
116 c Get the parameters
117 c
118  call text_to_real(field(3), tau, flag)
119  call text_to_real(field(4), zin, flag2)
120  call strip(field(6), istart6, iend6)
121  if (istart6 .ne. notext) then
122  call text_to_real(field(6), tresline, flag4)
123  else
124  tresline = res_time
125  flag4 = noerr
126  end if
127  call strip(field(5), istart5, iend5)
128  if (istart5 .ne. notext) then
129  call text_to_real(field(5), zout, flag3)
130  else
131  zout = zin
132  flag3 = noerr
133  end if
134  if ((flag+flag2+flag3+flag4) .eq. noerr) then
135  pin(1,nblks,nbrns) = tau
136  pin(2,nblks,nbrns) = zin
137  pin(3,nblks,nbrns) = zout
138  pin(4,nblks,nbrns) = tresline
139  write
140  & (9,'(A,i3,A,a13/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
141  & ' Block ',nublks,
142  & ' : Transmission line with impedance varying ',
143  & trllabel,' Tau=',tau,' Zin=',zin,
144  & ' Zout=',zout,' Tres=',tresline
145  else
146  call print_bad_line(currline, nlines, numerr)
147  end if
148 c
149 c-----------------------------------------------------------------------
150 c MITL with constant impedance.
151 c 4,5, or 6 parameters may be entered
152 c If Tres is not entered, it is set to the default.
153 c
154  else if (keyword .eq. k_mitline) then
155  status = k_found
156  nblks = nblks + 1
157  nublks = nublks + 1
158  lcirblk = mitline
159  lastblk = mitline
160  nmitline = nmitline + 1
161  iin(1,nblks,nbrns) = mitline
162 c
163 c Get the parameters
164 c
165  call text_to_real(field(2), cir, flag)
166  call text_to_real(field(3), gap, flag2)
167  call text_to_real(field(4), tau, flag3)
168  call text_to_real(field(5), z, flag4)
169  call strip(field(6), istart6, iend6)
170  if (istart6 .ne. notext) then
171  call text_to_real(field(6), tresline, flag5)
172  call strip(field(7), istart7, iend7)
173  if (istart7 .ne. notext) then
174  call text_to_real(field(7), eturnon, flag6)
175  else
176  eturnon = 2.0e7
177  flag6 = noerr
178  endif
179  else
180  tresline = res_time
181  eturnon = 2.0e7
182  flag5 = noerr
183  flag6 = noerr
184  end if
185  if ((flag+flag2+flag3+flag4+flag5+flag6) .eq. noerr) then
186  pin(1,nblks,nbrns) = cir
187  pin(2,nblks,nbrns) = gap
188  pin(3,nblks,nbrns) = tau
189  pin(4,nblks,nbrns) = z
190  pin(5,nblks,nbrns) = tresline
191  pin(6,nblks,nbrns) = 1.0 / (cir * cir)
192  pin(7,nblks,nbrns) = 1.0 / gap
193  pin(8,nblks,nbrns) = 1.0 / (gap * gap)
194  pin(9,nblks,nbrns) = eturnon
195  write(9,
196  & '(A,i3,A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3,
197  & A,1pe10.3,A,1pe10.3)')
198  & ' Block ',nublks, ' : MITL (geometric setup)',
199  & ' Circumference=',cir,' Gap=',gap,
200  & ' Tau=',tau,' Z=',z,
201  & ' Tres=',tresline,' Eturnon=',eturnon
202  else
203  call print_bad_line(currline, nlines, numerr)
204  end if
205 c
206 c-----------------------------------------------------------------------
207 c MITL with perveance.
208 c 4 parameters entered ( Perv, Tau, Zline, tres-optional)
209 c
210  else if (keyword .eq. k_pmitline) then
211  status = k_found
212  nblks = nblks + 1
213  nublks = nublks + 1
214  lcirblk = pmitline
215  lastblk = pmitline
216  nmitline = nmitline + 1
217  iin(1,nblks,nbrns) = pmitline
218 c
219 c Get the parameters
220 c
221  call text_to_real(field(2), perv, flag)
222  call text_to_real(field(3), tau, flag2)
223  call text_to_real(field(4), zline, flag3)
224  call strip(field(5), istart5, iend5)
225  if (istart5 .ne. notext) then
226  call text_to_real(field(5), tresline, flag4)
227  else
228  tresline = res_time
229  flag4 = noerr
230  end if
231  if ((flag+flag2+flag3+flag4) .eq. noerr) then
232  pin(1,nblks,nbrns) = perv
233  pin(2,nblks,nbrns) = tau
234  pin(3,nblks,nbrns) = zline
235  pin(4,nblks,nbrns) = tresline
236  write(9,'(A,i3,A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
237  & ' Block ',nublks,' : MITL (perveance setup)',
238  & ' Perveance=',perv,' Tau=',tau,
239  & ' Z=',zline,' Tres=',tresline
240  else
241  call print_bad_line(currline, nlines, numerr)
242  end if
243 c
244 c-----------------------------------------------------------------------
245 c Resistor and capacitor to ground.
246 c If no value for the capacitance is entered, it is set to zero.
247 c
248  else if (keyword .eq. k_rcground) then
249  status = k_found
250  nblks = nblks + 1
251  nublks = nublks + 1
252  lcirblk = rcground
253  lastblk = rcground
254  iin(1,nblks,nbrns) = rcground
255  call text_to_real(field(2), r1, flag)
256 c write(6,*)'field(2) = ',field(2)
257 c write(6,*)'r1 = ',r1
258 c write(6,*)'flag = ',flag
259  call strip(field(3), istart3, iend3)
260  if (istart3 .ne. notext) then
261  call text_to_real(field(3), c1, flag2)
262 c write(6,*)'field(3) = ',field(3)
263 c write(6,*)'c1 = ',c1
264 c write(6,*)'flag2 = ',flag2
265 c write(6,*)
266 c write(6,*)
267  else
268  c1 = 0.0
269  flag2 = noerr
270  end if
271  if ((flag+flag2) .eq. noerr) then
272  pin(1,nblks,nbrns) = r1
273  pin(2,nblks,nbrns) = c1
274  write(9,'(A,i3,A/A,1pe10.3,A,1pe10.3)')
275  & ' Block ',nublks,' : resistor and capacitor to ground.',
276  & ' R1=',r1,' C1=',c1
277  else
278  call print_bad_line(currline, nlines, numerr)
279  end if
280 c
281 c-----------------------------------------------------------------------
282 c Resistor and inductor in series.
283 c If no value for the inductance is entered, it is set to zero.
284 c
285  else if (keyword .eq. k_rlseries) then
286  status = k_found
287  nblks = nblks + 1
288  nublks = nublks + 1
289  lcirblk = rlseries
290  lastblk = rlseries
291  iin(1,nblks,nbrns) = rlseries
292  call text_to_real(field(2), r2, flag)
293 c write(6,*)'field(2) = ',field(2)
294 c write(6,*)'r2 = ',r2
295 c write(6,*)'flag = ',flag
296  call strip(field(3), istart3, iend3)
297  if (istart3 .ne. notext) then
298  call text_to_real(field(3), l2, flag2)
299 c write(6,*)'field(3) = ',field(3)
300 c write(6,*)'l2 = ',l2
301 c write(6,*)'flag2 = ',flag2
302 c write(6,*)
303 c write(6,*)
304  else
305  l2 = 0.0
306  flag2 = noerr
307  end if
308  if ((flag+flag2) .eq. noerr) then
309  pin(1,nblks,nbrns) = r2
310  pin(2,nblks,nbrns) = l2
311  write(9,'(A,i3,A/A,1pe10.3,A,1pe10.3)')
312  & ' Block ',nublks,' : resistor and inductor in series.',
313  & ' R2=',r2,' L2=',l2
314  else
315  call print_bad_line(currline, nlines, numerr)
316  end if
317 c
318 c-----------------------------------------------------------------------
319 c Pi section.
320 c
321  else if (keyword .eq. k_pisection) then
322  status = k_found
323  nblks = nblks + 1
324  nublks = nublks + 1
325  lcirblk = pisection
326  lastblk = pisection
327  iin(1,nblks,nbrns) = pisection
328  call text_to_real(field(2), r1, flag)
329  call text_to_real(field(3), c1, flag2)
330  call text_to_real(field(4), r2, flag3)
331  call text_to_real(field(5), l2, flag4)
332  call text_to_real(field(6), r3, flag5)
333  call text_to_real(field(7), c3, flag6)
334  if ((flag+flag2+flag3+flag4+flag5+flag6) .eq. noerr) then
335  pin(1,nblks,nbrns) = r1
336  pin(2,nblks,nbrns) = c1
337  pin(3,nblks,nbrns) = r2
338  pin(4,nblks,nbrns) = l2
339  pin(5,nblks,nbrns) = r3
340  pin(6,nblks,nbrns) = c3
341  write(9,
342  & '(A,i3,A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3,
343  & A,1pe10.3,A,1pe10.3)')
344  & ' Block ',nublks,' : pi section. ',
345  & ' R1=',r1,' C1=',c1,
346  & ' R2=',r2,' L2=',l2,
347  & ' R3=',r3,' C3=',c3
348  else
349  call print_bad_line(currline, nlines, numerr)
350  end if
351 c
352 c-----------------------------------------------------------------------
353 c Adder block.
354 c
355  else if (keyword .eq. k_adder) then
356  status = k_found
357  nblks = nblks + 1
358  nublks = nublks + 1
359  lcirblk = adder
360  lastblk = adder
361  iin(1,nblks,nbrns) = adder
362  write(9,'(A,i3,A)')
363  & ' Block ',nublks,' : adder block.'
364 c
365 c-----------------------------------------------------------------------
366 c Transformer.
367 c
368  else if (keyword .eq. k_transformer) then
369  status = k_found
370  nblks = nblks + 1
371  nublks = nublks + 1
372  lcirblk = transformer
373  lastblk = transformer
374  iin(1,nblks,nbrns) = transformer
375  call text_to_real(field(2), zlp, flag)
376  call text_to_real(field(3), zls, flag2)
377  call text_to_real(field(4), zm, flag3)
378  if (flag+flag2+flag3 .eq. noerr) then
379  pin(1,nblks,nbrns) = zlp
380  pin(2,nblks,nbrns) = zls
381  pin(3,nblks,nbrns) = zm
382  write(9,'(A,i3,A/A,1pe10.3,A,1pe10.3,A,1pe10.3)')
383  & ' Block ',nublks,' : transformer block.',
384  & ' Lp=',zlp,' Ls=',zls,
385  & ' M=',zm
386  else
387  call print_bad_line(currline, nlines, numerr)
388  end if
389 c
390 c-----------------------------------------------------------------------
391 c Measure Zflow and Cathode current at a null element
392 c
393  else if (keyword .eq. k_measurezflow) then
394  status = k_found
395  nblks = nblks + 1
396  nublks = nublks + 1
397  lcirblk = measurezflow
398  lastblk = measurezflow
399  iin(1,nblks,nbrns) = measurezflow
400  nvarl = nvarl + 1
401  iin(2,nblks,nbrns) = measurezflow
402  ivar_block(nvarl) = measurezflow
403  ivar_block_num(nvarl) = nublks
404  ivar_type(nvarl) = measurezflow
405  mzflowblock = mzflowblock + 1
406  call text_to_real(field(2), zimpedance, flag)
407  if (flag .eq. noerr) then
408  zofmzflow(mzflowblock) = zimpedance
409  write(9,'(A,i3,A/A,1pe10.3,A,i2)')
410  & ' Block ',nublks, ' : Measure Zflow Block',
411  & ' Line Impedance = ',zimpedance,
412  & ' Measure Zflow Block Number = ',mzflowblock
413  else
414  call print_bad_line(currline, nlines, numerr)
415  end if
416 c
417 c
418 c-----------------------------------------------------------------------
419 c CYLINDICAL Foil implosion model using resistor and inductor in series (both variable).
420 c Parameters are: initial-radius, length, mass, minimum-radius
421 c
422  else if (keyword .eq. k_cylfoilblock) then
423  status = k_found
424  nblks = nblks + 1
425  nublks = nublks + 1
426  lcirblk = cylfoilblock
427  lastblk = cylfoilblock
428  iin(1,nblks,nbrns) = cylfoilblock
429  nvarl = nvarl + 1
430  ivar_block(nvarl) = cylfoilblock
431  ivar_block_num(nvarl) = nublks
432  ivar_type(nvarl) = cylfoilblock
433  iin(2,nblks,nbrns) = l2_var
434  pin(1,nblks,nbrns) = 0.0
435  pin(2,nblks,nbrns) = 0.0
436  call text_to_real(field(2), rinit, flag)
437  call text_to_real(field(3), xlen, flag2)
438  call text_to_real(field(4), xmass, flag3)
439  call text_to_real(field(5), rmin, flag4)
440  if ((flag+flag2+flag3+flag4) .eq. noerr) then
441  write(9,'(A,i3,A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
442  & ' Block ',nublks,' : imploding CYLfoil model.',
443  & ' Initrad=',rinit,' Length=',xlen,
444  & ' Mass=',xmass,' Minrad=',rmin
445  num_var_parms(nvarl) = 4
446  var_model(1,nvarl) = rinit
447  var_model(2,nvarl) = xlen
448  var_model(3,nvarl) = xmass
449  var_model(4,nvarl) = rmin
450  radyields=.false.
451 c
452 c Now call a subroutine which will set the many parameters needed to
453 c do this foil model.
454 c
455  call cylfoilparm(var_model(1,nvarl), num_var_parms(nvarl))
456  else
457  call print_bad_line(currline, nlines, numerr)
458  end if
459 c
460 c-----------------------------------------------------------------------
461 c N SHELL implosion model using resistor and inductor in series (both variable).
462 c Parameters are: radius1, radius2, mass1, mass2, length, and final radius
463 c
464  else if (keyword .eq. k_nshellblock) then
465  status = k_found
466  nblks = nblks + 1
467  nublks = nublks + 1
468  lcirblk = nshellblock
469  lastblk = nshellblock
470  iin(1,nblks,nbrns) = nshellblock
471  nvarl = nvarl + 1
472  ivar_block(nvarl) = nshellblock
473  ivar_block_num(nvarl) = nublks
474  ivar_type(nvarl) = nshellblock
475  iin(2,nblks,nbrns) = l2_var
476  pin(1,nblks,nbrns) = 0.0
477  pin(2,nblks,nbrns) = 0.0
478  call text_to_real(field(2), xlength, flag)
479  call text_to_real(field(3), rmin, flag2)
480  call text_to_real(field(4), akgap, flag3)
481  call strip(field(5), istart5, iend5)
482  if (istart5 .ne. notext) then
483  call text_to_real(field(5), ttrap, flag4)
484  else
485  ttrap = 0.0
486  flag4 = noerr
487  end if
488  if ((flag+flag2+flag3+flag4) .eq. noerr) then
489  write(9,'(A,i3,A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
490  & ' Block ',nublks,' : imploding NShell model.',
491  & ' Shell length =',xlength,' min radius =',rmin,
492  & ' A-K gap = ',akgap,' trapped field time = ',ttrap
493  num_var_parms(nvarl) = 4
494  var_model(1,nvarl) = xlength
495  var_model(2,nvarl) = rmin
496  var_model(3,nvarl) = akgap
497  var_model(4,nvarl) = ttrap
498  nsaverr = numerr
499 c
500 c Now read the table of shell radii and masses
501 c
502  call read_pwl_parms(shellparms,nparams, eofflg,
503  & nlines, numerr)
504  if (eofflg .eq. noerr) then
505  if (nparams/2 .gt. max_shells) then
506  write(9,'(A,i2,A,i2)')
507  & 'Too many shells. Number of shells is ',
508  & nparams/2,' Max allowed is ',max_shells
509  status=1000
510  return
511  endif
512  if (numerr .eq. nsaverr) then
513  write(9,48) 'Radius ', 'Mass ',
514  & ((j+1)/2, shellparms(j),
515  & shellparms(j+1),
516  & j=1,nparams-1,2)
517  end if
518  else
519  call show_end_of_file(nlines, numerr)
520  status=1000
521  return
522  end if
523  numshells = nparams/2
524  do nx=1,nparams-1,2
525  shellradius((nx+1)/2)=shellparms(nx)
526  shellmass((nx+1)/2)=shellparms(nx+1)
527  end do
528  do nx=1,numshells-1
529  if (shellradius(nx).lt.shellradius(nx+1)) then
530  write(9,'(A)') 'Shell radii not in correct sequence'
531  status=1000
532  return
533  endif
534  end do
535 c
536 c
537 c Now call a subroutine which will set the parameters needed to
538 c do this shell model.
539 c
540  call nshellparm(var_model(1,nvarl), num_var_parms(nvarl))
541  else
542  call print_bad_line(currline, nlines, numerr)
543  end if
544 c
545 c-----------------------------------------------------------------------
546 c SPHERICAL Foil implosion model using resistor and inductor in series
547 c (both variable).
548 c Parameters are: initial-radius, angle, mass, min-radius
549 c
550  else if (keyword .eq. k_sphfoilblock) then
551  status = k_found
552  nblks = nblks + 1
553  nublks = nublks + 1
554  lcirblk = sphfoilblock
555  lastblk = sphfoilblock
556  iin(1,nblks,nbrns) = sphfoilblock
557  nvarl = nvarl + 1
558  ivar_block(nvarl) = sphfoilblock
559  ivar_block_num(nvarl) = nublks
560  ivar_type(nvarl) = sphfoilblock
561  iin(2,nblks,nbrns) = l2_var
562  pin(1,nblks,nbrns) = 0.0
563  pin(2,nblks,nbrns) = 0.0
564  call text_to_real(field(2), rinit, flag)
565  call text_to_real(field(3), xangl, flag2)
566  call text_to_real(field(4), xmass, flag3)
567  call text_to_real(field(5), rmin, flag4)
568 C
569  if ((flag+flag2+flag3+flag4) .eq. noerr) then
570  write(9,'(A,i3,A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
571  & ' Block ',nublks,' : imploding SPHfoil model.',
572  & ' Initrad=',rinit,' ANGLE=',xangl,
573  & ' Mass=',xmass,' Minrad=',rmin
574  num_var_parms(nvarl) = 4
575  var_model(1,nvarl) = rinit
576  var_model(2,nvarl) = xangl
577  var_model(3,nvarl) = xmass
578  var_model(4,nvarl) = rmin
579 c
580 c Now call a subroutine which will set the many parameters needed to
581 c do this foil model.
582 c
583  call sphfoilparm(var_model(1,nvarl), num_var_parms(nvarl))
584  else
585  call print_bad_line(currline, nlines, numerr)
586  end if
587 c
588 c-----------------------------------------------------------------------
589 c GAS PUFF implosion model using resistor and inductor in series
590 c (both variable).
591 c Parameters are: initial-radius, length, density, minimum-radius,
592 c inner-radius, initial-mass
593 c
594  else if (keyword .eq. k_gaspuffblock) then
595  status = k_found
596  nblks = nblks + 1
597  nublks = nublks + 1
598  lcirblk = gaspuffblock
599  lastblk = gaspuffblock
600  iin(1,nblks,nbrns) = gaspuffblock
601  nvarl = nvarl + 1
602  ivar_block(nvarl) = gaspuffblock
603  ivar_block_num(nvarl) = nublks
604  ivar_type(nvarl) = gaspuffblock
605  iin(2,nblks,nbrns) = l2_var
606  pin(1,nblks,nbrns) = 0.0
607  pin(2,nblks,nbrns) = 0.0
608  call text_to_real(field(2), rinit, flag)
609  call text_to_real(field(3), xlen, flag2)
610  call text_to_real(field(4), density, flag3)
611  call text_to_real(field(5), rmin, flag4)
612  call text_to_real(field(6), rinner, flag5)
613  call text_to_real(field(7), ximass, flag6)
614  if ((flag+flag2+flag3+flag4+flag5+flag6) .eq. noerr) then
615  write(9,'(A,i3,A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,
616  & 1pe10.3,A,1pe10.3,A,1pe10.3)')
617  & ' Block ',nublks,' : imploding gas puff model.',
618  & ' Initrad=',rinit,' Length=',xlen,
619  & ' Density=',density,' Minrad=',rmin,
620  & ' Innerrad=',rinner,' InitMass=',ximass
621  num_var_parms(nvarl) = 6
622  if (ximass .le. 0.0) ximass = 1.0e-12
623  var_model(1,nvarl) = rinit
624  var_model(2,nvarl) = xlen
625  var_model(3,nvarl) = density
626  var_model(4,nvarl) = rmin
627  var_model(5,nvarl) = rinner
628  var_model(6,nvarl) = ximass
629 c
630 c Now call a subroutine which will set the many parameters needed to
631 c do this gaspuff model.
632 c
633  call gaspuffparm(var_model(1,nvarl), num_var_parms(nvarl))
634  else
635  call print_bad_line(currline, nlines, numerr)
636  end if
637 c
638 c-----------------------------------------------------------------------
639 c Voltage source described by a function in time.
640 c A voltsource occurs at the beginning of the main branch,
641 c a vendsource occurs at the end of a secondary branch.
642 c
643  else if ((keyword .eq. k_voltsource) .or.
644  & (keyword .eq. k_vendsource)) then
645  status = k_found
646  nblks = nblks + 1
647  nublks = nublks + 1
648  nvoltsource = nvoltsource + 1
649  if (keyword .eq. k_vendsource) then
650  lcirblk = vendsource
651  lastblk = vendsource
652  iin(1,nblks,nbrns) = vendsource
653  ivbranch_end(nbrns) = nvoltsource
654  else
655  lcirblk = voltsource
656  lastblk = voltsource
657  iin(1,nblks,nbrns) = voltsource
658  end if
659 c
660 c Get R and L (3rd and 4th fields)
661 c
662  call text_to_real(field(3), r2, flag)
663  call text_to_real(field(4), l2, flag2)
664  if ((flag+flag2) .eq. noerr) then
665  pin(1,nblks,nbrns) = r2
666  pin(2,nblks,nbrns) = l2
667  if (lcirblk .eq. vendsource) then
668  write(9,'(A,i3,A,A/A,1pe10.3,A,1pe10.3)')
669  & ' Block ',nublks,' : end-of-branch voltage source ',
670  & 'described as a function of time.',
671  & ' R2=',r2,' L2=',l2
672  else
673  write(9,'(A,i3,A,A/A,1pe10.3,A,1pe10.3)')
674  & ' Block ',nublks,' : voltage source described as a ',
675  & 'function of time.',' R2=',r2,' L2=',l2
676  end if
677  else
678  call print_bad_line(currline, nlines, numerr)
679  status=305
680  return
681  end if
682 c
683 c Get the function type from the second keyword
684 c and read in the next line with the function parameters in it.
685 c
686  keyword = field(2)(1:keyword_len)
687 c
688  if (keyword .eq. k_sinsquared) then
689  status = k_found
690  ivoltf(nvoltsource) = sinsquared
691  call get_next_line(currline, field, nlines, eofflg,
692  & max_fields)
693  if (eofflg .eq. noerr) then
694  call text_to_real(field(1), vmax, flag)
695  call text_to_real(field(2), tp, flag2)
696  call strip(field(3), istart3, iend3)
697  if (istart3 .ne. notext) then
698  call text_to_real(field(3), delay, flag3)
699  else
700  delay = 0.0
701  flag3 = noerr
702  end if
703  if (flag+flag2+flag3 .eq. noerr) then
704  num_voltf_parms(nvoltsource) = 3
705  voltf_parms(1,nvoltsource) = vmax
706  voltf_parms(2,nvoltsource) = tp
707  voltf_parms(3,nvoltsource) = delay
708  write(9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3)')
709  & ' Sin-squared function:',
710  & ' Magnitude=',vmax,' Tpulse=',tp,
711  & ' Tdelay=',delay
712  else
713  call print_bad_line(currline, nlines, numerr)
714  end if
715  else
716  call show_end_of_file(nlines, numerr)
717  status=1000
718  return
719  end if
720 c
721  else if (keyword .eq. k_sinfun) then
722  status = k_found
723  ivoltf(nvoltsource) = sinfun
724  call get_next_line(currline, field, nlines, eofflg,
725  & max_fields)
726  if (eofflg .eq. noerr) then
727  call text_to_real(field(1), vmax, flag)
728  call text_to_real(field(2), tp, flag2)
729  call strip(field(3), istart3, iend3)
730  if (istart3 .ne. notext) then
731  call text_to_real(field(3), delay, flag3)
732  else
733  delay = 0.0
734  flag3 = noerr
735  end if
736  if (flag+flag2+flag3 .eq. noerr) then
737  num_voltf_parms(nvoltsource) = 3
738  voltf_parms(1,nvoltsource) = vmax
739  voltf_parms(2,nvoltsource) = tp
740  voltf_parms(3,nvoltsource) = delay
741  write(9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3)')
742  & ' Sin function:',
743  & ' Magnitude=',vmax,' Period=',tp,
744  & ' Tdelay=',delay
745  else
746  call print_bad_line(currline, nlines, numerr)
747  end if
748  else
749  call show_end_of_file(nlines, numerr)
750  status=1000
751  return
752  end if
753 c
754  else if (keyword .eq. k_leastsquares) then
755  status = k_found
756  ivoltf(nvoltsource) = leastsquares
757  nsaverr = numerr
758  call read_lsf_parms(voltf_parms(1,nvoltsource),
759  & num_voltf_parms(nvoltsource), eofflg,
760  & nlines, numerr)
761  if (eofflg .eq. noerr) then
762  if (numerr .eq. nsaverr) then
763  write(9,47) (j-1, voltf_parms(j,nvoltsource),
764  & j=1,num_voltf_parms(nvoltsource))
765  end if
766  else
767  call show_end_of_file(nlines, numerr)
768  status=1000
769  return
770  end if
771 c
772  else if (keyword .eq. k_piecewiselinear) then
773  status = k_found
774  ivoltf(nvoltsource) = piecewiselinear
775  nsaverr = numerr
776  call read_pwl_parms(voltf_parms(1,nvoltsource),
777  & num_voltf_parms(nvoltsource), eofflg,
778  & nlines, numerr)
779  if (eofflg .eq. noerr) then
780  if (numerr .eq. nsaverr) then
781  write(9,48) 'Time ', 'Voltage ',
782  & ((j+1)/2, voltf_parms(j,nvoltsource),
783  & voltf_parms(j+1,nvoltsource),
784  & j=1,num_voltf_parms(nvoltsource)-1,2)
785  end if
786  else
787  call show_end_of_file(nlines, numerr)
788  status=1000
789  return
790  end if
791 c
792  else if (keyword .eq. k_table) then
793  status = k_found
794  ivoltf(nvoltsource) = table
795  nsaverr = numerr
796  call read_pwl_parms(voltf_parms(1,nvoltsource),
797  & num_voltf_parms(nvoltsource), eofflg,
798  & nlines, numerr)
799 
800  if (eofflg .eq. noerr) then
801  if (numerr .eq. nsaverr) then
802  write(9,49) (voltf_parms(j,nvoltsource),j=1,2)
803  write(9,48) 'Time ', 'Voltage ',
804  & ((j-1)/2, voltf_parms(j,nvoltsource),
805  & voltf_parms(j+1,nvoltsource),
806  & j=3,num_voltf_parms(nvoltsource)-1,2)
807  end if
808  else
809  call show_end_of_file(nlines, numerr)
810  status=1000
811  return
812  end if
813 c
814  else
815  call print_bad_line(currline, nlines, numerr)
816  end if
817 
818 c
819 c-----------------------------------------------------------------------
820 c Current source described by a function in time.
821 c A currsource occurs at the beginning of the main branch,
822 c a cendsource occurs at the end of a secondary branch.
823 c
824  else if ((keyword .eq. k_currsource) .or.
825  & (keyword .eq. k_cendsource)) then
826  status = k_found
827  nblks = nblks + 1
828  nublks = nublks + 1
829  ncurrsource = ncurrsource + 1
830  if (keyword .eq. k_cendsource) then
831  itypcend(ncurrsource) = cendsource
832  lcirblk = cendsource
833  lastblk = cendsource
834  iin(1,nblks,nbrns) = cendsource
835  icbranch_end(nbrns) = ncurrsource
836  else if (keyword .eq. k_currsource) then
837  lcirblk = currsource
838  lastblk = currsource
839  iin(1,nblks,nbrns) = currsource
840  end if
841 c
842 c Get R and C (3rd and 4th fields)
843 c
844  call text_to_real(field(3), r, flag)
845  call text_to_real(field(4), c, flag2)
846  if ((flag+flag2) .eq. noerr) then
847  pin(1,nblks,nbrns) = r
848  pin(2,nblks,nbrns) = c
849  if (lcirblk .eq. currsource) then
850  write(9,'(A,i3,A,A/A,1pe10.3,A,1pe10.3)')
851  & ' Block ',nublks,' : current source described as a ',
852  & 'function of time.',
853  & ' R3=',r,' C3=',c
854  else if (lcirblk .eq. cendsource) then
855  write(9,'(A,i3,A,A/A,1pe10.3,A,1pe10.3)')
856  & ' Block ',nublks,' : end-of-branch current source ',
857  & 'described as a function of time.',
858  & ' R1=',r,' C1=',c
859  end if
860  else
861  call print_bad_line(currline, nlines, numerr)
862  status=305
863  return
864  end if
865 c
866 c Get the function type from the second keyword
867 c and read in the next line with the function parameters in it.
868 c
869  keyword = field(2)(1:keyword_len)
870 c
871  if (keyword .eq. k_sinsquared) then
872  status = k_found
873  icurrf(ncurrsource) = sinsquared
874  call get_next_line(currline, field, nlines, eofflg,
875  & max_fields)
876  if (eofflg .eq. noerr) then
877  call text_to_real(field(1), cmax, flag)
878  call text_to_real(field(2), tp, flag2)
879  call strip(field(3), istart3, iend3)
880  if (istart3 .ne. notext) then
881  call text_to_real(field(3), delay, flag3)
882  else
883  delay = 0.0
884  flag3 = noerr
885  end if
886  if (flag+flag2+flag3 .eq. noerr) then
887  num_currf_parms(ncurrsource) = 3
888  currf_parms(1,ncurrsource) = cmax
889  currf_parms(2,ncurrsource) = tp
890  currf_parms(3,ncurrsource) = delay
891  write(9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3)')
892  & ' Sin-squared function:',
893  & ' Magnitude=',cmax,' Tpulse=',tp,
894  & ' Tdelay=',delay
895  else
896  call print_bad_line(currline, nlines, numerr)
897  end if
898  else
899  call show_end_of_file(nlines, numerr)
900  status=1000
901  return
902  end if
903 c
904  else if (keyword .eq. k_sinfun) then
905  status = k_found
906  icurrf(ncurrsource) = sinfun
907  call get_next_line(currline, field, nlines, eofflg,
908  & max_fields)
909  if (eofflg .eq. noerr) then
910  call text_to_real(field(1), cmax, flag)
911  call text_to_real(field(2), tp, flag2)
912  call strip(field(3), istart3, iend3)
913  if (istart3 .ne. notext) then
914  call text_to_real(field(3), delay, flag3)
915  else
916  delay = 0.0
917  flag3 = noerr
918  end if
919  if (flag+flag2+flag3 .eq. noerr) then
920  num_currf_parms(ncurrsource) = 3
921  currf_parms(1,ncurrsource) = cmax
922  currf_parms(2,ncurrsource) = tp
923  currf_parms(3,ncurrsource) = delay
924  write(9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3)')
925  & ' Sin function:',
926  & ' Magnitude=',cmax,' Period=',tp,
927  & ' Tdelay=',delay
928  else
929  call print_bad_line(currline, nlines, numerr)
930  end if
931  else
932  call show_end_of_file(nlines, numerr)
933  status=1000
934  return
935  end if
936 c
937  else if (keyword .eq. k_leastsquares) then
938  status = k_found
939  icurrf(ncurrsource) = leastsquares
940  nsaverr = numerr
941  call read_lsf_parms(currf_parms(1,ncurrsource),
942  & num_currf_parms(ncurrsource), eofflg,
943  & nlines, numerr)
944  if (eofflg .eq. noerr) then
945  if (numerr .eq. nsaverr) then
946  write(9,47) (j-1, currf_parms(j,ncurrsource),
947  & j=1,num_currf_parms(ncurrsource))
948  end if
949  else
950  call show_end_of_file(nlines, numerr)
951  status=1000
952  return
953  end if
954 c
955  else if (keyword .eq. k_piecewiselinear) then
956  status = k_found
957  icurrf(ncurrsource) = piecewiselinear
958  nsaverr = numerr
959  call read_pwl_parms(currf_parms(1,ncurrsource),
960  & num_currf_parms(ncurrsource), eofflg,
961  & nlines, numerr)
962  if (eofflg .eq. noerr) then
963  if (numerr .eq. nsaverr) then
964  write(9,48) 'Time ', 'Current ',
965  & ((j+1)/2, currf_parms(j,ncurrsource),
966  & currf_parms(j+1,ncurrsource),
967  & j=1,num_currf_parms(ncurrsource)-1,2)
968  end if
969  else
970  call show_end_of_file(nlines, numerr)
971  status=1000
972  return
973  end if
974 c
975  else if (keyword .eq. k_table) then
976  status = k_found
977  icurrf(ncurrsource) = table
978  nsaverr = numerr
979  call read_pwl_parms(currf_parms(1,ncurrsource),
980  & num_currf_parms(ncurrsource), eofflg,
981  & nlines, numerr)
982  if (eofflg .eq. noerr) then
983  if (numerr .eq. nsaverr) then
984  write(9,49) (currf_parms(j,ncurrsource),j=1,2)
985  write(9,48) 'Time ', 'Current ',
986  & ((j-1)/2, currf_parms(j,ncurrsource),
987  & currf_parms(j+1,ncurrsource),
988  & j=3,num_currf_parms(ncurrsource)-1,2)
989  end if
990  else
991  call show_end_of_file(nlines, numerr)
992  status=1000
993  return
994  end if
995 c
996  else
997  call print_bad_line(currline, nlines, numerr)
998  end if
999 c
1000 c-----------------------------------------------------------------------
1001 c SCL Current source described by a table.
1002 c
1003  else if (keyword .eq. k_csclsource) then
1004  status = k_found
1005  nblks = nblks + 1
1006  nublks = nublks + 1
1007  ncurrsource = ncurrsource + 1
1008  itypcend(ncurrsource) = csclsource
1009  lcirblk = csclsource
1010  lastblk = csclsource
1011  iin(1,nblks,nbrns) = csclsource
1012  icbranch_end(nbrns) = ncurrsource
1013 c
1014 c Get R and C (2rd and 3th fields)
1015 c
1016  call text_to_real(field(2), r, flag)
1017  call text_to_real(field(3), c, flag2)
1018  if ((flag+flag2) .eq. noerr) then
1019  pin(1,nblks,nbrns) = r
1020  pin(2,nblks,nbrns) = c
1021  write(9,'(A,i3,A,A/A,1pe10.3,A,1pe10.3)')
1022  & ' Block ',nublks,' : end-of-branch SCL current source ',
1023  & 'described as a function of time.',
1024  & ' R1=',r,' C1=',c
1025  else
1026  call print_bad_line(currline, nlines, numerr)
1027  status=305
1028  return
1029  end if
1030 c
1031 c Read in the conditional table.
1032 c
1033  nsaverr = numerr
1034  call readctab(currf_parms(1,ncurrsource),
1035  & num_currf_parms(ncurrsource), eofflg,
1036  & nlines, numerr)
1037  if (eofflg .eq. noerr) then
1038  if (numerr .eq. nsaverr) then
1039  write(9,86) (currf_parms(j,ncurrsource),j=1,3)
1040  write(9,85) 'Time ', 'Current ', 'Min-voltg ',
1041  & ((j-1)/3, currf_parms(j,ncurrsource),
1042  & currf_parms(j+1,ncurrsource),
1043  & currf_parms(j+2,ncurrsource),
1044  & j=4,num_currf_parms(ncurrsource)-2,3)
1045  currf_parms(2,ncurrsource) =
1046  & 1.0 / currf_parms(2,ncurrsource)
1047  end if
1048  status=305
1049  return
1050  else
1051  call show_end_of_file(nlines, numerr)
1052  status=1000
1053  return
1054  end if
1055 c
1056 c-----------------------------------------------------------------------
1057 c Variable element in the last block type.
1058 c
1059  else if (keyword .eq. k_variable) then
1060  status = k_found
1061  last_block = iin(1,nblks,nbrns)
1062  nvarl = nvarl + 1
1063  ivar_block(nvarl) = last_block
1064  ivar_block_num(nvarl) = nublks
1065 c
1066 c Second keyword to specify which one is the variable element.
1067 c Check against block type.
1068 c
1069  keyword = field(2)(1:keyword_len)
1070 c
1071  if (last_block .eq. pisection) then
1072  if (keyword .eq. k_r1_var) then
1073  iin(2,nblks,nbrns) = r1_var
1074  else if (keyword .eq. k_c1_var) then
1075  iin(2,nblks,nbrns) = c1_var
1076  else if (keyword .eq. k_r2_var) then
1077  iin(2,nblks,nbrns) = r2_var
1078  else if (keyword .eq. k_l2_var) then
1079  iin(2,nblks,nbrns) = l2_var
1080  else if (keyword .eq. k_r3_var) then
1081  iin(2,nblks,nbrns) = r3_var
1082  else if (keyword .eq. k_c3_var) then
1083  iin(2,nblks,nbrns) = c3_var
1084  else
1085  call print_bad_line(currline, nlines, numerr)
1086  status=305
1087  return
1088  end if
1089 c
1090  else if (last_block .eq. rcground) then
1091  if (keyword .eq. k_r1_var) then
1092  iin(2,nblks,nbrns) = r1_var
1093  else if (keyword .eq. k_c1_var) then
1094  iin(2,nblks,nbrns) = c1_var
1095  else
1096  call print_bad_line(currline, nlines, numerr)
1097  status=305
1098  return
1099  end if
1100 c
1101  else if (last_block .eq. rlseries) then
1102  if (keyword .eq. k_r2_var) then
1103  iin(2,nblks,nbrns) = r2_var
1104  else if (keyword .eq. k_l2_var) then
1105  iin(2,nblks,nbrns) = l2_var
1106  else
1107  call print_bad_line(currline, nlines, numerr)
1108  status=305
1109  return
1110  end if
1111 c
1112  else if (last_block .eq. voltsource) then
1113  if (keyword .eq. k_r2_var) then
1114  iin(2,nblks,nbrns) = r2_var
1115  else if (keyword .eq. k_l2_var) then
1116  iin(2,nblks,nbrns) = l2_var
1117  else
1118  call print_bad_line(currline, nlines, numerr)
1119  status=305
1120  return
1121  end if
1122 c
1123  else
1124  call print_bad_line(currline, nlines, numerr)
1125  status=305
1126  return
1127  end if
1128 c
1129  kelement = iin(2,nblks,nbrns)
1130  label2 = keyword(1:2)
1131 c
1132 c Third keyword for model type (lsf and pwl models not active yet).
1133 c
1134  keyword = field(3)(1:keyword_len)
1135 c
1136 c-----------------------------------------------------------------------
1137 c User supplied model - all parameters are internal to the user's function.
1138 c The function is compiled by the user before executing SCREAMER.
1139 c
1140  if (keyword .eq. k_user_model) then
1141  status = k_found
1142  ivar_type(nvarl) = user_model
1143  write(9,'(A,a2,A,i3)')
1144  & ' ',label2,' is a variable element in block ',nublks
1145  write(9,'(A)') ' User supplied model.'
1146 c
1147  elseif (keyword .eq. k_user1_model) then
1148  status = k_found
1149  ivar_type(nvarl) = user1_model
1150  write(9,'(A,a2,A,i3)')
1151  & ' ',label2,' is a variable element in block ',nublks
1152  write(9,'(A)') ' User supplied model.'
1153 c
1154  elseif (keyword .eq. k_user2_model) then
1155  status = k_found
1156  ivar_type(nvarl) = user2_model
1157  write(9,'(A,a2,A,i3)')
1158  & ' ',label2,' is a variable element in block ',nublks
1159  write(9,'(A)') ' User supplied model.'
1160 c
1161  elseif (keyword .eq. k_user3_model) then
1162  status = k_found
1163  ivar_type(nvarl) = user3_model
1164  write(9,'(A,a2,A,i3)')
1165  & ' ',label2,' is a variable element in block ',nublks
1166  write(9,'(A)') ' User supplied model.'
1167 c
1168  elseif (keyword .eq. k_user4_model) then
1169  status = k_found
1170  ivar_type(nvarl) = user4_model
1171  write(9,'(A,a2,A,i3)')
1172  & ' ',label2,' is a variable element in block ',nublks
1173  write(9,'(A)') ' User supplied model.'
1174 c
1175 c-----------------------------------------------------------------------
1176 c Table model of variable resistor.
1177 c Add an inductor as a variable element
1178 c
1179  else if (keyword .eq. k_tab_model) then
1180  status = k_found
1181  itabnum = itabnum + 1
1182  ivar_type(nvarl) = tab_model
1183  write(9,'(A,a2,A,i3)')
1184  & ' ',label2,' is a variable element in block ',nublks
1185  if ((kelement .ne. r1_var) .and.
1186  & (kelement .ne. r2_var) .and.
1187  & (kelement .ne. r3_var) .and.
1188  & (kelement .ne. l2_var)) then
1189 c L2 added above this line
1190  write(9,'(A,a2,A)')
1191  & ' ### ERROR ### element ',label2,' may not be
1192  & used with this model.'
1193  numerr = numerr + 1
1194  end if
1195  nsaverr = numerr
1196  call read_tablem(tablem_vals(1,itabnum),
1197  + num_tablem_vals(itabnum),
1198  + eofflg, nlines, numerr)
1199  if (eofflg .eq. noerr) then
1200  if (numerr .eq. nsaverr) then
1201  write(9,49) (tablem_vals(j,itabnum),j=1,2)
1202  if (kelement .eq. l2_var) then
1203  write(9,48) 'Time ', 'Inductance ',
1204  & ((j-1)/2, tablem_vals(j,itabnum),
1205  & tablem_vals(j+1,itabnum),
1206  & j=3,num_tablem_vals(itabnum)-1,2)
1207  else
1208  write(9,48) 'Time ', 'Resistance ',
1209  & ((j-1)/2, tablem_vals(j,itabnum),
1210  & tablem_vals(j+1,itabnum),
1211  & j=3,num_tablem_vals(itabnum)-1,2)
1212 
1213  endif
1214  endif
1215  else
1216  call show_end_of_file(nlines, numerr)
1217  status=1000
1218  return
1219  endif
1220 c
1221 c-----------------------------------------------------------------------
1222 c Exponential model of variable resistor.
1223 c
1224  else if (keyword .eq. k_exp_model) then
1225  status = k_found
1226  ivar_type(nvarl) = exp_model
1227  write(9,'(A,a2,A,i3)')
1228  & ' ',label2,' is a variable element in block ',nublks
1229  if ((kelement .ne. r1_var) .and.
1230  & (kelement .ne. r2_var) .and.
1231  & (kelement .ne. r3_var)) then
1232  write(9,'(A,a2,A)')
1233  & ' ### ERROR ### element ',label2,' may not be
1234  & used with this model.'
1235  numerr = numerr + 1
1236  end if
1237  call get_next_line(currline, field, nlines, eofflg,
1238  & max_fields)
1239  if (eofflg .eq. noerr) then
1240  call text_to_real(field(1), ropen, flag)
1241  call text_to_real(field(2), rclose, flag2)
1242  call text_to_real(field(3), timsw, flag3)
1243  call text_to_real(field(4), tau, flag4)
1244  call text_to_real(field(5), zsw, flag5)
1245  if (flag+flag2+flag3+flag4+flag5 .eq. noerr) then
1246  num_var_parms(nvarl) = 5
1247  var_model(1,nvarl) = ropen
1248  var_model(2,nvarl) = rclose
1249  var_model(3,nvarl) = timsw
1250  var_model(4,nvarl) = 1.0 / tau
1251  var_model(5,nvarl) = zsw
1252  write(9,
1253  & '(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
1254  & ' Exponential model of a resistive switch:',
1255  & ' Ropen=',ropen,' Rclose=',rclose,
1256  & ' Tswitch=',timsw,' Tau=',tau,
1257  & ' Zswitch=',zsw
1258  else
1259  call print_bad_line(currline, nlines, numerr)
1260  end if
1261 c
1262  else
1263  call show_end_of_file(nlines, numerr)
1264  status=1000
1265  return
1266  end if
1267 c
1268 c-----------------------------------------------------------------------
1269 c Decay or Rise model of variable resistor.
1270 c
1271  else if ((keyword .eq. k_decay_model) .or.
1272  & (keyword .eq. k_rise_model)) then
1273  status = k_found
1274 
1275  if (keyword .eq. k_decay_model) then
1276  ivar_type(nvarl) = decay_model
1277  else
1278  ivar_type(nvarl) = rise_model
1279  endif
1280 c
1281  write(9,'(A,a2,A,i3)')
1282  & ' ',label2,' is a variable element in block ',nublks
1283  if ((kelement .ne. r1_var) .and.
1284  & (kelement .ne. r2_var) .and.
1285  & (kelement .ne. r3_var)) then
1286  write(9,'(A,a2,A)')
1287  & ' ### ERROR ### element ',label2,' may not be
1288  & used with this model.'
1289  numerr = numerr + 1
1290  end if
1291  call get_next_line(currline, field, nlines, eofflg,
1292  & max_fields)
1293 c
1294  if (eofflg .eq. noerr) then
1295  call text_to_real(field(1), ropen, flag)
1296  call text_to_real(field(2), rclose, flag2)
1297  call text_to_real(field(3), timsw, flag3)
1298  call text_to_real(field(4), tau, flag4)
1299  if (flag+flag2+flag3+flag4 .eq. noerr) then
1300  num_var_parms(nvarl) = 4
1301  var_model(1,nvarl) = ropen
1302  var_model(2,nvarl) = rclose
1303  var_model(3,nvarl) = timsw
1304  var_model(4,nvarl) = 1.0 / tau
1305  if (keyword .eq. k_decay_model) then
1306  write
1307  & (9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
1308  & ' Decay model of a resistive switch:',
1309  & ' Ropen=',ropen,' Rclose=',rclose,
1310  & ' Tswitch=',timsw,' Tau=',tau
1311  else
1312  write
1313  & (9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
1314  & ' Rise model of a resistive switch:',
1315  & ' Ropen=',ropen,' Rclose=',rclose,
1316  & ' Tswitch=',timsw,' Tau=',tau
1317  endif
1318  else
1319  call print_bad_line(currline, nlines, numerr)
1320  end if
1321 c
1322  else
1323  call show_end_of_file(nlines, numerr)
1324  status=1000
1325  return
1326  end if
1327 c
1328 c-----------------------------------------------------------------------
1329 c Plasma opening switch models.
1330 c PS1 is time switching, PS2 is for charge switching.
1331 c
1332  else if ((keyword .eq. k_ps1_model) .or.
1333  & (keyword .eq. k_ps2_model)) then
1334  status = k_found
1335  if (keyword .eq. k_ps1_model) then
1336  ivar_type(nvarl) = ps1_model
1337  else if (keyword .eq. k_ps2_model) then
1338  ivar_type(nvarl) = ps2_model
1339  end if
1340  write(9,'(A,a2,A,i3)')
1341  & ' ',label2,' is a variable element in block ',nublks
1342  if ((kelement .ne. r1_var) .and.
1343  & (kelement .ne. r3_var)) then
1344  write(9,'(A,a2,A)')
1345  & ' ### ERROR ### element ',label2,' may not be
1346  & used with this model.'
1347  numerr = numerr + 1
1348  end if
1349  call get_next_line(currline, field, nlines, eofflg,
1350  & max_fields)
1351  if (eofflg .eq. noerr) then
1352  call text_to_real(field(1), timsw, flag )
1353  call text_to_real(field(2), const, flag2)
1354  call text_to_real(field(3), rmax, flag3)
1355  call text_to_real(field(4), rmin, flag4)
1356  if (flag+flag2+flag3+flag4 .eq. noerr) then
1357  if (keyword .eq. k_ps1_model) then
1358  num_var_parms(nvarl) = 6
1359  var_model(1,nvarl) = timsw
1360  var_model(2,nvarl) = const
1361  var_model(3,nvarl) = 1.0 / (rmax + 1.0e-20)
1362  var_model(4,nvarl) = 1.0 / (rmin + 1.0e-20)
1363  var_model(5,nvarl) = 0.0
1364  var_model(6,nvarl) = 0.0
1365  write(9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
1366  & ' PEOS model 1:',
1367  & ' Tswitch=',timsw,' Constant=',const,
1368  & ' Rmax=',rmax,' Rmin=',rmin
1369  else if (keyword .eq. k_ps2_model) then
1370  num_var_parms(nvarl) = 7
1371  qsw = timsw
1372  var_model(1,nvarl) = qsw
1373  var_model(2,nvarl) = const
1374  var_model(3,nvarl) = 1.0 / (rmax + 1.0e-20)
1375  var_model(4,nvarl) = 1.0 / (rmin + 1.0e-20)
1376  var_model(5,nvarl) = 0.0
1377  var_model(6,nvarl) = 0.0
1378  var_model(7,nvarl) = 0.0
1379  write(9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
1380  & ' PEOS model 2:',
1381  & ' Qswitch=',qsw,' Constant=',const,
1382  & ' Rmax=',rmax,' Rmin=',rmin
1383  end if
1384  else
1385  call print_bad_line(currline, nlines, numerr)
1386  end if
1387 c
1388  else
1389  call show_end_of_file(nlines, numerr)
1390  status=1000
1391  return
1392  end if
1393 c
1394 c-----------------------------------------------------------------------
1395 c
1396 c Plasma opening switch model.
1397 c POS is a Z-flow pos model, January 11, 1995 kws.
1398 c pos to switch on time or current level.
1399 c
1400  else if (keyword .eq. k_pos_model) then
1401  status = k_found
1402  ivar_type(nvarl) = pos_model
1403  write(9,'(A,a2,A,i3)')
1404  & ' ',label2,' is a variable element in block ',nublks
1405  if ((kelement .ne. r1_var) .and.
1406  & (kelement .ne. r3_var)) then
1407  write(9,'(A,a2,A)')
1408  & ' ### ERROR ### element ',label2,' may not be
1409  & used with this model.'
1410  numerr = numerr + 1
1411  end if
1412  call get_next_line(currline, field, nlines, eofflg,
1413  & max_fields)
1414  if (eofflg .eq. noerr) then
1415  call text_to_real(field(1), tsw, flag )
1416  call text_to_real(field(2), cursw, flag2)
1417  call text_to_real(field(3), topen, flag3)
1418  call text_to_real(field(4), zflow, flag4)
1419  call text_to_real(field(5), gswmin, flag5)
1420  call text_to_real(field(6), gswmax, flag6)
1421  call text_to_real(field(7), cbswitch,flag7)
1422  call strip(field(8), istart8, iend8)
1423  if (istart8 .ne. notext) then
1424  call text_to_real(field(8), forward, flag8)
1425  else
1426  forward = 1.0
1427  flag8 = noerr
1428  end if
1429 c
1430  if (flag+flag2+flag3+flag4+flag5+flag6+flag7+flag8
1431  & .eq. noerr) then
1432  num_var_parms(nvarl) = 7
1433  var_model(1,nvarl) = tsw
1434  var_model(2,nvarl) = cursw
1435  var_model(3,nvarl) = topen
1436  var_model(4,nvarl) = zflow
1437  var_model(5,nvarl) = gswmin
1438  var_model(6,nvarl) = gswmax
1439  var_model(7,nvarl) = cbswitch
1440  var_model(8,nvarl) = 0.0 ! parameter skip
1441  var_model(9,nvarl) = 0.0 ! parameter tsw
1442  var_model(10,nvarl) = 0.0 ! parameter ctest
1443  var_model(11,nvarl) = 0.0 ! parameter CBflag
1444  var_model(12,nvarl) = 0.0 ! parameter calczflow
1445  var_model(13,nvarl) = 0.0 ! parameter gvar
1446  var_model(14,nvarl) = forward ! flag for forwards or backwards
1447  write(9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3,A,
1448  & 1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
1449  & ' Z FLOW POS model :',' tsw =',tsw,
1450  & ' cursw =',cursw,' topen=',topen,' zflow=',zflow,
1451  & ' gswmax=',gswmax,' gswmin=',gswmin,
1452  & ' CBflag=',cbflag,' forward = ',forward
1453  else
1454  call print_bad_line(currline, nlines, numerr)
1455  end if
1456  else
1457  call show_end_of_file(nlines, numerr)
1458  status=1000
1459  return
1460  end if
1461 c
1462 c-----------------------------------------------------------------------
1463 c
1464 c KWS Zflow Plasma Loss Current Model
1465 c
1466 c Forces a zflow current loss at the insertion point when Child-Langmuir
1467 c emission turns off (after it has first been turned on).
1468 c
1469  else if (keyword .eq. k_zflow_model) then
1470  status = k_found
1471  ivar_type(nvarl) = zflow_model
1472  write(9,'(A,a2,A,i3)')
1473  & ' ',label2,' is a variable element in block ',nublks
1474  if (kelement .ne. r1_var) then
1475  write(9,'(A,a2,A)')
1476  & ' ### ERROR ### element ',label2,' may not be
1477  & used with this model.'
1478  numerr = numerr + 1
1479  end if
1480  call get_next_line(currline, field, nlines, eofflg,
1481  & max_fields)
1482  if (eofflg .eq. noerr) then
1483  call text_to_real(field(1), zflow , flag )
1484  call text_to_real(field(2), gap , flag2)
1485  call text_to_real(field(3), radius, flag3)
1486  call text_to_real(field(4), gmin , flag4)
1487  call text_to_real(field(5), gmax , flag5)
1488  call text_to_real(field(6), xni , flag6)
1489  call strip(field(7), istart7, iend7)
1490  if (istart7 .ne. notext) then
1491  call text_to_real(field(7), forward, flag7)
1492  else
1493  forward = 1.0
1494  flag7 = noerr
1495  end if
1496 c
1497  if (flag+flag2+flag3+flag4+flag5+flag6+flag7.eq. noerr) then
1498  num_var_parms(nvarl) = 6
1499  var_model(1,nvarl) = zflow
1500  var_model(2,nvarl) = gap
1501  var_model(3,nvarl) = radius
1502  var_model(4,nvarl) = gmin
1503  var_model(5,nvarl) = gmax
1504  var_model(6,nvarl) = 0.0 ! parameter calczflow
1505  var_model(7,nvarl) = gmin ! parameter gvar
1506  var_model(8,nvarl) = 0.0 ! parameter emissionflag
1507  var_model(9,nvarl) = 0.0 ! parameter tintegral
1508  var_model(10,nvarl) = xni ! number of parallel lines
1509  var_model(11,nvarl) = forward ! flag for forward or backwards
1510  write(9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3
1511  & ,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
1512  & ' Z FLOW Plasma Loss Current model :',
1513  & ' zflow =',zflow,' gap =',gap,' radius=',radius,
1514  & ' gmin=',gmin,' gmax=',gmax,' xni=',xni,
1515  & ' forward = ',forward
1516  else
1517  call print_bad_line(currline, nlines, numerr)
1518  end if
1519  if ((gap.le.0.0).or.(radius.le.0.0).or.(xni.le.0.0)) then
1520  write(9,'(A,A)')
1521  & 'gap, radius, or number of parallel lines ',
1522  & 'less than or equal zero <<<<<<<<<<<<<<<<<<<<<<<<<<<'
1523  call print_bad_line(currline, nlines,numerr)
1524  endif
1525  else
1526  call show_end_of_file(nlines, numerr)
1527  status=1000
1528  return
1529  end if
1530 c
1531 c-----------------------------------------------------------------------
1532 c
1533 c Magnetic Flashover Inhibition (MFI) Insulator Crowbar Model.
1534 c October 14, 1993, KWS.
1535 c Causes Insulator to crowbar if MFI criterion exceeded.
1536 c
1537  else if (keyword .eq. k_mfi_model) then
1538  status = k_found
1539  ivar_type(nvarl) = mfi_model
1540  write(9,'(A,a2,A,i3)')
1541  & ' ',label2,' is a variable element in block ',nublks
1542  if ((kelement .ne. r1_var) .and.
1543  & (kelement .ne. r3_var)) then
1544  write(9,'(A,a2,A)')
1545  & ' ### ERROR ### element ',label2,' may not be
1546  & used with this model.'
1547  numerr = numerr + 1
1548  end if
1549  call get_next_line(currline, field, nlines, eofflg,
1550  & max_fields)
1551  if (eofflg .eq. noerr) then
1552  call text_to_real(field(1), radius, flag )
1553  call text_to_real(field(2), dgap, flag2)
1554  call text_to_real(field(3), gmin, flag3)
1555  call text_to_real(field(4), gmax, flag4)
1556  call text_to_real(field(5), xni, flag5)
1557  call text_to_real(field(6), flash, flag6)
1558 c
1559  if (flag+flag2+flag3+flag4+flag5+flag6 .eq. noerr) then
1560  num_var_parms(nvarl) = 6
1561  var_model(1,nvarl) = radius
1562  var_model(2,nvarl) = dgap
1563  var_model(3,nvarl) = gmin
1564  var_model(4,nvarl) = gmax
1565  var_model(5,nvarl) = xni
1566  var_model(6,nvarl) = flash
1567  var_model(7,nvarl) = 0.0 ! Initial value of swclosed
1568  var_model(8,nvarl) = 0.0 ! Initial value of tsw
1569  var_model(9,nvarl) = 0.0 ! Initial value of efld
1570  var_model(10,nvarl) = 0.0 ! Initial value of bfld
1571  var_model(11,nvarl) = 0.0 ! Initial value of xmfi
1572  write(9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3,
1573  & A,1pe10.3,A,1pe10.3)')
1574  & ' MFI Insulator CB model :',
1575  & ' radius =',radius,' dgap =',dgap,
1576  & ' gmin =',gmin,' gmax =',gmax,
1577  & ' xni =',xni,' flash =',flash
1578  else
1579  call print_bad_line(currline, nlines, numerr)
1580  end if
1581  else
1582  call show_end_of_file(nlines, numerr)
1583  status=1000
1584  return
1585  end if
1586 c
1587 c-----------------------------------------------------------------------
1588 c
1589 c Resistive Wall Resistance Model.
1590 c March 7, 1994, KWS.
1591 c Calculates resistance of the wall for very short, high current pulses.
1592 c
1593  else if (keyword .eq. k_rwall_model) then
1594  status = k_found
1595  ivar_type(nvarl) = rwall_model
1596  write(9,'(A,a2,A,i4)')
1597  & ' ',label2,' is a variable element in block ',nublks
1598  if (kelement .ne. r2_var) then
1599  write(9,'(A,a2,A)')
1600  & ' ### ERROR ### element ',label2,' may not be
1601  & used with this model.'
1602  numerr = numerr + 1
1603  end if
1604  call get_next_line(currline, field, nlines, eofflg,
1605  & max_fields)
1606  if (eofflg .eq. noerr) then
1607  call text_to_real(field(1), t_in, flag )
1608  call text_to_real(field(2), gvalue,flag2)
1609  call text_to_real(field(3), disk1in,flag3)
1610  call text_to_real(field(4), disk1out,flag4)
1611  call text_to_real(field(5), disk2in,flag5)
1612  call text_to_real(field(6), disk2out,flag6)
1613  call get_next_line(currline, field, nlines, eofflg,
1614  & max_fields)
1615  if (eofflg .eq. noerr) then
1616  call text_to_real(field(1), cyl_r_1,flag7)
1617  call text_to_real(field(2), cyl_l_1,flag8)
1618  call text_to_real(field(3), cyl_r_2,flag9)
1619  call text_to_real(field(4), cyl_l_2,flag10)
1620  else
1621  call show_end_of_file(nlines, numerr)
1622  status=1000
1623  return
1624  end if
1625 c
1626  if(flag+flag2+flag3+flag4+flag5+flag6+flag7+flag8+flag9+flag10
1627  & .eq.noerr)then
1628  num_var_parms(nvarl) = 8
1629  gvalue=abs(gvalue)
1630  if(disk1in.le.0.0)disk1in=1000.
1631 c if(disk1out.le.disk1in)disk1out=disk1in+1000.
1632  if(disk1out.lt.disk1in)disk1out=disk1in
1633  if(disk2in.le.0.0)disk2in=1000.
1634 c if(disk2out.le.disk2in)disk2out=disk2in+1000.
1635  if(disk2out.lt.disk2in)disk2out=disk2in
1636  if(cyl_r_1.le.0.0)then
1637  cyl_r_1=1000.0
1638  cyl_l_1=0.0
1639  endif
1640  if(cyl_r_2.le.0.0)then
1641  cyl_r_2=1000.0
1642  cyl_l_1=0.0
1643  endif
1644  if(cyl_l_1.lt.0.0)cyl_l_1=0.0
1645  if(cyl_l_2.lt.0.0)cyl_l_2=0.0
1646  diskfact=log(disk1out/disk1in)+log(disk2out/disk2in)
1647  cylfact=cyl_l_1/cyl_r_1+cyl_l_2/cyl_r_2
1648  geomfact=diskfact+cylfact
1649  var_model(1,nvarl) = t_in
1650  var_model(2,nvarl) = gvalue
1651  var_model(3,nvarl) = diskfact
1652  var_model(4,nvarl) = cylfact
1653  var_model(5,nvarl) = geomfact
1654  write(9,
1655  & '(A/A,1pe10.3,A,1pe10.3/A,1pe10.3,A,1pe10.3/A,1pe10.3,
1656  & A,1pe10.3/A,1pe10.3,A,1pe10.3/A,1pe10.3,A,1pe10.3)')
1657  & ' RWALL resistive wall model :',
1658  & ' t_in =',t_in,' gvalue =',gvalue,
1659  & ' disk1inner =',disk1in,' disk1outer =',disk1out,
1660  & ' disk2inner =',disk2in,' disk2outer =',disk2out,
1661  & ' cyl_radius_1 =',cyl_r_1,' cyl_length_1 =',cyl_l_1,
1662  & ' cyl_radius_2 =',cyl_r_2,' cyl_length_2 =',cyl_l_2
1663  else
1664  call print_bad_line(currline, nlines, numerr)
1665  end if
1666  else
1667  call show_end_of_file(nlines, numerr)
1668  status=1000
1669  return
1670  end if
1671 c
1672 c-----------------------------------------------------------------------
1673 c
1674 c Version 1 Modified Wall Resistance Model.
1675 c 2012-03-08, RBS
1676 c 2013-12-07, RBS arb. disk and cyl
1677 c
1678 c Calculates resistance of a conducting wall for short, high
1679 c current pulses using the NEW stgar model.
1680 c
1681 c Read in the conductor parameters (cylindrical or disk)
1682 c and check the parameters for validity.
1683 c
1684  else if (keyword .eq. k_r2wall_model) then
1685  status = k_found
1686  ivar_type(nvarl) = r2wall_model
1687  write(9,'(A,a2,A,i3)')
1688  & ' ',label2,' is a variable element in block ',nublks
1689  if (kelement .ne. r2_var) then
1690  write(9,'(A,a2,A)')
1691  & ' ### ERROR ### element ',label2,' may not be
1692  & used with this model.'
1693  numerr = numerr + 1
1694  end if
1695 c Read in the lines following the resistor command line
1696  call get_next_line(currline, field, nlines, eofflg,
1697  & max_fields)
1698  if (eofflg .eq. noerr) then
1699  call text_to_real(field(1), t_in, flag)
1700  call text_to_real(field(2), cyl_lin, flag2)
1701  call text_to_real(field(3), cyl_lo, flag3)
1702  call text_to_real(field(4), cyl_rin, flag4)
1703  call text_to_real(field(5), cyl_ro, flag5)
1704  call get_next_line(currline, field, nlines, eofflg,
1705  & max_fields)
1706  if (eofflg .eq. noerr) then
1707  call text_to_real(field(1), d_urin, flag6)
1708  call text_to_real(field(2), d_urout, flag7)
1709  call text_to_real(field(3), d_lrin, flag8)
1710  call text_to_real(field(4), d_lrout, flag9)
1711  else
1712  call show_end_of_file(nlines, numerr)
1713  status=1000
1714  return
1715  end if
1716 c
1717 c Place the inputted parameters for R2Wall into the passed vector
1718 c
1719  if(flag+flag2+flag3+flag4+flag5+flag6+flag7+flag8+flag9
1720  & .eq.noerr) then
1721  var_model(1,nvarl) = t_in
1722  var_model(2,nvarl) = cyl_lin
1723  var_model(3,nvarl) = cyl_lo
1724  var_model(4,nvarl) = cyl_rin
1725  var_model(5,nvarl) = cyl_ro
1726  var_model(6,nvarl) = d_urin
1727  var_model(7,nvarl) = d_urout
1728  var_model(8,nvarl) = d_lrin
1729  var_model(9,nvarl) = d_lrout
1730  write(9,
1731  & '(A/A,1pe10.3,/
1732  & A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3,/
1733  & A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3/)')
1734  & ' R2WALL resistive wall model :',
1735  & ' t_in =',t_in,
1736  & ' cyl l inner =',cyl_lin,' cyl l outer r =',cyl_lo,
1737  & ' cyl r inner =',cyl_rin,' cyl r outer =',cyl_ro,
1738  & ' disk up r inner =',d_urin,
1739  & ' disk up r outer =',d_urout,
1740  & ' disk low r inner =',d_lrin,
1741  & ' disk low r outer =',d_lrout
1742  else
1743  call print_bad_line(currline, nlines, numerr)
1744  end if
1745  else
1746  call show_end_of_file(nlines, numerr)
1747  status=1000
1748  return
1749  end if
1750 c
1751 c-----------------------------------------------------------------------
1752 c
1753 c MIP POS model, February 26, 1993 hnw.
1754 c zmip ( CTOPS ) pos to switch on errosion and/or magnetic push back.
1755 c
1756  else if (keyword .eq. k_zmip_model) then
1757  status = k_found
1758  ivar_type(nvarl) = zmip_model
1759  write(9,'(A,a2,A,i3)')
1760  & ' ',label2,' is a variable element in block ',nublks
1761  if ((kelement .ne. r1_var) .and.
1762  & (kelement .ne. r3_var)) then
1763  write(9,'(A,a2,A)')
1764  & ' ### ERROR ### element ',label2,' may not be
1765  & used with this model.'
1766  numerr = numerr + 1
1767  end if
1768  call get_next_line(currline, field, nlines, eofflg,
1769  & max_fields)
1770  if (eofflg .eq. noerr) then
1771  call text_to_real(field(1), plength, flag )
1772  call text_to_real(field(2), gap0, flag2)
1773  call text_to_real(field(3), gapmin, flag3)
1774  call text_to_real(field(4), radius, flag4)
1775  call text_to_real(field(5), gmax, flag5)
1776  call text_to_real(field(6), pitch, flag6)
1777  call text_to_real(field(7), massnum, flag7)
1778  call text_to_real(field(8), numden, flag8)
1779  call text_to_real(field(9), econst, flag9)
1780  call text_to_real(field(10), ibigpo, flag10)
1781 c
1782  if (flag+flag2+flag3+flag4+flag5+flag6+flag7+flag8+
1783  & flag9+flag10 .eq. noerr) then
1784  num_var_parms(nvarl) = 10
1785  var_model(1,nvarl) = plength
1786  var_model(2,nvarl) = gap0
1787  var_model(3,nvarl) = gapmin
1788  var_model(4,nvarl) = radius
1789  var_model(5,nvarl) = gmax
1790  var_model(6,nvarl) = pitch
1791  var_model(7,nvarl) = massnum
1792  var_model(8,nvarl) = numden
1793  var_model(9,nvarl) = econst
1794  var_model(10,nvarl) = ibigpo
1795  write(9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3/
1796  & A,1pe10.3,A,1pe10.3,A,1pe10.3/
1797  & A,1pe10.3,A,1pe10.3,A,1pe10.3/A,1pe10.3)')
1798  & ' MIP POS ( CTOPS ) model:',
1799  & ' length =',plength,' gap0 =',gap0,
1800  & ' gapmin =',gapmin,
1801  & ' radius =',radius,' gmax =',gmax,
1802  & ' pitch =',pitch,
1803  & ' massnum =',massnum,' numden =',numden,
1804  & ' econst =',econst,' ibigpo =',ibigpo
1805  else
1806  call print_bad_line(currline, nlines, numerr)
1807  end if
1808  else
1809  call show_end_of_file(nlines, numerr)
1810  status=1000
1811  return
1812  end if
1813 c
1814 c-----------------------------------------------------------------------
1815 c-----------------------------------------------------------------------
1816 c Series Switch model, set up with a R2 in a PIEsection or
1817 c a RLSeries block. hnw January 14, 1993
1818 c
1819 c Tom Martins lossy switch model, sw_model
1820 c
1821  else if ( (keyword .eq. k_sw_model )
1822  & .or. (keyword .eq. k_sw1_model)
1823  & .or. (keyword .eq. k_sw2_model)
1824  & .or. (keyword .eq. k_sw3_model)
1825  & .or. (keyword .eq. k_sw4_model) ) then
1826 c
1827  status = k_found
1828  ivar_type(nvarl) = sw_model
1829 c
1830  write(9,'(A,a2,A,i3)')
1831  & ' ',label2,' is a variable element in block ',nublks
1832  if (kelement .ne. r2_var) then
1833  write(9,'(A,a2,A)')
1834  & ' ### ERROR ### element ',label2,' may not be
1835  & used with this model.'
1836  numerr = numerr + 1
1837  end if
1838  call get_next_line(currline, field, nlines, eofflg,
1839  & max_fields)
1840  if (eofflg .eq. noerr) then
1841  call decodematerial(field(1), diel1, flag )
1842  call text_to_real(field(2), tbd1, flag2)
1843  call text_to_real(field(3), dm1, flag3)
1844  call text_to_real(field(4), atm1, flag4)
1845  call text_to_real(field(5), xsw1, flag5)
1846  call text_to_real(field(6), xch1, flag6)
1847  material = field(1)
1848  if (flag+flag2+flag3+flag4+flag5+flag6 .eq. noerr) then
1849  num_var_parms(nvarl) = 6
1850  var_model(1,nvarl) = diel1
1851  var_model(2,nvarl) = tbd1
1852  var_model(3,nvarl) = dm1
1853  var_model(4,nvarl) = atm1
1854  var_model(5,nvarl) = xsw1
1855  var_model(6,nvarl) = xch1
1856  var_model(7,nvarl) = 0.0 ! Initialize variable irta1
1857  write(9,'(A/A,a3,A,1pe10.3,A,
1858  & 1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
1859  & ' SW1 model :',
1860  & ' DIEL1=',material,' TBD1=',tbd1,
1861  & ' DM1=',dm1,' ATM1=',atm1,
1862  & ' XSW1=',xsw1,' XCH1=',xch1
1863  else
1864  call print_bad_line(currline, nlines, numerr)
1865  end if
1866 c
1867  else
1868  call show_end_of_file(nlines, numerr)
1869  status=1000
1870  return
1871  end if
1872 c
1873 c-----------------------------------------------------------------------
1874 c Diode model of S.A.Slutz
1875 c
1876  else if (keyword .eq. k_diode_model) then
1877  status = k_found
1878  ivar_type(nvarl) = diode_model
1879  write(9,'(A,a2,A,i3)')
1880  & ' ',label2,' is a variable element in block ',nublks
1881  if ((kelement .ne. r1_var) .and.
1882  & (kelement .ne. r3_var)) then
1883  write(9,'(A,a2,A)')
1884  & ' ### ERROR ### element ',label2,' may not be
1885  & used with this model.'
1886  numerr = numerr + 1
1887  end if
1888  call get_next_line(currline, field, nlines, eofflg,
1889  & max_fields)
1890  if (eofflg .eq. noerr) then
1891  call text_to_real(field(1), tdelay, flag )
1892  call text_to_real(field(2), rmax, flag2)
1893  call text_to_real(field(3), rmin, flag3)
1894  call text_to_real(field(4), area, flag4)
1895  call text_to_real(field(5), gap, flag5)
1896  call text_to_real(field(6), velocity, flag6)
1897  call text_to_real(field(7), gapmin, flag7)
1898  call text_to_real(field(8), pmass_ratio, flag8)
1899 c
1900 c If user did not enter pmass_ratio, set it to 1.0
1901 c
1902  if (pmass_ratio .eq. 0.0) then
1903  pmass_ratio = 1.0
1904  endif
1905 c
1906  if (flag+flag2+flag3+flag4+flag5+flag6+flag7 .eq. noerr)
1907  & then
1908  num_var_parms(nvarl) = 8
1909  var_model(1,nvarl) = tdelay
1910  var_model(2,nvarl) = 1.0 / (rmax + 1.0e-20)
1911  var_model(3,nvarl) = 1.0 / (rmin + 1.0e-20)
1912  var_model(4,nvarl) = area
1913  var_model(5,nvarl) = gap
1914  var_model(6,nvarl) = velocity
1915  var_model(7,nvarl) = gapmin
1916  var_model(8,nvarl) = pmass_ratio
1917  var_model(9,nvarl) = 0.0
1918  write(9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3/A,
1919  & 1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
1920  & ' Diode model:',' Tdelay=',tdelay,
1921  & ' Rmax=',rmax,'Rmin=',rmin,' Area=',area,
1922  & ' Gap=',gap,' Vel.=',velocity,
1923  & 'Min-Gap=',gapmin,' Pmass_ratio=',pmass_ratio
1924  else
1925  call print_bad_line(currline, nlines, numerr)
1926  end if
1927 c
1928  else
1929  call show_end_of_file(nlines, numerr)
1930  status=1000
1931  return
1932  end if
1933 c
1934 c-----------------------------------------------------------------------
1935 c Applied-B Diode model of M.P.DesJarlais
1936 c
1937  else if (keyword .eq. k_abdiode_model) then
1938  status = k_found
1939  ivar_type(nvarl) = abdiode_model
1940  write(9,'(A,a2,A,i3)')
1941  & ' ',label2,' is a variable element in block ',nublks
1942  if ((kelement .ne. r1_var) .and.
1943  & (kelement .ne. r3_var)) then
1944  write(9,'(A,a2,A)')
1945  & ' ### ERROR ### element ',label2,' may not be
1946  & used with this model.'
1947  numerr = numerr + 1
1948  end if
1949  call get_next_line(currline, field, nlines, eofflg,
1950  & max_fields)
1951  if (eofflg .eq. noerr) then
1952  call text_to_real(field(1), gap, flag )
1953  call text_to_real(field(2), area, flag2)
1954  call text_to_real(field(3), charge, flag3)
1955  call text_to_real(field(4), amu, flag4)
1956  call text_to_real(field(5), b0, flag5)
1957  call text_to_real(field(6), x0, flag6)
1958  call text_to_real(field(7), rmin, flag7)
1959  call text_to_real(field(8), rmax, flag8)
1960  call text_to_real(field(9), frac, flag9)
1961  call strip(field(10), istart10, iend10)
1962  if (istart10 .ne. notext) then
1963  call text_to_real(field(10), ratemax, flag10)
1964  else
1965  ratemax = abdratemax
1966  flag10 = noerr
1967  end if
1968  if ( flag +flag2+flag3+flag4+flag5
1969  & +flag6+flag7+flag8+flag9+flag10
1970  & .eq. noerr) then
1971  num_var_parms(nvarl) = 10
1972  var_model(1,nvarl) = gap
1973  var_model(2,nvarl) = area
1974  var_model(3,nvarl) = charge
1975  var_model(4,nvarl) = amu
1976  var_model(5,nvarl) = b0
1977  var_model(6,nvarl) = x0
1978  var_model(7,nvarl) = 1.0 / (rmin + 1.0e-20) !gmax
1979  var_model(8,nvarl) = 1.0 / (rmax + 1.0e-20) !gmin
1980  var_model(9,nvarl) = frac
1981  var_model(10,nvarl) = ratemax
1982  write(9,
1983  & '(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3,
1984  & A,1pe10.3/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
1985  & ' Applied-B Diode model:',
1986  & ' Gap=',gap,' Area=',area,
1987  & ' Ion Charge=',charge,' Ion AMU=',amu,
1988  & ' B0=',b0,' X0=',x0,' Rmin=',rmin,
1989  & ' Rmax=',rmax,' IonFraction=',frac,
1990  & ' Ratemax=',ratemax
1991 c
1992 c Now call a subroutine which will set the many parameters needed to
1993 c do this diode model.
1994 c
1995  call abdiodeparm
1996  & (var_model(1,nvarl), num_var_parms(nvarl))
1997  else
1998  call print_bad_line(currline, nlines, numerr)
1999  end if
2000 c
2001  else
2002  call show_end_of_file(nlines, numerr)
2003  status=1000
2004  return
2005  end if
2006 c
2007 c-----------------------------------------------------------------------
2008 c Saturable core inductor as a magnetic switch model.
2009 c
2010  else if (keyword .eq. k_magsw_model) then
2011  status = k_found
2012  ivar_type(nvarl) = magsw_model
2013  write(9,'(A,a2,A,i3)')
2014  & ' ',label2,' is a variable element in block ',nublks
2015  if (kelement .ne. l2_var) then
2016  write(9,'(A,a2,A)')
2017  & ' ### ERROR ### element ',label2,' may not be
2018  & used with this model.'
2019  numerr = numerr + 1
2020  end if
2021  call get_next_line(currline, field, nlines, eofflg,
2022  & max_fields)
2023  if (eofflg .eq. noerr) then
2024  call text_to_real(field(1), pf, flag)
2025  call text_to_real(field(2), ri, flag2)
2026  call text_to_real(field(3), ro, flag3)
2027  call text_to_real(field(4), w, flag4)
2028  call text_to_real(field(5), h1, flag5)
2029  call text_to_real(field(6), hsat, flag6)
2030  call text_to_real(field(7), hrev, flag7)
2031  call text_to_real(field(8), bsat, flag8)
2032  isum = flag+flag2+flag3+flag4+flag5+flag6+flag7+flag8
2033  if (isum .eq. noerr) then
2034  num_var_parms(nvarl) = 9
2035  var_model(1,nvarl) = pf
2036  var_model(2,nvarl) = ri
2037  var_model(3,nvarl) = ro
2038  var_model(4,nvarl) = w
2039  var_model(5,nvarl) = h1
2040  var_model(6,nvarl) = hsat
2041  var_model(7,nvarl) = hrev
2042  var_model(8,nvarl) = bsat
2043 c
2044 c set 9 to the initial value of the inductance
2045 c
2046  iiin = iin(2,nblks,nbrns)
2047  var_model(9,nvarl) = pin(iiin,nblks,nbrns)
2048  write(9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3/
2049  & A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
2050  & ' Saturable core inductor switch model:',
2051  & ' PkFrac=',pf,' Rinner=',ri,
2052  & ' Router=',ro,' Width=',w,
2053  & ' H1=',h1,' Hsat=',hsat,
2054  & ' Hrev=',hrev,' Bsat=',bsat
2055 c
2056 c Now call a subroutine which will set the many parameters needed to
2057 c do this switch model.
2058 c
2059  call magparm(var_model(1,nvarl), num_var_parms(nvarl))
2060  else
2061  call print_bad_line(currline, nlines, numerr)
2062  end if
2063  else
2064  call show_end_of_file(nlines, numerr)
2065  status=1000
2066  return
2067 
2068  end if
2069 c
2070 c-----------------------------------------------------------------------
2071 c Least squares fit to some function.
2072 c
2073  else if (keyword .eq. k_lsf_model) then
2074  status = k_found
2075  ivar_type(nvarl) = lsf_model
2076  write(9,'(A,a2,A,i3)')
2077  & ' ',label2,' is a variable element in block ',nublks
2078  nsaverr = numerr
2079  call read_lsf_parms(var_model(1,nvarl),
2080  & num_var_parms(nvarl), eofflg,
2081  & nlines, numerr)
2082  if (eofflg .eq. noerr) then
2083  if (numerr .eq. nsaverr) then
2084  write(9,47) (j-1,var_model(j,nvarl),
2085  & j=1,num_var_parms(nvarl))
2086  end if
2087  else
2088  call show_end_of_file(nlines, numerr)
2089  status=1000
2090  return
2091  end if
2092 c
2093 c-----------------------------------------------------------------------
2094 c Piece-wise linear model.
2095 c
2096  else if (keyword .eq. k_pwl_model) then
2097  status = k_found
2098  ivar_type(nvarl) = pwl_model
2099  nsaverr = numerr
2100  write(9,'(A,a2,A,i3)')
2101  & ' ',label2,' is a variable element in block ',nublks
2102  call read_pwl_parms(var_model(1,nvarl),
2103  & num_var_parms(nvarl), eofflg,
2104  & nlines, numerr)
2105  if (eofflg .eq. noerr) then
2106  if (numerr .eq. nsaverr) then
2107  write(9,48) 'Indep.Var.', 'Depen.Var.',
2108  & ((j+1)/2, var_model(j,nvarl),
2109  & var_model(j+1,nvarl),
2110  & j=1,num_voltf_parms(nvoltsource)-1,2)
2111  end if
2112  else
2113  call show_end_of_file(nlines, numerr)
2114  status=1000
2115  return
2116  end if
2117 c
2118  else
2119  call print_bad_line(currline, nlines, numerr)
2120  end if
2121 
2122 
2123 c
2124 c-----------------------------------------------------------------------
2125 c Switched Variable element in the last block type.
2126 c
2127  else if (keyword .eq. k_svariable) then
2128  status = k_found
2129  last_block = iin(1,nblks,nbrns)
2130  nvarl = nvarl + 1
2131  ivar_block(nvarl) = last_block
2132  ivar_block_num(nvarl) = nublks
2133 c
2134 c Second keyword to specify which one is the variable element.
2135 c Check against block type.
2136 c
2137  keyword = field(2)(1:keyword_len)
2138 c
2139  if (last_block .eq. rcground) then
2140  if (keyword .eq. k_r1_var) then
2141  iin(2,nblks,nbrns) = r1_var
2142  else if (keyword .eq. k_c1_var) then
2143  iin(2,nblks,nbrns) = c1_var
2144  else
2145  call print_bad_line(currline, nlines, numerr)
2146  status=305
2147  return
2148  end if
2149 c
2150  else if (last_block .eq. rlseries) then
2151  if (keyword .eq. k_r2_var) then
2152  iin(2,nblks,nbrns) = r2_var
2153  else if (keyword .eq. k_l2_var) then
2154  iin(2,nblks,nbrns) = l2_var
2155  else
2156  call print_bad_line(currline, nlines, numerr)
2157  status=305
2158  return
2159  end if
2160 c
2161  else
2162  call print_bad_line(currline, nlines, numerr)
2163  status=305
2164  return
2165  end if
2166 c
2167  kelement = iin(2,nblks,nbrns)
2168  label2 = keyword(1:2)
2169 c
2170 c Third keyword for model type (lsf and pwl models not active yet).
2171 c
2172  keyword = field(3)(1:keyword_len)
2173 c
2174 c-----------------------------------------------------------------------
2175 c Exponential model of variable resistor.
2176 c
2177  if (keyword .eq. k_exp_model) then
2178  status = k_found
2179  ivar_type(nvarl) = exp_model
2180  write(9,'(A,a2,A,i3)')
2181  & ' ',label2,' is a svariable element in block ',nublks
2182  if ((kelement .ne. r1_var) .and.
2183  & (kelement .ne. r2_var) .and.
2184  & (kelement .ne. r3_var)) then
2185  write(9,'(A,a2,A)')
2186  & ' ### ERROR ### element ',label2,' may not be
2187  & used with this model.'
2188  numerr = numerr + 1
2189  end if
2190  call get_next_line(currline, field, nlines, eofflg,
2191  & max_fields)
2192  if (eofflg .eq. noerr) then
2193  call text_to_real(field(1), ropen, flag)
2194  call text_to_real(field(2), rclose, flag2)
2195  call text_to_int(field(3), iswitch, flag3)
2196  call text_to_real(field(4), tau, flag4)
2197  call text_to_real(field(5), zsw, flag5)
2198  if (flag+flag2+flag3+flag4+flag5 .eq. noerr) then
2199  num_var_parms(nvarl) = 5
2200  var_model(1,nvarl) = ropen
2201  var_model(2,nvarl) = rclose
2202  var_model(3,nvarl) = switch_time(iswitch)
2203  var_model(4,nvarl) = 1.0 / tau
2204  var_model(5,nvarl) = zsw
2205  write(9,
2206  & '(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
2207  & ' Exponential model of a resistive switch:',
2208  & ' Ropen=',ropen,' Rclose=',rclose,
2209  & ' Tswitch=',switch_time(iswitch),' Tau=',tau,
2210  & ' Zswitch=',zsw
2211  else
2212  call print_bad_line(currline, nlines, numerr)
2213  end if
2214 c
2215  else
2216  call show_end_of_file(nlines, numerr)
2217  status=1000
2218  return
2219  end if
2220 c
2221 c-----------------------------------------------------------------------
2222 c Decay or Rise model of variable resistor.
2223 c
2224  else if ((keyword .eq. k_decay_model) .or.
2225  & (keyword .eq. k_rise_model)) then
2226  status = k_found
2227  if (keyword .eq. k_decay_model) then
2228  ivar_type(nvarl) = decay_model
2229  else
2230  ivar_type(nvarl) = rise_model
2231  endif
2232 c
2233  write(9,'(A,a2,A,i3)')
2234  & ' ',label2,' is a svariable element in block ',nublks
2235  if ((kelement .ne. r1_var) .and.
2236  & (kelement .ne. r2_var) .and.
2237  & (kelement .ne. r3_var)) then
2238  write(9,'(A,a2,A)')
2239  & ' ### ERROR ### element ',label2,' may not be
2240  & used with this model.'
2241  numerr = numerr + 1
2242  end if
2243  call get_next_line(currline, field, nlines, eofflg,
2244  & max_fields)
2245 c
2246  if (eofflg .eq. noerr) then
2247  call text_to_real(field(1), ropen, flag)
2248  call text_to_real(field(2), rclose, flag2)
2249  call text_to_int(field(3), iswitch, flag3)
2250  call text_to_real(field(4), tau, flag4)
2251  if (flag+flag2+flag3+flag4 .eq. noerr) then
2252  num_var_parms(nvarl) = 4
2253  var_model(1,nvarl) = ropen
2254  var_model(2,nvarl) = rclose
2255  var_model(3,nvarl) = switch_time(iswitch)
2256  var_model(4,nvarl) = 1.0 / tau
2257  if (keyword .eq. k_decay_model) then
2258  write
2259  & (9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
2260  & ' Decay model of a resistive switch:',
2261  & ' Ropen=',ropen,' Rclose=',rclose,
2262  & ' Tswitch=',switch_time(iswitch),' Tau=',tau
2263  else
2264  write
2265  & (9,'(A/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
2266  & ' Rise model of a resistive switch:',
2267  & ' Ropen=',ropen,' Rclose=',rclose,
2268  & ' Tswitch=',switch_time(iswitch),' Tau=',tau
2269  endif
2270  else
2271  call print_bad_line(currline, nlines, numerr)
2272  end if
2273 c
2274  else
2275  call show_end_of_file(nlines, numerr)
2276  status=1000
2277  return
2278  end if
2279 c
2280  else
2281  call print_bad_line(currline, nlines, numerr)
2282  end if
2283 c
2284 c-----------------------------------------------------------------------
2285 c Set an initial voltage or current.
2286 c
2287  else if (keyword .eq. k_initial) then
2288 c
2289 c Set the keyword for voltage or current and what element.
2290 c
2291  status = k_found
2292  ninit_cond = ninit_cond + 1
2293  keyword = field(2)(1:keyword_len)
2294  if (keyword .eq. k_vcapacitor1) then
2295  iin(4,nblks,nbrns) = vcapacitor1
2296  label18 = 'Voltage on C1 = '
2297  else if (keyword .eq. k_vcapacitor3) then
2298  iin(4,nblks,nbrns) = vcapacitor3
2299  label18 = 'Voltage on C3 = '
2300  else if (keyword .eq. k_vtrline) then
2301  iin(4,nblks,nbrns) = vtrline
2302  label18 = 'Voltage on line = '
2303  else if (keyword .eq. k_cinductor) then
2304  iin(4,nblks,nbrns) = cinductor
2305  label18 = 'Current in L2 = '
2306  else if (keyword .eq. k_ctrline) then
2307  iin(4,nblks,nbrns) = ctrline
2308  label18 = 'Current in line = '
2309  else
2310  call print_bad_line(currline, nlines, numerr)
2311  status=305
2312  return
2313  end if
2314 c
2315 c Get the initial value and store it.
2316 c
2317  call text_to_real(field(3), value, flag)
2318  if (flag .eq. noerr) then
2319  value_init(ninit_cond) = value
2320  write(9,'(A,a18,1pe10.3)')
2321  & ' Initial condition: ',label18,value
2322  else
2323  call print_bad_line(currline, nlines, numerr)
2324  end if
2325 c
2326 c-----------------------------------------------------------------------
2327 c Top branch exitting this block.
2328 c
2329  else if (keyword .eq. k_topbranch) then
2330  status = k_found
2331  iin(3,nblks,nbrns) = topbranch
2332  nsecbrn = nsecbrn + 1
2333  write(9,'(A,i3,A,A,i2,A)')
2334  & ' ***** Block ',nublks,' has a top branch ',
2335  & 'exitting it (branch ',nsecbrn,') *****'
2336 c
2337 c-----------------------------------------------------------------------
2338 c End branch exitting this block.
2339 c
2340  else if (keyword .eq. k_endbranch) then
2341  status = k_found
2342  iin(3,nblks,nbrns) = endbranch
2343  nsecbrn = nsecbrn + 1
2344  write(9,'(A,i3,A,A,i2,A)')
2345  & ' ***** Block ',nublks,' has an end branch ',
2346  & 'exitting it (branch ',nsecbrn,') *****'
2347 c
2348 c-----------------------------------------------------------------------
2349  end if
2350 
2351 c the "historic" goto 305
2352 c if (0 .eq. 1) then
2353 c 305 status=305
2354 c end if
2355 C error serious enought to halt execution
2356 c if (0 .eq. 1) then
2357 c 1000 status=1000
2358 c end if
2359  return
2360  end
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS c c c c SW1 c c c158 MFI Insulator CB c c & gmax
Definition: zdemfmt.h:154
subroutine sphfoilparm(parms, nparms)
Definition: sphflprm.f:1
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K gap
Definition: zdemfmt.h:84
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS tsw
Definition: zdemfmt.h:132
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS c c & gswmax
Definition: zdemfmt.h:134
subroutine readctab(parms, nparms, eofflg, nlines, nerrors)
Definition: rdpw3prm.f:1
subroutine abdiodeparm(parms, nparms)
Definition: abdioprm.f:1
subroutine cylfoilparm(parms, nparms)
Definition: cylflprm.f:1
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS topen
Definition: zdemfmt.h:132
subroutine read_tablem(vals, num_vals, eofflg, nlines, numerr)
Definition: rdtbl.f:1
subroutine get_next_line(currline, field, nlines, eofflg, max_fields)
Definition: getnxtln.f:1
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS c c c c SW1 c c c158 MFI Insulator CB c & gmin
Definition: zdemfmt.h:153
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min radius
Definition: zdemfmt.h:84
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS c gswmin
Definition: zdemfmt.h:133
subroutine nshellparm(parms, nparms)
Definition: nshelprm.f:1
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS cursw
Definition: zdemfmt.h:132
subroutine text_to_int(text, int, flag)
Definition: txt2int.f:1
subroutine strip(text, start, end)
Definition: strpblnk.f:1
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS c c c c SW1 c c c158 MFI Insulator CB c c c & flash
Definition: zdemfmt.h:155
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS c & zflow
Definition: zdemfmt.h:133
subroutine gaspuffparm(parms, nparms)
Definition: gaspfprm.f:1
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS c c c c SW1 c c c158 MFI Insulator CB c c xni
Definition: zdemfmt.h:154
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line c
Definition: zdemfmt.h:7
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS c c c & forward
Definition: zdemfmt.h:135
subroutine decodematerial(name, diel, flag)
Definition: nam2diel.f:1
subroutine print_bad_line(currline, nlines, numerr)
Definition: prtbadln.f:1
subroutine magparm(parms, nparms)
Definition: magswprm.f:1
c *****************************************************************************c Various format statements for read_screamer_data output c To get these into made format to be characters c for each line corrected spelling errors in format added statement for Zflow Plasma Loss Model added format for CSV output type fixed more lines longer than characters added format for Measure Zflow Block and forward c reverse current directions in Zflow plasma loss c and Zflow POS models added format for SFC output type c removed from all code calls c c c c c a80 c i10 c No grids on plots c Do not write files containing the plotted points c Execute only one cycle c Do not echo the setup parameters and indicies c c &exitting c a13 c c c c c c c c102 c &described as a function of time c c c &described as a function of time c c c &function of time c c shell c &min A K c &trapped field c153 c c c Sin c c c remaining calls in rdscrelem c Tabular a10 Cond c c c &used with this model c Exponential model of a resistive c c c Rise model of a resistive c c Z FLOW POS c c c c SW1 c c c158 MFI Insulator CB dgap
Definition: zdemfmt.h:152
subroutine readscreamerelements(status)
Definition: rdscrelem.f:41
subroutine read_lsf_parms(parms, num_parms, eofflg, nlines, numerr)
Definition: rdlsfprm.f:1
subroutine text_to_real(text, rvalue, flag)
Definition: txt2real.f:1
subroutine show_end_of_file(nlines, numerr)
Definition: showeof.f:1
subroutine read_pwl_parms(parms, nparams, eofflg, nlines, numerr)
Definition: rdpwlprm.f:1