Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real(kind=dp), | intent(in) | :: | vec(:) | |||
integer, | intent(in), | optional | :: | target_state |
pure real(dp) function my_minval(vec, target_state)
real(dp), intent(in) :: vec(:)
integer, intent(in), optional :: target_state
if (present(target_state)) then
my_minval = vec(my_minloc(vec,target_state))
else
my_minval = minval(vec)
end if
end function my_minval