initialize the type hmap_frenet with number of elements
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nfp |
number of field periods |
||
| integer, | intent(in) | :: | n_max |
maximum mode number of guiding curve |
||
| integer, | intent(in) | :: | nvisu |
number of visualization points per field period (-1: no visualization) |
||
| real(kind=wp), | intent(in) | :: | Rc(0:n_max) |
R cos(-n*zeta) modes of guiding curve, 0..n_max |
||
| real(kind=wp), | intent(in) | :: | Rs(0:n_max) |
R sin(-n*zeta) modes of guiding curve, 0..n_max |
||
| real(kind=wp), | intent(in) | :: | Zc(0:n_max) |
Z cos(-n*zeta) modes of guiding curve, 0..n_max |
||
| real(kind=wp), | intent(in) | :: | Zs(0:n_max) |
Z sin(-n*zeta) modes of guiding curve, 0..n_max |
||
| logical, | intent(in) | :: | omnig |
omnigeneity, gives sign function of Frenet frame. False: sigma=1, True: sigma=+1 for 0<=zeta<=pi/nfp, and -1 for pi/nfp<zeta<2pi |
self
FUNCTION hmap_frenet_init_params(nfp,n_max,nvisu,Rc,Rs,Zc,Zs,omnig) RESULT(sf) ! MODULES IMPLICIT NONE !----------------------------------------------------------------------------------------------------------------------------------- ! INPUT VARIABLES INTEGER, INTENT(IN) :: nfp !! number of field periods INTEGER, INTENT(IN) :: n_max !! maximum mode number of guiding curve INTEGER, INTENT(IN) :: nvisu !! number of visualization points per field period (-1: no visualization) REAL(wp),INTENT(IN) :: Rc(0:n_max) !! R cos(-n*zeta) modes of guiding curve, 0..n_max REAL(wp),INTENT(IN) :: Rs(0:n_max) !! R sin(-n*zeta) modes of guiding curve, 0..n_max REAL(wp),INTENT(IN) :: Zc(0:n_max) !! Z cos(-n*zeta) modes of guiding curve, 0..n_max REAL(wp),INTENT(IN) :: Zs(0:n_max) !! Z sin(-n*zeta) modes of guiding curve, 0..n_max LOGICAL ,INTENT(IN) :: omnig !! omnigeneity, gives sign function of Frenet frame. False: sigma=1, !! True: sigma=+1 for 0<=zeta<=pi/nfp, and -1 for pi/nfp<zeta<2pi !----------------------------------------------------------------------------------------------------------------------------------- ! OUTPUT VARIABLES TYPE(t_hmap_frenet) :: sf !! self !----------------------------------------------------------------------------------------------------------------------------------- ! LOCAL VARIABLES INTEGER :: n !=================================================================================================================================== SWRITE(UNIT_stdOut,'(4X,A)')'INIT HMAP :: FRENET FRAME OF A CLOSED CURVE ...' sf%nfp=nfp IF(sf%nfp.LE.0) & CALL abort(__STAMP__, & "hmap_frenet init: nfp > 0 not fulfilled!",TypeInfo="MissingParameterError") sf%n_max=n_max ALLOCATE(sf%Xn(0:sf%n_max)) DO n=0,sf%n_max sf%Xn(n)=n*sf%nfp END DO ALLOCATE(sf%rc(0:sf%n_max));sf%rc=Rc ALLOCATE(sf%rs(0:sf%n_max));sf%rs=Rs ALLOCATE(sf%zc(0:sf%n_max));sf%zc=Zc ALLOCATE(sf%zs(0:sf%n_max));sf%zs=Zs sf%omnig=omnig IF (.NOT.(sf%rc(0) > 0.0_wp)) THEN CALL abort(__STAMP__, & "hmap_frenet init: condition rc(n=0) > 0 not fulfilled!",TypeInfo="InitializationError") END IF IF(MPIroot)THEN IF(nvisu.GT.0) CALL VisuFrenet(sf,nvisu*sf%nfp) CALL CheckZeroCurvature(sf) END IF sf%initialized=.TRUE. SWRITE(UNIT_stdOut,'(4X,A)')'...DONE.' IF(.NOT.test_called) CALL hmap_frenet_test(sf) END FUNCTION hmap_frenet_init_params