1143 use dc_date,
only:
operator(+), dcdatetimecreate,
tochar, evalsec, &
1144 & dcdifftimecreate
1145 implicit none
1146 type(CLOCK), intent(in):: clk
1147 real, intent(in):: progress
1148 integer, intent(in), optional:: unit
1149 logical, intent(out), optional:: err
1150 character(STRING):: cause_c
1151 integer:: stat, out_unit
1152 type(DC_DIFFTIME):: remain_diff
1153 type(DC_DATETIME):: comp_date, cur_date
1154 character(7):: prog_percent
1155 character(25):: prog_bar
1156 integer:: prog_bar_ptr
1157 real:: prog_valid
1158 logical:: initflag_mpi
1159 integer:: err_mpi, myrank_mpi
1160 character(*), parameter:: subname = 'DCClockPredict'
1161 continue
1162 call beginsub(subname)
1164 cause_c = 'CLOCK'
1165 if (.not. clk % initialized) then
1166 call messagenotify(
'W', subname,
'Call Create before Predict in dc_clock.')
1167 call dbgmessage('Ignored because input argument was not initialized.')
1169 goto 999
1170 end if
1171 if (progress <= 0.0) then
1172 call messagenotify(
'W', subname,
'Specify 0.0 -- 1.0 value to "progress"')
1173 return
1174 elseif (progress > 1.0) then
1175 call messagenotify(
'W', subname,
'Over 1.0 value to "progress" was modified to 1.0')
1176 prog_valid = 1.0
1177 else
1178 prog_valid = progress
1179 end if
1180 if (present(unit)) then
1181 out_unit = unit
1182 else
1184 end if
1185 call dcdifftimecreate( remain_diff, &
1186 & sec = real(nint(evalsec(clk) / prog_valid * (1.0 - prog_valid)),
dp) )
1187 call dcdatetimecreate(cur_date)
1188 comp_date = cur_date + remain_diff
1189 prog_percent = ''
1190 prog_percent = adjustr(trim(printf_g5_2(real(prog_valid * 100,
dp))) //
'%')
1191 prog_bar = ''
1192 prog_bar_ptr = int(prog_valid * 25)
1193 if (prog_bar_ptr > 0) prog_bar(1:prog_bar_ptr) = '*************************'
1194 call mpi_initialized(initflag_mpi, err_mpi)
1195 if ( initflag_mpi ) then
1196 call mpi_comm_rank(mpi_comm_world, myrank_mpi, err_mpi)
1197 if ( myrank_mpi /= 0 ) goto 999
1198 end if
1199 call printf(out_unit,
'')
1201 & ' ########## PREDICTION OF CALCULATION ###########')
1203 &
' Start Date %c', c1=trim(
tochar(clk % start_date)))
1205 &
' Current Date %c', c1=trim(
tochar(cur_date)))
1207 & ' Progress %c [%c]', c1=prog_percent, c2=prog_bar)
1209 & ' Remaining CPU TIME %c %c', &
1210 & c1=trim(result_value_form(evalsec(remain_diff))), &
1211 & c2=trim(fit_unit_value(0.0_dp, remain_diff)))
1213 &
' Completion Date %c', c1=trim(
tochar(comp_date)))
1214999 continue
1216 call endsub(subname)
subroutine, public storeerror(number, where, err, cause_c, cause_i)
integer, parameter, public dc_noerr
エラー等を保持
integer, parameter, public dc_enotinit
-400 以下: dc ユーティリティのエラー
integer, parameter, public stdout
標準出力の装置番号
integer, parameter, public dp
倍精度実数型変数