next up previous
Next: Printout Up: No Title Previous: Initial Coding

Input and Output Variables

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 tex2html_wrap_inline423
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 tex2html_wrap_inline425 experimental tex2html_wrap_inline275 shearing rate
gamma_p_exp(jm) 0.0 tex2html_wrap_inline429 experimental parallel velocity shearing rate
vphi_m(jm) 0.0 tex2html_wrap_inline431 toroidal velocity (m/s)
vpar_m(jm) 0.0 tex2html_wrap_inline433 parallel velocity (m/s)
vper_m(jm) 0.0 tex2html_wrap_inline435 perpendicular velocity (m/s)
zeff_exp(jm) 1.0 tex2html_wrap_inline281 effective charge
bt_exp 1.0 tex2html_wrap_inline439 toroidal field (T) such that tex2html_wrap_inline441=enclosed flux
bt_flag 0.0 switch for effective B-field (> 0 for tex2html_wrap_inline445, tex2html_wrap_inline439 otherwise)
rho(jm) 0.0 tex2html_wrap_inline449 square root of normalized toroidal flux surface label
arho_exp 1.0 tex2html_wrap_inline451 square root of toroidal flux at last closed flux surface LCFS (m)
gradrho_exp(jm) 1.0 tex2html_wrap_inline453 dimensionless
gradrhosq_exp(jm) 1.0 tex2html_wrap_inline455 dimensionless
rmin_exp(jm) 0.0 tex2html_wrap_inline457 local minor radius (m)
rmaj_exp(jm) 0.0 tex2html_wrap_inline459 local major radius (m)
rmajor_exp 1.0 tex2html_wrap_inline461 geometrical major radius of magnetic axis (m)
q_exp(jm) 1.0 q safety factor
shat_exp(jm) 0.0 tex2html_wrap_inline465 magnetic shear tex2html_wrap_inline467
alpha_exp(jm) 0.0 tex2html_wrap_inline273 MHD alpha tex2html_wrap_inline471
elong_exp(jm) 1.0 tex2html_wrap_inline473 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 tex2html_wrap_inline479 average charge of impurity
alpha_e 0.0 tex2html_wrap_inline481 real variable switch for tex2html_wrap_inline275 shear stabilization
(0 = off and > 0 = on)
x_alpha 0.0 tex2html_wrap_inline485 real variable switch for alpha stabilization
(0 = off, 1. = on and
-1. for self-consistent alpha stabilization)
i_delay 0 time steps by which tex2html_wrap_inline275 shear egamma_d is delayed
(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 tex2html_wrap_inline493 electron thermal diffusivity (m2/s)
chiinem 0.0 tex2html_wrap_inline387 ion thermal diffusivity (m2/s)
etaphim 0.0 tex2html_wrap_inline315 toroidal velocity diffusivity (m2/s)
etaparm 0.0 tex2html_wrap_inline505 parallel velocity diffusivity (m2/s)
etaperm 0.0 tex2html_wrap_inline509 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 tex2html_wrap_inline493 electron thermal diffusivity (m2/s)
chii_m(jm) 0.0 tex2html_wrap_inline387 ion thermal diffusivity (m2/s)
etaphi_m(jm) 0.0 tex2html_wrap_inline315 toroidal velocity diffusivity (m2/s)
etapar_m(jm) 0.0 tex2html_wrap_inline505 parallel velocity diffusivity (m2/s)
etaper_m(jm) 0.0 tex2html_wrap_inline509 perpendicular velocity diffusivity (m2/s)
exch_m(jm) 0.0 turbulent electron-ion energy exchange (MW/m3)
egamma_m(jm) 0.0 tex2html_wrap_inline541 tex2html_wrap_inline275 shear rate in units of csda_m (1/s)
egamma_d(jm) 0.0 tex2html_wrap_inline545 tex2html_wrap_inline275 shear rate delayed by i_delay steps
gamma_p_m(jm) 0.0 tex2html_wrap_inline549 parallel velocity shear rate in units of local csda_m (1/s)
anrate_m(jm) 0.0 tex2html_wrap_inline551 growth rate of leading mode in units of local csda_m (1/s)
anrate2_m(jm) 0.0 tex2html_wrap_inline553 2nd leading growth rate in units of local csda_m (1/s)
anfreq_m(jm) 0.0 tex2html_wrap_inline555 leading mode frequency in units of local csda_m (1/s)
anfreq2_m(jm) 0.0 tex2html_wrap_inline557 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, tex2html_wrap_inline275 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


next up previous
Next: Printout Up: No Title Previous: Initial Coding

transp_support
Thu Feb 20 11:20:39 EST 2003