Transform to Straight-field line angles, PEST / BOOZER
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | spos |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| logical, | public | :: | initialized | = | .FALSE. |
set to true in init, set to false in free |
|
| integer, | public | :: | whichSFLcoord | ||||
| integer, | public | :: | fac_nyq | ||||
| integer, | public | :: | mn_max(2) | ||||
| integer, | public | :: | deg | ||||
| integer, | public | :: | continuity | ||||
| integer, | public | :: | degGP | ||||
| integer, | public | :: | nfp | ||||
| integer, | public | :: | mn_nyq(2) |
number of integration points in fbase for X1sfl,X2sfl,Gtsfl,GZsfl |
|||
| integer, | public | :: | mn_nyq_booz(2) |
number of integration points in fbase for boozer transform (fbase of GZ_base) |
|||
| integer, | public | :: | X1sfl_sin_cos | ||||
| integer, | public | :: | X2sfl_sin_cos | ||||
| integer, | public | :: | GZ_sin_cos | ||||
| logical, | public | :: | booz_relambda |
=T: recompute lambda from mapping on full fourier series, =F: use LA from eq. |
|||
| integer, | public | :: | to_angle_method |
=1: "interpolate": root search of interpolation points (mn_nyq=2(m_max,n_max)+1) in sfl angles, =2: "integrate": project to sfl angles with trapezoidal rule (integral with transform, mn_nyq=4(m_max,n_max)+1) |
|||
| type(t_sGrid), | public | :: | sgrid_sfl |
grid for SFL coordinates |
|||
| class(c_hmap), | public, | POINTER | :: | hmap |
pointer to hmap class |
||
| class(t_base), | public, | ALLOCATABLE | :: | X1sfl_base |
container for base of variable X1 in SFL coordinates |
||
| class(t_base), | public, | ALLOCATABLE | :: | X2sfl_base |
container for base of variable X2 in SFL coordinates |
||
| class(t_base), | public, | ALLOCATABLE | :: | GZ_base |
container for base of variable Gthet and Gzeta (transforms to BOOZER!) |
||
| class(t_base), | public, | ALLOCATABLE | :: | GZsfl_base |
container for base of variable Gtheta and Gzeta in SFL coordinates |
||
| real(kind=wp), | public, | ALLOCATABLE | :: | X1sfl(:,:) |
data (1:nBase,1:modes) of X1 in SFL coords. |
||
| real(kind=wp), | public, | ALLOCATABLE | :: | X2sfl(:,:) |
data (1:nBase,1:modes) of X2 in SFL coords. |
||
| real(kind=wp), | public, | ALLOCATABLE | :: | Gthet(:,:) |
data (1:nBase,1:modes) of Gthet in GVEC coords. (for BOOZER) |
||
| real(kind=wp), | public, | ALLOCATABLE | :: | GZ(:,:) |
data (1:nBase,1:modes) of GZ in GVEC coords. (for BOOZER) |
||
| real(kind=wp), | public, | ALLOCATABLE | :: | Gtsfl(:,:) |
data (1:nBase,1:modes) of Gt in SFL coords. (for BOOZER) |
||
| real(kind=wp), | public, | ALLOCATABLE | :: | GZsfl(:,:) |
data (1:nBase,1:modes) of GZ in SFL coords. (for BOOZER) |
||
| type(t_sfl_boozer), | public, | ALLOCATABLE | :: | booz |
subclass needed for boozer transform |
||
| procedure(i_func_evalprof), | public, | POINTER, NOPASS | :: | eval_phiPrime | |||
| procedure(i_func_evalprof), | public, | POINTER, NOPASS | :: | eval_iota |
| procedure, public :: init => transform_SFL_init | |
| procedure, public :: BuildTransform => BuildTransform_SFL | |
| procedure, public :: free => transform_SFL_free |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(t_fBase), | public, | POINTER | :: | LA_fbase_in | |||
| real(kind=wp), | public, | POINTER | :: | LA_in(:) | |||
| real(kind=wp), | public | :: | zeta |
| procedure, public :: FRdFR => pest_newton_FRdFR |
This function returns the result of the 1D newton root search for the pest theta angle
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | theta_star | |||
| real(kind=wp), | intent(in) | :: | zeta | |||
| type(t_fBase), | intent(in), | TARGET | :: | LA_fbase_in | ||
| real(kind=wp), | intent(in), | TARGET | :: | LA_in(1:LA_fbase_in%modes) |
Function for 1D newton root search for PEST
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_newton_Root1D_FdF_pest), | intent(in) | :: | sf | |||
| real(kind=wp), | intent(in) | :: | x |
Allocate class and call init
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(t_transform_sfl), | intent(inout), | ALLOCATABLE | :: | sf |
self |
|
| integer, | intent(in) | :: | mn_max_in(2) | |||
| integer, | intent(in) | :: | whichSFL | |||
| integer, | intent(in) | :: | deg_in | |||
| integer, | intent(in) | :: | continuity_in | |||
| integer, | intent(in) | :: | degGP_in | |||
| class(t_sGrid), | intent(in), | TARGET | :: | grid_in |
grid information |
|
| class(c_hmap), | intent(in), | TARGET | :: | hmap_in | ||
| class(t_base), | intent(in), | TARGET | :: | X1_base_in | ||
| class(t_base), | intent(in), | TARGET | :: | X2_base_in | ||
| class(t_base), | intent(in), | TARGET | :: | LA_base_in | ||
| procedure(i_func_evalprof) | :: | eval_phiPrime_in |
procedure pointers to profile evaluation functions. |
|||
| procedure(i_func_evalprof) | :: | eval_iota_in |
procedure pointers to profile evaluation functions. |
|||
| logical, | intent(in), | optional | :: | booz_relambda |
for boozer transform, recompute lambda (recommended) |
get_new
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_transform_sfl), | intent(inout) | :: | sf |
self |
Builds X1 and X2 in SFL coordinates
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_transform_sfl), | intent(inout) | :: | sf |
self |
||
| 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) |
Transform a function from the GVEC angles q(s,theta,zeta) to new angles q(s,theta,zeta*) by using interpolation in angular direction (fourier transform) and spline interpolation in radial direction (at s_IP points of output base) the interpolation points are given by thetazeta_IP, which are the angle positions of an equidistant interpolation grid in PEST/Boozer angles
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_base), | intent(in) | :: | q_base_in | |||
| real(kind=wp), | intent(in) | :: | q_in(1:q_base_in%s%nBase,1:q_base_in%f%modes) | |||
| character(len=*), | intent(in) | :: | q_name | |||
| class(t_base), | intent(in) | :: | q_base_out | |||
| real(kind=wp), | intent(inout) | :: | q_out(q_base_out%s%nBase,1:q_base_out%f%modes) | |||
| real(kind=wp), | intent(in) | :: | thetazeta_IP(2,q_base_out%f%mn_IP,q_base_out%s%nBase) |
Helper routine to go from spline interpolation points to spline coefficients and apply smooth axis boundary condition.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_base), | intent(in) | :: | q_base_out | |||
| real(kind=wp), | intent(in) | :: | q_m(1:q_base_out%f%modes,1:q_base_out%s%nBase) | |||
| real(kind=wp), | intent(out) | :: | q_out(q_base_out%s%nBase,1:q_base_out%f%modes) |
Transform a function from VMEC angles q(s,theta,zeta) to new angles q(s,theta,zeta) by projection onto the modes of the new angles: sigma_mn(theta,zeta) using a given in s Here, new angles are theta=theta+A(theta,zeta), zeta=zeta+B(theta,zeta), with A,B periodic functions and zero average and same base Note that in this routine, the integral is transformed back to (theta,zeta) q_mn = iint_0^2pi q(theta,zeta) sigma_mn(theta,zeta) dtheta dzeta = iint_0^2pi q(theta,zeta) sigma_mn(theta,zeta) [(1+dA/dtheta)(1+dB/dzeta)-(dA/dzetadB/dzeta)] dtheta dzeta
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_base), | intent(in) | :: | AB_base_in | |||
| real(kind=wp), | intent(in) | :: | A_in(1:AB_base_in%s%nBase,1:AB_base_in%f%modes) | |||
| class(t_base), | intent(in) | :: | q_base_in | |||
| real(kind=wp), | intent(in) | :: | q_in(1:q_base_in%s%nBase,1:q_base_in%f%modes) | |||
| character(len=*), | intent(in) | :: | q_name | |||
| class(t_base), | intent(in) | :: | q_base_out | |||
| real(kind=wp), | intent(inout) | :: | q_out(q_base_out%s%nBase,1:q_base_out%f%modes) | |||
| real(kind=wp), | intent(in), | optional | :: | B_in(1:AB_base_in%s%nBase,1:AB_base_in%f%modes) |
on one flux surface, find for a list of in thet_j,zeta_j, the corresponding (thet_j,zeta_j) positions, given Here, new PEST angles are theta=theta+lambda(theta,zeta) zeta=zeta, so a 1D root search in theta is is enough
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nrho |
number of surfaces, (second dimension of LA_in and nu_in modes) |
||
| type(t_fBase), | intent(in) | :: | fbase_in | |||
| real(kind=wp), | intent(in) | :: | LA_in(1:fbase_in%modes,nrho) | |||
| integer, | intent(in) | :: | tz_dim | |||
| real(kind=wp), | intent(in) | :: | tz_pest(2,tz_dim) | |||
| real(kind=wp), | intent(out) | :: | thetzeta_out(2,tz_dim,nrho) |
theta,zeta position in original angles, for given pest angles |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(t_transform_sfl), | intent(inout) | :: | sf |
self |