plotdata Subroutine

private subroutine plotdata(rgrid, seik, grads, dpsidrho, dr, theta, rplot, zplot, aplot, rprime, zprime, aprime)

FIXME : Add documentation

Arguments

Type IntentOptional Attributes Name
real, intent(in), dimension (-ntgrid:) :: rgrid
real, intent(in), dimension (-ntgrid:) :: seik
real, intent(in), dimension (-ntgrid:, :) :: grads
real, intent(in) :: dpsidrho
real, intent(in) :: dr
real, intent(in), dimension (-ntgrid:) :: theta
real, intent(out), dimension (-ntgrid:) :: rplot
real, intent(out), dimension (-ntgrid:) :: zplot
real, intent(out), dimension (-ntgrid:) :: aplot
real, intent(out), dimension (-ntgrid:) :: rprime
real, intent(out), dimension (-ntgrid:) :: zprime
real, intent(out), dimension (-ntgrid:) :: aprime

Contents

Source Code


Source Code

  subroutine plotdata (rgrid, seik, grads, dpsidrho, dr, theta, &
       rplot, zplot, aplot, rprime, zprime, aprime)
    implicit none
    real, dimension (-ntgrid:), intent(in) :: rgrid, seik, theta
    real, dimension (-ntgrid:, :), intent(in) :: grads
    real, dimension (-ntgrid:), intent(out) :: rplot, zplot, aplot, rprime, zprime, aprime
    real, intent (in) :: dpsidrho, dr
    real :: rplus, rminus, dr_tot
    integer :: i
    ! At the present flux surface, calculate these three functions
    ! as a function of theta, together with their derivates with
    ! respect to rho:
    !
    ! R, Z, alpha-phi
    !
    ! Call these variables
    !
    ! Rplot, Zplot, aplot
    !
    ! and their derivatives:
    !
    ! Rprime, Zprime, aprime
    !
    ! BD: bug??
    ! Is this correct for EFIT data?  Need to check
    do i = -ntgrid, ntgrid
       Rplot(i) = geom%Rpos(rgrid(i), theta(i))
       Zplot(i) = geom%Zpos(rgrid(i), theta(i))
    end do
    aplot = seik

    do i = -ntgrid, ntgrid
       rplus  = rgrid(i) * (1 + dr) ; rminus = rgrid(i) * (1 - dr)
       dr_tot = 2 * dr * rgrid(i)
       Rprime(i) = (geom%Rpos(rplus, theta(i)) - geom%Rpos(rminus, theta(i))) / dr_tot
       Zprime(i) = (geom%Zpos(rplus, theta(i)) - geom%Zpos(rminus, theta(i))) / dr_tot
    end do
    aprime = grads(:, 1) * dpsidrho
  end subroutine plotdata