sfl_boozer_new Function

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

Uses

  • proc~~sfl_boozer_new~~UsesGraph proc~sfl_boozer_new sfl_boozer_new module~modgvec_fbase MODgvec_fBase proc~sfl_boozer_new->module~modgvec_fbase module~modgvec_globals MODgvec_Globals proc~sfl_boozer_new->module~modgvec_globals module~modgvec_hmap MODgvec_hmap proc~sfl_boozer_new->module~modgvec_hmap module~modgvec_fbase->module~modgvec_globals iso_fortran_env iso_fortran_env module~modgvec_globals->iso_fortran_env module~modgvec_c_hmap MODgvec_c_hmap module~modgvec_hmap->module~modgvec_c_hmap module~modgvec_hmap_axisnb MODgvec_hmap_axisNB module~modgvec_hmap->module~modgvec_hmap_axisnb module~modgvec_hmap_cyl MODgvec_hmap_cyl module~modgvec_hmap->module~modgvec_hmap_cyl module~modgvec_hmap_frenet MODgvec_hmap_frenet module~modgvec_hmap->module~modgvec_hmap_frenet module~modgvec_hmap_knot MODgvec_hmap_knot module~modgvec_hmap->module~modgvec_hmap_knot module~modgvec_hmap_rz MODgvec_hmap_RZ module~modgvec_hmap->module~modgvec_hmap_rz module~modgvec_c_hmap->module~modgvec_globals module~modgvec_hmap_axisnb->module~modgvec_fbase module~modgvec_hmap_axisnb->module~modgvec_globals module~modgvec_hmap_axisnb->module~modgvec_c_hmap module~modgvec_io_netcdf MODgvec_IO_NETCDF module~modgvec_hmap_axisnb->module~modgvec_io_netcdf module~modgvec_hmap_cyl->module~modgvec_globals module~modgvec_hmap_cyl->module~modgvec_c_hmap module~modgvec_hmap_frenet->module~modgvec_globals module~modgvec_hmap_frenet->module~modgvec_c_hmap module~modgvec_hmap_knot->module~modgvec_globals module~modgvec_hmap_knot->module~modgvec_c_hmap module~modgvec_hmap_rz->module~modgvec_globals module~modgvec_hmap_rz->module~modgvec_c_hmap module~modgvec_io_netcdf->module~modgvec_globals

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


Calls

proc~~sfl_boozer_new~~CallsGraph proc~sfl_boozer_new sfl_boozer_new proc~hmap_new_auxvar hmap_new_auxvar proc~sfl_boozer_new->proc~hmap_new_auxvar

Called by

proc~~sfl_boozer_new~~CalledByGraph proc~sfl_boozer_new sfl_boozer_new interface~t_sfl_boozer t_sfl_boozer interface~t_sfl_boozer->proc~sfl_boozer_new

Source Code

FUNCTION sfl_boozer_new(mn_max,mn_nyq,nfp,sin_cos,hmap_in,nrho,rho_pos,iota,phiPrime,relambda_in) RESULT(sf)
  ! MODULES
  USE MODgvec_Globals, ONLY: UNIT_stdOut
  USE MODgvec_fbase, ONLY: t_fBase
  USE MODgvec_hmap, ONLY: hmap_new_auxvar
  IMPLICIT NONE
  ! INPUT VARIABLES -------------------------!
  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_"
#ifdef PP_WHICH_HMAP
  TYPE(PP_T_HMAP),INTENT(IN),TARGET :: hmap_in
#else
  CLASS(c_hmap)  ,INTENT(IN),TARGET :: hmap_in
#endif
  INTEGER,INTENT(IN) :: nrho       !! number of rho positions
  REAL(wp),INTENT(IN) :: rho_pos(nrho),iota(nrho),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.
  ! OUTPUT VARIABLES -------------------------!
  TYPE(t_sfl_boozer) :: sf !! self
  ! CODE --------------------------------------------------------------------------------------------------------------------------!
  SWRITE(UNIT_StdOut,'(A)') 'NEW sfl_boozer'
  sf%nrho = nrho
  ALLOCATE(sf%rho_pos(nrho),sf%iota(nrho),sf%phiPrime(nrho))
  sf%rho_pos = rho_pos
  IF(ANY((sf%rho_pos.LT.1e-4_wp).OR.(sf%rho_pos.GT. 1.0_wp))) CALL abort(__STAMP__, &
         "sfl_boozer_new: rho_pos must be >=1e-4 and <=1.0", &
         TypeInfo="InvalidParameterError")
  sf%iota = iota
  sf%phiPrime = phiPrime
  IF(PRESENT(relambda_in)) THEN
    sf%relambda=relambda_in
  ELSE
    sf%relambda = .TRUE. ! default
  END IF
  sf%nu_fbase = t_fBase(mn_max,mn_nyq,nfp,sin_cos,.TRUE.)
  sf%hmap => hmap_in
  CALL hmap_new_auxvar(sf%hmap,sf%nu_fbase%x_IP(2,:),sf%hmap_xv,.TRUE.)
  ALLOCATE(sf%lambda(sf%nu_fbase%modes,nrho),sf%nu(sf%nu_fbase%modes,nrho))
  sf%initialized=.TRUE.
  SWRITE(UNIT_StdOut,'(A)') '... DONE.'
END FUNCTION sfl_boozer_new