Lightening has finally struck from the clouds that have been looming for months over Grangemouth following this morning's confirmation that Scotland's only oil refinery will cease production from next year.

The owners of the refinery, which first opened in 1924, have cited the seemingly inevitable impact of the green energy transition on the operation's viability. Petroineos, the joint venture between INEOS and PetroChina, says demand for the key fuels produced at Grangemouth has already started to decline and this is expected to shrink further with the forthcoming ban on new petrol and diesel cars.

There is little argument against this logic, but that won't be of comfort to the 400 people losing their jobs. They will be rightly asking why so little has been done to prepare for this moment despite previous warnings from the Just Transition Commission of a "disorderly and unjust" outcome at Grangemouth.

READ MORE: Grangemouth refinery to cease production with hundreds of jobs set to be lost

The loss of these high-value, high-wage jobs will be a major blow to the area around Falkirk with local businesses ranging from pubs and restaurants to retailers and tradesmen absorbing the impact of a poorer customer base. However, the ripple effect won't stop there.

The refinery at Grangemouth is one of only six in the UK, with the Scottish site accounting for about 14% of overall capacity. It has the capacity to meet 100% of demand for refined oil products in Scotland, though wider economic conditions mean it traditionally exports about 40% of the fuel it produces.

Questions therefore must be asked about what this means more broadly for energy security in Scotland and across the UK, a point that has been painfully driven home by the surging cost of petrol, gas and electricity since the Russian invasion of Ukraine.

READ MORE: Union compares Robison to Thatcher over £460m ScotWind cash raid

Furthermore, this will be an additional unwelcome drag on Scotland's overall economic performance. As has been pointed out by the Fraser of Allander Institute, refining activity accounted for somewhere in the region of 0.3% of Scotland's economic output in 2021, a considerable contribution for a single albeit large industrial site.

Today's announcement from Petroineos comes hard on the heels of news earlier this week that the Scottish Government has used £460 million from the renewable energy fund - which was meant to support the creation of new green jobs for workers like those at Grangemouth - to plug holes elsewhere in the public finances.

Nothing lasts forever and after nearly 100 years in production it's no surprise that the story of refining at Grangemouth is nearing its end. The conclusion was clearly foreshadowed, but many will feel that the "just transition" is a remote fantasy.