source: LMDZ6/branches/Amaury_dev/libf/misc/lmdz_q_sat.f90 @ 5229

Last change on this file since 5229 was 5158, checked in by abarral, 4 months ago

Add missing klon on strataer_emiss_mod.F90
Correct various missing explicit declarations
Replace tabs by spaces (tabs are not part of the fortran charset)
Continue cleaning modules
Removed unused arguments and variables

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.7 KB
Line 
1! $Header$
2
3MODULE lmdz_q_sat
4  IMPLICIT NONE; PRIVATE
5  PUBLIC q_sat
6CONTAINS
7  SUBROUTINE q_sat(np, temp, pres, qsat)
8
9    IMPLICIT NONE
10    !======================================================================
11    ! Autheur(s): Z.X. Li (LMD/CNRS)
12    !  reecriture vectorisee par F. Hourdin.
13    ! Objet: calculer la vapeur d'eau saturante (formule Centre Euro.)
14    !======================================================================
15    ! Arguments:
16    ! kelvin---input-R: temperature en Kelvin
17    ! millibar--input-R: pression en mb
18
19    ! q_sat----output-R: vapeur d'eau saturante en kg/kg
20    !======================================================================
21
22    INTEGER :: np
23    REAL :: temp(np), pres(np), qsat(np)
24
25    REAL :: r2es
26    PARAMETER (r2es = 611.14 * 18.0153 / 28.9644)
27
28    REAL :: r3les, r3ies, r3es
29    PARAMETER (R3LES = 17.269)
30    PARAMETER (R3IES = 21.875)
31
32    REAL :: r4les, r4ies, r4es
33    PARAMETER (R4LES = 35.86)
34    PARAMETER (R4IES = 7.66)
35
36    REAL :: rtt
37    PARAMETER (rtt = 273.16)
38
39    REAL :: retv
40    PARAMETER (retv = 28.9644 / 18.0153 - 1.0)
41
42    REAL :: zqsat
43    INTEGER :: ip
44
45    ! ------------------------------------------------------------------
46
47    DO ip = 1, np
48
49      ! WRITE(*,*)'kelvin,millibar=',kelvin,millibar
50      !  WRITE(*,*)'temp,pres=',temp(ip),pres(ip)
51
52      IF (temp(ip) <= rtt) THEN
53        r3es = r3ies
54        r4es = r4ies
55      ELSE
56        r3es = r3les
57        r4es = r4les
58      END IF
59
60      zqsat = r2es / pres(ip) * EXP(r3es * (temp(ip) - rtt) / (temp(ip) - r4es))
61      zqsat = MIN(0.5, ZQSAT)
62      zqsat = zqsat / (1. - retv * zqsat)
63
64      qsat(ip) = zqsat
65      ! WRITE(*,*)'qsat=',qsat(ip)
66
67    END DO
68
69  END SUBROUTINE q_sat
70END MODULE lmdz_q_sat
Note: See TracBrowser for help on using the repository browser.