 
     /* --------------------------------- Start code ----------------------------------- */
 
-
-    dtdx = dt/dx;
-    dtdy = dt/dy;
-
-    /* Compute strides */
-    xs = 1;
-    ys = (2*mbc + mx)*xs;
-    zs = (2*mbc + my)*xs*ys;
+    if (threadIdx.x == 0)
+    {
+        dtdx = dt/dx;
+        dtdy = dt/dy;        
+
+        /* Compute strides */
+        xs = 1;
+        ys = (2*mbc + mx)*xs;
+        zs = (2*mbc + my)*xs*ys;
+    }
+    
+    __syncthreads();
 
     maxcfl = 0;
 

        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++)
            {
