$optimize cartesian on internal offThese lines switch on the non-default optimization in cartesian coordinates and switch off the optimization in internal coordinates (this has to be done explicitly!). As input data groups you need only $grad as provided by on of the gradient programs. For the first coordinate update an approximate force constant matrix is needed in data group $forceapprox. Output will be the updated coordinates on $coord, and the updated force constant matrix on $forceapprox.
The coordinates for any single atom can be fixed by placing an 'f' in the third to eighth column of the chemical symbol/flag group. As an example, the following coordinates specify acetone with a fixed carbonyl group:
$coord 2.02693271108611 2.03672551266230 0.00000000000000 c 1.08247228252865 -0.68857387733323 0.00000000000000 c f 2.53154870318830 -2.48171472134488 0.00000000000000 o f -1.78063790034738 -1.04586399389434 0.00000000000000 c -2.64348282517094 -0.13141435997713 1.68855816889786 h -2.23779643042546 -3.09026673535431 0.00000000000000 h -2.64348282517094 -0.13141435997713 -1.68855816889786 h 1.31008893646566 3.07002878668872 1.68840815751978 h 1.31008893646566 3.07002878668872 -1.68840815751978 h 4.12184425921830 2.06288409251899 0.00000000000000 h $end