Blame view

mstm-intrinsics.f90 1.32 KB
de89d3bc   dmayerich   Initial commit.
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
        module intrinsics

  !

  ! compiler-dependent intrinsic functions.

  !

  !

  !  last revised: 15 January 2011

  !

  

        implicit none

        contains

  !

  !   system clock

  !

           real function mytime()

           implicit none

           real :: etime

           real(4), parameter :: x=0.

           real :: t(2)

  !         mytime=secnds(x)

           mytime=etime(t)

           end function mytime

  

  !   flush is one of the best named functions in fortran, although it does not do what I think it should.   This function flushes

  !   the buffer to print unit i, so when the unit is flushed, all data written to the open file will appear in the file.

  !   Not all compilers have this function.

  

           subroutine flush(i)

           implicit none

           integer :: i

           flush(i)

           end subroutine flush

  !

  !   number of command-line arguments.

  !

           integer function mstm_nargs()

           implicit none

           integer nargs

  !         mstm_nargs=nargs()

           mstm_nargs=iargc()

           end function mstm_nargs

  !

  !   command line argument retrieval

  !

           subroutine mstm_getarg(char)

           implicit none

           integer :: istat

           character(*) :: char

  !         call getarg(1,char,istat)

           call getarg(1,char)

           end subroutine mstm_getarg

  

        end module intrinsics