ceq_testing_type Derived Type

type, public :: ceq_testing_type

Expose private routines for testing only!


Contents

Source Code


Type-Bound Procedures

procedure, public, nopass :: alloc_arrays

  • private subroutine alloc_arrays(nr, nt)

    Allocate module-level arrays

    Arguments

    Type IntentOptional AttributesName
    integer, intent(in) :: nr

    Number of points in radial direction

    integer, intent(in) :: nt

    Number of points in theta direction

procedure, public, nopass :: chease_chi_index

  • private function chease_chi_index(nchi, itheta)

    Convert from theta-index which is -pi to pi, to chi-index, which is 0 to 2*pi. Assumes nchi is even?

    Arguments

    Type IntentOptional AttributesName
    integer, intent(in) :: nchi
    integer, intent(in) :: itheta

    Return Value integer

procedure, public, nopass :: dealloc_arrays

  • private subroutine dealloc_arrays()

    Deallocate module-level arrays

    Arguments

    None

procedure, public, nopass :: derm

  • private subroutine derm(f, dfm, char)

    Calculate the derivative of f w.r.t to the radial and poloidal indexes (i.e. calculate the finite differences without dividing by delta psi and delta theta). - dfm(:,:,1) is the psi derivative - dfm(:,:,2) is the theta derivative - char specifies the periodicity in theta - 'E', 'O' mean continuous at theta = +/- pi - 'T' means a jump of 2 pi at theta = +/- pi

    Arguments

    Type IntentOptional AttributesName
    real, intent(in) :: f(:,:)
    real, intent(out) :: dfm(:,:,:)
    character(len=1), intent(in) :: char

procedure, public, nopass :: eqdbish

  • public subroutine eqdbish(dcart, dbish)

    Convert gradients of a function f w.r.t. R,Z into bishop form Note that dbish(1, :, :) is not valid

    Arguments

    Type IntentOptional AttributesName
    real, intent(in), dimension(:, :, :):: dcart

    dcart(:,:,1) is gradient of f w.r.t. R; dcart(:,:,2) is gradient of f w.r.t. Z

    real, intent(out), dimension(:, :, :):: dbish

    dbish(:,:,1) is set to (df/dR dpsi/dR + df/dZ dpsi/dZ)/|grad psi|; dbish(:,:,2) is set to (-df/dR dpsi/dZ + df/dZ dpsi/dR)/|grad psi|. Note that in the special case where f=psi: dbish(:,:,1) is |grad psi|; dbish(:,:,2) is 0

procedure, public, nopass :: eqdcart

  • private subroutine eqdcart(dfm, dfcart)

    Converts derivatives w.r.t. (psi_index,theta_index) to derivatives w.r.t. (R,Z). Note that dfcart(1, :, :) is not valid

    Arguments

    Type IntentOptional AttributesName
    real, intent(in), dimension (:,:,:):: dfm

    dfm(:,:,1) is deriv w.r.t. psi_index (i.e. (df/dpsi)_theta * delta psi); dfm(:,:,2) is deriv w.r.t. theta_index

    real, intent(out), dimension (:,:,:):: dfcart

    dfcart(:,:,1) is deriv w.r.t. R; dfcart(:,:,2) is deriv w.r.t. Z

procedure, public, nopass :: mod2pi

  • private function mod2pi(theta)

    Put theta into the range

    Arguments

    Type IntentOptional AttributesName
    real, intent(in) :: theta

    Return Value real

procedure, public, nopass :: set_ceq_from_chease

procedure, public, nopass :: set_dpcart

  • private subroutine set_dpcart(dpcart_in)

    Set module-level dpcart PURELY FOR TESTING FIXME: Remove when we have more control over module-level variables for testing

    Arguments

    Type IntentOptional AttributesName
    real, intent(in), dimension(nr,nt,2):: dpcart_in

procedure, public, nopass :: set_drm

  • private subroutine set_drm(drm_in)

    Set module-level drm PURELY FOR TESTING FIXME: Remove when we have more control over module-level variables for testing

    Arguments

    Type IntentOptional AttributesName
    real, intent(in), dimension(nr,nt,2):: drm_in

procedure, public, nopass :: set_dzm

  • private subroutine set_dzm(dzm_in)

    Set module-level dzm PURELY FOR TESTING FIXME: Remove when we have more control over module-level variables for testing

    Arguments

    Type IntentOptional AttributesName
    real, intent(in), dimension(nr,nt,2):: dzm_in

procedure, public, nopass :: set_eqpsi

  • private subroutine set_eqpsi(eqpsi_in)

    Set module-level eqpsi PURELY FOR TESTING FIXME: Remove when we have more control over module-level variables for testing

    Arguments

    Type IntentOptional AttributesName
    real, intent(in), dimension(nr):: eqpsi_in

procedure, public, nopass :: set_nrnt

  • private subroutine set_nrnt(nradius, ntheta)

    Set module-level nt, nr PURELY FOR TESTING FIXME: Remove when we have more control over module-level variables for testing

    Arguments

    Type IntentOptional AttributesName
    integer, intent(in) :: nradius
    integer, intent(in) :: ntheta

procedure, public, nopass :: set_R_psi

  • private subroutine set_R_psi(R_psi_in)

    Set module-level R_psi PURELY FOR TESTING FIXME: Remove when we have more control over module-level variables for testing

    Arguments

    Type IntentOptional AttributesName
    real, intent(in), dimension(nr, nt):: R_psi_in

procedure, public, nopass :: set_Z_psi

  • private subroutine set_Z_psi(Z_psi_in)

    Set module-level Z_psi PURELY FOR TESTING FIXME: Remove when we have more control over module-level variables for testing

    Arguments

    Type IntentOptional AttributesName
    real, intent(in), dimension(nr, nt):: Z_psi_in

procedure, public, nopass :: set_cart_arrays

  • private subroutine set_cart_arrays(dpcart_in, dbtcart_in, dtcart_in)

    Set module-level dpcart, dbtcart and dtcart PURELY FOR TESTING FIXME: Remove when we have more control over module-level variables for testing

    Arguments

    Type IntentOptional AttributesName
    real, intent(in), dimension(nr, nt, 2):: dpcart_in
    real, intent(in), dimension(nr, nt, 2):: dbtcart_in
    real, intent(in), dimension(nr, nt, 2):: dtcart_in

procedure, public, nopass :: set_bish_arrays

  • private subroutine set_bish_arrays(dpbish_in, dbtbish_in, dtbish_in)

    Set module-level dpbish, dbtbish and dtbish PURELY FOR TESTING FIXME: Remove when we have more control over module-level variables for testing

    Arguments

    Type IntentOptional AttributesName
    real, intent(in), dimension(nr, nt, 2):: dpbish_in
    real, intent(in), dimension(nr, nt, 2):: dbtbish_in
    real, intent(in), dimension(nr, nt, 2):: dtbish_in

procedure, public, nopass :: get_cart_arrays

  • private subroutine get_cart_arrays(dpcart_out, dbtcart_out, dtcart_out)

    Get module-level dpcart, dbtcart and dtcart PURELY FOR TESTING FIXME: Remove when we have more control over module-level variables for testing

    Arguments

    Type IntentOptional AttributesName
    real, intent(out), dimension(nr, nt, 2):: dpcart_out
    real, intent(out), dimension(nr, nt, 2):: dbtcart_out
    real, intent(out), dimension(nr, nt, 2):: dtcart_out

procedure, public, nopass :: get_bish_arrays

  • private subroutine get_bish_arrays(dpbish_out, dbtbish_out, dtbish_out)

    Get module-level dpbish, dbtbish and dtbish PURELY FOR TESTING FIXME: Remove when we have more control over module-level variables for testing

    Arguments

    Type IntentOptional AttributesName
    real, intent(out), dimension(nr, nt, 2):: dpbish_out
    real, intent(out), dimension(nr, nt, 2):: dbtbish_out
    real, intent(out), dimension(nr, nt, 2):: dtbish_out

Source Code

  type :: ceq_testing_type
  contains
    procedure, nopass :: alloc_arrays
    procedure, nopass :: chease_chi_index
    procedure, nopass :: dealloc_arrays
    procedure, nopass :: derm
    procedure, nopass :: eqdbish
    procedure, nopass :: eqdcart
    procedure, nopass :: mod2pi
    procedure, nopass :: set_ceq_from_chease
    procedure, nopass :: set_dpcart
    procedure, nopass :: set_drm
    procedure, nopass :: set_dzm
    procedure, nopass :: set_eqpsi
    procedure, nopass :: set_nrnt
    procedure, nopass :: set_R_psi
    procedure, nopass :: set_Z_psi
    procedure, nopass :: set_cart_arrays
    procedure, nopass :: set_bish_arrays
    procedure, nopass :: get_cart_arrays
    procedure, nopass :: get_bish_arrays
  end type ceq_testing_type