initialize_c Subroutine

public subroutine initialize_c(ipointer) bind(C, name="initialize_c")

create a radbelt_type from C

Arguments

Type IntentOptional Attributes Name
integer(kind=c_intptr_t), intent(out) :: ipointer

Source Code

    subroutine initialize_c(ipointer) bind(C, name="initialize_c")

        integer(c_intptr_t), intent(out) :: ipointer
        type(radbelt_type), pointer :: p
        type(c_ptr) :: cp

        allocate (p)
        cp = c_loc(p)
        ipointer = transfer(cp, 0_c_intptr_t)

    end subroutine initialize_c