\hypertarget{historysettime_8f90}{}\section{gtool/gtool\+\_\+history/historysettime.f90 File Reference}
\label{historysettime_8f90}\index{gtool/gtool\+\_\+history/historysettime.\+f90@{gtool/gtool\+\_\+history/historysettime.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{historysettime_8f90_a0529c8b4e5a02c57700958caaa1535ce}{historysettime} (time, history, difftime, timed)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{historysettime_8f90_a0529c8b4e5a02c57700958caaa1535ce}\label{historysettime_8f90_a0529c8b4e5a02c57700958caaa1535ce}} 
\index{historysettime.\+f90@{historysettime.\+f90}!historysettime@{historysettime}}
\index{historysettime@{historysettime}!historysettime.\+f90@{historysettime.\+f90}}
\subsubsection{\texorpdfstring{historysettime()}{historysettime()}}
{\footnotesize\ttfamily subroutine historysettime (\begin{DoxyParamCaption}\item[{real, intent(in), optional}]{time,  }\item[{type(gt\+\_\+history), intent(inout), optional, target}]{history,  }\item[{type(dc\+\_\+difftime), intent(in), optional}]{difftime,  }\item[{real(dp), intent(in), optional}]{timed }\end{DoxyParamCaption})}



Definition at line 11 of file historysettime.\+f90.



References dc\+\_\+trace\+::beginsub(), dc\+\_\+trace\+::dbgmessage(), gtool\+\_\+history\+\_\+internal\+::default, dc\+\_\+types\+::dp, dumperror(), dc\+\_\+trace\+::endsub(), dc\+\_\+types\+::string, and dc\+\_\+types\+::token.



Referenced by historyautoputdouble0(), historyautoputdouble1(), historyautoputdouble2(), historyautoputdouble3(), historyautoputdouble4(), historyautoputdouble5(), historyautoputdouble6(), historyautoputdouble7(), historyautoputint0(), historyautoputint1(), historyautoputint2(), historyautoputint3(), historyautoputint4(), historyautoputint5(), historyautoputint6(), historyautoputint7(), historyautoputreal0(), historyautoputreal1(), historyautoputreal2(), historyautoputreal3(), historyautoputreal4(), historyautoputreal5(), historyautoputreal6(), and historyautoputreal7().


\begin{DoxyCode}
11     \textcolor{comment}{!}
12     \textcolor{comment}{!== 時刻指定}
13     \textcolor{comment}{!}
14     \textcolor{comment}{! 明示的に時刻指定を行なうためのサブルーチンです。}
15     \textcolor{comment}{! このサブルーチンを用いる前に、HistoryCreate による初期設定が必要です。}
16     \textcolor{comment}{! このサブルーチンを使用する事で HistoryCreate の *interval* が無効}
17     \textcolor{comment}{! になるので注意してください。}
18     \textcolor{comment}{!}
19     \textcolor{comment}{!--}
20     \textcolor{comment}{! 時刻を明示設定している状態で、巻き戻しを含めた時間設定。}
21     \textcolor{comment}{! 前進している間は検索をしないようになっている。}
22     \textcolor{comment}{!++}
23     \textcolor{comment}{!}
24     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__types}{gtool\_history\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}, 
      \hyperlink{structgtool__history__types_1_1gt__history__axis}{gt\_history\_axis}, \hyperlink{structgtool__history__types_1_1gt__history__varinfo}{gt\_history\_varinfo}, 
      \hyperlink{structgtool__history__types_1_1gt__history__attr}{gt\_history\_attr}
25     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__internal}{gtool\_history\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtool__history__internal_aa7fc82d2ca1961a254be1acb599afbb1}{default}
26     \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__generic}{gtdata\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1slice}{slice}, \hyperlink{interfacegtdata__generic_1_1put}{put}, \hyperlink{interfacegtdata__generic_1_1get}{get}
27     \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__types_1_1gt__variable}{gt\_variable}
28     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__generic}{dc\_date\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__date__generic_1_1dcdifftimecreate}{dcdifftimecreate}, \textcolor{keyword}{operator}(<), \textcolor{keyword}{operator}(>), &
29       & \hyperlink{interfacedc__date__generic_1_1evalbyunit}{evalbyunit}, \hyperlink{interfacedc__date__generic_1_1min}{min}, \hyperlink{interfacedc__date__generic_1_1max}{max}, \hyperlink{interfacedc__date__generic_1_1dcdifftimeputline}{dcdifftimeputline}
30     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date__types}{dc\_date\_types}\textcolor{keywordtype}{, only}: \hyperlink{structdc__date__types_1_1dc__difftime}{dc\_difftime}
31     \textcolor{keywordtype}{use }\hyperlink{namespacedc__trace}{dc\_trace}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}, \hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}, \hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}, 
      \hyperlink{interfacedc__trace_1_1debug}{debug}
32     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_adb76910ff05e3b9fe3436567f8f8dac6}{string}, \hyperlink{namespacedc__types_a6d28eb015ba84292a06f4ff25165b376}{token}, \hyperlink{namespacedc__types_ac74a34430fcd3d0eb2344f19d536c086}{dp}
33     \textcolor{keywordtype}{implicit none}
34     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: time
35                               \textcolor{comment}{! 時刻}
36                               \textcolor{comment}{! }
37                               \textcolor{comment}{! ここで言う "時刻" とは、}
38                               \textcolor{comment}{! HistoryCreate の *dims* で "0"}
39                               \textcolor{comment}{! と指定されたものです。}
40                               \textcolor{comment}{! もしも時刻が定義されていな}
41                               \textcolor{comment}{! い場合は、 このサブルーチン}
42                               \textcolor{comment}{! は何の効果も及ぼしません。}
43                               \textcolor{comment}{! }
44     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{intent(inout)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: history
45                               \textcolor{comment}{! 出力ファイルの設定に関する情報を}
46                               \textcolor{comment}{! 格納した構造体}
47                               \textcolor{comment}{! }
48                               \textcolor{comment}{! ここに指定するものは、}
49                               \textcolor{comment}{! HistoryCreate によって初期設定}
50                               \textcolor{comment}{! されていなければなりません。}
51                               \textcolor{comment}{! }
52     \textcolor{keywordtype}{type}(\hyperlink{structdc__date__types_1_1dc__difftime}{dc\_difftime}), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: difftime
53                               \textcolor{comment}{! 時刻 (dc\_date\_types#DC\_DIFFTIME 型)}
54                               \textcolor{comment}{! }
55                               \textcolor{comment}{! ここで言う "時刻" とは、}
56                               \textcolor{comment}{! HistoryCreate の *dims* で "0"}
57                               \textcolor{comment}{! と指定されたものです。}
58                               \textcolor{comment}{! もしも時刻が定義されていな}
59                               \textcolor{comment}{! い場合は、 このサブルーチン}
60                               \textcolor{comment}{! は何の効果も及ぼしません。}
61                               \textcolor{comment}{! }
62     \textcolor{keywordtype}{real(DP)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: timed
63                               \textcolor{comment}{! 時刻 (倍精度実数型)}
64                               \textcolor{comment}{! }
65                               \textcolor{comment}{! ここで言う "時刻" とは、}
66                               \textcolor{comment}{! HistoryCreate の *dims* で "0"}
67                               \textcolor{comment}{! と指定されたものです。}
68                               \textcolor{comment}{! もしも時刻が定義されていな}
69                               \textcolor{comment}{! い場合は、 このサブルーチン}
70                               \textcolor{comment}{! は何の効果も及ぼしません。}
71                               \textcolor{comment}{! }
72     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{pointer}:: hst =>null()
73     \textcolor{keywordtype}{type}(\hyperlink{structgtdata__types_1_1gt__variable}{gt\_variable}):: var
74     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: buffer(:) =>null()
75     \textcolor{keywordtype}{real(DP)}:: dt
76 \textcolor{comment}{!    type(DC\_DIFFTIME):: dt}
77     \textcolor{keywordtype}{real(DP)}:: timew
78     \textcolor{keywordtype}{logical}:: err, dbg\_mode
79     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{"HistorySetTime"}
80   \textcolor{keywordflow}{continue}
81     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}(subname)
82     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(history)) \textcolor{keywordflow}{then}
83       hst => history
84     \textcolor{keywordflow}{else}
85       hst => \hyperlink{namespacegtool__history__internal_aa7fc82d2ca1961a254be1acb599afbb1}{default}
86 \textcolor{keywordflow}{    endif}
87     \textcolor{keyword}{call }\hyperlink{interfacedc__trace_1_1debug}{debug}( dbg\_mode ) 
88     \textcolor{keywordflow}{if} ( dbg\_mode ) \textcolor{keywordflow}{then}
89       \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(difftime) ) \textcolor{keywordflow}{then}
90         timew = \hyperlink{interfacedc__date__generic_1_1evalbyunit}{evalbyunit}( difftime, \textcolor{stringliteral}{''}, hst % unlimited\_units\_symbol )
91         \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}(\textcolor{stringliteral}{'time=%f'}, d = (/timew/) )
92       \textcolor{keywordflow}{elseif} ( \textcolor{keyword}{present}(timed) ) \textcolor{keywordflow}{then}
93         \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}(\textcolor{stringliteral}{'time=%f'}, d = (/timed/) )
94       \textcolor{keywordflow}{elseif} ( \textcolor{keyword}{present}(time) ) \textcolor{keywordflow}{then}
95         \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}(\textcolor{stringliteral}{'time=%r'}, r = (/time/) )
96 \textcolor{keywordflow}{      end if}
97 \textcolor{keywordflow}{    end if}
98     \textcolor{keywordflow}{if} (hst % unlimited\_index == 0) \textcolor{keywordflow}{then}
99       \textcolor{keywordflow}{goto} 999
100 \textcolor{keywordflow}{    endif}
101     var = hst % dimvars(hst % unlimited\_index)
102     hst % dim\_value\_written(hst % unlimited\_index) = .true.
103     \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(difftime) ) \textcolor{keywordflow}{then}
104       dt = \hyperlink{interfacedc__date__generic_1_1evalbyunit}{evalbyunit}( difftime, \textcolor{stringliteral}{''}, hst % unlimited\_units\_symbol )
105       timew = dt 
106     \textcolor{keywordflow}{elseif} ( \textcolor{keyword}{present}(timed) ) \textcolor{keywordflow}{then}
107       dt = timed
108 \textcolor{comment}{!!$      call DCDiffTimeCreate( dt, &                          ! (out)}
109 \textcolor{comment}{!!$        & real( timed ), '', hst % unlimited\_units\_symbol ) ! (in)}
110       timew = timed
111     \textcolor{keywordflow}{elseif} ( \textcolor{keyword}{present}(time) ) \textcolor{keywordflow}{then}
112       dt = time
113 \textcolor{comment}{!!$      call DCDiffTimeCreate( dt, &                 ! (out)}
114 \textcolor{comment}{!!$        & time, '', hst % unlimited\_units\_symbol ) ! (in)}
115       timew = time
116 \textcolor{keywordflow}{    end if}
117     \textcolor{keywordflow}{if} (      dt < hst % oldest &
118       &  .or. dt > hst % newest &
119       &  .or. hst % count(2) == 0 ) \textcolor{keywordflow}{then}
120       hst % count(:) = maxval(hst % count(:)) + 1
121       hst % newest = \hyperlink{interfacedc__date__generic_1_1max}{max}(hst % newest, dt)
122       hst % oldest = \hyperlink{interfacedc__date__generic_1_1min}{min}(hst % oldest, dt)
123       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1slice}{slice}(var, 1, start=hst % count(1), count=1)
124       timew = dt
125 \textcolor{comment}{!      timew = EvalByUnit( dt, '', hst % unlimited\_units\_symbol )}
126       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1put}{put}(var, (/timew/), 1, err)
127       \textcolor{keywordflow}{if} (err) \textcolor{keyword}{call }\hyperlink{dc__error_8f90_a805edc2691c008aded6c82bc8d28d99e}{dumperror}()
128       \textcolor{keywordflow}{goto} 999
129 \textcolor{keywordflow}{    endif}
130     \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1slice}{slice}(var, 1, start=1, count=hst % count(2))
131     \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1get}{get}(var, buffer, err)
132     hst % count(1:1) = minloc(\hyperlink{interfacedc__scaledsec_1_1abs}{abs}(buffer - timew))
133     \textcolor{keyword}{deallocate}(buffer)
134 999 \textcolor{keywordflow}{continue}
135     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}(subname)
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{historysettime_8f90_a0529c8b4e5a02c57700958caaa1535ce_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[height=550pt]{historysettime_8f90_a0529c8b4e5a02c57700958caaa1535ce_icgraph}
\end{center}
\end{figure}
