MFIX  2016-1
machine_mod.f
Go to the documentation of this file.
1  MODULE machine
2 
3 ! record length used in open statement for unformatted,
4 ! direct access file, with 512 bytes per record
5  INTEGER open_n1
6 !
7 ! number of DOUBLE PRECISION words in 512 bytes
8  INTEGER nwords_dp
9 !
10 ! number of REAL words in 512 bytes
11  INTEGER nwords_r
12 !
13 ! number of INTEGER words in 512 bytes
14  INTEGER nwords_i
15 !
16  LOGICAL :: just_flush = .true.
17 
18 ! computer node name/id
19  CHARACTER(LEN=64) :: id_node
20 
21 ! RUN ID info
22  INTEGER :: id_month
23  INTEGER :: id_day
24  INTEGER :: id_year
25  INTEGER :: id_hour
26  INTEGER :: id_minute
27  INTEGER :: id_second
28 
29  CONTAINS
30 
31 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
32 ! C
33 ! Module name: MACHINE_CONS C
34 ! Purpose: set the machine constants ( SGI ONLY ) C
35 ! C
36 ! Author: P. Nicoletti Date: 28-JAN-92 C
37 ! Reviewer: P. Nicoletti, W. Rogers, M. Syamlal Date: C
38 ! C
39 ! Revision Number: C
40 ! Purpose: C
41 ! Author: Date: dd-mmm-yy C
42 ! Reviewer: Date: dd-mmm-yy C
43 ! C
44 ! Literature/Document References: C
45 ! C
46 ! Variables referenced: None C
47 ! Variables modified: OPEN_N1, NWORDS_DP, NWORDS_R, N_WORDS_I C
48 ! C
49 ! Local variables: None C
50 ! C
51 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
52 !
53  SUBROUTINE machine_cons
54 
55  IMPLICIT NONE
56 
57  open_n1 = 512
58  nwords_dp = 64
59  nwords_r = 128
60  nwords_i = 128
61  just_flush = .true.
62 
63  RETURN
64  END SUBROUTINE machine_cons
65 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
66 ! C
67 ! Module name: GET_RUN_ID C
68 ! Purpose: get the run id for this run C
69 ! C
70 ! Author: P. Nicoletti Date: 16-DEC-91 C
71 ! Reviewer: P. Nicoletti, W. Rogers, M. Syamlal Date: C
72 ! C
73 ! Revision Number: 1 C
74 ! Purpose: add ndoe name C
75 ! Author: P.Nicoletti Date: 07-FEB-92 C
76 ! Reviewer: Date: dd-mmm-yy C
77 ! C
78 ! Literature/Document References: C
79 ! C
80 ! Variables referenced: None C
81 ! Variables modified: ID_MONTH, ID_DAY, ID_YEAR, ID_HOUR, ID_MINUTE C
82 ! ID_SECOND, ID_NODE C
83 ! C
84 ! Local variables: TIME_ARRAY C
85 ! C
86 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
87 !
88  SUBROUTINE get_run_id
89 !
90  USE param
91  IMPLICIT NONE
92 !
93 ! temporary array to hold time data
94  INTEGER DAT(8)
95  CHARACTER(LEN=10) DATE, TIM, ZONE
96 
97  CALL date_and_time(date, tim, zone, dat)
98  id_year = dat(1)
99  id_month = dat(2)
100  id_day = dat(3)
101  id_hour = dat(5)
102  id_minute = dat(6)
103  id_second = dat(7)
104 
105 ! For SGI only
106 ! CALL GETHOSTNAME(ID_NODE,64)
107 ! For Linux with Portland Group compilers
108  CALL get_environment_variable('HOSTNAME',id_node)
109 !
110  RETURN
111  END SUBROUTINE get_run_id
112 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
113 ! C
114 ! Function name: WALL_TIME (CPU) C
115 ! Purpose: returns wall time since start of the run C
116 ! C
117 ! Author: P. Nicoletti Date: 10-JAN-92 C
118 ! Reviewer: P. Nicoletti, W. Rogers, M. Syamlal Date: C
119 ! C
120 ! Revision Number: C
121 ! Purpose: C
122 ! Author: Date: dd-mmm-yy C
123 ! Reviewer: Date: dd-mmm-yy C
124 ! C
125 ! Literature/Document References: C
126 ! C
127 ! Variables referenced: None C
128 ! Variables modified: None C
129 ! C
130 ! Local variables: TA, XT C
131 ! C
132 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
133 !
134  DOUBLE PRECISION FUNCTION wall_time()
135 !
136  IMPLICIT NONE
137 
138  INTEGER, SAVE :: COUNT_OLD=0, wrap=0
139 !
140 ! local variables
141 ! clock cycle
142  INTEGER COUNT
143 
144 ! number of cycles per second
145  INTEGER COUNT_RATE
146 
147 ! max number of cycles, after which count is reset to 0
148  INTEGER COUNT_MAX
149 
150  CALL system_clock(count, count_rate, count_max)
151  IF(count_old .GT. count) THEN
152  wrap = wrap + 1
153  ENDIF
154  count_old = count
155 
156  wall_time = dble(count)/dble(count_rate) &
157  + dble(wrap) * dble(count_max)/dble(count_rate)
158  END FUNCTION wall_time
159 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
160 ! C
161 ! Module name: START_LOG C
162 ! Purpose: does nothing ... for VAX/VMS compatibility (SGI ONLY) C
163 ! C
164 ! Author: P. Nicoletti Date: 28-JAN-92 C
165 ! Reviewer: P. Nicoletti, W. Rogers, M. Syamlal Date: C
166 ! C
167 ! Revision Number: C
168 ! Purpose: C
169 ! Author: Date: dd-mmm-yy C
170 ! Reviewer: Date: dd-mmm-yy C
171 ! C
172 ! Literature/Document References: C
173 ! C
174 ! Variables referenced: None C
175 ! Variables modified: None C
176 ! C
177 ! Local variables: None C
178 ! C
179 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
180 !
181  SUBROUTINE start_log
182  IMPLICIT NONE
183  RETURN
184  END SUBROUTINE start_log
185 !vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvC
186 ! C
187 ! Module name: END_LOG C
188 ! Purpose: flushes the log file C
189 ! C
190 ! Author: P. Nicoletti Date: 28-JAN-92 C
191 ! Reviewer: P. Nicoletti, W. Rogers, M. Syamlal Date: C
192 ! C
193 ! Revision Number: C
194 ! Purpose: C
195 ! Author: Date: dd-mmm-yy C
196 ! Reviewer: Date: dd-mmm-yy C
197 ! C
198 ! Literature/Document References: C
199 ! C
200 ! Variables referenced: None C
201 ! Variables modified: None C
202 ! C
203 ! Local variables: None C
204 ! C
205 !^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^C
206 !
207  SUBROUTINE end_log
208  USE funits
209  IMPLICIT NONE
210  IF(dmp_log) FLUSH(unit_log)
211  RETURN
212  END SUBROUTINE end_log
213 
214  subroutine slumber
215  return
216  end subroutine slumber
217 
218  subroutine pc_quickwin
219  return
220  end subroutine pc_quickwin
221 
222  subroutine ran
223  return
224  end subroutine ran
225 
226  subroutine flush_bin(iunit)
227  implicit none
228  integer :: iunit
229 
230  flush(iunit)
231  return
232  end subroutine flush_bin
233 
234  subroutine flush_res(iunit)
235  implicit none
236  integer :: iunit
237  flush(iunit)
238  return
239  end subroutine flush_res
240 
241  END MODULE machine
subroutine slumber
Definition: machine_mod.f:215
logical dmp_log
Definition: funits_mod.f:6
integer open_n1
Definition: machine_mod.f:5
subroutine flush_bin(iunit)
Definition: machine_mod.f:227
double precision function wall_time()
Definition: machine_mod.f:135
integer id_month
Definition: machine_mod.f:22
integer id_second
Definition: machine_mod.f:27
integer id_day
Definition: machine_mod.f:23
character(len=64) id_node
Definition: machine_mod.f:19
subroutine flush_res(iunit)
Definition: machine_mod.f:235
logical just_flush
Definition: machine_mod.f:16
subroutine ran
Definition: machine_mod.f:223
integer id_year
Definition: machine_mod.f:24
integer id_minute
Definition: machine_mod.f:26
integer nwords_i
Definition: machine_mod.f:14
integer, parameter unit_log
Definition: funits_mod.f:21
Definition: param_mod.f:2
subroutine machine_cons
Definition: machine_mod.f:54
integer nwords_dp
Definition: machine_mod.f:8
integer nwords_r
Definition: machine_mod.f:11
subroutine start_log
Definition: machine_mod.f:182
integer id_hour
Definition: machine_mod.f:25
subroutine get_run_id
Definition: machine_mod.f:89
subroutine pc_quickwin
Definition: machine_mod.f:219
subroutine end_log
Definition: machine_mod.f:208