Added progress bar to plotter

This commit is contained in:
nhorelik 2013-04-26 15:06:38 -04:00
parent 366d962600
commit ba5e85964c
4 changed files with 8 additions and 1 deletions

View file

@ -311,6 +311,7 @@ plot.o: output.o
plot.o: particle_header.o
plot.o: plot_header.o
plot.o: ppmlib.o
plot.o: progress_header.o
plot.o: source.o
plot.o: string.o

View file

@ -46,6 +46,7 @@ physics.o \
plot.o \
plot_header.o \
ppmlib.o \
progress_header.o \
random_lcg.o \
search.o \
set_header.o \

View file

@ -10,6 +10,7 @@ module plot
use plot_header
use ppmlib, only: Image, init_image, allocate_image, &
deallocate_image, set_pixel
use progress_header
use source, only: initialize_particle
use string, only: to_str
@ -108,6 +109,7 @@ contains
real(8) :: out_pixel
real(8) :: xyz(3)
type(Image) :: img
type(ProgressBar) :: progress
! Initialize and allocate space for image
call init_image(img)
@ -147,6 +149,7 @@ contains
p % coord % universe = BASE_UNIVERSE
do y = 1, img % height
call progress % set_value(dble(y)/dble(img % height)*100.)
do x = 1, img % width
! get pixel color
@ -226,6 +229,7 @@ contains
integer :: id ! id of cell or material
real(8) :: vox(3) ! x, y, and z voxel widths
real(8) :: ll(3) ! lower left starting point for each sweep direction
type(ProgressBar) :: progress
! compute voxel widths in each direction
vox = pl % width/dble(pl % pixels)
@ -251,6 +255,7 @@ contains
ll = ll + vox / 2.0
do x = 1, pl % pixels(1)
call progress % set_value(dble(x)/dble(pl % pixels(1))*100.)
do y = 1, pl % pixels(2)
do z = 1, pl % pixels(3)

View file

@ -45,7 +45,7 @@ contains
function timer_get_value(self) result(elapsed)
class(Timer), intent(in) :: self ! the timer
real(8) :: elapsed ! total elapsed time
real(8) :: elapsed ! total elapsed time
integer :: end_counts ! current number of counts
integer :: count_rate ! system-dependent counting rate