I saw this example in Cambridge english grammar in use 2nd edition:
Yesterday morning I got up and looked out of the window. The sun was shining but the ground was so wet. It had been raining.
My question is, as this action happened before I looked out of the window, can I use it had rained instead.
Thanks in advance for your help.
Both it had been raining and it had rained are in the past perfect tense. The difference is that the first one is past perfect progressive and the second one is not progressive. (Some people say continuous instead of progressive.)
Both of them are ok. They both mean that the action happened before you looked out the window. The difference would be that it had been raining has the idea of ongoing action. The rain kept coming for a while. (2 hours? 5 hours?) You could also say that it had rained, even if it had indeed rained for 5 hours. you are just not stressing that the action (i.e. the rain falling) was ongoing. It had been raining stresses the idea that it was going on for a while.
While we're talking about this, remember the following:
If you are looking out the window right now, and you see rain falling, you have to say "It is raining." You use present progressive if something is happening right now.
If someone were to ask you "Does it rain a lot where you live?" you would answer "Yes, it does. It rains a lot where I live. (Present tense shows what routinely happens.)
You can say 1'it had rained', also, yes. 2'it had been raining' or 1'it had rained' mean the same here. Or, 3'it was raining'.
Imagine it is now 1400hr. The rain came from 0300 to 0330 the same day.
1. it had(0330) rained(0300to0330).
2. it had(0330) (been raining)(0300to0330).
3. it (was raining)(0300to0330)
Notice, with 1 and 2, there are really 3 points of reference: now(understood=1400), (rainypart)(0300to0330), and then(had=0330). Once you realise that in most English tenses, there are really 3 points of reference, things will start to clear up. 'had' usually refers to a point in the past, here(0330).