libsim  Versione 7.2.1

◆ 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.

184 TYPE(vol7d_varvect),intent(in) :: this
185 type(vol7d_var),INTENT(in) :: search
186 LOGICAL,INTENT(in),OPTIONAL :: mask(:)
187 LOGICAL,INTENT(in),OPTIONAL :: back
188 character(len=*),intent(inout),optional :: type
189 INTEGER :: index_
190 
191 
192 index_=0
193 
194 select case (optio_c(type,1))
195 
196 case ("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 
201 case ("r")
202  if (associated(this%r))then
203  index_=index(this%r(:), search, mask, back) ! vettore di variabili reali
204  end if
205 
206 case ("i")
207  if (associated(this%i))then
208  index_=index(this%i(:), search, mask, back) ! vettore di variabili intere
209  end if
210 
211 case ("b")
212  if (associated(this%b))then
213  index_=index(this%b(:), search, mask, back) ! vettore di variabili byte
214  end if
215 
216 case ("c")
217  if (associated(this%c))then
218  index_=index(this%c(:), search, mask, back) ! vettore di variabili carattere
219  end if
220 
221 case (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
240 end 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 
258 case default
259 
260  CALL l4f_log(l4f_error, 'variable type not contemplated: '//type)
261 
262 end select
263 
Index method.

Generated with Doxygen.