it's probably the passive cooling system for the turbocharger. Subaru basically uses a heat pump to recirculate coolant through the turbo, even after the engine is shut off. It's actually quite ingenious in that it doesn't require any external pump to function, it just uses the hot coolant fluid expansion to create a siphon which in turn draws cooler fluid through the turbo until the turbo cools.
That said, your car is making way more noise than is typical from that system. Usually you just hear a steady "tick, tick, tick" for awhile after shutting off the car.