All Utilities functions are located here
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=c_int), | private, | parameter | :: | RTLD_LAZY | = | 1_c_int |
Each external function reference is bound the first time the function is called. |
integer(kind=c_int), | private, | parameter | :: | RTLD_NOW | = | 2_c_int |
All external function references are bound when the library is loaded. |
Convert various types to string
Convert 8-bit integer to string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int8), | intent(in) | :: | n |
Integer to convert |
Resulting string
Convert 32-bit integer to string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | n |
Integer to convert |
Resulting string
Convert 64-bit integer to string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int64), | intent(in) | :: | n |
Integer to convert |
Resulting string
Convert double to string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | n |
Double to convert |
Resulting string
Convert double to string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | n |
Double to convert |
Resulting string
Frees memory allocated with aligned_alloc
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | value | :: | ptr |
Pointer to free |
Converts Fortran communicator to C
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=c_int), | value | :: | fcomm |
Fortran communicator |
Checks if pointer can be accessed from device
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | value | :: | ptr |
Device pointer |
Result
Creates string object
Creates string object
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | str |
String |
Checks if pointer is NULL
Checks if pointer is NULL
Checks if pointer is NULL
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_funptr), | intent(in) | :: | ptr |
Pointer to check |
Load and link a dynamic library
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=c_char) | :: | filename(*) |
Name of the library |
|||
integer(kind=c_int), | value | :: | mode |
Options to dlopen |
Handle to the library
Get address of a symbol from a dynamic library
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | value | :: | handle |
Handle to the library |
||
character(len=c_char) | :: | name(*) |
Name of the symbol |
Address of the symbol
Close a dynamic library
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | value | :: | handle |
Handle to the library |
Result of the operation
Get diagnostic information
Error message
Allocates memory using C11 Standard alloc_align with 16 bytes alignment
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=c_size_t), | value | :: | alignment |
Alignment in bytes (16 bytes by default) |
||
integer(kind=c_size_t), | value | :: | alloc_size |
Number of bytes to allocate |
Pointer to allocate
Class used to create array of strings
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | raw |
String |
Creates string object
private function string_constructor (str) | Creates string object |
procedure, public, pass(self) :: destroy => destroy_string |
Dynamically loads library and its symbols
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | name |
Name of library to load |
||
type(string), | intent(in) | :: | symbol_names(:) |
Names of functions to load |
||
type(c_ptr), | intent(out) | :: | handle |
Loaded handle |
||
type(c_funptr), | intent(out) | :: | symbols(:) |
Function pointers |
Error code
Get the inverse R2R kind of transform for the given R2R kind
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(dtfft_r2r_kind_t), | intent(in) | :: | r2r_kind |
R2R kind |
Checks if pointer is NULL
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | intent(in) | :: | ptr |
Pointer to check |
Checks if two pointer are the same
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | intent(in) | :: | ptr1 |
First pointer |
||
type(c_ptr), | intent(in) | :: | ptr2 |
Second pointer |
Count the number of unique elements in the array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | x(:) |
Array of integers |
Allocates memory using C11 Standard alloc_align with 16 bytes alignment
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int64), | intent(in) | :: | alloc_size |
Number of bytes to allocate |
Pointer to allocate
Dynamically loads library
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | name |
Name of library to load |
Loaded handle
Dynamically loads symbol from library
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | intent(in) | :: | handle |
Loaded handle |
||
character(len=*), | intent(in) | :: | name |
Name of function to load |
Function pointer
Convert 8-bit integer to string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int8), | intent(in) | :: | n |
Integer to convert |
Resulting string
Convert 32-bit integer to string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | n |
Integer to convert |
Resulting string
Convert 64-bit integer to string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int64), | intent(in) | :: | n |
Integer to convert |
Resulting string
Convert double to string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real64), | intent(in) | :: | n |
Double to convert |
Resulting string
Convert double to string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=real32), | intent(in) | :: | n |
Double to convert |
Resulting string
Checks if pointer is NULL
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_funptr), | intent(in) | :: | ptr |
Pointer to check |
Convert Fortran string to C string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fstring |
Fortran string |
||
character(kind=c_char, len=1), | intent(inout) | :: | cstring(*) |
C string |
||
integer(kind=int64), | intent(out), | optional | :: | string_size |
Size of the C string |
Convert C string to Fortran string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr) | :: | cstring |
C string |
|||
character(len=:), | allocatable | :: | fstring |
Fortran string |
Convert Fortran string to C allocatable string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | fstring |
Fortran string |
||
character(kind=c_char, len=1), | intent(out), | allocatable | :: | cstring(:) |
C string |
|
integer(kind=int64), | intent(out), | optional | :: | string_size |
Size of the C string |
Write message to the specified unit
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
integer(kind=int32), | intent(in) | :: | unit |
Unit number |
||
character(len=*), | intent(in) | :: | message |
Message to write |
||
character(len=*), | intent(in), | optional | :: | prefix |
Prefix to the message |
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(string), | intent(inout) | :: | self |
Writes error message to the error unit
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | message |
Message to write |
Unloads library
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(c_ptr), | intent(in) | :: | handle |
Loaded handle |