The following two tables list the input and output variables for the GLF23 model. Internal documentation can also be found inside the callglf2d and glf2d routines. The variable jshoot determines how the gradients and diffusivities are computed on the grid where jm is the local grid point and is between 0 and the maximum grid point jmaxm. The choice of jshoot depends upon the structure of the transport code and/or user preference. Typically, for a time-dependent transport code, jshoot=0 so the gradients and diffusion are computed on the backward gradient between the jm+1 and jm grid points. The model can also be run inside a shooting code (jshoot=1) whereby the diffusivities at grid point jm are computed on the forward (implicit) gradient between jm to jm-1. To turn on the impurity dynamics, set idengrad=3 and prescribe the fast ion density ns_m along with the average mass amass_imp and charge zimp_exp of the impurity. The default is for simple dilution (idengrad=2). The gradients can be prescribed externally using the variables zpmte, etc. and by setting igrad=1. If the user chooses to prescribe the gradients, which are scalar quantities, then the user must also supply the corresponding grid number jmm. In this case, the output scalar variables are used diffnem, etc.
Inputs:
variable | default | symbol | meaning |
leigen | 0 | eigenvalue solver, default 1 for tomsqz, =0 for cgg solver | |
jshoot | 0 | =0 for time-dep code, =1 for shooting code | |
iglf | 0 | =0 for original normalization, =1 retuned model | |
jmm | 0 | grid number (jmm=0 does full grid from jm=1 to jmaxm-1) | |
jmaxm | 0 | maximum no. of grid pts. All input profiles are dimensioned (0:jmaxm) | |
itport_pt(1:5) | 0 | controls transport, =1 for on. | |
0 | itport_pt(1) | density transport | |
0 | itport_pt(2) | electron transport | |
0 | itport_pt(3) | ion transport | |
0 | itport_pt(4) | vphi transport (-1 use egamma_exp) | |
0 | itport_pt(5) | vtheta transport (-1 use gamma_p_exp) | |
te_m(jm) | 1.0 | Te | electron temperature (keV) |
ti_m(jm) | 1.0 | Ti | Ion temperature (keV) |
ne_m(jm) | 1.0 | ne | electron density (1019 m-3) |
ni_m(jm) | 1.0 | ni | Ion density (1019 m-3) |
ns_m(jm) | 1.0 | ns | Fast ion density (1019 m-3) |
igrad | 0 | compute gradients (1=input gradients) | |
idengrad | 2 | compute simple dilution dilgf=1-ni/ne (3=actual dilution) |
Inputs:
variable | default | symbol | meaning |
zpte_in | 0.0 | log electron temperature gradient with respect to ![]() | |
zpti_in | 0.0 | log ion temperature gradient | |
zpne_in | 0.0 | log electron density gradient | |
zpni_in | 0.0 | log ion density gradient | |
angrotp_exp(jm) | 0.0 | experimental toroidal angular velocity (1/s) | |
egamma_exp(jm) | 0.0 | ![]() | experimental ![]() |
gamma_p_exp(jm) | 0.0 | ![]() | experimental parallel velocity shearing rate |
vphi_m(jm) | 0.0 | ![]() | toroidal velocity (m/s) |
vpar_m(jm) | 0.0 | ![]() | parallel velocity (m/s) |
vper_m(jm) | 0.0 | ![]() | perpendicular velocity (m/s) |
zeff_exp(jm) | 1.0 | ![]() | effective charge |
bt_exp | 1.0 | ![]() | toroidal field (T) such that ![]() |
bt_flag | 0.0 | switch for effective B-field (> 0 for ![]() ![]() | |
rho(jm) | 0.0 | ![]() | square root of normalized toroidal flux surface label |
arho_exp | 1.0 | ![]() | square root of toroidal flux at last closed flux surface LCFS (m) |
gradrho_exp(jm) | 1.0 | ![]() | dimensionless |
gradrhosq_exp(jm) | 1.0 | ![]() | dimensionless |
rmin_exp(jm) | 0.0 | ![]() | local minor radius (m) |
rmaj_exp(jm) | 0.0 | ![]() | local major radius (m) |
rmajor_exp | 1.0 | ![]() | geometrical major radius of magnetic axis (m) |
q_exp(jm) | 1.0 | q | safety factor |
shat_exp(jm) | 0.0 | ![]() | magnetic shear ![]() |
alpha_exp(jm) | 0.0 | ![]() | MHD alpha ![]() |
elong_exp(jm) | 1.0 | ![]() | local elongation |
amassgas_exp | 1.0 | MH | atomic number of working gas |
amassimp_exp | 12.0 | MZ | average mass of impurity |
zimp_exp | 6.0 | ![]() | average charge of impurity |
alpha_e | 0.0 | ![]() | real variable switch for ![]() |
(0 = off and > 0 = on) | |||
x_alpha | 0.0 | ![]() | real variable switch for alpha stabilization |
(0 = off, 1. = on and | |||
-1. for self-consistent alpha stabilization) | |||
i_delay | 0 | time steps by which ![]() | |
(for numerical stability and normally should be defaulted) |
Note: the input file in is copied to a file called temp whereby any comments are stripped out using subroutine stripx.
Output:
variable | default | symbol | meaning |
diffnem | 0.0 | D | ion plasma diffusivity (m2/s) |
chienem | 0.0 | ![]() | electron thermal diffusivity (m2/s) |
chiinem | 0.0 | ![]() | ion thermal diffusivity (m2/s) |
etaphim | 0.0 | ![]() | toroidal velocity diffusivity (m2/s) |
etaparm | 0.0 | ![]() | parallel velocity diffusivity (m2/s) |
etaperm | 0.0 | ![]() | perpendicular velocity diffusivity (m2/s) |
exchm | 0.0 | turbulent electron-ion energy exchange (MW/m3) | |
diff_m(jm) | 0.0 | D | ion plasma diffusivity (m2/s) |
chie_m(jm) | 0.0 | ![]() | electron thermal diffusivity (m2/s) |
chii_m(jm) | 0.0 | ![]() | ion thermal diffusivity (m2/s) |
etaphi_m(jm) | 0.0 | ![]() | toroidal velocity diffusivity (m2/s) |
etapar_m(jm) | 0.0 | ![]() | parallel velocity diffusivity (m2/s) |
etaper_m(jm) | 0.0 | ![]() | perpendicular velocity diffusivity (m2/s) |
exch_m(jm) | 0.0 | turbulent electron-ion energy exchange (MW/m3) | |
egamma_m(jm) | 0.0 | ![]() | ![]() |
egamma_d(jm) | 0.0 | ![]() | ![]() |
gamma_p_m(jm) | 0.0 | ![]() | parallel velocity shear rate in units of local csda_m (1/s) |
anrate_m(jm) | 0.0 | ![]() | growth rate of leading mode in units of local csda_m (1/s) |
anrate2_m(jm) | 0.0 | ![]() | 2nd leading growth rate in units of local csda_m (1/s) |
anfreq_m(jm) | 0.0 | ![]() | leading mode frequency in units of local csda_m (1/s) |
anfreq2_m(jm) | 0.0 | ![]() | 2nd leading mode frequency in units of local csda_m (1/s) |
Note: if input variable jmm is set to a non-zero value, the scalar output quantities (diffnem et al.) are used. If jmm is zero, the profile output arrays (diff_m et al.) are used. If the user supplies scalar input gradients, then a non-zero jmm value must be used.
Initialization of input and output variables:
c---:----1----:----2----:----3----:----4----:----5----:----6----:----7-c
open (4,file='temp')
open (5,file='in')
open (6,file='out')
c
call stripx (5,4,6)
c
cdate = ' '
c ctime = ' '
c
call c9date (cdate)
cray call clock (ctime)
cibm call clock_ (ctime)
c
write (6,*)
write (6,*) ' GLF23 stand-alone code by Kinsey, GA ',cdate
c
c..default inputs
c
epsilon = 1.e-10
leigen = 0 ! for cgg eigenvalue solver
nroot = 8 ! number of roots in eigenvalue solver
iglf = 0 ! original GLF23 normalization
jshoot = 0 ! for time-dependent code
jmaxm = 2
igrad = 0 ! compute gradients
idengrad = 2 ! simple dilution
i_delay = 0
itport_pt(1) = 0
itport_pt(2) = 0
itport_pt(3) = 0
itport_pt(4) = 0
itport_pt(5) = 0
irotstab = 1 ! use internally computed ExB shear, 0 for prescribed
bt_exp = 1.0
bt_flag = 0 ! do not use effective B-field
bteff_exp = 1.0 ! effective B-field (used when bt_flag > 0)
rmajor_exp = 1.0
amassgas_exp = 1.0
zimp_exp = 6.0
amassimp_exp = 12.0
arho_exp = 1.0
alpha_e = 0. ! ExB shear stabilization
x_alpha = 0. ! alpha stabilization
zpte_in = 0.
zpti_in = 0.
zpne_in = 0.
zpni_in = 0.
c
do j=0,jpd
te_m(j) = 0.0
ti_m(j) = 0.0
ne_m(j) = 0.0
ni_m(j) = 0.0
ns_m(j) = 0.0
c
zpte_m(j) = 0.0
zpti_m(j) = 0.0
zpne_m(j) = 0.0
zpni_m(j) = 0.0
c
angrotp_exp(j) = 0.0
egamma_exp(j) = 0.0
gamma_p_exp(j) = 0.0
vphi_m(j) = 0.0
vpar_m(j) = 0.0
vper_m(j) = 0.0
c
zeff_exp(j) = 1.0
rho(j) = 0.0
gradrho_exp(j) = 1.0
gradrhosq_exp(j) = 1.0
rmin_exp(j) = 0.0
rmaj_exp(j) = 0.0
q_exp(j) = 1.0
shat_exp(j) = 0.0
alpha_exp(j) = 0.0
elong_exp(j) = 1.0
enddo
c
c..default outputs
c
diffnem = 0
chietem = 0
chiitim = 0
etaphim = 0
etaparm = 0
etaperm = 0
exchm = 0
c
do j=0,jpd
diff_m(j) = 0.0
chie_m(j) = 0.0
chii_m(j) = 0.0
etaphi_m(j) = 0.0
etapar_m(j) = 0.0
etaper_m(j) = 0.0
exch_m(j) = 0.0
egamma_m(j) = 0.0
gamma_p_m(j)= 0.0
anrate_m(j) = 0.0
anrate2_m(j) = 0.0
anfreq_m(j) = 0.0
anfreq2_m(j) = 0.0
do k=1,10
egamma_d(j,k) = 0.0
enddo
enddo
Read input file and copy to output file:
c
c---:----1----:----2----:----3----:----4----:----5----:----6----:----7-c
c
c..read input file
c
10 continue
c
read (4,20,end=900,err=900) line
20 format (a)
c
if ( index ( line, '$nlglf' ) .gt. 0
& .or. index ( line, '&nlglf' ) .gt. 0 ) then
c
c read namelist input
c
backspace 4
read (4,nlglf)
else
go to 10
endif
c
if ( leigen .gt. 0 ) then
write (6,*) ' tomsqz eigenvalue solver '
else
write (6,*) ' cgg eigenvalue solver '
endif
c
if ( lprint .gt. 100 ) write (6,nlglf)
c
write (6,*)
The pre-call subroutine callglf2d prescribes the GLF23 model parameters,
sets up gradients, shearing rate, etc. and then calls
the main routine glf2d containing the GLF23 model. Unlike callglf2d
which is accessed through an argument list, information is passed
to and from glf2d through a local common block glf.m. Upon
returning from the glf2d routine, the diffusivities, exchange terms,
growth rates and frequencies are determined.
c
call callglf2d( leigen, nroot, iglf
& , jshoot, jmm, jmaxm, itport_pt
& , irotstab, te_m, ti_m, ne_m, ni_m, ns_m
& , igrad, idengrad, zpte_in, zpti_in, zpne_in, zpni_in
& , angrotp_exp, egamma_exp, gamma_p_exp, vphi_m, vpar_m, vper_m
& , zeff_exp, bt_exp, bt_flag, rho
& , arho_exp, gradrho_exp, gradrhosq_exp
& , rmin_exp, rmaj_exp, rmajor_exp, zimp_exp, amassimp_exp
& , q_exp, shat_exp, alpha_exp, elong_exp, amassgas_exp
& , alpha_e, x_alpha, i_delay
& , diffnem, chietem, chiitim, etaphim, etaparm, etaperm
& , exchm, diff_m, chie_m, chii_m, etaphi_m, etapar_m, etaper_m
& , exch_m, egamma_m, egamma_d, gamma_p_m
& , anrate_m, anrate2_m, anfreq_m, anfreq2_m )
c
do j=1,jmaxm
drho=rho(j-1)-rho(j)+epsilon
zpte_m(j)=-(log(te_m(j-1))-log(te_m(j)))/drho
zpti_m(j)=-(log(ti_m(j-1))-log(ti_m(j)))/drho
zpne_m(j)=-(log(ne_m(j-1))-log(ne_m(j)))/drho
zpni_m(j)=-(log(ni_m(j-1))-log(ni_m(j)))/drho
enddo