polishing

This commit is contained in:
Martin Diehl 2023-02-28 07:34:11 +01:00
parent 9418664604
commit 949bc39173
1 changed files with 4 additions and 4 deletions

View File

@ -166,8 +166,8 @@ end function IO_isBlank
function IO_insertEOL(string,separator,length) function IO_insertEOL(string,separator,length)
character(len=*), intent(in) :: string !< string to split character(len=*), intent(in) :: string !< string to split
character, optional, intent(in) :: separator !< possible splitting positions character, optional, intent(in) :: separator !< line breaks are possible after this character, defaults to ','
integer, optional, intent(in) :: length !< (soft) line limit integer, optional, intent(in) :: length !< (soft) line limit, defaults to 80
character(len=:), allocatable :: IO_insertEOL character(len=:), allocatable :: IO_insertEOL
integer, dimension(:), allocatable :: pos_sep, pos_split integer, dimension(:), allocatable :: pos_sep, pos_split
@ -190,10 +190,10 @@ function IO_insertEOL(string,separator,length)
end do end do
pos_sep = [pos_sep,len(string)] pos_sep = [pos_sep,len(string)]
pos_split = [integer::] pos_split = emptyIntArray
s = 1 s = 1
e = 2 e = 2
IO_insertEOL= '' IO_insertEOL = ''
do while (e < size(pos_sep)) do while (e < size(pos_sep))
if (pos_sep(e+1) - pos_sep(s) >= misc_optional(length,80)) then if (pos_sep(e+1) - pos_sep(s) >= misc_optional(length,80)) then
IO_insertEOL = IO_insertEOL//string(pos_sep(s)+1:pos_sep(e))//IO_EOL IO_insertEOL = IO_insertEOL//string(pos_sep(s)+1:pos_sep(e))//IO_EOL