Implementation of latching control in a numerical wave tank with regular waves