\hypertarget{gtvardeldim_8f90}{}\section{gtdata/gtvardeldim.f90 File Reference}
\label{gtvardeldim_8f90}\index{gtdata/gtvardeldim.\+f90@{gtdata/gtvardeldim.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{gtvardeldim_8f90_ad725f6ab968213a7c13159902132efd2}{gtvardeldim} (var, dimord, err)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{gtvardeldim_8f90_ad725f6ab968213a7c13159902132efd2}\label{gtvardeldim_8f90_ad725f6ab968213a7c13159902132efd2}} 
\index{gtvardeldim.\+f90@{gtvardeldim.\+f90}!gtvardeldim@{gtvardeldim}}
\index{gtvardeldim@{gtvardeldim}!gtvardeldim.\+f90@{gtvardeldim.\+f90}}
\subsubsection{\texorpdfstring{gtvardeldim()}{gtvardeldim()}}
{\footnotesize\ttfamily subroutine gtvardeldim (\begin{DoxyParamCaption}\item[{type(gt\+\_\+variable), intent(in)}]{var,  }\item[{integer, intent(in)}]{dimord,  }\item[{logical, intent(out)}]{err }\end{DoxyParamCaption})}



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



References gtdata\+\_\+internal\+\_\+map\+::map\+\_\+lookup(), gtdata\+\_\+internal\+\_\+map\+::map\+\_\+set(), and gtdata\+\_\+internal\+\_\+map\+::map\+\_\+set\+\_\+ndims().


\begin{DoxyCode}
14   \textcolor{comment}{!}
15   \textcolor{comment}{!== 次元の削除}
16   \textcolor{comment}{!}
17   \textcolor{comment}{! 変数 *var* の次元 *dimord* を削除します。}
18   \textcolor{comment}{! 次元対応表の順位を下げ有効次元数をデクリメントするだけなので、}
19   \textcolor{comment}{! 当該次元がすでに縮退していれば、この操作のあとでも入出力が可能です。}
20   \textcolor{comment}{!}
21   \textcolor{comment}{! エラーが生じた場合、メッセージを出力}
22   \textcolor{comment}{! してプログラムは強制終了します。*err* を与えてある場合には}
23   \textcolor{comment}{! の引数に .true. が返り、プログラムは終了しません。}
24   \textcolor{comment}{!}
25   \textcolor{comment}{!--}
26   \textcolor{comment}{! 実際には、次元対応表の順位を下げ有効次元数をデクリメント}
27   \textcolor{comment}{! するだけなので、入出力に支障はない。}
28   \textcolor{comment}{!}
29   \textcolor{comment}{! NetCDF 実装においては、変数は削除されず、}
30   \textcolor{comment}{! 別の名称に改名されるだけです。}
31   \textcolor{comment}{! これは netCDF API に変数の削除が欠けているためです。}
32   \textcolor{comment}{!++}
33   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{, only}: gt\_variable
34   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__internal__map}{gtdata\_internal\_map}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtdata__internal__map_a076911f777be03f10a2c024dac7efdad}{map\_lookup}, 
      \hyperlink{structgtdata__internal__map_1_1gt__dimmap}{gt\_dimmap}, \hyperlink{namespacegtdata__internal__map_a12dffe35d93120bca94db15c47818ae1}{map\_set\_ndims}, \hyperlink{namespacegtdata__internal__map_a2e6a789c1c8f4850421da11f10081cb7}{map\_set}
35   \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{, only}: beginsub, endsub, dbgmessage
36   \textcolor{keywordtype}{implicit none}
37   \textcolor{keywordtype}{type}(gt\_variable), \textcolor{keywordtype}{intent(in)}:: var
38   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: dimord
39   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}:: err
40   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__internal__map_1_1gt__dimmap}{gt\_dimmap}), \textcolor{keywordtype}{allocatable}:: map(:)
41   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__internal__map_1_1gt__dimmap}{gt\_dimmap}):: tmpmap
42   \textcolor{keywordtype}{integer}:: ndimsp, stat
43   \textcolor{keywordtype}{character(*)}, \textcolor{keywordtype}{parameter}:: subname = \textcolor{stringliteral}{'GTVarDelDim'}
44 \textcolor{keywordflow}{continue}
45   err = .true.
46   \textcolor{keyword}{call }beginsub(subname)
47   \textcolor{keywordflow}{if} (dimord < 1) \textcolor{keywordflow}{then}
48     \textcolor{keyword}{call }endsub(subname, \textcolor{stringliteral}{"negative dimord=%d invalid"}, i=(/dimord/))
49     \textcolor{keywordflow}{return}
50 \textcolor{keywordflow}{  endif}
51   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_a076911f777be03f10a2c024dac7efdad}{map\_lookup}(var, ndims=ndimsp)
52   \textcolor{keywordflow}{if} (ndimsp <= 0) \textcolor{keywordflow}{then}
53     \textcolor{keyword}{call }endsub(subname, \textcolor{stringliteral}{"variable invalid"})
54     \textcolor{keywordflow}{return}
55   \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (dimord > ndimsp) \textcolor{keywordflow}{then}
56     \textcolor{keyword}{call }endsub(subname, \textcolor{stringliteral}{"dimord=%d not exist"}, i=(/dimord/))
57     \textcolor{keywordflow}{return}
58 \textcolor{keywordflow}{  endif}
59 
60   \textcolor{keyword}{allocate}(map(ndimsp))
61   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_a076911f777be03f10a2c024dac7efdad}{map\_lookup}(var, map=map)
62   tmpmap = map(dimord)
63   map(dimord: ndimsp-1) = map(dimord+1: ndimsp)
64   map(ndimsp) = tmpmap
65   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_a2e6a789c1c8f4850421da11f10081cb7}{map\_set}(var, map, stat)
66   \textcolor{keyword}{deallocate}(map)
67 
68   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_a12dffe35d93120bca94db15c47818ae1}{map\_set\_ndims}(var, ndims = ndimsp - 1, stat=stat)
69   err = stat /= 0
70   \textcolor{keyword}{call }endsub(subname)
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{gtvardeldim_8f90_ad725f6ab968213a7c13159902132efd2_cgraph}
\end{center}
\end{figure}
