You could in principle use harmonic dihedral instead of charmm IF your “d” parameter in charmm is either 0 or 180 degrees.
In that case the charmm potential can be simplified to harmonic potential such the d parameter of harmonic potential is basically cos(d).
For example. If you had 0 for d in charmm, it becomes 1 in harmonic and if you had 180 for d in charmm, it becomes -1.
I hope this helps!!!