OpenCMISS-Iron Internal API Documentation
timer_f.f90
Go to the documentation of this file.
1 
43 
45 MODULE timer
46 
47  USE base_routines
48  USE constants
49  USE base_routines
50  USE iso_c_binding
52 
53 #include "macros.h"
54 
55  IMPLICIT NONE
56 
57  PRIVATE
58 
59  !Module parameters
60 
61  !Module variables
62 
63  !CPU time parameters
68  INTEGER(INTG), PARAMETER :: user_cpu=1
69  INTEGER(INTG), PARAMETER :: system_cpu=2
70  INTEGER(INTG), PARAMETER :: total_cpu=3
72 
73  !Module variables
74 
75  !Interfaces
76 
77  INTERFACE
78 
79  SUBROUTINE cputimer(RETURN_TIME, TIME_TYPE, ERR, CERROR) BIND(C,NAME="CPUTimer")
80  USE iso_c_binding
81  REAL(C_DOUBLE), INTENT(OUT) :: RETURN_TIME
82  INTEGER(C_INT), INTENT(IN) :: TIME_TYPE
83  INTEGER(C_INT), INTENT(OUT) :: ERR
84  CHARACTER(C_CHAR), INTENT(OUT) :: CERROR(*)
85  END SUBROUTINE cputimer
86 
87  END INTERFACE
88 
90 
91 CONTAINS
92 
93  !
94  !============================================================================
95  !
96 
98  SUBROUTINE cpu_timer(TIME_TYPE,TIME,ERR,ERROR,*)
99 
100  !Argument variables
101  INTEGER(INTG), INTENT(IN) :: TIME_TYPE
102  REAL(SP), INTENT(OUT) :: TIME(*)
103  INTEGER(INTG), INTENT(OUT) :: ERR
104  TYPE(varying_string), INTENT(OUT) :: ERROR
105  !Local variables
106  REAL(DP) :: RETURN_TIME
107  CHARACTER(KIND=C_CHAR,LEN=MAXSTRLEN) :: CERROR
108 
109  enters("CPU_TIMER",err, error,*999)
110 
111  CALL cputimer(return_time,time_type,err,cerror)
112  time(1)=REAL(return_time,sp)
113  IF(err/=0) CALL flagerror(cerror,err,error,*999)
114 
115  exits("CPU_TIMER")
116  RETURN
117 999 errorsexits("CPU_TIMER",err,error)
118  RETURN 1
119  END SUBROUTINE cpu_timer
120 
121  !
122  !============================================================================
123  !
124 
125 END MODULE timer
subroutine, public enters(NAME, ERR, ERROR,)
Records the entry into the named procedure and initialises the error code.
This module contains routines for timing the program.
Definition: timer_f.f90:45
This module provides an iso_varying_string module, conformant to the API specified in ISO/IEC 1539-2:...
This module contains all program wide constants.
Definition: constants.f90:45
integer(intg), parameter, public user_cpu
User CPU time type.
Definition: timer_f.f90:68
subroutine, public exits(NAME)
Records the exit out of the named procedure.
This module contains all the low-level base routines e.g., all debug, control, and low-level communic...
integer(intg), parameter, public system_cpu
System CPU time type.
Definition: timer_f.f90:69
subroutine, public cpu_timer(TIME_TYPE, TIME, ERR, ERROR,)
CPU_TIMER returns the CPU time in TIME(1). TIME_TYPE indicates the type of time required.
Definition: timer_f.f90:99
integer(intg), parameter, public total_cpu
Total CPU (i.e. User + System) time type.
Definition: timer_f.f90:70
Flags an error condition.