     double* bmasdq = aux3   + 2*maux;       /* meqn        */
     double* bpasdq = bmasdq + meqn;         /* meqn        */
 
-    double dtdx, dtdy;
+    __shared__ double dtdx, dtdy;
+    __shared__ int xs,ys,zs;
 
     int mq, mw, m, k;
-    int xs, ys, zs;
     int I, I_q, I_aux, I_waves, I_speeds;
     int ix,iy,ifaces_x, ifaces_y, num_ifaces;
     int thread_index;

        ix = thread_index % mx;
        iy = thread_index/my;

        I = (ix + mbc)*xs + (iy + mbc)*ys;

        for(mq = 0; mq < meqn; mq++)
        {

            ix = thread_index % mx;
            iy = thread_index/mx;

            I = (ix + mbc) + (iy + mbc)*ys;

            for(mq = 0; mq < meqn; mq++)
            {
