aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetLib/src/prolongate_3d_real8.F77
diff options
context:
space:
mode:
Diffstat (limited to 'Carpet/CarpetLib/src/prolongate_3d_real8.F77')
-rw-r--r--Carpet/CarpetLib/src/prolongate_3d_real8.F7726
1 files changed, 9 insertions, 17 deletions
diff --git a/Carpet/CarpetLib/src/prolongate_3d_real8.F77 b/Carpet/CarpetLib/src/prolongate_3d_real8.F77
index e843ae42e..4383fe0c9 100644
--- a/Carpet/CarpetLib/src/prolongate_3d_real8.F77
+++ b/Carpet/CarpetLib/src/prolongate_3d_real8.F77
@@ -1,17 +1,7 @@
c -*-Fortran-*-
#include "cctk.h"
-
-
-
-#define CHKIDX(i,j,k, imax,jmax,kmax, where) \
- if ((i).lt.1 .or. (i).gt.(imax) \
- .or. (j).lt.1 .or. (j).gt.(jmax) \
- .or. (k).lt.1 .or. (k).gt.(kmax)) then &&\
- write (msg, '(a, " array index out of bounds: shape is (",i4,",",i4,",",i4,"), index is (",i4,",",i4,",",i4,")")') \
- (where), (imax), (jmax), (kmax), (i), (j), (k) &&\
- call CCTK_WARN (0, msg) &&\
- end if
+#include "cctk_Parameters.h"
@@ -22,6 +12,8 @@ c -*-Fortran-*-
implicit none
+ DECLARE_CCTK_PARAMETERS
+
CCTK_REAL8 one
parameter (one = 1)
@@ -51,8 +43,6 @@ c bbox(:,3) is stride
CCTK_REAL8 res
integer d
- character msg*1000
-
do d=1,3
@@ -148,8 +138,9 @@ c Loop over fine region
fac = ifac(ii) * jfac(jj) * kfac(kk)
if (fac.ne.0) then
- CHKIDX (i0+ii, j0+jj, k0+kk, \
- srciext,srcjext,srckext, "source")
+ if (check_array_accesses.ne.0) then
+ call checkindex (i0+ii, j0+jj, k0+kk, 1,1,1, srciext,srcjext,srckext, "source")
+ end if
res = res + fac * src(i0+ii, j0+jj, k0+kk)
end if
@@ -181,8 +172,9 @@ c$$$
c$$$ fac = ifac(2) * jfac(2) * kfac(2)
c$$$ if (fac.ne.0) res = res + fac * src(i0+2, j0+2, k0+2)
- CHKIDX (dstioff+i+1, dstjoff+j+1, dstkoff+k+1, \
- dstiext,dstjext,dstkext, "destination")
+ if (check_array_accesses.ne.0) then
+ call checkindex (dstioff+i+1, dstjoff+j+1, dstkoff+k+1, 1,1,1, dstiext,dstjext,dstkext, "destination")
+ end if
dst (dstioff+i+1, dstjoff+j+1, dstkoff+k+1) = dstdiv * res
end do