radbelt_c_module Module

Experimental C interface to the radbelt module.


Uses

  • module~~radbelt_c_module~~UsesGraph module~radbelt_c_module radbelt_c_module iso_c_binding iso_c_binding module~radbelt_c_module->iso_c_binding module~radbelt_module radbelt_module module~radbelt_c_module->module~radbelt_module module~radbelt_kinds_module radbelt_kinds_module module~radbelt_module->module~radbelt_kinds_module module~shellig_module shellig_module module~radbelt_module->module~shellig_module module~trmfun_module trmfun_module module~radbelt_module->module~trmfun_module iso_fortran_env iso_fortran_env module~radbelt_kinds_module->iso_fortran_env module~shellig_module->module~radbelt_kinds_module module~trmfun_module->module~radbelt_kinds_module

Functions

public function c2f_str(cstr) result(fstr)

Convert C string to Fortran

Arguments

Type IntentOptional Attributes Name
character(kind=c_char, len=1), intent(in), dimension(:) :: cstr

string from C

Return Value character(len=:), allocatable

fortran string


Subroutines

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

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

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

destroy a radbelt_type from C

Arguments

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

public subroutine set_trm_file_path_c(ipointer, aep8_dir, n) bind(C, name="set_trm_file_path_c")

C interface for setting the trm data file path

Arguments

Type IntentOptional Attributes Name
integer(kind=c_intptr_t), intent(in) :: ipointer
character(kind=c_char, len=1), intent(in), dimension(n) :: aep8_dir
integer(kind=c_int), intent(in) :: n

size of aep8_dir

public subroutine set_igrf_file_path_c(ipointer, igrf_dir, n) bind(C, name="set_igrf_file_path")

C interface for setting the igrf data file path

Arguments

Type IntentOptional Attributes Name
integer(kind=c_intptr_t), intent(in) :: ipointer
character(kind=c_char, len=1), intent(in), dimension(n) :: igrf_dir
integer(kind=c_int), intent(in) :: n

size of igrf_dir

public subroutine set_data_files_paths_c(ipointer, aep8_dir, igrf_dir, n, m) bind(C, name="set_data_files_paths_c")

C interface for setting the data file paths

Arguments

Type IntentOptional Attributes Name
integer(kind=c_intptr_t), intent(in) :: ipointer
character(kind=c_char, len=1), intent(in), dimension(n) :: aep8_dir
character(kind=c_char, len=1), intent(in), dimension(m) :: igrf_dir
integer(kind=c_int), intent(in) :: n

size of aep8_dir

integer(kind=c_int), intent(in) :: m

size of igrf_dir

public subroutine get_flux_g_c(ipointer, lon, lat, height, year, e, imname, flux) bind(C, name="get_flux_g_c")

C interface to get_flux_g.

Arguments

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

geodetic longitude in degrees (east)

real(kind=c_double), intent(in) :: lat

geodetic latitude in degrees (north)

real(kind=c_double), intent(in) :: height

altitude in km above sea level

real(kind=c_double), intent(in) :: year

decimal year for which geomagnetic field is to be calculated (e.g.:1995.5 for day 185 of 1995)

real(kind=c_double), intent(in) :: e

minimum energy

integer(kind=c_int), intent(in) :: imname

which method to use:

Read more…
real(kind=c_double), intent(out) :: flux

The flux of particles above the given energy, in units of cm^-2 s^-1.