MONC
|
Conversion between common inbuilt FORTRAN data types. More...
Data Types | |
interface | conv_is_integer |
Determines whether a data item can be represented as an integer or not. More... | |
interface | conv_is_logical |
Determines whether a data item can be represented as a logical or not. More... | |
interface | conv_is_real |
Determines whether a data item can be represented as a real or not. More... | |
interface | conv_to_generic |
Converts a data type into the generic (class *) form. More... | |
interface | conv_to_integer |
Converts data types to integers. More... | |
interface | conv_to_logical |
Converts data types to logical. More... | |
interface | conv_to_real |
Converts data types to real. More... | |
interface | conv_to_string |
Converts data types to strings. More... | |
Functions/Subroutines | |
real(kind=double_precision) function, public | conv_single_real_to_double (input_real) |
Converts from a single to double precision real. This applies some rounding to a certain number of decimal places to ignore very small fractions. More... | |
logical function | string_is_integer (string) |
Determines whether a string is an integer or not. More... | |
logical function | string_is_real (string) |
Determines whether a string is a real or not. More... | |
logical function | string_is_logical (string) |
Determines whether a string is a logical or not. More... | |
character(len=str_length) function, pointer | generic_to_string (generic, makecopy, str_length) |
Converts a generic to a string. More... | |
character(len=15) function | integer_to_string (input) |
Converts an integer to a string. More... | |
character(len=30) function | real_single_to_string (input, decimal_places, exponent, exponent_small_numbers) |
Converts a single precision real to a string. More... | |
character(len=30) function | real_double_to_string (input, decimal_places, exponent, exponent_small_numbers) |
Converts a double precision real to a string. More... | |
subroutine | limit_to_decimal_places (string_to_parse, decimal_places) |
Helper subroutine which trims the string down to an upper limit of decimal places, with all numbers beyond this point removed. More... | |
subroutine | trim_trailing_zeros (string_to_parse, zeros_to_retain) |
A helper subroutine which trims training zeros from the string after a decimal place this is to make the string more readable when printed out. More... | |
character(len=5) function | logical_to_string (input) |
Converts a logical to a string. More... | |
logical function, pointer | generic_to_logical (generic, makecopy) |
Converts a generic to a logical. More... | |
logical function | string_to_logical (string) |
Converts a string to a logical. More... | |
logical function | integer_to_logical (input) |
Converts an integer to a logical. More... | |
logical function | real_to_logical (input) |
Converts a real to a logical. More... | |
real(kind=default_precision) function, pointer, public | generic_to_double_real (generic, makecopy) |
Converts a generic to a double real. More... | |
real function, pointer | generic_to_real (generic, makecopy) |
Converts a generic to a real. If this is infact an integer then will do a conversion and allocate pointed to this. More... | |
real function | string_to_real (string) |
Converts a string to a real. More... | |
real function | integer_to_real (input) |
Converts an integer to a real. More... | |
real function | logical_to_real (input) |
Converts a logical to a real. More... | |
integer function, pointer | generic_to_integer (generic, makecopy) |
Converts a generic to an integer. More... | |
integer function | string_to_integer (string) |
Converts a string to an integer. More... | |
integer function | real_to_integer (input) |
Converts a real to an integer. More... | |
integer function | logical_to_integer (input) |
Converts a logical to an integer. More... | |
class(*) function, pointer | string_to_generic (string, makecopy) |
Converts a string into its generic data representation. More... | |
class(*) function, pointer | integer_to_generic (input, makecopy) |
Converts an integer into its generic data representation. More... | |
class(*) function, pointer | real_single_to_generic (input, makecopy) |
Converts a single real into its generic data representation. More... | |
class(*) function, pointer | real_double_to_generic (input, makecopy) |
Converts a double real into its generic data representation. More... | |
class(*) function, pointer | logical_to_generic (input, makecopy) |
Converts a logical into its generic data representation. More... | |
Variables | |
logical | l_original_rounding = .False. |
integer, parameter | real_rounding_precision =int(1e8) |
Conversion between common inbuilt FORTRAN data types.
The user will still need to supply conversions between their derived types but this makes it easier when handling common inbuilt type conversions.
real(kind=double_precision) function, public conversions_mod::conv_single_real_to_double | ( | real(kind=single_precision), intent(in) | input_real | ) |
Converts from a single to double precision real. This applies some rounding to a certain number of decimal places to ignore very small fractions.
input_real | The single precision real to convert |
Definition at line 113 of file conversions.F90.
real(kind=default_precision) function, pointer, public conversions_mod::generic_to_double_real | ( | class(*), intent(in), pointer | generic, |
logical, intent(in) | makecopy | ||
) |
Converts a generic to a double real.
generic | The generic to convert into a double real |
makecopy | Whether to use a copy of the generic data or not |
Definition at line 413 of file conversions.F90.
|
private |
Converts a generic to an integer.
generic | The generic to convert into an integer |
makecopy | Whether to use a copy of the generic data or not |
Definition at line 493 of file conversions.F90.
|
private |
Converts a generic to a logical.
generic | The generic to convert into a logical |
makecopy | Whether to use a copy of the generic data or not |
Definition at line 352 of file conversions.F90.
|
private |
Converts a generic to a real. If this is infact an integer then will do a conversion and allocate pointed to this.
generic | The generic to convert into a real |
makecopy | Whether to use a copy of the generic data or not |
Definition at line 434 of file conversions.F90.
|
private |
Converts a generic to a string.
generic | The generic to convert into a string |
makecopy | Whether to use a copy of the generic data or not |
str_length | Length of the resulting string |
Definition at line 182 of file conversions.F90.
|
private |
Converts an integer into its generic data representation.
input | The integer to convert into its generic representation |
makecopy | Whether make a copy of the underlying data or just return a simple pointer |
Definition at line 561 of file conversions.F90.
|
private |
Converts an integer to a logical.
input | The integer to convert into a logical |
Definition at line 386 of file conversions.F90.
|
private |
Converts an integer to a real.
input | The integer to convert into a real |
Definition at line 470 of file conversions.F90.
|
private |
Converts an integer to a string.
input | The integer to convert into a string |
Definition at line 205 of file conversions.F90.
|
private |
Helper subroutine which trims the string down to an upper limit of decimal places, with all numbers beyond this point removed.
stringToParse | The raw, uncropped, string to processess which is modified |
decimalPlaces | Number of decimal places to keep |
Definition at line 287 of file conversions.F90.
|
private |
Converts a logical into its generic data representation.
input | The logical to convert into its generic representation |
makecopy | Whether make a copy of the underlying data or just return a simple pointer |
Definition at line 609 of file conversions.F90.
|
private |
Converts a logical to an integer.
input | The logical to convert into an integer |
Definition at line 531 of file conversions.F90.
|
private |
Converts a logical to a real.
input | The logical to convert into a real |
Definition at line 479 of file conversions.F90.
|
private |
Converts a logical to a string.
input | The logical to convert into a string |
Definition at line 337 of file conversions.F90.
|
private |
Converts a double real into its generic data representation.
input | The real to convert into its generic representation |
makecopy | Whether make a copy of the underlying data or just return a simple pointer |
Definition at line 593 of file conversions.F90.
|
private |
Converts a double precision real to a string.
input | The real to convert into a string |
Definition at line 250 of file conversions.F90.
|
private |
Converts a single real into its generic data representation.
input | The real to convert into its generic representation |
makecopy | Whether make a copy of the underlying data or just return a simple pointer |
Definition at line 577 of file conversions.F90.
|
private |
Converts a single precision real to a string.
input | The real to convert into a string |
Definition at line 216 of file conversions.F90.
|
private |
Converts a real to an integer.
input | The real to convert into an integer |
Definition at line 522 of file conversions.F90.
|
private |
Converts a real to a logical.
input | The real to convert into a logical |
Definition at line 399 of file conversions.F90.
|
private |
Determines whether a string is an integer or not.
string | The string to test |
Definition at line 134 of file conversions.F90.
|
private |
Determines whether a string is a logical or not.
string | The string to test |
Definition at line 167 of file conversions.F90.
|
private |
Determines whether a string is a real or not.
string | The string to test |
Definition at line 150 of file conversions.F90.
|
private |
Converts a string into its generic data representation.
string | The string to convert into its generic representation |
makecopy | Whether make a copy of the underlying data or just return a simple pointer |
Definition at line 545 of file conversions.F90.
|
private |
Converts a string to an integer.
string | The string to convert into an integer |
Definition at line 513 of file conversions.F90.
|
private |
Converts a string to a logical.
string | The string to convert into a logical (case sensitive) |
Definition at line 372 of file conversions.F90.
|
private |
Converts a string to a real.
string | The string to convert into a real |
Definition at line 457 of file conversions.F90.
|
private |
A helper subroutine which trims training zeros from the string after a decimal place this is to make the string more readable when printed out.
stringToParse | The string to parse which is modified to replace trailing zeros |
zerosToRetain | The number of trailing (after decimal) zeros to retain |
Definition at line 310 of file conversions.F90.
|
private |
Definition at line 14 of file conversions.F90.
|
private |
Definition at line 16 of file conversions.F90.