When can you take commodities out of the warehouse?
Play as if the cards are in your hand (besides the obvious new rule: you don't need to discard them).

So when can you use them? When you like. Replacing? Assume all the cards are you in your hand, so this question is now irrelevant. When? In the progress step.

Justifications:


  At the end of this phase, the players must discard all unused cards 
  (unless they are placed in a warehouse).


Note it does not say the cards are put on top of the warehouse cards.


  Warehouses are valuable because they can 
  store unused goods at the end of a round.


That's all warehouses do - there are no further clarifications on timing or anything else because there doesn't need to be any.

Practical:

In play, I tend to put the cards that can fit into my warehouses, on top of the warehouse cards - just because it permits me to play quicker, knowing that I've set aside the cards that I believe are important to keep and thus calculating the rest of my purchases can continue unencumbered. Understand that this convention is not in the rules, nowhere does it say you need to put your cards "on top" of the warehouse.