Transform to Straight-field line BOOZER coordinates
initialize sfl boozer class
| Type | Intent | Optional | 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. |
self
Class for the computation of the boozer transform, on a given radial grid positions rho, with iota(rho) phiPrime(rho) values.
| 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 |
| private function sfl_boozer_new (mn_max, mn_nyq, nfp, sin_cos, hmap_in, nrho, rho_pos, iota, phiPrime, relambda_in) | initialize sfl boozer class |
| final :: sfl_boozer_free |
| procedure, public :: get_boozer => Get_Boozer_sinterp | |
| procedure, public :: find_angles => self_find_boozer_angles | |
| procedure, public :: find_angles_irho => self_find_boozer_angles_irho |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(t_fBase), | public, | POINTER | :: | AB_fbase_in | |||
| real(kind=wp), | public, | POINTER | :: | A_in(:) | |||
| real(kind=wp), | public, | POINTER | :: | B_in(:) | |||
| real(kind=wp), | public | :: | x0(2) |
| procedure, public :: FR => get_booz_newton_FR | |
| procedure, public :: dFR => get_booz_newton_dFR |
initialize sfl boozer class
| Type | Intent | Optional | 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. |
self
This function returns the result of the 2D newton root search for the boozer angle
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | x0(2) | |||
| real(kind=wp), | intent(in) | :: | bounds(2) | |||
| type(t_fBase), | intent(in), | TARGET | :: | AB_fbase_in | ||
| real(kind=wp), | intent(in), | TARGET | :: | A_in(1:AB_fbase_in%modes) | ||
| real(kind=wp), | intent(in), | TARGET | :: | B_in(1:AB_fbase_in%modes) |
Target function for finding the logical angle for given boozer angles
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_newton_Root2D_boozer), | intent(in) | :: | sf | |||
| real(kind=wp), | intent(in) | :: | x(2) |
Derivative of the target function for finding the logical angle for given boozer angles
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_newton_Root2D_boozer), | intent(in) | :: | sf | |||
| real(kind=wp), | intent(in) | :: | x(2) |
finalize sfl boozer class
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(t_sfl_boozer), | intent(inout) | :: | sf |
self |
Builds the boozer transform coordinate theta^B = theta + lambda + iota(s)*nu(s,theta,zeta) zeta^B = zeta +nu(s,theta,zeta)
| Type | Intent | Optional | 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) |
interface to find_boozer_angles from the class t_sfl_boozer
| Type | Intent | Optional | 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 |
interface to find_boozer_angles from the class t_sfl_boozer
| Type | Intent | Optional | 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) |
on one flux surface, find for an given list of (thet_j,zeta_j), the corresponding (thet_j,zeta_j) positions, given Here, new boozer angles are theta=theta+Gt(theta,zeta) zeta=zeta+nu(theta,zeta), with Gt=lambda+iotanu and nu periodic functions and zero average and same base Note that in this routine, we will use a 2d root search with a newton method, setting [f1,f2]^T = [thet+A(thet,zeta)-thet=0, zeta+B(thet,zeta)-zeta*=0]^T that includes the derivatives (Jacobian), so that the newton step needs to the solved: -[f1] [ 1+dA/dthet dA/dzeta] [dthet] | | = | | | | -[f2] [ dB/dthet 1+dB/dzeta] [dzeta]
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nrho |
number of surfaces, (second dimension of LA_in and nu_in modes) |
||
| real(kind=wp), | intent(in) | :: | iota(nrho) |
iota at the rho positions. |
||
| type(t_fBase), | intent(in) | :: | fbase_in | |||
| real(kind=wp), | intent(in) | :: | LA_in(1:fbase_in%modes,nrho) | |||
| real(kind=wp), | intent(in) | :: | nu_in(1:fbase_in%modes,nrho) | |||
| 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,nrho) |
theta,zeta position in original angles, for given boozer angles |