Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
fvcom-toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
FVCOM
fvcom-toolbox
Commits
87e6698d
Commit
87e6698d
authored
May 15, 2015
by
Pierre Cazenave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Function to convert from specific humidity to relative humidity.
parent
0ed5eb78
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
utilities/qair2rh.m
utilities/qair2rh.m
+29
-0
No files found.
utilities/qair2rh.m
0 → 100644
View file @
87e6698d
function
rh
=
qair2rh
(
qair
,
temp
,
varargin
)
% Convert specific humitidy to relative humidity.
%
% INPUTS:
% qair - Specific humidity. Dimensionless ratio of water mass /
% total air mass.
% 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)
if
nargin
==
2
press
=
1013.25
;
end
es
=
6.112
*
exp
((
17.67
*
temp
)
/
(
temp
+
243.5
));
e
=
qair
*
press
/
(
0.378
*
qair
+
0.622
);
rh
=
e
/
es
;
rh
(
rh
>
1
)
=
1
;
rh
(
rh
<
0
)
=
0
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment