Skip to content

Commit

Permalink
Added files and readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
vehre committed Jun 20, 2015
1 parent 3185198 commit d12c644
Show file tree
Hide file tree
Showing 12 changed files with 7,444 additions and 0 deletions.
41 changes: 41 additions & 0 deletions ArrayUtils.f90
@@ -0,0 +1,41 @@
module ArrayUtils
implicit none

contains

function IndexOf(aval,arr, n)
integer, intent(in) :: n, arr(n), aval
integer IndexOf, i

do i=1,n
if (arr(i)==aval) then
IndexOf= i
return
end if
end do
IndexOf = 0

end function IndexOf

function MaxIndex(arr, n)
integer, intent(in) :: n
real, intent(in) :: arr(n)
integer locs(1:1), MaxIndex

locs = maxloc(arr(1:n))
MaxIndex = locs(1)

end function MaxIndex


function MinIndex(arr, n)
integer, intent(in) :: n
real, intent(in) :: arr(n)
integer locs(1:1), MinIndex

locs = minloc(arr(1:n))
MinIndex = locs(1)

end function MinIndex

end module ArrayUtils

0 comments on commit d12c644

Please sign in to comment.