t_sfl_boozer Derived Type

type, public :: t_sfl_boozer

Class for the computation of the boozer transform, on a given radial grid positions rho, with iota(rho) phiPrime(rho) values.

theta^Boozer=theta+lambda+iota(rho)*nu(rho,theta,zeta) zeta^Boozer =zeta +nu(rho,theta,zeta)


Inherits

type~~t_sfl_boozer~~InheritsGraph type~t_sfl_boozer t_sfl_boozer type~c_hmap c_hmap type~t_sfl_boozer->type~c_hmap hmap type~c_hmap_auxvar c_hmap_auxvar type~t_sfl_boozer->type~c_hmap_auxvar hmap_xv type~t_fbase t_fBase type~t_sfl_boozer->type~t_fbase nu_fbase

Inherited by

type~~t_sfl_boozer~~InheritedByGraph type~t_sfl_boozer t_sfl_boozer type~t_transform_sfl t_transform_sfl type~t_transform_sfl->type~t_sfl_boozer booz

Components

Type Visibility Attributes Name Initial
logical, public :: initialized = .FALSE.

set to true in init, set to false in free

integer, public :: nrho

number of rho positions

logical, public :: relambda

if =True, J^s=0 will be recomputed, for exact integrability condition of boozer transform (but slower!)

type(t_fBase), public :: nu_fbase
real(kind=wp), public, ALLOCATABLE :: rho_pos(:)

rho positions, iota and phiPrime at these rho positions

real(kind=wp), public, ALLOCATABLE :: iota(:)

rho positions, iota and phiPrime at these rho positions

real(kind=wp), public, ALLOCATABLE :: phiPrime(:)

rho positions, iota and phiPrime at these rho positions

real(kind=wp), public, ALLOCATABLE :: lambda(:,:)

Fourier modes for all rho positions of lambda (recomputed on the fourier space of nu) and nu for boozer transform , (iMode,irho)

real(kind=wp), public, ALLOCATABLE :: nu(:,:)

Fourier modes for all rho positions of lambda (recomputed on the fourier space of nu) and nu for boozer transform , (iMode,irho)

class(c_hmap), public, POINTER :: hmap

pointer to hmap class

class(c_hmap_auxvar), public, ALLOCATABLE :: hmap_xv(:)

auxiliary variables for hmap


Constructor

public interface t_sfl_boozer

  • private function sfl_boozer_new(mn_max, mn_nyq, nfp, sin_cos, hmap_in, nrho, rho_pos, iota, phiPrime, relambda_in) result(sf)

    initialize sfl boozer class

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: mn_max(2)

    maximum Fourier modes in theta and zeta

    integer, intent(in) :: mn_nyq(2)

    number of equidistant integration points (trapezoidal rule) in m and n

    integer, intent(in) :: nfp

    number of field periods

    character(len=8) :: sin_cos

    can be either only sine: " sin" only cosine: " cos" or full: "sin_cos"

    class(c_hmap), intent(in), TARGET :: hmap_in
    integer, intent(in) :: nrho

    number of rho positions

    real(kind=wp), intent(in) :: rho_pos(nrho)

    rho positions, iota and phiPrime at these rho positions

    real(kind=wp), intent(in) :: iota(nrho)

    rho positions, iota and phiPrime at these rho positions

    real(kind=wp), intent(in) :: phiPrime(nrho)

    rho positions, iota and phiPrime at these rho positions

    logical, intent(in), optional :: relambda_in

    DEFAULT=TRUE: lambda is recomputed on the given fourier resolution, RECOMMENDED for exact integrability condition of boozer transform, but slower. FALSE: lambda from equilibrium solution is taken.

    Return Value type(t_sfl_boozer)

    self


Finalization Procedures

final :: sfl_boozer_free

  • public subroutine sfl_boozer_free(sf)

    finalize sfl boozer class

    Arguments

    Type IntentOptional Attributes Name
    type(t_sfl_boozer), intent(inout) :: sf

    self


Type-Bound Procedures

procedure, public :: get_boozer => Get_Boozer_sinterp

  • private subroutine Get_Boozer_sinterp(sf, X1_base_in, X2_base_in, LA_base_in, X1_in, X2_in, LA_in)

    Builds the boozer transform coordinate theta^B = theta + lambda + iota(s)*nu(s,theta,zeta) zeta^B = zeta +nu(s,theta,zeta)

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(t_sfl_boozer), intent(inout) :: sf
    class(t_base), intent(in) :: X1_base_in
    class(t_base), intent(in) :: X2_base_in
    class(t_base), intent(in) :: LA_base_in
    real(kind=wp), intent(in) :: X1_in(1:X1_base_in%s%nbase,1:X1_base_in%f%modes)
    real(kind=wp), intent(in) :: X2_in(1:X2_base_in%s%nbase,1:X2_base_in%f%modes)
    real(kind=wp), intent(in) :: LA_in(1:LA_base_in%s%nbase,1:LA_base_in%f%modes)

procedure, public :: find_angles => self_find_boozer_angles

  • private subroutine self_find_boozer_angles(sf, tz_dim, tz_boozer, thetzeta_out)

    interface to find_boozer_angles from the class t_sfl_boozer

    Arguments

    Type IntentOptional Attributes Name
    class(t_sfl_boozer), intent(in) :: sf
    integer, intent(in) :: tz_dim
    real(kind=wp), intent(in) :: tz_boozer(2,tz_dim)
    real(kind=wp), intent(out) :: thetzeta_out(2,tz_dim,sf%nrho)

    theta,zeta position in original angles, for given boozer angles

procedure, public :: find_angles_irho => self_find_boozer_angles_irho

  • private subroutine self_find_boozer_angles_irho(sf, irho, tz_dim, tz_boozer, thetzeta_out)

    interface to find_boozer_angles from the class t_sfl_boozer

    Arguments

    Type IntentOptional Attributes Name
    class(t_sfl_boozer), intent(in) :: sf
    integer, intent(in) :: irho
    integer, intent(in) :: tz_dim
    real(kind=wp), intent(in) :: tz_boozer(2,tz_dim)
    real(kind=wp), intent(out) :: thetzeta_out(2,tz_dim)

Source Code

TYPE :: t_sfl_boozer
  !---------------------------------------------------------------------------------------------------------------------------------
  LOGICAL              :: initialized=.FALSE.      !! set to true in init, set to false in free
  !---------------------------------------------------------------------------------------------------------------------------------
  !input parameters
  INTEGER  :: nrho       !! number of rho positions
  LOGICAL  :: relambda   !! if =True, J^s=0 will be recomputed, for exact integrability condition of boozer transform  (but slower!)
  TYPE(t_fbase) :: nu_fbase

  REAL(wp),ALLOCATABLE::rho_pos(:),iota(:),phiPrime(:) !! rho positions, iota and phiPrime at these rho positions
  ! computed in the boozer transform
  REAL(wp),ALLOCATABLE::lambda(:,:),nu(:,:)   !! Fourier modes for all rho positions of lambda (recomputed on the fourier space of nu) and nu for boozer transform , (iMode,irho)
#ifdef PP_WHICH_HMAP
  TYPE(PP_T_HMAP),  POINTER     :: hmap          !! pointer to hmap class
  TYPE(PP_T_HMAP_AUXVAR),ALLOCATABLE   :: hmap_xv(:) !! auxiliary variables for hmap
#else
  CLASS(c_hmap),  POINTER     :: hmap          !! pointer to hmap class
  CLASS(c_hmap_auxvar),ALLOCATABLE   :: hmap_xv(:) !! auxiliary variables for hmap
#endif
  CONTAINS
  PROCEDURE :: get_boozer  => get_boozer_sinterp
  FINAL     ::                sfl_boozer_free
  PROCEDURE :: find_angles => self_find_boozer_angles
  PROCEDURE :: find_angles_irho => self_find_boozer_angles_irho
END TYPE t_sfl_boozer