Selfconsistent noncollinear magnetic calculations can be done in VASP. I am wondering how VASP update the spin directions at each local site. For molecular dynamics, VASP search the next movement of ions by the Newton's equation with the force obtatined from the derivative of the total energy with respect to the ion displacement. As we do a noncollinear calculations selfconsistently, the spin direction would rotate to the ground state (if we do it carefully). However, how VASP rotate the spin direction? Rotate it randomly or follow some laws? I have tried to search in VASP source code and can not find anything related to this. Any suggestions would be greatly appreciated.