gtool5 Fortran 90/95 ライブラリ 1.0.0-rc5
English
Loading...
Searching...
No Matches
dc_clock::predict Interface Reference

Public Member Functions

subroutine dcclockpredict0 (clk, progress, unit, err)

Detailed Description

Definition at line 197 of file dc_clock.f90.

Member Function/Subroutine Documentation

◆ dcclockpredict0()

subroutine dc_clock::predict::dcclockpredict0 ( type(clock), intent(in) clk,
real, intent(in) progress,
integer, intent(in), optional unit,
logical, intent(out), optional err )

プログラムが終了するまでの予測 CPU 時間・日時を表示

CLOCK 変数 clkprogress から、プログラムが終了するまでの 予測 CPU 時間および日時を以下のように表示します。

########## PREDICTION OF CALCULATION ###########
start date 2007-03-08t16:49:25+09:00
current date 2007-03-08t16:49:27+09:00
progress 66.67% [**************** ]
remaining cpu time 0.100000e+01
completion date 2007-03-08t16:49:28+09:00

progress には 0 〜 1 までの値を与えてください。 プログラムの開始時を 0、終了時を 1 とします (例: プログラムが半分進んだ時には 0.5 を与えます)。

Note
ここで行う「予測」とは、これまでの経過時間および終了した プログラムの分量から単純なアルゴリズムで割り出しているものなので、 正確な予測値を返すわけではありません。あくまで目安として利用してください。

unit には出力先の装置番号を与えてください。 unit を与えない場合、標準出力へ表示されます。

clk に対して DCClockCreate による初期化が行われていない場合、 エラーを発生させます。err を与える場合には err に .true. が返り、 プログラムは続行されます。

Parameters
[in]clkCLOCK 型変数
[in]progress進捗値 (0.0 〜 1.0)
[in]unit出力先装置番号 (省略可)。デフォルト: 標準出力。
[out]errエラーフラグ (省略可)。エラー時に .true.。

Definition at line 1124 of file dc_clock.f90.

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)
日付・時刻に関する構造データ型と定数
日付および時刻に関する手続きを提供するモジュール
Definition dc_date.f90:57
エラー処理用モジュール
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 以下: dc ユーティリティのエラー
Definition dc_error.f90:534
integer, parameter, public dc_noerr
エラー等を保持
Definition dc_error.f90:468
メッセージの出力
文字型変数の操作
Definition dc_string.f90:83
種別型パラメタを提供します。
Definition dc_types.f90:55
integer, parameter, public stdout
標準出力の装置番号
Definition dc_types.f90:117
integer, parameter, public dp
倍精度実数型変数
Definition dc_types.f90:92

The documentation for this interface was generated from the following file: