单项选择题

What is the purpose of a canal lock

A.To keep out boats that are too large for the canal.
B.To measure the tonnage of canal boats.
C.To lead and unload the cargo.
D.To change the depth of the water.