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

Annotation of /trunk/dyn3d/q_sat.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3 - (hide annotations)
Wed Feb 27 13:16:39 2008 UTC (16 years, 3 months ago) by guez
Original Path: trunk/libf/dyn3d/q_sat.f90
File size: 1172 byte(s)
Initial import
1 guez 3 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     ! Authors : 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 hPa
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