\hypertarget{interfacedc__clock_1_1predict}{}\section{dc\+\_\+clock\+:\+:predict Interface Reference}
\label{interfacedc__clock_1_1predict}\index{dc\+\_\+clock\+::predict@{dc\+\_\+clock\+::predict}}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{interfacedc__clock_1_1predict_ad72da5044573f5f3e93898b092ab813c}{dcclockpredict0} (clk, progress, unit, err)
\end{DoxyCompactItemize}


\subsection{Detailed Description}


Definition at line 208 of file dc\+\_\+clock.\+f90.



\subsection{Member Function/\+Subroutine Documentation}
\mbox{\Hypertarget{interfacedc__clock_1_1predict_ad72da5044573f5f3e93898b092ab813c}\label{interfacedc__clock_1_1predict_ad72da5044573f5f3e93898b092ab813c}} 
\index{dc\+\_\+clock\+::predict@{dc\+\_\+clock\+::predict}!dcclockpredict0@{dcclockpredict0}}
\index{dcclockpredict0@{dcclockpredict0}!dc\+\_\+clock\+::predict@{dc\+\_\+clock\+::predict}}
\subsubsection{\texorpdfstring{dcclockpredict0()}{dcclockpredict0()}}
{\footnotesize\ttfamily subroutine dc\+\_\+clock\+::predict\+::dcclockpredict0 (\begin{DoxyParamCaption}\item[{type(\hyperlink{structdc__clock_1_1clock}{clock}), intent(in)}]{clk,  }\item[{real, intent(in)}]{progress,  }\item[{integer, intent(in), optional}]{unit,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



Definition at line 855 of file dc\+\_\+clock.\+f90.


\begin{DoxyCode}
855     \textcolor{comment}{!}
856     \textcolor{comment}{!=== プログラムが終了するまでの予測 CPU 時間, および日時を表示}
857     \textcolor{comment}{!}
858     \textcolor{comment}{! CLOCK 変数 *clk* と *progress* から, プログラムが}
859     \textcolor{comment}{! 終了するまでの予測 CPU 時間, および日時を以下のように表示します.}
860     \textcolor{comment}{!}
861     \textcolor{comment}{!     ########## PREDICTION OF CALCULATION ###########}
862     \textcolor{comment}{!     Start Date             2007-03-08T16:49:25+09:00}
863     \textcolor{comment}{!     Current Date           2007-03-08T16:49:27+09:00}
864     \textcolor{comment}{!     Progress     66.67%  [****************         ]}
865     \textcolor{comment}{!     Remaining CPU TIME      0.100000E+01}
866     \textcolor{comment}{!     Completion Date        2007-03-08T16:49:28+09:00}
867     \textcolor{comment}{!}
868     \textcolor{comment}{! 第2引数である *progress* には 0 〜 1 までの値を与えてください.}
869     \textcolor{comment}{! プログラムの開始時を 0, 終了時を 1 とします. (例えば,}
870     \textcolor{comment}{! プログラムが半分進んだ時には 0.5 を与えます).}
871     \textcolor{comment}{!}
872     \textcolor{comment}{! ここで行う「予測」とは, これまでの経過時間および}
873     \textcolor{comment}{! 終了したプログラムの分量から単純なアルゴリズムで割り出している}
874     \textcolor{comment}{! ものなので, 正確な予測値を返すわけではありません.}
875     \textcolor{comment}{! あくまで目安として利用してください.}
876     \textcolor{comment}{!}
877     \textcolor{comment}{! 引数 *unit* には出力先の装置番号を}
878     \textcolor{comment}{! 与えてください. *unit* を与えない場合, 標準出力へ表示されます.}
879     \textcolor{comment}{!}
880     \textcolor{comment}{! 第一引数 *clk* に対して DCClockCreate による初期化が行われていない場合,}
881     \textcolor{comment}{! エラーを発生させます. *err* を与える場合には *err* に .true. が返り,}
882     \textcolor{comment}{! プログラムは続行されます.}
883     \textcolor{comment}{!}
884     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
885     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
886     \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__string_1_1tochar}{tochar}, \hyperlink{interfacedc__string_1_1cprintf}{cprintf}, \hyperlink{interfacedc__string_1_1printf}{printf}
887     \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}, \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}, 
      \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
888     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__types}{dc\_date\_types}\textcolor{keywordtype}{, only}: \hyperlink{structdc__date__types_1_1dc__difftime}{dc\_difftime}, \hyperlink{structdc__date__types_1_1dc__datetime}{dc\_datetime}
889     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date}{dc\_date}\textcolor{keywordtype}{, only}: \textcolor{keyword}{operator}(+), \hyperlink{interfacedc__date__generic_1_1dcdatetimecreate}{dcdatetimecreate}, 
      \hyperlink{interfacedc__string_1_1tochar}{tochar}, \hyperlink{interfacedc__date__generic_1_1evalsec}{evalsec}, &
890       & \hyperlink{interfacedc__date__generic_1_1dcdifftimecreate}{dcdifftimecreate}
891     \textcolor{keywordtype}{implicit none}
892     \textcolor{keywordtype}{type}(clock), \textcolor{keywordtype}{intent(in)}:: clk
893     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}:: progress
894     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: unit
895     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
896     \textcolor{keywordtype}{character(STRING)}:: cause\_c
897     \textcolor{keywordtype}{integer}:: stat, out\_unit
898     \textcolor{keywordtype}{type}(\hyperlink{structdc__date__types_1_1dc__difftime}{dc\_difftime}):: remain\_diff
899     \textcolor{keywordtype}{type}(\hyperlink{structdc__date__types_1_1dc__datetime}{dc\_datetime}):: comp\_date, cur\_date
900     \textcolor{keywordtype}{character(7)}:: prog\_percent
901     \textcolor{keywordtype}{character(25)}:: prog\_bar
902     \textcolor{keywordtype}{integer}:: prog\_bar\_ptr
903     \textcolor{keywordtype}{real}:: prog\_valid
904     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'DCClockPredict'}
905   \textcolor{keywordflow}{continue}
906     \textcolor{keyword}{call }beginsub(subname)
907     stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
908     cause\_c = \textcolor{stringliteral}{'CLOCK'}
909     \textcolor{keywordflow}{if} (.not. clk % initialized) \textcolor{keywordflow}{then}
910       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'Call Create before Predict in dc\_clock.'})
911       \textcolor{keyword}{call }dbgmessage(\textcolor{stringliteral}{'Ignored because input argument was not initialized.'})
912       stat = \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
913       \textcolor{keywordflow}{goto} 999
914 \textcolor{keywordflow}{    end if}
915     \textcolor{keywordflow}{if} (progress <= 0.0) \textcolor{keywordflow}{then}
916       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'Specify 0.0 -- 1.0 value to "progress"'})
917       \textcolor{keywordflow}{return}
918     \textcolor{keywordflow}{elseif} (progress > 1.0) \textcolor{keywordflow}{then}
919       \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'Over 1.0 value to "progress" was modified to 1.0'})
920       prog\_valid = 1.0
921     \textcolor{keywordflow}{else}
922       prog\_valid = progress
923 \textcolor{keywordflow}{    end if}
924     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(unit)) \textcolor{keywordflow}{then}
925       out\_unit = unit
926     \textcolor{keywordflow}{else}
927       out\_unit = \hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}
928 \textcolor{keywordflow}{    end if}
929     \textcolor{keyword}{call }\hyperlink{interfacedc__date__generic_1_1dcdifftimecreate}{dcdifftimecreate}( remain\_diff, &
930       & sec = \textcolor{keywordtype}{real(nint(EvalSec(clk) / prog\_valid * (1.0 - prog\_valid)), DP)} )
931     \textcolor{keyword}{call }\hyperlink{interfacedc__date__generic_1_1dcdatetimecreate}{dcdatetimecreate}(cur\_date)
932     comp\_date = cur\_date + remain\_diff
933     prog\_percent = \textcolor{stringliteral}{''}
934     prog\_percent = adjustr(trim(printf\_g5\_2(\textcolor{keywordtype}{real}(prog\_valid * 100, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}))) // \textcolor{stringliteral}{'%'})
935     prog\_bar = \textcolor{stringliteral}{''}
936     prog\_bar\_ptr = \hyperlink{interfacedc__scaledsec_1_1int}{int}(prog\_valid * 25)
937     \textcolor{keywordflow}{if} (prog\_bar\_ptr > 0) prog\_bar(1:prog\_bar\_ptr) = \textcolor{stringliteral}{'*************************'}
938     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, \textcolor{stringliteral}{''})
939     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, &
940       & \textcolor{stringliteral}{' ########## PREDICTION OF CALCULATION ###########'})
941     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, &
942       & \textcolor{stringliteral}{' Start Date             %c'}, c1=trim(\hyperlink{interfacedc__string_1_1tochar}{tochar}(clk % start\_date)))
943     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, &
944       & \textcolor{stringliteral}{' Current Date           %c'}, c1=trim(\hyperlink{interfacedc__string_1_1tochar}{tochar}(cur\_date)))
945     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, &
946       & \textcolor{stringliteral}{' Progress     %c [%c]'}, c1=prog\_percent, c2=prog\_bar)
947     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, &
948       & \textcolor{stringliteral}{' Remaining CPU TIME   %c %c'}, &
949       & c1=trim(result\_value\_form(\hyperlink{interfacedc__date__generic_1_1evalsec}{evalsec}(remain\_diff))), &
950       & c2=trim(fit\_unit\_value(0.0\_dp, remain\_diff)))
951     \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, &
952       & \textcolor{stringliteral}{' Completion Date        %c'}, c1=trim(\hyperlink{interfacedc__string_1_1tochar}{tochar}(comp\_date)))
953 999 \textcolor{keywordflow}{continue}
954     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(stat, subname, err, cause\_c)
955     \textcolor{keyword}{call }endsub(subname)
\end{DoxyCode}


The documentation for this interface was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
dc\+\_\+utils/\hyperlink{dc__clock_8f90}{dc\+\_\+clock.\+f90}\end{DoxyCompactItemize}
