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) |
SUBROUTINE transform_sfl_new(sf,mn_max_in, whichSFL,deg_in,continuity_in,degGP_in,grid_in, & hmap_in,X1_base_in,X2_base_in,LA_base_in,eval_phiPrime_in,eval_iota_in,booz_relambda) ! MODULES IMPLICIT NONE !----------------------------------------------------------------------------------------------------------------------------------- ! INPUT VARIABLES INTEGER ,INTENT(IN) :: mn_max_in(2) !< maximum number for new variables in SFL coordinates INTEGER ,INTENT(IN) :: whichSFL !< either =1: PEST, =2:Boozer INTEGER ,INTENT(IN) :: deg_in,continuity_in,degGP_in !< for output base (X1,X2,G) CLASS(t_sgrid),INTENT(IN),TARGET :: grid_in !! grid information CLASS(t_base),INTENT(IN),TARGET :: X1_base_in,X2_base_in,LA_base_in !< base classes belong to solution U_in #ifdef PP_WHICH_HMAP TYPE( PP_T_HMAP),INTENT(IN),TARGET :: hmap_in #else CLASS(PP_T_HMAP),INTENT(IN),TARGET :: hmap_in #endif PROCEDURE(i_func_evalprof) :: eval_phiPrime_in,eval_iota_in !!procedure pointers to profile evaluation functions. LOGICAL,INTENT(IN),OPTIONAL :: booz_relambda !! for boozer transform, recompute lambda (recommended) !----------------------------------------------------------------------------------------------------------------------------------- ! OUTPUT VARIABLES TYPE(t_transform_sfl), ALLOCATABLE,INTENT(INOUT) :: sf !! self !=================================================================================================================================== ALLOCATE(t_transform_sfl :: sf) sf%hmap => hmap_in sf%eval_phiPrime=>eval_PhiPrime_in sf%eval_iota=>eval_iota_in !TEST !WRITE(*,*)'DEBUG,phiprime= ? ',sf%eval_phiPrime(0.0_wp),sf%eval_phiPrime(1.0_wp) !WRITE(*,*)'DEBUG,iota= ? ',sf%eval_iota(0.0_wp),sf%eval_iota(1.0_wp) !pass any grid here CALL sf%sgrid_sfl%copy(grid_in) sf%mn_max=mn_max_in; sf%deg=deg_in; sf%continuity=continuity_in ; sf%degGP = degGP_in sf%nfp = X1_base_in%f%nfp sf%whichSFLcoord=whichSFL IF(PRESENT(booz_relambda))THEN sf%booz_relambda=booz_relambda ELSE sf%booz_relambda=.TRUE. !relambda !if =True, J^s=0 will be recomputed, for exact integrability condition of boozer transform (but slower!) END IF sf%fac_nyq=4 !hard coded for now sf%mn_nyq_booz(1:2)=sf%fac_nyq*MAXVAL(sf%mn_max)+1 ! for boozer transform ! use maximum number of integration points from maximum mode number in both directions sf%to_angle_method=1 !HARD CODED TO NEWTON ROOT SEARCH for interpolation points, faster than projection SELECT CASE(sf%to_angle_method) CASE(1) !INTERPOLATION sf%mn_nyq(1:2)=2*sf%mn_max+1 !only interpolation (=Fourier transform) CASE(2) !PROJECTION (previous way) sf%mn_nyq(1:2)=sf%mn_nyq_booz !projection with trapezoidal rule END SELECT sf%X1sfl_sin_cos=X1_base_in%f%sin_cos sf%X2sfl_sin_cos=X2_base_in%f%sin_cos sf%GZ_sin_cos =LA_base_in%f%sin_cos CALL sf%init() END SUBROUTINE transform_sfl_new