-
Notifications
You must be signed in to change notification settings - Fork 0
/
OUCHGNU.F90
65 lines (47 loc) · 1.08 KB
/
OUCHGNU.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
! Code to abstract GFortran specific calls.
! Owain Kenway
! Equivalent of iargc
subroutine countargs(n)
use ISO_FORTRAN_ENV
implicit none
integer, intent(out) :: n
n = command_argument_count()
end
! Equivalent of getarg
subroutine getargat(n, s, l)
use ISO_FORTRAN_ENV
implicit none
integer, intent(in) :: n
integer, intent(out) :: l
character (len=1024), intent(out) :: s
call get_command_argument(n, length=l)
call get_command_argument(n, s)
end
! Get time in seconds
subroutine getsec(t)
use ISO_FORTRAN_ENV
implicit none
real, intent(out) :: t
call cpu_time(t)
end
! Start random number generation.
! Technically we don't need to do anything in OpenWatcom
subroutine initrand(seed)
implicit none
integer, intent(in) :: seed
call srand(seed)
end
! Get next number.
! Need to pass seed as that's always needed by OpenWatcom
function getrand(seed)
implicit none
real :: getrand
integer :: seed
real :: rand
getrand = rand()
end
! Sleep that only happens on DOS
subroutine dossleep(seconds)
implicit none
integer :: seconds
end