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
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


Calls

proc~~hmap_new~~CallsGraph proc~hmap_new hmap_new interface~enter_subregion enter_subregion proc~hmap_new->interface~enter_subregion interface~exit_subregion exit_subregion proc~hmap_new->interface~exit_subregion interface~enter_subregion->interface~enter_subregion interface~exit_subregion->interface~exit_subregion

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 Init proc~init->proc~initmhd3d proc~rungvec rungvec proc~rungvec->proc~initmhd3d program~gvec_post GVEC_POST program~gvec_post->proc~initmhd3d proc~init_gvec_to_jorek init_gvec_to_jorek proc~init_gvec_to_jorek->interface~readstate proc~restartfromstate RestartFromState proc~restartfromstate->interface~readstate proc~start_rungvec start_rungvec proc~start_rungvec->proc~rungvec program~gvec GVEC program~gvec->proc~rungvec

Source Code

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