diff options
author | Ondřej Čertík <ondrej@certik.us> | 2020-12-23 09:59:45 -0700 |
---|---|---|
committer | Ondřej Čertík <ondrej@certik.us> | 2020-12-23 09:59:45 -0700 |
commit | a8ca0103647175401bdb16e2729a60b0dc9ccdd2 (patch) | |
tree | 125e56275d8c137705591303b49fb67cf722f7ad | |
parent | d64229bf66a3a854d8bacccd27f01104911e141f (diff) | |
download | fpm-a8ca0103647175401bdb16e2729a60b0dc9ccdd2.tar.gz fpm-a8ca0103647175401bdb16e2729a60b0dc9ccdd2.zip |
Remove str() implementation for real
It is not needed at the moment, but it will have to be put back in once
we extract str() into a dedicated string manipulation library (or
stdlib).
-rw-r--r-- | fpm/src/fpm_strings.f90 | 32 |
1 files changed, 1 insertions, 31 deletions
diff --git a/fpm/src/fpm_strings.f90 b/fpm/src/fpm_strings.f90 index ad0a843..5b6104c 100644 --- a/fpm/src/fpm_strings.f90 +++ b/fpm/src/fpm_strings.f90 @@ -7,8 +7,6 @@ public :: f_string, lower, split, str_ends_with, string_t public :: string_array_contains, string_cat, operator(.in.), fnv_1a public :: resize, str -integer, parameter :: dp = selected_real_kind(15) - type string_t character(len=:), allocatable :: s end type @@ -32,7 +30,7 @@ interface str_ends_with end interface str_ends_with interface str - module procedure str_int, str_int64, str_real, str_real_n, str_logical + module procedure str_int, str_int64, str_logical end interface contains @@ -391,34 +389,6 @@ character(len=str_int64_len(i)) :: s write(s, '(i0)') i end function -pure integer function str_real_len(r, fmt) result(sz) -! Returns the length of the string representation of 'i' -real(dp), intent(in) :: r -character(len=*), intent(in) :: fmt -integer, parameter :: MAX_STR = 100 -character(MAX_STR) :: s -! If 's' is too short (MAX_STR too small), Fortan will abort with: -! "Fortran runtime error: End of record" -write(s, fmt) r -sz = len_trim(s) -end function - -pure function str_real(r) result(s) -! Converts the real number "r" to string with 7 decimal digits. -real(dp), intent(in) :: r -character(len=*), parameter :: fmt="(f0.6)" -character(len=str_real_len(r, fmt)) :: s -write(s, fmt) r -end function - -pure function str_real_n(r, n) result(s) -! Converts the real number "r" to string with 'n' decimal digits. -real(dp), intent(in) :: r -integer, intent(in) :: n -character(len=str_real_len(r, "(f0." // str_int(n) // ")")) :: s -write(s, "(f0." // str_int(n) // ")") r -end function - pure integer function str_logical_len(l) result(sz) ! Returns the length of the string representation of 'l' logical, intent(in) :: l |