initialize_SC1D_field_interpolant Subroutine

public subroutine initialize_SC1D_field_interpolant(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~~CallsGraph proc~initialize_sc1d_field_interpolant initialize_SC1D_field_interpolant ezspline_init ezspline_init proc~initialize_sc1d_field_interpolant->ezspline_init ezspline_allocated ezspline_allocated proc~initialize_sc1d_field_interpolant->ezspline_allocated ezspline_error ezspline_error proc~initialize_sc1d_field_interpolant->ezspline_error ezspline_setup ezspline_setup proc~initialize_sc1d_field_interpolant->ezspline_setup

Called by

proc~~initialize_sc1d_field_interpolant~~CalledByGraph proc~initialize_sc1d_field_interpolant initialize_SC1D_field_interpolant proc~calculate_sc_e1d calculate_SC_E1D proc~calculate_sc_e1d->proc~initialize_sc1d_field_interpolant proc~init_sc_e1d init_SC_E1D proc~init_sc_e1d->proc~initialize_sc1d_field_interpolant proc~reinit_sc_e1d reinit_SC_E1D proc~reinit_sc_e1d->proc~initialize_sc1d_field_interpolant program~main main program~main->proc~reinit_sc_e1d proc~adv_gceqn_top adv_GCeqn_top program~main->proc~adv_gceqn_top proc~adv_gceqn_top->proc~calculate_sc_e1d

Contents


Source Code

  subroutine initialize_SC1D_field_interpolant(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%Nrm = F%dim_1D

       call EZspline_init(efield_SC1d%PHI,efield_SC1d%Nrm, &
            efield_SC1d%BCSrm,ezerr)
       call EZspline_error(ezerr)

       efield_SC1d%PHI%x1 = F%r_1D/params%cpp%length
    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%Drm = ABS(F%r_1D(2) - F%r_1D(1))

  end subroutine initialize_SC1D_field_interpolant