Modified CMthread functions. Parallel grdCalculate. Eliminating compiler warnings on MacOS X.