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

Contents of /trunk/dyn3d/q_sat.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 38 - (show annotations)
Thu Jan 6 17:52:19 2011 UTC (13 years, 4 months ago) by guez
Original Path: trunk/libf/dyn3d/q_sat.f90
File size: 1170 byte(s)
Extracted ASCII art from "inigeom" into a separate text file in the
documentation.

"test_disvert" now creates a separate file for layer thicknesses.

Moved variables from module "yomcst" to module "suphec_m" because this
is where those variables are defined. Kept in "yomcst" only parameters
of Earth orbit. Gave the attribute "parameter" to some variables of
module "suphec_m".

Variables of module "yoethf" were defined in procedure "suphec". Moved
these definitions to a new procedure "yoethf" in module "yoethf_m".

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 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