I2MEX, by providing a standard equilibrium representation, allows stability codes to obtain metric information from a variety of equilibrium sources. These include GEQDSK (EFIT format), INP1/inp1.cdf (CHEASE), eqdsk.cdf (JSOLVER) as well as TRANSP run data stored on local file system or in the MDSPlus tree.
I2MEX is based on a minimal set of data: the scalar pressure, safety factor, covariant toroidal B field plus the (X, Z) coordinates which are loaded-in at initialization. All metric quantities are computed on the fly on arbitrary, user-specified grids (poloidal angle, poloidal flux/2*pi), using bi-cubic splines.
magnetic field: [Tesla]
radius/elevation: [metre]
(X, Z): the major radius and elevation [m]
q: safety factor profile [-]
g: covarian toroidal magnetic field [T*m]
the, or t: the poloidal angle
nt1: number of poloidal rays + 1
ns: number of radial surfaces
The i2mex object should first be initialized. Then use any 'get' access data routine. Finally, the object should be freed:
use i2mex_mod
implicit none
! local variable declarations come here...
!...
call i2mex_init(label, nt1, ns, t, psi, p, g, q, x, z, ier)
! add your methods here
! ...
call i2mex_free(ier)
It is recommended to follow each i2mex call by
Most radial and 2-d quantities XXX are computed by calling
The test driver drive.f90 offers a quick tour of i2mex's capabilities.
Use your web browser search key to locate the routine of your choice (Alt-f on netscape).
    i2mex_xydot
    i2mex_jac
    i2mex_getQDeltaT
    i2mex_getQDeltaP
    i2mex_getXJphi
    i2mex_getGsError
    i2mex_getGp
    i2mex_getGpp
    i2mex_getJt
    i2mex_getJp
    i2mex_getPp
    i2mex_getPpp
    i2mex_getPhiP
    i2mex_getPhiPP
    i2mex_getQp
    i2mex_getQpp
    i2mex_getQFromPsiGXZ
    i2mex_getDS
    i2mex_getD2S
    i2mex_getGradX
    i2mex_getXtt
    i2mex_getXtp
    i2mex_getXpt
    i2mex_getXpp
    i2mex_getGradZ
    i2mex_getZtt
    i2mex_getZtp
    i2mex_getZpt
    i2mex_getZpp
    i2mex_2Dx
    i2mex_fromFreeqbe
    i2mex_fromGeqdsk
    i2mex_fromGeqdskThruEscQ
    i2mex_fromInp1CDF
    i2mex_fromEqdskCDF
    i2mex_fromInp1Binary
    i2mex_fromMDSPlus
    i2mex_fromMenard
    i2mex_fromCEO
    i2mex_integratePeriodic1d
    R8v_ieval
    i2mex_integrateAlongFluxSurface
    i2mex_interpPeriodic1d
    i2mex_getMetricT
    i2mex_getMetricP
    i2mex_getOriNs
    i2mex_getOriT
    i2mex_getOriPsi
    i2mex_getOriP
    i2mex_getOriG
    i2mex_getOriQ
    i2mex_getOriX
    i2mex_getOriZ
    i2mex_getUpsilon
    i2mex_getSurface
    i2mex_getVolume
    i2mex_getV
    i2mex_getVp
    i2mex_getVolumeAveragedPressure
    i2mex_getVolumeAveragedBSquare
    i2mex_getBeta
    i2mex_getBetaStar
    i2mex_getBetaToroidal
    i2mex_getBetaPoloidalFreidberg
    i2mex_getBetaPoloidal
    i2mex_getBetaN
    i2mex_getFrame
    i2mex_getRminor
    i2mex_getRmajor
    i2mex_getRmagnetic
    i2mex_getZmagnetic
    i2mex_getB0
    i2mex_getJdotBOverBSquare
    i2mex_getPolAvrgOneOverRSquare
    i2mex_getPolAvrgBSquare
    i2mex_getPlasmaCurrent
    i2mex_getLi
    i2mex_load
    i2mex_toAxisFraction
    i2mex_toEdgeFraction