                 h_shallow_water_fluxes);
 
             cudaMemcpy(Uc_d, Uc_h, nx*ny*3*sizeof(float), cudaMemcpyHostToDevice);
-
-            /*cout << "\nAfter rk3 coarse: \n\n";
-            for (int y = 0; y < ny; y++) {
-                for (int x = 0; x < nx; x++) {
-                    if (nan_check(Uc_h[((y*nx)+x)*3+2])) {
-                        cout << '(' << x << ',' << y << "): " << Uc_h[((y*nx)+x)*3+2] << '\n';
-                    }
-                }
-            }*/
-
-
-            //for (int j = 0; j < nx*ny*3; j++) {
-                //Uc_h[j] = Upc_h[j];
-            //}
 
             /*for (int j = 0; j < kernels[rank].y; j++) {
                 kx_offset = 0;

            H5Sclose(file_space);
        }

        // prolong to fine grid
        //prolong_grid(Uc_h, Uf_h, nx, ny, nxf, nyf, dx, dy, gamma_up,
                     //rho, gamma, matching_indices);

        // main loop
        for (int t = 0; t < nt; t++) {
            cout << "Evolving t = " << t << '\n';
            //printf("t = %i\n", t);
            // offset by kernels in previous
            //int kx_offset = 0;
            int ky_offset = (kernels[0].y * blocks[0].y * threads[0].y - 2*ng) * rank;
            //int k_offset = 0;
            //if (rank > 0) {
                //k_offset = cumulative_kernels[rank - 1];
            //}

            /*cout << "Coarse grid: \n";
            for (int y = 0; y < ny; y++) {
                for (int x = 0; x < nx; x++) {
                    if (nan_check(Uc_h[((y*nx)+x)*3])) {
                        cout << '(' << x << ',' << y << "): " << Uc_h[((y*nx)+x)*3] << '\n';
                    }
                }
            }*/

            // prolong to fine grid
            prolong_grid(kernels, threads, blocks, cumulative_kernels,


            Sy *= phi(r);

            q_f[(2*y * nxf + 2*x) * 4 + n] = q_comp[coarse_index] -
                0.25 * (dx * Sx + dy * Sy);

