/[lmdze]/trunk/dyn3d/q_sat.f
ViewVC logotype

Contents of /trunk/dyn3d/q_sat.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 254 - (show annotations)
Mon Feb 5 10:39:38 2018 UTC (6 years, 3 months ago) by guez
File size: 1168 byte(s)
Move Sources/* to root directory.
1 module q_sat_m
2
3 IMPLICIT none
4
5 contains
6
7 elemental real function q_sat(temp, pres)
8
9 ! From dyn3d/q_sat.F, version 1.1.1.1 2004/05/19 12:53:05
10
11 ! Author: Z. X. Li (LMD/CNRS).
12 ! Récriture vectorisée par F. Hourdin.
13 ! This procedure computes the mass fraction of saturating water
14 ! vapor, with the formula of ECMWF.
15
16 REAL, intent(in):: temp ! temperature, in K
17 REAL, intent(in):: pres ! total pressure, in Pa
18
19 ! Variables local to the procedure:
20
21 REAL, PARAMETER:: r2es = 611.14 * 18.0153 / 28.9644
22
23 REAL r3es
24 REAL, PARAMETER:: R3LES=17.269
25 REAL, PARAMETER:: R3IES=21.875
26
27 REAL r4es
28 REAL, PARAMETER:: R4LES=35.86
29 REAL, PARAMETER:: R4IES=7.66
30
31 REAL, PARAMETER:: rtt = 273.16
32 REAL, PARAMETER:: retv = 28.9644 / 18.0153 - 1.
33
34 !------------------------------------------------------------------
35
36 IF (temp <= rtt) THEN
37 r3es = r3ies
38 r4es = r4ies
39 ELSE
40 r3es = r3les
41 r4es = r4les
42 ENDIF
43
44 q_sat = r2es / pres * EXP(r3es * (temp - rtt) / (temp - r4es))
45 q_sat = MIN(0.5, q_sat)
46 q_sat = q_sat / (1. - retv * q_sat)
47
48 END function q_sat
49
50 end module q_sat_m

  ViewVC Help
Powered by ViewVC 1.1.21