Return absolute of 2D array
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
complex, | intent(in), | dimension(:, :) | :: | array_in |
function gs2_abs_complex_array_2(array_in) result(array_out)
implicit none
complex, dimension(:, :), intent(in) :: array_in
real, dimension(:, :), allocatable :: array_out
integer :: counter, start, end
allocate(array_out(size(array_in, dim=1),size(array_in, dim=2)))
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_complex_array_2