   #endif
 
 
-  #ifdef SINGLE_ALLOC_GPU
+  #ifndef DYNAMIC_GPU_ALLOC
   chprintf( " VL_3D: Memory freed successfully \n");
   #endif
 }

    CudaSafeCall( cudaMalloc((void**)&dev_dt_array, ngrid*sizeof(Real)) );
    #endif 
    
    #ifdef SINGLE_ALLOC_GPU
    chprintf( " VL_3D: Allocating memory \n");
    chprintf ( "  N memory blocks gpu: %d\n", block_tot );
    // If memory is single allocated: memory_allocated becomes true and succesive timesteps won't allocate memory.

  // 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.
  Free_Memory_VL_3D();
  #endif
