Calculation of the equilibrium configuration and intermolecular frequencies of water dimers and hexagonal ice