Green's law — evolution of non-breaking surface gravity waves propagating in shallow water of gradually varying depth and width