Jump to: navigation, search

6. Customising the "EFIT" programme

The following steps should be followed to carry out the necessary custom modifications to the "EFIT" code.

  1. Ensure consistency of "EFIT with the "EFUND" programme (section 6.1).
  2. Change array values in block data routine "efit_bdata" as required and modify array dimensions accordingly (section 6.2)
  3. Make other changes to the "EFIT" parameter values as desired.

6.1. Ensuring consistency of "EFIT and "EFUND" programmes

Modify the EFIT module "/efit/x/eparmdx.for" to ensure that the array dimensions of the following variables are identical to those used on the "EFUND" programme (i.e. the parameter values defined in "/efit/green/u/efund.for"):

       magpri  (set magpri67=1 and magpri322=magpri-1). This variable 
               is called mafpr2 in programme "EFUND".
       nesum   
       necoil
       nfcoil
       nsilop
       nacoil  (set to 1.)
       nvesel

Note a strange quirk in the EFIT programme is that the magnetic diagnostics must be split between magpri67 and magpri322.


6.2. Modifications to the block data routine "efit_bdata"

The block data routine "efit_bdata" located in "/efit/x/efitdx.for" initializes a number of useful variables. During installation of EFIT, the following variables (in the "D3D" section of the routine) should be checked and modified according to need:

1.specification of initial set of flux surfaces:
relip major radius (r-coord) of lcfs.
zelipmajor radius (z-coord) of lcfs.
aelipminor radius of lcfs.
eelipelongation of lcfs.
2.specification of sxr choords (for plotting purposes): If (ishot.gt.80744) then EFIT will plot the sxr lines of sight as specified by the arrays XANGLE, ZXRAY, and RXRAY.
xangle[1..nangle] angle of sxr coord (in degs from midplane)
rxray[1..nangle]r-coord of start of coord
zxray[1..nangle]z-coord of start of coord
3. specification of which path lengths to compute through plasma: EFIT computes the path lengths of vertical and horizontal chords through the plasma as specified by the arrays:
chordr[1..nc02r] array of z-values for which path lengths are required.
chordv[1..nc02v]array of r-values for which path lengths are required.
4. specification of other quantities
rcentr r-coord where the vaccum toroidal field is specified
rzero set to same value as RCENTR
emaxis elongation on magnetic axis (probably not required)
aaslop rough estimate of minor radius of reference flux loop.
(used to compute the sigma values of flux loops).
drslopuncertainty in major radius.
(used to compute the sigma values of flux loops).
nslref label of the reference flux loop.
zcentr??
rmajtsr-coord for Thompson scattering diagnostic.
ecurrt[1..nesum]initial value of ohmic current in each coil group
(set to zero).
ringr[1..6]obsolete variable.
ringz[1..6]obsolete variable.

Note the parameters that set array dimensions for the above arrays are located in "/efit/x/eparmdx.for" and should be modified if necessary.


6.4. Additional custom modifications to the EFIT code

This section descibes additional modifications that may be necessary to EFIT and the controlling scripts used during the production of an executable module. 6.4.1. Modifications to the assignment of initial values

Default values of many input and other global variables are set in the efit_bdata block data module. The following is a list of variables that you may be most likely to change.

variable description
mfvers (1) version number of EFIT code (month day)
mfvers (2)version number of EFIT code (year)

6.4.2. Changes to EFIT parameter values

The majority of parameters in the EFIT programme are defined in the file "eparmdx.for". The table below describes all these variables. Some of them have already been specifically mentioned in section 6.1.

Warning!!! DO NOT CHANGE THE VALUES OF PARAMETERS "NW" AND "NH" BECAUSE THIS WILL PREVENT THE CORRECT OPERATION OF THE SCRIPT FILE USED TO PRODUCE THE SET OF EFIT EXECUTABLE MODULES.

class="greyCell" kubics used in cubic spline representation.
kubicxused in cubic spline representation.
kubicyused in cubic spline representation.
kujunkused in cubic spline representation.
kxitermaximum allowed number of iterations.
lubicxused in cubic spline representation.
lubicyused in cubic spline representation.
magpri67 number of magnetic detectors at toroidal angle "1" ***
magpri333number of magnetic detectors at toroidal angle "2" ***
magprit obsolete
magpri= magpri67+magpri322
mbdry maximum number of boundary points for fixed boundary run.
modef used in cubic spline representation.
modep used in cubic spline representation.
modew used in cubic spline representation.
mpressnumber of pressure data points ?***
msbdr2= 2*msbdry
msbdry= msbdry+nsilop+nfcoil+1
mqwantmaximum allowed iterations to get q on axis.
nangledimension of arrays xangle,zxray,rxray.
nbwork= nsilop
nco2r dimension of array chordr
nco2v dimension of array chordv
ncurrt= nvesel+nesum+nfcoil
ndata array dimension of some useful parameters ?****
necoilnumber of o.h. coils.
nesum maximum number of coil groups for o.h. coils.
nfbcoil obsolete
nfcoilnumber of p.f. coils.
nffcurMaximum number of fitting parameters for f-fprime.
mfnpcr= nfcoil+npcurn+nvesel+nwwcur+nesum+nfcoil
nh Number of grid points in z-direction
nh2 = 2*nh
nlimbdnumber of 'outer' limiter points (used in some calculations).
nlimitnumber of limiter points.
npcur2= npcurn*2
npcur3= npcurn*2
npcurn= nffcur+nppcur
npointMaximum allowed number of points on contour being followed.
nppcurMaximum number of fitting parameters for p-prime.
nrogowObsolete.
nrsma2= 2*nrsmat
nrsmat= nsilop+magpri+nrogow+nffcur+1+npcurn+nwwcur+mpress+nfcoil+nstark
nsilopnumber of flux loops.
nstarkMaximum number of fitting parameters for MSE.
ntime Maximum number of time slices.
nveselnumber of vessel segements.
nw Number of grid points in r-direction
nwcur2= nwcurn*2
nwf = nwwf
nwnh = nw*nh
nwrk = 2*(nw+1)*nh
nwwf = 2*nw
nwwcurMaximum number of fitting parameters for toroidal rotation.
nwcurn= nwwcur+npcurn
nxtlim'not important'
nxtramnumber of field lines to plot external to plasma
nxtrap= npoint

Note that the following variables are also defined in other places in the code:

variables name places where variables is defined
magpri getecdx
nco2r getecdx
nco2v getecdx
necoil getecdx
nesum getecdx
nfcoil getecdx
nsilop getecdx
ntime getecdx
nw simslu,splinex
nh simslu,splinex

whereas the variables "nacoil", "ntimem" are only defined in module "getecdx".)

6.4.3. Changes to file names refered to by EFIT

The EFIT code has hard-wired into it where to find the Green's function tabes and the "dprobe.dat" data file. By default the directory it looks in is "/link/efit". However, these files files are actually stored in directory "efit/p". To change the name of this directory you must do the following:

  1. Change to directory "efit/x" and edit files "efitdx.for", "getdiax.for", "getfnmx.for", "pltdatx.for" to replace all references to "/link/efit" with the desired directory location.
  2. Change to directory "efit/ex" and do the following string replace in all "makeefitdu*.ex" files: "\/link\/efit\/" is replaced by "[target]\/" (where [target] is the new directory location).

There are also some data files which may be archived in a central store "/link/store". You should edit the following files to replace all occurance of "\link\store" with the desired file path: "getfnmx.for", "pltdatx.for", "tearing.for" and "weqdskx.for".

6.4.4. Changes to the definition of sigma

The value of sigma is defined in routine DATA_INPUT (module "efitdx.for" in directory "efit/x") by scaling the weighting functions (the sigma values are the reciprical of the weighting functions). The definitions of the sigma values for each class of constraints are described in ... ANOTHER ONE OF MY NOTES ... It may be necessary to modify the definition of the sigma's defined in this routine (in particular, note the definition of the flux loop sigma).