diff options
Diffstat (limited to 'src/AHFinder_gau.F')
-rw-r--r-- | src/AHFinder_gau.F | 44 |
1 files changed, 36 insertions, 8 deletions
diff --git a/src/AHFinder_gau.F b/src/AHFinder_gau.F index 98be8f6..ed74d51 100644 --- a/src/AHFinder_gau.F +++ b/src/AHFinder_gau.F @@ -85,6 +85,13 @@ c CCTK_REAL i2dx,i2dy,i2dz,idxx,idyy,idzz,idxy,idxz,idyz character(len=200) :: gaussf +! Reduction variables + CCTK_INT , dimension(1) :: input_array_dim + CCTK_POINTER_TO_CONST, dimension(1) :: input_array + CCTK_POINTER, dimension(1) :: reduction_value + CCTK_POINTER, dimension(3) :: reduction_value3 + CCTK_INT, dimension(3) ::input_array_type + ! Declarations for macros. c#include "CactusEinstein/ADMMacros/src/macro/ADM_Spacing_declare.h" @@ -224,7 +231,7 @@ c#include "CactusEinstein/ADMMacros/src/macro/ADM_Spacing_declare.h" ! *** Get the reduction handle for sum operation *** ! ****************************************************** - call CCTK_ReductionArrayHandle(sum_handle,"sum") + call CCTK_LocalArrayReductionHandle(sum_handle,"sum") if (sum_handle.lt.0) then call CCTK_WARN(1,"Cannot get handle for sum reduction ! Forgot to activate an implementation providing reduction operators ??") @@ -648,24 +655,45 @@ c#include "CactusEinstein/ADMMacros/src/macro/ADM_Spacing_declare.h" ! know about this since all will participate on the interpolation ! below). - call CCTK_ReduceLocalScalar(ierror,cctkGH,-1,sum_handle, - . error1,rerror,CCTK_VARIABLE_INT) - + input_array_dim(1) = zero + reduction_value(1)= CCTK_PointerTo(rerror) + input_array(1) = CCTK_PointerTo(error1) + call CCTK_ReduceArraysGlobally(ierror, cctkGH, -1,sum_handle, -1, + . 1, input_array,0, input_array_dim, CCTK_VARIABLE_INT, 1, + . CCTK_VARIABLE_INT, reduction_value) + if (ierror.ne.0) then call CCTK_WARN(1,"Reduction failed!") end if error1 = rerror - call CCTK_ReduceLocalScalar(ierror,cctkGH,-1,sum_handle, - . error2,rerror,CCTK_VARIABLE_INT) + input_array(1) = CCTK_PointerTo(error1) + call CCTK_ReduceArraysGlobally(ierror, cctkGH, -1,sum_handle, -1, + . 1, input_array,0, input_array_dim, CCTK_VARIABLE_INT, 1, + . CCTK_VARIABLE_INT, reduction_value) if (ierror.ne.0) then call CCTK_WARN(1,"Reduction failed!") end if error2 = rerror - call CCTK_ReduceLocArrayToArray1D(ierror,cctkGH,-1,sum_handle, - . ahf_centroid,rahf_centroid,3,CCTK_VARIABLE_REAL) + input_array_dim = 0 + + input_array(1) = CCTK_PointerTo(ahf_centroid(1)) + input_array(2) = CCTK_PointerTo(ahf_centroid(2)) + input_array(3) = CCTK_PointerTo(ahf_centroid(3)) + + reduction_value3(1) = CCTK_PointerTo(rahf_centroid(1)) + reduction_value3(2) = CCTK_PointerTo(rahf_centroid(2)) + reduction_value3(3) = CCTK_PointerTo(rahf_centroid(3)) + + input_array_type(1) = CCTK_VARIABLE_REAL + input_array_type(2) = CCTK_VARIABLE_REAL + input_array_type(3) = CCTK_VARIABLE_REAL + + call CCTK_ReduceArraysGlobally(ierror, cctkGH, -1,sum_handle, -1, + . 3, input_array,0, input_array_dim, input_array_type, 3, + . input_array_type, reduction_value) if (ierror.ne.0) then call CCTK_WARN(1,"Reduction failed!") |