Modified calc_tors
Removed some intent(out) variables that can be found by simply using intrinsics on arrays already output
Moved several items to math module