diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/utilities.F90 | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/common/utilities.F90 b/common/utilities.F90 index 670d48f..e8bceff 100644 --- a/common/utilities.F90 +++ b/common/utilities.F90 @@ -391,6 +391,7 @@ contains end function get_directories_in_directory function get_files_in_directory(directory) result(res) + use logging implicit none character(*), intent(in)::directory @@ -398,6 +399,7 @@ contains character(80)::line character(len=:), pointer::tempfile + logical::skip_first logical, dimension(:), allocatable::is_real_file integer::unum, ierr, i, n, j @@ -428,6 +430,8 @@ contains i = i + 1 if(len_trim(line) > 0 .and. line(1:1) == '-' .and. line(1:6) /= "total ") then is_real_file(i) = .TRUE. + else if(line(1:6) == "total ") then + skip_first = .TRUE. end if read(unum, '(A)', iostat=ierr) line end do @@ -448,7 +452,12 @@ contains ! Now we can read files i = 0 - j = 0 + if(skip_first) then + j = 1 + else + j = 0 + end if + read(unum, '(A)', iostat=ierr) line do while(ierr == 0 .and. i < n) j = j + 1 |