-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmachine_lf95.f90
59 lines (50 loc) · 1.68 KB
/
machine_lf95.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
module MACHINE
implicit none
character(LEN=2) :: END_LINE = ' ' // char(10)
character(LEN=1) :: FILSEP = '/' ! '/' for Unix, '\' for DOS or NT
integer, parameter :: HP = 0 ! Offset for first argument for GETARG
contains
! subroutine GetArg ( ArgNum, ArgVal )
! integer, intent(in) :: ArgNum
! character(len=*), intent(out) :: ArgVal
!
! character(len=1023) :: CmdLine ! The whole command line, from GETCL
! integer :: I, J
!
! if ( ArgNum < 1 ) then
! print '(a,i0,a)', 'Argument number (',argNum, ') must be > 0'
! stop
! end if
!
! call getcl ( cmdLine )
! j = 1
! do i = 1, argNum
! cmdLine = adjustl(cmdLine(j:))
! j = index(cmdLine,' ')
! end do
!
! argVal = cmdLine(:j)
! end subroutine GetArg
subroutine Get_Command_Argument ( ArgNum, ArgVal )
integer, intent(in) :: ArgNum
character(len=*), intent(out) :: ArgVal
call getarg ( argNum, argVal )
end subroutine Get_Command_Argument
subroutine IO_ERROR ( MESSAGE, IOSTAT, FILE )
! Print MESSAGE and FILE, and then do something reasonable with IOSTAT.
character(len=*), intent(in) :: MESSAGE
integer, intent(in) :: IOSTAT
character(len=*), intent(in), optional :: FILE
integer :: L
character(len=127) :: MSG ! From the Lahey IOSTAT_MSG intrinsic
write (*,*) message(:len_trim(message))
if ( present(file) ) then
l = len_trim(file)
write (*,*) file(:l)
end if
call iostat_msg (iostat, msg) ! Lahey intrinsic
write (*,*) msg(:len_trim(msg)) ! Print the error message
write (*,*) 'Error status code =', iostat
return
end subroutine IO_ERROR
end module MACHINE