libsim Versione 7.2.6

◆ vol7d_varvect_index()

integer function vol7d_varvect_index ( type(vol7d_varvect), intent(in) this,
type(vol7d_var), intent(in) search,
logical, dimension(:), intent(in), optional mask,
logical, intent(in), optional back,
character(len=*), intent(inout), optional type )

Return the index of first or last element of this equal to search.

Parametri
[in]thisobject to search in
[in]searchwhat to search
[in]masksearch only among elements for which mask is .TRUE.
[in]backif .TRUE. search from the end
[in,out]typetype of vector found ("d","r","i","b","c")

Definizione alla linea 183 del file vol7d_varvect_class.f90.

184TYPE(vol7d_varvect),intent(in) :: this !< object to search in
185type(vol7d_var),INTENT(in) :: search !< what to search
186LOGICAL,INTENT(in),OPTIONAL :: mask(:) !< search only among elements for which \a mask is \a .TRUE.
187LOGICAL,INTENT(in),OPTIONAL :: back !< if \a .TRUE. search from the end
188character(len=*),intent(inout),optional :: type !< type of vector found ("d","r","i","b","c")
189INTEGER :: index_
190
191
192index_=0
193
194select case (optio_c(type,1))
195
196case ("d")
197 if (associated(this%d))then
198 index_=index(this%d(:), search, mask, back) ! vettore di variabili a doppia precisione
199 end if
200
201case ("r")
202 if (associated(this%r))then
203 index_=index(this%r(:), search, mask, back) ! vettore di variabili reali
204 end if
205
206case ("i")
207 if (associated(this%i))then
208 index_=index(this%i(:), search, mask, back) ! vettore di variabili intere
209 end if
210
211case ("b")
212 if (associated(this%b))then
213 index_=index(this%b(:), search, mask, back) ! vettore di variabili byte
214 end if
215
216case ("c")
217 if (associated(this%c))then
218 index_=index(this%c(:), search, mask, back) ! vettore di variabili carattere
219 end if
220
221case (cmiss)
222
223 if (associated(this%d))then
224 index_=index(this%d(:), search, mask, back) ! vettore di variabili a doppia precisione
225 if (present(type)) type="d"
226 end if
227
228 if(index_ == 0)then
229 if (associated(this%r))then
230 index_=index(this%r(:), search, mask, back) ! vettore di variabili reali
231 if (present(type)) type="r"
232 end if
233 end if
234
235 if(index_ == 0)then
236 if (associated(this%i))then
237 index_=index(this%i(:), search, mask, back) ! vettore di variabili intere
238 if (present(type)) type="i"
239 end if
240end if
241
242 if(index_ == 0)then
243 if (associated(this%b))then
244 index_=index(this%b(:), search, mask, back) ! vettore di variabili byte
245 if (present(type)) type="b"
246 end if
247 end if
248
249 if(index_ == 0)then
250 if (associated(this%c))then
251 index_=index(this%c(:), search, mask, back) ! vettore di variabili carattere
252 if (present(type)) type="c"
253 end if
254 end if
255
256 if (index_ == 0) type=cmiss
257
258case default
259
260 CALL l4f_log(l4f_error, 'variable type not contemplated: '//type)
261
262end select
263
Index method.

Generated with Doxygen.