aboutsummaryrefslogtreecommitdiff
path: root/src/fpm_backend_console.f90
diff options
context:
space:
mode:
authorLaurence Kedward <laurence.kedward@bristol.ac.uk>2021-11-26 17:32:07 +0000
committerLaurence Kedward <laurence.kedward@bristol.ac.uk>2021-11-26 17:32:07 +0000
commit37ba9d7cf61d6b9ddbfe59a4456311fda62ef101 (patch)
treebd9d618584f275a48031d67f7a4e8b41ff215c5a /src/fpm_backend_console.f90
parentab7cb42fddc3cf19fe20c76dac527a9e591b11c2 (diff)
downloadfpm-37ba9d7cf61d6b9ddbfe59a4456311fda62ef101.tar.gz
fpm-37ba9d7cf61d6b9ddbfe59a4456311fda62ef101.zip
Simplify implementation and cleanup plain mode output
Diffstat (limited to 'src/fpm_backend_console.f90')
-rw-r--r--src/fpm_backend_console.f9028
1 files changed, 22 insertions, 6 deletions
diff --git a/src/fpm_backend_console.f90 b/src/fpm_backend_console.f90
index 4db0cdc..7daff14 100644
--- a/src/fpm_backend_console.f90
+++ b/src/fpm_backend_console.f90
@@ -41,20 +41,36 @@ subroutine console_init(console,plain_mode)
end subroutine console_init
-function console_write_line(console,str) result(line)
+subroutine console_write_line(console,str,line,advance)
class(console_t), intent(inout), target :: console
character(*), intent(in) :: str
- integer :: line
+ integer, intent(out), optional :: line
+ logical, intent(in), optional :: advance
+
+ character(3) :: adv
+
+ adv = "yes"
+ if (present(advance)) then
+ if (.not.advance) then
+ adv = "no"
+ end if
+ end if
!$omp critical
- line = console%n_line
- write(stdout,*) console%LINE_RESET//str
+ if (present(line)) then
+ line = console%n_line
+ end if
+
+ write(stdout,'(A)',advance=trim(adv)) console%LINE_RESET//str
+
+ if (adv=="yes") then
+ console%n_line = console%n_line + 1
+ end if
- console%n_line = console%n_line + 1
!$omp end critical
-end function console_write_line
+end subroutine console_write_line
subroutine console_update_line(console,line_no,str)
class(console_t), intent(in) :: console