65 if (keyword .eq. k_branch)
then
81 &
' ',
'************ Branch ',nbrns,
' ************'
92 else if (keyword .eq. k_transline)
then
98 ntransline = ntransline + 1
99 iin(1,nblks,nbrns) = transline
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'
120 call
strip(field(6), istart6, iend6)
121 if (istart6 .ne. notext)
then
127 call
strip(field(5), istart5, iend5)
128 if (istart5 .ne. notext)
then
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
140 & (9,
'(A,i3,A,a13/A,1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
142 &
' : Transmission line with impedance varying ',
143 & trllabel,
' Tau=',tau,
' Zin=',zin,
144 &
' Zout=',zout,
' Tres=',tresline
154 else if (keyword .eq. k_mitline)
then
160 nmitline = nmitline + 1
161 iin(1,nblks,nbrns) = mitline
169 call
strip(field(6), istart6, iend6)
170 if (istart6 .ne. notext)
then
172 call
strip(field(7), istart7, iend7)
173 if (istart7 .ne. notext)
then
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
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
210 else if (keyword .eq. k_pmitline)
then
216 nmitline = nmitline + 1
217 iin(1,nblks,nbrns) = pmitline
224 call
strip(field(5), istart5, iend5)
225 if (istart5 .ne. notext)
then
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
248 else if (keyword .eq. k_rcground)
then
254 iin(1,nblks,nbrns) = rcground
259 call
strip(field(3), istart3, iend3)
260 if (istart3 .ne. notext)
then
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
285 else if (keyword .eq. k_rlseries)
then
291 iin(1,nblks,nbrns) = rlseries
296 call
strip(field(3), istart3, iend3)
297 if (istart3 .ne. notext)
then
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
321 else if (keyword .eq. k_pisection)
then
327 iin(1,nblks,nbrns) = pisection
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
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
355 else if (keyword .eq. k_adder)
then
361 iin(1,nblks,nbrns) = adder
363 &
' Block ',nublks,
' : adder block.'
368 else if (keyword .eq. k_transformer)
then
372 lcirblk = transformer
373 lastblk = transformer
374 iin(1,nblks,nbrns) = transformer
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,
393 else if (keyword .eq. k_measurezflow)
then
397 lcirblk = measurezflow
398 lastblk = measurezflow
399 iin(1,nblks,nbrns) = measurezflow
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
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
422 else if (keyword .eq. k_cylfoilblock)
then
426 lcirblk = cylfoilblock
427 lastblk = cylfoilblock
428 iin(1,nblks,nbrns) = cylfoilblock
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
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
455 call
cylfoilparm(var_model(1,nvarl), num_var_parms(nvarl))
464 else if (keyword .eq. k_nshellblock)
then
468 lcirblk = nshellblock
469 lastblk = nshellblock
470 iin(1,nblks,nbrns) = nshellblock
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
481 call
strip(field(5), istart5, iend5)
482 if (istart5 .ne. notext)
then
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
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
512 if (numerr .eq. nsaverr)
then
513 write(9,48)
'Radius ',
'Mass ',
514 & ((j+1)/2, shellparms(j),
523 numshells = nparams/2
525 shellradius((nx+1)/2)=shellparms(nx)
526 shellmass((nx+1)/2)=shellparms(nx+1)
529 if (shellradius(nx).lt.shellradius(nx+1))
then
530 write(9,
'(A)')
'Shell radii not in correct sequence'
540 call
nshellparm(var_model(1,nvarl), num_var_parms(nvarl))
550 else if (keyword .eq. k_sphfoilblock)
then
554 lcirblk = sphfoilblock
555 lastblk = sphfoilblock
556 iin(1,nblks,nbrns) = sphfoilblock
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
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
583 call
sphfoilparm(var_model(1,nvarl), num_var_parms(nvarl))
594 else if (keyword .eq. k_gaspuffblock)
then
598 lcirblk = gaspuffblock
599 lastblk = gaspuffblock
600 iin(1,nblks,nbrns) = gaspuffblock
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
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
633 call
gaspuffparm(var_model(1,nvarl), num_var_parms(nvarl))
643 else if ((keyword .eq. k_voltsource) .or.
644 & (keyword .eq. k_vendsource))
then
648 nvoltsource = nvoltsource + 1
649 if (keyword .eq. k_vendsource)
then
652 iin(1,nblks,nbrns) = vendsource
653 ivbranch_end(nbrns) = nvoltsource
657 iin(1,nblks,nbrns) = voltsource
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
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
686 keyword = field(2)(1:keyword_len)
688 if (keyword .eq. k_sinsquared)
then
690 ivoltf(nvoltsource) = sinsquared
693 if (eofflg .eq. noerr)
then
696 call
strip(field(3), istart3, iend3)
697 if (istart3 .ne. notext)
then
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,
721 else if (keyword .eq. k_sinfun)
then
723 ivoltf(nvoltsource) = sinfun
726 if (eofflg .eq. noerr)
then
729 call
strip(field(3), istart3, iend3)
730 if (istart3 .ne. notext)
then
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)')
743 &
' Magnitude=',vmax,
' Period=',tp,
754 else if (keyword .eq. k_leastsquares)
then
756 ivoltf(nvoltsource) = leastsquares
759 & num_voltf_parms(nvoltsource), eofflg,
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))
772 else if (keyword .eq. k_piecewiselinear)
then
774 ivoltf(nvoltsource) = piecewiselinear
777 & num_voltf_parms(nvoltsource), eofflg,
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)
792 else if (keyword .eq. k_table)
then
794 ivoltf(nvoltsource) = table
797 & num_voltf_parms(nvoltsource), eofflg,
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)
824 else if ((keyword .eq. k_currsource) .or.
825 & (keyword .eq. k_cendsource))
then
829 ncurrsource = ncurrsource + 1
830 if (keyword .eq. k_cendsource)
then
831 itypcend(ncurrsource) = cendsource
834 iin(1,nblks,nbrns) = cendsource
835 icbranch_end(nbrns) = ncurrsource
836 else if (keyword .eq. k_currsource)
then
839 iin(1,nblks,nbrns) = currsource
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.',
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.',
869 keyword = field(2)(1:keyword_len)
871 if (keyword .eq. k_sinsquared)
then
873 icurrf(ncurrsource) = sinsquared
876 if (eofflg .eq. noerr)
then
879 call
strip(field(3), istart3, iend3)
880 if (istart3 .ne. notext)
then
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,
904 else if (keyword .eq. k_sinfun)
then
906 icurrf(ncurrsource) = sinfun
909 if (eofflg .eq. noerr)
then
912 call
strip(field(3), istart3, iend3)
913 if (istart3 .ne. notext)
then
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)')
926 &
' Magnitude=',cmax,
' Period=',tp,
937 else if (keyword .eq. k_leastsquares)
then
939 icurrf(ncurrsource) = leastsquares
942 & num_currf_parms(ncurrsource), eofflg,
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))
955 else if (keyword .eq. k_piecewiselinear)
then
957 icurrf(ncurrsource) = piecewiselinear
960 & num_currf_parms(ncurrsource), eofflg,
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)
975 else if (keyword .eq. k_table)
then
977 icurrf(ncurrsource) = table
980 & num_currf_parms(ncurrsource), eofflg,
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)
1003 else if (keyword .eq. k_csclsource)
then
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
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.',
1034 call
readctab(currf_parms(1,ncurrsource),
1035 & num_currf_parms(ncurrsource), eofflg,
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)
1059 else if (keyword .eq. k_variable)
then
1061 last_block = iin(1,nblks,nbrns)
1063 ivar_block(nvarl) = last_block
1064 ivar_block_num(nvarl) = nublks
1069 keyword = field(2)(1:keyword_len)
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
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
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
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
1129 kelement = iin(2,nblks,nbrns)
1130 label2 = keyword(1:2)
1134 keyword = field(3)(1:keyword_len)
1140 if (keyword .eq. k_user_model)
then
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.'
1147 elseif (keyword .eq. k_user1_model)
then
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.'
1154 elseif (keyword .eq. k_user2_model)
then
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.'
1161 elseif (keyword .eq. k_user3_model)
then
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.'
1168 elseif (keyword .eq. k_user4_model)
then
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.'
1179 else if (keyword .eq. k_tab_model)
then
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
1191 &
' ### ERROR ### element ',label2,
' may not be
1192 & used with this model.'
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)
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)
1224 else if (keyword .eq. k_exp_model)
then
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
1233 &
' ### ERROR ### element ',label2,
' may not be
1234 & used with this model.'
1239 if (eofflg .eq. noerr)
then
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
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,
1271 else if ((keyword .eq. k_decay_model) .or.
1272 & (keyword .eq. k_rise_model))
then
1275 if (keyword .eq. k_decay_model)
then
1276 ivar_type(nvarl) = decay_model
1278 ivar_type(nvarl) = rise_model
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
1287 &
' ### ERROR ### element ',label2,
' may not be
1288 & used with this model.'
1294 if (eofflg .eq. noerr)
then
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
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
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
1332 else if ((keyword .eq. k_ps1_model) .or.
1333 & (keyword .eq. k_ps2_model))
then
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
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
1345 &
' ### ERROR ### element ',label2,
' may not be
1346 & used with this model.'
1351 if (eofflg .eq. noerr)
then
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)')
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
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)')
1381 &
' Qswitch=',qsw,
' Constant=',const,
1382 &
' Rmax=',rmax,
' Rmin=',rmin
1400 else if (keyword .eq. k_pos_model)
then
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
1408 &
' ### ERROR ### element ',label2,
' may not be
1409 & used with this model.'
1414 if (eofflg .eq. noerr)
then
1422 call
strip(field(8), istart8, iend8)
1423 if (istart8 .ne. notext)
then
1430 if (flag+flag2+flag3+flag4+flag5+flag6+flag7+flag8
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
1441 var_model(9,nvarl) = 0.0
1442 var_model(10,nvarl) = 0.0
1443 var_model(11,nvarl) = 0.0
1444 var_model(12,nvarl) = 0.0
1445 var_model(13,nvarl) = 0.0
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,
1452 &
' CBflag=',cbflag,
' forward = ',
forward
1469 else if (keyword .eq. k_zflow_model)
then
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
1476 &
' ### ERROR ### element ',label2,
' may not be
1477 & used with this model.'
1482 if (eofflg .eq. noerr)
then
1489 call
strip(field(7), istart7, iend7)
1490 if (istart7 .ne. notext)
then
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
1505 var_model(7,nvarl) =
gmin
1506 var_model(8,nvarl) = 0.0
1507 var_model(9,nvarl) = 0.0
1508 var_model(10,nvarl) =
xni
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 :',
1519 if ((
gap.le.0.0).or.(
radius.le.0.0).or.(
xni.le.0.0))
then
1521 &
'gap, radius, or number of parallel lines ',
1522 &
'less than or equal zero <<<<<<<<<<<<<<<<<<<<<<<<<<<'
1537 else if (keyword .eq. k_mfi_model)
then
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
1545 &
' ### ERROR ### element ',label2,
' may not be
1546 & used with this model.'
1551 if (eofflg .eq. noerr)
then
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
1568 var_model(8,nvarl) = 0.0
1569 var_model(9,nvarl) = 0.0
1570 var_model(10,nvarl) = 0.0
1571 var_model(11,nvarl) = 0.0
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 :',
1593 else if (keyword .eq. k_rwall_model)
then
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
1600 &
' ### ERROR ### element ',label2,
' may not be
1601 & used with this model.'
1606 if (eofflg .eq. noerr)
then
1615 if (eofflg .eq. noerr)
then
1626 if(flag+flag2+flag3+flag4+flag5+flag6+flag7+flag8+flag9+flag10
1628 num_var_parms(nvarl) = 8
1630 if(disk1in.le.0.0)disk1in=1000.
1632 if(disk1out.lt.disk1in)disk1out=disk1in
1633 if(disk2in.le.0.0)disk2in=1000.
1635 if(disk2out.lt.disk2in)disk2out=disk2in
1636 if(cyl_r_1.le.0.0)
then
1640 if(cyl_r_2.le.0.0)
then
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
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
1684 else if (keyword .eq. k_r2wall_model)
then
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
1691 &
' ### ERROR ### element ',label2,
' may not be
1692 & used with this model.'
1698 if (eofflg .eq. noerr)
then
1706 if (eofflg .eq. noerr)
then
1719 if(flag+flag2+flag3+flag4+flag5+flag6+flag7+flag8+flag9
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
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 :',
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
1756 else if (keyword .eq. k_zmip_model)
then
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
1764 &
' ### ERROR ### element ',label2,
' may not be
1765 & used with this model.'
1770 if (eofflg .eq. noerr)
then
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,
1803 &
' massnum =',massnum,
' numden =',numden,
1804 &
' econst =',econst,
' ibigpo =',ibigpo
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
1828 ivar_type(nvarl) = sw_model
1830 write(9,
'(A,a2,A,i3)')
1831 &
' ',label2,
' is a variable element in block ',nublks
1832 if (kelement .ne. r2_var)
then
1834 &
' ### ERROR ### element ',label2,
' may not be
1835 & used with this model.'
1840 if (eofflg .eq. noerr)
then
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
1857 write(9,
'(A/A,a3,A,1pe10.3,A,
1858 & 1pe10.3,A,1pe10.3,A,1pe10.3,A,1pe10.3)')
1860 &
' DIEL1=',material,
' TBD1=',tbd1,
1861 &
' DM1=',dm1,
' ATM1=',atm1,
1862 &
' XSW1=',xsw1,
' XCH1=',xch1
1876 else if (keyword .eq. k_diode_model)
then
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
1884 &
' ### ERROR ### element ',label2,
' may not be
1885 & used with this model.'
1890 if (eofflg .eq. noerr)
then
1902 if (pmass_ratio .eq. 0.0)
then
1906 if (flag+flag2+flag3+flag4+flag5+flag6+flag7 .eq. noerr)
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
1937 else if (keyword .eq. k_abdiode_model)
then
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
1945 &
' ### ERROR ### element ',label2,
' may not be
1946 & used with this model.'
1951 if (eofflg .eq. noerr)
then
1961 call
strip(field(10), istart10, iend10)
1962 if (istart10 .ne. notext)
then
1965 ratemax = abdratemax
1968 if ( flag +flag2+flag3+flag4+flag5
1969 & +flag6+flag7+flag8+flag9+flag10
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)
1979 var_model(8,nvarl) = 1.0 / (rmax + 1.0e-20)
1980 var_model(9,nvarl) = frac
1981 var_model(10,nvarl) = ratemax
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
1996 & (var_model(1,nvarl), num_var_parms(nvarl))
2010 else if (keyword .eq. k_magsw_model)
then
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
2017 &
' ### ERROR ### element ',label2,
' may not be
2018 & used with this model.'
2023 if (eofflg .eq. noerr)
then
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
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
2059 call
magparm(var_model(1,nvarl), num_var_parms(nvarl))
2073 else if (keyword .eq. k_lsf_model)
then
2075 ivar_type(nvarl) = lsf_model
2076 write(9,
'(A,a2,A,i3)')
2077 &
' ',label2,
' is a variable element in block ',nublks
2080 & num_var_parms(nvarl), eofflg,
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))
2096 else if (keyword .eq. k_pwl_model)
then
2098 ivar_type(nvarl) = pwl_model
2100 write(9,
'(A,a2,A,i3)')
2101 &
' ',label2,
' is a variable element in block ',nublks
2103 & num_var_parms(nvarl), eofflg,
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)
2127 else if (keyword .eq. k_svariable)
then
2129 last_block = iin(1,nblks,nbrns)
2131 ivar_block(nvarl) = last_block
2132 ivar_block_num(nvarl) = nublks
2137 keyword = field(2)(1:keyword_len)
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
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
2167 kelement = iin(2,nblks,nbrns)
2168 label2 = keyword(1:2)
2172 keyword = field(3)(1:keyword_len)
2177 if (keyword .eq. k_exp_model)
then
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
2186 &
' ### ERROR ### element ',label2,
' may not be
2187 & used with this model.'
2192 if (eofflg .eq. noerr)
then
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
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,
2224 else if ((keyword .eq. k_decay_model) .or.
2225 & (keyword .eq. k_rise_model))
then
2227 if (keyword .eq. k_decay_model)
then
2228 ivar_type(nvarl) = decay_model
2230 ivar_type(nvarl) = rise_model
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
2239 &
' ### ERROR ### element ',label2,
' may not be
2240 & used with this model.'
2246 if (eofflg .eq. noerr)
then
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
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
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
2287 else if (keyword .eq. k_initial)
then
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 = '
2318 if (flag .eq. noerr)
then
2319 value_init(ninit_cond) = value
2320 write(9,
'(A,a18,1pe10.3)')
2321 &
' Initial condition: ',label18,value
2329 else if (keyword .eq. k_topbranch)
then
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,
') *****'
2340 else if (keyword .eq. k_endbranch)
then
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,
') *****'
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
subroutine sphfoilparm(parms, nparms)
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
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
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
subroutine readctab(parms, nparms, eofflg, nlines, nerrors)
subroutine abdiodeparm(parms, nparms)
subroutine cylfoilparm(parms, nparms)
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
subroutine read_tablem(vals, num_vals, eofflg, nlines, numerr)
subroutine get_next_line(currline, field, nlines, eofflg, max_fields)
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
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
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
subroutine nshellparm(parms, nparms)
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
subroutine text_to_int(text, int, flag)
subroutine strip(text, start, 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 c & flash
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
subroutine gaspuffparm(parms, nparms)
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
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
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
subroutine decodematerial(name, diel, flag)
subroutine print_bad_line(currline, nlines, numerr)
subroutine magparm(parms, nparms)
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
subroutine readscreamerelements(status)
subroutine read_lsf_parms(parms, num_parms, eofflg, nlines, numerr)
subroutine text_to_real(text, rvalue, flag)
subroutine show_end_of_file(nlines, numerr)
subroutine read_pwl_parms(parms, nparams, eofflg, nlines, numerr)