Near-surface humidity is not archived directly in ERA datasets, but the archive contains near-surface (2m from the surface) temperature (T), dew point temperature (Td), and surface pressure (sp) from which you can calculate specific and relative humidity at 2m (https://confluence.ecmwf.int/display/CKB/ERA5%3A+data+documentation).

**Specific humidity** at 2meter can be calculated over water and ice using equations 7.4 and 7.5 from Part IV, Physical processes section (Chapter 7, section 7.2.1b) in the documentation of the IFS for CY41R2. Use the 2m dew point temperature and surface pressure (which is approximately equal to the pressure at 2m) in these equations. The constants in 7.4 are to be found in Chapter 12 (of Part IV: Physical processes) and the parameters in 7.5 should be set for saturation over water because the dew point temperature is being used."

**In practice:**

*In the following : dtas=Td and ps=sp*

Rdry=287.0597 ; Rvap=461.5250 ; a1=611.21 ; a3=17.502 ; a4=32.19 ; T0=273.16

;Calculation of E saturation water vapour from Teten's formula

E=a1*exp(a3*(dtas-T0)/(dtas-a4))

;Calculation of saturation specific humidity at 2m qsat (equal to huss)

qsat=(Rdry/Rvap)*E/(ps-((1-Rdry/Rvap)*E))