|
FMS
2025.04
Flexible Modeling System
|
Routines to use for string manipulation. More...
Functions/Subroutines | |
| character(len=:) function, allocatable | cpointer_fortran_conversion (cstring) |
| Converts a C-string returned from a TYPE(C_PTR) function to a fortran string with type character. More... | |
| character(len=:) function, allocatable | cstring_fortran_conversion (cstring) |
| Converts a C-string to a pointer and then to a Fortran string. More... | |
| type(c_ptr) function, dimension(:), allocatable, public | fms_array_to_pointer (my_array) |
| Converts a character array to an array of c pointers! More... | |
| subroutine, public | fms_f2c_string (dest, str_in) |
| Copies a Fortran string into a C string and puts c_null_char in any trailing spaces. More... | |
| integer function, dimension(:), allocatable, public | fms_find_my_string (my_pointer, narray, string_to_find) |
| Searches through a SORTED array of pointers for a string. More... | |
| character(len=:) function, dimension(:), allocatable, public | fms_pointer_to_array (my_pointer, narray) |
| Convert an array of c pointers back to a character array. More... | |
| character(:) function, allocatable, public | string (v, fmt) |
| Converts a number or a Boolean value to a string. More... | |
| subroutine, public | string_copy (dest, source, check_for_null) |
| Safely copy a string from one buffer to another. More... | |
Routines to use for string manipulation.
|
private |
Converts a C-string returned from a TYPE(C_PTR) function to a fortran string with type character.
| [in] | cstring | Input C-pointer |
Set the length of fstring
Definition at line 207 of file fms_string_utils.F90.
|
private |
Converts a C-string to a pointer and then to a Fortran string.
| [in] | cstring | Input C-string |
Definition at line 199 of file fms_string_utils.F90.
| type(c_ptr) function, dimension(:), allocatable, public fms_string_utils_mod::fms_array_to_pointer | ( | character(len=*), dimension(:), target | my_array | ) |
Converts a character array to an array of c pointers!
Definition at line 130 of file fms_string_utils.F90.
| subroutine, public fms_string_utils_mod::fms_f2c_string | ( | character (c_char), dimension (:), intent(out) | dest, |
| character (len=*), intent(in) | str_in | ||
| ) |
Copies a Fortran string into a C string and puts c_null_char in any trailing spaces.
| [out] | dest | C String to be copied into |
| [in] | str_in | Fortran string to copy to C string |
Drop an error if the C string is not large enough to hold the input and the c_null_char at the end.
Copy c_null_char into each spot in dest
Loop though and put each character of the Fortran string into the C string array
Definition at line 227 of file fms_string_utils.F90.
| integer function, dimension(:), allocatable, public fms_string_utils_mod::fms_find_my_string | ( | type(c_ptr), dimension(*), intent(in) | my_pointer, |
| integer, intent(in) | narray, | ||
| character(len=*), intent(in) | string_to_find | ||
| ) |
Searches through a SORTED array of pointers for a string.
| [in] | my_pointer | Array of c pointer |
| [in] | narray | Length of the array |
| [in] | string_to_find | string to find |
Definition at line 172 of file fms_string_utils.F90.
| character(len=:) function, dimension(:), allocatable, public fms_string_utils_mod::fms_pointer_to_array | ( | type(c_ptr), dimension(*), intent(in) | my_pointer, |
| integer, intent(in) | narray | ||
| ) |
Convert an array of c pointers back to a character array.
| [in] | my_pointer | Array of c pointer |
| [in] | narray | Length of the array |
Definition at line 148 of file fms_string_utils.F90.
| character(:) function, allocatable, public fms_string_utils_mod::string | ( | class(*), intent(in) | v, |
| character(*), intent(in), optional | fmt | ||
| ) |
Converts a number or a Boolean value to a string.
| [in] | v | Value to be converted to a string |
| [in] | fmt | Optional format string for a real or integral argument |
Definition at line 244 of file fms_string_utils.F90.
| subroutine, public fms_string_utils_mod::string_copy | ( | character(len=*), intent(inout) | dest, |
| character(len=*), intent(in) | source, | ||
| logical, intent(in), optional | check_for_null | ||
| ) |
Safely copy a string from one buffer to another.
| [in,out] | dest | Destination string. |
| [in] | source | Source string. |
| [in] | check_for_null | Flag indicating to test for null character |
Definition at line 303 of file fms_string_utils.F90.