Update calcMatrix.f90