mopac icon indicating copy to clipboard operation
mopac copied to clipboard

Portability problems in orient_water.F90

Open godotalgorithm opened this issue 4 years ago • 0 comments

The optimization of the orientation of water molecules in orient_water.F90 is numerically unstable and produces noticeable different results with different compilers and even different compiler flags. The implementation is based on constrained optimization by linear approximation (COBYLA) [https://handwiki.org/wiki/COBYLA].

This problem causes intermittent failures in the add-h3 test (Au_Add-H.mop).

SUGGESTION: The simplest fix might just be to replace the optimizer with a gradient-based optimizer and remove the optimization constraints by recasting the problem with an orientation quaternion instead of using a pair of hydrogen coordinates as the optimization variables.

godotalgorithm avatar Dec 09 '21 22:12 godotalgorithm