int_pointer_to_f_pointer Subroutine

public subroutine int_pointer_to_f_pointer(ipointer, p)

Convert an integer pointer to a radbelt_type pointer.

Arguments

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

integer pointer from C

type(radbelt_type), pointer :: p

fortran pointer


Called by

proc~~int_pointer_to_f_pointer~~CalledByGraph proc~int_pointer_to_f_pointer radbelt_c_module::int_pointer_to_f_pointer proc~destroy_c radbelt_c_module::destroy_c proc~destroy_c->proc~int_pointer_to_f_pointer proc~get_flux_g_c radbelt_c_module::get_flux_g_c proc~get_flux_g_c->proc~int_pointer_to_f_pointer proc~set_data_files_paths_c radbelt_c_module::set_data_files_paths_c proc~set_data_files_paths_c->proc~int_pointer_to_f_pointer proc~set_igrf_file_path_c radbelt_c_module::set_igrf_file_path_c proc~set_igrf_file_path_c->proc~int_pointer_to_f_pointer proc~set_trm_file_path_c radbelt_c_module::set_trm_file_path_c proc~set_trm_file_path_c->proc~int_pointer_to_f_pointer

Source Code

    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