From f6cc7c792d6a5a74bf45e0d7ac4420048fea17c4 Mon Sep 17 00:00:00 2001 From: Robert Pincus Date: Fri, 30 Apr 2021 13:13:07 -0400 Subject: [PATCH] Initialize values in OpenMP values checking routines --- rte/mo_rte_util_array.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rte/mo_rte_util_array.F90 b/rte/mo_rte_util_array.F90 index 9ef28380e..41a02cc96 100644 --- a/rte/mo_rte_util_array.F90 +++ b/rte/mo_rte_util_array.F90 @@ -84,7 +84,7 @@ logical function any_vals_less_than_3D(array, check_value) dim1 = size(array,1) dim2 = size(array,2) dim3 = size(array,3) - minValue = array(1,1,1) ! initialize to some value + minValue = check_value + epsilon(check_value) ! initialize to some value !$omp target teams map(to:array) & !$omp defaultmap(tofrom:scalar) reduction(min:minValue) !$omp distribute parallel do simd reduction(min:minValue) @@ -207,8 +207,8 @@ logical function any_vals_outside_3D(array, checkMin, checkMax) dim1 = size(array,1) dim2 = size(array,2) dim3 = size(array,3) - minValue = array(1,1,1) ! initialize to some value - maxValue = array(1,1,1) ! initialize to some value + minValue = checkMin + epsilon(checkMin) ! initialize to some value + maxValue = checkMax - epsilon(checkMax) ! initialize to some value !$omp target teams map(to:array) & !$omp defaultmap(tofrom:scalar) reduction(min:minValue) reduction(max:maxValue) !$omp distribute parallel do simd reduction(min:minValue) reduction(max:maxValue) @@ -370,7 +370,7 @@ subroutine zero_array_1D(ni, array) bind(C, name="zero_array_1D") integer :: i ! ----------------------- !$acc parallel loop copyout(array) - !$omp target teams distribute parallel do simd map(from:array) + !$omp target teams distribute parallel do simd map(from:array) do i = 1, ni array(i) = 0.0_wp end do