Skip to content

Commit a8ca010

Browse files
committed
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).
1 parent d64229b commit a8ca010

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

fpm/src/fpm_strings.f90

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ module fpm_strings
77
public :: string_array_contains, string_cat, operator(.in.), fnv_1a
88
public :: resize, str
99

10-
integer, parameter :: dp = selected_real_kind(15)
11-
1210
type string_t
1311
character(len=:), allocatable :: s
1412
end type
@@ -32,7 +30,7 @@ module fpm_strings
3230
end interface str_ends_with
3331

3432
interface str
35-
module procedure str_int, str_int64, str_real, str_real_n, str_logical
33+
module procedure str_int, str_int64, str_logical
3634
end interface
3735

3836
contains
@@ -391,34 +389,6 @@ pure function str_int64(i) result(s)
391389
write(s, '(i0)') i
392390
end function
393391

394-
pure integer function str_real_len(r, fmt) result(sz)
395-
! Returns the length of the string representation of 'i'
396-
real(dp), intent(in) :: r
397-
character(len=*), intent(in) :: fmt
398-
integer, parameter :: MAX_STR = 100
399-
character(MAX_STR) :: s
400-
! If 's' is too short (MAX_STR too small), Fortan will abort with:
401-
! "Fortran runtime error: End of record"
402-
write(s, fmt) r
403-
sz = len_trim(s)
404-
end function
405-
406-
pure function str_real(r) result(s)
407-
! Converts the real number "r" to string with 7 decimal digits.
408-
real(dp), intent(in) :: r
409-
character(len=*), parameter :: fmt="(f0.6)"
410-
character(len=str_real_len(r, fmt)) :: s
411-
write(s, fmt) r
412-
end function
413-
414-
pure function str_real_n(r, n) result(s)
415-
! Converts the real number "r" to string with 'n' decimal digits.
416-
real(dp), intent(in) :: r
417-
integer, intent(in) :: n
418-
character(len=str_real_len(r, "(f0." // str_int(n) // ")")) :: s
419-
write(s, "(f0." // str_int(n) // ")") r
420-
end function
421-
422392
pure integer function str_logical_len(l) result(sz)
423393
! Returns the length of the string representation of 'l'
424394
logical, intent(in) :: l

0 commit comments

Comments
 (0)