CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
GFS_MP_generic_post.F90
1
4
9 contains
10
18 subroutine gfs_mp_generic_post_run( &
19 im, levs, kdt, nrcm, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_nssl, &
20 imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, cpllnd, progsigma, con_g, rhowater, rainmin, dtf, &
21 frain, rainc, rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, phil, htop, refl_10cm, &
22 imfshalcnv,imfshalcnv_gf,imfdeepcnv,imfdeepcnv_gf,imfdeepcnv_samf, con_t0c, snow, graupel, save_t, save_q, &
23 rain0, ice0, snow0, graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp,&
24 totprcp, totice, totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, &
25 pwat, frzr, frzrb, frozr, frozrb, tsnowp, tsnowpb, rhonewsn1, exticeden, &
26 drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, &
27 graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, &
28 dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d,dqdt_qmicro, lssav, num_dfi_radar, &
29 fh_dfi_radar,index_of_process_dfi_radar, ix_dfi_radar, dfi_radar_tten, radar_tten_limits, fhour, prevsq, &
30 iopt_lake, iopt_lake_clm, lkm, use_lake_model, errmsg, errflg)
31!
32 use machine, only: kind_phys
33 use calpreciptype_mod, only: calpreciptype
34 implicit none
35
36 integer, intent(in) :: im, levs, kdt, nrcm, nncl, ntcw, ntrac, num_dfi_radar, index_of_process_dfi_radar
37 integer, intent(in) :: imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_mg, imp_physics_fer_hires
38 integer, intent(in) :: imp_physics_nssl, iopt_lake_clm, iopt_lake, lkm
39 logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, cpllnd, progsigma, exticeden
40 integer, intent(in) :: index_of_temperature,index_of_process_mp,use_lake_model(:)
41 integer, intent(in) :: imfshalcnv,imfshalcnv_gf,imfdeepcnv,imfdeepcnv_gf,imfdeepcnv_samf
42 integer, dimension (:), intent(in) :: htop
43 real(kind=kind_phys), intent(in) :: fh_dfi_radar(:), fhour, con_t0c
44 real(kind=kind_phys), intent(in) :: radar_tten_limits(:)
45 integer, intent(in) :: ix_dfi_radar(:)
46 real(kind=kind_phys), dimension(:,:), intent(inout) :: gt0,refl_10cm
47
48 real(kind=kind_phys), intent(in) :: dtf, frain, con_g, rainmin, rhowater
49 real(kind=kind_phys), dimension(:), intent(in) :: rain1, xlat, xlon, tsfc
50 real(kind=kind_phys), dimension(:), intent(inout) :: ice, snow, graupel, rainc
51 real(kind=kind_phys), dimension(:), intent(in), optional :: rain0, ice0, snow0, graupel0
52 real(kind=kind_phys), dimension(:,:), intent(in) :: rann
53 real(kind=kind_phys), dimension(:,:), intent(in) :: prsl, save_t, del
54 real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, phii,phil
55 real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0, save_q
56
57 real(kind=kind_phys), dimension(:,:,:), intent(in), optional :: dfi_radar_tten
58
59 real(kind=kind_phys), dimension(:), intent(in ) :: sr
60 real(kind=kind_phys), dimension(:), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, &
61 srflag, cnvprcp, totprcp, totice, totsnw, totgrp, cnvprcpb, &
62 totprcpb, toticeb, totsnwb, totgrpb, pwat
63 real(kind=kind_phys), dimension(:), intent(inout), optional :: rain_cpl, rainc_cpl, snow_cpl
64
65 real(kind=kind_phys), dimension(:,:,:), intent(inout), optional :: dtend
66 integer, dimension(:,:), intent(in) :: dtidx
67
68 ! Stochastic physics / surface perturbations
69 real(kind=kind_phys), dimension(:), intent(inout), optional :: drain_cpl, dsnow_cpl
70
71 ! Rainfall variables previous time step
72 integer, intent(in) :: lsm, lsm_ruc, lsm_noahmp
73 real(kind=kind_phys), dimension(:), intent(inout), optional :: raincprv
74 real(kind=kind_phys), dimension(:), intent(inout), optional :: rainncprv
75 real(kind=kind_phys), dimension(:), intent(inout), optional :: iceprv
76 real(kind=kind_phys), dimension(:), intent(inout), optional :: snowprv
77 real(kind=kind_phys), dimension(:), intent(inout), optional :: graupelprv
78 real(kind=kind_phys), dimension(:), intent(inout), optional :: draincprv
79 real(kind=kind_phys), dimension(:), intent(inout), optional :: drainncprv
80 real(kind=kind_phys), dimension(:), intent(inout), optional :: diceprv
81 real(kind=kind_phys), dimension(:), intent(inout), optional :: dsnowprv
82 real(kind=kind_phys), dimension(:), intent(inout), optional :: dgraupelprv
83 real(kind=kind_phys), dimension(:), intent(inout) :: frzr
84 real(kind=kind_phys), dimension(:), intent(inout) :: frzrb
85 real(kind=kind_phys), dimension(:), intent(inout) :: frozr
86 real(kind=kind_phys), dimension(:), intent(inout) :: frozrb
87 real(kind=kind_phys), dimension(:), intent(inout) :: tsnowp
88 real(kind=kind_phys), dimension(:), intent(inout) :: tsnowpb
89 real(kind=kind_phys), dimension(:), intent(inout) :: rhonewsn1
90 real(kind=kind_phys), dimension(:,:), intent(inout), optional :: dqdt_qmicro
91 real(kind=kind_phys), dimension(:,:), intent(inout), optional :: prevsq
92 real(kind=kind_phys), intent(in) :: dtp
93
94 ! CCPP error handling
95 character(len=*), intent(out) :: errmsg
96 integer, intent(out) :: errflg
97
98 ! DH* TODO: CLEANUP, all of these should be coming in through the argument list
99 real(kind=kind_phys), parameter :: con_p001= 0.001_kind_phys
100 real(kind=kind_phys), parameter :: con_day = 86400.0_kind_phys
101 real(kind=kind_phys), parameter :: p850 = 85000.0_kind_phys
102 ! *DH
103
104 integer :: i, k, ic, itrac, idtend, itime, idtend_radar, idtend_mp
105
106 real(kind=kind_phys), parameter :: zero = 0.0_kind_phys, one = 1.0_kind_phys
107 real(kind=kind_phys) :: crain, csnow, onebg, tem, total_precip, tem1, tem2, ttend
108 real(kind=kind_phys), dimension(im) :: domr, domzr, domip, doms, t850, work1
109
110 real :: snowrat,grauprat,icerat,curat,prcpncfr,prcpcufr
111 real :: rhonewsnow,rhoprcpice,rhonewgr,rhonewice
112
113 real(kind_phys), parameter :: dbzmin=-20.0
114 real(kind_phys) :: cuprate
115 real(kind_phys) :: ze, ze_conv, dbz_sum
116
117 real(kind_phys), dimension(1:im,1:levs) :: zo
118 real(kind_phys), dimension(1:im) :: zfrz
119 real(kind_phys), dimension(1:im) :: factor
120 real(kind_phys) ze_mp, fctz, delz
121 logical :: lfrz
122
123
124 ! Initialize CCPP error handling variables
125 errmsg = ''
126 errflg = 0
127
128 onebg = one/con_g
129
130 do i = 1, im
131 rain(i) = rainc(i) + frain * rain1(i) ! time-step convective plus explicit
132 enddo
133!
134! Combine convective reflectivity with MP reflectivity for selected
135! parameterizations.
136 if ( (imp_physics==imp_physics_thompson .or. imp_physics==imp_physics_nssl) .and. &
137 (imfdeepcnv==imfdeepcnv_samf .or. imfdeepcnv==imfdeepcnv_gf .or. imfshalcnv==imfshalcnv_gf) ) then
138 do i=1,im
139 factor(i) = 0.0
140 lfrz = .true.
141 zfrz(i) = phil(i,1)*onebg
142 do k = levs, 1, -1
143 zo(i,k) = phil(i,k)*onebg
144 if (gt0(i,k) >= con_t0c .and. lfrz) then
145 zfrz(i) = zo(i,k)
146 lfrz = .false.
147 endif
148 enddo
149 enddo
150!
151 do i=1,im
152 if(rainc(i) > 0.0 .and. htop(i) > 0) then
153 factor(i) = -2./max(1000., zo(i,htop(i)) - zfrz(i))
154 endif
155 enddo
156
157! combine the reflectivity from both Thompson MP and samfdeep convection
158
159 do k=1,levs
160 do i=1,im
161 if(rainc(i) > 0. .and. k <= htop(i)) then
162 fctz = 0.0
163 delz = zo(i,k) - zfrz(i)
164 if(delz <0.0) then
165 fctz = 1. ! wrong
166 else
167 fctz = 10.**(factor(i)*delz)
168 endif
169 cuprate = rainc(i) * 3.6e6 / dtp ! cu precip rate (mm/h)
170 ze_conv = 300.0 * cuprate**1.4
171 ze_conv = fctz * ze_conv
172 ze_mp = 10._kind_phys ** (0.1 * refl_10cm(i,k))
173 dbz_sum = max(dbzmin, 10.*log10(ze_mp + ze_conv))
174 refl_10cm(i,k) = dbz_sum
175 endif
176 enddo
177 enddo
178 endif
179
180! compute surface snowfall, graupel/sleet, freezing rain and precip ice density
181 if (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson .or. imp_physics == imp_physics_nssl ) then
182 do i = 1, im
183 if (gt0(i,1) .le. 273) then
184 frzr(i) = frzr(i) + rain0(i)
185 frzrb(i) = frzrb(i) + rain0(i)
186 endif
187 tsnowp(i) = tsnowp(i) + snow0(i)
188 tsnowpb(i) = tsnowpb(i) + snow0(i)
189 frozr(i) = frozr(i) + graupel0(i)
190 frozrb(i) = frozrb(i) + graupel0(i)
191 enddo
192!Compute the variable precip ice density for specific LSM schemes and options
193 if (exticeden) then
194 snowrat = 0.
195 grauprat = 0.
196 icerat = 0.
197 prcpncfr = 0.
198 prcpcufr = 0.
199 curat = 0.
200 prcpncfr = 0.
201 prcpcufr = 0.
202 rhonewsnow = 0.
203 rhonewgr = 0.
204 rhonewice = 0.
205 rhoprcpice = 0.
206 do i = 1, im
207 rhonewsn1(i)= 200.
208 prcpncfr = rain1(i)*sr(i)
209 if(sr(i) > 0..and. gt0(i,1) < 273.) then
210 prcpcufr = max(0.,rainc(i)*sr(i))
211 else
212 if(gt0(i,1) < 273.) then
213 prcpcufr = max(0.,rainc(i))
214 else
215 prcpcufr = 0.
216 endif ! gt0(i,1) < 273.
217 endif ! frzfrac > 0.
218!
219 if((prcpncfr + prcpcufr) > 0.) then
220! -- calculate snow, graupel and ice fractions in falling frozen precip
221 snowrat=min(1.,max(0.,snow0(i)/(prcpncfr + prcpcufr)))
222 grauprat=min(1.,max(0.,graupel0(i)/(prcpncfr + prcpcufr)))
223 icerat=min(1.,max(0.,(prcpncfr-snow0(i)-graupel0(i)) &
224 /(prcpncfr + prcpcufr)))
225 curat=min(1.,max(0.,(prcpcufr/(prcpncfr + prcpcufr))))
226
227 rhonewsnow=min(125.,1000.0/max(8.,(17.*tanh((276.65-gt0(i,1))*0.15))))
228 rhonewgr=min(500.,rhowater/max(2.,(3.5*tanh((274.15-gt0(i,1))*0.3333))))
229 rhonewice=rhonewsnow
230!--- compute density of "precip ice" from weighted contribution
231! of snow, graupel and ice fractions
232
233 rhoprcpice = min(500.,max(58.8,(rhonewsnow*snowrat + &
234 rhonewgr*grauprat + rhonewice*icerat + rhonewgr*curat)))
235! from now on rhonewsn1 is the density of falling frozen precipitation
236 rhonewsn1(i)=rhoprcpice
237 endif
238 enddo
239 endif
240 endif
241
244 ! DH* TODO - Fix wrong code in non-CCPP build (GFS_physics_driver)
245 ! and use commented lines here (keep wrong version for bit-for-bit):
246 ! put ice, snow, graupel on dynamics timestep. The way the code in
247 ! GFS_physics_driver is written, Diag%{graupel,ice,snow} are on the
248 ! physics timestep, while Diag%{rain,rainc} and all totprecip etc
249 ! are on the dynamics timestep. Confusing, but works if frain=1. *DH
250 if (imp_physics == imp_physics_gfdl) then
251 tprcp = max(zero, rain) ! clu: rain -> tprcp
252 !graupel = frain*graupel0
253 !ice = frain*ice0
254 !snow = frain*snow0
255 graupel = graupel0
256 ice = ice0
257 snow = snow0
258 ! Do it right from the beginning for Thompson
259 else if (imp_physics == imp_physics_thompson .or. imp_physics == imp_physics_nssl ) then
260 tprcp = max(zero, rainc + frain * rain1) ! time-step convective and explicit precip
261 graupel = frain*graupel0 ! time-step graupel
262 ice = frain*ice0 ! time-step ice
263 snow = frain*snow0 ! time-step snow
264 else if (imp_physics == imp_physics_fer_hires) then
265 tprcp = max(zero, rain) ! time-step convective and explicit precip
266 ice = frain*rain1*sr ! time-step ice
267 end if
268
269 if (lsm==lsm_ruc .or. lsm==lsm_noahmp) then
270 raincprv(:) = rainc(:)
271 rainncprv(:) = frain * rain1(:)
272 iceprv(:) = ice(:)
273 snowprv(:) = snow(:)
274 graupelprv(:) = graupel(:)
275 !for NoahMP, calculate precipitation rates from liquid water equivalent thickness for use in next time step
276 !Note (GJF): Precipitation LWE thicknesses are multiplied by the frain factor, and are thus on the dynamics time step, but the conversion as written
277 ! (with dtp in the denominator) assumes the rate is calculated on the physics time step. This only works as expected when dtf=dtp (i.e. when frain=1).
278 if (lsm == lsm_noahmp) then
279 tem = one / (dtp*con_p001) !GJF: This conversion was taken from GFS_physics_driver.F90, but should denominator also have the frain factor?
280 draincprv(:) = tem * raincprv(:)
281 drainncprv(:) = tem * rainncprv(:)
282 dsnowprv(:) = tem * snowprv(:)
283 dgraupelprv(:) = tem * graupelprv(:)
284 diceprv(:) = tem * iceprv(:)
285 end if
286 else if(lkm>0 .and. iopt_lake==iopt_lake_clm) then
287 do i=1,im
288 if(use_lake_model(i)>0) then
289 raincprv(i) = rainc(i)
290 rainncprv(i) = frain * rain1(i)
291 end if
292 end do
293 end if
294
295 if (cal_pre) then ! hchuang: add dominant precipitation type algorithm
296!
297 call calpreciptype (kdt, nrcm, im, im, levs, levs+1, &
298 rann, xlat, xlon, gt0, &
299 gq0(:,:,1), prsl, prsi, &
300 rain, phii, tsfc, & ! input
301 domr, domzr, domip, doms) ! output
302!
303! HCHUANG: use new precipitation type to decide snow flag for LSM snow accumulation
304
305 if (imp_physics /= imp_physics_gfdl .and. imp_physics /= imp_physics_thompson .and. imp_physics /= imp_physics_nssl) then
306 do i=1,im
307 tprcp(i) = max(zero, rain(i) )
308 if(doms(i) > zero .or. domip(i) > zero) then
309 srflag(i) = one
310 else
311 srflag(i) = zero
312 end if
313 enddo
314 endif
315 if (lssav) then
316 do i=1,im
317 domr_diag(i) = domr_diag(i) + domr(i) * dtf
318 domzr_diag(i) = domzr_diag(i) + domzr(i) * dtf
319 domip_diag(i) = domip_diag(i) + domip(i) * dtf
320 doms_diag(i) = doms_diag(i) + doms(i) * dtf
321 enddo
322 endif
323
324 endif
325
326 do itime=1,num_dfi_radar
327 if(ix_dfi_radar(itime)<1) cycle
328 if(fhour<fh_dfi_radar(itime)) cycle
329 if(fhour>=fh_dfi_radar(itime+1)) cycle
330 exit
331 enddo
332 if_radar: if(itime<=num_dfi_radar) then
333 radar_k: do k=3,levs-2 ! Avoid model top and bottom in case DA forgets to
334 radar_i: do i=1,im
335 ttend = dfi_radar_tten(i,k,itime)
336 if_active: if (ttend>-19) then
337 ttend = max(ttend,radar_tten_limits(1))
338 ttend = min(ttend,radar_tten_limits(2))
339
340 ! add radar temp tendency
341 ! there is radar coverage
342 gt0(i,k) = save_t(i,k) + ttend*dtp
343 end if if_active
344 end do radar_i
345 end do radar_k
346 if(ldiag3d) then
347 idtend_radar = dtidx(index_of_temperature,index_of_process_dfi_radar)
348 idtend_mp = dtidx(index_of_temperature,index_of_process_mp)
349 if(idtend_radar>0 .or. idtend_mp>0) then
350 if(idtend_mp>0) then
351 dtend(:,1:2,idtend_mp) = dtend(:,1:2,idtend_mp) + (gt0(:,1:2)-save_t(:,1:2))*frain
352 endif
353 do k=3,levs-2 ! Avoid model top and bottom in case DA forgets to
354 do i=1,im
355 ttend = dfi_radar_tten(i,k,itime)
356 if (ttend>-19) then
357 if(idtend_radar>0) then
358 dtend(i,k,idtend_radar) = dtend(i,k,idtend_radar) + (gt0(i,k)-save_t(i,k)) * frain
359 endif
360 else if(idtend_mp>0) then
361 dtend(i,k,idtend_mp) = dtend(i,k,idtend_mp) + (gt0(i,k)-save_t(i,k)) * frain
362 endif
363 enddo
364 enddo
365 if(idtend_mp>0) then
366 dtend(:,levs-1:levs,idtend_mp) = dtend(:,levs-1:levs,idtend_mp) + (gt0(:,levs-1:levs)-save_t(:,levs-1:levs))*frain
367 endif
368 endif
369 endif
370 endif if_radar
371
372 t850(1:im) = gt0(1:im,1)
373
374 do k = 1, levs-1
375 do i = 1, im
376 if (prsl(i,k) > p850 .and. prsl(i,k+1) <= p850) then
377 t850(i) = gt0(i,k) - (prsl(i,k)-p850) / &
378 (prsl(i,k)-prsl(i,k+1)) * &
379 (gt0(i,k)-gt0(i,k+1))
380 endif
381 enddo
382 enddo
383
384 ! Conversion factor from mm per day to m per physics timestep
385 tem = dtp * con_p001 / con_day
386
391
392 if (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson .or. &
393 imp_physics == imp_physics_nssl ) then
394
395! determine convective rain/snow by surface temperature
396! determine large-scale rain/snow by rain/snow coming out directly from MP
397
398 if (lsm /= lsm_ruc) then
399 do i = 1, im
400 !tprcp(i) = max(0.0, rain(i) )! clu: rain -> tprcp ! DH now lines 245-250
401 srflag(i) = zero ! clu: default srflag as 'rain' (i.e. 0)
402 if (tsfc(i) >= 273.15_kind_phys) then
403 crain = rainc(i)
404 csnow = zero
405 else
406 crain = zero
407 csnow = rainc(i)
408 endif
409! if (snow0(i,1)+ice0(i,1)+graupel0(i,1)+csnow > rain0(i,1)+crain) then
410! if (snow0(i)+ice0(i)+graupel0(i)+csnow > 0.0) then
411! Sfcprop%srflag(i) = 1. ! clu: set srflag to 'snow' (i.e. 1)
412! endif
413 total_precip = snow0(i)+ice0(i)+graupel0(i)+rain0(i)+rainc(i)
414 if (total_precip > rainmin) then
415 srflag(i) = (snow0(i)+ice0(i)+graupel0(i)+csnow)/total_precip
416 endif
417 enddo
418 else
419 ! only for RUC LSM
420 do i=1,im
421 srflag(i) = sr(i)
422 enddo
423 endif ! lsm==lsm_ruc
424 elseif( .not. cal_pre) then
425 if (imp_physics == imp_physics_mg) then ! MG microphysics
426 do i=1,im
427 if (rain(i) > rainmin) then
428 tem1 = max(zero, (rain(i)-rainc(i))) * sr(i)
429 tem2 = one / rain(i)
430 if (t850(i) > 273.16_kind_phys) then
431 srflag(i) = max(zero, min(one, tem1*tem2))
432 else
433 srflag(i) = max(zero, min(one, (tem1+rainc(i))*tem2))
434 endif
435 else
436 srflag(i) = zero
437 rain(i) = zero
438 rainc(i) = zero
439 endif
440 tprcp(i) = max(zero, rain(i))
441 enddo
442 else ! not GFDL or MG or Thompson microphysics
443 do i = 1, im
444 tprcp(i) = max(zero, rain(i))
445 srflag(i) = sr(i)
446 enddo
447 endif
448 endif
449
450 if_save_fields: if (lssav) then
451! if (Model%me == 0) print *,'in phys drive, kdt=',Model%kdt, &
452! 'totprcpb=', Diag%totprcpb(1),'totprcp=',Diag%totprcp(1), &
453! 'rain=',Diag%rain(1)
454 do i=1,im
455 cnvprcp(i) = cnvprcp(i) + rainc(i)
456 totprcp(i) = totprcp(i) + rain(i)
457 totice(i) = totice(i) + ice(i)
458 totsnw(i) = totsnw(i) + snow(i)
459 totgrp(i) = totgrp(i) + graupel(i)
460
461 cnvprcpb(i) = cnvprcpb(i) + rainc(i)
462 totprcpb(i) = totprcpb(i) + rain(i)
463 toticeb(i) = toticeb(i) + ice(i)
464 totsnwb(i) = totsnwb(i) + snow(i)
465 totgrpb(i) = totgrpb(i) + graupel(i)
466 enddo
467
468 if_tendency_diagnostics: if (ldiag3d) then
469 idtend = dtidx(index_of_temperature,index_of_process_mp)
470 if(idtend>=1) then
471 do k=1,levs
472 do i=1,im
473 dtend(i,k,idtend) = dtend(i,k,idtend) + (gt0(i,k)-save_t(i,k)) * frain
474 enddo
475 enddo
476 endif
477 if_tracer_diagnostics: if (qdiag3d) then
478 dtend_q: do itrac=1,ntrac
479 idtend = dtidx(itrac+100,index_of_process_mp)
480 if(idtend>=1) then
481 do k=1,levs
482 do i=1,im
483 dtend(i,k,idtend) = dtend(i,k,idtend) + (gq0(i,k,itrac)-save_q(i,k,itrac)) * frain
484 enddo
485 enddo
486 endif
487 enddo dtend_q
488 endif if_tracer_diagnostics
489 endif if_tendency_diagnostics
490 endif if_save_fields
491
492 !If prognostic updraft area fraction is used in saSAS
493 if(progsigma)then
494 do k=1,levs
495 do i=1,im
496 dqdt_qmicro(i,k)=(gq0(i,k,1)-save_q(i,k,1))/dtp
497 enddo
498 enddo
499 endif
500
501 if (cplflx .or. cplchm .or. cpllnd) then
502 do i = 1, im
503 dsnow_cpl(i)= max(zero, rain(i) * srflag(i))
504 drain_cpl(i)= max(zero, rain(i) - dsnow_cpl(i))
505 rain_cpl(i) = rain_cpl(i) + drain_cpl(i)
506 snow_cpl(i) = snow_cpl(i) + dsnow_cpl(i)
507 enddo
508 endif
509
510 if (cplchm .or. cpllnd) then
511 do i = 1, im
512 rainc_cpl(i) = rainc_cpl(i) + rainc(i)
513 enddo
514 endif
515
516 pwat(:) = zero
517 do k = 1, levs
518 do i=1, im
519 work1(i) = zero
520 enddo
521 if (nncl > 0) then
522 do ic = ntcw, ntcw+nncl-1
523 do i=1,im
524 work1(i) = work1(i) + gq0(i,k,ic)
525 enddo
526 enddo
527 endif
528 do i=1,im
529 pwat(i) = pwat(i) + del(i,k)*(gq0(i,k,1)+work1(i))
530 enddo
531 enddo
532 do i=1,im
533 pwat(i) = pwat(i) * onebg
534 enddo
535
536 if(progsigma)then
537 do k = 1, levs
538 do i=1, im
539 prevsq(i,k) = gq0(i,k,1)
540 enddo
541 enddo
542 endif
543
544 end subroutine gfs_mp_generic_post_run
545
546 end module gfs_mp_generic_post
subroutine csnow
This subroutine calculates snow termal conductivity.
Definition sflx.f:1227
Four algorithms are called to calculate dominant precipitation type, and the tallies are sumed in cal...
This module contains the subroutine that calculates precipitation type and its post,...