\hypertarget{interfacedc__clock_1_1result}{}\section{dc\+\_\+clock\+:\+:result Interface Reference}
\label{interfacedc__clock_1_1result}\index{dc\+\_\+clock\+::result@{dc\+\_\+clock\+::result}}
\subsection*{Private Member Functions}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{interfacedc__clock_1_1result_ad767548dc2302e4bb3a203fef7202541}{dcclockresult0} (clks, unit, total\+\_\+auto, clk\+\_\+total, total\+\_\+name, err)
\end{DoxyCompactItemize}


\subsection{Detailed Description}


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



\subsection{Member Function/\+Subroutine Documentation}
\mbox{\Hypertarget{interfacedc__clock_1_1result_ad767548dc2302e4bb3a203fef7202541}\label{interfacedc__clock_1_1result_ad767548dc2302e4bb3a203fef7202541}} 
\index{dc\+\_\+clock\+::result@{dc\+\_\+clock\+::result}!dcclockresult0@{dcclockresult0}}
\index{dcclockresult0@{dcclockresult0}!dc\+\_\+clock\+::result@{dc\+\_\+clock\+::result}}
\subsubsection{\texorpdfstring{dcclockresult0()}{dcclockresult0()}}
{\footnotesize\ttfamily subroutine dc\+\_\+clock\+::result\+::dcclockresult0 (\begin{DoxyParamCaption}\item[{type(\hyperlink{structdc__clock_1_1clock}{clock}), dimension(\+:), intent(in)}]{clks,  }\item[{integer, intent(in), optional}]{unit,  }\item[{logical, intent(in), optional}]{total\+\_\+auto,  }\item[{type(\hyperlink{structdc__clock_1_1clock}{clock}), intent(in), optional}]{clk\+\_\+total,  }\item[{character($\ast$), intent(in), optional}]{total\+\_\+name,  }\item[{logical, intent(out), optional}]{err }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [private]}}



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


\begin{DoxyCode}
535     \textcolor{comment}{!}
536     \textcolor{comment}{!=== CPU 時間の総計を表示}
537     \textcolor{comment}{!}
538     \textcolor{comment}{! CPU 時間の総計を表示します. *clks* へ, CLOCK 変数の配列を}
539     \textcolor{comment}{! 与えてください. プログラムの最後で呼び出されることを}
540     \textcolor{comment}{! 想定しています. *unit* には出力先の装置番号を}
541     \textcolor{comment}{! 与えてください. *unit* を与えない場合, 標準出力へ表示されます.}
542     \textcolor{comment}{!}
543     \textcolor{comment}{! 引数 *total\_auto* に .true. を与えると, *clks* を全て足し合わせた}
544     \textcolor{comment}{! 合計値を自動的に表示します. 下記の引数 *clk\_total* が与えられている}
545     \textcolor{comment}{! 場合は *clk\_total* が優先されます.}
546     \textcolor{comment}{!}
547     \textcolor{comment}{! 引数 *clk\_total* に CLOCK 変数を与えると, この変数を合計値と}
548     \textcolor{comment}{! して表示します.}
549     \textcolor{comment}{!}
550     \textcolor{comment}{! 引数 *total\_name* に文字型変数を与えると, 総計メッセージの}
551     \textcolor{comment}{! 冒頭にこの文字列を出力します.}
552     \textcolor{comment}{!}
553     \textcolor{comment}{! 第一引数 *clk* に対して DCClockCreate による初期化が行われていない場合,}
554     \textcolor{comment}{! エラーを発生させます. *err* を与える場合には *err* に .true. が返り,}
555     \textcolor{comment}{! プログラムは続行されます.}
556     \textcolor{comment}{!}
557     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}, \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
558     \textcolor{keywordtype}{use }\hyperlink{namespacedc__message}{dc\_message}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}
559     \textcolor{keywordtype}{use }\hyperlink{namespacedc__string}{dc\_string}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__string_1_1printf}{printf}, \hyperlink{interfacedc__string_1_1tochar}{tochar}, \hyperlink{interfacedc__string_1_1cprintf}{cprintf}
560     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date}{dc\_date}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__date__generic_1_1evalsec}{evalsec}
561     \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}
562     \textcolor{keywordtype}{implicit none}
563     \textcolor{keywordtype}{type}(clock), \textcolor{keywordtype}{intent(in)}:: clks(:)
564     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: unit
565     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: total\_auto
566     \textcolor{keywordtype}{type}(clock), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: clk\_total
567     \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
568     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: total\_name
569     \textcolor{keywordtype}{integer}:: out\_unit, i, clks\_size, ra
570     \textcolor{keywordtype}{character(20)}:: clk\_name
571     \textcolor{keywordtype}{character(STRING)}:: cause\_c
572     \textcolor{keywordtype}{character(STRING)}:: total\_name\_work
573     \textcolor{keywordtype}{type}(clock):: clk\_auto\_total
574     \textcolor{keywordtype}{logical}:: total\_print\_complete
575     \textcolor{keywordtype}{real(DP)}:: elapsed\_time\_val\_cor
576     \textcolor{keywordtype}{integer}:: stat
577     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: total\_time\_mes = \textcolor{stringliteral}{'       TOTAL TIME = '}
578     \textcolor{keywordtype}{integer}:: myrank\_mpi, nprocs\_mpi
579     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'DCClockResult'}
580   \textcolor{keywordflow}{continue}
581     \textcolor{keyword}{call }beginsub(subname)
582     stat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
583     cause\_c = \textcolor{stringliteral}{'CLOCK'}
584     clks\_size = \textcolor{keyword}{size}(clks)
585     \textcolor{keywordflow}{do} i = 1, clks\_size
586       \textcolor{keywordflow}{if} (.not. clks(i) % initialized) \textcolor{keywordflow}{then}
587         \textcolor{keyword}{call }\hyperlink{interfacedc__message_1_1messagenotify}{messagenotify}(\textcolor{stringliteral}{'W'}, subname, \textcolor{stringliteral}{'Call Create before Result in dc\_clock.'})
588         \textcolor{keyword}{call }dbgmessage(\textcolor{stringliteral}{'Ignored because input argument was not initialized.'})
589         stat = \hyperlink{namespacedc__error_a31f1081213c338a4f6a6e5acdfe4a8a8}{dc\_enotinit}
590         \textcolor{keywordflow}{goto} 999
591 \textcolor{keywordflow}{      end if}
592 \textcolor{keywordflow}{    end do}
593     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(unit)) \textcolor{keywordflow}{then}
594       out\_unit = unit
595     \textcolor{keywordflow}{else}
596       out\_unit = \hyperlink{namespacedc__types_a5d5ccca8cc2b447f2a0546da0a22efdc}{stdout}
597 \textcolor{keywordflow}{    end if}
598     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(total\_name)) \textcolor{keywordflow}{then}
599       total\_name\_work = \textcolor{stringliteral}{' ('} // trim(total\_name) // \textcolor{stringliteral}{')'}
600     \textcolor{keywordflow}{else}
601       total\_name\_work = \textcolor{stringliteral}{''}
602 \textcolor{keywordflow}{    end if}
603     myrank\_mpi = -1
604     nprocs\_mpi = 1
605     \textcolor{keywordflow}{do} ra = 0, nprocs\_mpi - 1
606       \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, \textcolor{stringliteral}{''})
607       \textcolor{keywordflow}{if} ( myrank\_mpi < 0 ) \textcolor{keywordflow}{then}
608         \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, &
609           & \textcolor{stringliteral}{' ############## CPU TIME SUMMARY%c################'}, &
610           & c1=trim(total\_name\_work) // \textcolor{stringliteral}{' '})
611       \textcolor{keywordflow}{else}
612         \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, &
613           & \textcolor{stringliteral}{' ####### CPU TIME SUMMARY%c#### [rank=%06d] ####'}, &
614           & c1=trim(total\_name\_work) // \textcolor{stringliteral}{' '}, &
615           & i = (/myrank\_mpi/) )
616 \textcolor{keywordflow}{      end if}
617       \textcolor{keywordflow}{do} i = 1, clks\_size
618         clk\_name = clks(i) % name
619         elapsed\_time\_val\_cor = clks(i) % elapsed\_time
620         \textcolor{keywordflow}{if} (elapsed\_time\_val\_cor < 0.0\_dp) elapsed\_time\_val\_cor = 0.0\_dp
621         \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, &
622           & \textcolor{stringliteral}{' %c%c  %c'}, c1=clk\_name, &
623           & c2=trim(result\_value\_form(elapsed\_time\_val\_cor)), &
624           & c3=trim(fit\_unit\_value(clks(i) % elapsed\_time)))
625 \textcolor{keywordflow}{      end do}
626       total\_print\_complete = .false.
627       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(clk\_total)) \textcolor{keywordflow}{then}
628         \textcolor{keywordflow}{if} (clk\_total % initialized) \textcolor{keywordflow}{then}
629           \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, &
630             & \textcolor{stringliteral}{' ------------------------------------------------'})
631           elapsed\_time\_val\_cor = clk\_total % elapsed\_time
632           \textcolor{keywordflow}{if} (elapsed\_time\_val\_cor < 0.0\_dp) elapsed\_time\_val\_cor = 0.0\_dp
633           \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, &
634             & \textcolor{stringliteral}{' %c%c  %c'}, c1=total\_time\_mes, &
635             & c2=trim(result\_value\_form(elapsed\_time\_val\_cor)), &
636             & c3=trim(fit\_unit\_value(clk\_total % elapsed\_time)))
637           total\_print\_complete = .true.
638 \textcolor{keywordflow}{        end if}
639 \textcolor{keywordflow}{      end if}
640       \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(total\_auto) .and. .not. total\_print\_complete) \textcolor{keywordflow}{then}
641         \textcolor{keywordflow}{if} (total\_auto) \textcolor{keywordflow}{then}
642           clk\_auto\_total = clks(1)
643           \textcolor{keywordflow}{if} (clks\_size > 1) \textcolor{keywordflow}{then}
644             \textcolor{keywordflow}{do} i = 2, clks\_size
645               clk\_auto\_total = clk\_auto\_total + clks(i)
646 \textcolor{keywordflow}{            end do}
647 \textcolor{keywordflow}{          end if}
648           \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, &
649             & \textcolor{stringliteral}{' ------------------------------------------------'})
650           elapsed\_time\_val\_cor = clk\_auto\_total % elapsed\_time
651           \textcolor{keywordflow}{if} (elapsed\_time\_val\_cor < 0.0\_dp) elapsed\_time\_val\_cor = 0.0\_dp
652           \textcolor{keyword}{call }\hyperlink{interfacedc__string_1_1printf}{printf}(out\_unit, &
653             & \textcolor{stringliteral}{' %c%c  %c'}, c1=total\_time\_mes, &
654             & c2=trim(result\_value\_form(elapsed\_time\_val\_cor)), &
655             & c3=trim(fit\_unit\_value(clk\_auto\_total % elapsed\_time)))
656 \textcolor{keywordflow}{        end if}
657 \textcolor{keywordflow}{      end if}
658       \textcolor{keyword}{call }dbgmessage(\textcolor{stringliteral}{'total results, output to device number %d'}, &
659         & i=(/out\_unit/))
660 \textcolor{keywordflow}{    end do}
661 999 \textcolor{keywordflow}{continue}
662     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(stat, subname, err, cause\_c)
663     \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}
