/[lmdze]/trunk/phylmd/CV3_routines/cv3_feed.f
ViewVC logotype

Contents of /trunk/phylmd/CV3_routines/cv3_feed.f

Parent Directory Parent Directory | Revision Log Revision Log


Revision 103 - (show annotations)
Fri Aug 29 13:00:05 2014 UTC (9 years, 8 months ago) by guez
File size: 2878 byte(s)
Renamed module cvparam to cv_param. Deleted procedure
cv_param. Changed variables of module cv_param into parameters.

In procedures cv_driver, cv_uncompress and cv3_uncompress, removed
some arguments giving dimensions and used module variables klon and
klev instead.

In procedures gradiv2, laplacien_gam and laplacien, changed
declarations of local variables because klevel is not always klev.

Removed code for nudging surface pressure.

Removed arguments pim and pjm of tau2alpha. Added assignment of false
to variable first.

Replaced real argument del of procedures foeew and FOEDE by logical
argument.

1 module cv3_feed_m
2
3 implicit none
4
5 contains
6
7 SUBROUTINE cv3_feed(len, nd, t, q, qs, p, ph, hm, gz, nk, icb, icbmax, &
8 iflag, tnk, qnk, gznk, plcl)
9
10 ! Purpose: CONVECTIVE FEED
11
12 ! Main differences with cv_feed:
13 ! - ph added in input
14 ! - here, nk(i)=minorig
15 ! - icb defined differently (plcl compared with ph instead of p)
16
17 ! Main differences with convect3:
18 ! - we do not compute dplcldt and dplcldr of CLIFT anymore
19 ! - values iflag different (but tests identical)
20 ! - A, B explicitely defined (!)
21
22 use cv3_param_m
23
24 ! inputs:
25 integer, intent(in):: len, nd
26 real, intent(in):: t(len, nd)
27 real, intent(in):: q(len, nd), qs(len, nd), p(len, nd)
28 real hm(len, nd), gz(len, nd)
29 real, intent(in):: ph(len, nd+1)
30
31 ! outputs:
32 integer iflag(len)
33 integer, intent(out):: nk(len), icb(len), icbmax
34 real tnk(len), qnk(len), gznk(len), plcl(len)
35
36 ! local variables:
37 integer i, k
38 integer ihmin(len)
39 real work(len)
40 real pnk(len), qsnk(len), rh(len), chi(len)
41 real A, B ! convect3
42
43 !--------------------------------------------------------------------
44
45 plcl=0.0
46
47 ! --- Origin level of ascending parcels for convect3:
48
49 do i=1, len
50 nk(i)=minorig
51 end do
52
53 ! --- Check whether parcel level temperature and specific humidity
54 ! --- are reasonable
55
56 do i=1, len
57 if ((t(i, nk(i)) < 250. .or. q(i, nk(i)) <= 0.) .and. iflag(i) == 0) &
58 iflag(i)=7
59 end do
60
61 ! --- Calculate lifted condensation level of air at parcel origin level
62 ! --- (Within 0.2% of formula of Bolton, MON. WEA. REV., 1980)
63
64 A = 1669.0 ! convect3
65 B = 122.0 ! convect3
66
67 do i=1, len
68 if (iflag(i).ne.7) then
69 tnk(i)=t(i, nk(i))
70 qnk(i)=q(i, nk(i))
71 gznk(i)=gz(i, nk(i))
72 pnk(i)=p(i, nk(i))
73 qsnk(i)=qs(i, nk(i))
74
75 rh(i)=qnk(i)/qsnk(i)
76 chi(i)=tnk(i)/(A-B*rh(i)-tnk(i)) ! convect3
77 plcl(i)=pnk(i)*(rh(i)**chi(i))
78 if ((plcl(i) < 200. .or. plcl(i) >= 2000.) .and. iflag(i) == 0) &
79 iflag(i) = 8
80 endif
81 end do
82
83 ! --- Calculate first level above lcl (=icb)
84
85 do i=1, len
86 icb(i)=nlm
87 end do
88
89 ! la modification consiste a comparer plcl a ph et non a p:
90 ! icb est defini par : ph(icb) < plcl < ph(icb - 1)
91 do k=3, nl-1 ! modification pour que icb soit supérieur ou égal à 2
92 do i=1, len
93 if(ph(i, k) < plcl(i)) icb(i) = min(icb(i), k)
94 end do
95 end do
96
97 do i=1, len
98 if((icb(i) == nlm).and.(iflag(i) == 0))iflag(i)=9
99 end do
100
101 do i=1, len
102 icb(i) = icb(i)-1 ! icb sup ou egal a 2
103 end do
104
105 ! Compute icbmax.
106
107 icbmax=2
108 do i=1, len
109 if (iflag(i) < 7) icbmax=max(icbmax, icb(i)) ! sb Jun7th02
110 end do
111
112 end SUBROUTINE cv3_feed
113
114 end module cv3_feed_m

  ViewVC Help
Powered by ViewVC 1.1.21