One of the reasons oil companies shut down some refineries is because oil supplies were depleted in inland areas and there was no longer enough oil to supply land-locked refineries in inland areas. You'll notice that most of our refineries are now on the three coasts or near the Houston ship channel, so the refineries can receive shipments of imported oil. Shell Oil just shut down a refinery in Bakersfield, CA last year because they no longer have enough San Joaquin Valley oil to run the refinery at a profit. Shell tried to sell the refinery, but last I heard nobody wanted to buy it because it loses money. The oil industry is constantly changing. It's not like semiconductors where they have abundant raw materials and they can build their factories anywhere and keep them running forever.
Thank you!