\hypertarget{historycopy_8f90}{}\section{gtool/gtool\+\_\+history/historycopy.f90 File Reference}
\label{historycopy_8f90}\index{gtool/gtool\+\_\+history/historycopy.\+f90@{gtool/gtool\+\_\+history/historycopy.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{historycopy_8f90_aa3a078b6a0c0ffffcd172f36f7cb957d}{historycopy1} (hist\+\_\+dest, file, hist\+\_\+src, title, source, institution, origin, interval, conventions, gt\+\_\+version)
\item 
subroutine \hyperlink{historycopy_8f90_ae69a8869e0fd3635f69b70be77430681}{historycopy2} (hist\+\_\+dest, file, hist\+\_\+src, title, source, institution, origin, interval, conventions, gt\+\_\+version)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{historycopy_8f90_aa3a078b6a0c0ffffcd172f36f7cb957d}\label{historycopy_8f90_aa3a078b6a0c0ffffcd172f36f7cb957d}} 
\index{historycopy.\+f90@{historycopy.\+f90}!historycopy1@{historycopy1}}
\index{historycopy1@{historycopy1}!historycopy.\+f90@{historycopy.\+f90}}
\subsubsection{\texorpdfstring{historycopy1()}{historycopy1()}}
{\footnotesize\ttfamily subroutine historycopy1 (\begin{DoxyParamCaption}\item[{type(gt\+\_\+history), intent(out), target}]{hist\+\_\+dest,  }\item[{character($\ast$), intent(in)}]{file,  }\item[{type(gt\+\_\+history), intent(in), optional, target}]{hist\+\_\+src,  }\item[{character($\ast$), intent(in), optional}]{title,  }\item[{character($\ast$), intent(in), optional}]{source,  }\item[{character($\ast$), intent(in), optional}]{institution,  }\item[{real, intent(in), optional}]{origin,  }\item[{real, intent(in), optional}]{interval,  }\item[{character($\ast$), intent(in), optional}]{conventions,  }\item[{character($\ast$), intent(in), optional}]{gt\+\_\+version }\end{DoxyParamCaption})}



Definition at line 14 of file historycopy.\+f90.



References dc\+\_\+trace\+::beginsub(), dc\+\_\+trace\+::dbgmessage(), dc\+\_\+error\+::dc\+\_\+noerr, gtool\+\_\+history\+\_\+internal\+::default, dc\+\_\+types\+::dp, dc\+\_\+trace\+::endsub(), dc\+\_\+error\+::gt\+\_\+eargsizemismatch, dc\+\_\+error\+::storeerror(), dc\+\_\+types\+::string, and dc\+\_\+types\+::token.


\begin{DoxyCode}
14     \textcolor{comment}{!}
15     \textcolor{comment}{! 引数 *hist\_src* の内容にコピーし, *hist\_dest* へ返します. *hist\_src*}
16     \textcolor{comment}{! が与えられない場合は, 引数 *history* を与えずに呼び出した}
17     \textcolor{comment}{! HistoryCreate の設定内容が参照されます.}
18     \textcolor{comment}{! HistoryCreate と同様に, 出力の初期設定を行います. *file*}
19     \textcolor{comment}{! は必ず与えなければならず, *hist\_src* と同じファイルへ出力}
20     \textcolor{comment}{! しようとする場合はエラーを生じます.}
21     \textcolor{comment}{! HistoryAddVariable で設定される内容に関してはコピーされません.}
22     \textcolor{comment}{!}
23     \textcolor{comment}{! それ以降の引数を与えることで, hist\_src の設定を}
24     \textcolor{comment}{! 上書きすることが可能です.}
25     \textcolor{comment}{!}
26     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__internal}{gtool\_history\_internal}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtool__history__internal_aa7fc82d2ca1961a254be1acb599afbb1}{default}
27     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__generic}{gtool\_history\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtool__history__generic_1_1historyinquire}{historyinquire}, 
      \hyperlink{interfacegtool__history__generic_1_1historycreate}{historycreate}, \hyperlink{interfacegtool__history__generic_1_1historyput}{historyput}
28     \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__generic}{gtdata\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__generic_1_1inquire}{inquire}, \hyperlink{interfacegtdata__generic_1_1get__attr}{get\_attr}, 
      \hyperlink{interfacegtdata__generic_1_1copy__attr}{copy\_attr}, \hyperlink{interfacegtdata__generic_1_1get}{get}, \hyperlink{interfacegtdata__generic_1_1put}{put}
29     \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{,   only}: \hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}, \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}, 
      \hyperlink{namespacedc__error_aa11b8065198295505e35eb5a1e1436a4}{gt\_eargsizemismatch}
30     \textcolor{keywordtype}{use }\hyperlink{namespacedc__present}{dc\_present}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__present_1_1present__select}{present\_select}
31     \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}
32     \textcolor{keywordtype}{use }\hyperlink{namespacedc__date}{dc\_date}\textcolor{keywordtype}{, only}: \hyperlink{interfacedc__date__generic_1_1evalbyunit}{evalbyunit}
33     \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}
34     \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}
35     \textcolor{keywordtype}{implicit none}
36     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{target}:: hist\_dest
37     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: file
38     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: hist\_src
39     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: title, source, institution
40     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: origin, interval
41     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: conventions, gt\_version
42 
43     \textcolor{comment}{! Internal Work}
44     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{pointer}:: src =>null()
45     \textcolor{keywordtype}{character(STRING)} :: title\_src, source\_src, institution\_src
46     \textcolor{keywordtype}{character(STRING)} :: conventions\_src, gt\_version\_src
47     \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{pointer}:: dims(:) => null()
48     \textcolor{keywordtype}{integer}          , \textcolor{keywordtype}{pointer}:: dimsizes(:) => null()
49     \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{pointer}:: longnames(:) => null()
50     \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{pointer}:: \hyperlink{structdc__units_1_1units}{units}(:)  => null()
51     \textcolor{keywordtype}{character(STRING)}, \textcolor{keywordtype}{pointer}:: xtypes(:) => null()
52     \textcolor{keywordtype}{real}:: originw, intervalw
53     \textcolor{keywordtype}{integer}  :: i, numdims
54     \textcolor{keywordtype}{logical}        :: err
55     \textcolor{keywordtype}{real(DP)},\textcolor{keywordtype}{pointer} :: dimvalue(:) => null()
56     \textcolor{keywordtype}{character(len = *)},\textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{"HistoryCopy1"}
57   \textcolor{keywordflow}{continue}
58     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}(subname, \textcolor{stringliteral}{'file=<%c>'}, c1=trim(file))
59 
60     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(hist\_src)) \textcolor{keywordflow}{then}
61       src => hist\_src
62     \textcolor{keywordflow}{else}
63       src => \hyperlink{namespacegtool__history__internal_aa7fc82d2ca1961a254be1acb599afbb1}{default}
64 \textcolor{keywordflow}{    endif}
65 
66 
67 
68 
69 
70 
71     numdims = \textcolor{keyword}{size}(src % dimvars)
72 
73     \textcolor{keyword}{call }\hyperlink{interfacegtool__history__generic_1_1historyinquire}{historyinquire}(history=src, title=title\_src, &
74       & source=source\_src, institution=institution\_src, &
75       & dims=dims, dimsizes=dimsizes, longnames=longnames, &
76       & \hyperlink{structdc__units_1_1units}{units}=\hyperlink{structdc__units_1_1units}{units}, xtypes=xtypes, &
77       & conventions=conventions\_src, gt\_version=gt\_version\_src)
78 
79     \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(origin) ) \textcolor{keywordflow}{then}
80       originw = origin
81     \textcolor{keywordflow}{else}
82       originw = src % origin
83 \textcolor{comment}{!      originw = EvalByUnit( src % origin, '', src % unlimited\_units\_symbol )}
84 \textcolor{keywordflow}{    end if}
85 
86     intervalw = src % interval
87 \textcolor{comment}{!    intervalw = EvalByUnit( src % interval, '', src % unlimited\_units\_symbol )}
88     \textcolor{keywordflow}{if} ( \textcolor{keyword}{present}(interval) ) \textcolor{keywordflow}{then}
89       \textcolor{keywordflow}{if} ( interval /= 0.0 ) \textcolor{keywordflow}{then}
90         intervalw = interval
91 \textcolor{keywordflow}{      end if}
92 \textcolor{keywordflow}{    end if}
93 
94     \textcolor{keyword}{call }\hyperlink{interfacegtool__history__generic_1_1historycreate}{historycreate}(file=trim(file), &
95       & title=trim(\hyperlink{interfacedc__present_1_1present__select}{present\_select}(\textcolor{stringliteral}{''}, title\_src, title)), &
96       & source=trim(\hyperlink{interfacedc__present_1_1present__select}{present\_select}(\textcolor{stringliteral}{''}, source\_src, source)), &
97       & institution=trim(\hyperlink{interfacedc__present_1_1present__select}{present\_select}(\textcolor{stringliteral}{''}, institution\_src, institution)), &
98       & dims=dims, dimsizes=dimsizes, longnames=longnames, \hyperlink{structdc__units_1_1units}{units}=\hyperlink{structdc__units_1_1units}{units}, &
99       & origin=originw, interval=intervalw, &
100       & xtypes=xtypes, &
101       & history=hist\_dest, &
102       & conventions=trim(\hyperlink{interfacedc__present_1_1present__select}{present\_select}(\textcolor{stringliteral}{''}, conventions\_src, conventions)), &
103       & gt\_version=trim(\hyperlink{interfacedc__present_1_1present__select}{present\_select}(\textcolor{stringliteral}{''}, gt\_version\_src, gt\_version)) )
104 
105     \textcolor{comment}{!}
106     \textcolor{comment}{! 次元変数が属性を持っている場合のことも考え, 最後に直接}
107     \textcolor{comment}{! hist\_dst % dimvars へ copy\_attr (gtvarcopyattrall) をかける.}
108     \textcolor{comment}{!}
109     \textcolor{keywordflow}{do} i = 1, numdims
110       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1copy__attr}{copy\_attr}(hist\_dest % dimvars(i), src % dimvars (i), global=.false.)
111 \textcolor{keywordflow}{    end do}
112 
113     \textcolor{comment}{! dimvars を Get してみて, 値を持っているようならデータを与えてしまう.}
114     \textcolor{keywordflow}{do} i = 1, numdims
115       \textcolor{keywordflow}{if} (dimsizes(i) == 0) cycle
116       \textcolor{keyword}{call }\hyperlink{interfacegtdata__generic_1_1get}{get}(src % dimvars(i), dimvalue, err)
117       \textcolor{keywordflow}{if} (err) cycle
118       \textcolor{keyword}{call }\hyperlink{interfacegtool__history__generic_1_1historyput}{historyput}(dims(i), dimvalue, hist\_dest)
119       \textcolor{keyword}{deallocate}(dimvalue)
120 \textcolor{keywordflow}{    end do}
121 
122     \textcolor{keyword}{deallocate}(dims, dimsizes, longnames, \hyperlink{structdc__units_1_1units}{units}, xtypes)
123 
124 
125 
126 
127 
128     \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]{historycopy_8f90_aa3a078b6a0c0ffffcd172f36f7cb957d_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{historycopy_8f90_ae69a8869e0fd3635f69b70be77430681}\label{historycopy_8f90_ae69a8869e0fd3635f69b70be77430681}} 
\index{historycopy.\+f90@{historycopy.\+f90}!historycopy2@{historycopy2}}
\index{historycopy2@{historycopy2}!historycopy.\+f90@{historycopy.\+f90}}
\subsubsection{\texorpdfstring{historycopy2()}{historycopy2()}}
{\footnotesize\ttfamily subroutine historycopy2 (\begin{DoxyParamCaption}\item[{type(gt\+\_\+history), intent(out), target}]{hist\+\_\+dest,  }\item[{character($\ast$), intent(in)}]{file,  }\item[{type(gt\+\_\+history), intent(in), optional, target}]{hist\+\_\+src,  }\item[{character($\ast$), intent(in), optional}]{title,  }\item[{character($\ast$), intent(in), optional}]{source,  }\item[{character($\ast$), intent(in), optional}]{institution,  }\item[{real, intent(in), optional}]{origin,  }\item[{real, intent(in), optional}]{interval,  }\item[{character($\ast$), intent(in), optional}]{conventions,  }\item[{character($\ast$), intent(in), optional}]{gt\+\_\+version }\end{DoxyParamCaption})}



Definition at line 137 of file historycopy.\+f90.



References dc\+\_\+trace\+::beginsub(), dc\+\_\+trace\+::dbgmessage(), and dc\+\_\+trace\+::endsub().


\begin{DoxyCode}
137     \textcolor{comment}{!}
138     \textcolor{comment}{! 使用方法は HistoryCopy と同様です. }
139     \textcolor{comment}{!}
140     \textcolor{comment}{! Usage is same as "HistoryCopy".}
141     \textcolor{comment}{!}
142     \textcolor{comment}{!--}
143     \textcolor{comment}{! 総称名 Copy として提供するための関数です. }
144     \textcolor{comment}{! 機能は HistoryCopy1 と同じです. }
145     \textcolor{comment}{!++}
146     \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}
147     \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}
148     \textcolor{keywordtype}{use }\hyperlink{namespacegtool__history__generic}{gtool\_history\_generic}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtool__history__generic_1_1historycopy}{historycopy}
149     \textcolor{keywordtype}{implicit none}
150     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{target}:: hist\_dest
151     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}:: file
152     \textcolor{keywordtype}{type}(\hyperlink{structgtool__history__types_1_1gt__history}{gt\_history}), \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}, \textcolor{keywordtype}{target}:: hist\_src
153     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: title, source, institution
154     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: origin, interval
155     \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: conventions, gt\_version
156 
157     \textcolor{comment}{! Internal Work}
158     \textcolor{keywordtype}{character(len = *)},\textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{"HistoryCopy2"}
159   \textcolor{keywordflow}{continue}
160     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}(subname, \textcolor{stringliteral}{'file=<%c>'}, c1=trim(file))
161     \textcolor{keyword}{call }\hyperlink{interfacegtool__history__generic_1_1historycopy}{historycopy}(hist\_dest, file, hist\_src, &
162       & title, source, institution, &
163       & origin, interval, &
164       & conventions, gt\_version)
165     \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]{historycopy_8f90_ae69a8869e0fd3635f69b70be77430681_cgraph}
\end{center}
\end{figure}
