/[MITgcm]/MITgcm/pkg/aim_v23/phy_convmf.F
ViewVC logotype

Contents of /MITgcm/pkg/aim_v23/phy_convmf.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Fri Nov 22 17:17:03 2002 UTC (21 years, 5 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint51k_post, checkpoint47e_post, checkpoint57m_post, checkpoint52l_pre, hrcube4, hrcube5, checkpoint57g_pre, checkpoint50c_post, checkpoint57s_post, checkpoint58b_post, checkpoint57b_post, checkpoint52d_pre, checkpoint57g_post, checkpoint48e_post, checkpoint56b_post, checkpoint50c_pre, checkpoint57y_post, checkpoint52j_pre, checkpoint51o_pre, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint54d_post, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint54e_post, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62c, checkpoint51l_post, checkpoint48i_post, checkpoint57r_post, checkpoint57d_post, checkpoint57i_post, checkpoint50d_pre, checkpoint52k_post, checkpoint59, checkpoint58, checkpoint55, checkpoint54, checkpoint57, checkpoint56, checkpoint51, checkpoint50, checkpoint53, checkpoint52, checkpoint50d_post, checkpoint58f_post, checkpoint52f_post, checkpoint57n_post, checkpoint58d_post, checkpoint58a_post, checkpoint50b_pre, checkpoint57z_post, checkpoint54f_post, checkpoint51f_post, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint58y_post, checkpoint48b_post, checkpoint51d_post, checkpoint48c_pre, checkpoint47d_pre, checkpoint51t_post, checkpoint58t_post, checkpoint51n_post, checkpoint55i_post, checkpoint58m_post, checkpoint57l_post, checkpoint52i_pre, hrcube_1, hrcube_2, hrcube_3, checkpoint51s_post, checkpoint47a_post, checkpoint57t_post, checkpoint55c_post, checkpoint48d_pre, checkpoint51j_post, checkpoint47i_post, checkpoint52e_pre, checkpoint57v_post, checkpoint57f_post, checkpoint52e_post, checkpoint51n_pre, checkpoint47d_post, checkpoint53d_post, checkpoint64, checkpoint65, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint57a_post, checkpoint48d_post, checkpoint57h_pre, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint48f_post, checkpoint52b_pre, checkpoint54b_post, checkpoint58w_post, checkpoint57h_post, checkpoint51l_pre, checkpoint52m_post, checkpoint57y_pre, checkpoint55g_post, checkpoint48h_post, checkpoint51q_post, checkpoint51b_pre, checkpoint47g_post, checkpoint52b_post, checkpoint52c_post, checkpoint51h_pre, checkpoint58o_post, checkpoint48a_post, checkpoint57c_post, checkpoint50f_post, checkpoint50a_post, checkpoint50f_pre, checkpoint58p_post, checkpoint58q_post, checkpoint52f_pre, checkpoint55d_post, checkpoint58e_post, checkpoint47j_post, checkpoint54a_pre, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint53c_post, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint55d_pre, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, branch-exfmods-tag, branchpoint-genmake2, checkpoint54a_post, checkpoint55h_post, checkpoint58n_post, checkpoint51r_post, checkpoint48c_post, checkpoint51i_post, checkpoint57e_post, checkpoint55b_post, checkpoint51b_post, checkpoint51c_post, checkpoint53a_post, checkpoint65o, checkpoint47b_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint55f_post, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint52d_post, checkpoint53g_post, checkpoint57p_post, checkpint57u_post, checkpoint50g_post, checkpoint57q_post, eckpoint57e_pre, checkpoint58k_post, checkpoint52a_pre, checkpoint62b, checkpoint58v_post, checkpoint50h_post, checkpoint52i_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51i_pre, checkpoint52h_pre, checkpoint56a_post, checkpoint64y, checkpoint64x, checkpoint58l_post, checkpoint64z, checkpoint53f_post, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint57h_done, checkpoint52j_post, checkpoint47f_post, checkpoint50e_post, checkpoint57j_post, checkpoint57f_pre, checkpoint61f, checkpoint58g_post, branch-netcdf, checkpoint52l_post, checkpoint58x_post, checkpoint61n, checkpoint52n_post, checkpoint53b_pre, checkpoint58h_post, checkpoint56c_post, checkpoint58j_post, checkpoint51e_post, checkpoint57a_pre, checkpoint55a_post, checkpoint48, checkpoint49, checkpoint57o_post, checkpoint51o_post, checkpoint61q, checkpoint57k_post, checkpoint51f_pre, checkpoint61z, checkpoint53b_post, checkpoint47h_post, checkpoint52a_post, checkpoint57w_post, checkpoint61e, checkpoint58i_post, checkpoint51g_post, ecco_c52_e35, checkpoint57x_post, checkpoint50b_post, checkpoint58c_post, checkpoint58u_post, checkpoint51m_post, checkpoint53d_pre, checkpoint58s_post, checkpoint55e_post, checkpoint61g, checkpoint61d, checkpoint54c_post, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint51a_post, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint51p_post, checkpoint48g_post, checkpoint61x, checkpoint61y, checkpoint51u_post, HEAD
Branch point for: branch-exfmods-curt, branch-genmake2, branch-nonh, tg2-branch, netcdf-sm0, checkpoint51n_branch
new aim pkg: adapted from Franco Molteni SPEEDY code, ver23

1 C $Header: $
2 C $Name: $
3
4 #include "AIM_OPTIONS.h"
5
6 SUBROUTINE CONVMF (PSA,dpFac,SE,QA,QSAT,
7 O IDEPTH,CBMF,PRECNV,DFSE,DFQA,
8 I kGrd,bi,bj,myThid)
9 C--
10 C-- SUBROUTINE CONVMF (PSA,SE,QA,QSAT,
11 C-- * IDEPTH,CBMF,PRECNV,DFSE,DFQA)
12 C--
13 C-- Purpose: Compute convective fluxes of dry static energy and moisture
14 C-- using a simplified mass-flux scheme
15 C-- Input: PSA = norm. surface pressure [p/p0] (2-dim)
16 C dpFac = cell delta_P fraction (3-dim)
17 C-- SE = dry static energy (3-dim)
18 C-- QA = specific humidity [g/kg] (3-dim)
19 C-- QSAT = saturation spec. hum. [g/kg] (3-dim)
20 C-- Output: IDEPTH = convection depth in layers (2-dim)
21 C-- CBMF = cloud-base mass flux (2-dim)
22 C-- PRECNV = convective precipitation [g/(m^2 s)] (2-dim)
23 C-- DFSE = net flux of d.s.en. into each atm. layer (3-dim)
24 C-- DFQA = net flux of sp.hum. into each atm. layer (3-dim)
25 C Input: kGrd = Ground level index (2-dim)
26 C bi,bj = tile index
27 C myThid = Thread number for this instance of the routine
28 C-------
29 C Note: dry static energy has been replaced by Pot.Temp.
30 C-------
31
32 IMPLICIT NONE
33
34 C Resolution parameters
35
36 C-- size for MITgcm & Physics package :
37 #include "AIM_SIZE.h"
38
39 #include "EEPARAMS.h"
40
41 C Physical constants + functions of sigma and latitude
42
43 #include "com_physcon.h"
44
45 C Convection constants
46
47 #include "com_cnvcon.h"
48
49 C-- Routine arguments:
50 _RL PSA(NGP), SE(NGP,NLEV), QA(NGP,NLEV), QSAT(NGP,NLEV)
51 _RL dpFac(NGP,NLEV)
52 INTEGER IDEPTH(NGP)
53 _RL CBMF(NGP), PRECNV(NGP), DFSE(NGP,NLEV), DFQA(NGP,NLEV)
54 INTEGER kGrd(NGP)
55 INTEGER bi,bj,myThid
56
57 #ifdef ALLOW_AIM
58
59 C-- Local variables:
60 INTEGER ITOP(NGP)
61 c_FM REAL SM(NGP,NLEV), QATHR(NGP), ENTR(2:NLEV-1)
62 _RL QATHR(NGP), ENTR(2:NLEV-1)
63 _RL ENTR_PS(NGP,2:NLEV-1), FM0(NGP)
64
65 INTEGER J, K, K1, Ktmp
66 _RL dSEdp(NGP,NLEV), factP, PSA_1
67 _RL dSEdpTot, stab_crit, FDMUS
68 C- jmc: declare all local variables:
69 _RL QMAX, DELQ, QB, QSATB, FMASS, ENMASS, SENTR
70 _RL FPSA, FQMAX, RDPS, FUQ, FDQ, FSQ
71 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
72
73 C-- 1. Initialization of output and workspace arrays
74
75 PSA_1 = 1.
76 FQMAX= 5.
77
78 RDPS = 2. _d 0 /(1. _d 0 - PSMIN)
79 c_FM FM0=P0*DSIG(NLEV)/(GG*TRCNV*3600)
80 c_FM FPSA=PSA(J)*MIN(1.,(PSA(J)-PSMIN)*RDPS)
81 C- compute FM0(J) = FM0*FPSA
82 DO J=1,NGP
83 FM0(J)=0.
84 Ktmp = kGrd(J)
85 IF ( Ktmp .NE. 0 ) THEN
86 FPSA = MIN(1. _d 0 ,(PSA(J)-PSMIN)*RDPS)
87 FM0(J)=P0*DSIG(Ktmp)*dpFac(J,Ktmp)/(GG*TRCNV*3600. _d 0)
88 ENDIF
89 ENDDO
90
91 DO K=1,NLEV
92 DO J=1,NGP
93 DFSE(J,K)=0.0
94 DFQA(J,K)=0.0
95 ENDDO
96 ENDDO
97 DO K=2,NLEV-1
98 DO J=1,NGP
99 ENTR_PS(J,K)=0.
100 ENDDO
101 ENDDO
102
103 DO J=1,NGP
104 ITOP(J) =kGrd(J)
105 CBMF(J) =0.0
106 PRECNV(J)=0.0
107 ENDDO
108
109 C Saturation moist static energy
110 c_FM DO K=1,NLEV
111 c_FM DO J=1,NGP
112 c_FM SM(J,K)=SE(J,K)+ALHC*QSAT(J,K)
113 c_FM ENDDO
114 c_FM ENDDO
115
116 C ---------------------------------------------
117 C Write Conditional stability based on Pot.Temp :
118 C dSEdp(K) = Delta[Static-Energy] between 2 Plevels(k,k+1)
119 C and corresponds to SE(K+1)-SE(K) in the original code
120 C -------
121 DO K=1,NLEV-1
122 factP = CP*SIGH(K)**(RD/CP)
123 DO J=1,NGP
124 dSEdp(J,K)=(SE(J,K+1)-SE(J,K))*factP
125 ENDDO
126 ENDDO
127
128 C Entrainment profile (up to sigma = 0.5)
129
130 c_FM SENTR=0.
131 c_FM DO K=2,NLEV-1
132 c_FM ENTR(K)=( MAX( 0. _d 0, SIG(K)-0.5 _d 0) )**2
133 c_FM SENTR=SENTR+ENTR(K)
134 c_FM ENDDO
135
136 c_FM SENTR=ENTMAX/SENTR
137 c_FM DO K=2,NLEV-1
138 c_FM ENTR(K)=ENTR(K)*SENTR
139 c_FM ENDDO
140
141 DO J=1,NGP
142 DO K=2,NLEV-1
143 ENTR_PS(J,K)=0.
144 ENDDO
145 Ktmp = kGrd(J)
146 IF (Ktmp.GT.2) THEN
147 SENTR=0.
148 DO K=2,Ktmp-1
149 ENTR(K)= ( MAX( 0. _d 0, SIG(K)/PSA(J) - 0.5 _d 0) )**2
150 SENTR=SENTR+ENTR(K)
151 ENDDO
152 IF (SENTR.GT.0.) THEN
153 SENTR=ENTMAX/SENTR
154 DO K=2,Ktmp-1
155 ENTR_PS(J,K) = ENTR(K)*SENTR*PSA(J)
156 ENDDO
157 ENDIF
158 ENDIF
159 ENDDO
160
161 C-- 2. Check of conditions for convection
162
163 C 2.1 Conditional instability
164
165 c_FM DO K=NLEV-2,2,-1
166 c_FM DO J=1,NGP
167 c_FM SMB=SM(J,K)+WVI(K,2)*(SM(J,K+1)-SM(J,K))
168 c_FM IF (SM(J,NLEV).GT.SMB) ITOP(J)=K
169 c_FM ENDDO
170 c_FM ENDDO
171
172 DO J=1,NGP
173 Ktmp = kGrd(J)
174 IF ( Ktmp .GE. 2 ) THEN
175 dSEdpTot = dSEdp(J,Ktmp-1)
176 DO k=Ktmp-2,2,-1
177 dSEdpTot = dSEdpTot + dSEdp(J,K)
178 stab_crit = dSEdpTot + ALHC*(QSAT(J,Ktmp)-QSAT(J,K))
179 & -WVI(K,2)*(dSEdp(J,K) + ALHC*(QSAT(J,K+1)-QSAT(J,K)) )
180 IF (stab_crit.GT.0.) ITOP(J) = K
181 ENDDO
182 ENDIF
183 ENDDO
184
185
186 C 2.2 Humidity exceeding prescribed threshold
187
188 DO J=1,NGP
189 Ktmp = kGrd(J)
190 IF ( Ktmp .NE. 0 ) THEN
191 QATHR(J)=MIN(QBL,RHBL*QSAT(J,Ktmp))
192 IF (QA(J,Ktmp).LT.QATHR(J).OR.PSA(J).LT.PSMIN)
193 & ITOP(J)=Ktmp
194 ENDIF
195 IDEPTH(J)=Ktmp-ITOP(J)
196 ENDDO
197
198 C-- 3. Convection over selected grid-points
199
200 DO 300 J=1,NGP
201 Ktmp = kGrd(J)
202 IF (ITOP(J).EQ.Ktmp) GO TO 300
203
204 C- 3.1 Boundary layer (cloud base)
205
206 K = Ktmp
207 K1=K-1
208
209 C Maximum specific humidity in the PBL
210 QMAX=MAX(1.01 _d 0 *QA(J,K),QSAT(J,K))
211
212 C Dry static energy and moisture at upper boundary
213 c_FM SB=SE(J,K1)+WVI(K1,2)*(SE(J,K)-SE(J,K1))
214 QB=QA(J,K1)+WVI(K1,2)*(QA(J,K)-QA(J,K1))
215 QB=MIN(QB,QA(J,K))
216
217 C Cloud-base mass flux, computed to satisfy:
218 C fmass*(qmax-qb)*(g/dp)=(q-qthr)/trcnv
219
220 c_FM FPSA=PSA(J)*MIN(1.,(PSA(J)-PSMIN)*RDPS)
221 c_FM FMASS=FM0*FPSA*MIN(FQMAX,(QA(J,K)-QATHR(J))/(QMAX-QB))
222 FMASS = FM0(J)*MIN(FQMAX,(QA(J,K)-QATHR(J))/(QMAX-QB))
223 CBMF(J)=FMASS
224
225 C Upward fluxes at upper boundary
226 c_FM FUS=FMASS*SE(J,K)
227 FUQ=FMASS*QMAX
228
229 C Downward fluxes at upper boundary
230 c_FM FDS=FMASS*SB
231 FDQ=FMASS*QB
232
233 C Net flux of dry static energy and moisture
234 FDMUS = FMASS*dSEdp(J,K1)*(WVI(K1,2)-1.)
235 DFSE(J,K)=FDMUS
236 c_FM DFSE(J,K)=FDS-FUS
237 DFQA(J,K)=FDQ-FUQ
238
239 C- 3.2 Intermediate layers (entrainment)
240
241 DO K=Ktmp-1,ITOP(J)+1,-1
242 K1=K-1
243
244 C Fluxes at lower boundary
245 c_FM DFSE(J,K)=FUS-FDS
246 DFQA(J,K)=FUQ-FDQ
247
248 C Mass entrainment
249 c_FM ENMASS=ENTR(K)*PSA(J)*CBMF(J)
250 ENMASS=ENTR_PS(J,K) * CBMF(J)
251 FMASS=FMASS+ENMASS
252
253 C Upward fluxes at upper boundary
254 c_FM FUS=FUS+ENMASS*SE(J,K)
255 FUQ=FUQ+ENMASS*QA(J,K)
256
257 C Downward fluxes at upper boundary
258 c_FM SB=SE(J,K1)+WVI(K1,2)*(SE(J,K)-SE(J,K1))
259 QB=QA(J,K1)+WVI(K1,2)*(QA(J,K)-QA(J,K1))
260 c_FM FDS=FMASS*SB
261 FDQ=FMASS*QB
262
263 C Net flux of dry static energy and moisture
264 DFSE(J,K) = FMASS*(WVI(K1,2)-1.)*dSEdp(J,K1)
265 & -(FMASS-ENMASS)*WVI(K,2)*dSEdp(J,K)
266 FDMUS = FDMUS + DFSE(J,K)
267 c_FM DFSE(J,K)=DFSE(J,K)+FDS-FUS
268 DFQA(J,K)=DFQA(J,K)+FDQ-FUQ
269
270 C Secondary moisture flux
271 DELQ=RHIL*QSAT(J,K)-QA(J,K)
272 IF (DELQ.GT.0.0) THEN
273 FSQ=SMF*CBMF(J)*DELQ
274 DFQA(J,K) =DFQA(J,K) +FSQ
275 DFQA(J,Ktmp)=DFQA(J,Ktmp)-FSQ
276 ENDIF
277
278 ENDDO
279
280 C- 3.3 Top layer (condensation and detrainment)
281
282 K=ITOP(J)
283
284 C Flux of convective precipitation
285 QSATB=QSAT(J,K)+WVI(K,2)*(QSAT(J,K+1)-QSAT(J,K))
286 PRECNV(J)=MAX(FUQ-FMASS*QSATB, 0. _d 0)
287
288 C Net flux of dry static energy and moisture
289 DFSE(J,K)= -FDMUS+ALHC*PRECNV(J)
290 c_FM DFSE(J,K)=FUS-FDS+ALHC*PRECNV(J)
291 DFQA(J,K)=FUQ-FDQ-PRECNV(J)
292
293 300 CONTINUE
294
295 #endif /* ALLOW_AIM */
296
297 RETURN
298 END

  ViewVC Help
Powered by ViewVC 1.1.22