1 | SUBROUTINE CV3_BUOY (nloc,ncum,nd,icb,inb |
---|
2 | : ,pbase,plcl,p,ph,Ale,Cin |
---|
3 | : ,tv,tvp |
---|
4 | : ,buoy ) |
---|
5 | *************************************************************** |
---|
6 | * * |
---|
7 | * CV3_BUOY * |
---|
8 | * Buoyancy corrections to account for ALE * |
---|
9 | * * |
---|
10 | * written by : MOREAU Cecile, 07/08/2003, 15.55.48 * |
---|
11 | * modified by : * |
---|
12 | *************************************************************** |
---|
13 | * |
---|
14 | implicit none |
---|
15 | |
---|
16 | #include "cvthermo.h" |
---|
17 | #include "cv3param.h" |
---|
18 | |
---|
19 | c input: |
---|
20 | integer ncum, nd, nloc |
---|
21 | integer icb(nloc), inb(nloc) |
---|
22 | real pbase(nloc),plcl(nloc) |
---|
23 | real p(nloc,nd), ph(nloc,nd+1) |
---|
24 | real Ale(nloc), Cin(nloc) |
---|
25 | real tv(nloc,nd), tvp(nloc,nd) |
---|
26 | |
---|
27 | c output: |
---|
28 | real buoy(nloc,nd) |
---|
29 | |
---|
30 | c local variables: |
---|
31 | integer il, k |
---|
32 | integer kmx(nloc) |
---|
33 | real bll(nloc), bmx(nloc) |
---|
34 | real gamma(nloc) |
---|
35 | real dgamma |
---|
36 | real buoymin |
---|
37 | logical ok(nloc) |
---|
38 | |
---|
39 | data dgamma /2.e-03/ !dgamma gamma |
---|
40 | data buoymin /2./ |
---|
41 | |
---|
42 | c print *,' Ale+cin ',ale(1)+cin(1) |
---|
43 | c-------------------------------------------------------------- |
---|
44 | c Recompute buoyancies |
---|
45 | c-------------------------------------------------------------- |
---|
46 | DO k = 1,nl |
---|
47 | DO il = 1,ncum |
---|
48 | buoy(il,k) = tvp(il,k) - tv(il,k) |
---|
49 | ENDDO |
---|
50 | ENDDO |
---|
51 | |
---|
52 | c ------------------------------------------------------------- |
---|
53 | c -- Compute low level buoyancy ( function of Ale+Cin ) |
---|
54 | c ------------------------------------------------------------- |
---|
55 | |
---|
56 | do il = 1,ncum |
---|
57 | bll(il) = 0. |
---|
58 | end do |
---|
59 | |
---|
60 | do il = 1,ncum |
---|
61 | IF (Ale(il)+Cin(il) .GT. 0.) THEN |
---|
62 | gamma(il) = 4.*buoy(il,icb(il))**2 |
---|
63 | : + 8.*dgamma*(Ale(il)+Cin(il))*tv(il,icb(il))/grav |
---|
64 | gamma(il) = max(gamma(il),1.e-10) |
---|
65 | ENDIF |
---|
66 | end do |
---|
67 | |
---|
68 | do il = 1,ncum |
---|
69 | IF (Ale(il)+Cin(il) .GT. 0.) THEN |
---|
70 | bll(il) = 4.*dgamma*(Ale(il)+Cin(il))*tv(il,icb(il)) |
---|
71 | : /(grav*(abs(buoy(il,icb(il))+0.5*sqrt(gamma(il))))) |
---|
72 | ENDIF |
---|
73 | end do |
---|
74 | |
---|
75 | do il = 1,ncum |
---|
76 | IF (Ale(il)+Cin(il) .GT. 0.) THEN |
---|
77 | bll(il) = min(bll(il),buoymin) |
---|
78 | ENDIF |
---|
79 | end do |
---|
80 | |
---|
81 | c ------------------------------------------------------------- |
---|
82 | c --Get highest buoyancy among levels below LCL-200hPa |
---|
83 | c ------------------------------------------------------------- |
---|
84 | |
---|
85 | do il = 1,ncum |
---|
86 | bmx(il) =-1000. |
---|
87 | kmx(il) = icb(il) |
---|
88 | ok(il) = .true. |
---|
89 | end do |
---|
90 | |
---|
91 | do k = 1,nl |
---|
92 | do il = 1,ncum |
---|
93 | IF (Ale(il)+Cin(il) .GT. 0. .AND. ok(il)) THEN |
---|
94 | IF (k .GT. icb(il) .AND. k .LE. inb(il)) THEN |
---|
95 | cc print *,'k,p(il,k),plcl(il)-200. ', k,p(il,k),plcl(il)-200. |
---|
96 | IF (P(il,k) .GT. plcl(il)-200.) THEN |
---|
97 | IF (buoy(il,k) .GT. bmx(il)) THEN |
---|
98 | bmx(il) = buoy(il,k) |
---|
99 | kmx(il) = k |
---|
100 | IF (bmx(il) .GE. bll(il)) ok(il)=.false. |
---|
101 | ENDIF |
---|
102 | ENDIF |
---|
103 | ENDIF |
---|
104 | ENDIF |
---|
105 | end do |
---|
106 | end do |
---|
107 | |
---|
108 | c print *,' ==cv3_buoy== bll(1),bmx(1),icb(1),kmx(1) ' |
---|
109 | c $ ,bll(1),bmx(1),icb(1),kmx(1) |
---|
110 | |
---|
111 | c ------------------------------------------------------------- |
---|
112 | c --Calculate modified buoyancies |
---|
113 | c ------------------------------------------------------------- |
---|
114 | |
---|
115 | do il = 1,ncum |
---|
116 | IF (Ale(il)+Cin(il) .GT. 0.) THEN |
---|
117 | bll(il) = min(bll(il),bmx(il)) |
---|
118 | ENDIF |
---|
119 | end do |
---|
120 | |
---|
121 | do k = 1,nl |
---|
122 | do il = 1,ncum |
---|
123 | IF (Ale(il)+Cin(il) .GT. 0.) THEN |
---|
124 | IF (k .GE. icb(il) .AND. k .LE. kmx(il)-1) THEN |
---|
125 | buoy(il,k) = bll(il) |
---|
126 | ENDIF |
---|
127 | ENDIF |
---|
128 | end do |
---|
129 | end do |
---|
130 | |
---|
131 | |
---|
132 | |
---|
133 | RETURN |
---|
134 | END |
---|