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


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



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



References dc\+\_\+trace\+::beginsub(), dc\+\_\+trace\+::dbgmessage(), dc\+\_\+error\+::dc\+\_\+noerr, dc\+\_\+trace\+::endsub(), dc\+\_\+error\+::gt\+\_\+efake, dc\+\_\+error\+::gt\+\_\+enomoredims, gtdata\+\_\+internal\+\_\+map\+::map\+\_\+lookup(), gtdata\+\_\+internal\+\_\+map\+::map\+\_\+set(), and dc\+\_\+error\+::storeerror().


\begin{DoxyCode}
14   \textcolor{comment}{!}
15   \textcolor{comment}{!== 入出力範囲を移動}
16   \textcolor{comment}{!}
17   \textcolor{comment}{! 変数 *var* の *dimord* 番目の次元の *start* 値を *stride* *}
18   \textcolor{comment}{! *count* 個だけ増やすことによって次元範囲を移動します。*dimord*}
19   \textcolor{comment}{! を省略すると、どれかの次元についてこの操作を行います。成功した}
20   \textcolor{comment}{! 場合 *stat* が 0 になリます。}
21   \textcolor{comment}{!}
22   \textcolor{comment}{! いずれかの次元について *start*, *stride* 値が 1 になるような}
23   \textcolor{comment}{! Slice を設定しておいて、Slice\_Next を順次呼び出すと変数全体}
24   \textcolor{comment}{! を走査することができます。}
25   \textcolor{comment}{!}
26   \textcolor{comment}{! 入出力範囲を移動する際にエラーが生じた場合、メッセージを出力}
27   \textcolor{comment}{! してプログラムは 強制終了します。*err* を与えてある場合には}
28   \textcolor{comment}{! の引数に .true. が返り、プログラムは終了しません。}
29   \textcolor{comment}{!}
30   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{, only}: \hyperlink{structgtdata__types_1_1gt__variable}{gt\_variable}
31   \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__error_a3c706700d7fb6c0ff705558066f8e583}{gt\_efake}, \hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}, \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}, 
      \hyperlink{namespacedc__error_adbe5d07dca84213ae01fef87caf04be3}{gt\_enomoredims}, &
32     & nf90\_einval, nf90\_enotvar
33   \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_a2e6a789c1c8f4850421da11f10081cb7}{map\_set}
34   \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}
35   \textcolor{keywordtype}{implicit none}
36   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__types_1_1gt__variable}{gt\_variable}), \textcolor{keywordtype}{intent(in out)}:: var
37   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: dimord
38   \textcolor{keywordtype}{logical}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: err
39   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)}, \textcolor{keywordtype}{optional}:: stat
40   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__internal__map_1_1gt__dimmap}{gt\_dimmap}), \textcolor{keywordtype}{allocatable}:: map(:)
41   \textcolor{keywordtype}{integer}:: mystat, vid, id, nd, idim\_lo, idim\_hi, ilast
42 \textcolor{keywordflow}{continue}
43   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_aca1efe8bae50b85f74980a8c4d704dd8}{beginsub}(\textcolor{stringliteral}{'gtvarslicenext'})
44   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(dimord)) \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}(\textcolor{stringliteral}{'dimord=%d'}, i=(/dimord/))
45 
46   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_a076911f777be03f10a2c024dac7efdad}{map\_lookup}(var, vid=vid, ndims=nd)
47   \textcolor{keywordflow}{if} (vid < 0) \textcolor{keywordflow}{then}
48     mystat = nf90\_enotvar
49     \textcolor{keywordflow}{goto} 999
50 \textcolor{keywordflow}{  endif}
51   \textcolor{keywordflow}{if} (nd <= 0) \textcolor{keywordflow}{then}
52     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}(\textcolor{stringliteral}{'dimension map not associated'})
53     mystat = \hyperlink{namespacedc__error_adbe5d07dca84213ae01fef87caf04be3}{gt\_enomoredims}
54     \textcolor{keywordflow}{goto} 999
55 \textcolor{keywordflow}{  endif}
56   \textcolor{keyword}{allocate}(map(nd))
57   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_a076911f777be03f10a2c024dac7efdad}{map\_lookup}(var, map=map)
58 
59   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(dimord)) \textcolor{keywordflow}{then}
60     \textcolor{keywordflow}{if} (dimord < 0 .or. dimord <= \textcolor{keyword}{size}(map)) \textcolor{keywordflow}{then}
61       \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}(\textcolor{stringliteral}{'dimord=%d is out of 1..%d'}, i=(/dimord, \textcolor{keyword}{size}(map)/))
62       mystat = nf90\_einval
63       \textcolor{keywordflow}{goto} 995
64 \textcolor{keywordflow}{    endif}
65     idim\_lo = dimord
66     idim\_hi = dimord
67   \textcolor{keywordflow}{else}
68     idim\_lo = 1
69     idim\_hi = \textcolor{keyword}{size}(map)
70 \textcolor{keywordflow}{  endif}
71   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}(\textcolor{stringliteral}{'idim scan range=(%d:%d)'}, i=(/idim\_lo, idim\_hi/))
72 
73   mystat = \hyperlink{namespacedc__error_adbe5d07dca84213ae01fef87caf04be3}{gt\_enomoredims}
74   \textcolor{keywordflow}{do}, id = idim\_lo, idim\_hi
75     ilast = map(id)%start + (map(id)%count * 2 - 1) * map(id)%stride
76     \textcolor{keyword}{call }\hyperlink{namespacedc__trace_a2a38fceb4cf9baf298d63456238c3fea}{dbgmessage}(\textcolor{stringliteral}{'last\_index=%d allcount=%d'}, &
77       & i=(/ilast, map(id)%allcount/))
78     \textcolor{keywordflow}{if} (ilast >= 1 .and. ilast <= map(id)%allcount) \textcolor{keywordflow}{then}
79       map(id)%start = map(id)%start + map(id)%count * map(id)%stride
80       mystat = \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}
81       \textcolor{keywordflow}{exit}
82 \textcolor{keywordflow}{    endif}
83 \textcolor{keywordflow}{  enddo}
84   \textcolor{keywordflow}{if} (mystat /= \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr}) \textcolor{keywordflow}{goto} 995
85   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_a2e6a789c1c8f4850421da11f10081cb7}{map\_set}(var, map, mystat)
86 
87 995 \textcolor{keywordflow}{continue}
88   \textcolor{keyword}{deallocate}(map)
89 
90 999 \textcolor{keywordflow}{continue}
91   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stat)) \textcolor{keywordflow}{then}
92     stat = mystat
93     \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(err)) err = (mystat /= \hyperlink{namespacedc__error_a64841a3c9e3ef7d5ddb175e5770f7dfe}{dc\_noerr})
94   \textcolor{keywordflow}{else}
95     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(mystat, \textcolor{stringliteral}{"GTVarSliceNext"}, err)
96 \textcolor{keywordflow}{  endif}
97   \textcolor{keyword}{call }\hyperlink{namespacedc__trace_ae44de97565a3bdd685789c7748b37e37}{endsub}(\textcolor{stringliteral}{'gtvarslicenext'}, \textcolor{stringliteral}{'stat=%d'}, i=(/mystat/))
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{gtvarslicenext_8f90_a73f4f52f9e0c433942f30c349098a000_cgraph}
\end{center}
\end{figure}
