 
     {
         PROFILE_CUDA_GROUP("Copy CPU buffer back to patches",5);
-        for (int i = 0; i < batch_size; ++i)    
+        for (i = 0; i < batch_size; ++i)    
         {      
-
-            cudaclaw_fluxes_t* fluxes = &(array_fluxes_struct[i]);
-            int I_q = i*fluxes->num;
+            fluxes = &(array_fluxes_struct[i]);
+            I_q = i*fluxes->num;
 
             memcpy(fluxes->qold,&membuffer_cpu[I_q],fluxes->num_bytes);
         }        

    maux = clawpatch_opt->maux;
    meqn = clawpatch_opt->meqn;  

    cudaclaw_fluxes_t* fluxes = &(array_fluxes_struct[0]);
    size = batch_size*(fluxes->num + fluxes->num_aux);
    bytes = size*sizeof(double);



#include "../fc2d_cudaclaw_cuda.h"

#include "cudaclaw_allocate.h"  /* Needed for def of cudaclaw_fluxes_t */


#include <fclaw2d_patch.h>
#include <fclaw2d_global.h>
#include <fclaw2d_vtable.h>

#include <fclaw2d_clawpatch.h>
#include <fclaw2d_clawpatch_options.h>
#include <fc2d_cudaclaw_options.h>
