initialize_SC1D_field_interpolant_FS Subroutine

public subroutine initialize_SC1D_field_interpolant_FS(params, F)

This subroutine initializes either 2-D or 3-D PSPLINE interpolants using the data of fields in the KORC-dervied-type variable F.

Arguments

Type IntentOptional AttributesName
type(KORC_PARAMS), intent(in) :: params

Core KORC simulation parameters.

type(FIELDS), intent(in) :: F

An instance of KORC's derived type FIELDS containing all the information about the fields used in the simulation. See korc_types and korc_fields.


Calls

proc~~initialize_sc1d_field_interpolant_fs~~CallsGraph proc~initialize_sc1d_field_interpolant_fs initialize_SC1D_field_interpolant_FS ezspline_init ezspline_init proc~initialize_sc1d_field_interpolant_fs->ezspline_init ezspline_allocated ezspline_allocated proc~initialize_sc1d_field_interpolant_fs->ezspline_allocated ezspline_error ezspline_error proc~initialize_sc1d_field_interpolant_fs->ezspline_error ezspline_setup ezspline_setup proc~initialize_sc1d_field_interpolant_fs->ezspline_setup

Called by

proc~~initialize_sc1d_field_interpolant_fs~~CalledByGraph proc~initialize_sc1d_field_interpolant_fs initialize_SC1D_field_interpolant_FS proc~calculate_sc_e1d_fs calculate_SC_E1D_FS proc~calculate_sc_e1d_fs->proc~initialize_sc1d_field_interpolant_fs proc~reinit_sc_e1d_fs reinit_SC_E1D_FS proc~reinit_sc_e1d_fs->proc~initialize_sc1d_field_interpolant_fs proc~init_sc_e1d_fs init_SC_E1D_FS proc~init_sc_e1d_fs->proc~initialize_sc1d_field_interpolant_fs proc~adv_gcinterp_psi_top_fs adv_GCinterp_psi_top_FS proc~adv_gcinterp_psi_top_fs->proc~calculate_sc_e1d_fs program~main main program~main->proc~reinit_sc_e1d_fs program~main->proc~adv_gcinterp_psi_top_fs

Contents


Source Code

  subroutine initialize_SC1D_field_interpolant_FS(params,F)
    !! @note Subroutine that initializes fields interpolants. @endnote
    !! This subroutine initializes either 2-D or 3-D PSPLINE interpolants
    !! using the data of fields in the KORC-dervied-type variable F.
    TYPE(KORC_PARAMS), INTENT(IN)  :: params
    !! Core KORC simulation parameters.
    TYPE(FIELDS), INTENT(IN)       :: F
    !! An instance of KORC's derived type FIELDS containing all the information
    !! about the fields used in the simulation.
    !! See [[korc_types]] and [[korc_fields]].
    integer :: ii,jj

     
!    if (EZspline_allocated(efield_SC1d%PHI)) &
!         call Ezspline_free(efield_SC1d%PHI, ezerr)

    if (.not.(EZspline_allocated(efield_SC1d%PHI))) then
       efield_SC1d%NPSIP = F%dim_1D

       call EZspline_init(efield_SC1d%PHI,efield_SC1d%NPSIP, &
            efield_SC1d%BCSPSIP,ezerr)
       call EZspline_error(ezerr)

       efield_SC1d%PHI%x1 = F%PSIP_1D/(params%cpp%Bo*params%cpp%length**2)
    end if

    call EZspline_setup(efield_SC1d%PHI, F%E_SC_1D%PHI, ezerr, .TRUE.)
    call EZspline_error(ezerr)

    if (.not.ALLOCATED(fields_domain%FLAG1D)) &
         ALLOCATE(fields_domain%FLAG1D(efield_SC1d%Nrm))

    fields_domain%DPSIP = ABS(F%PSIP_1D(2) - F%PSIP_1D(1))

  end subroutine initialize_SC1D_field_interpolant_FS