The optimal design of a flap gate array in front of a straight vertical wall: resonance of the natural modes and enhancement of the exciting torque