gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
dc_clock.f90
Go to the documentation of this file.
1! -*- mode: f90; coding: utf-8 -*-
2!-----------------------------------------------------------------------
3! Copyright (c) 2006-2026 Gtool Development Group. All rights reserved.
4!-----------------------------------------------------------------------
5!>
6!> @author Yasuhiro MORIKAWA
7!> @copyright Copyright (C) GFD Dennou Club, 2006-2026. All rights reserved. <br/>
8!> License is BSD-2-Clause. see [COPYRIGHT](@ref COPYRIGHT) in detail
9!>
10!> @en
11!> @brief Monitor of CPU TIME
12!> @details
13!> Measures and displays the CPU time consumed by program processing.
14!>
15!> @section dc_clock_procedures Procedures List
16!>
17!> | Procedure | Description |
18!> |-----------------|--------------------------------------------------|
19!> | DCClockCreate | Initialize CLOCK type variable |
20!> | DCClockStart | Start measurement |
21!> | DCClockStop | Pause measurement |
22!> | DCClockClose | Finalize CLOCK type variable |
23!> | DCClockGet | Get CPU time (in seconds) |
24!> | DCClockEvalSec | Get CPU time (in seconds) as function |
25!> | DCClockToChar | Convert CPU time to formatted string |
26!> | DCClockPutLine | Display CLOCK variable information |
27!> | DCClockResult | Display comprehensive CPU time information |
28!> | DCClockPredict | Display predicted CPU time and date to completion|
29!> | DCClockSetName | Reset name |
30!> | operator(+) | Addition (between CLOCK types) |
31!> | operator(-) | Subtraction (between CLOCK types) |
32!>
33!> @section dc_clock_usage Usage
34!>
35!> First, define a CLOCK type variable and initialize it with DCClockCreate.
36!> Call DCClockStart at the measurement start point in your program,
37!> and call DCClockStop at the point to pause measurement.
38!> Display elapsed time with DCClockResult.
39!> Use DCClockPredict to display estimated remaining CPU time.
40!>
41!> @note CPU time measurement uses the *cpu_time* intrinsic subroutine
42!> (introduced in Fortran 95). Whether the measured CPU time is system
43!> CPU time, user CPU time, or the sum of both depends on the implementation.
44!>
45!> @enden
46!>
47!> @ja
48!> @brief CPU 時間の計測
49!> @details
50!> プログラムの処理に要した CPU 時間を計測して表示します。
51!>
52!> @section dc_clock_procedures_ja 手続一覧
53!>
54!> | 手続名 | 説明 |
55!> |-----------------|--------------------------------------------------|
56!> | DCClockCreate | CLOCK 型変数の初期設定 |
57!> | DCClockStart | 計測の開始 |
58!> | DCClockStop | 計測の一時停止 |
59!> | DCClockClose | 構造型 CLOCK 変数の終了処理 |
60!> | DCClockGet | CPU 時間 (単位: 秒) の取得 |
61!> | DCClockEvalSec | CPU 時間 (単位: 秒) の取得 (関数) |
62!> | DCClockToChar | CPU 時間を適当に整形して文字型変数に変換 |
63!> | DCClockPutLine | 構造型 CLOCK 変数の情報を表示 |
64!> | DCClockResult | CPU 時間に関する総合的な情報を表示 |
65!> | DCClockPredict | プログラム終了までの予測 CPU 時間・日時を表示 |
66!> | DCClockSetName | 名称の再設定 |
67!> | operator(+) | 加算 (CLOCK 型同士) |
68!> | operator(-) | 減算 (CLOCK 型同士) |
69!>
70!> @section dc_clock_usage_ja 使用方法
71!>
72!> 始めに、構造型 CLOCK の変数を定義し、DCClockCreate で初期化します。
73!> プログラム中の計測開始地点で DCClockStart を呼び出し、
74!> 計測を一時停止する地点で DCClockStop を呼び出します。
75!> DCClockResult によって経過時間を表示します。
76!> DCClockPredict を使用することでプログラム終了までの残り CPU 時間
77!> の予測値を表示することが可能です。
78!>
79!> @note CPU 時間の計測に *cpu_time* サブルーチン (Fortran 95 規格で導入)
80!> を使用しているため、計測された CPU 時間がシステム CPU 時間なのか
81!> ユーザ CPU 時間なのか、もしくは両方の合計なのかは処理系に依存します。
82!>
83!> @endja
84!>
86 use dc_types, only: string, dp
89 implicit none
90 private
91 public:: clock
94 public:: operator(+), operator(-)
96 !-----------------------------------------------
97 ! 後方互換用
98 ! For backward compatibility
99 public:: create, Close, start, stop, putline, result, set_name
100 public:: get, evalsec, tochar, predict
101 !> @en
102 !> @brief Structure for CPU time measurement
103 !> @details
104 !> Use Create for initialization and Close for finalization.
105 !> See dc_clock Usage for detailed usage.
106 !> @enden
107 !>
108 !> @ja
109 !> @brief CPU 時刻計測用の構造体
110 !> @details
111 !> 初期化には Create を、終了処理には Close を用います。
112 !> 詳しい使い方は dc_clock の Usage を参照ください。
113 !> @endja
114 type clock
115 private
116 character(STRING):: name
117 real(dp):: start_time ! 計測を開始した時間
118 ! (計測の一時停止中には負の値が設定される)
119 real(dp):: elapsed_time ! 経過時間の累計値
120 type(dc_datetime):: start_date ! 計測を開始した日時
121 logical:: initialized = .false. ! CLOCK 構造体の初期化チェック用フラグ
122 end type clock
124 module procedure dcclockcreate0
125 end interface
126 interface dcclockclose
127 module procedure dcclockclose0
128 end interface
129 interface dcclockstart
130 module procedure dcclockstart0
131 end interface
132 interface dcclockstop
133 module procedure dcclockstop0
134 end interface
136 module procedure dcclockputline0
137 end interface
138 interface dcclockget
139 module procedure dcclockgetr
140 module procedure dcclockgetd
141 end interface
143 module procedure dcclockevalsecd
144 end interface
146 module procedure dcclocktochar0
147 end interface
149 module procedure dcclockresult0
150 end interface
151 interface operator(+)
152 module procedure dcclockadd
153 end interface
154 interface operator(-)
155 module procedure dcclocksubtract
156 end interface
158 module procedure dcclocksetname0
159 end interface
161 module procedure dcclockpredict0
162 end interface
163 !-----------------------------------------------
164 ! 後方互換用
165 ! For backward compatibility
166 interface create
167 module procedure dcclockcreate0
168 end interface
169 interface close
170 module procedure dcclockclose0
171 end interface
172 interface start
173 module procedure dcclockstart0
174 end interface
175 interface stop
176 module procedure dcclockstop0
177 end interface
178 interface putline
179 module procedure dcclockputline0
180 end interface
181 interface get
182 module procedure dcclockgetr
183 module procedure dcclockgetd
184 end interface
185 interface evalsec
186 module procedure dcclockevalsecd
187 end interface
188 interface tochar
189 module procedure dcclocktochar0
190 end interface
191 interface result
192 module procedure dcclockresult0
193 end interface
194 interface set_name
195 module procedure dcclocksetname0
196 end interface
197 interface predict
198 module procedure dcclockpredict0
199 end interface
200 character(*), parameter:: version = &
201 & '$Name: $' // &
202 & '$Id: dc_clock.F90,v 1.1 2009-03-20 09:09:53 morikawa Exp $'
203contains
204 !> @en
205 !> @brief Initialize CLOCK variable
206 !> @details
207 !> Initialize a CLOCK type variable before using it.
208 !> Give the measurement content to `name`.
209 !>
210 !> @param[out] clk CLOCK type variable to initialize
211 !> @param[in] name Name of measurement content
212 !> @enden
213 !>
214 !> @ja
215 !> @brief CLOCK の初期化用サブルーチン
216 !> @details
217 !> CLOCK 型の変数を利用する際にはまずこのサブルーチンによって
218 !> 初期化を行ってください。`name` には計測内容を与えてください。
219 !>
220 !> @param[out] clk 初期化する CLOCK 型変数
221 !> @param[in] name 計測内容の名称
222 !> @endja
223 subroutine dcclockcreate0(clk, name)
224 use dc_message, only: messagenotify
225 use dc_date, only: dcdatetimecreate
226 implicit none
227 type(clock), intent(out):: clk
228 character(*), intent(in):: name
229 character(*), parameter:: subname = 'DCClockCreate'
230 continue
231 call beginsub(subname, 'name=%c', c1=trim(name), version=version)
232 if (clk % initialized) then
233 call messagenotify('W', subname, 'This argument (type CLOCK) is already initialized.')
234 call dbgmessage('already initialized')
235 goto 999
236 end if
237 clk % name = name
238 clk % elapsed_time = 0.0
239 clk % start_time = - 1.0
240 clk % initialized = .true.
241 call dcdatetimecreate(clk % start_date)
242 call dbgmessage('normal initialized')
243999 continue
244 call endsub(subname)
245 end subroutine dcclockcreate0
246 !> @en
247 !> @brief Close CLOCK variable
248 !> @details
249 !> Closes a CLOCK type variable.
250 !>
251 !> @param[in,out] clk CLOCK type variable to close
252 !> @enden
253 !>
254 !> @ja
255 !> @brief CLOCK の終了サブルーチン
256 !> @details
257 !> CLOCK 型の変数をクローズします。
258 !>
259 !> @param[in,out] clk クローズする CLOCK 型変数
260 !> @endja
261 subroutine dcclockclose0(clk)
262 implicit none
263 type(clock), intent(inout):: clk
264 character(*), parameter:: subname = 'DCClockClose'
265 continue
266 call beginsub(subname)
267 if (clk % initialized) then
268 clk % initialized = .false.
269 clk % name = ''
270 end if
271 call endsub(subname)
272 end subroutine dcclockclose0
273 !> @en
274 !> @brief Start measurement
275 !> @details
276 !> Starts measurement at the point this subroutine is called.
277 !>
278 !> If `clk` has not been initialized by DCClockCreate, an error is raised.
279 !> If `err` is provided, .true. is returned in `err` and the program continues.
280 !>
281 !> @param[in,out] clk CLOCK type variable
282 !> @param[out] err Error flag (optional). .true. if error occurred.
283 !> @enden
284 !>
285 !> @ja
286 !> @brief 計測の開始
287 !> @details
288 !> このサブルーチンを呼んだ時点で計測を開始します。
289 !>
290 !> `clk` に対して DCClockCreate による初期化が行われていない場合、
291 !> エラーを発生させます。`err` を与える場合には `err` に .true. が返り、
292 !> プログラムは続行されます。
293 !>
294 !> @param[in,out] clk CLOCK 型変数
295 !> @param[out] err エラーフラグ (省略可)。エラー時に .true.。
296 !> @endja
297 subroutine dcclockstart0(clk, err)
298 use dc_message, only: messagenotify
299 use dc_string, only: tochar
301 use dc_date, only: evalsec
302 !$ use omp_lib
303 implicit none
304 type(clock), intent(inout):: clk
305 logical, intent(out), optional:: err
306 character(STRING):: cause_c
307 integer:: stat
308 character(*), parameter:: subname = 'DCClockStart'
309 continue
310 call beginsub(subname)
311 stat = dc_noerr
312 cause_c = 'CLOCK'
313 if (.not. clk % initialized) then
314 call messagenotify('W', subname, 'Call Create before Start in dc_clock.')
315 call dbgmessage('Ignored because input argument was not initialized.')
316 stat = dc_enotinit
317 goto 999
318 end if
319 call cpu_time(clk % start_time) ! (out)
320 !$ clk % start_time = omp_get_wtime()
321 call dbgmessage('name=%c, cpu_time=%f', &
322 & c1=trim(clk % name), d=(/clk % start_time/) )
323999 continue
324 call storeerror(stat, subname, err, cause_c)
325 call endsub(subname)
326 end subroutine dcclockstart0
327 !> @en
328 !> @brief Pause measurement
329 !> @details
330 !> Pauses measurement at the point this subroutine is called.
331 !>
332 !> If `clk` has not been initialized by DCClockCreate, an error is raised.
333 !> If `err` is provided, .true. is returned in `err` and the program continues.
334 !>
335 !> @param[in,out] clk CLOCK type variable
336 !> @param[out] err Error flag (optional). .true. if error occurred.
337 !> @enden
338 !>
339 !> @ja
340 !> @brief 計測の一時停止
341 !> @details
342 !> このサブルーチンを呼んだ時点で計測を一時停止します。
343 !>
344 !> `clk` に対して DCClockCreate による初期化が行われていない場合、
345 !> エラーを発生させます。`err` を与える場合には `err` に .true. が返り、
346 !> プログラムは続行されます。
347 !>
348 !> @param[in,out] clk CLOCK 型変数
349 !> @param[out] err エラーフラグ (省略可)。エラー時に .true.。
350 !> @endja
351 subroutine dcclockstop0(clk, err)
352 use dc_message, only: messagenotify
353 use dc_string, only: tochar
355 use dc_date, only: evalsec, operator(+), operator(-)
356 use dc_date_types, only: dc_difftime
357 use dc_types, only: dp
358 !$ use omp_lib
359 implicit none
360 type(clock), intent(inout):: clk
361 logical, intent(out), optional:: err
362 character(STRING):: cause_c
363 real(DP):: stop_time
364 integer:: stat
365 character(*), parameter:: subname = 'DCClockStop'
366 continue
367 call beginsub(subname)
368 stat = dc_noerr
369 cause_c = 'CLOCK'
370 if (.not. clk % initialized) then
371 call messagenotify('W', subname, 'Call Create before Stop in dc_clock.')
372 call dbgmessage('Ignored because input argument was not initialized.')
373 stat = dc_enotinit
374 goto 999
375 elseif (clk % start_time < 0.0_dp) then
376 call messagenotify('W', subname, 'Call Start before Stop in dc_clock.')
377 call dbgmessage('Ignored because input argument was not started.')
378 goto 999
379 end if
380 call cpu_time(stop_time)
381 !$ stop_time = omp_get_wtime()
382 clk % elapsed_time = clk % elapsed_time + stop_time - clk % start_time
383 clk % start_time = - 1.0
384 call dbgmessage('name=%c, cpu_time=%f, elapsed_time=%f', &
385 & c1=trim(clk % name), d=(/stop_time, clk % elapsed_time/))
386999 continue
387 call storeerror(stat, subname, err, cause_c)
388 call endsub(subname)
389 end subroutine dcclockstop0
390 !> @en
391 !> @brief Get CPU time (in seconds) - single precision
392 !> @details
393 !> Gets CPU time (in seconds) to `sec`.
394 !>
395 !> If `clk` has not been initialized by DCClockCreate, an error is raised.
396 !> If `err` is provided, .true. is returned in `err` and the program continues.
397 !>
398 !> @param[in] clk CLOCK type variable
399 !> @param[out] sec CPU time in seconds (single precision)
400 !> @param[out] err Error flag (optional). .true. if error occurred.
401 !> @enden
402 !>
403 !> @ja
404 !> @brief CPU 時間 (単位: 秒) の取得 (単精度)
405 !> @details
406 !> CPU 時間 (単位: 秒) を `sec` に取得します。
407 !>
408 !> `clk` に対して DCClockCreate による初期化が行われていない場合、
409 !> エラーを発生させます。`err` を与える場合には `err` に .true. が返り、
410 !> プログラムは続行されます。
411 !>
412 !> @param[in] clk CLOCK 型変数
413 !> @param[out] sec CPU 時間 (秒、単精度)
414 !> @param[out] err エラーフラグ (省略可)。エラー時に .true.。
415 !> @endja
416 subroutine dcclockgetr(clk, sec, err) !:doc-priority 40:
417 use dc_message, only: messagenotify
418 use dc_date, only: evalsec
419 use dc_string, only: cprintft
421 implicit none
422 type(clock), intent(in):: clk
423 real, intent(out):: sec
424 logical, intent(out), optional:: err
425 character(STRING):: cause_c
426 integer:: stat
427 character(*), parameter:: subname = 'DCClockGetR'
428 continue
429 call beginsub(subname)
430 stat = dc_noerr
431 cause_c = 'CLOCK'
432 if (.not. clk % initialized) then
433 call messagenotify('W', subname, 'Call Create before Get in dc_clock.')
434 call dbgmessage('Ignored because input argument was not initialized.')
435 stat = dc_enotinit
436 goto 999
437 end if
438 sec = real(clk % elapsed_time, kind=kind(sec))
439 call dbgmessage('name=%c, return sec=<%r>', &
440 & c1=trim(clk % name), r=(/sec/))
441999 continue
442 call storeerror(stat, subname, err, cause_c)
443 call endsub(subname)
444 end subroutine dcclockgetr
445 !> @en
446 !> @brief Get CPU time (in seconds) - double precision
447 !> @details
448 !> Gets CPU time (in seconds) to `sec`.
449 !>
450 !> If `clk` has not been initialized by DCClockCreate, an error is raised.
451 !> If `err` is provided, .true. is returned in `err` and the program continues.
452 !>
453 !> @param[in] clk CLOCK type variable
454 !> @param[out] sec CPU time in seconds (double precision)
455 !> @param[out] err Error flag (optional). .true. if error occurred.
456 !> @enden
457 !>
458 !> @ja
459 !> @brief CPU 時間 (単位: 秒) の取得 (倍精度)
460 !> @details
461 !> CPU 時間 (単位: 秒) を `sec` に取得します。
462 !>
463 !> `clk` に対して DCClockCreate による初期化が行われていない場合、
464 !> エラーを発生させます。`err` を与える場合には `err` に .true. が返り、
465 !> プログラムは続行されます。
466 !>
467 !> @param[in] clk CLOCK 型変数
468 !> @param[out] sec CPU 時間 (秒、倍精度)
469 !> @param[out] err エラーフラグ (省略可)。エラー時に .true.。
470 !> @endja
471 subroutine dcclockgetd(clk, sec, err) !:doc-priority 60:
472 use dc_types, only: dp
473 use dc_string, only: cprintf
474 use dc_message, only: messagenotify
475 use dc_date, only: evalsec
477 implicit none
478 type(clock), intent(in):: clk
479 real(DP), intent(out):: sec
480 logical, intent(out), optional:: err
481 character(STRING):: cause_c
482 integer:: stat
483 character(*), parameter:: subname = 'DCClockGetD'
484 continue
485 call beginsub(subname)
486 stat = dc_noerr
487 cause_c = 'CLOCK'
488 if (.not. clk % initialized) then
489 call messagenotify('W', subname, 'Call Create before Get in dc_clock.')
490 call dbgmessage('Ignored because input argument was not initialized.')
491 stat = dc_enotinit
492 goto 999
493 end if
494 sec = clk % elapsed_time
495 call dbgmessage('name=%c, return sec=<%f>', &
496 & c1=trim(clk % name), d=(/sec/))
497999 continue
498 call storeerror(stat, subname, err, cause_c)
499 call endsub(subname)
500 end subroutine dcclockgetd
501 !> @en
502 !> @brief Get CPU time (in seconds) as function
503 !> @details
504 !> Returns CPU time (in seconds).
505 !> If `clk` has not been initialized by DCClockCreate, -1.0 is returned.
506 !>
507 !> @param[in] clk CLOCK type variable
508 !> @return CPU time in seconds (double precision). -1.0 if not initialized.
509 !> @enden
510 !>
511 !> @ja
512 !> @brief CPU 時間 (単位: 秒) の取得 (関数)
513 !> @details
514 !> CPU 時間 (単位: 秒) を返します。
515 !> `clk` に対して DCClockCreate による初期化が行われていない場合、
516 !> -1.0 が返ります。
517 !>
518 !> @param[in] clk CLOCK 型変数
519 !> @return CPU 時間 (秒、倍精度)。初期化されていない場合は -1.0。
520 !> @endja
521 function dcclockevalsecd(clk) result(result)
522 use dc_types, only: dp
523 implicit none
524 type(clock), intent(in):: clk
525 real(dp):: result
526 logical:: err
527 continue
528 call dcclockgetd(clk, result, err)
529 if (err) result = -1.0_dp
530 end function dcclockevalsecd
531 !> @en
532 !> @brief Convert CPU time to formatted string
533 !> @details
534 !> Formats CPU time appropriately and returns it as a character variable.
535 !> If `clk` has not been initialized by DCClockCreate, an empty string is returned.
536 !>
537 !> @param[in] clk CLOCK type variable
538 !> @return Formatted string of CPU time
539 !> @enden
540 !>
541 !> @ja
542 !> @brief CPU 時間を適当に整形して文字型変数に変換
543 !> @details
544 !> CPU 時間に関して適当に整形を行い、文字型変数に変換して返します。
545 !> `clk` に対して DCClockCreate による初期化が行われていない場合、
546 !> 空文字が返ります。
547 !>
548 !> @param[in] clk CLOCK 型変数
549 !> @return 整形された CPU 時間の文字列
550 !> @endja
551 function dcclocktochar0(clk) result(result)
552 use dc_string, only: cprintf
553 use dc_date, only: evalsec
554 implicit none
555 type(clock), intent(in):: clk
556 character(STRING):: result
557 character(20):: clk_name
558 integer:: name_len
559 continue
560 clk_name = ''
561 name_len = min(len(clk_name), len_trim(clk % name))
562 if (name_len > 0) then
563 clk_name(1:name_len) = clk % name(1:name_len)
564 end if
565 if (clk % initialized) then
566 result = cprintf(' %c%c %c', c1 = clk_name, &
567 & c2=trim(result_value_form(clk % elapsed_time)), &
568 & c3=trim(fit_unit_value(clk % elapsed_time)))
569 else
570 result = ''
571 end if
572 end function dcclocktochar0
573 !> @en
574 !> @brief Display CLOCK variable information
575 !> @details
576 !> Displays information about a CLOCK type variable.
577 !> Specify the output unit number in `unit`. If `unit` is not given,
578 !> output goes to standard output.
579 !>
580 !> If `clk` has not been initialized by DCClockCreate, an error is raised.
581 !> If `err` is provided, .true. is returned in `err` and the program continues.
582 !>
583 !> @param[in] clk CLOCK type variable
584 !> @param[in] unit Output unit number (optional). Default: standard output.
585 !> @param[in] indent Indent of displayed messages (optional)
586 !> @param[out] err Error flag (optional). .true. if error occurred.
587 !> @enden
588 !>
589 !> @ja
590 !> @brief 構造型 CLOCK 変数の情報を表示
591 !> @details
592 !> 構造型 CLOCK 変数に関する情報を表示します。`unit` には出力先の装置番号を
593 !> 与えてください。`unit` を与えない場合、標準出力へ表示されます。
594 !>
595 !> `clk` に対して DCClockCreate による初期化が行われていない場合、
596 !> エラーを発生させます。`err` を与える場合には `err` に .true. が返り、
597 !> プログラムは続行されます。
598 !>
599 !> @param[in] clk CLOCK 型変数
600 !> @param[in] unit 出力先装置番号 (省略可)。デフォルト: 標準出力。
601 !> @param[in] indent 表示されるメッセージの字下げ (省略可)
602 !> @param[out] err エラーフラグ (省略可)。エラー時に .true.。
603 !> @endja
604 subroutine dcclockputline0(clk, unit, indent, err)
605 use dc_types, only: stdout
606 use dc_message, only: messagenotify
607 use dc_string, only: printf, tochar, cprintf
608 use dc_date, only: evalsec, evalday, tochar
610 use dc_types, only: dp
611 implicit none
612 type(clock), intent(in):: clk
613 integer, intent(in), optional:: unit
614 character(*), intent(in), optional:: indent
615 logical, intent(out), optional:: err
616 integer:: out_unit
617 character(STRING):: cause_c
618 integer:: stat
619 integer:: indent_len
620 character(STRING):: indent_str
621 character(*), parameter:: subname = 'DCClockPutLine'
622 continue
623 call beginsub(subname)
624 stat = dc_noerr
625 cause_c = 'CLOCK'
626 if (.not. clk % initialized) then
627 call messagenotify('W', subname, 'Call Create before PutLine in dc_clock.')
628 call dbgmessage('Ignored because input argument was not initialized.')
629 stat = dc_enotinit
630 goto 999
631 end if
632 if (present(unit)) then
633 out_unit = unit
634 else
635 out_unit = stdout
636 end if
637 indent_len = 0
638 indent_str = ''
639 if (present(indent)) then
640 if (len(indent) /= 0) then
641 indent_len = len(indent)
642 indent_str(1:indent_len) = indent
643 end if
644 end if
645 call printf(out_unit, &
646 & indent_str(1:indent_len) // &
647 & '#<CLOCK:: @name=%c @clocking=%y @elapsed_time=%f sec. %c @start_date=%c>', &
648 & c1=trim(clk % name), l=(/clk % start_time > 0.0_dp/), &
649 & d=(/clk % elapsed_time/), &
650 & c2=trim(fit_unit_value(clk % elapsed_time)), &
651 & c3=trim(tochar(clk % start_date)))
652 call dbgmessage('name=%c, output to device number %d', &
653 & c1=trim(clk % name), i=(/out_unit/))
654999 continue
655 call storeerror(stat, subname, err, cause_c)
656 call endsub(subname)
657 end subroutine dcclockputline0
658 !> @en
659 !> @brief Display CPU time summary
660 !> @details
661 !> Displays the total CPU time summary. Pass an array of CLOCK variables to `clks`.
662 !> This is intended to be called at the end of the program.
663 !> Specify the output unit number in `unit`. If `unit` is not given,
664 !> output goes to standard output.
665 !>
666 !> If `total_auto` is .true., the sum of all `clks` is automatically displayed.
667 !> If `clk_total` is given, it takes precedence.
668 !>
669 !> If `clk_total` is given, this CLOCK variable is displayed as the total.
670 !>
671 !> If `total_name` is given, this string is output at the beginning of the summary.
672 !>
673 !> If any `clk` in `clks` has not been initialized by DCClockCreate, an error is raised.
674 !> If `err` is provided, .true. is returned in `err` and the program continues.
675 !>
676 !> @param[in] clks Array of CLOCK type variables
677 !> @param[in] unit Output unit number (optional). Default: standard output.
678 !> @param[in] total_auto If .true., automatically display sum of all clks (optional)
679 !> @param[in] clk_total CLOCK variable to display as total (optional)
680 !> @param[in] total_name String to output at the beginning of summary (optional)
681 !> @param[out] err Error flag (optional). .true. if error occurred.
682 !> @enden
683 !>
684 !> @ja
685 !> @brief CPU 時間の総計を表示
686 !> @details
687 !> CPU 時間の総計を表示します。`clks` へ CLOCK 変数の配列を与えてください。
688 !> プログラムの最後で呼び出されることを想定しています。
689 !> `unit` には出力先の装置番号を与えてください。
690 !> `unit` を与えない場合、標準出力へ表示されます。
691 !>
692 !> `total_auto` に .true. を与えると、`clks` を全て足し合わせた
693 !> 合計値を自動的に表示します。`clk_total` が与えられている場合は
694 !> `clk_total` が優先されます。
695 !>
696 !> `clk_total` に CLOCK 変数を与えると、この変数を合計値として表示します。
697 !>
698 !> `total_name` に文字型変数を与えると、総計メッセージの冒頭に
699 !> この文字列を出力します。
700 !>
701 !> `clks` 内の `clk` に対して DCClockCreate による初期化が行われていない場合、
702 !> エラーを発生させます。`err` を与える場合には `err` に .true. が返り、
703 !> プログラムは続行されます。
704 !>
705 !> @param[in] clks CLOCK 型変数の配列
706 !> @param[in] unit 出力先装置番号 (省略可)。デフォルト: 標準出力。
707 !> @param[in] total_auto .true. の場合、全 clks の合計を自動表示 (省略可)
708 !> @param[in] clk_total 合計として表示する CLOCK 変数 (省略可)
709 !> @param[in] total_name 総計メッセージ冒頭に出力する文字列 (省略可)
710 !> @param[out] err エラーフラグ (省略可)。エラー時に .true.。
711 !> @endja
712 subroutine dcclockresult0(clks, unit, total_auto, clk_total, total_name, err)
713 use dc_types, only: stdout, string, dp
714 use dc_message, only: messagenotify
715 use dc_string, only: printf, tochar, cprintf
716 use dc_date, only: evalsec
718 implicit none
719 type(clock), intent(in):: clks(:)
720 integer, intent(in), optional:: unit
721 logical, intent(in), optional:: total_auto
722 type(clock), intent(in), optional:: clk_total
723 logical, intent(out), optional:: err
724 character(*), intent(in), optional:: total_name
725 integer:: out_unit, i, clks_size, ra
726 character(20):: clk_name
727 integer:: name_len
728 character(STRING):: cause_c
729 character(STRING):: total_name_work
730 type(clock):: clk_auto_total
731 logical:: total_print_complete
732 real(DP):: elapsed_time_val_cor
733 integer:: stat
734 character(*), parameter:: total_time_mes = ' TOTAL TIME = '
735 integer:: myrank_mpi, nprocs_mpi
736 character(*), parameter:: subname = 'DCClockResult'
737 continue
738 call beginsub(subname)
739 stat = dc_noerr
740 cause_c = 'CLOCK'
741 clks_size = size(clks)
742 do i = 1, clks_size
743 if (.not. clks(i) % initialized) then
744 call messagenotify('W', subname, 'Call Create before Result in dc_clock.')
745 call dbgmessage('Ignored because input argument was not initialized.')
746 stat = dc_enotinit
747 goto 999
748 end if
749 end do
750 if (present(unit)) then
751 out_unit = unit
752 else
753 out_unit = stdout
754 end if
755 if (present(total_name)) then
756 total_name_work = ' (' // trim(total_name) // ')'
757 else
758 total_name_work = ''
759 end if
760 myrank_mpi = -1
761 nprocs_mpi = 1
762 do ra = 0, nprocs_mpi - 1
763 call printf(out_unit, '')
764 if ( myrank_mpi < 0 ) then
765 call printf(out_unit, &
766 & ' ############## CPU TIME SUMMARY%c################', &
767 & c1=trim(total_name_work) // ' ')
768 else
769 call printf(out_unit, &
770 & ' ####### CPU TIME SUMMARY%c#### [rank=%06d] ####', &
771 & c1=trim(total_name_work) // ' ', &
772 & i = (/myrank_mpi/) )
773 end if
774 do i = 1, clks_size
775 clk_name = ''
776 name_len = min(len(clk_name), len_trim(clks(i) % name))
777 if (name_len > 0) then
778 clk_name(1:name_len) = clks(i) % name(1:name_len)
779 end if
780 elapsed_time_val_cor = clks(i) % elapsed_time
781 if (elapsed_time_val_cor < 0.0_dp) elapsed_time_val_cor = 0.0_dp
782 call printf(out_unit, &
783 & ' %c%c %c', c1=clk_name, &
784 & c2=trim(result_value_form(elapsed_time_val_cor)), &
785 & c3=trim(fit_unit_value(clks(i) % elapsed_time)))
786 end do
787 total_print_complete = .false.
788 if (present(clk_total)) then
789 if (clk_total % initialized) then
790 call printf(out_unit, &
791 & ' ------------------------------------------------')
792 elapsed_time_val_cor = clk_total % elapsed_time
793 if (elapsed_time_val_cor < 0.0_dp) elapsed_time_val_cor = 0.0_dp
794 call printf(out_unit, &
795 & ' %c%c %c', c1=total_time_mes, &
796 & c2=trim(result_value_form(elapsed_time_val_cor)), &
797 & c3=trim(fit_unit_value(clk_total % elapsed_time)))
798 total_print_complete = .true.
799 end if
800 end if
801 if (present(total_auto) .and. .not. total_print_complete) then
802 if (total_auto) then
803 clk_auto_total = clks(1)
804 if (clks_size > 1) then
805 do i = 2, clks_size
806 clk_auto_total = clk_auto_total + clks(i)
807 end do
808 end if
809 call printf(out_unit, &
810 & ' ------------------------------------------------')
811 elapsed_time_val_cor = clk_auto_total % elapsed_time
812 if (elapsed_time_val_cor < 0.0_dp) elapsed_time_val_cor = 0.0_dp
813 call printf(out_unit, &
814 & ' %c%c %c', c1=total_time_mes, &
815 & c2=trim(result_value_form(elapsed_time_val_cor)), &
816 & c3=trim(fit_unit_value(clk_auto_total % elapsed_time)))
817 end if
818 end if
819 call dbgmessage('total results, output to device number %d', &
820 & i=(/out_unit/))
821 end do
822999 continue
823 call storeerror(stat, subname, err, cause_c)
824 call endsub(subname)
825 end subroutine dcclockresult0
826 !> @brief Format double precision value to exponential notation string
827 !> @param[in] value Double precision value to format
828 !> @return Formatted string (e.g., "0.183400E+02")
829 function result_value_form(value) result(result)
830 use dc_types, only: dp, token
831 implicit none
832 character(TOKEN):: result
833 real(DP), intent(in):: value
834 continue
835 write(result, "(e15.6)") value
836 end function result_value_form
837 !> @brief Format seconds to appropriate unit string
838 !> @details
839 !> Treats the value given to `sec` as seconds and formats it as:
840 !> "(23.18 days)". The unit is chosen from days, hrs., minutes
841 !> (chosen so the value is >= 1). Returns empty string if < 1 minute.
842 !> @param[in] sec Seconds value
843 !> @param[in] diff DC_DIFFTIME to use directly (optional)
844 !> @return Formatted string (e.g., "(23.18 days)")
845 function fit_unit_value(sec, diff) result(result)
846 use dc_types, only: dp, token
847 use dc_date_types, only: dc_difftime
848 use dc_date, only: dcdifftimecreate, evalday, evalhour, evalmin, evalsec
849 implicit none
850 character(TOKEN):: result
851 real(DP), intent(in):: sec
852 type(dc_difftime), intent(in), optional:: diff
853 type(dc_difftime):: diffw
854 character(TOKEN):: unit
855 real(DP):: value
856 character(TOKEN):: cval
857 continue
858 if ( present(diff) ) then
859 diffw = diff
860 else
861 call dcdifftimecreate( diffw, sec = sec )
862 end if
863 if (evalday(diffw) > 1.0_dp) then
864 unit = ' days'
865 value = evalday(diffw)
866 elseif (evalhour(diffw) > 1.0_dp) then
867 unit = ' hrs.'
868 value = evalhour(diffw)
869 elseif (evalmin(diffw) > 1.0_dp) then
870 unit = ' minutes'
871 value = evalmin(diffw)
872 else
873 result = ''
874 return
875 end if
876 cval = printf_g5_2(value)
877 result = '(' // trim(adjustl(cval)) // trim(unit) // ')'
878 end function fit_unit_value
879 !> @brief Format numeric value with 2 decimal places
880 !> @details
881 !> Formats the value given as: "23.18" or "0.23"
882 !> @param[in] value Numeric value to format
883 !> @return Formatted string
884 function printf_g5_2(value) result(result)
885 use dc_types, only: dp, token
886 use dc_string, only: cprintft
887 implicit none
888 character(TOKEN):: result
889 real(DP), intent(in):: value
890 character(TOKEN):: int_part, dem_part
891 integer:: dem_int
892 continue
893 write(int_part, "(i20)") int(value)
894 dem_int = nint((value - int(value)) * 100)
895 if (dem_int < 0) dem_int = - dem_int
896 if (dem_int == 100) then
897 dem_int = 0
898 write(int_part, "(i20)") int(value) + 1
899 end if
900 dem_part = cprintft('%02d', i=(/dem_int/))
901 result = trim(adjustl(int_part)) // '.' // trim(dem_part)
902 end function printf_g5_2
903 !> @en
904 !> @brief Add CLOCK variables
905 !> @details
906 !> Adds CLOCK variables `clk1` and `clk2`.
907 !> Sums the CPU times of the two given CLOCK variables and returns as CLOCK.
908 !> The name of the result is a combination of `clk1` and `clk2` names joined by '+'.
909 !>
910 !> @param[in] clk1 First CLOCK variable
911 !> @param[in] clk2 Second CLOCK variable
912 !> @return Sum of the two CLOCK variables
913 !> @enden
914 !>
915 !> @ja
916 !> @brief CLOCK 変数を足し合わせる
917 !> @details
918 !> CLOCK 変数 `clk1` と `clk2` を足し合わせます。
919 !> 与えられた 2 つの CLOCK 変数の CPU 時間を合計し、
920 !> CLOCK 変数として返します。計測内容の名称は `clk1` と `clk2`
921 !> の名称を '+' で組み合わせたものとなります。
922 !>
923 !> @param[in] clk1 1つ目の CLOCK 変数
924 !> @param[in] clk2 2つ目の CLOCK 変数
925 !> @return 2 つの CLOCK 変数の合計
926 !> @endja
927 function dcclockadd(clk1, clk2) result(clk_total)
928 use dc_string, only: cprintf
929 use dc_date, only: operator(+), operator(<)
930 implicit none
931 type(clock), intent(in):: clk1
932 type(clock), intent(in):: clk2
933 type(clock):: clk_total
934 continue
935 if (.not. clk1 % initialized .or. .not. clk2 % initialized) then
936 clk_total % initialized = .false.
937 return
938 end if
939 clk_total % name = cprintf('%c+%c', &
940 & c1=trim(clk1 % name), c2=trim(clk2 % name))
941 clk_total % start_time = - 1.0
942 clk_total % initialized = .true.
943 clk_total % elapsed_time = 0.0
944 if (clk1 % start_date < clk2 % start_date) then
945 clk_total % start_date = clk1 % start_date
946 else
947 clk_total % start_date = clk2 % start_date
948 end if
949 clk_total % elapsed_time = &
950 & clk1 % elapsed_time + clk2 % elapsed_time
951 end function dcclockadd
952 !> @en
953 !> @brief Subtract CLOCK variables
954 !> @details
955 !> Subtracts `clk2` from CLOCK variable `clk1`.
956 !> Returns the difference between the CPU times of the two CLOCK variables.
957 !> The name of the result is a combination of `clk1` and `clk2` names joined by '-'.
958 !>
959 !> @param[in] clk1 First CLOCK variable (minuend)
960 !> @param[in] clk2 Second CLOCK variable (subtrahend)
961 !> @return Difference of the two CLOCK variables
962 !> @enden
963 !>
964 !> @ja
965 !> @brief CLOCK 変数を引き算する
966 !> @details
967 !> CLOCK 変数 `clk1` から `clk2` を引きます。
968 !> 1 つ目の CLOCK 変数の CPU 時間と 2 つ目の CLOCK 変数の CPU 時間との差を
969 !> CLOCK 変数として返します。計測内容の名称は `clk1` と `clk2`
970 !> の名称を '-' で組み合わせたものとなります。
971 !>
972 !> @param[in] clk1 1つ目の CLOCK 変数 (被減数)
973 !> @param[in] clk2 2つ目の CLOCK 変数 (減数)
974 !> @return 2 つの CLOCK 変数の差
975 !> @endja
976 function dcclocksubtract(clk1, clk2) result(clk_total)
977 use dc_string, only: cprintf
978 use dc_date, only: operator(-), operator(<)
979 implicit none
980 type(clock), intent(in):: clk1
981 type(clock), intent(in):: clk2
982 type(clock):: clk_total
983 continue
984 if (.not. clk1 % initialized .or. .not. clk2 % initialized) then
985 clk_total % initialized = .false.
986 return
987 end if
988 clk_total % name = cprintf('%c-%c', &
989 & c1=trim(clk1 % name), c2=trim(clk2 % name))
990 clk_total % start_time = - 1.0
991 clk_total % initialized = .true.
992 clk_total % elapsed_time = 0.0
993 if (clk1 % start_date < clk2 % start_date) then
994 clk_total % start_date = clk1 % start_date
995 else
996 clk_total % start_date = clk2 % start_date
997 end if
998 clk_total % elapsed_time = &
999 & clk1 % elapsed_time - clk2 % elapsed_time
1000 end function dcclocksubtract
1001 !> @en
1002 !> @brief Change the measurement name
1003 !> @details
1004 !> Changes the measurement name of CLOCK variable `clk`.
1005 !> This name was originally specified by the `name` argument in Create.
1006 !>
1007 !> If `clk` has not been initialized by DCClockCreate, an error is raised.
1008 !> If `err` is provided, .true. is returned in `err` and the program continues.
1009 !>
1010 !> @param[in,out] clk CLOCK type variable
1011 !> @param[in] name New measurement name
1012 !> @param[out] err Error flag (optional). .true. if error occurred.
1013 !> @enden
1014 !>
1015 !> @ja
1016 !> @brief 測定内容の名称を変更する
1017 !> @details
1018 !> CLOCK 変数 `clk` の計測内容の名称を変更します。
1019 !> この名称は Create の `name` 引数で指定されたものです。
1020 !>
1021 !> `clk` に対して DCClockCreate による初期化が行われていない場合、
1022 !> エラーを発生させます。`err` を与える場合には `err` に .true. が返り、
1023 !> プログラムは続行されます。
1024 !>
1025 !> @param[in,out] clk CLOCK 型変数
1026 !> @param[in] name 新しい計測内容の名称
1027 !> @param[out] err エラーフラグ (省略可)。エラー時に .true.。
1028 !> @endja
1029 subroutine dcclocksetname0(clk, name, err)
1030 use dc_message, only: messagenotify
1031 use dc_string, only: tochar, cprintf
1033 implicit none
1034 type(clock), intent(inout):: clk
1035 character(*), intent(in):: name
1036 logical, intent(out), optional:: err
1037 character(STRING):: cause_c
1038 integer:: stat
1039 character(*), parameter:: subname = 'DCClockSetName'
1040 continue
1041 call beginsub(subname)
1042 stat = dc_noerr
1043 cause_c = 'CLOCK'
1044 if (.not. clk % initialized) then
1045 call messagenotify('W', subname, 'Call Create before Set_Name in dc_clock.')
1046 call dbgmessage('Ignored because input argument was not initialized.')
1047 stat = dc_enotinit
1048 goto 999
1049 end if
1050 clk % name = name
1051 call dbgmessage('set new name "%c"', c1=trim(clk % name))
1052999 continue
1053 call storeerror(stat, subname, err, cause_c)
1054 call endsub(subname)
1055 end subroutine dcclocksetname0
1056 !> @en
1057 !> @brief Display predicted CPU time and completion date
1058 !> @details
1059 !> From CLOCK variable `clk` and `progress`, displays predicted CPU time
1060 !> and completion date as follows:
1061 !>
1062 !> @code
1063 !> ########## PREDICTION OF CALCULATION ###########
1064 !> Start Date 2007-03-08T16:49:25+09:00
1065 !> Current Date 2007-03-08T16:49:27+09:00
1066 !> Progress 66.67% [**************** ]
1067 !> Remaining CPU TIME 0.100000E+01
1068 !> Completion Date 2007-03-08T16:49:28+09:00
1069 !> @endcode
1070 !>
1071 !> Give `progress` a value from 0 to 1. 0 is program start, 1 is end.
1072 !> (For example, give 0.5 when the program is half done.)
1073 !>
1074 !> Note: The "prediction" is calculated by a simple algorithm from elapsed
1075 !> time and progress, so it is not an accurate prediction. Use as a guide only.
1076 !>
1077 !> Specify the output unit number in `unit`. If `unit` is not given,
1078 !> output goes to standard output.
1079 !>
1080 !> If `clk` has not been initialized by DCClockCreate, an error is raised.
1081 !> If `err` is provided, .true. is returned in `err` and the program continues.
1082 !>
1083 !> @param[in] clk CLOCK type variable
1084 !> @param[in] progress Progress value (0.0 to 1.0)
1085 !> @param[in] unit Output unit number (optional). Default: standard output.
1086 !> @param[out] err Error flag (optional). .true. if error occurred.
1087 !> @enden
1088 !>
1089 !> @ja
1090 !> @brief プログラムが終了するまでの予測 CPU 時間・日時を表示
1091 !> @details
1092 !> CLOCK 変数 `clk` と `progress` から、プログラムが終了するまでの
1093 !> 予測 CPU 時間および日時を以下のように表示します。
1094 !>
1095 !> @code
1096 !> ########## PREDICTION OF CALCULATION ###########
1097 !> Start Date 2007-03-08T16:49:25+09:00
1098 !> Current Date 2007-03-08T16:49:27+09:00
1099 !> Progress 66.67% [**************** ]
1100 !> Remaining CPU TIME 0.100000E+01
1101 !> Completion Date 2007-03-08T16:49:28+09:00
1102 !> @endcode
1103 !>
1104 !> `progress` には 0 〜 1 までの値を与えてください。
1105 !> プログラムの開始時を 0、終了時を 1 とします
1106 !> (例: プログラムが半分進んだ時には 0.5 を与えます)。
1107 !>
1108 !> @note ここで行う「予測」とは、これまでの経過時間および終了した
1109 !> プログラムの分量から単純なアルゴリズムで割り出しているものなので、
1110 !> 正確な予測値を返すわけではありません。あくまで目安として利用してください。
1111 !>
1112 !> `unit` には出力先の装置番号を与えてください。
1113 !> `unit` を与えない場合、標準出力へ表示されます。
1114 !>
1115 !> `clk` に対して DCClockCreate による初期化が行われていない場合、
1116 !> エラーを発生させます。`err` を与える場合には `err` に .true. が返り、
1117 !> プログラムは続行されます。
1118 !>
1119 !> @param[in] clk CLOCK 型変数
1120 !> @param[in] progress 進捗値 (0.0 〜 1.0)
1121 !> @param[in] unit 出力先装置番号 (省略可)。デフォルト: 標準出力。
1122 !> @param[out] err エラーフラグ (省略可)。エラー時に .true.。
1123 !> @endja
1124 subroutine dcclockpredict0(clk, progress, unit, err)
1125 use dc_types, only: stdout, dp
1126 use dc_message, only: messagenotify
1127 use dc_string, only: tochar, cprintf, printf
1130 use dc_date, only: operator(+), dcdatetimecreate, tochar, evalsec, &
1131 & dcdifftimecreate
1132 implicit none
1133 type(clock), intent(in):: clk
1134 real, intent(in):: progress
1135 integer, intent(in), optional:: unit
1136 logical, intent(out), optional:: err
1137 character(STRING):: cause_c
1138 integer:: stat, out_unit
1139 type(dc_difftime):: remain_diff
1140 type(dc_datetime):: comp_date, cur_date
1141 character(7):: prog_percent
1142 character(25):: prog_bar
1143 integer:: prog_bar_ptr
1144 real:: prog_valid
1145 character(*), parameter:: subname = 'DCClockPredict'
1146 continue
1147 call beginsub(subname)
1148 stat = dc_noerr
1149 cause_c = 'CLOCK'
1150 if (.not. clk % initialized) then
1151 call messagenotify('W', subname, 'Call Create before Predict in dc_clock.')
1152 call dbgmessage('Ignored because input argument was not initialized.')
1153 stat = dc_enotinit
1154 goto 999
1155 end if
1156 if (progress <= 0.0) then
1157 call messagenotify('W', subname, 'Specify 0.0 -- 1.0 value to "progress"')
1158 return
1159 elseif (progress > 1.0) then
1160 call messagenotify('W', subname, 'Over 1.0 value to "progress" was modified to 1.0')
1161 prog_valid = 1.0
1162 else
1163 prog_valid = progress
1164 end if
1165 if (present(unit)) then
1166 out_unit = unit
1167 else
1168 out_unit = stdout
1169 end if
1170 call dcdifftimecreate( remain_diff, &
1171 & sec = real(nint(evalsec(clk) / prog_valid * (1.0 - prog_valid)), dp) )
1172 call dcdatetimecreate(cur_date)
1173 comp_date = cur_date + remain_diff
1174 prog_percent = ''
1175 prog_percent = adjustr(trim(printf_g5_2(real(prog_valid * 100, dp))) // '%')
1176 prog_bar = ''
1177 prog_bar_ptr = int(prog_valid * 25)
1178 if (prog_bar_ptr > 0) prog_bar(1:prog_bar_ptr) = '*************************'
1179 call printf(out_unit, '')
1180 call printf(out_unit, &
1181 & ' ########## PREDICTION OF CALCULATION ###########')
1182 call printf(out_unit, &
1183 & ' Start Date %c', c1=trim(tochar(clk % start_date)))
1184 call printf(out_unit, &
1185 & ' Current Date %c', c1=trim(tochar(cur_date)))
1186 call printf(out_unit, &
1187 & ' Progress %c [%c]', c1=prog_percent, c2=prog_bar)
1188 call printf(out_unit, &
1189 & ' Remaining CPU TIME %c %c', &
1190 & c1=trim(result_value_form(evalsec(remain_diff))), &
1191 & c2=trim(fit_unit_value(0.0_dp, remain_diff)))
1192 call printf(out_unit, &
1193 & ' Completion Date %c', c1=trim(tochar(comp_date)))
1194999 continue
1195 call storeerror(stat, subname, err, cause_c)
1196 call endsub(subname)
1197 end subroutine dcclockpredict0
1198 !> @namespace dc_clock
1199end module dc_clock
Monitor of CPU TIME.
Definition dc_clock.f90:85
Derived types and parameters for date and time.
Date and time manipulation module.
Definition dc_date.f90:57
Error handling module.
Definition dc_error.f90:454
subroutine, public storeerror(number, where, err, cause_c, cause_i)
Definition dc_error.f90:891
integer, parameter, public dc_enotinit
-400 or less: DC utilities errors
Definition dc_error.f90:534
integer, parameter, public dc_noerr
Error storage variables
Definition dc_error.f90:468
Message output module.
Handling character types.
Definition dc_string.f90:83
Debug tracing module.
Definition dc_trace.f90:150
subroutine, public dbgmessage(fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:661
subroutine, public beginsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca, version)
Definition dc_trace.f90:457
subroutine, public endsub(name, fmt, i, r, d, l, n, c1, c2, c3, ca)
Definition dc_trace.f90:580
Provides kind type parameter values.
Definition dc_types.f90:55
integer, parameter, public token
Character length for word, token
Definition dc_types.f90:128
integer, parameter, public string
Character length for string
Definition dc_types.f90:137
integer, parameter, public stdout
Unit number for Standard OUTPUT
Definition dc_types.f90:117
integer, parameter, public dp
Double Precision Real number
Definition dc_types.f90:92