2019-04-03 21:54:15 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @author Martin Diehl, Max-Planck-Institut für Eisenforschung GmbH
|
|
|
|
!> @brief New fortran functions for compiler versions that do not support them
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
module future
|
2019-06-11 13:18:07 +05:30
|
|
|
use prec
|
|
|
|
|
|
|
|
implicit none
|
2019-04-03 21:54:15 +05:30
|
|
|
public
|
2019-06-11 13:18:07 +05:30
|
|
|
|
2019-04-03 21:54:15 +05:30
|
|
|
contains
|
|
|
|
|
2019-09-23 19:18:20 +05:30
|
|
|
#if defined(__GFORTRAN__) && __GNUC__<9 || __INTEL_COMPILER<1800
|
2019-04-03 21:54:15 +05:30
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
!> @brief substitute for the findloc intrinsic (only for integer, dimension(:) at the moment)
|
|
|
|
!--------------------------------------------------------------------------------------------------
|
|
|
|
function findloc(a,v)
|
2019-06-11 13:18:07 +05:30
|
|
|
|
2019-04-03 21:54:15 +05:30
|
|
|
integer, intent(in), dimension(:) :: a
|
|
|
|
integer, intent(in) :: v
|
|
|
|
integer :: i,j
|
|
|
|
integer, allocatable, dimension(:) :: findloc
|
|
|
|
|
|
|
|
allocate(findloc(count(a==v)))
|
|
|
|
j = 1
|
|
|
|
do i = 1, size(a)
|
|
|
|
if (a(i)==v) then
|
|
|
|
findloc(j) = i
|
|
|
|
j = j + 1
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
end function findloc
|
|
|
|
#endif
|
|
|
|
|
|
|
|
end module future
|