Convert an integer pointer to a radbelt_type pointer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=c_intptr_t), | intent(in) | :: | ipointer |
integer pointer from C |
||
type(radbelt_type), | pointer | :: | p |
fortran pointer |
subroutine int_pointer_to_f_pointer(ipointer, p) integer(c_intptr_t), intent(in) :: ipointer !! integer pointer from C type(radbelt_type), pointer :: p !! fortran pointer type(c_ptr) :: cp cp = transfer(ipointer, c_null_ptr) if (c_associated(cp)) then call c_f_pointer(cp, p) else p => null() end if end subroutine int_pointer_to_f_pointer