hmap_new Subroutine

public subroutine hmap_new(sf, which_hmap, hmap_in)

Uses

  • proc~~hmap_new~~UsesGraph proc~hmap_new hmap_new module~modgvec_globals MODgvec_Globals proc~hmap_new->module~modgvec_globals iso_fortran_env iso_fortran_env module~modgvec_globals->iso_fortran_env

initialize the type hmap, also readin parameters here if necessary

Arguments

Type IntentOptional Attributes Name
type(PP_T_HMAP), intent(inout), ALLOCATABLE :: sf

self

integer, intent(in) :: which_hmap

input number of field periods

type(PP_T_HMAP), intent(in), optional :: hmap_in

if present, copy this hmap


Calls

proc~~hmap_new~~CallsGraph proc~hmap_new hmap_new pp_t_hmap pp_t_hmap proc~hmap_new->pp_t_hmap

Called by

proc~~hmap_new~~CalledByGraph proc~hmap_new hmap_new proc~initmhd3d t_functional_mhd3d%InitMHD3D proc~initmhd3d->proc~hmap_new proc~readstatefilefromascii ReadStateFileFromASCII proc~readstatefilefromascii->proc~hmap_new interface~readstate ReadState interface~readstate->proc~readstatefilefromascii proc~init_gvec_to_jorek init_gvec_to_jorek proc~init_gvec_to_jorek->interface~readstate proc~restartfromstate RestartFromState proc~restartfromstate->interface~readstate

Source Code

SUBROUTINE hmap_new( sf, which_hmap,hmap_in)
! MODULES
USE MODgvec_Globals   , ONLY: abort
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)*/
!===================================================================================================================================
  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

END SUBROUTINE hmap_new