Subroutine that initializes fields interpolants.
This subroutine initializes either 2-D or 3-D PSPLINE interpolants using the data of fields in the KORC-dervied-type variable F.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
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. |
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