<commit_before>!>------------------------------------------------------------
!!
!!  Various functions to convert a number to a string and a string
!!  to a number
!!
!!  Author: <NAME> (<EMAIL>)
!!
!!------------------------------------------------------------
module string

    implicit none
    interface str
        module procedure str_d
        module procedure str_r
        module procedure str_i
    end interface
    
    integer,parameter::MAXSTRINGLENGTH=100
contains
    function get_double(str_in)
        implicit none
        character(len=*), intent(in) :: str_in
        double precision :: get_double
        read(str_in,*) get_double
    end function get_double
    
    function get_real(str_in)
        implicit none
        character(len=*), intent(in) :: str_in
        real :: get_real
        read(str_in,*) get_real
    end function get_real

    function get_integer(str_in)
        implicit none
        character(len=*), intent(in) :: str_in
        integer :: get_integer
        read(str_in,*) get_integer
    end function get_integer
    
    
    
    function str_d(value,fmt) result(output_string)
        implicit none
        double precision :: value
        character(len=*), optional :: fmt
        character(len=MAXSTRINGLENGTH) :: output_string
        if (present(fmt)) then
            write(output_string,fmt) value
        else
            write(output_string,*) value
        endif
        output_string=adjustl(output_string)
    end function str_d

    function str_r(value,fmt) result(output_string)
        implicit none
        real :: value
        character(len=*), optional :: fmt
        character(len=MAXSTRINGLENGTH) :: output_string
        if (present(fmt)) then
            write(output_string,fmt) value
        else
            write(output_string,*) value
        endif
        output_string=adjustl(output_string)
    end function str_r

    function str_i(value,fmt) result(output_string)
        implicit none
        integer :: value
        character(len=*), optional :: fmt
        character(len=MAXSTRINGLENGTH) :: output_string
        if (present(fmt)) then
            write(output_string,fmt) value
        else
            write(output_string,*) value
        endif
        output_string=adjustl(output_string)
    end function str_i


end module string<commit_msg>In string.f90, Specify real kinds & make elemental<commit_after>!>------------------------------------------------------------
!!
!!  Various functions to convert a number to a string and a string
!!  to a number
!!
!!  Author: <NAME> (<EMAIL>)
!!
!!------------------------------------------------------------
module string

    use iso_fortran_env, only : real32, real64

    implicit none
    interface str
        module procedure str_d
        module procedure str_r
        module procedure str_i
    end interface
    
    integer,parameter::MAXSTRINGLENGTH=100
contains
    elemental function get_double(str_in)
        implicit none
        character(len=*), intent(in) :: str_in
        real(real64) :: get_double
        read(str_in,*) get_double
    end function get_double
    
    elemental function get_real(str_in)
        implicit none
        character(len=*), intent(in) :: str_in
        real(real32) :: get_real
        read(str_in,*) get_real
    end function get_real

    elemental function get_integer(str_in)
        implicit none
        character(len=*), intent(in) :: str_in
        integer :: get_integer
        read(str_in,*) get_integer
    end function get_integer
    
    elemental function str_d(value,fmt) result(output_string)
        implicit none
        real(real64), intent(in) :: value
        character(len=*), optional, intent(in) :: fmt
        character(len=MAXSTRINGLENGTH) :: output_string
        if (present(fmt)) then
            write(output_string,fmt) value
        else
            write(output_string,*) value
        endif
        output_string=adjustl(output_string)
    end function str_d

    elemental function str_r(value,fmt) result(output_string)
        implicit none
        real(real32), intent(in) :: value
        character(len=*), optional, intent(in) :: fmt
        character(len=MAXSTRINGLENGTH) :: output_string
        if (present(fmt)) then
            write(output_string,fmt) value
        else
            write(output_string,*) value
        endif
        output_string=adjustl(output_string)
    end function str_r

    elemental function str_i(value,fmt) result(output_string)
        implicit none
        integer, intent(in) :: value
        character(len=*), optional, intent(in) :: fmt
        character(len=MAXSTRINGLENGTH) :: output_string
        if (present(fmt)) then
            write(output_string,fmt) value
        else
            write(output_string,*) value
        endif
        output_string=adjustl(output_string)
    end function str_i

end module string
{'fraction_non_alphanumeric': 0.12897959183673469, 'fraction_numerical': 0.004081632653061225, 'mean_word_length': 2.09211356466877, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1639142', 'n_tokens_mistral': 1323, 'n_tokens_neox': 1301, 'n_words': 340}