parameters.f90


subroutine i2mex_getSpest1 (ns, psi, s, ier)

    Compute

    (integral_0^psi d psi q/g)/(integral_0^psimax d psi q/g)

    This is the radial coordinate used in PEST1 according to

    Manickam.

integer, intent(in) :: ns

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: s(ns)

integer, intent(out) :: ier


subroutine i2mex_getUpsilon (res, ier)

    Compute (R0/2*pi) * the volume integral dV/X**2 and return result

    in 'res'.

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getSurface (res, ier)

    Compute the plasma surface and return result in 'res'.

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getVolume (res, ier)

    Compute the plasma volume and return result in 'res'.

    ier error flag (ok if =0)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getV (ns, psi, res, ier)

    Compute the enclosed volume V(psi) and return the result in 'res'.

    ier error flag (ok if =0)

integer, intent(in) :: ns

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res(ns)

integer, intent(out) :: ier


subroutine i2mex_getVp (ns, psi, res, ier)

    Compute d/dpsi of enclosed volume V and return the result in 'res'.

    ier error flag (ok if =0)

integer, intent(in) :: ns

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res(ns)

integer, intent(out) :: ier


subroutine i2mex_getVolumeAveragedPressure (nt1, ns, the, psi, res, ier)

    compute <p>, the volume average pressure and return the result

    in 'res'. ier error flag (ok if =0)

integer, intent(in) :: nt1, ns

real(i2mex_r8), intent(in) :: the(nt1)

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getVolumeAveragedBSquare (nt1, ns, the, psi, res, ier)

    compute <B^2>, the volume average of the square of the magnetic field

    and return the result in 'res'. ier error flag (ok if =0)

integer, intent(in) :: nt1, ns

real(i2mex_r8), intent(in) :: the(nt1)

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getBeta (nt1, ns, the, psi, res, ier)

    Compute (the volume averaged) beta and return the result in 'res'.

    ier error flag (ok if =0)

integer, intent(in) :: nt1, ns

real(i2mex_r8), intent(in) :: the(nt1)

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getBetaStar (nt1, ns, the, psi, res, ier)

    Compute the (volume averaged) 2 sqrt(<p^2>)/B0^2

    and return the result in 'res'.

    ier error flag (ok if =0)

integer, intent(in) :: nt1, ns

real(i2mex_r8), intent(in) :: the(nt1)

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getBetaToroidal (nt1, ns, the, psi, res, ier)

    Compute beta-toroidal and return the result in 'res'.

    ier error flag (ok if =0)

integer, intent(in) :: nt1, ns

real(i2mex_r8), intent(in) :: the(nt1)

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getBetaPoloidalFreidberg (nt1, ns, the, psi, res, ier)

    Compute the approximate beta-poroidal and return the result in 'res'. The

    formula used is loosely based on Eq(4.32) in Ideal Magnetohydrodynamics

    by J P Freidberg, since there appears to be an error in Eq(4.29) therein.

    Call i2mex_getBetaPoloidal for a more accurate estimate of beta-poloidal.

    ier error flag (ok if =0)

integer, intent(in) :: nt1, ns

real(i2mex_r8), intent(in) :: the(nt1)

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getBetaPoloidal (nt1, ns, the, psi, res, ier)

    Compute beta-toroidal and return the result in 'res'.

    ier error flag (ok if =0)

integer, intent(in) :: nt1, ns

real(i2mex_r8), intent(in) :: the(nt1)

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getBetaN (nt1, ns, the, psi, res, ier)

    Compute the normalized beta (beta_N) and return the result in 'res'.

    ier error flag (ok if =0)

integer, intent(in) :: nt1, ns

real(i2mex_r8), intent(in) :: the(nt1)

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getFrame (xin, xout, zbot, ztop, ier)

    Compute the plasma boundary frame; ie the abscissae xin and xout

    where the plasma boundary intersects the mid plane, and the ordinates

    zbot and ztop where the plasma boundary intersects the vertical plane

    passing through the magnetic axis.

real(i2mex_r8), intent(out) :: xin     mid plane intersect inside

real(i2mex_r8), intent(out) :: xout     mid plane intersect outside

real(i2mex_r8), intent(out) :: zbot     bottom intersect below magnetic axis

real(i2mex_r8), intent(out) :: ztop     top intersect above magnetic axis

integer, intent(out) :: ier


subroutine i2mex_getRminor (res, ier)

    Compute the minor radius, and return the result in 'res'. The

    minor radius is defined as the half distance between Xout and Xin,

    where Xin and Xout are the plasma boundary points intersecting the

    mid plane.

   

    ier error flag (ok if =0)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getRmajor (res, ier)

    Compute the major radius, and return the result in 'res'. The

    major radius is defined as the average of Xout and Xin, where

    Xin and Xout are the plasma boundary points intersecting the

    mid plane.

   

    ier error flag (ok if =0)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getRmagnetic (res, ier)

    Compute the magnetic radius position, and return the result in 'res'.

    ier error flag (ok if =0)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getZmagnetic (res, ier)

    Compute the magnetic Z position, and return the result in 'res'.

    ier error flag (ok if =0)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getB0 (res, ier)

    Compute the vacuum magnetic field at the major radius position,

    and return the result in 'res'.

    ier error flag (ok if =0)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getJdotBOverBSquare (nt1, ns, the, psi, res, ier)

    Compute <J.B>/<B^2> and return the result in 'res'.

    ier error flag (ok if =0)

integer, intent(in) :: nt1, ns

real(i2mex_r8), intent(in) :: the(nt1)

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res(ns)

integer, intent(out) :: ier


subroutine i2mex_getPolAvrgOneOverRSquare (nt1, ns, the, psi, res, ier)

    Compute <1/R^2> = integral d theta J /X^2 / integral d theta J

    and return the result in 'res'.

    ier error flag (ok if =0)

integer, intent(in) :: nt1, ns

real(i2mex_r8), intent(in) :: the(nt1)

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res(ns)

integer, intent(out) :: ier


subroutine i2mex_getPolAvrgBSquare (nt1, ns, the, psi, res, ier)

    Compute <B^2> = integral d theta J B^2 / integral d theta J

    and return the result in 'res'.

    ier error flag (ok if =0)

integer, intent(in) :: nt1, ns

real(i2mex_r8), intent(in) :: the(nt1)

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res(ns)

integer, intent(out) :: ier


subroutine i2mex_getPlasmaCurrent (nt1, ns, the, psi, res, ier)

    Compute Ip, the plasma current, and return the result in 'res'.

    ier error flag (ok if =0)

integer, intent(in) :: nt1, ns

real(i2mex_r8), intent(in) :: the(nt1)

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


subroutine i2mex_getLi (nt1, ns, the, psi, res, ier)

    Compute li, the internal plasma inductance, and return the

    result in 'res'.

    ier error flag (ok if =0)

integer, intent(in) :: nt1, ns

real(i2mex_r8), intent(in) :: the(nt1)

real(i2mex_r8), intent(in) :: psi(ns)

real(i2mex_r8), intent(out) :: res

integer, intent(out) :: ier


Send comments about this document to Alexander Ppletzer. Thu Jan 26 12:43:46 2006