From 00ba3e4f99bfe83649f0b891c0e49d778818d751 Mon Sep 17 00:00:00 2001 From: hawke Date: Tue, 27 Apr 2004 19:55:33 +0000 Subject: 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 --- src/interpolate.c | 17 ++++++++++++----- 1 file 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) ); -- cgit v1.2.3