\hypertarget{gtvarslice_8f90}{}\section{gtdata/gtvarslice.f90 File Reference}
\label{gtvarslice_8f90}\index{gtdata/gtvarslice.\+f90@{gtdata/gtvarslice.\+f90}}
\subsection*{Functions/\+Subroutines}
\begin{DoxyCompactItemize}
\item 
subroutine \hyperlink{gtvarslice_8f90_ac2fa32099894dc037b1871433e307fe3}{gtvarslice} (var, dimord, start, count, stride)
\item 
subroutine \hyperlink{gtvarslice_8f90_a88f46f7a0203db6c945c2772e0922b61}{gtvarslicec} (var, string, err)
\item 
subroutine \hyperlink{gtvarslice_8f90_ad4bbe30291d7ef974e7fec2aae9d61dc}{limit\+\_\+one} (string)
\item 
subroutine \hyperlink{gtvarslice_8f90_a8e9aca7b0e9cbf3672233a1d89803bc0}{region\+\_\+spec} (dimord, string, start, count, stride)
\item 
real function \hyperlink{gtvarslice_8f90_a9db8385e0dfb608a22ee4f2a1af2bbf8}{value\+\_\+to\+\_\+index} (dimord, value)
\end{DoxyCompactItemize}


\subsection{Function/\+Subroutine Documentation}
\mbox{\Hypertarget{gtvarslice_8f90_ac2fa32099894dc037b1871433e307fe3}\label{gtvarslice_8f90_ac2fa32099894dc037b1871433e307fe3}} 
\index{gtvarslice.\+f90@{gtvarslice.\+f90}!gtvarslice@{gtvarslice}}
\index{gtvarslice@{gtvarslice}!gtvarslice.\+f90@{gtvarslice.\+f90}}
\subsubsection{\texorpdfstring{gtvarslice()}{gtvarslice()}}
{\footnotesize\ttfamily subroutine gtvarslice (\begin{DoxyParamCaption}\item[{type(gt\+\_\+variable), intent(in)}]{var,  }\item[{integer, intent(in)}]{dimord,  }\item[{integer, intent(in), optional}]{start,  }\item[{integer, intent(in), optional}]{count,  }\item[{integer, intent(in), optional}]{stride }\end{DoxyParamCaption})}



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



References gtdata\+\_\+internal\+\_\+map\+::gtvar\+\_\+dump(), gtdata\+\_\+internal\+\_\+map\+::map\+\_\+lookup(), gtdata\+\_\+internal\+\_\+map\+::map\+\_\+set(), gtdata\+\_\+internal\+\_\+vartable\+::query\+\_\+growable(), and dc\+\_\+error\+::storeerror().


\begin{DoxyCode}
14   \textcolor{comment}{!}
15   \textcolor{comment}{!== 入出力範囲を数値で指定}
16   \textcolor{comment}{!}
17   \textcolor{comment}{! 変数 *var* の入出力範囲を指定します。}
18   \textcolor{comment}{!}
19   \textcolor{comment}{! 変数 *var* の *dimord* 番目の次元の入出力範囲を *start* から}
20   \textcolor{comment}{! *stride* 個おきに *count* 個とします。*start*, *count*,}
21   \textcolor{comment}{! *stride* のいずれを省略しても <b>1</b> が仮定されます。成功し}
22   \textcolor{comment}{! たか否かを返す引数はありません。仮に指定できない範囲が指定さ}
23   \textcolor{comment}{! た場合には、指定範囲を含むなるべく広い範囲を設定します。}
24   \textcolor{comment}{!}
25   \textcolor{comment}{! *Slice* は複数のサブルーチンの総称名であり、}
26   \textcolor{comment}{! 他にも文字列や番号で指定する方法があります。}
27   \textcolor{comment}{!}
28   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{, only}: gt\_variable
29   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__internal__vartable}{gtdata\_internal\_vartable}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtdata__internal__vartable_a6c3912fc042a447a1586ce60f43874dc}{query\_growable}
30   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__internal__map}{gtdata\_internal\_map}\textcolor{keywordtype}{, only}: \hyperlink{namespacegtdata__internal__map_a076911f777be03f10a2c024dac7efdad}{map\_lookup}, 
      \hyperlink{namespacegtdata__internal__map_a2e6a789c1c8f4850421da11f10081cb7}{map\_set}, \hyperlink{structgtdata__internal__map_1_1gt__dimmap}{gt\_dimmap}, \hyperlink{namespacegtdata__internal__map_acbda65a71acbd7d3ba6175c6f4fceff0}{gtvar\_dump}
31   \textcolor{keywordtype}{use }\hyperlink{namespacedc__error}{dc\_error}\textcolor{keywordtype}{, only}: nf90\_enotvar, \hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}
32   \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{, only}: beginsub, endsub, dbgmessage
33   \textcolor{keywordtype}{implicit none}
34   \textcolor{keywordtype}{type}(gt\_variable), \textcolor{keywordtype}{intent(in)}:: var
35   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: dimord
36   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: start
37   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: count
38   \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}, \textcolor{keywordtype}{optional}:: stride
39   \textcolor{keywordtype}{type}(\hyperlink{structgtdata__internal__map_1_1gt__dimmap}{gt\_dimmap}), \textcolor{keywordtype}{allocatable}:: map(:)
40   \textcolor{keywordtype}{integer}:: vid, maxindex, maxcount, nd, stat
41   \textcolor{keywordtype}{logical}:: growable\_dimension
42 \textcolor{keywordflow}{continue}
43   \textcolor{keyword}{call }beginsub(\textcolor{stringliteral}{'GTVarSlice'}, \textcolor{stringliteral}{'var%%mapid=%d dimord=%d'}, &
44     & i=(/var%mapid, dimord/))
45   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_acbda65a71acbd7d3ba6175c6f4fceff0}{gtvar\_dump}(var)
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     \textcolor{keyword}{call }\hyperlink{namespacedc__error_a0104aee83ee5752b1a9f6152b11864a8}{storeerror}(nf90\_enotvar, \textcolor{stringliteral}{"GTVarSlice"})
49 \textcolor{keywordflow}{  endif}
50 
51   \textcolor{keywordflow}{if} (vid > 0) \textcolor{keywordflow}{then}
52     \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__vartable_a6c3912fc042a447a1586ce60f43874dc}{query\_growable}(vid, growable\_dimension)
53   \textcolor{keywordflow}{else}
54     growable\_dimension = .false.
55 \textcolor{keywordflow}{  endif}
56 
57   \textcolor{keywordflow}{if} (nd == 0) \textcolor{keywordflow}{goto} 999
58   \textcolor{keyword}{allocate}(map(nd))
59   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_a076911f777be03f10a2c024dac7efdad}{map\_lookup}(var, map=map)
60 
61   \textcolor{keywordflow}{if} (dimord <= 0 .or. dimord > \textcolor{keyword}{size}(map)) \textcolor{keywordflow}{goto} 998
62 
63   \textcolor{keyword}{call }dbgmessage(\textcolor{stringliteral}{'map(dimord): originally start=%d count=%d stride=%d'}, &
64     & i=(/map(dimord)%start, map(dimord)%count, map(dimord)%stride/))
65   \textcolor{keywordflow}{if} (.not. growable\_dimension) \textcolor{keywordflow}{then}
66     maxindex = map(dimord)%allcount
67     \textcolor{keyword}{call }dbgmessage(\textcolor{stringliteral}{'maxindex=%d'}, i=(/maxindex/))
68 \textcolor{keywordflow}{  endif}
69 
70   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(start)) \textcolor{keywordflow}{then}
71     \textcolor{keywordflow}{if} (start < 0) \textcolor{keywordflow}{then}
72       map(dimord)%start = \hyperlink{interfacedc__date__generic_1_1max}{max}(1, maxindex + 1 + start)
73     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (growable\_dimension) \textcolor{keywordflow}{then}
74       map(dimord)%start = \hyperlink{interfacedc__date__generic_1_1max}{max}(1, start)
75     \textcolor{keywordflow}{else}
76       map(dimord)%start = \hyperlink{interfacedc__date__generic_1_1min}{min}(maxindex, \hyperlink{interfacedc__date__generic_1_1max}{max}(1, start))
77 \textcolor{keywordflow}{    endif}
78     \textcolor{keyword}{call }dbgmessage(\textcolor{stringliteral}{'start=%d (%d specified)'}, i=(/map(dimord)%start, start/))
79 \textcolor{keywordflow}{  endif}
80 
81   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(stride)) \textcolor{keywordflow}{then}
82     map(dimord)%stride = stride
83     \textcolor{keywordflow}{if} (stride == 0) map(dimord)%stride = 1
84     \textcolor{keyword}{call }dbgmessage(\textcolor{stringliteral}{'stride=%d (%d specified)'}, &
85       & i=(/map(dimord)%stride, stride/))
86 \textcolor{keywordflow}{  endif}
87 
88   \textcolor{keywordflow}{if} (\textcolor{keyword}{present}(count)) \textcolor{keywordflow}{then}
89     map(dimord)%count = abs(count)
90     \textcolor{keywordflow}{if} (count == 0) map(dimord)%count = 1
91     \textcolor{keyword}{call }dbgmessage(\textcolor{stringliteral}{'count=%d (%d specified)'}, &
92       & i=(/map(dimord)%count, count/))
93 \textcolor{keywordflow}{  endif}
94 
95   \textcolor{keywordflow}{if} (.not. growable\_dimension) \textcolor{keywordflow}{then}
96     maxcount = 1 + (maxindex - map(dimord)%start) / map(dimord)%stride
97     map(dimord)%count = \hyperlink{interfacedc__date__generic_1_1max}{max}(1, \hyperlink{interfacedc__date__generic_1_1min}{min}(maxcount, map(dimord)%count))
98     \textcolor{keyword}{call }dbgmessage(\textcolor{stringliteral}{'count=%d '}, i=(/map(dimord)%count/))
99 \textcolor{keywordflow}{  endif}
100   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_a2e6a789c1c8f4850421da11f10081cb7}{map\_set}(var, map, stat)
101   \textcolor{keywordflow}{if} (stat /= 0) \textcolor{keywordflow}{goto} 998
102 
103   \textcolor{keyword}{call }endsub(\textcolor{stringliteral}{'GTVarSlice'})
104   \textcolor{keyword}{deallocate}(map)
105   \textcolor{keywordflow}{return}
106 
107 998 \textcolor{keywordflow}{continue}
108   \textcolor{keyword}{deallocate}(map)
109 999 \textcolor{keywordflow}{continue}
110   \textcolor{keyword}{call }endsub(\textcolor{stringliteral}{'GTVarSlice'}, \textcolor{stringliteral}{'err skipped'})
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{gtvarslice_8f90_ac2fa32099894dc037b1871433e307fe3_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{gtvarslice_8f90_a88f46f7a0203db6c945c2772e0922b61}\label{gtvarslice_8f90_a88f46f7a0203db6c945c2772e0922b61}} 
\index{gtvarslice.\+f90@{gtvarslice.\+f90}!gtvarslicec@{gtvarslicec}}
\index{gtvarslicec@{gtvarslicec}!gtvarslice.\+f90@{gtvarslice.\+f90}}
\subsubsection{\texorpdfstring{gtvarslicec()}{gtvarslicec()}}
{\footnotesize\ttfamily subroutine gtvarslicec (\begin{DoxyParamCaption}\item[{type(gt\+\_\+variable), intent(inout)}]{var,  }\item[{character(len = $\ast$), intent(in)}]{string,  }\item[{logical, intent(out)}]{err }\end{DoxyParamCaption})}



Definition at line 114 of file gtvarslice.\+f90.



References dc\+\_\+url\+::gt\+\_\+comma, gtdata\+\_\+internal\+\_\+map\+::gtvar\+\_\+dump(), and limit\+\_\+one().


\begin{DoxyCode}
114   \textcolor{comment}{!}
115   \textcolor{comment}{!== 入出力範囲を文字列で指定}
116   \textcolor{comment}{!}
117   \textcolor{comment}{! 変数 *var* の入出力範囲を、*string* に応じて指定します。}
118   \textcolor{comment}{! *string* には \{gtool4 netCDF 規約\}[link:../xref.htm#label-6] の}
119   \textcolor{comment}{! 「5.4 コンマ記法」に述べられる範囲指定表現を用います。}
120   \textcolor{comment}{! 凡例を以下に挙げます。}
121   \textcolor{comment}{!}
122   \textcolor{comment}{!     <dim>=<lower>}
123   \textcolor{comment}{!}
124   \textcolor{comment}{!     <dim>=<lower>:<upper>}
125   \textcolor{comment}{!}
126   \textcolor{comment}{!     <dim>=<lower>:<upper>:<stride>}
127   \textcolor{comment}{!}
128   \textcolor{comment}{! ここで、<tt><dim></tt> は次元番号または次元名であり、}
129   \textcolor{comment}{! <tt><lower></tt>, <tt><upper></tt>}
130   \textcolor{comment}{! は座標値または "<tt>^</tt>" を前置した格子番号です。}
131   \textcolor{comment}{! <tt><stride></tt> は格子数です。}
132   \textcolor{comment}{!}
133   \textcolor{comment}{! 現在 *err* は必ず <tt>.false.</tt> を返すことになっています。}
134   \textcolor{comment}{!}
135   \textcolor{comment}{! *Slice* は複数のサブルーチンの総称名であり、}
136   \textcolor{comment}{! 他にも文字列や番号で指定する方法があります。}
137   \textcolor{comment}{!}
138   \textcolor{comment}{!}
139   \textcolor{comment}{!}
140   \textcolor{comment}{!--}
141   \textcolor{comment}{! 変数 var に string によるマップ操作を行う。}
142   \textcolor{comment}{! string はコンマで区切られた変換指定の列である。}
143   \textcolor{comment}{! 変換指定は領域設定と次元順序変換のどちらかである。}
144   \textcolor{comment}{! 領域設定は英数字で始まるもので、<dim>=<lower>, <dim>=<lower>:<upper>,}
145   \textcolor{comment}{!   <dim>=<lower>:<upper>:<stride> のような形式である。}
146   \textcolor{comment}{!   ここで、dim は次元番号または次元名であり、<lower>, <upper>}
147   \textcolor{comment}{!   は ^ を前置した座標即値または格子番号である。}
148   \textcolor{comment}{!   <stride> は格子数である。}
149   \textcolor{comment}{! (未実装) 次元順序変換は = で始まるもので、}
150   \textcolor{comment}{!   IGN:<dim>=<pos>}
151   \textcolor{comment}{! の形態をとる。}
152   \textcolor{comment}{!++}
153   \textcolor{comment}{!}
154   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{,   only}: gt\_variable
155   \textcolor{keywordtype}{use }gtdata\_generic\textcolor{keywordtype}{, only}: slice
156   \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{,       only}: beginsub, endsub
157   \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{,         only}: \hyperlink{namespacedc__url_a61f457425e29d1452036669b43735790}{gt\_comma}
158   \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__internal__map}{gtdata\_internal\_map}\textcolor{keywordtype}{,         only}: \hyperlink{namespacegtdata__internal__map_acbda65a71acbd7d3ba6175c6f4fceff0}{gtvar\_dump}
159   \textcolor{keywordtype}{type}(gt\_variable),  \textcolor{keywordtype}{intent(inout)} :: var
160   \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}    :: string
161   \textcolor{keywordtype}{logical},            \textcolor{keywordtype}{intent(out)}   :: err
162   \textcolor{keywordtype}{integer}:: is, ie
163 \textcolor{keywordflow}{continue}
164   \textcolor{keyword}{call }beginsub(\textcolor{stringliteral}{'GTVarSliceC'}, \textcolor{stringliteral}{'var=%d lim=<%c>'}, &
165     & i=(/var%mapid/), c1=trim(string))
166   \textcolor{keyword}{call }\hyperlink{namespacegtdata__internal__map_acbda65a71acbd7d3ba6175c6f4fceff0}{gtvar\_dump}(var)
167   \textcolor{comment}{! コンマで区切って解釈}
168   is = 1
169   \textcolor{keywordflow}{do}
170     ie = index(string(is: ), \hyperlink{namespacedc__url_a61f457425e29d1452036669b43735790}{gt\_comma})
171     \textcolor{keywordflow}{if} (ie == 0) \textcolor{keywordflow}{exit}
172     \textcolor{keyword}{call }\hyperlink{gtvarlimit_8f90_a3ab399280ae0a9c47ef63d17a9cbb1ae}{limit\_one}(string(is: is+ie-2))
173     is = is + ie
174     \textcolor{keywordflow}{if} (is > len(string)) \textcolor{keywordflow}{exit}
175 \textcolor{keywordflow}{  enddo}
176   \textcolor{keyword}{call }\hyperlink{gtvarlimit_8f90_a3ab399280ae0a9c47ef63d17a9cbb1ae}{limit\_one}(string(is: ))
177   err = .false.
178   \textcolor{keyword}{call }endsub(\textcolor{stringliteral}{'GTVarSliceC'})
179   \textcolor{keywordflow}{return}
180 \textcolor{keyword}{contains}
181 
182 \textcolor{keyword}{  subroutine }\hyperlink{gtvarlimit_8f90_a3ab399280ae0a9c47ef63d17a9cbb1ae}{limit\_one}(string)
183     \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__url_a7136bff4d1b5152ca579575eb6a99f75}{gt\_equal}
184     \textcolor{keywordtype}{use }dc\_string\textcolor{keywordtype}{, only}: strieq, stoi
185     \textcolor{keywordtype}{use }gtdata\_generic\textcolor{keywordtype}{, only}: del\_dim, dimname\_to\_dimord
186     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: string
187     \textcolor{keywordtype}{integer}:: equal, dimord
188     \textcolor{keywordtype}{integer}:: start, count, stride
189     \textcolor{keywordtype}{logical}:: myerr
190 
191     \textcolor{keywordflow}{if} (string == \textcolor{stringliteral}{''}) \textcolor{keywordflow}{return}
192 
193     \textcolor{keywordflow}{if} (strieq(string(1:4), \textcolor{stringliteral}{"IGN:"})) \textcolor{keywordflow}{then}
194       \textcolor{comment}{! 隠蔽型指定子 ign:<dim> または ign:<dim>=<start>}
195       equal = index(string, \hyperlink{namespacedc__url_a7136bff4d1b5152ca579575eb6a99f75}{gt\_equal})
196       \textcolor{keywordflow}{if} (equal == 0) \textcolor{keywordflow}{then}
197         start = 1
198       \textcolor{keywordflow}{else}
199         start = stoi(string(equal+1: ), default=1)
200 \textcolor{keywordflow}{      endif}
201       dimord = dimname\_to\_dimord(var, string(5: equal-1))
202       \textcolor{keyword}{call }slice(var, dimord, start, 1, 1)
203       \textcolor{keyword}{call }del\_dim(var, dimord, myerr)
204       \textcolor{keywordflow}{return}
205 \textcolor{keywordflow}{    endif}
206 
207     \textcolor{comment}{! 限定型指定子 <dim>=<start>:<finish>:<stride>}
208     \textcolor{comment}{!}
209     equal = index(string, \hyperlink{namespacedc__url_a7136bff4d1b5152ca579575eb6a99f75}{gt\_equal})
210     \textcolor{keywordflow}{if} (equal == 0) \textcolor{keywordflow}{return}
211     dimord = dimname\_to\_dimord(var, string(1: equal-1))
212     \textcolor{keywordflow}{if} (dimord <= 0) \textcolor{keywordflow}{return}
213     \textcolor{comment}{!}
214     \textcolor{keyword}{call }\hyperlink{gtvarlimit_8f90_a94e803f7f864a2956bece716f16a6a57}{region\_spec}(dimord, string(equal+1: ), start, count, stride)
215     \textcolor{keyword}{call }slice(var, dimord, start, count, stride)
216 \textcolor{keyword}{  end subroutine }\hyperlink{gtvarlimit_8f90_a3ab399280ae0a9c47ef63d17a9cbb1ae}{limit\_one}
217 
218   \textcolor{comment}{!}
219   \textcolor{comment}{! 範囲指定の = のあとを : で区切ってマップにいれる}
220   \textcolor{comment}{!}
221 \textcolor{keyword}{  subroutine }\hyperlink{gtvarlimit_8f90_a94e803f7f864a2956bece716f16a6a57}{region\_spec}(dimord, string, start, count, stride)
222     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_a6d28eb015ba84292a06f4ff25165b376}{token}
223     \textcolor{keywordtype}{use }dc\_string\textcolor{keywordtype}{, only}: index\_ofs, stoi
224     \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__url_adf1b8d55d944dc6510d8ba57d54bc168}{gt\_circumflex}, \hyperlink{namespacedc__url_a8a012262cb2d70e929fb1d929c1f5752}{gt\_colon}
225     \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__internal__map}{gtdata\_internal\_map}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__internal__map_1_1dimrange}{dimrange}
226     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: dimord
227     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)}:: start, count, stride
228     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: string
229     \textcolor{keywordtype}{integer}:: colon, prev\_colon, finish, dimlo, dimhi
230     \textcolor{keywordtype}{character(len = token)}:: val(3)
231   \textcolor{keywordflow}{continue}
232     colon = index(string, \hyperlink{namespacedc__url_a8a012262cb2d70e929fb1d929c1f5752}{gt\_colon})
233     \textcolor{keywordflow}{if} (colon == 0) \textcolor{keywordflow}{then}
234       \textcolor{comment}{! コロンがない場合は上下端に同じ値}
235       val(1) = string(1: )
236       val(2) = val(1)
237       val(3) = \textcolor{stringliteral}{""}
238     \textcolor{keywordflow}{else}
239       val(1) = string(1: colon - 1)
240       prev\_colon = colon
241       colon = index\_ofs(string, colon + 1, \hyperlink{namespacedc__url_a8a012262cb2d70e929fb1d929c1f5752}{gt\_colon})
242       \textcolor{keywordflow}{if} (colon > 0) \textcolor{keywordflow}{then}
243         val(2) = string(prev\_colon + 1: colon - 1)
244         val(3) = string(colon + 1: )
245       \textcolor{keywordflow}{else}
246         val(2) = string(prev\_colon + 1: )
247         val(3) = \textcolor{stringliteral}{""}
248 \textcolor{keywordflow}{      endif}
249 \textcolor{keywordflow}{    endif}
250     \textcolor{keywordflow}{if} (val(3) == \textcolor{stringliteral}{""}) val(3) = \textcolor{stringliteral}{"^1"}
251 
252     \textcolor{keywordflow}{if} (val(1)(1:1) == \hyperlink{namespacedc__url_adf1b8d55d944dc6510d8ba57d54bc168}{gt\_circumflex}) \textcolor{keywordflow}{then}
253       start = stoi(val(1)(2: ))
254     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (val(1) == val(2)) \textcolor{keywordflow}{then}
255       start = nint(\hyperlink{gtvarlimit_8f90_a84b815e1598fad755fc5b5ca03612997}{value\_to\_index}(dimord, val(1)))
256     \textcolor{keywordflow}{else}
257       start = floor(\hyperlink{gtvarlimit_8f90_a84b815e1598fad755fc5b5ca03612997}{value\_to\_index}(dimord, val(1)))
258 \textcolor{keywordflow}{    endif}
259     \textcolor{keywordflow}{if} (val(2) == val(1)) \textcolor{keywordflow}{then}
260       finish = start
261     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (val(2)(1:1) == \hyperlink{namespacedc__url_adf1b8d55d944dc6510d8ba57d54bc168}{gt\_circumflex}) \textcolor{keywordflow}{then}
262       finish = stoi(val(2)(2: ))
263     \textcolor{keywordflow}{else}
264       finish = ceiling(\hyperlink{gtvarlimit_8f90_a84b815e1598fad755fc5b5ca03612997}{value\_to\_index}(dimord, val(2)))
265 \textcolor{keywordflow}{    endif}
266 
267     \textcolor{keyword}{call }\hyperlink{interfacegtdata__internal__map_1_1dimrange}{dimrange}(var, dimord, dimlo, dimhi)
268     start = \hyperlink{interfacedc__date__generic_1_1min}{min}(\hyperlink{interfacedc__date__generic_1_1max}{max}(dimlo, start), dimhi)
269     finish = \hyperlink{interfacedc__date__generic_1_1min}{min}(\hyperlink{interfacedc__date__generic_1_1max}{max}(dimlo, finish), dimhi)
270     count = abs(finish - start) + 1
271 
272     \textcolor{keywordflow}{if} (val(3)(1:1) == \hyperlink{namespacedc__url_adf1b8d55d944dc6510d8ba57d54bc168}{gt\_circumflex}) \textcolor{keywordflow}{then}
273       stride = stoi(val(3)(2: ))
274     \textcolor{keywordflow}{else}
275       stride = stoi(val(3))
276 \textcolor{keywordflow}{    endif}
277     stride = sign(stride, finish - start)
278 \textcolor{keyword}{  end subroutine }\hyperlink{gtvarlimit_8f90_a94e803f7f864a2956bece716f16a6a57}{region\_spec}
279 
280 \textcolor{keyword}{  real }\textcolor{keyword}{function }\hyperlink{gtvarlimit_8f90_a84b815e1598fad755fc5b5ca03612997}{value\_to\_index}(dimord, value) \textcolor{keyword}{result}(result)
281     \textcolor{comment}{!}
282     \textcolor{comment}{! GTVarSlice の引数 *var* に格納される変数の次元 *dimord*}
283     \textcolor{comment}{! に格納されるデータのうち, *value* が格納される}
284     \textcolor{comment}{! 格子番号を整数値にして返します.}
285     \textcolor{comment}{!}
286     \textcolor{comment}{! 例えば次元に以下のデータが格納されているとします.}
287     \textcolor{comment}{!}
288     \textcolor{comment}{!     0.05  0.1  0.15  0.20  0.25  0.30}
289     \textcolor{comment}{!}
290     \textcolor{comment}{! この場合, *value* に 0.15 が与えられれば戻り値は 3. となります.}
291     \textcolor{comment}{! また *value* に 0.225 が与えられれば戻り値は 4.5 となります.}
292     \textcolor{comment}{!}
293     \textcolor{comment}{!}
294     \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{, only}: gt\_variable
295     \textcolor{keywordtype}{use }gtdata\_generic\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__netcdf__generic_1_1get}{get}, \hyperlink{interfacegtdata__netcdf__generic_1_1open}{open}, \hyperlink{interfacegtdata__netcdf__generic_1_1close}{close}
296     \textcolor{keywordtype}{use }dc\_string\textcolor{keywordtype}{, only}: stod
297     \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{, only}: beginsub, endsub, dbgmessage
298     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: dimord
299     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: value
300     \textcolor{keywordtype}{type}(gt\_variable):: axisvar
301     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: axisval(:)
302     \textcolor{keywordtype}{real}:: val
303     \textcolor{keywordtype}{integer}:: i
304   \textcolor{keywordflow}{continue}
305     \textcolor{keyword}{call }beginsub(\textcolor{stringliteral}{'value\_to\_index'}, \textcolor{stringliteral}{'var=%d dimord=%d value=%c'}, &
306       & i=(/var%mapid, dimord/), c1=trim(\textcolor{keywordtype}{value}))
307 
308     \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1open}{open}(axisvar, var, dimord, count\_compact=.true.)
309     \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1get}{get}(axisvar, axisval)
310     \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1close}{close}(axisvar)
311     \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(axisval)) \textcolor{keywordflow}{then}
312       result = -1.0
313       \textcolor{keywordflow}{return}
314     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(axisval) < 2) \textcolor{keywordflow}{then}
315       result = 1.0
316       \textcolor{keywordflow}{goto} 900
317 \textcolor{keywordflow}{    endif}
318 
319     val = stod(\textcolor{keywordtype}{value})
320 
321     \textcolor{comment}{! call DbgMessage('value=%f axis=(/%*r/)', r=(/val, axisval(:)/), &}
322     \textcolor{comment}{!    & n=(/size(axisval)/))}
323 
324     \textcolor{keywordflow}{do}, i = 1, \textcolor{keyword}{size}(axisval) - 1
325       \textcolor{keywordflow}{if} (axisval(i + 1) == axisval(i)) \textcolor{keywordflow}{then}
326         result = \textcolor{keywordtype}{real(i)} + 0.5
327         \textcolor{keywordflow}{goto} 900
328 \textcolor{keywordflow}{      endif}
329       result = i + (val - axisval(i)) / (axisval(i + 1) - axisval(i))
330       \textcolor{keywordflow}{if} (result <= (i + 1)) \textcolor{keywordflow}{goto} 900
331 \textcolor{keywordflow}{    enddo}
332 
333 900 \textcolor{keywordflow}{continue}
334     \textcolor{keyword}{call }endsub(\textcolor{stringliteral}{'value\_to\_index'}, \textcolor{stringliteral}{'value(%c) =~ index(%r)'}, &
335       & c1=trim(\textcolor{keywordtype}{value}), r=(/result/))
336     \textcolor{keyword}{deallocate}(axisval)
337 \textcolor{keyword}{  end function }\hyperlink{gtvarlimit_8f90_a84b815e1598fad755fc5b5ca03612997}{value\_to\_index}
338 
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{gtvarslice_8f90_a88f46f7a0203db6c945c2772e0922b61_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{gtvarslice_8f90_ad4bbe30291d7ef974e7fec2aae9d61dc}\label{gtvarslice_8f90_ad4bbe30291d7ef974e7fec2aae9d61dc}} 
\index{gtvarslice.\+f90@{gtvarslice.\+f90}!limit\+\_\+one@{limit\+\_\+one}}
\index{limit\+\_\+one@{limit\+\_\+one}!gtvarslice.\+f90@{gtvarslice.\+f90}}
\subsubsection{\texorpdfstring{limit\+\_\+one()}{limit\_one()}}
{\footnotesize\ttfamily subroutine gtvarslicec\+::limit\+\_\+one (\begin{DoxyParamCaption}\item[{character(len = $\ast$), intent(in)}]{string }\end{DoxyParamCaption})}



Definition at line 183 of file gtvarslice.\+f90.



References dc\+\_\+url\+::gt\+\_\+equal, and region\+\_\+spec().


\begin{DoxyCode}
183     \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__url_a7136bff4d1b5152ca579575eb6a99f75}{gt\_equal}
184     \textcolor{keywordtype}{use }dc\_string\textcolor{keywordtype}{, only}: strieq, stoi
185     \textcolor{keywordtype}{use }gtdata\_generic\textcolor{keywordtype}{, only}: del\_dim, dimname\_to\_dimord
186     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: string
187     \textcolor{keywordtype}{integer}:: equal, dimord
188     \textcolor{keywordtype}{integer}:: start, count, stride
189     \textcolor{keywordtype}{logical}:: myerr
190 
191     \textcolor{keywordflow}{if} (string == \textcolor{stringliteral}{''}) \textcolor{keywordflow}{return}
192 
193     \textcolor{keywordflow}{if} (strieq(string(1:4), \textcolor{stringliteral}{"IGN:"})) \textcolor{keywordflow}{then}
194       \textcolor{comment}{! 隠蔽型指定子 ign:<dim> または ign:<dim>=<start>}
195       equal = index(string, \hyperlink{namespacedc__url_a7136bff4d1b5152ca579575eb6a99f75}{gt\_equal})
196       \textcolor{keywordflow}{if} (equal == 0) \textcolor{keywordflow}{then}
197         start = 1
198       \textcolor{keywordflow}{else}
199         start = stoi(string(equal+1: ), default=1)
200 \textcolor{keywordflow}{      endif}
201       dimord = dimname\_to\_dimord(var, string(5: equal-1))
202       \textcolor{keyword}{call }slice(var, dimord, start, 1, 1)
203       \textcolor{keyword}{call }del\_dim(var, dimord, myerr)
204       \textcolor{keywordflow}{return}
205 \textcolor{keywordflow}{    endif}
206 
207     \textcolor{comment}{! 限定型指定子 <dim>=<start>:<finish>:<stride>}
208     \textcolor{comment}{!}
209     equal = index(string, \hyperlink{namespacedc__url_a7136bff4d1b5152ca579575eb6a99f75}{gt\_equal})
210     \textcolor{keywordflow}{if} (equal == 0) \textcolor{keywordflow}{return}
211     dimord = dimname\_to\_dimord(var, string(1: equal-1))
212     \textcolor{keywordflow}{if} (dimord <= 0) \textcolor{keywordflow}{return}
213     \textcolor{comment}{!}
214     \textcolor{keyword}{call }\hyperlink{gtvarlimit_8f90_a94e803f7f864a2956bece716f16a6a57}{region\_spec}(dimord, string(equal+1: ), start, count, stride)
215     \textcolor{keyword}{call }slice(var, dimord, start, count, stride)
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{gtvarslice_8f90_ad4bbe30291d7ef974e7fec2aae9d61dc_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{gtvarslice_8f90_a8e9aca7b0e9cbf3672233a1d89803bc0}\label{gtvarslice_8f90_a8e9aca7b0e9cbf3672233a1d89803bc0}} 
\index{gtvarslice.\+f90@{gtvarslice.\+f90}!region\+\_\+spec@{region\+\_\+spec}}
\index{region\+\_\+spec@{region\+\_\+spec}!gtvarslice.\+f90@{gtvarslice.\+f90}}
\subsubsection{\texorpdfstring{region\+\_\+spec()}{region\_spec()}}
{\footnotesize\ttfamily subroutine gtvarslicec\+::region\+\_\+spec (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{dimord,  }\item[{character(len = $\ast$), intent(in)}]{string,  }\item[{integer, intent(out)}]{start,  }\item[{integer, intent(out)}]{count,  }\item[{integer, intent(out)}]{stride }\end{DoxyParamCaption})}



Definition at line 222 of file gtvarslice.\+f90.



References dc\+\_\+url\+::gt\+\_\+circumflex, dc\+\_\+url\+::gt\+\_\+colon, dc\+\_\+types\+::token, and value\+\_\+to\+\_\+index().


\begin{DoxyCode}
222     \textcolor{keywordtype}{use }\hyperlink{namespacedc__types}{dc\_types}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__types_a6d28eb015ba84292a06f4ff25165b376}{token}
223     \textcolor{keywordtype}{use }dc\_string\textcolor{keywordtype}{, only}: index\_ofs, stoi
224     \textcolor{keywordtype}{use }\hyperlink{namespacedc__url}{dc\_url}\textcolor{keywordtype}{, only}: \hyperlink{namespacedc__url_adf1b8d55d944dc6510d8ba57d54bc168}{gt\_circumflex}, \hyperlink{namespacedc__url_a8a012262cb2d70e929fb1d929c1f5752}{gt\_colon}
225     \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__internal__map}{gtdata\_internal\_map}\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__internal__map_1_1dimrange}{dimrange}
226     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: dimord
227     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(out)}:: start, count, stride
228     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: string
229     \textcolor{keywordtype}{integer}:: colon, prev\_colon, finish, dimlo, dimhi
230     \textcolor{keywordtype}{character(len = token)}:: val(3)
231   \textcolor{keywordflow}{continue}
232     colon = index(string, \hyperlink{namespacedc__url_a8a012262cb2d70e929fb1d929c1f5752}{gt\_colon})
233     \textcolor{keywordflow}{if} (colon == 0) \textcolor{keywordflow}{then}
234       \textcolor{comment}{! コロンがない場合は上下端に同じ値}
235       val(1) = string(1: )
236       val(2) = val(1)
237       val(3) = \textcolor{stringliteral}{""}
238     \textcolor{keywordflow}{else}
239       val(1) = string(1: colon - 1)
240       prev\_colon = colon
241       colon = index\_ofs(string, colon + 1, \hyperlink{namespacedc__url_a8a012262cb2d70e929fb1d929c1f5752}{gt\_colon})
242       \textcolor{keywordflow}{if} (colon > 0) \textcolor{keywordflow}{then}
243         val(2) = string(prev\_colon + 1: colon - 1)
244         val(3) = string(colon + 1: )
245       \textcolor{keywordflow}{else}
246         val(2) = string(prev\_colon + 1: )
247         val(3) = \textcolor{stringliteral}{""}
248 \textcolor{keywordflow}{      endif}
249 \textcolor{keywordflow}{    endif}
250     \textcolor{keywordflow}{if} (val(3) == \textcolor{stringliteral}{""}) val(3) = \textcolor{stringliteral}{"^1"}
251 
252     \textcolor{keywordflow}{if} (val(1)(1:1) == \hyperlink{namespacedc__url_adf1b8d55d944dc6510d8ba57d54bc168}{gt\_circumflex}) \textcolor{keywordflow}{then}
253       start = stoi(val(1)(2: ))
254     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (val(1) == val(2)) \textcolor{keywordflow}{then}
255       start = nint(\hyperlink{gtvarlimit_8f90_a84b815e1598fad755fc5b5ca03612997}{value\_to\_index}(dimord, val(1)))
256     \textcolor{keywordflow}{else}
257       start = floor(\hyperlink{gtvarlimit_8f90_a84b815e1598fad755fc5b5ca03612997}{value\_to\_index}(dimord, val(1)))
258 \textcolor{keywordflow}{    endif}
259     \textcolor{keywordflow}{if} (val(2) == val(1)) \textcolor{keywordflow}{then}
260       finish = start
261     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (val(2)(1:1) == \hyperlink{namespacedc__url_adf1b8d55d944dc6510d8ba57d54bc168}{gt\_circumflex}) \textcolor{keywordflow}{then}
262       finish = stoi(val(2)(2: ))
263     \textcolor{keywordflow}{else}
264       finish = ceiling(\hyperlink{gtvarlimit_8f90_a84b815e1598fad755fc5b5ca03612997}{value\_to\_index}(dimord, val(2)))
265 \textcolor{keywordflow}{    endif}
266 
267     \textcolor{keyword}{call }\hyperlink{interfacegtdata__internal__map_1_1dimrange}{dimrange}(var, dimord, dimlo, dimhi)
268     start = \hyperlink{interfacedc__date__generic_1_1min}{min}(\hyperlink{interfacedc__date__generic_1_1max}{max}(dimlo, start), dimhi)
269     finish = \hyperlink{interfacedc__date__generic_1_1min}{min}(\hyperlink{interfacedc__date__generic_1_1max}{max}(dimlo, finish), dimhi)
270     count = abs(finish - start) + 1
271 
272     \textcolor{keywordflow}{if} (val(3)(1:1) == \hyperlink{namespacedc__url_adf1b8d55d944dc6510d8ba57d54bc168}{gt\_circumflex}) \textcolor{keywordflow}{then}
273       stride = stoi(val(3)(2: ))
274     \textcolor{keywordflow}{else}
275       stride = stoi(val(3))
276 \textcolor{keywordflow}{    endif}
277     stride = sign(stride, finish - start)
\end{DoxyCode}
Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=267pt]{gtvarslice_8f90_a8e9aca7b0e9cbf3672233a1d89803bc0_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{gtvarslice_8f90_a9db8385e0dfb608a22ee4f2a1af2bbf8}\label{gtvarslice_8f90_a9db8385e0dfb608a22ee4f2a1af2bbf8}} 
\index{gtvarslice.\+f90@{gtvarslice.\+f90}!value\+\_\+to\+\_\+index@{value\+\_\+to\+\_\+index}}
\index{value\+\_\+to\+\_\+index@{value\+\_\+to\+\_\+index}!gtvarslice.\+f90@{gtvarslice.\+f90}}
\subsubsection{\texorpdfstring{value\+\_\+to\+\_\+index()}{value\_to\_index()}}
{\footnotesize\ttfamily real function gtvarslicec\+::value\+\_\+to\+\_\+index (\begin{DoxyParamCaption}\item[{integer, intent(in)}]{dimord,  }\item[{character(len = $\ast$), intent(in)}]{value }\end{DoxyParamCaption})}



Definition at line 281 of file gtvarslice.\+f90.


\begin{DoxyCode}
281     \textcolor{comment}{!}
282     \textcolor{comment}{! GTVarSlice の引数 *var* に格納される変数の次元 *dimord*}
283     \textcolor{comment}{! に格納されるデータのうち, *value* が格納される}
284     \textcolor{comment}{! 格子番号を整数値にして返します.}
285     \textcolor{comment}{!}
286     \textcolor{comment}{! 例えば次元に以下のデータが格納されているとします.}
287     \textcolor{comment}{!}
288     \textcolor{comment}{!     0.05  0.1  0.15  0.20  0.25  0.30}
289     \textcolor{comment}{!}
290     \textcolor{comment}{! この場合, *value* に 0.15 が与えられれば戻り値は 3. となります.}
291     \textcolor{comment}{! また *value* に 0.225 が与えられれば戻り値は 4.5 となります.}
292     \textcolor{comment}{!}
293     \textcolor{comment}{!}
294     \textcolor{keywordtype}{use }\hyperlink{namespacegtdata__types}{gtdata\_types}\textcolor{keywordtype}{, only}: gt\_variable
295     \textcolor{keywordtype}{use }gtdata\_generic\textcolor{keywordtype}{, only}: \hyperlink{interfacegtdata__netcdf__generic_1_1get}{get}, \hyperlink{interfacegtdata__netcdf__generic_1_1open}{open}, \hyperlink{interfacegtdata__netcdf__generic_1_1close}{close}
296     \textcolor{keywordtype}{use }dc\_string\textcolor{keywordtype}{, only}: stod
297     \textcolor{keywordtype}{use }dc\_trace\textcolor{keywordtype}{, only}: beginsub, endsub, dbgmessage
298     \textcolor{keywordtype}{integer}, \textcolor{keywordtype}{intent(in)}:: dimord
299     \textcolor{keywordtype}{character(len = *)}, \textcolor{keywordtype}{intent(in)}:: value
300     \textcolor{keywordtype}{type}(gt\_variable):: axisvar
301     \textcolor{keywordtype}{real}, \textcolor{keywordtype}{pointer}:: axisval(:)
302     \textcolor{keywordtype}{real}:: val
303     \textcolor{keywordtype}{integer}:: i
304   \textcolor{keywordflow}{continue}
305     \textcolor{keyword}{call }beginsub(\textcolor{stringliteral}{'value\_to\_index'}, \textcolor{stringliteral}{'var=%d dimord=%d value=%c'}, &
306       & i=(/var%mapid, dimord/), c1=trim(\textcolor{keywordtype}{value}))
307 
308     \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1open}{open}(axisvar, var, dimord, count\_compact=.true.)
309     \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1get}{get}(axisvar, axisval)
310     \textcolor{keyword}{call }\hyperlink{interfacegtdata__netcdf__generic_1_1close}{close}(axisvar)
311     \textcolor{keywordflow}{if} (.not. \textcolor{keyword}{associated}(axisval)) \textcolor{keywordflow}{then}
312       result = -1.0
313       \textcolor{keywordflow}{return}
314     \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (\textcolor{keyword}{size}(axisval) < 2) \textcolor{keywordflow}{then}
315       result = 1.0
316       \textcolor{keywordflow}{goto} 900
317 \textcolor{keywordflow}{    endif}
318 
319     val = stod(\textcolor{keywordtype}{value})
320 
321     \textcolor{comment}{! call DbgMessage('value=%f axis=(/%*r/)', r=(/val, axisval(:)/), &}
322     \textcolor{comment}{!    & n=(/size(axisval)/))}
323 
324     \textcolor{keywordflow}{do}, i = 1, \textcolor{keyword}{size}(axisval) - 1
325       \textcolor{keywordflow}{if} (axisval(i + 1) == axisval(i)) \textcolor{keywordflow}{then}
326         result = \textcolor{keywordtype}{real(i)} + 0.5
327         \textcolor{keywordflow}{goto} 900
328 \textcolor{keywordflow}{      endif}
329       result = i + (val - axisval(i)) / (axisval(i + 1) - axisval(i))
330       \textcolor{keywordflow}{if} (result <= (i + 1)) \textcolor{keywordflow}{goto} 900
331 \textcolor{keywordflow}{    enddo}
332 
333 900 \textcolor{keywordflow}{continue}
334     \textcolor{keyword}{call }endsub(\textcolor{stringliteral}{'value\_to\_index'}, \textcolor{stringliteral}{'value(%c) =~ index(%r)'}, &
335       & c1=trim(\textcolor{keywordtype}{value}), r=(/result/))
336     \textcolor{keyword}{deallocate}(axisval)
\end{DoxyCode}
