From a8ca0103647175401bdb16e2729a60b0dc9ccdd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Wed, 23 Dec 2020 09:59:45 -0700 Subject: 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). --- fpm/src/fpm_strings.f90 | 32 +------------------------------- 1 file changed, 1 insertion(+), 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 -- cgit v1.2.3