In order to freeze a bond length, angle or dihedral, it is important to set the Opt=ModRedundant directive.

%nprocshared=20
%mem=40GB
%chk=/global/archive/phchm/ir-goettingen/s0opt2/ir_opt.chk
#P b3lyp/def2SVP opt=ModRedundant scf=(tight,MaxCycle=500) pop=full iop(6/7=3) gfinput gfoldprint gfprint EmpiricalDispersion=GD3 SCRF=(PCM,Solvent=Acetonitrile)

Ir complex with B3LYP

1 1
C -2.38008 0.32587 0.65976
S -4.86842 0.34670 -0.74159
S -5.07214 1.14093 0.59786
C -3.51219 -0.45064 -1.51185
...
Ir 0.59352 0.00001 -0.00005

D 1 2 3 4 0.00 B
D 1 2 3 4 F


The D 1 2 3 4 0.00 B indicates a dihedral (other possibilities: X for Cartesian coordinate, B for bond length, A for angle or L for linear bend), the four involved atoms (indicated by their number in the xyz part), the value of the dihedral (0.00 in this case) and B for "build", i.e., create this redundant definition. The following line, D 1 2 3 4 F,  takes the dihedral and freezes it at the previously specified value. Here, the dihedral is constrained at 0 degrees.

Here is a simple example of a Gaussian input for geometry optimization using effective core potentials and implicit solvent.

%nprocshared=20
%mem=40GB
%chk=/directory/ir_opt.chk
#P b3lyp/GenECP opt scf=(tight,MaxCycle=500) pop=full iop(6/7=3) gfinput gfoldprint gfprint EmpiricalDispersion=GD3 SCRF=(PCM,Solvent=Acetonitrile)

Ir complex with B3LYP

1 1
  Ir        0.5935160        0.0000110       -0.0000510
...
  H       -0.0408700        1.7889610        2.4865060

C N H S 0
6-31G(d)
****
Ir     0
LANL2DZ
****

Ir     0
LANL2DZ


Pay attention to the two empty lines at the end.
Here is also a SLURM submission script.


#!/bin/bash
#SBATCH -J opt
#SBATCH -N 1
#SBATCH --ntasks-per-node=20
#SBATCH -p compute
#SBATCH --mem=42G
#SBATCH --constraint beegfs

module use /usr/license/modulefiles
module load gaussian
export g16root=/usr/license/gaussian
source $g16root/g16/bsd/g16.profile
export TMPDIR=/public/`hostname -s`/scratch/tmp/$LOGNAME.$$
mkdir $TMPDIR

g16 < ir_opt.inp > ir_opt.log

rm -rf $TMPDIR