Return absolute of 2D array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
real, | intent(in), | dimension(:, :) | :: | array_in |
function gs2_abs_real_array_2(array_in) result(array_out)
implicit none
real, dimension(:, :), intent(in) :: array_in
real, dimension(:, :), allocatable :: array_out
integer :: counter, start, end
allocate(array_out, mold = array_in)
start = lbound(array_in, dim = 2)
end = ubound(array_in, dim = 2)
!$OMP PARALLEL DO DEFAULT(none) &
!$OMP SHARED(start, end, array_in, array_out) &
!$OMP SCHEDULE(static)
do counter = start, end
array_out(:, counter) = abs(array_in(:, counter))
end do
!$OMP END PARALLEL DO
end function gs2_abs_real_array_2