The optionality is inherent in the asset. Storage can be filled or drawn down.
A refinery can run different types of crude (heavy, light, sweet, sour; naphtha rich, distillate rich) and can be configured to extract varying degrees of product. There are literally thousands of inputs to optimizing a refinery (see linear programming).
A coastal refiner can draw in different types of crude from both the domestic and international markets while a land-locked refiner typically relies on domestic. Which crude they lift depends on the relevant crack, their on-site storage, and any domestic or international arb opportunities.