# relative humidity

This post was from a previous version of the WRF&MPAS-A Support Forum. Please do not add new replies here and if you would like the thread moved out of the Historical / Archive section then contact us, making sure to include the link of the thread to be moved.

#### ensiyeh

##### New member
Hi

I have a problem with WRF-ARW. I don't have relative humidity in WRF output. Could you help me on how to calculate relative humidity, please?
Thank you

#### Ming Chen

##### Moderator
Staff member
The Relative Humidity (RH) is simply the mixing ratio divided by the saturation mixing ratio. wrfout files include mixing ratio and T, from which you can easily obtain RH.

#### ensiyeh

##### New member
Hi Ming

Thank you. I searched for the equation of relative humidity a lot. But I didn't find any equation to calculate relative humidity. Every equation needs something that I don't have in my WRF output. Could you write the equation, please?
Thank you

#### Ming Chen

##### Moderator
Staff member
Here is a small piece of Fortran to calculate relative humidity from mixing ratio:
real, parameter :: svp1=611.2
real, parameter :: svp2=17.67
real, parameter :: svp3=29.65
real, parameter :: svpt0=273.15
real, parameter :: eps = 0.622
rh = 1.E2 * (p*q/(q*(1.-eps) + eps))/(svp1*exp(svp2*(t-svpt0)/(T-svp3)))
Note that t (temperature), p (pressure) and q (mixing ratio) are output variables in wrfout.

#### ensiyeh

##### New member
Hi Ming,

Thank you for your reply. At this formula, is t equal T2 and q equal Q2 in wrfoutput file? What about P? Which P in wrfoutput file will use for calculation? Could you guide me, please?
Thank you

#### Ming Chen

##### Moderator
Staff member
T is temperature, Q is water vapor mixing ratio, P is pressure.They are are available in wrfoiut files.