forked from rwharvey/cql3d
-
Notifications
You must be signed in to change notification settings - Fork 2
/
cqlinput_help_to_160602
4118 lines (4112 loc) · 190 KB
/
cqlinput_help_to_160602
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
********************************************************************
** This help file, along with the CQL3D code, is copyrighted under
** the GNU-GPL free-software license, as described below, and at
** the beginning of the a_cqlp.f CQL3D source.
********************************************************************
**
**
** TO RUN CQL3D SET NAMELIST AS DIRECTED BELOW
** AND
** NAME THIS FILE cqlinput
** 2011-2-18
**
** Several namelist groups are defined: setup0, setup, sousetup,
** rfsetup, trsetup, frsetup,....
**
********************************************************************
**
** Character data input is generally limited to character*8,
** unless otherwise stated.
**
**************************************************************
**
** This cqlinput_help file documents the namelist input variables.
**
** A reference describing the general problem solved along
** with some illustrative results is:
** "The CQL3D Fokker-Planck Code", R.W. Harvey and M.G. McCoy,
** appearing in Proceedings of the IAEA TCM on Advances in
** Simulation and Modeling of Thermonuclear Plasmas, Montreal,
** 1992, p. 489-526, IAEA, Vienna (1993); available from U.S.
** Dept. of Commerce, National Technical Information Service,
** Document DE93002962.
** The two dimensional (2-velocity) precedent to the code
** is CQL: G.D. Kerbel and M.G. McCoy, Phys. Fluids 28, 3629
** (1985).
** See also, file: code_overviews_cql3d_genray
**
**************************************************************
**
** NAMELIST &setup0 SECTION
**
** The namelist group "setup" occurs in the cqlinput file twice.
** [Now deprecated: works, but use &setup0. See below BH070414.]
** The first instance of the "setup" [now setup0] section of the
** cqlinput namelist file contains the following variables (which
** should not be repeated in the second instance of "setup"):
**
** mnemonic, ioutput, iuser, ibox, noplots,lnwidth,nmlstout,
** special_calls,cqlpmod,lrz,lrzdiff,lrzmax,lrindx,
** ls,lsmax,lsdiff,lsindx,nlwritf,nlrestrt,
**
** BH070414: Above use of "setup" as a "first setup namelist"
** is depracated. PLACE above variables in
** separated namelist &setup0.
** [Modification for SWIM Integrated Plasma Simulator.]
**
** Descriptions follow immediately below.
**
*************************************************************
**
** mnemonic is the run designator...to help keep track of runs.
** for example: mnemonic="wy01"
** mnemonic is dimensioned a48,
** i.e., ok for up to 48 characters.
** Used as prefix to output PS and netCDF files.
** default: mnemonic="mnemonic"
**
** ioutput determines graphical o/p (PS only at moment, so no effect.)
**
** iuser ="name" of user or "number" of user (no present use).
**
** ibox="box ***" where *** is user's box number (no present use).
**
** Parameters are set in param.h giving maximum dimensions
** of variables used in the code. The code may be run
** with dimensions which are less than the input parameters,
** as specified below by namelist variables lrz, lrzmax,
** ls, lsmax, (and others,) as specified below.
**
** The parameter machinea specifies the size of integer words:
** (=1, for 8 byte integers, =2, for 4 byte integers).
**
** lrz is the number of radial flux surfaces in the computational
** grid on which Fokker-Planck equation is solved.
**
** lrzdiff="enabled", compute distribution functions on subset
** of the flux surfaces considered.
** This system was setup to reduce computational time, when
** only interested in few of the FP surfaces, but want to specify
** the radial profile of background species on a more refined lrzmax
** grid. (default="disabled")
**
** lrzmax is number of flux surfaces, including any not FP'd.
** lrzmax=1, then this gives single flux surface runs with no input
** of profiles
** lrzmax.ge.4 uses input profiles of density, etc.
** (lrzmax=2,3 to be avoided, and problems with some cubic splines.)
** lrzmax is set =lrz, if lrzdiff.ne."enabled"
**
** lrindx(1:lrz)=indices of flux surfaces where the FP'ing is
** performed.
** (if lrz=lrzmax, i.e., all flux surfaces are to be FP'ed,
** then it is unnecessary to specify lrzmax, lrindx, and lrzdiff).
**
** noplots="enabled1" inhibits all plots.
** default: noplots="disabled"
** [="enabled" inhibits old unimplemented graflib plots, and was
** necessary for code to run, but now all old graflib replaced.
** so it should have same effect as "disabled", BH and YuP, 120122]
** noplots="enabled1" can be useful to load the code without
** a pgplot library.
** The -Wl,-noinhibit-exec gnu loader (ld) option exists in gfortran
** which enables loading of the code in the presence of unsatisfied
** externals. With noplots='enabled', the references to pgplot
** routines in the code will be avoided. Similar options exist
** for several other compiler groups.
**
** lnwidth=line-width attribute for plotting; affects lines, graph
** markers, and text. Specified in units of 0.005 in, and
** must be an integer. [default=3]
** [Smaller value may work better for vector plots.]
** Conversion from .ps to .pdf using ps2pdf improves the plot.
**
**
** nmlstout="enabled", prints namelists to stdout
** "trnscrib", transcribes the cqlinput nml file to stdout
** else, suppress this output.
** default: nmlstout="trnscrib"
**
** special_calls="enabled", then code makes system calls to find
** name of system and pwd, for output. This is not
** allowed on some systems.
** ="external", then files uname_output and pwd_output
** are used to printout. These many be created with
** and external script containing
** uname -a > uname_output
** pwd > pwd_output
** ="disabled", then no system calls and not reference
** to uname_output and pwd_output files.
** This gets around lack of some special functions,
* e.g., second(), with some compilers.
**
** nlwritf="enabled" saves the distribution function at the end of
** the run (in file distrfunc). default="disabled"
** ="ncdfdist", don't write distn function into text file
** distrfunc, since can use mnemonic.nc save of f.
** Text distrfunc will contain only namelist and profiles
** at the end of the run.
** nlrestrt="enabled" reads the initial distribution function in
** text file 'distrfunc'. default="disabled"
** ="ncdfdist" reads the distribution function from a
** netcdf file, 'distrfunc.nc'. This file can be
** the mnemonic.nc file from a previous run.
** The text file 'distrfunc' is still needed, but only for
** reading namelist from &setup and others (except %setup0),
** ensuring compatibility of grids, etc. (Can change
** mnemonic in &setup0.)
** Reading of distrfunc for nlrestrt='ncdfdist' or
** 'ncregrid' discontinued (BH110201).
** ='ncregrid', same as 'ncdfdist', except the momentum-per-
** mass grid can be reset from that used in distrfunc.nc,
** by changing enorm, jx and xfac (only enabled changes
** presently, not iy or lrz) in cqlinput. If enorm/vnorm
** is increased, the distrn for distrfunc.nc is extrapolated
** linearly in ln(f) versus v(mom-per-mass). Portions of the
** distn fnctn in distrfunc.nc within the bounds of the
** new x() grid specified by the namelist input are
** interpolated onto the new grid. The FSA density of the
** new code distribution is maintained equal to the
** restart distribution function in the .nc file.
** enorm/vnorm can be either increased or decreased from
** the value in the distrfunc.nc file.
** Reading of distrfunc text file for nlrestrt='ncdfdist' or
** 'ncregrid' discontinued (BH110201).
**
************************************************************************
** BH070414: Variables nlwritf and nlrestrt have been changed from **
** logical to character*8. Check if old NL needs adjusting.**
************************************************************************
**
** This namelist section also contains:
** cqlpmod,ls,lsmax,lsdiff,lsindx,nlwritf,nlrestrt,
** lrz=1,lrzdiff,lrindx, used for CQLP run (see below).
**
**
**
**************************************************************
**
** NAMELIST &setup SECTION
**
**************************************************************
**
** MAJOR TIME STEP CONTROLS
** (The following variables down to the "sousetup" namelist
** description , are in "setup" namelist.)
**
*************************************************************
**
** dtr is the time step in seconds.
** (n is time step counter. Initially n=0. It is incremented after
** each step).
** dtr can be nonphysically large for implicit steady state
** calculations, with transp="disabled":
** dtr= 1. --> 10. is a typical choice if implct="enabled".
** This allows code to "jump" to steady state (for linear problems).
** transp="enabled"/soln_method='direct' cases will require dtr
** values less than or of order the collision time of the nonthermal
** particles, to get accurate results, to prevent oscillations
** between the velocity and radial space solutions.
** default: dtr=5.
**
** dtr1(1:10) is array of additional time step settings
** (can be shorter or longer than dtr) starting
** at time step nondtr1(1:10), if nondtr1().gt.-1. (default: dtr1()=0.0)
**
** nondtr1(1:10) is array of steps at which the corresponding new
** time step dtr1(1:10) starts.
** Choose mod(nondtr1().gt.0,nrstrt)=0, else it is reset to next
** highest value. (default: nondtr1(1:10)=-1).
**
** nstop is the number of time steps (or cycles) to be run.
** default: nstop=5
**
** nrstrt is the number of cycles to advance on a flux
** surface before moving on to the next flux surface.
** Operant only if lrz > 1
** default: nrstrt=1
** BH100517: Defunct functionality. Only possibility is
** default case, nrstrt=1.
**
** nplot(1:nplota) gives time steps for plotting of data for
** individual flux surfaces.
** default: nplot(1:nplota)=0
**
** iactst="enabled" means certain debugging diagnostics are called:
** subroutines diagimpd, exsweepx, and exsweept are utilized.
** This option should be used only in debugging mode.
** iactst="abort" means abort the code if the computed
** error is .gt. 1.e-8 (relative difference between integrated
** rhs and lhs of difference equation).
** default: "disabled"
**
**************************************************************
**
** MESH CONTROLS
**
**************************************************************
**
** jx is the number speed mesh points.
** Speed also means momentum/rest mass for relativistic calcs.
** default: jx=300 (in aindflt.f).
** The basic speed mesh runs from 0. to xmax=1.0.
**
** iy is the number of theta mesh points. Must be even number.
** default: iy=200 (in aindflt.f).
** The y (theta) mesh is symmetric about pi/2.
** For urfmod="enabled", iy.gt.255 not allowed with
** the storage scheme for ilim1,ilim2,....[BH070418: relaxed now?]
** (Have had difficulty constructing a mesh iy as small as 30,
** and meshy.eq."fixed_y".)
** The positive theta dirn (i.e., v_parallel) has positive component
** in the positive toroidal direction (counter-clockwise, looking
** from the top).
**
** lz is the number of poloidal (or field line mesh points). Bounce-
** averages are computed over this mesh. lz must be .le. lza
** (a parameter).
** default: lz=lza (lza is a parameter)
**
** vnorm is the velocity normalization constant (cm/sec).
** For relativistic calculations, vnorm is the maximum momentum/unit
** rest mass on the mesh.
** default: vnorm is set through enorm (below).
**
** enorm is the energy corresponding to the velocity normalization
** constant; if kenorm corresponds to a species index, that
** species determines vnorm through enorm, superseding vnorm. (kev)
** default: enorm=200., kenorm=1
**
** tandem="enabled" facilitates the use of both ions and electrons
** as general species. The mesh extends to a speed (momentum)
** represented by an electron energy of enorme. However, the
** majority of the mesh points are dedicated to a region of
** velocity space which adequately represents ions with a
** energy less than enormi. The ion species selected for this
** treatment is the first general ion species listed. Most
** of the plots are fixed so that the ion contributions are visible
** and not squeezed into the first 1% of the plot.
** tandem="disabled" disengages this option.
** default: tandem="disabled"
**
** enorme,enormi are analogues to enorm for tandem="enabled"
** enorme corresponds to the top of the electron mesh,
** enormi corresponds to the top of the ion mesh.
** [defaults: enorme=enorm, enormi=enorm]
**
** relativ="enabled" means the quasi-relativistic calculation and
** mesh are activated. Best for fusion plasmas.
** ="fully" give fully relativistic calc. Has some limitations
** in maximum order Legendre polynomial to be used in
** expansion for FP coefficients (mx, below, .le.3, or so).
** See CompX report CompX-2009-1_Fully-Rel.pdf.
** default: relativ="enabled"
**
** xfac is the velocity mesh spacing parameter.
** xfac=1. ==> uniform mesh;
** xfac<1. ==> geometric mesh with greater mesh resolution at x=0;
** xfac>1. ==> greater resolution at xmax.
** xfac<0. ==> xpctlwr,xpctmdl,xlwr,xmdl must be input.
** xfac<0. ==> the momentum (velocity) mesh contains three regions:
** The region [0,xlwr] will have jx*xpctlwr evenly spaced
** mesh points.
** The region [xlwr,xmdl] will have xpctmdl*jx mesh points.
** The region [xmdl,xmax] will have the balance of the jx
** mesh points.
** default: xfac=1.
** (xfac,xpctlwr,xlwr,xpctmdl,xmdl are reset appropriately, if
** tandem="enabled").
**
** tfac is the theta mesh spacing parameter.
** tfac=1 ==> uniform mesh except in the vicinity of the
** pass/trapped boundary region. See tbnd below.
** tfac<1. ==> geometric mesh with points packed closer at p/t bndry.
** tfac>1. ==> geometric mesh with points packed closer 0., pi,
** and pi/2.
** default: tfac=1.
** tfac=-1. ==>Appropriate for radial transport, transp="enabled"
** calculations. This will give uniform theta mesh at each
** radius. There will be slight adjustments near t-p bndry
** at each radius, but no addition of extra points bounding the
** trapped-passing boundary, as for tfac.gt.0. case.
** If tfac.gt.0. and transp="enabled" and soln_method.ne."direct"
** then tfac is reset to -1. at beginning of run.
**
** If tfac negative and .ne.-1, then mesh adjusted according to
** positive tfac above, with abs(tfac) values. No added pts near t-p.
** There is also a tfac.lt.0./cqlpmod="enabled" option (see below).
**
** yreset="enabled" means pack extra theta mesh points in some
** specified (below) region.
** default:yreset="disabled"
** [Not working at present, and if "enabled" will be reset to
** "disabled" in ainsetva.f, for lrz>1.]
**
** numby is the number of packed theta mesh points
** numby should be significantly less than iy/2 (or resolution
** will be to coarse in the rest of pitch angle space).
** Recall that the y (theta) mesh is symmetric about pi/2.
** Only used if yreset="enabled".
** default: numby=20
**
** ylower and yupper specify the radian spread of the packed region
** below pi/2. Avoid allowing [ylower,yupper] to include the p/t
** boundary region [y(itl-1),y(itl+1)].
** This option is automatically disabled if lrz > 1.
** Only used if yreset="enabled".
**
** tfacz is the field line coordinate (z) mesh spacing parameter.
** default: tfacz=1.
** tfacz is not operational for eqsym="none", in which case the z-mesh
** is uniform on either side of the max-|B| point on the flux surface.
**
** tbnd(1:lrorsa) is the width (in radians) of the passing/trapped boundary
** layer. There is usually no reason to change the default value.
** If necessary the program may reset this value at some
** flux surfaces.
** default: tbnd=.002, tbnd(2:lrorsa)=0.
**
** rfacz is the radial mesh spacing parameter. The minimum value of
** the mesh can be pre-specified (see roveram below). Otherwise
** rfacz works like xfac for xfac > 0.
** default:rfacz=.7
**
** roveram determines the value of r/radmin = rya(1) by setting
** rya(1)=roveram. It works in conjunction with
** rfacz above. If roveram < 1.e-8, the minimum flux surface is
** determined internally with no user control. This option is
** useful for keeping the innermost flux surface away from the
** magnetic axis.
** default: roveram=1.e-8
**
** rzset="enabled" allows the user to specify the entire radial
** rya mesh as an array of values r(l)/radmin where r(l) is the
** radial coordinate and radmin in this case takes on
** the meaning of the radial coodinate at the LCFS.
** ="disabled", mesh follows rfacz directive, above.
** default: rzset="disabled"
**
** rya(l),l=1,lrzmax is the normalized radial mesh referred to above in
** the rzset description. The user specifies rya(1)=.02, rya(2)=.05,...
** rya(23)=.95, for instance, if lrzmax=23
** Thus rya(l)=r(l)/radmin, and rya is a code array.
** (Note: rya is dimensioned rya(0:lrza+1), so need to specify
** first namelist input value explicitly as rya(1)=....).
**
** radcoord="sqtorflx" (default) use normalized radial coordinate (that is,
** flux surface label) proportional to sqrt of toroidal flux.
** [Presently, radial diffusion eqn is only set up for this value
** of radcoord. Additional choices below are for no radial
** transport.]
** ="sqarea" square root of flux surface area,
** ="sqvolume" square root of flux surface volume,
** ="rminmax" 0.5*(max. major radius -
** min. major radius) of flux surface
** "polflx" normalized poloidal flux from magnetic
** axis to last closed flux surface (LCFS).
** "sqpolflx" normalized square root of poloidal flux function.
**
*********************************************************
**
** DIFFERENCING and SOLUTION METHOD CONTROLS
**
*************************************************************
**
** chang= "enabled" forces Chang Cooper differencing; = "disabled" forces
** standard centered differencing. chang="noneg" employs an additional
** scheme to minimize resulting negative distributions in strongly
** driven RF fields. Actually, we employ a variant of strict Chang-
** Cooper differencing. Typical Chang-
** Cooper looks at dx*A/B where A is the advective coefficient and
** B the diffusive. The closer the ratio is to zero, the closer the
** differencing is to central. As the ratio grows larger in absolute
** value, the differencing shifts to upwind. We have
** empirically determined that in the presence of strong RF excitation
** that even with the use of Chang-Cooper, the distribution can
** be driven negative. This may be due to a 2-D effect, since the
** RF diffusion characteristics rarely coincide with the theta and v
** mesh directions. It was discovered that by subtracting off the
** contribution from the RF diffusion from the total diffusion
** coefficient and then computing the ratio above, the scheme is
** driven in the upwind direction and the problem is vastly
** ameliorated, in most cases, the difficulties disappear. The
** ratio is now dx*A*B/(B-B_ql)**2 for the
** velocity differencing. In the limit B_ql==>0, we recover
** Chang-Cooper. For the theta differencing, the approach
** is similar, except that if chang="noneg", strict one sided
** differencing is enforced in the regions where the distribution has been
** previously driven negative (during earlier time-steps). All
** of this manipulation is a result of experimentation and
** has not been proven to be useful rigorously....as indeed
** neither has Chang Cooper for the 2D problem.
** default: chang="enabled"
**
** ineg="enabled" means negative values of the distribution function
** are reset to zero after time advancement; ="disabled"
** defeats this option. But, see update below 03-2011 comment.
** default: ineg="enabled"
** ="renorm" means if f developes negative values after a time
** step, then add 1.1*abs(min(f)) to f, and then multiply by
** (old_line_density/new_line_density), to keep total number
** of particles constant during this renormalization. This option
** is an attempt to deal with negative distributions sometimes
** occurring with QL diffusion. It can add unacceptable amounts of
** high energy particles to the distribution. (BobH, sept/94)
** ="trunc_d" is another attempt to cope with QL diffusion causing
** negative distributions: the QL diffusion coefficients are
** smoothly reduced to zero over the last 10 velocity grid points.
** Also, negative values of f reset to zero.
**
** Modification made after [03-2011] to ineg="enabled" or "trunc_d":
** (See diagimpd.f)
** If distr.function f(i,j) is negative or zero
** at some (i,j)-point in vel. space,
** it is set to zero for ALL jj.ge.j
** (and fixed i-index of pitch angle),
** for energies greater than the maximum in the source term
** (for example from NBI). For lower energies, neg f is set = 0.
** Before this modification, it was set to zero
** for only this specific (i,j)-point where f(i,j)<0.
** So, no more "islands" in distribution function
** remaining beyond such (i,j)-points, except when they are
** caused by sources like NBI.
** ="enabled1" as in ineg="enabled" [after 03-2011], except
** f is zeroed at each pitch angle i for all j above the
** first velocity where f(i,j)/f(1,1).lt.1.e-20. This removes
** spikes in the tail distribution resulting from (NBI) sources
** injected within prompt-loss regions (e.g., lossmode(1)='simplban'
** which may create problems for nonthermal full-wave code calculation.
** For other purposes, the user might want to see these spikes, which
** represent injected density for one time step, before removal.
**
** implct= "enabled" forces implicit differencing and
** Gaussian elimination. implct = "disabled" forces operator
** splitting (can be used for time dependent calculations).
** The implct namelist variable relates to (only) the velocity-space
** differencing of the FP eqn, and method of solution.
** implct="enabled", uses LAPACK linear algebra subroutines which have
** been incorporated into the source code.
** default: implct="enabled"
**
** manymat="enabled" allows all the factored matrices on all flux
** surfaces to live on disk and not disappear after the backsolve.
** This means that the next time step will NOT require a new
** factorization IF THE RHS HAS NOT CHANGED. This saves lots
** of computer time and is the recommend operating mode.
** manymat="disabled" does not save the factored matrices on disk
** and is useful for single flux surface calculations where the
** core space used for the factorization is not overwritten
** as the code moves from flux surface to flux surface.
** default: manymat="enabled". Only implemented for
** soln_method="direct"
**
** soln_method="direct"[default], use lapack dgbtrf/dgbtrs direct
** LU factorization and solve of the velocity-space
** equations.
** v-space coeff matrix A(,) is inefficiently stored
** in LAPACK storage system (with many zeroes).
** In radial transport case (transp.eq."enabled") will
** also retain the splitting method, for this setting.
** ="itsol", obtains v-space coeffs in A(,) directly.
** Uses SPARSKIT2 iterative GMRES solver with
** ilut drop-tolerance preconditioner for v-space solve,
** In radial transport case (transp.eq."enabled") will
** also retain the splitting method, for this setting.
** ="itsol1",uses translation of inefficient lapack
** coeff storage of v-space coeff matrix A(,)to CSR using
** SPARSKIT2 translation routine bndcsr. Then solves as
** in "itsol" case. This option is just for cross-check
** that CSR and LAPACK storage methods are understood.
** ="it3dv", full 3D v-space matrix (but not
** off-diagonal terms for transport yet) with SPARSKIT2
** soln of full matrix simultaneously for all flux surfaces.
** Gives better converged solution then for
** soln_method="itsol". [I don't think this is compatible
** with transp="enabled" and splitting, BH080319].
** [Now OK, 091203].
** ="it3drv", is full 3D-implicit solve including radial
** transport terms, using SPARSKIT2 GMRES routine with
** preconditioning and drop-tolerance.
**
** droptol=drop tolerance for the itsol preconditioner,
** 1.d-3 [default]. Off-diagonal elements smaller than
** this factor times diagonal element will be eliminated.
** lfil= Maximum fill-in of L and U. If .ge. number of equations to be
** solved, it will have no effect. See following. [default:lfil=30]
** From itsol.f preconditioner comments:
**c---- Dual drop strategy works as follows. *
**c *
**c 1) Thresholding in L and U as set by droptol. Any element whose *
**c magnitude is less than some tolerance (relative to the abs *
**c value of diagonal element in u) is dropped. *
**c *
**c 2) Keeping only the largest lfil elements in the i-th row of L *
**c and the largest lfil elements in the i-th row of U (excluding *
**c diagonal elements). *
**c *
**c Flexibility: one can use droptol=0 to get a strategy based on *
**c keeping the largest elements in each row of L and U. Taking *
**c droptol .ne. 0 but lfil=n will give the usual threshold strategy *
**c (however, fill-in is then unpredictible). *
**
** lbdry(k)="conserv" means conservation boundary conditions used
** at v=0 for general species "k" (see species descriptors).
** Zero v-flux at v=0 is enforced in this case.
** Also, no resetting of plasma density.
** lbdry(k)="fixed" means zero flux boundary conditions are not
** enforced at v=0. Instead the distribution is held constant at
** v=0 during "time" advancement. Also, if elecfld is set through
** eoved, then f(v=0) is only set at time step n=0, and not reset.
** Unicity at v=0 is applied.
** lbdry(k)="scale" is like "fixed", but after the solution for
** the distribution, f, is found, the entire distribution is scaled
** so that the resulting field line integrated number density does
** not change in "time". Unicity at v=0 is applied.
** lbdry(k)="consscal", then combine above "conserv" and "scale".
** lbdry(k)="conserv" is the ONLY option for implct="disabled"
** default: lbdry()="conserv"
** NOTE: no "enabled" or "disabled" option for lbdry().
**
** Following lbdry0 input only applies for implct="enabled":
** lbdry0="enabled" means use new system computing distrn function f
** at v=0 that takes f to be a single value. This uses
** subroutine impavnc0 for implicit time advancement. (Modifications
** originated by Olivier Sauter). (default="enabled", implct="enabled").
** This option only applied if lbdry(i)="conserv" or "conserv_scale".
** lbdry0=.ne."enabled" means use old system which computed non-unique
** f(v=0) and then set f(v=0) to density conserving average. Uses
** subroutine impavnc. (Applies for implct="enabled").
**
** taunew="enabled" means use new fully numerical calculation of dtau
** and tau times (BobH, 970210).
** Although more accurate, there remains some work to ensure
** compatibility of the extended theta_poloidal region of
** dtau with the sinz,cosz,tanz determined for a single
** orbit for each velocity grid point (BobH, 010320).
** Oct'09: This option is only possibility with eqsym.eq."none".
** Have removed extended theta_poloidal region of
** dtau by only integrating down the center of the
** pitch angle bin (nii=1); the "extended" feature is
** confusing [to me, BH] and doesn't add much accuracy.
** ="disabled" gives old partially analytic method described
** in Killeen et al. book. (default="disabled", changed 010320).
** nstps=related to integration for tau and dtau. The number of
** subintervals into which each dz along the B-field is
** divided, for int[dz/|v_parallel|]. default:nstps=100
**
********************************************************
**
** MACHINE GEOMETRY
**
**************************************************************
**
** machine="toroidal" or machine="mirror"
** Use of "mirror" makes available Gary Smith's B field option
** (see below). Use of "toroidal" allows a variety of magnetic
** field options (see below).
** machine="mirror" is disabled for lrz .gt. 1
** default: machine="toroidal"
**
** psimodel determines the model used (or the method used) to determine
** the magnetic field variation in the poloidal direction, that
** is psi(z)=B(z)/B(0).
** psimodel="axitorus" means standard 1/R variation for circular cross
** sections is used. (Only slightly sensible for eqmod.ne."enabled";
** even with eqmod.ne."enabled", I recommend psimodel="spline"BH000416)
** psimodel="smith" means Gary Smith's model is used for mirror problems.
** psimodel="spline" means that if through the use of some other model,
** we have available on some arbitrary z (field line) grid an array
** psi(z), then we utilize splines to determine psi(z) on the
** computational z mesh. This option is generally used only when
** the "eq"uilibrium module is enabled and an MHD "eqdsk" file is
** available. (Also works with eqmod.ne."enabled",machine="toroidal".)
** default: psimodel="axitorus",
** But psimodel reset to "spline" if eqmod.NE."disabled".
**
** Set gsla and gslb if machine="mirror" and psimodel="smith"
** gsla and gslb are field scale lengths such that:
** psi(s)=[1+(s/gsla)^2
** +gsb*(exp(-(s-gszb)^2/gslb^2)
** +gsb*(exp(-(s+gszb)^2/gslb^2)]/N
** Sets gsb and gszb so psi'(zmax)=0, psi(zmax)=rmirror
** N is chosen so psi(0)=1 and psi'(0)=0 by construction
** default: gsla=270. gslb=35.
**
** ephicc is the throat potential jump in Kev for machine="mirror"
** This is used to determine the loss cone.
** default:ephicc=0.
**
** zmax(1) is the arclength along B from midplane to throat in
** machine="mirror"
** rmirror is the mirror ratio for machine="mirror"
** rmirror=2.
**
** radmin is the torus minor radius (cm) for machine="toroidal"
** default: radmin=50. Not required, for eqmod='enabled'.
**
** rovera(1) (for rzset.ne."enabled") is the (normalized) minor radius
** of the toroidal flux surface
** (r/a=r/radmin) which also serves as the toroidal drift surface
** in the zero banana width approximation for machine="toroidal"
** For normal operation 1.e-8 < rovera < 1.
** If rovera is positive and less that 1.e-8, it will be reset to 1.e-8.
** Note the rovera input option is used only for cases where lrz=1, and
** rzset.ne."enabled".
** rovera(1) < 0 can be utilized only if eqmod="enabled"
** In this case an input variable povdelp is utilized to determine
** the flux surface of interest. povdelp is described in the "eq"
** model input below.
** default: rovera=.1
**
** radmaj is the torus major radius (cm) for machine="toroidal",
** for the case that eqmod="disabled" and psimodel="axitorus"
** default: radmaj=100. Not required, for eqmod='enabled'.
**
** btor is B(toroidal) (g) at the magnetic axis for machine="toroidal"
** for the case that eqmod="disabled" and psimodel="axitorus"
** default: btor=1.e+4 Not required, for eqmod='enabled'.
**
** bth is B(poloidal) (g) at the plasma edge for machine="toroidal"
** for the case that eqmod="disabled" and psimodel="axitorus"
** The poloidal coordinate at which bth is defined is pi/2.
** default: bth=1.e+3 Not required, for eqmod='enabled'.
**
***********************************************************
**
** SPECIES DESCRIPTORS
**
**************************************************************
**
** In the following, the index (k) refers to the species being
** assigned the particular value. The following conventions are
** assumed:
**
** If 1 .le. k .le. ngen, then k is a general (time-advanced) species.
** k.gt.ngen means species k is background Maxwellian.
** General species are represented by f(theta,x,k,l_), a distribution
** function which evolves in time, whereas the background Maxwellians
** are represented by two quantities, temp(k,) and reden(k,).
** In k order, the general (non-Maxwellian time advanced species)
** come before the background species. Electrons and
** ions can be mixed, and any species can be represented
** simultaneously as a general and a background species.
** If there is more than one Maxwellian ion, then they must
** not be separated in k by the electron species. If more than
** one of the ion species has the same charge number bnumb(), (e.g.,
** H+, D+, and/or T+) then they should be placed successively at the
** beginning of the Maxwellian ion species.
**
**********************************************************************
**
** ngen is the number of general species. It must not exceed
** parameter value ngena or code will abort with error message.
** default:ngen=ngena
**
** nmax is the number of Maxwellian species. It must not exceed
** parameter nmaxa or the code will abort with an error message.
** default: nmax=nmaxa
**
** kspeci(1,k) is the name of species(k) for k=1,ntotal(=nmax+ngen).
** kspeci(2,k) is "general" or "maxwell" for k=1,ntotal,
** designate species as general of Maxwellian.
**
** fmass(k) is the mass(k) in grams.
** default: fmass(k)=1.e-29
** Ions are defined by having mass .gt.1.e-27.
**
** bnumb(k) is the atomic number (-1. for electrons)
** default: bnumb(k)=1.
**
** iprote, iproti and iprone, are flags with several possible values
** (below) governing the electron temperature, ion temperature
** and densities of the plasma profiles for the species.
** We have the following possibilities:
** iprote="parabola","spline", "asdex" "prbola-t", and "spline-t"
** (similarly for iproti and iprone).
** Each option is described below.
** (The "-t" are time-dependent, and are descibed in a separate
** TIME-DEPENDENT PROFILES section below.)
** default: "parabola" for everything
** iprozeff, iproelec, iprovphi, ipronn: See below.
**
** iprote or iproti or iprone = "parabola"
** npwr(k) and mpwr(k) (real) specify the profiles:
** The form is (center-edge)*(1-(r/a)**npwr)**mpwr+edge between the
** specified center and edge values described below (see subr profaxis).
** npwr(0) and mpwr(0) give reden profiles whereas npwr(k) and
** mpwr(k) give the temp profiles for species k. npwr and mpwr
** are real variables, not integers.
** default: npwr(0)=2.; npwr(k)=2. for all (k=1:ngen+nmax) (k=1:ntotal).
** default: mpwr(0)=1.; mpwr(k)=3. for all k>0.
**
** reden(k,l) is the initial density at the midplane (particles/cm**3).
** FOR lrz.gt.1 (and iprone.eq."parabola"):
** The user specifies reden(k,0) (central value) and reden(k,1)
** (edge value). The intermediate values (l=1,lrzmax) are computed
** by the code (see below).
** FOR lrz.eq.1:
** The user specifies reden(k,1)
** This rule (involving lrz) is used throughout input. See temp
** and eparc and eperc for example.
** default: reden(k,l))=1. (for l=1,lrzmax)
**
** temp(k,l) is the initial temperature (Kev) of species k. This
** applies both to general and background species. See reden above
** for specification rule.
** default: temp(k,l)=1.
**
** profpsi="disabled" means that the density and temperature profiles
** will obey the npwr and mpwr directives (above).
** profpsi="enabled" means that the profiles have the following
** dependence (used in early days of the code):
** reden(k,l)=reden(k,0)*((psi(l)-psimag)/psimag)**.5
** temp(k,l)=temp(k,0)*(psi(l)-psimag)/psimag
** default: profpsi="disabled"
**
** iprote, iproti, iprone, iprozeff, iproelec, iprovphi, ipronn = "spline"
** In this case the user can specify namelist variable
** arrays which give radial profile information for cubic splines.
** A spline routine will interpolate the ene, te, and/or ti data
** onto the computational mesh.
** For specified profiles of ene, te, and/or ti, we have:
** (l=1:100,k=1,ntotala=ngena+nmaxa)
** See iprozeff below.
** ryain(l) (r/a) l=1,njene (the radial coordinate)
** enein(l,k) the specified density of species k at ryain(l) (/cm**3)
** (if enein(1,k)=0. for species k.gt.1, then the enein(l,k-1)/bnumb(k)
** values will be used for species k).
** tein(l) the specified electron temperature (keV)
** tiin(l) the specified ion temperature (same for all ion species
** such that bnumb(k).ne.-1.) (keV)
** enescal, tescal, tiscal (and zeffscal, elecscal, see below)
** are scale factors for "spline" input.
** (defaults = 1.0).
** 20100126: Also added that enescal,tescal,tiscal multiply
** all input density/temperature profiles.
** Can be useful, e.g., when units need adjusting.
** elecscal multiplies t-dep input for efswtch.eq."method1".
**
** njene must be less than njenea (= 256 is typ value)
** default: 0
**
** (There are also namelist input variables njte, njti (but no
** njzeff) similar to ONETWO input, but for now these variables
** have no effect, since the spline values of te, ti, zeff
** are all assumed to be input on the same ryain(1:njene) mesh.)
**
** iprote(or ti) (or ne) = "asdex"
** In this case, the code has ASDEX-type exponential profiles
** hard-wired into the code. The user need not make further
** specifications. See subroutines tdxinitl and tdpro.
** Uses acoefne,acoefte.
** default: none
**
** iprozeff = "disabled" (default), "parabola", or "spline":
**
** = "disabled", then this option has no effect.
** = "parabola","prbola-t", "spline" or "spline-1", then this
** option gives ion densities so as to achieve a given zeff
** radial profile, consistent with charge neutrality and the
** given electron density profile.
**
** There must be at least one Maxwellian ion species
** for this case.
** If there are more than one Maxwl ion species with
** bnumb() the same as the first (e.g., H+, D+, and/or T+),
** then these will be treated as a unit, and their densities
** adjusted proportionately, as required.
** It is necessary to specify these equal-bnumb() species
** successively at the beginning of the Maxwl ion species,
** and the densities reden(,) should contain the relative
** ratios of each species: e.g., reden(k,)=0.99,
** reden(k+1,)=0.01 gives 99% 1st species.
** Only up to two different Z ions are implemented for this
** option.
** If there are two different bnumb() Maxwellian ion species
** specified, then densities of these species are adjusted
** to obtain the zeff-profile.
** If only one bnumb() value (for .ge.1 Maxwl ions) is
** specified, then bnumb,fmass are as input above into
** namelist, and an additional ion species is automatically
** added with bnumb=50., fmass=50*2.*1.67e-24.
** The densities of the two different bnumb() species will
** be adjusted to achieve the specified profile of zeff.
** The first general ion species (if it exists)
** will be given density of the first of the two Maxwellian
** species.
** The second general ion species (if it exists) will be given
** the density of the second Maxwellian ion species.
** Etc.
** (remember that an added species will have bnumb=50,
** fmass=50*2.*1.676e-24.)
** In particular,
** = "parabola", then input zeff profile by
** zeffin(0)=central value, zeffin(1)=edge value,
** npwrzeff,mpwrzeff (real numbers) specify parabolic
** profile as is done above for reden.
** = "spline", then input zeff profile data in
** zeffin(1:njene), as done above for enein.
** ***NB*** MUST explicitly put zeffin(1)=,in this case.
** If using time-dependent profiles, then need
** iprozeff="parabola", and input profiles as specified
** below. iprozeff="spline" is not presently implemented
** for time-dep. case.
**
** zeffscal=scale factor for zeffin spline input (default=1.0).
**
** zeffin, npwrzeff, mpwrzeff, as above.
**
** izeff = "backgrnd" (default), then zeff(l),l=1,lrzmax profile
** is calculated from all species k=1,ntotal except
** general electrons and Maxwellian electrons.
** [BH070316: Need to check ngen.gt.1 case]
** = "ion", then zeff(l),l=1,lrzmax calculated from all species
** other than general species or electrons. (Use for
** ion simulations, with colmodl=1,3...)
** BH recommends checking this out a bit more in ainpla.f,
** diaggnde.f and diaggnde2.f, if you are going to use it.
**
** fpld(1:6,1:ngena) controls "additional" loading of the of the
** equatorial distribution functions, at time step nfpld.
** This set of options was instituted for purposes of study of the
** electron knock-on runaway problem.
** It can also be used for INITIALIZING the
** Fokker-Planck'd distribution (ngen=1)
** from externally generated distributions (see, for example,
** the IDL procedure make_input_distn.pro, BobH, 001124).
** (The default, fpld(1,1:ngena)=0.0,
** gives no loading of distribution functions beyond initial
** (relativistic) Maxwellians derived from the specified density,
** temp. and zeff.)
** The additional loading
** is in the form of a internally generated vel-space-constant
** plus a shifted "Maxwellian" distribution which is localized in
** pitch angle, or, distributions read in from file "fpld_dsk".
** (See subroutine finit.)
** fpld(1,1)= -1.0, (Previously "fpld_dsk" option on C90)
** then read initial distribution function
** in from file "fpld_dsk" according to format
** given in source file finit.f.
** (Only works for No additional preloading).
** fpld(1,1)= -2.0 (Previously "fpld_ds1" option on C90)
** then add additional loading with distribution
** given in file "fpld_dsk", and renormalized to have
** a fraction of the total (reden-)density
** as specified in fpld(2,1). Windowing of distribution is
** given by fpld(7:10,k), as described below.
** fpld(2,1)=in the case fpld(1,1)=-2.0, gives fraction
** of additional loading which is in the distribution
** specified by the "fpld_dsk" file.
** For fpld(1,1)=real number.gt.0., (.ne.-1.0 or -2.0):
** fpld(1,k)=fraction of flux surface averaged density of species
** k which is in the additional preloading. (.ge.0., .le.1.)
** (default=0.)
** fpld(2,k)=fraction of the additional loading which is in the
** the shifted "Maxwellian". (.ge.0., .le.1.)
** (default =0.)
** fpld(3,k)=Energy of peak of shifted "Maxwellian". (keV)
** fpld(4,k)=Energy spread of distn. (keV).
** fpld(5,k)=Pitch angle of peak of shifted "Max". (radians)
** fpld(6,k)=Dispersion of distn in pitch angle (radians).
** fpld(7,k)=Minimum energy(keV) of loading function. (deflt. 0.)
** fpld(8,k)=Maximum energy(keV) of loading function. (deflt. 1.e10)
** fpld(9,k)=Minimum pitch angle(radians) of loading function (def. 0.)
** fpld(10,k)=Maximum pitch angle(radians) of loading function (def. pi)
** N.B. If using Zeff (as above) increases the number of
** ion species, must give any desired additional
** preloading through the appropriate fpld(k,...)
**
** nfpld = time step at which to introduce the additional loading
** into f.
**
**************************************************************
**
** TIME-DEPENDENT PROFILES
**
***************************************************************
**
** Time-dependent profiles are implemented either by specifying
** (A) central and edge values for parabolic-type profiles
** as a function of time, or as (B) a series of spline
** profiles as described at time-dependent splines, below.
**
** (A) central and edge values for parabolic-type profiles
** =======================================================
** nbctime > 0, and profile designator (iprone, etc.) is "prbola-t"
** The exponents of the profiles are fixed in time,
** and are those used elsewhere in the code.
**
** BH131029: Presently, it does not appear their is backward
** compatability with iprone='parabola', nbctime.gt.0.
** Need to fix this.
**
** Two methods are implemented for specification of the time-
** dependent parabolic profiles, according to tmdmeth="method1"
** or "method2".
** tmdmeth="method1", then specify central and edge values at a
** sequence of times, bctime(1:nbctime), as given below.
** ="method2" give central and edge values at only
** two times bctime(1:2). The edge and central
** values are constant up to bctime(1), vary as
** y=y2+((y1-y2)/2.)*(1.+cos((t-t1)/(t2-t1)) up to
** time bctime(2), and then constant. y1 and y2
** are given by redenc(1:2), and so on.
** (default="method1")
**
** nbctime=number of times at which profile data given.
** Set nbctime=0 for no time-dependent profiles, else
** specify time dependent profiles. (default=0)
** bctime(1:nbctime)=times at which data given (seconds).
** (default= 0, 1., 2., ..., float(nbctimea-1))
** If code time .lt. bctime(1), use bctime(1) profiles.
** If code time .gt. bctime(nbctime), use bctime(nbctime) profiles.
**
** Setting central values =0. at the first time step
** turns off profile generation through this namelist variable.
** (default is all central and edge values =0.)
** BH131029: Looking over profiles.f, this option does not appear
** to be implemented.
**
** redenc(1:nbctime,k), redenb(1:nbctime,k) central and edge values
** for each species k (cm**-3). The powers of the parabola are
** given by npwr(0), mpwr(0) as above, and are time-independent.
** NOTE: for time-dependent density profiles, most sensible cases will
** use lbdry="scale".
** With time dependent density and lbdry="scale", density is added
** to achieve specified density, at either the local (in time and
** position) temperature, or at the input value of
** temperature as specified by temp_den.
** temp_den=0., use local in time and radius temperature for added density.
** .ne.0., then use this as temperature of added density (keV).
** (default= 0.0).
** tempc(1:nbctime,k), tempb(1:nbctime,k) central and edge values
** for each species k (keV). npwr(1:ntotal), mpwr(1:ntotal )
** as for temp( ,k).
** zeffc(1:nbctime),zeffb(1:nbctime), with npwrzeff,mpwrzeff,
** specify zeff profiles as described above.
** NOTE: if using this option (i.e., zeffc(1).ne.0.), need to have
** iprozeff="prbola-t" (see iprozeff above).
** Also, can specify two maxwellian ion species, one
** with high enough Z, or the code will will add a second
** ion species with Z=50.
** elecc(1:nbctime),elecb(1:nbctime), with npwrelec(real),mpwrelec(real)
** specify electric field profiles, unless current profile
** control is enabled (volts/cm). See below, D.C. ELECTRIC FIELD TERM.
** vphic,vphib,npwrvphi,mpwrvphi similarly, specify toroidal rot (cm/sec).
**
** Parallel Current profile (rather than specified electric field) gives
** electric field if efswtch.eq."method2" or "method4", and