     ys = (2*mbc + mx)*xs;
     zs = (2*mbc + my)*xs*ys;
 
+    double max_speed = 0;
+
     for(int thread_index = threadIdx.x; thread_index<num_ifaces; thread_index+=blockDim.x)
     {
 

            {
                I_speeds = I + mw*zs;
                speeds[I_speeds] = s[mw];
            } 



            {
                I_speeds = I + (mwaves+mw)*zs;
                speeds[I_speeds] = s[mw];
                if(fabs(s[mw])*dtdy>max_speed){
                    max_speed=fabs(s[mw])*dtdy;
                }
            } 

#if 0        
