Quick and dirty optimization; only let one thread calculate the mixing length, and use shared memory for other threads. Reduces kernel execution time with factor 2.
When possible, use integer exponents instead of doubles. Huge difference on GPU