In this scene, Professor McGonagall and several other teachers aim their wands at the sky and create a defensive dome over Hogwarts.
What is the spell?
If it is not Expecto Patronum, then why does it deter Dementors?
Science Fiction & Fantasy Stack Exchange is a question and answer site for science fiction and fantasy enthusiasts. It only takes a minute to sign up.Sign up to join this community
In the book, the only spell we can see used is Protego horribilis, by Flitwick. But there isn't a single spell, but instead a mix of them.
'I can act from here', said Flitwick, and although he could barely see out of it, he pointed his wand through the smashed window and started muttering incantations of great complexity. Harry heard a weird rushing noise, as though Flitwick had unleashed the power of the wind into the grounds.
'... Protego horribilis - the diadem of Ravenclaw?' squeaked Flitwick.
Harry Potter and the Deathly Hallows. Chapter thirty: The Sacking of Severus Snape
In the movies, as far as I can tell, there is no explicit spell used. Thus, I'm afraid we can't know which spells are used in that moment.
About your second part of the question, we can safely assume that Expecto Patronum wasn't cast, since that spell doesn't produce a durable shield, and if properly executed, produces a visible corporeal animal form, which wasn't shown in the movie, nor mentioned in the book.
Besides that, Expecto Patronum isn't the only spell that can be used to deal with Dementors, as we can see in Harry Potter and the Half-Blood Prince.
Harry fully expected to receive low marks on his, because he had disagreed with Snape on the best way to tackle Dementors, but he did not care.
Harry Potter and the Half-Blood Prince. Chapter twenty-one: The Unknowable Room.
Therefore, it isn't a stretch to think that a protective charm could protect you from Dementors to some degree, and Flitwick was using high-complexity protective charms that evidently could stop Dementors.