aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhawke <hawke@eec4d7dc-71c2-46d6-addf-10296150bf52>2004-04-27 19:55:33 +0000
committerhawke <hawke@eec4d7dc-71c2-46d6-addf-10296150bf52>2004-04-27 19:55:33 +0000
commit00ba3e4f99bfe83649f0b891c0e49d778818d751 (patch)
tree07abada918ac4d58609decd0ebffb8cb0b485f24
parent63344a7ebbb1b34018dfd60001afbc03c549a575 (diff)
Move the declarations of variables in the ENO interpolator to the
beginning so that pgCC doesn't complain. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/Cartoon2D/trunk@77 eec4d7dc-71c2-46d6-addf-10296150bf52
-rw-r--r--src/interpolate.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/interpolate.c b/src/interpolate.c
index d48da6e..7b318d7 100644
--- a/src/interpolate.c
+++ b/src/interpolate.c
@@ -241,6 +241,13 @@ CCTK_REAL interpolate_eno(CCTK_REAL x0, CCTK_REAL dx,
CCTK_INT seed = 0;
CCTK_INT j,r;
+ CCTK_REAL c0;
+ CCTK_REAL c1;
+ CCTK_REAL c2;
+
+ CCTK_REAL xc;
+ CCTK_REAL xr;
+
/* Find seed index */
while (x > x0 + dx * ((float)seed+0.5)) seed++;
@@ -270,12 +277,12 @@ CCTK_REAL interpolate_eno(CCTK_REAL x0, CCTK_REAL dx,
}
/* Interpolate second order */
- double c0 = y[r+1];
- double c1 = (-1.0/2.0)*y[r] + (+1.0/2.0)*y[r+2];
- double c2 = (+1.0/2.0)*y[r] - y[r+1] + (+1.0/2.0)*y[r+2];
+ c0 = y[r+1];
+ c1 = (-1.0/2.0)*y[r] + (+1.0/2.0)*y[r+2];
+ c2 = (+1.0/2.0)*y[r] - y[r+1] + (+1.0/2.0)*y[r+2];
- double xc = x0 + dx * (double)(r+1);
- double xr = (x - xc) / dx;
+ xc = x0 + dx * (CCTK_REAL)(r+1);
+ xr = (x - xc) / dx;
return( c0 + xr*(c1 + xr*c2) );