/[lmdze]/trunk/Sources/phylmd/cv_driver.f
ViewVC logotype

Diff of /trunk/Sources/phylmd/cv_driver.f

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 200 by guez, Tue May 31 16:17:35 2016 UTC revision 201 by guez, Mon Jun 6 17:42:15 2016 UTC
# Line 28  contains Line 28  contains
28      use cv30_undilute2_m, only: cv30_undilute2      use cv30_undilute2_m, only: cv30_undilute2
29      use cv30_unsat_m, only: cv30_unsat      use cv30_unsat_m, only: cv30_unsat
30      use cv30_yield_m, only: cv30_yield      use cv30_yield_m, only: cv30_yield
     use cv_thermo_m, only: cv_thermo  
31      USE dimphy, ONLY: klev, klon      USE dimphy, ONLY: klev, klon
32    
33      real, intent(in):: t1(klon, klev) ! temperature (K)      real, intent(in):: t1(klon, klev) ! temperature, in K
34      real, intent(in):: q1(klon, klev) ! specific humidity      real, intent(in):: q1(klon, klev) ! specific humidity
35      real, intent(in):: qs1(klon, klev) ! saturation specific humidity      real, intent(in):: qs1(klon, klev) ! saturation specific humidity
36    
37      real, intent(in):: u1(klon, klev), v1(klon, klev)      real, intent(in):: u1(klon, klev), v1(klon, klev)
38      ! zonal wind and meridional velocity (m/s)      ! zonal wind and meridional velocity (m/s)
39    
40      real, intent(in):: p1(klon, klev) ! full level pressure (hPa)      real, intent(in):: p1(klon, klev) ! full level pressure, in hPa
41    
42      real, intent(in):: ph1(klon, klev + 1)      real, intent(in):: ph1(klon, klev + 1)
43      ! Half level pressure (hPa). These pressures are defined at levels      ! Half level pressure, in hPa. These pressures are defined at levels
44      ! intermediate between those of P1, T1, Q1 and QS1. The first      ! intermediate between those of P1, T1, Q1 and QS1. The first
45      ! value of PH should be greater than (i.e. at a lower level than)      ! value of PH should be greater than (i.e. at a lower level than)
46      ! the first value of the array P1.      ! the first value of the array P1.
# Line 106  contains Line 105  contains
105    
106      ! Local:      ! Local:
107    
108      real da(klon, klev), phi(klon, klev, klev), mp(klon, klev)      real da(klon, klev), phi(klon, klev, klev)
109        real, allocatable:: mp(:, :) ! (ncum, nl)
110      integer i, k, il      integer i, k, il
111      integer icbs1(klon)      integer icbs1(klon)
112      real plcl1(klon)      real plcl1(klon)
# Line 115  contains Line 115  contains
115      real gznk1(klon)      real gznk1(klon)
116      real pbase1(klon)      real pbase1(klon)
117      real buoybase1(klon)      real buoybase1(klon)
118      real lv1(klon, klev)  
119      real cpn1(klon, klev)      real lv1(klon, nl)
120        ! specific latent heat of vaporization of water, in J kg-1
121    
122        real cpn1(klon, nl)
123        ! specific heat capacity at constant pressure of humid air, in J K-1 kg-1
124    
125      real tv1(klon, klev)      real tv1(klon, klev)
126      real gz1(klon, klev)      real gz1(klon, klev)
127      real hm1(klon, klev)      real hm1(klon, klev)
# Line 124  contains Line 129  contains
129      real tp1(klon, klev)      real tp1(klon, klev)
130      real tvp1(klon, klev)      real tvp1(klon, klev)
131      real clw1(klon, klev)      real clw1(klon, klev)
132      real th1(klon, klev)      real th1(klon, nl) ! potential temperature, in K
133      integer ncum      integer ncum
134    
135      ! Compressed fields:      ! Compressed fields:
# Line 132  contains Line 137  contains
137      integer, allocatable:: icb(:) ! (ncum)      integer, allocatable:: icb(:) ! (ncum)
138      integer nent(klon, klev)      integer nent(klon, klev)
139      integer icbs(klon)      integer icbs(klon)
140      integer inb(klon)  
141        integer, allocatable:: inb(:) ! (ncum)
142        ! first model level above the level of neutral buoyancy of the
143        ! parcel (1 <= inb <= nl - 1)
144    
145      real, allocatable:: plcl(:) ! (ncum)      real, allocatable:: plcl(:) ! (ncum)
146      real tnk(klon), qnk(klon), gznk(klon)      real tnk(klon), qnk(klon), gznk(klon)
147      real t(klon, klev), q(klon, klev), qs(klon, klev)      real t(klon, klev), q(klon, klev), qs(klon, klev)
148      real u(klon, klev), v(klon, klev)      real u(klon, klev), v(klon, klev)
149      real gz(klon, klev), h(klon, klev), lv(klon, klev), cpn(klon, klev)      real gz(klon, klev), h(klon, klev)
150    
151        real, allocatable:: lv(:, :) ! (ncum, nl)
152        ! specific latent heat of vaporization of water, in J kg-1
153    
154        real, allocatable:: cpn(:, :) ! (ncum, nl)
155        ! specific heat capacity at constant pressure of humid air, in J K-1 kg-1
156    
157      real p(klon, klev) ! pressure at full level, in hPa      real p(klon, klev) ! pressure at full level, in hPa
158      real ph(klon, klev + 1), tv(klon, klev), tp(klon, klev)      real ph(klon, klev + 1), tv(klon, klev), tp(klon, klev)
159      real clw(klon, klev)      real clw(klon, klev)
160      real pbase(klon), buoybase(klon), th(klon, klev)      real pbase(klon), buoybase(klon)
161        real, allocatable:: th(:, :) ! (ncum, nl)
162      real tvp(klon, klev)      real tvp(klon, klev)
163      real sig(klon, klev), w0(klon, klev)      real sig(klon, klev), w0(klon, klev)
164      real hp(klon, klev), ep(klon, klev)      real hp(klon, klev), ep(klon, klev)
# Line 167  contains Line 184  contains
184      !-------------------------------------------------------------------      !-------------------------------------------------------------------
185    
186      ! SET CONSTANTS AND PARAMETERS      ! SET CONSTANTS AND PARAMETERS
     CALL cv_thermo  
187      CALL cv30_param      CALL cv30_param
188    
189      ! INITIALIZE OUTPUT ARRAYS AND PARAMETERS      ! INITIALIZE OUTPUT ARRAYS AND PARAMETERS
# Line 213  contains Line 229  contains
229    
230      IF (ncum > 0) THEN      IF (ncum > 0) THEN
231         ! Moist convective adjustment is necessary         ! Moist convective adjustment is necessary
232         allocate(idcum(ncum), plcl(ncum))         allocate(idcum(ncum), plcl(ncum), inb(ncum))
233         allocate(b(ncum, nl - 1), evap(ncum, nl), icb(ncum), iflag(ncum))         allocate(b(ncum, nl - 1), evap(ncum, nl), icb(ncum), iflag(ncum))
234           allocate(th(ncum, nl), lv(ncum, nl), cpn(ncum, nl), mp(ncum, nl))
235         idcum = pack((/(i, i = 1, klon)/), iflag1 == 0)         idcum = pack((/(i, i = 1, klon)/), iflag1 == 0)
236         CALL cv30_compress(iflag1, icb1, icbs1, plcl1, tnk1, qnk1, gznk1, &         CALL cv30_compress(idcum, iflag1, icb1, icbs1, plcl1, tnk1, qnk1, &
237              pbase1, buoybase1, t1, q1, qs1, u1, v1, gz1, th1, h1, lv1, cpn1, &              gznk1, pbase1, buoybase1, t1, q1, qs1, u1, v1, gz1, th1, h1, lv1, &
238              p1, ph1, tv1, tp1, tvp1, clw1, sig1, w01, icb, icbs, plcl, tnk, &              cpn1, p1, ph1, tv1, tp1, tvp1, clw1, sig1, w01, icb, icbs, plcl, &
239              qnk, gznk, pbase, buoybase, t, q, qs, u, v, gz, th, h, lv, cpn, &              tnk, qnk, gznk, pbase, buoybase, t, q, qs, u, v, gz, th, h, lv, &
240              p, ph, tv, tp, tvp, clw, sig, w0)              cpn, p, ph, tv, tp, tvp, clw, sig, w0)
241         CALL cv30_undilute2(icb, icbs(:ncum), tnk, qnk, gznk, t, qs, gz, p, h, &         CALL cv30_undilute2(icb, icbs(:ncum), tnk, qnk, gznk, t, qs, gz, p, h, &
242              tv, lv, pbase(:ncum), buoybase(:ncum), plcl, inb(:ncum), tp, tvp, &              tv, lv, pbase(:ncum), buoybase(:ncum), plcl, inb, tp, tvp, &
243              clw, hp, ep, buoy)              clw, hp, ep, buoy)
244         CALL cv30_closure(icb, inb(:ncum), pbase, p, ph(:ncum, :), tv, buoy, &         CALL cv30_closure(icb, inb, pbase, p, ph(:ncum, :), tv, buoy, &
245              sig, w0, cape, m)              sig, w0, cape, m)
246         CALL cv30_mixing(icb, inb(:ncum), t, q, qs, u, v, h, lv, hp, ep, clw, &         CALL cv30_mixing(icb, inb, t, q, qs, u, v, h, lv, &
247              m, sig, ment, qent, uent, vent, nent, sij, elij, ments, qents)              hp, ep, clw, m, sig, ment, qent, uent, vent, nent, sij, elij, &
248         CALL cv30_unsat(icb, inb(:ncum), t(:ncum, :nl), q(:ncum, :nl), &              ments, qents)
249           CALL cv30_unsat(icb, inb, t(:ncum, :nl), q(:ncum, :nl), &
250              qs(:ncum, :nl), gz, u(:ncum, :nl), v(:ncum, :nl), p, &              qs(:ncum, :nl), gz, u(:ncum, :nl), v(:ncum, :nl), p, &
251              ph(:ncum, :), th(:ncum, :nl - 1), tv, lv(:ncum, :), &              ph(:ncum, :), th(:ncum, :nl - 1), tv, lv, cpn, ep(:ncum, :), &
252              cpn(:ncum, :nl), ep(:ncum, :), clw(:ncum, :), m(:ncum, :), &              clw(:ncum, :), m(:ncum, :), ment(:ncum, :, :), elij(:ncum, :, :), &
253              ment(:ncum, :, :), elij(:ncum, :, :), dtphys, plcl, mp, &              dtphys, plcl, mp, qp(:ncum, :nl), up(:ncum, :nl), vp(:ncum, :nl), &
254              qp(:ncum, :nl), up(:ncum, :nl), vp(:ncum, :nl), wt(:ncum, :nl), &              wt(:ncum, :nl), water(:ncum, :nl), evap, b)
255              water(:ncum, :nl), evap, b)         CALL cv30_yield(icb, inb, dtphys, t, q, u, v, gz, p, ph, h, hp, &
        CALL cv30_yield(icb, inb(:ncum), dtphys, t, q, u, v, gz, p, ph, h, hp, &  
256              lv, cpn, th, ep, clw, m, tp, mp, qp, up, vp(:ncum, 2:nl), &              lv, cpn, th, ep, clw, m, tp, mp, qp, up, vp(:ncum, 2:nl), &
257              wt(:ncum, :nl - 1), water(:ncum, :nl), evap, b, ment, qent, uent, &              wt(:ncum, :nl - 1), water(:ncum, :nl), evap, b, ment, qent, uent, &
258              vent, nent, elij, sig, tv, tvp, iflag, precip, VPrecip, ft, fq, &              vent, nent, elij, sig, tv, tvp, iflag, precip, VPrecip, ft, fq, &

Legend:
Removed from v.200  
changed lines
  Added in v.201

  ViewVC Help
Powered by ViewVC 1.1.21