 #ifdef COOLING_GPU
 Real *host_dt_array;
 #endif
+// Buffer to copy conserved variable blocks to/from
+Real *buffer;
+// Pointers for the location to copy from and to
+Real *tmp1;
+Real *tmp2;
 
 // Similarly, sizes of subgrid blocks and kernel dimensions are global variables
 // so subgrid splitting function is only called once


  }

  // free CPU memory
  if (block_tot > 1) free(buffer);
  
  #ifdef DYNAMIC_GPU_ALLOC
  // If memory is not single allocated then free the memory every timestep.

  other += elapsedTime;
  #endif //TIME

  // Set up pointers for the location to copy from and to
  if (block_tot == 1) {
    tmp1 = host_conserved0;
    tmp2 = host_conserved1;
  }

  #ifdef TIME
  cudaEventRecord(start, 0);
  #endif //TIME
  if ( !memory_allocated ){

    // allocate buffer to copy conserved variable blocks to/from
    if (block_tot > 1) {
      if ( NULL == ( buffer = (Real *) malloc(n_fields*BLOCK_VOL*sizeof(Real)) ) ) {
        printf("Failed to allocate CPU buffer.\n");
      }
      tmp1 = buffer;
      tmp2 = buffer;
    }
    // allocate an array on the CPU to hold max_dti returned from each thread block
    host_dti_array = (Real *) malloc(ngrid*sizeof(Real));
    #ifdef COOLING_GPU
