|
Neko 1.99.11
A portable framework for high-order spectral element flow simulations
|
Utilities. More...
Data Types | |
| interface | neko_error |
| interface | read_duration |
| interface | throw_intf |
| Interface for the throw procedure. Follows pFunit conventions. More... | |
| interface | c_mkdir |
Functions/Subroutines | |
| subroutine, public | default_throw_warning (filename, line_number, message) |
| Default throw method for warnings. Does nothing. | |
| subroutine, public | default_throw_error (filename, line_number, message) |
| Default throw method that stops execution. | |
| pure integer function, public | filename_suffix_pos (fname) |
| Find position (in the string) of a filename's suffix. | |
| pure integer function, public | filename_tslash_pos (fname) |
| Find position (in the string) of a filename's trailing slash. | |
| subroutine, public | filename_path (fname, path) |
| Extract the path to a file. | |
| subroutine, public | filename_name (fname, name) |
| Extract the base name of a file (without path and suffix). | |
| subroutine, public | filename_suffix (fname, suffix) |
| Extract a filename's suffix. | |
| subroutine, public | filename_split (fname, path, name, suffix) |
| Extract file name components. | |
| subroutine, public | filename_chsuffix (fname, new_fname, new_suffix) |
| Change a filename's suffix. | |
| recursive subroutine, public | mkdir (path, mode) |
| Recursively create a directory and all parent directories if they do not exist. This should be safer than the execute_command_line('mkdir -p ' // path) approach, which can be used to execute arbitrary code if path is not properly sanitized. | |
| integer function, public | extract_fld_file_index (fld_filename, default_index) |
| Extracts the index of a field file. For example, "myfield.f00045" will return 45. If the suffix of the file name is invalid, returns a default index value. | |
| character(len=100) function, dimension(:), allocatable, public | split_string (string, delimiter) |
| Split a string based on delimiter (tokenizer) OBS: very hacky, this should really be improved, it is rather embarrasing code. | |
| pure integer function, public | linear_index (i, j, k, l, lx, ly, lz) |
| Compute the address of a (i,j,k,l) array with sizes (1:lx, 1:ly, 1:lz, :). | |
| pure integer function, dimension(4), public | nonlinear_index (linear_index, lx, ly, lz) |
| Compute (i,j,k,l) array given linear index with sizes (1:lx, 1:ly, 1:lz, :). | |
| pure logical function, public | index_is_on_facet (i, j, k, lx, ly, lz, facet) |
| subroutine | neko_error_plain (error_code) |
| Reports an error and calls throw_error, which stops execution by default. | |
| subroutine | neko_error_msg (error_msg) |
| Reports an error and calls throw_error, which stops execution by default. | |
| subroutine, public | neko_type_error (base_type, wrong_type, known_types) |
| Reports an error allocating a type for a particular base pointer class. | |
| subroutine, public | neko_type_registration_error (base_type, wrong_type, known) |
| subroutine, public | neko_warning (warning_msg) |
| Reports a warning to standard output. | |
| character(:) function, allocatable, public | concat_string_array (array, sep, prepend) |
| Concatenate an array of strings into one string with array items separated by spaces. | |
| subroutine | read_duration_scalar (runtime_string, runtime_seconds, ierr) |
| Parse runtime string to total seconds. Supported formats are: | |
| subroutine | read_duration_components (runtime_string, runtime_values, ierr) |
| Parse runtime string to components. The output array maps to the largest unit available based on size: | |
| real(kind=dp) function | read_duration_internal (runtime_string, ierr) |
| Parse runtime string to total seconds. | |
| subroutine | set_error_or_throw (message, ierr) |
| Raise parser error or set ierr, depending on call mode. | |
Variables | |
| integer, parameter, public | neko_fname_len = 1024 |
| integer, parameter, public | neko_varname_len = 256 |
| integer, parameter, public | neko_typename_len = 64 |
| procedure(throw_intf), pointer, public | throw_error => null() |
| Pointer to the throw procedure. | |
| procedure(throw_intf), pointer, public | throw_warning => null() |
| Same as above, but for warnings. Does nothing by default. | |
Various utility functions
| character(:) function, allocatable, public utils::concat_string_array | ( | character(len=*), dimension(:), intent(in) | array, |
| character(len=*), intent(in) | sep, | ||
| logical, intent(in) | prepend ) |
| subroutine, public utils::default_throw_error | ( | character(len=*), intent(in) | filename, |
| integer, intent(in) | line_number, | ||
| character(len=*), intent(in), optional | message ) |
| subroutine, public utils::default_throw_warning | ( | character(len=*), intent(in) | filename, |
| integer, intent(in) | line_number, | ||
| character(len=*), intent(in), optional | message ) |
| integer function, public utils::extract_fld_file_index | ( | character(len=*), intent(in) | fld_filename, |
| integer, intent(in) | default_index ) |
| subroutine, public utils::filename_chsuffix | ( | character(len=*) | fname, |
| character(len=*) | new_fname, | ||
| character(len=*) | new_suffix ) |
| subroutine, public utils::filename_name | ( | character(len=*), intent(in) | fname, |
| character(len=*), intent(out) | name ) |
| subroutine, public utils::filename_path | ( | character(len=*), intent(in) | fname, |
| character(len=*), intent(out) | path ) |
| subroutine, public utils::filename_split | ( | character(len=*), intent(in) | fname, |
| character(len=*), intent(out) | path, | ||
| character(len=*), intent(out) | name, | ||
| character(len=*), intent(out) | suffix ) |
| subroutine, public utils::filename_suffix | ( | character(len=*) | fname, |
| character(len=*) | suffix ) |
| pure integer function, public utils::filename_suffix_pos | ( | character(len=*), intent(in) | fname | ) |
| pure integer function, public utils::filename_tslash_pos | ( | character(len=*), intent(in) | fname | ) |
| pure logical function, public utils::index_is_on_facet | ( | integer, intent(in) | i, |
| integer, intent(in) | j, | ||
| integer, intent(in) | k, | ||
| integer, intent(in) | lx, | ||
| integer, intent(in) | ly, | ||
| integer, intent(in) | lz, | ||
| integer, intent(in) | facet ) |
| pure integer function, public utils::linear_index | ( | integer, intent(in) | i, |
| integer, intent(in) | j, | ||
| integer, intent(in) | k, | ||
| integer, intent(in) | l, | ||
| integer, intent(in) | lx, | ||
| integer, intent(in) | ly, | ||
| integer, intent(in) | lz ) |
| recursive subroutine, public utils::mkdir | ( | character(len=*), intent(in) | path, |
| integer, intent(in), optional | mode ) |
|
private |
|
private |
| subroutine, public utils::neko_type_error | ( | character(len=*), intent(in) | base_type, |
| character(len=*), intent(in) | wrong_type, | ||
| character(len=*), dimension(:), intent(in) | known_types ) |
Should be used in factories.
| base_type | The base type of the object, which the factory tried to construct. |
| wrong_type | The type that was attempted to construct. |
| known_types | A list of the types that are known. |
Definition at line 414 of file utils.f90.


| subroutine, public utils::neko_type_registration_error | ( | character(len=*), intent(in) | base_type, |
| character(len=*), intent(in) | wrong_type, | ||
| logical, intent(in) | known ) |
| subroutine, public utils::neko_warning | ( | character(len=*) | warning_msg | ) |
| pure integer function, dimension(4), public utils::nonlinear_index | ( | integer, intent(in) | linear_index, |
| integer, intent(in) | lx, | ||
| integer, intent(in) | ly, | ||
| integer, intent(in) | lz ) |
|
private |
|
private |
|
private |
|
private |
| character(len=100) function, dimension(:), allocatable, public utils::split_string | ( | character(len=*) | string, |
| character(len=*) | delimiter ) |
| procedure(throw_intf), pointer, public utils::throw_error => null() |
| procedure(throw_intf), pointer, public utils::throw_warning => null() |