Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(KORC_PARAMS), | intent(in) | :: | params | |||
type(FIELDS), | intent(in) | :: | F | |||
real(kind=rp), | intent(in), | DIMENSION(params%pchunk) | :: | Y_R | ||
real(kind=rp), | intent(in), | DIMENSION(params%pchunk) | :: | Y_PHI | ||
real(kind=rp), | intent(in), | DIMENSION(params%pchunk) | :: | Y_Z | ||
real(kind=rp), | intent(inout), | DIMENSION(params%pchunk) | :: | PSIp | ||
integer(kind=is), | intent(inout), | DIMENSION(params%pchunk) | :: | flag | ||
type(C_PTR), | intent(inout), | DIMENSION(params%pchunk) | :: | hint |
subroutine get_fio_vector_potential_p(params,F,Y_R,Y_PHI,Y_Z, &
PSIp,flag,hint)
TYPE(FIELDS), INTENT(IN) :: F
TYPE(KORC_PARAMS), INTENT(IN) :: params
REAL(rp), DIMENSION(params%pchunk), INTENT(IN) :: Y_R,Y_PHI,Y_Z
REAL(rp), DIMENSION(params%pchunk), INTENT(INOUT) :: PSIp
INTEGER(is), DIMENSION(params%pchunk), INTENT(INOUT) :: flag
TYPE(C_PTR), DIMENSION(params%pchunk), INTENT(INOUT) :: hint
INTEGER (C_INT) :: status
INTEGER :: pp,pchunk
REAL(rp), DIMENSION(3) :: x
REAL(rp), DIMENSION(3) :: Atmp
integer(ip) :: ss
pchunk=params%pchunk
do pp = 1,pchunk
if (flag(pp) .EQ. 1_is) then
x(1) = Y_R(pp)*params%cpp%length
x(2) = Y_PHI(pp)
x(3) = Y_Z(pp)*params%cpp%length
! prtcls%hint(pp)=c_null_ptr
status = fio_eval_field(F%FIO_A, x(1), &
Atmp(1),hint(pp))
if (status .eq. FIO_SUCCESS) then
PSIp(pp)=-Atmp(2)*x(1)
else if (status .eq. FIO_NO_DATA) then
PSIp(pp) = 100._rp
flag(pp) = 0_is
else if (status .ne. FIO_SUCCESS) then
PSIp(pp) = 100._rp
flag(pp) = 0_is
end if
end if
end do
end subroutine get_fio_vector_potential_p