qair2rh.html 4.27 KB
 Pierre Cazenave committed Dec 07, 2015 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 `````` Description of qair2rh
Home > utilities > qair2rh.m

qair2rh

PURPOSE

Convert specific humitidy to relative humidity.

SYNOPSIS

function rh = qair2rh(qair, temp, press)

DESCRIPTION

Convert specific humitidy to relative humidity.   INPUTS:    qair - Specific humidity. Dimensionless ratio of water mass /        total air mass (0-1).    temp - Temperature. Celsius.    press - Pressure, optional. Millibar. Assume as 1013.25 if        missing.   OUTPUT:    rh  - relative humidity, ratio of actual water mixing ratio to        saturation mixing ratio.   NOTES:    Translated from the R code here:        http://earthscience.stackexchange.com/questions/2360   Author(s):    Pierre Cazenave (Plymouth Marine Laboratory)

CROSS-REFERENCE INFORMATION

This function calls:
This function is called by:

SOURCE CODE

0001 function rh = qair2rh(qair, temp, press) 0002 % Convert specific humitidy to relative humidity. 0003 % 0004 % INPUTS: 0005 %   qair - Specific humidity. Dimensionless ratio of water mass / 0006 %       total air mass (0-1). 0007 %   temp - Temperature. Celsius. 0008 %   press - Pressure, optional. Millibar. Assume as 1013.25 if 0009 %       missing. 0010 % 0011 % OUTPUT: 0012 %   rh  - relative humidity, ratio of actual water mixing ratio to 0013 %       saturation mixing ratio. 0014 % 0015 % NOTES: 0016 %   Translated from the R code here: 0017 %       http://earthscience.stackexchange.com/questions/2360 0018 % 0019 % Author(s): 0020 %   Pierre Cazenave (Plymouth Marine Laboratory) 0021  0022 if nargin == 2 0023     press = 1013.25; 0024 end 0025 es = 6.112 .* exp((17.67 .* temp) ./ (temp + 243.5)); 0026 e = qair .* press ./ (0.378 .* qair + 0.622); 0027 rh = e ./ es; 0028 rh(rh > 1) = 1; 0029 rh(rh < 0) = 0;
`````` Pierre Cazenave committed Feb 20, 2019 92 ``````
Generated on Wed 20-Feb-2019 16:06:01 by m2html © 2005
`````` Pierre Cazenave committed Dec 07, 2015 93 94 `````` ``````