source: LMDZ5/branches/LMDZ5_SPLA/libf/phylmd/tilft43.F90 @ 2699

Last change on this file since 2699 was 1992, checked in by lguez, 11 years ago

Converted to free source form files in libf/phylmd which were still in
fixed source form. The conversion was done using the polish mode of
the NAG Fortran Compiler.

In addition to converting to free source form, the processing of the
files also:

-- indented the code (including comments);

-- set Fortran keywords to uppercase, and set all other identifiers
to lower case;

-- added qualifiers to end statements (for example "end subroutine
conflx", instead of "end");

-- changed the terminating statements of all DO loops so that each
loop ends with an ENDDO statement (instead of a labeled continue).

-- replaced #include by include.

  • 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: 2.1 KB
Line 
1
2! $Header$
3
4SUBROUTINE tlift43(p, t, q, qs, gz, icb, nk, tvp, tpk, clw, nd, nl, kk)
5  REAL gz(nd), tpk(nd), clw(nd), p(nd)
6  REAL t(nd), q(nd), qs(nd), tvp(nd), lv0
7
8  ! ***   ASSIGN VALUES OF THERMODYNAMIC CONSTANTS     ***
9
10  ! -- sb:
11  ! !      CPD=1005.7
12  ! !      CPV=1870.0
13  ! !      CL=4190.0
14  ! !      RV=461.5
15  ! !      RD=287.04
16  ! !      LV0=2.501E6
17  ! !      G=9.8
18  ! !      ROWL=1000.0
19  ! ajouts:
20  include "YOMCST.h"
21  cpd = rcpd
22  cpv = rcpv
23  cl = rcw
24  lv0 = rlvtt
25  g = rg
26  rowl = ratm/100.
27  gravity = rg !sb: Pr que gravite ne devienne pas humidite!
28  ! sb --
29
30  cpvmcl = cl - cpv
31  eps = rd/rv
32  epsi = 1./eps
33
34  ! ***  CALCULATE CERTAIN PARCEL QUANTITIES, INCLUDING STATIC ENERGY   ***
35
36  ah0 = (cpd*(1.-q(nk))+cl*q(nk))*t(nk) + q(nk)*(lv0-cpvmcl*(t(nk)-273.15)) + &
37    gz(nk)
38  cpp = cpd*(1.-q(nk)) + q(nk)*cpv
39  cpinv = 1./cpp
40
41  IF (kk==1) THEN
42
43    ! ***   CALCULATE LIFTED PARCEL QUANTITIES BELOW CLOUD BASE   ***
44
45    DO i = 1, icb - 1
46      clw(i) = 0.0
47    END DO
48    DO i = nk, icb - 1
49      tpk(i) = t(nk) - (gz(i)-gz(nk))*cpinv
50      tvp(i) = tpk(i)*(1.+q(nk)*epsi)
51    END DO
52  END IF
53
54  ! ***  FIND LIFTED PARCEL QUANTITIES ABOVE CLOUD BASE    ***
55
56  nst = icb
57  nsb = icb
58  IF (kk==2) THEN
59    nst = nl
60    nsb = icb + 1
61  END IF
62  DO i = nsb, nst
63    tg = t(i)
64    qg = qs(i)
65    alv = lv0 - cpvmcl*(t(i)-273.15)
66    DO j = 1, 2
67      s = cpd + alv*alv*qg/(rv*t(i)*t(i))
68      s = 1./s
69      ahg = cpd*tg + (cl-cpd)*q(nk)*t(i) + alv*qg + gz(i)
70      tg = tg + s*(ah0-ahg)
71      tg = max(tg, 35.0)
72      tc = tg - 273.15
73      denom = 243.5 + tc
74      IF (tc>=0.0) THEN
75        es = 6.112*exp(17.67*tc/denom)
76      ELSE
77        es = exp(23.33086-6111.72784/tg+0.15215*log(tg))
78      END IF
79      qg = eps*es/(p(i)-es*(1.-eps))
80    END DO
81    alv = lv0 - cpvmcl*(t(i)-273.15)
82    tpk(i) = (ah0-(cl-cpd)*q(nk)*t(i)-gz(i)-alv*qg)/cpd
83    clw(i) = q(nk) - qg
84    clw(i) = max(0.0, clw(i))
85    rg = qg/(1.-q(nk))
86    tvp(i) = tpk(i)*(1.+rg*epsi)
87  END DO
88
89  ! -- sb:
90  rg = gravity ! RG redevient la gravite de YOMCST (sb)
91  ! sb --
92
93  RETURN
94END SUBROUTINE tlift43
95
Note: See TracBrowser for help on using the repository browser.