initialize the type hmap, also readin parameters here if necessary
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(c_hmap), | intent(inout), | ALLOCATABLE | :: | sf |
self |
|
| integer, | intent(in) | :: | which_hmap |
input number of field periods |
||
| class(c_hmap), | intent(in), | optional | :: | hmap_in |
if present, copy this hmap |
SUBROUTINE hmap_new( sf, which_hmap,hmap_in) ! MODULES USE MODgvec_Globals , ONLY: abort,enter_subregion,exit_subregion IMPLICIT NONE !----------------------------------------------------------------------------------------------------------------------------------- ! INPUT VARIABLES INTEGER , INTENT(IN ) :: which_hmap !! input number of field periods #ifdef PP_WHICH_HMAP TYPE(PP_T_HMAP), INTENT(IN),OPTIONAL :: hmap_in !! if present, copy this hmap !----------------------------------------------------------------------------------------------------------------------------------- ! OUTPUT VARIABLES TYPE(PP_T_HMAP),ALLOCATABLE,INTENT(INOUT) :: sf !! self #else CLASS(c_hmap), INTENT(IN),OPTIONAL :: hmap_in !! if present, copy this hmap !----------------------------------------------------------------------------------------------------------------------------------- ! OUTPUT VARIABLES CLASS(c_hmap),ALLOCATABLE,INTENT(INOUT) :: sf !! self #endif /*defined(PP_WHICH_HMAP)*/ !=================================================================================================================================== CALL enter_subregion("hmap") IF(.NOT. PRESENT(hmap_in))THEN SELECT CASE(which_hmap) #ifdef PP_WHICH_HMAP CASE(PP_WHICH_HMAP) sf=PP_T_HMAP() CASE DEFAULT CALL abort(__STAMP__, & "FIXED HMAP TO PP_WHICH_HMAP AT COMPILE TIME, hmap choice is therefore not compatible !") #else CASE(1) sf=t_hmap_RZ() !CASE(2) ! ALLOCATE(t_hmap_RphiZ :: sf) CASE(3) sf=t_hmap_cyl() CASE(10) sf=t_hmap_knot() CASE(20) sf=t_hmap_frenet() CASE(21) sf=t_hmap_axisNB() CASE DEFAULT CALL abort(__STAMP__, & "this hmap choice does not exist !") #endif /*defined(PP_WHICH_HAP)*/ END SELECT sf%which_hmap=which_hmap ELSE IF(which_hmap.NE.hmap_in%which_hmap) CALL abort(__STAMP__, & "hmap_in does not coincide with requested hmap in hmap_new") ALLOCATE(sf,source=hmap_in) END IF CALL exit_subregion("hmap") END SUBROUTINE hmap_new