-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest_global_clock.f90
41 lines (33 loc) · 1.11 KB
/
test_global_clock.f90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
include 'globals/global_clock_module.f90'
program test_global_clock
! Purpose:
! to perform unit testing on global_clock_module
!
!
! Record of revision:
! Date Programmer Description of change
! ======== ==================== ========================================
! 09/04/15 B. Y. Chen Original code
!
!
use global_clock_module ! use everything
implicit none
type(program_clock) :: local_clock
! initialize local variables
! all derived types have been initialized in definition
! call all public procedures, test their correctness
call empty (global_clock)
call set (global_clock, curr_step=1, curr_inc=10)
if (clock_in_sync(global_clock, local_clock)) then
write(*,'(1X,a)') ''
write(*,'(1X,a)') 'local clock is in sync with global clock'
write(*,'(1X,a)') ''
else
write(*,'(1X,a)') ''
write(*,'(1X,a)') 'local clock is out of sync with global clock'
write(*,'(1X,a)') ''
local_clock = global_clock
if (clock_in_sync(global_clock, local_clock)) &
& write(*,'(1X,a)') 'local clock is in sync with global clock'
end if
end program test_global_clock