@Tony12345,
Quote:"I had barely arrived when it began to rain." Does the adverbial clause modify "had arrived" or "barely"?
"An adverb clause (or adverbial clause) is a clause that works as an adverb in a sentence. Its role is to show place, time, condition, degree, and so on, by answering questions like “where?”; “when?”; “how?”; and “why?” Just like an adverb, it modifies other parts of a sentence to add more details.
Like all clauses, an adverb clause has a subject and a predicate. However, an adverb clause is a dependent clause—so, it can never be a sentence on its own. Specifically, an adverb clause is a modifier that modifies the independent clause."
The adverbial clause, 'I had barely arrived' modifies the independent clause,
'when it began to rain'.
https://englishsentences.com/adverb-clause/