← Back to Documentation Home
CCPP SciDoc v8.0.0  v8.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
radiation_clouds.f
1
4
5! module_radiation_clouds description !!!!!
6! ========================================================== !!!!!
7! !
8! the 'radiation_clouds.f' contains: !
9! !
10! 'module_radiation_clouds' --- compute cloud related quantities!
11! for radiation computations !
12! !
13! the following are the externally accessable subroutines: !
14! !
15! 'cld_init' --- initialization routine !
16! inputs: !
17! ( si, NLAY, imp_physics, me ) !
18! outputs: !
19! ( errflg, errmsg ) !
20! !
21! 'radiation_clouds_prop' --- radiation cloud properties !
22! obtained from various cloud schemes !
23! inputs: !
24! (plyr,plvl,tlyr,tvly,qlyr,qstl,rhly, !
25! ccnd, ncndl, cnvw, cnvc, tracer1, !
26! xlat,xlon,slmsk,dz,delp, IX, LM, NLAY, NLP1, !
27! deltaq, sup, me, icloud, kdt, !
28! ntrac, ntcw, ntiw, ntrw, ntsw, ntgl, ntclamt, !
29! imp_physics, imp_physics_nssl, imp_physics_fer_hires, !
30! imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, !
31! imp_physics_tempo, !
32! imp_physics_mg, iovr, iovr_rand, iovr_maxrand, iovr_max, !
33! iovr_dcorr, iovr_exp, iovr_exprand, idcor, idcor_con, !
34! idcor_hogan, idcor_oreopoulos, !
35! imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, do_mynnedmf, lgfdlmprad, !
36! uni_cld, lmfshal, lmfdeep2, cldcov, clouds1, !
37! effrl, effri, effrr, effrs, effr_in, !
38! effrl_inout, effri_inout, effrs_inout, !
39! lwp_ex, iwp_ex, lwp_fc, iwp_fc, !
40! dzlay, latdeg, julian, yearlen, gridkm, !
41! outputs: !
42! cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, !
43! cld_rwp, cld_rerain, cld_swp, cld_resnow, !
44! clds,mtop,mbot,de_lgth,alpha) !
45! !
46! internal/external accessable subroutines: !
47! 'progcld_gfdl_lin' --- GFDL-Lin cloud microphysics !
48! 'progcld_fer_hires' --- Ferrier-Aligo cloud microphysics !
49! 'progcld_thompson_wsm6' --- Thompson/wsm6 cloud microphysics (EMC) !
50! 'progclduni' --- MG2/3 cloud microphysics !
51! (with/without SHOC) (EMC) !
52! also used by GFDL MP (EMC) !
53! 'progcld_thompson' --- Thompson MP (added by G. Thompson) !
54! 'gethml' --- get diagnostic hi, mid, low clouds !
55! !
56! cloud property array description: !
57! cld_frac (:,:) - layer total cloud fraction !
58! cld_lwp (:,:) - layer cloud liq water path !
59! cld_reliq (:,:) - mean effective radius for liquid cloud !
60! cld_iwp (:,:) - layer cloud ice water path !
61! cld_reice (:,:) - mean effective radius for ice cloud !
62! cld_rwp (:,:) - layer rain drop water path !
63! cld_rerain(:,:) - mean effective radius for rain drop !
64! ** cld_swp (:,:) - layer snow flake water path !
65! cld_resnow(:,:) - mean effective radius for snow flake !
66! ** fu's scheme need to be normalized by snow density (g/m**3/1.0e6)!
67! !
68! external modules referenced: !
69! 'module module_microphysics' in 'module_bfmicrophysics.f' !
70! !
71! program history log: !
72! nov 1992, y.h., k.a.c, a.k. - cloud parameterization !
73! 'cldjms' patterned after slingo and slingo's work (jgr, !
74! 1992), stratiform clouds are allowed in any layer except !
75! the surface and upper stratosphere. the relative humidity !
76! criterion may cery in different model layers. !
77! mar 1993, kenneth campana - created original crhtab tables !
78! for critical rh look up references.
79! feb 1994, kenneth campana - modified to use only one table !
80! for all forecast hours. !
81! oct 1995, kenneth campana - tuned cloud rh curves !
82! rh-cld relation from tables created using mitchell-hahn !
83! tuning technique on airforce rtneph observations. !
84! nov 1995, kenneth campana - the bl relationships used !
85! below llyr, except in marine stratus regions. !
86! apr 1996, kenneth campana - save bl cld amt in cld(,5) !
87! aug 1997, kenneth campana - smooth out last bunch of bins !
88! of the rh look up tables !
89! dec 1998, s. moorthi - added prognostic cloud method !
90! apr 2003, yu-tai hou - rewritten in frotran 90 !
91! modulized form 'module_rad_clouds' from combining the original!
92! subroutines 'cldjms', 'cldprp', and 'gcljms'. and seperated !
93! prognostic and diagnostic methods into two packages. !
94! --- 2003, s. moorthi - adapted b. ferrier's prognostic !
95! cloud scheme to ncep gfs model as additional option. !
96! apr 2004, yu-tai hou - separated calculation of the !
97! averaged h,m,l,bl cloud amounts from each of the cld schemes !
98! to become an shared individule subprogram 'gethml'. !
99! apr 2005, yu-tai hou - modified cloud array and module !
100! structures. !
101! dec 2008, yu-tai hou - changed low-cld calculation, !
102! now cantains clds from sfc layer and upward to the low/mid !
103! boundary (include bl-cld). h,m,l clds domain boundaries are !
104! adjusted for better agreement with observations. !
105! jan 2011, yu-tai hou - changed virtual temperature !
106! as input variable !
107! aug 2012, yu-tai hou - modified subroutine cld_init !
108! to pass all fixed control variables at the start. and set !
109! their correponding internal module variables to be used by !
110! module subroutines. !
111! nov 2012, yu-tai hou - modified control parameters !
112! thru module 'physparam'. !
113! apr 2013, h.lin/y.hou - corrected error in calculating !
114! llyr for different vertical indexing directions. !
115! jul 2013, r. sun/h. pan - modified to use pdf cloud and !
116! convective cloud cover and water for radiation !
117! !
118! jul 2014 s. moorthi - merging with gfs version !
119! feb 2017 a. cheng - add odepth output, effective radius input !
120! Jan 2018 S Moorthi - update to include physics from ipdv4 !
121! jun 2018 h-m lin/y-t hou - removed the legacy subroutine !
122! 'diagcld1' for diagnostic cloud scheme, added new cloud !
123! overlapping method of de-correlation length, and optimized !
124! the code structure. !
125! jul 2020, m.j. iacono - added rrtmg/mcica cloud overlap options !
126! exponential and exponential-random. each method can use !
127! either a constant or a latitude-varying and day-of-year !
128! varying decorrelation length selected with parameter "idcor". !
129! !
130! Jan 2022, Q.Liu - add subroutine radiation_clouds_prop, and !
131! move all the subroutine call "progcld*" from !
132! GFS_rrtmg_pre.F90 to this new subroutine !
133!!!!! ========================================================== !!!!!
134!!!!! end descriptions !!!!!
135!!!!! ========================================================== !!!!!
136
161
164!
165 use module_iounitdef, only : nicltun
167 & get_alpha_exper
168 use machine, only : kind_phys
169!
170 implicit none
171!
172 private
173
174! --- version tag and last revision date
175 character(40), parameter :: &
176 & VTAGCLD='NCEP-Radiation_clouds v5.1 Nov 2012 '
177! & VTAGCLD='NCEP-Radiation_clouds v5.0 Aug 2012 '
178
179! --- set constant parameters
180 real (kind=kind_phys) :: gfac,gord
181
182 integer, parameter, public :: nf_clds = 9
183 integer, parameter, public :: nk_clds = 3
184
185! pressure limits of cloud domain interfaces (low,mid,high) in mb (0.1kPa)
186 real (kind=kind_phys), save :: ptopc(nk_clds+1,2)
188
189!org data ptopc / 1050., 642., 350., 0.0, 1050., 750., 500., 0.0 /
190 data ptopc / 1050., 650., 400., 0.0, 1050., 750., 500., 0.0 /
191
192! real (kind=kind_phys), parameter :: climit = 0.01
193 real (kind=kind_phys), parameter :: climit = 0.001, climit2=0.05
194 real (kind=kind_phys), parameter :: ovcst = 1.0 - 1.0e-8
195
196 real (kind=kind_phys), parameter :: reliq_def = 10.0
197 real (kind=kind_phys), parameter :: reice_def = 50.0
198 real (kind=kind_phys), parameter :: rrain_def = 1000.0
199 real (kind=kind_phys), parameter :: rsnow_def = 250.0
200 real (kind=kind_phys), parameter :: creice_def = 25.0
201
202 real (kind=kind_phys), parameter :: cldssa_def = 0.99
203 real (kind=kind_phys), parameter :: cldasy_def = 0.84
204
205 integer :: llyr = 2
206
207 ! Default ice crystal sizes vs. temperature following Kristjansson and Mitchell
208 real (kind=kind_phys), dimension(95), parameter :: retab =(/ &
209 & 5.92779, 6.26422, 6.61973, 6.99539, 7.39234, &
210 & 7.81177, 8.25496, 8.72323, 9.21800, 9.74075, 10.2930, &
211 & 10.8765, 11.4929, 12.1440, 12.8317, 13.5581, 14.2319, &
212 & 15.0351, 15.8799, 16.7674, 17.6986, 18.6744, 19.6955, &
213 & 20.7623, 21.8757, 23.0364, 24.2452, 25.5034, 26.8125, &
214 & 27.7895, 28.6450, 29.4167, 30.1088, 30.7306, 31.2943, &
215 & 31.8151, 32.3077, 32.7870, 33.2657, 33.7540, 34.2601, &
216 & 34.7892, 35.3442, 35.9255, 36.5316, 37.1602, 37.8078, &
217 & 38.4720, 39.1508, 39.8442, 40.5552, 41.2912, 42.0635, &
218 & 42.8876, 43.7863, 44.7853, 45.9170, 47.2165, 48.7221, &
219 & 50.4710, 52.4980, 54.8315, 57.4898, 60.4785, 63.7898, &
220 & 65.5604, 71.2885, 75.4113, 79.7368, 84.2351, 88.8833, &
221 & 93.6658, 98.5739, 103.603, 108.752, 114.025, 119.424, &
222 & 124.954, 130.630, 136.457, 142.446, 148.608, 154.956, &
223 & 161.503, 168.262, 175.248, 182.473, 189.952, 197.699, &
224 & 205.728, 214.055, 222.694, 231.661, 240.971, 250.639/)
225
229 & find_cloudlayers, adjust_cloudice, adjust_cloudh2o, &
231
232 public cld_frac_xurandall
233! =================
234 contains
235! =================
236
250 subroutine cld_init &
251 & ( si, nlay, imp_physics, me, con_g, con_rd, errflg, errmsg )
252! =================================================================== !
253! !
254! abstract: cld_init is an initialization program for cloud-radiation !
255! calculations. it sets up boundary layer cloud top. !
256! !
257! !
258! inputs: !
259! si (L+1) : model vertical sigma layer interface !
260! NLAY : vertical layer number !
261! imp_physics : MP identifier !
262! me : print control flag !
263! imp_physics : cloud microphysics scheme control flag !
264! !
265! outputs: !
266! errflg : CCPP error flag !
267! errmsg : CCPP error message !
268! !
269! usage: call cld_init !
270! !
271! subroutines called: rhtable !
272! !
273! =================================================================== !
274!
275 implicit none
276
277! --- inputs:
278 integer, intent(in) :: nlay, me, imp_physics
279
280 real (kind=kind_phys), intent(in) :: si(:), con_g, con_rd
281
282! --- outputs:
283 integer, intent(out) :: errflg
284 character(len=*), intent(out) :: errmsg
285
286!
287!===> ... begin here
288!
289! Initialize CCPP error handling variables
290 errmsg = ''
291 errflg = 0
292
293 ! Initialze module parameters
294 gfac = 1.0e5/con_g
295 gord = con_g/con_rd
296
297 if (me == 0) then
298 print *, vtagcld !print out version tag
299 print *,' - Using Prognostic Cloud Method'
300 if (imp_physics == 11) then
301 print *,' --- GFDL Lin cloud microphysics'
302 elseif (imp_physics == 8) then
303 print *,' --- Thompson cloud microphysics'
304 elseif (imp_physics == 88) then
305 print *,' --- TEMPO cloud microphysics'
306 elseif (imp_physics == 6) then
307 print *,' --- WSM6 cloud microphysics'
308 elseif (imp_physics == 10) then
309 print *,' --- MG cloud microphysics'
310 elseif (imp_physics == 15) then
311 print *,' --- Ferrier-Aligo cloud microphysics'
312 elseif (imp_physics == 17) then
313 print *,' --- NSSL cloud microphysics'
314 else
315 print *,' !!! ERROR in cloud microphysc specification!!!', &
316 & ' imp_physics (NP3D) =',imp_physics
317 errflg = 1
318 errmsg = 'ERROR(cld_init): cloud mp specification is not'// &
319 & ' valid'
320 return
321 endif
322 endif
323!
324!...................................
325 end subroutine cld_init
326!-----------------------------------
327
332 & ( plyr, plvl, tlyr, tvly, qlyr, qstl, rhly, & ! --- inputs:
333 & ccnd, ncndl, cnvw, cnvc, tracer1, &
334 & xlat, xlon, slmsk, dz, delp, ix, lm, nlay, nlp1, &
335 & deltaq, sup, dcorr_con, me, icloud, kdt, &
336 & ntrac, ntcw, ntiw, ntrw, ntsw, ntgl, ntclamt, &
337 & imp_physics, imp_physics_nssl, imp_physics_fer_hires, &
338 & imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, &
339 & imp_physics_tempo, &
340 & imp_physics_mg, iovr, iovr_rand, iovr_maxrand, iovr_max, &
341 & iovr_dcorr, iovr_exp, iovr_exprand, idcor, idcor_con, &
342 & idcor_hogan, idcor_oreopoulos, lcrick, lcnorm, &
343 & imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, &
344 & do_mynnedmf, lgfdlmprad, xr_cnvcld, &
345 & uni_cld, lmfshal, lmfdeep2, cldcov, clouds1, &
346 & effrl, effri, effrr, effrs, effr_in, &
347 & effrl_inout, effri_inout, effrs_inout, &
348 & lwp_ex, iwp_ex, lwp_fc, iwp_fc, &
349 & dzlay, latdeg, julian, yearlen, gridkm, top_at_1, si, &
350 & xr_con, xr_exp, con_ttp, con_pi, con_g, con_rd, con_thgni, &
351 & cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, & ! --- outputs:
352 & cld_rwp, cld_rerain, cld_swp, cld_resnow, &
353 & clds, mtop, mbot, de_lgth, alpha &
354 & )
355
356! ================= subprogram documentation block ================ !
357! !
358! subprogram: radiation_clouds_prop computes cloud related quantities !
359! !
360! abstract: this program computes cloud fractions from cloud !
361! condensates, calculates liquid/ice cloud droplet effective radius, !
362! and computes the low, mid, high, total and boundary layer cloud !
363! fractions and the vertical indices of low, mid, and high cloud !
364! top and base. the three vertical cloud domains are set up in the !
365! initial subroutine "cld_init". !
366! !
367! usage: call radiation_clouds_prop !
368! !
369! subprograms called: !
370! !
371! 'progcld_gfdl_lin' --- GFDL-Lin cloud microphysics !
372! 'progcld_fer_hires' --- Ferrier-Aligo cloud microphysics !
373! 'progcld_thompson_wsm6' --- Thompson/wsm6 cloud microphysics (EMC) !
374! 'progclduni' --- MG cloud microphysics !
375! --- GFDL cloud microphysics (EMC) !
376! --- Thompson + MYNN PBL (or GF convection) !
377! 'progcld_thompson' --- Thompson MP (added by G. Thompson) !
378! 'gethml' --- get diagnostic hi, mid, low clouds !
379! !
380! attributes: !
381! language: fortran 90 !
382! machine: ibm-sp, sgi !
383! !
384! !
385! ==================== definition of variables ==================== !
386! !
387! input variables: !
388! plyr (IX,NLAY) : model layer mean pressure in mb (100Pa) !
389! plvl (IX,NLP1) : model level pressure in mb (100Pa) !
390! tlyr (IX,NLAY) : model layer mean temperature in k !
391! tvly (IX,NLAY) : model layer virtual temperature in k !
392! qlyr (IX,NLAY) : layer specific humidity in gm/gm !
393! qstl (IX,NLAY) : layer saturate humidity in gm/gm !
394! rhly (IX,NLAY) : layer relative humidity (=qlyr/qstl) !
395! ccnd (IX,NLAY,ncndl) : layer cloud condensate amount !
396! water, ice, rain, snow (+ graupel) !
397! ncndl : number of layer cloud condensate types (max of 4) !
398! cnvw (IX,NLAY) : layer convective cloud condensate !
399! cnvc (IX,NLAY) : layer convective cloud cover !
400! tracer1 (IX,NLAY,1:ntrac-1) : all tracers (except sphum) !
401! xlat (IX) : grid latitude in radians, default to pi/2 -> -pi/2!
402! range, otherwise see in-line comment !
403! xlon (IX) : grid longitude in radians (not used) !
404! slmsk (IX) : sea/land mask array (sea:0,land:1,sea-ice:2) !
405! dz (ix,nlay) : layer thickness (km) !
406! delp (ix,nlay) : model layer pressure thickness in mb (100Pa) !
407! IX : horizontal dimention !
408! LM,NLAY,NLP1 : vertical layer/level dimensions !
409! deltaq (ix,nlay), half total water distribution width !
410! sup supersaturation !
411! me print control flag !
412! icloud : cloud effect to the optical depth in radiation !
413! kdt : current time step index !
414! ntrac number of tracers (Model%ntrac) !
415! ntcw tracer index for cloud liquid water (Model%ntcw) !
416! ntiw tracer index for cloud ice water (Model%ntiw) !
417! ntrw tracer index for rain water (Model%ntrw) !
418! ntsw tracer index for snow water (Model%ntsw) !
419! ntgl tracer index for graupel (Model%ntgl) !
420! ntclamt tracer index for cloud amount (Model%ntclamt) !
421! imp_physics : cloud microphysics scheme control flag !
422! imp_physics_nssl : NSSL microphysics !
423! imp_physics_fer_hires : Ferrier-Aligo microphysics scheme !
424! imp_physics_gfdl : GFDL microphysics scheme !
425! imp_physics_thompson : Thompson microphysics scheme !
426! imp_physics_tempo : Tempo microphysics scheme !
427! imp_physics_wsm6 : WSMG microphysics scheme !
428! imp_physics_mg : Morrison-Gettelman microphysics scheme !
429! iovr : choice of cloud-overlap !
430! iovr_rand : flag of cloud-overlap: random (=0) !
431! iovr_maxrand : flag of cloud-overlap: maximum random (=1) !
432! iovr_max : flag of cloud-overlap: maximum (=2) !
433! iovr_dcorr : flag of cloud-overlap: decorrelation length(=3) !
434! iovr_exp : flag of cloud-overlap: exponential (=4) !
435! iovr_exprand : flag of cloud-overlap: exponential random (=5) !
436! idcor : choice for decorrelation-length !
437! idcor_con : flag for decorrelation-length: Use constant value (=0)
438! idcor_hogan : flag for decorrelation-length: (=1) !
439! idcor_oreopoulos: flag for decorrelation-length: (=2) !
440! imfdeepcnv : flag for mass-flux deep convection scheme !
441! imfdeepcnv_gf : flag for scale- & aerosol-aware Grell-Freitas scheme (GSD)
442! imfdeepcnv_c3 : flag for unified convection scheme
443! do_mynnedmf : flag for MYNN-EDMF !
444! lgfdlmprad : flag for GFDLMP radiation interaction !
445! uni_cld : logical - true for cloud fraction from shoc !
446! lmfshal : logical - true for mass flux shallow convection !
447! lmfdeep2 : logical - true for mass flux deep convection !
448! top_at_1 : logical - true if ordered from toa-2-sfc !
449! cldcov : layer cloud fraction (used when uni_cld=.true. !
450! clouds1 : layer total cloud fraction
451! effrl, : effective radius for liquid water
452! effri, : effective radius for ice water
453! effrr, : effective radius for rain water
454! effrs, : effective radius for snow water
455! effr_in, : flag to use effective radii of cloud species in radiation
456! effrl_inout, : eff. radius of cloud liquid water particle
457! effri_inout, : eff. radius of cloud ice water particle
458! effrs_inout : effective radius of cloud snow particle
459! lwp_ex : total liquid water path from explicit microphysics
460! iwp_ex : total ice water path from explicit microphysics
461! lwp_fc : total liquid water path from cloud fraction scheme
462! iwp_fc : total ice water path from cloud fraction scheme
463! dzlay(ix,nlay) : thickness between model layer centers (km) !
464! latdeg(ix) : latitude (in degrees 90 -> -90) !
465! julian : day of the year (fractional julian day) !
466! yearlen : current length of the year (365/366 days) !
467! gridkm : grid length in km !
468! lmfshal : mass-flux shallow conv scheme flag !
469! lmfdeep2 : scale-aware mass-flux deep conv scheme flag !
470! lcrick : control flag for eliminating CRICK !
471! =t: apply layer smoothing to eliminate CRICK !
472! =f: do not apply layer smoothing !
473! lcnorm : control flag for in-cld condensate !
474! =t: normalize cloud condensate !
475! =f: not normalize cloud condensate !
476! !
477! output variables: !
478! cloud profiles: !
479! cld_frac (:,:) - layer total cloud fraction !
480! cld_lwp (:,:) - layer cloud liq water path (g/m**2) !
481! cld_reliq (:,:) - mean eff radius for liq cloud (micron) !
482! cld_iwp (:,:) - layer cloud ice water path (g/m**2) !
483! cld_reice (:,:) - mean eff radius for ice cloud (micron) !
484! cld_rwp (:,:) - layer rain drop water path not assigned !
485! cld_rerain(:,:) - mean eff radius for rain drop (micron) !
486! *** cld_swp (:,:) - layer snow flake water path not assigned !
487! cld_resnow(:,:) - mean eff radius for snow flake (micron) !
488! *** fu's scheme need to be normalized by snow density (g/m**3/1.0e6) !
489! clds (IX,5) : fraction of clouds for low, mid, hi, tot, bl !
490! mtop (IX,3) : vertical indices for low, mid, hi cloud tops !
491! mbot (IX,3) : vertical indices for low, mid, hi cloud bases !
492! de_lgth(ix) : clouds decorrelation length (km) !
493! alpha(ix,nlay) : alpha decorrelation parameter !
494! !
495! ==================== end of description ===================== !
496 implicit none
497
498! --- inputs
499 integer, intent(in) :: ix, lm, nlay, nlp1, me, ncndl, icloud
500 integer, intent(in) :: ntrac, ntcw, ntiw, ntrw, ntsw, ntgl, &
501 & ntclamt
502 integer, intent(in) :: kdt, imfdeepcnv, imfdeepcnv_gf, &
503 & imfdeepcnv_c3
504 integer, intent(in) :: &
505 & imp_physics, ! Flag for MP scheme
506 & imp_physics_nssl, ! Flag for NSSL scheme
507 & imp_physics_fer_hires, ! Flag for fer-hires scheme
508 & imp_physics_gfdl, ! Flag for gfdl scheme
509 & imp_physics_thompson, ! Flag for thompsonscheme
510 & imp_physics_tempo, ! Flag for TEMPO scheme
511 & imp_physics_wsm6, ! Flag for wsm6 scheme
512 & imp_physics_mg ! Flag for MG scheme
513
514 integer, intent(in) :: &
515 & iovr, !
516 & iovr_rand, ! Flag for random cloud overlap method
517 & iovr_maxrand, ! Flag for maximum-random cloud overlap method
518 & iovr_max, ! Flag for maximum cloud overlap method
519 & iovr_dcorr, ! Flag for decorrelation-length cloud overlap method
520 & iovr_exp, ! Flag for exponential cloud overlap method
521 & iovr_exprand, ! Flag for exponential-random cloud overlap method
522 & idcor,
523 & idcor_con,
524 & idcor_hogan,
525 & idcor_oreopoulos
526
527
528 logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, effr_in, &
529 & do_mynnedmf, lgfdlmprad, top_at_1, lcrick, lcnorm, &
530 & xr_cnvcld
531
532 real (kind=kind_phys), dimension(:,:,:), intent(in) :: ccnd, &
533 & tracer1
534 real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, &
535 & tlyr, tvly, qlyr, qstl, rhly, cnvw, cnvc, cldcov, &
536 & delp, dz, effrl, effri, effrr, effrs, dzlay, clouds1
537
538 real (kind=kind_phys), intent(in) :: sup, dcorr_con, con_ttp, &
539 & con_pi, con_g, con_rd, con_thgni, xr_con, xr_exp
540 real (kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, &
541 & slmsk, si
542
543 real(kind=kind_phys), dimension(:), intent(in) :: latdeg, gridkm
544 real(kind=kind_phys), intent(in) :: julian
545 integer, intent(in) :: yearlen
546
547! --- inout
548 real(kind=kind_phys),dimension(:,:) :: deltaq
549 real(kind=kind_phys),dimension(:,:),intent(inout) :: &
550 & effrl_inout, effri_inout, effrs_inout
551 real(kind=kind_phys), dimension(:), intent(inout) :: &
552 & lwp_ex, iwp_ex, lwp_fc, iwp_fc
553
554! --- outputs
555
556 real (kind=kind_phys), dimension(:,:), intent(out) :: &
557 & cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, &
558 & cld_rwp, cld_rerain, cld_swp, cld_resnow
559 real (kind=kind_phys), dimension(:,:), intent(out) :: clds
560 real (kind=kind_phys), dimension(:), intent(out) :: de_lgth
561 real (kind=kind_phys), dimension(:,:), intent(out) :: alpha
562
563 integer, dimension(:,:), intent(out) :: mtop,mbot
564
565! --- local variables:
566 real (kind=kind_phys), dimension(IX,NLAY) :: cldtot, cldcnv, &
567 & cwp, cip, crp, csp, rew, rei, res, rer, tem2d, clwf
568
569 real (kind=kind_phys) :: ptop1(ix,nk_clds+1), rxlat(ix)
570
571 real (kind=kind_phys) :: clwmin, clwm, clwt, onemrh, value, &
572 & tem1, tem2, tem3
573
574 integer :: i, k, id, nf
575
576!
577!===> ... begin here
578!
579 if (me == 0 .and. kdt == 1) then &
580 print*, 'in radiation_clouds_prop=', imp_physics, uni_cld, &
581 & ncndl, lgfdlmprad, do_mynnedmf, imfdeepcnv, kdt
582 end if
583
584 do k = 1, nlay
585 do i = 1, ix
586 cld_frac(i,k) = 0.0
587 cld_lwp(i,k) = 0.0
588 cld_reliq(i,k) = 0.0
589 cld_iwp(i,k) = 0.0
590 cld_reice(i,k) = 0.0
591 cld_rwp(i,k) = 0.0
592 cld_rerain(i,k) = 0.0
593 cld_swp(i,k) = 0.0
594 cld_resnow(i,k) = 0.0
595 enddo
596 enddo
597
598 do k = 1, nlay
599 do i = 1, ix
600 cldtot(i,k) = 0.0
601 cldcnv(i,k) = 0.0
602 end do
603 end do
604
605 if (imp_physics == imp_physics_mg) then !
606 ! unified cloud and/or with MG microphysics
607
608 if (uni_cld .and. ncndl >= 2) then
609 call progclduni (plyr, plvl, tlyr, tvly, ccnd, ncndl, & ! --- inputs
610 & xlat, xlon, slmsk, dz, delp, &
611 & ix, nlay, nlp1, cldcov, &
612 & effrl, effri, effrr, effrs, effr_in, &
613 & dzlay, &
614 & cldtot, cldcnv, lcrick, lcnorm, con_ttp, & ! inout
615 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
616 & cld_reice,cld_rwp, cld_rerain,cld_swp, &
617 & cld_resnow)
618 endif
619
620 elseif (imp_physics == imp_physics_gfdl) then ! GFDL cloud scheme
621
622 if (.not. lgfdlmprad) then
623 call progcld_gfdl_lin (plyr, plvl, tlyr, tvly, qlyr, & ! --- inputs
624 & qstl, rhly, ccnd(1:ix,1:nlay,1), cnvw, cnvc, &
625 & xlat, xlon, slmsk, cldcov, dz, delp, &
626 & ix, nlay, nlp1, dzlay, &
627 & cldtot, cldcnv, lcrick, lcnorm, con_ttp, & ! inout
628 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
629 & cld_reice,cld_rwp, cld_rerain,cld_swp, &
630 & cld_resnow)
631 else
632
633 call progclduni (plyr, plvl, tlyr, tvly, ccnd, ncndl, xlat, & ! --- inputs
634 & xlon, slmsk, dz,delp, ix, nlay, nlp1, cldcov, &
635 & effrl, effri, effrr, effrs, effr_in, &
636 & dzlay, &
637 & cldtot, cldcnv, lcrick, lcnorm, con_ttp, & ! inout
638 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
639 & cld_reice,cld_rwp, cld_rerain,cld_swp, &
640 & cld_resnow)
641 endif
642
643
644 elseif(imp_physics == imp_physics_fer_hires) then
645 if (kdt == 1) then
646 effrl_inout(:,:) = 10.
647 effri_inout(:,:) = 50.
648 effrs_inout(:,:) = 250.
649 endif
650
651 call progcld_fer_hires (plyr,plvl,tlyr,tvly,qlyr,qstl,rhly, & ! --- inputs
652 & tracer1,xlat,xlon,slmsk,dz,delp, &
653 & ntrac-1, ntcw-1,ntiw-1,ntrw-1, &
654 & ix,nlay,nlp1, icloud, xr_con, xr_exp, uni_cld,&
655 & lmfshal, lmfdeep2, &
656 & cldcov(:,1:nlay),effrl_inout(:,:), &
657 & effri_inout(:,:), effrs_inout(:,:), &
658 & dzlay, &
659 & cldtot, cldcnv, lcnorm, & ! inout
660 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
661 & cld_reice,cld_rwp, cld_rerain,cld_swp, &
662 & cld_resnow)
663
664 elseif ( imp_physics == imp_physics_nssl ) then ! NSSL MP
665
666 if(do_mynnedmf .or. imfdeepcnv == imfdeepcnv_gf .or. &
667 & imfdeepcnv == imfdeepcnv_c3) then ! MYNN PBL or GF or unified conv
668 !-- MYNN PBL or convective GF
669 !-- use cloud fractions with SGS clouds
670 do k=1,nlay
671 do i=1,ix
672 cld_frac(i,k) = clouds1(i,k)
673 enddo
674 enddo
675
676 ! --- use clduni with the NSSL microphysics.
677 ! --- make sure that effr_in=.true. in the input.nml!
678 call progclduni (plyr, plvl, tlyr, tvly, ccnd, ncndl, & ! --- inputs
679 & xlat, xlon, slmsk, dz, delp, ix, nlay, nlp1, &
680 & cld_frac, &
681 & effrl, effri, effrr, effrs, effr_in , &
682 & dzlay, &
683 & cldtot, cldcnv, lcrick, lcnorm, con_ttp, & ! inout
684 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
685 & cld_reice,cld_rwp, cld_rerain,cld_swp, &
686 & cld_resnow)
687 else
688 ! MYNN PBL or GF convective are not used
689 call progcld_thompson_wsm6 (plyr,plvl,tlyr,qlyr,qstl, & ! --- inputs
690 & rhly,tracer1,xlat,xlon,slmsk,dz,delp, &
691 & ntrac-1, ntcw-1,ntiw-1,ntrw-1, &
692 & ntsw-1,ntgl-1,con_ttp,xr_cnvcld, &
693 & ix, nlay, nlp1, xr_con, xr_exp, uni_cld, &
694 & lmfshal, lmfdeep2, &
695 & cldcov(:,1:nlay), cnvw, effrl_inout, &
696 & effri_inout, effrs_inout, &
697 & lwp_ex, iwp_ex, lwp_fc, iwp_fc, &
698 & dzlay, &
699 & cldtot, cldcnv, lcnorm, & ! inout
700 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
701 & cld_reice,cld_rwp, cld_rerain,cld_swp, &
702 & cld_resnow)
703 endif ! MYNN PBL or GF
704
705 elseif(imp_physics == imp_physics_thompson &
706 & .or. imp_physics == imp_physics_tempo) then ! Thompson/TEMPO MP
707
708 if(do_mynnedmf .or. imfdeepcnv == imfdeepcnv_gf &
709 & .or. imfdeepcnv == imfdeepcnv_c3) then ! MYNN PBL or GF conv
710
711 if (icloud == 3) then
712 call progcld_thompson (plyr,plvl,tlyr,qlyr,qstl,rhly, & ! --- inputs
713 & tracer1,xlat,xlon,slmsk,dz,delp, &
714 & ntrac-1, ntcw-1,ntiw-1,ntrw-1, &
715 & ntsw-1,ntgl-1, &
716 & ix, lm, nlp1, uni_cld, lmfshal, lmfdeep2, &
717 & cldcov(:,1:lm), effrl, effri, effrs, &
718 & lwp_ex, iwp_ex, lwp_fc, iwp_fc, &
719 & dzlay, gridkm, top_at_1, &
720 & cldtot, cldcnv, & ! inout
721 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
722 & cld_reice,cld_rwp, cld_rerain,cld_swp, &
723 & cld_resnow)
724 else
725
726 !-- MYNN PBL or convective GF
727 !-- use cloud fractions with SGS clouds
728 do k=1,nlay
729 do i=1,ix
730 cld_frac(i,k) = clouds1(i,k)
731 enddo
732 enddo
733
734 ! --- use clduni as with the GFDL microphysics.
735 ! --- make sure that effr_in=.true. in the input.nml!
736 call progclduni (plyr, plvl, tlyr, tvly, ccnd, ncndl, & ! --- inputs
737 & xlat, xlon, slmsk, dz, delp, ix, nlay, nlp1, &
738 & cld_frac, &
739 & effrl, effri, effrr, effrs, effr_in , &
740 & dzlay, &
741 & cldtot, cldcnv, lcrick, lcnorm, con_ttp, & ! inout
742 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
743 & cld_reice,cld_rwp, cld_rerain,cld_swp, &
744 & cld_resnow)
745 endif
746
747 else
748 ! MYNN PBL or GF convective are not used
749
750 if (icloud == 3) then
751 call progcld_thompson (plyr,plvl,tlyr,qlyr,qstl,rhly, & ! --- inputs
752 & tracer1,xlat,xlon,slmsk,dz,delp, &
753 & ntrac-1, ntcw-1,ntiw-1,ntrw-1, &
754 & ntsw-1,ntgl-1, &
755 & ix, lm, nlp1, uni_cld, lmfshal, lmfdeep2, &
756 & cldcov(:,1:lm), effrl, effri, effrs, &
757 & lwp_ex, iwp_ex, lwp_fc, iwp_fc, &
758 & dzlay, gridkm, top_at_1, &
759 & cldtot, cldcnv, & ! inout
760 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
761 & cld_reice,cld_rwp, cld_rerain,cld_swp, &
762 & cld_resnow)
763
764 else
765 call progcld_thompson_wsm6 (plyr,plvl,tlyr,qlyr,qstl, & ! --- inputs
766 & rhly,tracer1,xlat,xlon,slmsk,dz,delp, &
767 & ntrac-1, ntcw-1,ntiw-1,ntrw-1, &
768 & ntsw-1,ntgl-1,con_ttp,xr_cnvcld, &
769 & ix, nlay, nlp1, xr_con, xr_exp, uni_cld, &
770 & lmfshal, lmfdeep2, &
771 & cldcov(:,1:nlay), cnvw, effrl, effri, effrs, &
772 & lwp_ex, iwp_ex, lwp_fc, iwp_fc, &
773 & dzlay, &
774 & cldtot, cldcnv, lcnorm, & ! inout
775 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
776 & cld_reice,cld_rwp, cld_rerain,cld_swp, &
777 & cld_resnow)
778 endif
779 endif ! MYNN PBL or GF
780
781 endif ! end if_imp_physics
782
785! ptopc(k,i): top presure of each cld domain (k=1-4 are sfc,L,m,h;
786! --- i=1,2 are low-lat (<45 degree) and pole regions)
787
788 do i =1, ix
789 rxlat(i) = abs( xlat(i) / con_pi ) ! if xlat in pi/2 -> -pi/2 range
790! rxlat(i) = abs(0.5 - xlat(i)/con_pi) ! if xlat in 0 -> pi range
791 enddo
792
793 do id = 1, 4
794 tem1 = ptopc(id,2) - ptopc(id,1)
795
796 do i =1, ix
797 ptop1(i,id) = ptopc(id,1) + tem1*max( 0.0, 4.0*rxlat(i)-1.0 )
798 enddo
799 enddo
800
801 ! Compute cloud decorrelation length
802 if (idcor == idcor_hogan) then
803 call cmp_dcorr_lgth(ix, xlat, con_pi, de_lgth)
804 endif
805 if (idcor == idcor_oreopoulos) then
806 call cmp_dcorr_lgth(ix, latdeg, julian, yearlen, de_lgth)
807 endif
808 if (idcor == idcor_con) then
809 de_lgth(:) = dcorr_con
810 endif
811
812 ! Call subroutine get_alpha_exper to define alpha parameter for exponential cloud overlap options
813 if ( iovr == iovr_dcorr .or. iovr == iovr_exp &
814 & .or. iovr == iovr_exprand) then
815 call get_alpha_exper(ix, nlay, iovr, iovr_exprand, dzlay, &
816 & de_lgth, cld_frac, alpha)
817 else
818 de_lgth(:) = 0.
819 alpha(:,:) = 0.
820 endif
821
825! --- compute low, mid, high, total, and boundary layer cloud fractions
826! and clouds top/bottom layer indices for low, mid, and high clouds.
827! The three cloud domain boundaries are defined by ptopc. The cloud
828! overlapping method is defined by control flag 'iovr', which may
829! be different for lw and sw radiation programs.
830
831 call gethml &
832! --- inputs:
833 & ( plyr, ptop1, cldtot, cldcnv, dz, de_lgth, alpha, &
834 & ix, nlay, iovr, iovr_rand, iovr_maxrand, iovr_max, &
835 & iovr_dcorr, iovr_exp, iovr_exprand, top_at_1, si, &
836! --- outputs:
837 & clds, mtop, mbot &
838 & )
839
840!...................................
841 end subroutine radiation_clouds_prop
842
843
844!-----------------------------------
848 subroutine progcld_gfdl_lin &
849 & ( plyr,plvl,tlyr,tvly,qlyr,qstl,rhly,clw,cnvw,cnvc, & ! --- inputs:
850 & xlat,xlon,slmsk,cldtot, dz, delp, &
851 & ix, nlay, nlp1, &
852 & dzlay, cldtot1, cldcnv, lcrick, lcnorm, con_ttp, &
853 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
854 & cld_reice,cld_rwp, cld_rerain,cld_swp, cld_resnow &
855 & )
856
857! ================= subprogram documentation block ================ !
858! !
859! subprogram: progcld_gfdl_lin computes cloud related quantities using !
860! GFDL Lin MP prognostic cloud microphysics scheme. !
861! !
862! abstract: this program computes cloud fractions from cloud !
863! condensates, calculates liquid/ice cloud droplet effective radius, !
864! and computes the low, mid, high, total and boundary layer cloud !
865! fractions and the vertical indices of low, mid, and high cloud !
866! top and base. the three vertical cloud domains are set up in the !
867! initial subroutine "cld_init". !
868! !
869! usage: call progcld_gfdl_lin !
870! !
871! attributes: !
872! language: fortran 90 !
873! machine: ibm-sp, sgi !
874! !
875! !
876! ==================== definition of variables ==================== !
877! !
878! input variables: !
879! plyr (IX,NLAY) : model layer mean pressure in mb (100Pa) !
880! plvl (IX,NLP1) : model level pressure in mb (100Pa) !
881! tlyr (IX,NLAY) : model layer mean temperature in k !
882! tvly (IX,NLAY) : model layer virtual temperature in k !
883! qlyr (IX,NLAY) : layer specific humidity in gm/gm !
884! qstl (IX,NLAY) : layer saturate humidity in gm/gm !
885! rhly (IX,NLAY) : layer relative humidity (=qlyr/qstl) !
886! clw (IX,NLAY) : layer cloud condensate amount !
887! cnvw (IX,NLAY) : layer convective cloud condensate !
888! cnvc (IX,NLAY) : layer convective cloud cover !
889! xlat (IX) : grid latitude in radians, default to pi/2 -> -pi/2!
890! range, otherwise see in-line comment !
891! xlon (IX) : grid longitude in radians (not used) !
892! slmsk (IX) : sea/land mask array (sea:0,land:1,sea-ice:2) !
893! dz (ix,nlay) : layer thickness (km) !
894! delp (ix,nlay) : model layer pressure thickness in mb (100Pa) !
895! IX : horizontal dimention !
896! NLAY,NLP1 : vertical layer/level dimensions !
897! dzlay(ix,nlay) : thickness between model layer centers (km) !
898! lcrick : control flag for eliminating CRICK !
899! =t: apply layer smoothing to eliminate CRICK !
900! =f: do not apply layer smoothing !
901! lcnorm : control flag for in-cld condensate !
902! =t: normalize cloud condensate !
903! =f: not normalize cloud condensate !
904! !
905! output variables: !
906! cloud profiles: !
907! cld_frac (:,:) - layer total cloud fraction !
908! cld_lwp (:,:) - layer cloud liq water path (g/m**2) !
909! cld_reliq (:,:) - mean eff radius for liq cloud (micron) !
910! cld_iwp (:,:) - layer cloud ice water path (g/m**2) !
911! cld_reice (:,:) - mean eff radius for ice cloud (micron) !
912! cld_rwp (:,:) - layer rain drop water path not assigned !
913! cld_rerain(:,:) - mean eff radius for rain drop (micron) !
914! *** cld_swp (:,:) - layer snow flake water path not assigned !
915! cld_resnow(:,:) - mean eff radius for snow flake (micron) !
916! !
917! ==================== end of description ===================== !
918!
919 implicit none
920
921! --- inputs
922 integer, intent(in) :: ix, nlay, nlp1
923 logical, intent(in) :: lcrick, lcnorm
924 real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, &
925 & tlyr, tvly, qlyr, qstl, rhly, clw, cldtot, cnvw, cnvc, &
926 & delp, dz, dzlay
927 real (kind=kind_phys) :: con_ttp
928
929 real (kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, &
930 & slmsk
931
932 real (kind=kind_phys), dimension(:,:), intent(inout) :: cldtot1
933
934! --- inputs/outputs
935
936 real (kind=kind_phys), dimension(:,:), intent(inout) :: &
937 & cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, &
938 & cld_rwp, cld_rerain, cld_swp, cld_resnow
939
940! --- local variables:
941 real (kind=kind_phys), dimension(IX,NLAY) :: cldcnv, &
942 & cwp, cip, crp, csp, rew, rei, res, rer, tem2d, clwf
943
944 real (kind=kind_phys) :: clwmin, clwm, clwt, onemrh, value, &
945 & tem1, tem2, tem3
946
947 integer :: i, k, id, nf
948
949!
950!===> ... begin here
951!
953 do k = 1, nlay
954 do i = 1, ix
955 cldcnv(i,k) = 0.0
956 cwp(i,k) = 0.0
957 cip(i,k) = 0.0
958 crp(i,k) = 0.0
959 csp(i,k) = 0.0
960 rew(i,k) = reliq_def
961 rei(i,k) = reice_def
962 rer(i,k) = rrain_def
963 res(i,k) = rsnow_def
964 tem2d(i,k) = min( 1.0, max( 0.0, (con_ttp-tlyr(i,k))*0.05 ) )
965 clwf(i,k) = 0.0
966 enddo
967 enddo
968!
969 if ( lcrick ) then
970 do i = 1, ix
971 clwf(i,1) = 0.75*clw(i,1) + 0.25*clw(i,2)
972 clwf(i,nlay) = 0.75*clw(i,nlay) + 0.25*clw(i,nlay-1)
973 enddo
974 do k = 2, nlay-1
975 do i = 1, ix
976 clwf(i,k) = 0.25*clw(i,k-1) + 0.5*clw(i,k) + 0.25*clw(i,k+1)
977 enddo
978 enddo
979 else
980 do k = 1, nlay
981 do i = 1, ix
982 clwf(i,k) = clw(i,k)
983 enddo
984 enddo
985 endif
986
988
989 do k = 1, nlay
990 do i = 1, ix
991 clwt = max(0.0,(clwf(i,k)+cnvw(i,k))) * gfac * delp(i,k)
992 cip(i,k) = clwt * tem2d(i,k)
993 cwp(i,k) = clwt - cip(i,k)
994 enddo
995 enddo
996
998
999 do i = 1, ix
1000 if (nint(slmsk(i)) == 1) then
1001 do k = 1, nlay
1002 rew(i,k) = 5.0 + 5.0 * tem2d(i,k)
1003 enddo
1004 endif
1005 enddo
1006
1007 do k = 1, nlay
1008 do i = 1, ix
1009 if (cldtot(i,k) < climit) then
1010 cwp(i,k) = 0.0
1011 cip(i,k) = 0.0
1012 crp(i,k) = 0.0
1013 csp(i,k) = 0.0
1014 endif
1015 enddo
1016 enddo
1017
1018 if ( lcnorm ) then
1019 do k = 1, nlay
1020 do i = 1, ix
1021 if (cldtot(i,k) >= climit) then
1022 tem1 = 1.0 / max(climit2, cldtot(i,k))
1023 cwp(i,k) = cwp(i,k) * tem1
1024 cip(i,k) = cip(i,k) * tem1
1025 crp(i,k) = crp(i,k) * tem1
1026 csp(i,k) = csp(i,k) * tem1
1027 endif
1028 enddo
1029 enddo
1030 endif
1031
1034
1035 do k = 1, nlay
1036 do i = 1, ix
1037 tem2 = tlyr(i,k) - con_ttp
1038
1039 if (cip(i,k) > 0.0) then
1040 tem3 = gord * cip(i,k) * plyr(i,k) / (delp(i,k)*tvly(i,k))
1041
1042 if (tem2 < -50.0) then
1043 rei(i,k) = (1250.0/9.917) * tem3 ** 0.109
1044 elseif (tem2 < -40.0) then
1045 rei(i,k) = (1250.0/9.337) * tem3 ** 0.08
1046 elseif (tem2 < -30.0) then
1047 rei(i,k) = (1250.0/9.208) * tem3 ** 0.055
1048 else
1049 rei(i,k) = (1250.0/9.387) * tem3 ** 0.031
1050 endif
1051! rei(i,k) = max(20.0, min(rei(i,k), 300.0))
1052! rei(i,k) = max(10.0, min(rei(i,k), 100.0))
1053 rei(i,k) = max(10.0, min(rei(i,k), 150.0))
1054! rei(i,k) = max(5.0, min(rei(i,k), 130.0))
1055 endif
1056 enddo
1057 enddo
1058
1059 do k = 1, nlay
1060 do i = 1, ix
1061 cldtot1(i,k) = cldtot(i,k)
1062 enddo
1063 enddo
1064
1065!
1066 do k = 1, nlay
1067 do i = 1, ix
1068 cld_frac(i,k) = cldtot(i,k)
1069 cld_lwp(i,k) = cwp(i,k)
1070 cld_reliq(i,k) = rew(i,k)
1071 cld_iwp(i,k) = cip(i,k)
1072 cld_reice(i,k) = rei(i,k)
1073! cld_rwp(i,k) = 0.0
1074 cld_rerain(i,k) = rer(i,k)
1075! cld_swp(i,k) = 0.0
1076 cld_resnow(i,k) = res(i,k)
1077 enddo
1078 enddo
1079!
1080!...................................
1081 end subroutine progcld_gfdl_lin
1082!-----------------------------------
1083
1084!-----------------------------------
1088 & ( plyr,plvl,tlyr,tvly,qlyr,qstl,rhly,clw, & ! --- inputs:
1089 & xlat,xlon,slmsk,dz,delp, &
1090 & ntrac,ntcw,ntiw,ntrw, &
1091 & ix, nlay, nlp1, icloud, xr_con, xr_exp, &
1092 & uni_cld, lmfshal, lmfdeep2, cldcov, &
1093 & re_cloud,re_ice,re_snow, &
1094 & dzlay, cldtot, cldcnv, lcnorm, &
1095 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
1096 & cld_reice,cld_rwp, cld_rerain,cld_swp, cld_resnow &
1097 & )
1098
1099! ================= subprogram documentation block ================ !
1100! !
1101! subprogram: progcld_fer_hires computes cloud related quantities using !
1102! Ferrier-Aligo cloud microphysics scheme. !
1103! !
1104! abstract: this program computes cloud fractions from cloud !
1105! condensates, !
1106! and computes the low, mid, high, total and boundary layer cloud !
1107! fractions and the vertical indices of low, mid, and high cloud !
1108! top and base. the three vertical cloud domains are set up in the !
1109! initial subroutine "cld_init". !
1110! !
1111! usage: call progcld_fer_hires !
1112! !
1113! attributes: !
1114! language: fortran 90 !
1115! machine: ibm-sp, sgi !
1116! !
1117! !
1118! ==================== definition of variables ==================== !
1119! !
1120! input variables: !
1121! plyr (IX,NLAY) : model layer mean pressure in mb (100Pa) !
1122! plvl (IX,NLP1) : model level pressure in mb (100Pa) !
1123! tlyr (IX,NLAY) : model layer mean temperature in k !
1124! tvly (IX,NLAY) : model layer virtual temperature in k !
1125! qlyr (IX,NLAY) : layer specific humidity in gm/gm !
1126! qstl (IX,NLAY) : layer saturate humidity in gm/gm !
1127! rhly (IX,NLAY) : layer relative humidity (=qlyr/qstl) !
1128! clw (IX,NLAY,ntrac) : layer cloud condensate amount !
1129! xlat (IX) : grid latitude in radians, default to pi/2 -> -pi/2!
1130! range, otherwise see in-line comment !
1131! xlon (IX) : grid longitude in radians (not used) !
1132! slmsk (IX) : sea/land mask array (sea:0,land:1,sea-ice:2) !
1133! dz (ix,nlay) : layer thickness (km) !
1134! delp (ix,nlay) : model layer pressure thickness in mb (100Pa) !
1135! IX : horizontal dimention !
1136! NLAY,NLP1 : vertical layer/level dimensions !
1137! icloud : cloud effect to the optical depth in radiation !
1138! uni_cld : logical - true for cloud fraction from shoc !
1139! lmfshal : logical - true for mass flux shallow convection !
1140! lmfdeep2 : logical - true for mass flux deep convection !
1141! cldcov : layer cloud fraction (used when uni_cld=.true. !
1142! dzlay(ix,nlay) : thickness between model layer centers (km) !
1143! lmfshal : mass-flux shallow conv scheme flag !
1144! lmfdeep2 : scale-aware mass-flux deep conv scheme flag !
1145! lcrick : control flag for eliminating CRICK !
1146! =t: apply layer smoothing to eliminate CRICK !
1147! =f: do not apply layer smoothing !
1148! lcnorm : control flag for in-cld condensate !
1149! =t: normalize cloud condensate !
1150! =f: not normalize cloud condensate !
1151! !
1152! output variables: !
1153! cloud profiles: !
1154! cld_frac (:,:) - layer total cloud fraction !
1155! cld_lwp (:,:) - layer cloud liq water path (g/m**2) !
1156! cld_reliq (:,:) - mean eff radius for liq cloud (micron) !
1157! cld_iwp (:,:) - layer cloud ice water path (g/m**2) !
1158! cld_reice (:,:) - mean eff radius for ice cloud (micron) !
1159! cld_rwp (:,:) - layer rain drop water path not assigned !
1160! cld_rerain(:,:) - mean eff radius for rain drop (micron) !
1161! *** cld_swp (:,:) - layer snow flake water path not assigned !
1162! cld_resnow(:,:) - mean eff radius for snow flake (micron) !
1163! !
1164! ==================== end of description ===================== !
1165!
1166 implicit none
1167
1168! --- inputs
1169 integer, intent(in) :: ix, nlay, nlp1, icloud
1170 integer, intent(in) :: ntrac, ntcw, ntiw, ntrw
1171
1172 logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, lcnorm
1173
1174 real (kind=kind_phys), intent(in) :: xr_con, xr_exp
1175 real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, &
1176 & tlyr, tvly, qlyr, qstl, rhly, cldcov, delp, dz, dzlay
1177
1178 real (kind=kind_phys), dimension(:,:), intent(inout) :: &
1179 & re_cloud, re_ice, re_snow
1180
1181 real (kind=kind_phys), dimension(:,:,:), intent(in) :: clw
1182
1183 real (kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, &
1184 & slmsk
1185
1186! --- inputs/outputs
1187
1188 real (kind=kind_phys), dimension(:,:), intent(inout) :: &
1189 & cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, &
1190 & cld_rwp, cld_rerain, cld_swp, cld_resnow
1191
1192! --- local variables:
1193 real (kind=kind_phys), dimension(IX,NLAY) :: cldtot, cldcnv, &
1194 & cwp, cip, crp, csp, rew, rei, res, rer, tem2d, clwf
1195
1196 real (kind=kind_phys) :: clwmin, clwm, clwt, onemrh, value, &
1197 & tem1, tem2, tem3
1198
1199 real (kind=kind_phys) :: xrc3
1200
1201 integer :: i, k, id, nf
1202
1203!
1204!===> ... begin here
1205!
1206 do k = 1, nlay
1207 do i = 1, ix
1208 cldtot(i,k) = 0.0
1209 cldcnv(i,k) = 0.0
1210 cwp(i,k) = 0.0
1211 cip(i,k) = 0.0
1212 crp(i,k) = 0.0
1213 csp(i,k) = 0.0
1214 rew(i,k) = re_cloud(i,k)
1215 rei(i,k) = re_ice(i,k)
1216 rer(i,k) = rrain_def ! default rain radius to 1000 micron
1217 res(i,k) = re_snow(i,k)
1218! tem2d (i,k) = min( 1.0, max( 0.0, (con_ttp-tlyr(i,k))*0.05 ) )
1219 clwf(i,k) = 0.0
1220 enddo
1221 enddo
1222!
1223! if ( lcrick ) then
1224! do i = 1, IX
1225! clwf(i,1) = 0.75*clw(i,1) + 0.25*clw(i,2)
1226! clwf(i,nlay) = 0.75*clw(i,nlay) + 0.25*clw(i,nlay-1)
1227! enddo
1228! do k = 2, NLAY-1
1229! do i = 1, IX
1230! clwf(i,K) = 0.25*clw(i,k-1) + 0.5*clw(i,k) + 0.25*clw(i,k+1)
1231! enddo
1232! enddo
1233! else
1234! do k = 1, NLAY
1235! do i = 1, IX
1236! clwf(i,k) = clw(i,k)
1237! enddo
1238! enddo
1239! endif
1240
1241 do k = 1, nlay
1242 do i = 1, ix
1243 clwf(i,k) = clw(i,k,ntcw) + clw(i,k,ntiw)
1244 enddo
1245 enddo
1246
1248
1249 do k = 1, nlay
1250 do i = 1, ix
1251 cwp(i,k) = max(0.0, clw(i,k,ntcw) * gfac * delp(i,k))
1252 cip(i,k) = max(0.0, clw(i,k,ntiw) * gfac * delp(i,k))
1253 crp(i,k) = max(0.0, clw(i,k,ntrw) * gfac * delp(i,k))
1254 csp(i,k) = 0.0
1255 enddo
1256 enddo
1257
1258!mz* if (uni_cld) then ! use unified sgs clouds generated outside
1259!mz* use unified sgs clouds generated outside
1260 if (uni_cld) then
1261 do k = 1, nlay
1262 do i = 1, ix
1263 cldtot(i,k) = cldcov(i,k)
1264 enddo
1265 enddo
1266
1267 else
1268
1270
1271 if (.not. lmfshal) then
1272 xrc3 = xr_con
1273 do k = 1, nlay-1
1274 do i = 1, ix
1275 cldtot(i,k) = cld_frac_xurandall(plyr(i,k), qstl(i,k), &
1276 & rhly(i,k), clwf(i,k), xrc3, xr_exp, 0.)
1277 end do
1278 end do
1279 else
1280 xrc3 = 100.
1281 if (lmfdeep2) xrc3 = xr_con
1282 do k = 1, nlay-1
1283 do i = 1, ix
1284 cldtot(i,k) = cld_frac_xurandall(plyr(i,k), qstl(i,k), &
1285 & rhly(i,k), clwf(i,k), xrc3, xr_exp, 0.)
1286 end do
1287 end do
1288 endif
1289
1290 endif ! if (uni_cld) then
1291
1292 do k = 1, nlay
1293 do i = 1, ix
1294 if (cldtot(i,k) < climit) then
1295 cldtot(i,k) = 0.0
1296 cwp(i,k) = 0.0
1297 cip(i,k) = 0.0
1298 crp(i,k) = 0.0
1299 csp(i,k) = 0.0
1300 endif
1301 enddo
1302 enddo
1303
1304 if ( lcnorm ) then
1305 do k = 1, nlay
1306 do i = 1, ix
1307 if (cldtot(i,k) >= climit) then
1308 tem1 = 1.0 / max(climit2, cldtot(i,k))
1309 cwp(i,k) = cwp(i,k) * tem1
1310 cip(i,k) = cip(i,k) * tem1
1311 crp(i,k) = crp(i,k) * tem1
1312 csp(i,k) = csp(i,k) * tem1
1313 endif
1314 enddo
1315 enddo
1316 endif
1317!
1318 do k = 1, nlay
1319 do i = 1, ix
1320 cld_frac(i,k) = cldtot(i,k)
1321 cld_lwp(i,k) = cwp(i,k)
1322 cld_reliq(i,k) = rew(i,k)
1323 cld_iwp(i,k) = cip(i,k)
1324 cld_reice(i,k) = rei(i,k)
1325 cld_rwp(i,k) = crp(i,k)
1326 cld_rerain(i,k) = rer(i,k)
1327 cld_swp(i,k) = 0.0
1328 cld_resnow(i,k) = 10.0
1329 re_cloud(i,k) = rew(i,k)
1330 re_ice(i,k) = rei(i,k)
1331 re_snow(i,k) = 10.
1332 enddo
1333 enddo
1334!
1335!...................................
1336 end subroutine progcld_fer_hires
1337!...................................
1338
1339
1342 & ( plyr,plvl,tlyr,qlyr,qstl,rhly,clw, & ! --- inputs:
1343 & xlat,xlon,slmsk,dz,delp, &
1344 & ntrac,ntcw,ntiw,ntrw,ntsw,ntgl,con_ttp, &
1345 & xr_cnvcld, ix, nlay, nlp1, xr_con, xr_exp, &
1346 & uni_cld, lmfshal, lmfdeep2, cldcov, cnvw, &
1347 & re_cloud,re_ice,re_snow, &
1348 & lwp_ex, iwp_ex, lwp_fc, iwp_fc, &
1349 & dzlay, cldtot, cldcnv, lcnorm, &
1350 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
1351 & cld_reice,cld_rwp, cld_rerain,cld_swp, cld_resnow &
1352 & )
1353
1354! ================= subprogram documentation block ================ !
1355! !
1356! subprogram: progcld_thompson_wsm6 !
1357! computes cloud related quantities using !
1358! Thompson/WSM6/NSSL cloud microphysics scheme. !
1359! !
1360! abstract: this program computes cloud fractions from cloud !
1361! condensates, !
1362! and computes the low, mid, high, total and boundary layer cloud !
1363! fractions and the vertical indices of low, mid, and high cloud !
1364! top and base. the three vertical cloud domains are set up in the !
1365! initial subroutine "cld_init". !
1366! !
1367! usage: call progcld_thompson_wsm6 !
1368! !
1369! attributes: !
1370! language: fortran 90 !
1371! machine: ibm-sp, sgi !
1372! !
1373! !
1374! ==================== definition of variables ==================== !
1375! !
1376! !
1377! input variables: !
1378! plyr (IX,NLAY) : model layer mean pressure in mb (100Pa) !
1379! plvl (IX,NLP1) : model level pressure in mb (100Pa) !
1380! tlyr (IX,NLAY) : model layer mean temperature in k !
1381! tvly (IX,NLAY) : model layer virtual temperature in k !
1382! qlyr (IX,NLAY) : layer specific humidity in gm/gm !
1383! qstl (IX,NLAY) : layer saturate humidity in gm/gm !
1384! rhly (IX,NLAY) : layer relative humidity (=qlyr/qstl) !
1385! clw (IX,NLAY,ntrac) : layer cloud condensate amount !
1386! xlat (IX) : grid latitude in radians, default to pi/2 -> -pi/2!
1387! range, otherwise see in-line comment !
1388! xlon (IX) : grid longitude in radians (not used) !
1389! slmsk (IX) : sea/land mask array (sea:0,land:1,sea-ice:2) !
1390! dz (ix,nlay) : layer thickness (km) !
1391! delp (ix,nlay) : model layer pressure thickness in mb (100Pa) !
1392! IX : horizontal dimention !
1393! NLAY,NLP1 : vertical layer/level dimensions !
1394! uni_cld : logical - true for cloud fraction from shoc !
1395! lmfshal : logical - true for mass flux shallow convection !
1396! lmfdeep2 : logical - true for mass flux deep convection !
1397! cldcov : layer cloud fraction (used when uni_cld=.true. !
1398! lmfshal : mass-flux shallow conv scheme flag !
1399! lmfdeep2 : scale-aware mass-flux deep conv scheme flag !
1400! lcrick : control flag for eliminating CRICK !
1401! =t: apply layer smoothing to eliminate CRICK !
1402! =f: do not apply layer smoothing !
1403! lcnorm : control flag for in-cld condensate !
1404! =t: normalize cloud condensate !
1405! =f: not normalize cloud condensate !
1406! !
1407! output variables: !
1408! cloud profiles: !
1409! cld_frac (:,:) - layer total cloud fraction !
1410! cld_lwp (:,:) - layer cloud liq water path (g/m**2) !
1411! cld_reliq (:,:) - mean eff radius for liq cloud (micron) !
1412! cld_iwp (:,:) - layer cloud ice water path (g/m**2) !
1413! cld_reice (:,:) - mean eff radius for ice cloud (micron) !
1414! cld_rwp (:,:) - layer rain drop water path not assigned !
1415! cld_rerain(:,:) - mean eff radius for rain drop (micron) !
1416! *** cld_swp (:,:) - layer snow flake water path not assigned !
1417! cld_resnow(:,:) - mean eff radius for snow flake (micron) !
1418! *** fu's scheme need to be normalized by snow density (g/m**3/1.0e6) !
1419! clds (IX,5) : fraction of clouds for low, mid, hi, tot, bl !
1420! mtop (IX,3) : vertical indices for low, mid, hi cloud tops !
1421! mbot (IX,3) : vertical indices for low, mid, hi cloud bases !
1422! de_lgth(ix) : clouds decorrelation length (km) !
1423! !
1424! ==================== end of description ===================== !
1425!
1426 implicit none
1427
1428! --- inputs
1429 integer, intent(in) :: ix, nlay, nlp1
1430 integer, intent(in) :: ntrac, ntcw, ntiw, ntrw, ntsw, ntgl
1431
1432 logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, lcnorm, &
1433 & xr_cnvcld
1434
1435 real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, &
1436 & tlyr, qlyr, qstl, rhly, cldcov, delp, dz, dzlay, &
1437 & re_cloud, re_ice, re_snow, cnvw
1438 real (kind=kind_phys), dimension(:), intent(inout) :: &
1439 & lwp_ex, iwp_ex, lwp_fc, iwp_fc
1440
1441 real (kind=kind_phys), dimension(:,:,:), intent(in) :: clw
1442
1443 real (kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, &
1444 & slmsk
1445 real (kind=kind_phys), intent(in) :: con_ttp, xr_con, xr_exp
1446! --- inputs/outputs
1447
1448 real (kind=kind_phys), dimension(:,:), intent(inout) :: &
1449 & cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, &
1450 & cld_rwp, cld_rerain, cld_swp, cld_resnow
1451
1452! --- local variables:
1453 real (kind=kind_phys), dimension(IX,NLAY) :: cldtot, cldcnv, &
1454 & cwp, cip, crp, csp, rew, rei, res, rer, tem2d, clwf
1455
1456 real (kind=kind_phys) :: clwmin, clwm, clwt, onemrh, value, &
1457 & tem1, tem2, tem3
1458
1459 real (kind=kind_phys) :: xrc3
1460
1461 integer :: i, k, id, nf
1462
1463 logical :: cond_cfrac_onrh
1464
1465! --- constant values
1466 real (kind=kind_phys), parameter :: snow2ice = 0.25
1467 real (kind=kind_phys), parameter :: coef_t = 0.025
1468!
1469!===> ... begin here
1470
1471 do k = 1, nlay
1472 do i = 1, ix
1473 cldtot(i,k) = 0.0
1474 cldcnv(i,k) = 0.0
1475 cwp(i,k) = 0.0
1476 cip(i,k) = 0.0
1477 crp(i,k) = 0.0
1478 csp(i,k) = 0.0
1479 rew(i,k) = re_cloud(i,k)
1480 rei(i,k) = re_ice(i,k)
1481 rer(i,k) = rrain_def ! default rain radius to 1000 micron
1482 res(i,k) = re_snow(i,k)
1483 tem2d(i,k) = min(1.0, max( 0.0, (con_ttp-tlyr(i,k))*coef_t))
1484 clwf(i,k) = 0.0
1485 enddo
1486 enddo
1487!
1488!
1489! if ( lcrick ) then
1490! do i = 1, IX
1491! clwf(i,1) = 0.75*clw(i,1) + 0.25*clw(i,2)
1492! clwf(i,nlay) = 0.75*clw(i,nlay) + 0.25*clw(i,nlay-1)
1493! enddo
1494! do k = 2, NLAY-1
1495! do i = 1, IX
1496! clwf(i,K) = 0.25*clw(i,k-1) + 0.5*clw(i,k) + 0.25*clw(i,k+1)
1497! enddo
1498! enddo
1499! else
1500! do k = 1, NLAY
1501! do i = 1, IX
1502! clwf(i,k) = clw(i,k)
1503! enddo
1504! enddo
1505! endif
1506
1509
1510 if(xr_cnvcld)then
1511 do k = 1, nlay
1512 do i = 1, ix
1513 clwf(i,k) = clw(i,k,ntcw) + clw(i,k,ntiw) + clw(i,k,ntsw)
1514 & + clw(i,k,ntrw) + cnvw(i,k)
1515 enddo
1516 enddo
1517 else
1518 do k = 1, nlay
1519 do i = 1, ix
1520 clwf(i,k) = clw(i,k,ntcw) + clw(i,k,ntiw) + clw(i,k,ntsw)
1521 & + clw(i,k,ntrw)
1522 enddo
1523 enddo
1524 endif
1525
1528 do k = 1, nlay-1
1529 do i = 1, ix
1530 if(xr_cnvcld)then
1531 tem1 = cnvw(i,k)*(1.-tem2d(i,k))
1532 else
1533 tem1 = 0.
1534 endif
1535 cwp(i,k) = max(0.0, (clw(i,k,ntcw)+tem1) *
1536 & gfac * delp(i,k))
1537 if(tem1 > 1.e-12 .and. clw(i,k,ntcw) < 1.e-12)
1538 & rew(i,k)=reliq_def
1539 if(xr_cnvcld)then
1540 tem2 = cnvw(i,k)*tem2d(i,k)
1541 else
1542 tem2 = 0.
1543 endif
1544 cip(i,k) = max(0.0, (clw(i,k,ntiw) +
1545 & snow2ice*clw(i,k,ntsw) + tem2) *
1546 & gfac * delp(i,k))
1547 if(tem2 > 1.e-12 .and. clw(i,k,ntiw) < 1.e-12) then
1548 if(nint(slmsk(i))==1) then
1549 rei(i,k)=creice_def
1550 else
1551 rei(i,k)=reice_def
1552 endif
1553 endif
1554 crp(i,k) = max(0.0, clw(i,k,ntrw) * gfac * delp(i,k))
1555 csp(i,k) = max(0.0, (1.-snow2ice)*clw(i,k,ntsw) *
1556 & gfac * delp(i,k))
1557 enddo
1558 enddo
1559
1561
1562 do i = 1, ix
1563 lwp_ex(i) = 0.0
1564 iwp_ex(i) = 0.0
1565 lwp_fc(i) = 0.0
1566 iwp_fc(i) = 0.0
1567 do k = 1, nlay-1
1568 lwp_ex(i) = lwp_ex(i) + cwp(i,k)
1569 iwp_ex(i) = iwp_ex(i) + cip(i,k) + csp(i,k)
1570 enddo
1571 lwp_ex(i) = lwp_ex(i)*1.e-3
1572 iwp_ex(i) = iwp_ex(i)*1.e-3
1573 enddo
1574
1575 if (uni_cld) then ! use unified sgs clouds generated outside
1576 do k = 1, nlay
1577 do i = 1, ix
1578 cldtot(i,k) = cldcov(i,k)
1579 enddo
1580 enddo
1581
1582 else
1583
1585
1586 if (.not. lmfshal) then
1587 xrc3 = xr_con
1588 do k = 1, nlay-1
1589 do i = 1, ix
1590 cldtot(i,k) = cld_frac_xurandall(plyr(i,k), qstl(i,k), &
1591 & rhly(i,k), clwf(i,k), xrc3, xr_exp, 0.)
1592 end do
1593 end do
1594 else
1595 xrc3 = 100.
1596 if (lmfdeep2) xrc3 = xr_con
1597 cond_cfrac_onrh = .true.
1598 do k = 1, nlay-1
1599 do i = 1, ix
1600 cldtot(i,k) = cld_frac_xurandall(plyr(i,k), qstl(i,k), &
1601 & rhly(i,k), clwf(i,k), xrc3, xr_exp, 0., &
1602 & cond_cfrac_onrh)
1603 end do
1604 end do
1605 endif
1606
1607 endif ! if (uni_cld) then
1608
1609 do k = 1, nlay
1610 do i = 1, ix
1611 if (cldtot(i,k) < climit) then
1612 cldtot(i,k) = 0.0
1613 cwp(i,k) = 0.0
1614 cip(i,k) = 0.0
1615 crp(i,k) = 0.0
1616 csp(i,k) = 0.0
1617 endif
1618 enddo
1619 enddo
1620
1621 ! What portion of water and ice contents is associated with the
1622 ! partly cloudy boxes
1623 do i = 1, ix
1624 do k = 1, nlay-1
1625 if (cldtot(i,k).ge.climit .and. cldtot(i,k).lt.ovcst) then
1626 lwp_fc(i) = lwp_fc(i) + cwp(i,k)
1627 iwp_fc(i) = iwp_fc(i) + cip(i,k) + csp(i,k)
1628 endif
1629 enddo
1630 lwp_fc(i) = lwp_fc(i)*1.e-3
1631 iwp_fc(i) = iwp_fc(i)*1.e-3
1632 enddo
1633
1634 if ( lcnorm ) then
1635 do k = 1, nlay
1636 do i = 1, ix
1637 if (cldtot(i,k) >= climit) then
1638 tem1 = 1.0 / max(climit2, cldtot(i,k))
1639 cwp(i,k) = cwp(i,k) * tem1
1640 cip(i,k) = cip(i,k) * tem1
1641 crp(i,k) = crp(i,k) * tem1
1642 csp(i,k) = csp(i,k) * tem1
1643 endif
1644 enddo
1645 enddo
1646 endif
1647
1648 do k = 1, nlay
1649 do i = 1, ix
1650 cld_frac(i,k) = cldtot(i,k)
1651 cld_lwp(i,k) = cwp(i,k)
1652 cld_reliq(i,k) = rew(i,k)
1653 cld_iwp(i,k) = cip(i,k)
1654 cld_reice(i,k) = rei(i,k)
1655 cld_rwp(i,k) = crp(i,k) ! added for Thompson
1656 cld_rerain(i,k) = rer(i,k)
1657 cld_swp(i,k) = csp(i,k) ! added for Thompson
1658 cld_resnow(i,k) = res(i,k)
1659 enddo
1660 enddo
1661
1662
1663!............................................
1664 end subroutine progcld_thompson_wsm6
1665!............................................
1666
1667
1677 subroutine progcld_thompson &
1678 & ( plyr,plvl,tlyr,qlyr,qstl,rhly,clw, & ! --- inputs:
1679 & xlat,xlon,slmsk,dz,delp, &
1680 & ntrac,ntcw,ntiw,ntrw,ntsw,ntgl, &
1681 & ix, nlay, nlp1, &
1682 & uni_cld, lmfshal, lmfdeep2, cldcov, &
1683 & re_cloud,re_ice,re_snow, &
1684 & lwp_ex, iwp_ex, lwp_fc, iwp_fc, &
1685 & dzlay, gridkm, top_at_1, cldtot, cldcnv, &
1686 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
1687 & cld_reice,cld_rwp, cld_rerain,cld_swp, cld_resnow &
1688 & )
1689
1690! ================= subprogram documentation block ================ !
1691! !
1692! subprogram: progcld_thompson computes cloud related quantities !
1693! using Thompson cloud microphysics scheme. !
1694! !
1695! abstract: this program computes cloud fractions from cloud !
1696! condensates, !
1697! and computes the low, mid, high, total and boundary layer cloud !
1698! fractions and the vertical indices of low, mid, and high cloud !
1699! top and base. the three vertical cloud domains are set up in the !
1700! initial subroutine "cld_init". !
1701! !
1702! usage: call progcld_thompson !
1703! !
1704! attributes: !
1705! language: fortran 90 !
1706! machine: ibm-sp, sgi !
1707! !
1708! !
1709! ==================== definition of variables ==================== !
1710! !
1711! !
1712! input variables: !
1713! plyr (IX,NLAY) : model layer mean pressure in mb (100Pa) !
1714! plvl (IX,NLP1) : model level pressure in mb (100Pa) !
1715! tlyr (IX,NLAY) : model layer mean temperature in k !
1716! tvly (IX,NLAY) : model layer virtual temperature in k !
1717! qlyr (IX,NLAY) : layer specific humidity in gm/gm !
1718! qstl (IX,NLAY) : layer saturate humidity in gm/gm !
1719! rhly (IX,NLAY) : layer relative humidity (=qlyr/qstl) !
1720! clw (IX,NLAY,ntrac) : layer cloud condensate amount !
1721! xlat (IX) : grid latitude in radians, default to pi/2 -> -pi/2!
1722! range, otherwise see in-line comment !
1723! xlon (IX) : grid longitude in radians (not used) !
1724! slmsk (IX) : sea/land mask array (sea:0,land:1,sea-ice:2) !
1725! dz (ix,nlay) : layer thickness (km) !
1726! delp (ix,nlay) : model layer pressure thickness in mb (100Pa) !
1727! gridkm (IX) : grid length in km !
1728! IX : horizontal dimention !
1729! NLAY,NLP1 : vertical layer/level dimensions !
1730! uni_cld : logical - true for cloud fraction from shoc !
1731! lmfshal : logical - true for mass flux shallow convection !
1732! lmfdeep2 : logical - true for mass flux deep convection !
1733! top_at_1 : logical - true if vertical ordereing is toa-2-sfc !
1734! cldcov : layer cloud fraction (used when uni_cld=.true. !
1735! lmfshal : mass-flux shallow conv scheme flag !
1736! lmfdeep2 : scale-aware mass-flux deep conv scheme flag !
1737! lcrick : control flag for eliminating CRICK !
1738! =t: apply layer smoothing to eliminate CRICK !
1739! =f: do not apply layer smoothing !
1740! lcnorm : control flag for in-cld condensate !
1741! =t: normalize cloud condensate !
1742! =f: not normalize cloud condensate !
1743! !
1744! output variables: !
1745! cloud profiles: !
1746! cld_frac (:,:) - layer total cloud fraction !
1747! cld_lwp (:,:) - layer cloud liq water path (g/m**2) !
1748! cld_reliq (:,:) - mean eff radius for liq cloud (micron) !
1749! cld_iwp (:,:) - layer cloud ice water path (g/m**2) !
1750! cld_reice (:,:) - mean eff radius for ice cloud (micron) !
1751! cld_rwp (:,:) - layer rain drop water path not assigned !
1752! cld_rerain(:,:) - mean eff radius for rain drop (micron) !
1753! *** cld_swp (:,:) - layer snow flake water path not assigned !
1754! cld_resnow(:,:) - mean eff radius for snow flake (micron) !
1755! !
1756! ==================== end of description ===================== !
1757!
1758 implicit none
1759
1760! --- inputs
1761 integer, intent(in) :: ix, nlay, nlp1
1762 integer, intent(in) :: ntrac, ntcw, ntiw, ntrw, ntsw, ntgl
1763
1764 logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, top_at_1
1765
1766 real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, &
1767 & tlyr, qlyr, qstl, rhly, cldcov, delp, dz, dzlay, &
1768 & re_cloud, re_ice, re_snow
1769 real (kind=kind_phys), dimension(:), intent(inout) :: &
1770 & lwp_ex, iwp_ex, lwp_fc, iwp_fc
1771
1772 real (kind=kind_phys), dimension(:,:,:), intent(in) :: clw
1773
1774 real (kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, &
1775 & slmsk
1776 real(kind=kind_phys), dimension(:), intent(in) :: gridkm
1777
1778! --- inputs/outputs
1779
1780 real (kind=kind_phys), dimension(:,:), intent(inout) :: &
1781 & cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, &
1782 & cld_rwp, cld_rerain, cld_swp, cld_resnow
1783
1784! --- local variables:
1785 real (kind=kind_phys), dimension(IX,NLAY) :: cldtot, cldcnv, &
1786 & cwp, cip, crp, csp, rew, rei, res, rer
1787
1788 real (kind=kind_phys), dimension(NLAY) :: cldfra1d, qv1d, &
1789 & qc1d, qi1d, qs1d, dz1d, p1d, t1d
1790
1791 real (kind=kind_phys) :: clwmin, tem1
1792 real (kind=kind_phys) :: corr, xland, snow_mass_factor
1793 real (kind=kind_phys), parameter :: max_relh = 1.5
1794 real (kind=kind_phys), parameter :: snow_max_radius = 130.0
1795
1796 integer :: i, k, k2, id, nf, idx_rei
1797!
1798!===> ... begin here
1799!
1800
1801 clwmin = 1.0e-9
1802
1803 do k = 1, nlay
1804 do i = 1, ix
1805 cldtot(i,k) = 0.0
1806 cldcnv(i,k) = 0.0
1807 cwp(i,k) = 0.0
1808 cip(i,k) = 0.0
1809 crp(i,k) = 0.0
1810 csp(i,k) = 0.0
1811 rew(i,k) = re_cloud(i,k)
1812 rei(i,k) = re_ice(i,k)
1813 rer(i,k) = rrain_def ! default rain radius to 1000 micron
1814 res(i,k) = re_snow(i,k)
1815 enddo
1816 enddo
1817
1821
1822 do k = 1, nlay-1
1823 do i = 1, ix
1824 cwp(i,k) = max(0.0, clw(i,k,ntcw) * dz(i,k)*1.e6)
1825 crp(i,k) = 0.0
1826 snow_mass_factor = 0.90
1827 cip(i,k) = max(0.0, (clw(i,k,ntiw) &
1828 & + (1.0-snow_mass_factor)*clw(i,k,ntsw))*dz(i,k)*1.e6)
1829 if (re_snow(i,k) .gt. snow_max_radius)then
1830 snow_mass_factor = min(snow_mass_factor, &
1831 & (snow_max_radius/re_snow(i,k)) &
1832 & *(snow_max_radius/re_snow(i,k)))
1833 res(i,k) = snow_max_radius
1834 endif
1835 csp(i,k) = max(0.,snow_mass_factor*clw(i,k,ntsw)*dz(i,k)*1.e6)
1836 enddo
1837 enddo
1838
1840
1841 do i = 1, ix
1842 lwp_ex(i) = 0.0
1843 iwp_ex(i) = 0.0
1844 do k = 1, nlay-1
1845 lwp_ex(i) = lwp_ex(i) + cwp(i,k)
1846 iwp_ex(i) = iwp_ex(i) + cip(i,k) + csp(i,k)
1847 enddo
1848 enddo
1849
1858
1859 do i = 1, ix
1860 if (slmsk(i)-0.5 .gt. 0.5 .and. slmsk(i)+0.5 .lt. 1.5) then
1861 xland = 1.0
1862 else
1863 xland = 2.0
1864 endif
1865
1866 cldfra1d(:) = 0.0
1867
1868 if (.not. top_at_1) then
1869 do k = 1, nlay
1870 qv1d(k) = qlyr(i,k)
1871 qc1d(k) = max(0.0, clw(i,k,ntcw))
1872 qi1d(k) = max(0.0, clw(i,k,ntiw))
1873 qs1d(k) = max(0.0, clw(i,k,ntsw))
1874 dz1d(k) = dz(i,k)*1.e3
1875 p1d(k) = plyr(i,k)*100.0
1876 t1d(k) = tlyr(i,k)
1877 enddo
1878 else
1879 do k = nlay, 1, -1
1880 k2 = nlay - k + 1
1881 qv1d(k2) = qlyr(i,k)
1882 qc1d(k2) = max(0.0, clw(i,k,ntcw))
1883 qi1d(k2) = max(0.0, clw(i,k,ntiw))
1884 qs1d(k2) = max(0.0, clw(i,k,ntsw))
1885 dz1d(k2) = dz(i,k)*1.e3
1886 p1d(k2) = plyr(i,k)*100.0
1887 t1d(k2) = tlyr(i,k)
1888 enddo
1889 endif
1890
1891 call cal_cldfra3(cldfra1d, qv1d, qc1d, qi1d, qs1d, dz1d, &
1892 & p1d, t1d, xland, gridkm(i), &
1893 & .false., max_relh, 1, nlay, .false.)
1894
1895 do k = 1, nlay
1896 cldtot(i,k) = cldfra1d(k)
1897 if (qc1d(k).gt.clwmin .and. cldfra1d(k).lt.ovcst) then
1898 cwp(i,k) = qc1d(k) * dz1d(k)*1000.
1899 if ((xland-1.5).GT.0.) then !--- Ocean
1900 rew(i,k) = 9.5
1901 else !--- Land
1902 rew(i,k) = 5.5
1903 endif
1904 endif
1905 if (qi1d(k).gt.clwmin .and. cldfra1d(k).lt.ovcst) then
1906 cip(i,k) = qi1d(k) * dz1d(k)*1000.
1907 idx_rei = int(t1d(k)-179.)
1908 idx_rei = min(max(idx_rei,1),75)
1909 corr = t1d(k) - int(t1d(k))
1910 rei(i,k) = max(5.0, retab(idx_rei)*(1.-corr) + &
1911 & retab(idx_rei+1)*corr)
1912 endif
1913 enddo
1914 enddo
1915
1916 do k = 1, nlay
1917 do i = 1, ix
1918 cld_frac(i,k) = cldtot(i,k)
1919 cld_lwp(i,k) = cwp(i,k)
1920 cld_reliq(i,k) = rew(i,k)
1921 cld_iwp(i,k) = cip(i,k)
1922 cld_reice(i,k) = rei(i,k)
1923 cld_rwp(i,k) = crp(i,k) ! added for Thompson
1924 cld_rerain(i,k) = rer(i,k)
1925 cld_swp(i,k) = csp(i,k) ! added for Thompson
1926 cld_resnow(i,k) = res(i,k)
1927 enddo
1928 enddo
1929
1931
1932 do i = 1, ix
1933 lwp_fc(i) = 0.0
1934 iwp_fc(i) = 0.0
1935 do k = 1, nlay
1936 lwp_fc(i) = lwp_fc(i) + cwp(i,k)
1937 iwp_fc(i) = iwp_fc(i) + cip(i,k) + csp(i,k)
1938 enddo
1939 lwp_fc(i) = max(0.0, lwp_fc(i) - lwp_ex(i))
1940 iwp_fc(i) = max(0.0, iwp_fc(i) - iwp_ex(i))
1941 lwp_fc(i) = lwp_fc(i)*1.e-3
1942 iwp_fc(i) = iwp_fc(i)*1.e-3
1943 lwp_ex(i) = lwp_ex(i)*1.e-3
1944 iwp_ex(i) = iwp_ex(i)*1.e-3
1945 enddo
1946!
1947
1948!............................................
1949 end subroutine progcld_thompson
1950!............................................
1951!mz
1952
1953
1957 subroutine progclduni &
1958 & ( plyr,plvl,tlyr,tvly,ccnd,ncnd, & ! --- inputs:
1959 & xlat,xlon,slmsk,dz,delp, ix, nlay, nlp1, cldtot, &
1960 & effrl,effri,effrr,effrs,effr_in, &
1961 & dzlay, cldtot1, cldcnv, lcrick, lcnorm, con_ttp, &
1962 & cld_frac, cld_lwp, cld_reliq, cld_iwp, & ! --- outputs
1963 & cld_reice,cld_rwp, cld_rerain,cld_swp, cld_resnow &
1964 & )
1965
1966! ================= subprogram documentation block ================ !
1967! !
1968! subprogram: progclduni computes cloud related quantities using !
1969! for unified cloud microphysics scheme. !
1970! !
1971! abstract: this program computes cloud fractions from cloud !
1972! condensates, calculates liquid/ice cloud droplet effective radius, !
1973! and computes the low, mid, high, total and boundary layer cloud !
1974! fractions and the vertical indices of low, mid, and high cloud !
1975! top and base. the three vertical cloud domains are set up in the !
1976! initial subroutine "cld_init". !
1977! This program is written by Moorthi !
1978! to represent unified cloud across all physics while !
1979! using SHOC+MG2/3+convection (RAS or SAS or CSAW) !
1980! !
1981! usage: call progclduni !
1982! !
1983! attributes: !
1984! language: fortran 90 !
1985! machine: ibm-sp, sgi !
1986! !
1987! !
1988! ==================== definition of variables ==================== !
1989! !
1990! input variables: !
1991! plyr (IX,NLAY) : model layer mean pressure in mb (100Pa) !
1992! plvl (IX,NLP1) : model level pressure in mb (100Pa) !
1993! tlyr (IX,NLAY) : model layer mean temperature in k !
1994! tvly (IX,NLAY) : model layer virtual temperature in k !
1995! ccnd (IX,NLAY,ncnd) : layer cloud condensate amount !
1996! water, ice, rain, snow (+ graupel) !
1997! ncnd : number of layer cloud condensate types (max of 4) !
1998! xlat (IX) : grid latitude in radians, default to pi/2 -> -pi/2!
1999! range, otherwise see in-line comment !
2000! xlon (IX) : grid longitude in radians (not used) !
2001! slmsk (IX) : sea/land mask array (sea:0,land:1,sea-ice:2) !
2002! IX : horizontal dimention !
2003! NLAY,NLP1 : vertical layer/level dimensions !
2004! cldtot : unified cloud fracrion from moist physics !
2005! effrl (ix,nlay) : effective radius for liquid water !
2006! effri (ix,nlay) : effective radius for ice water !
2007! effrr (ix,nlay) : effective radius for rain water !
2008! effrs (ix,nlay) : effective radius for snow water !
2009! effr_in : logical - if .true. use input effective radii !
2010! dz (ix,nlay) : layer thickness (km) !
2011! delp (ix,nlay) : model layer pressure thickness in mb (100Pa) !
2012! dzlay(ix,nlay) : thickness between model layer centers (km) !
2013! lmfshal : mass-flux shallow conv scheme flag !
2014! lmfdeep2 : scale-aware mass-flux deep conv scheme flag !
2015! lcrick : control flag for eliminating CRICK !
2016! =t: apply layer smoothing to eliminate CRICK !
2017! =f: do not apply layer smoothing !
2018! lcnorm : control flag for in-cld condensate !
2019! =t: normalize cloud condensate !
2020! =f: not normalize cloud condensate !
2021! !
2022! output variables: !
2023! cloud profiles: !
2024! cld_frac (:,:) - layer total cloud fraction !
2025! cld_lwp (:,:) - layer cloud liq water path (g/m**2) !
2026! cld_reliq (:,:) - mean eff radius for liq cloud (micron) !
2027! cld_iwp (:,:) - layer cloud ice water path (g/m**2) !
2028! cld_reice (:,:) - mean eff radius for ice cloud (micron) !
2029! cld_rwp (:,:) - layer rain drop water path not assigned !
2030! cld_rerain(:,:) - mean eff radius for rain drop (micron) !
2031! *** cld_swp (:,:) - layer snow flake water path not assigned !
2032! cld_resnow(:,:) - mean eff radius for snow flake (micron) !
2033! *** fu's scheme need to be normalized by snow density (g/m**3/1.0e6) !
2034! clds (IX,5) : fraction of clouds for low, mid, hi, tot, bl !
2035! mtop (IX,3) : vertical indices for low, mid, hi cloud tops !
2036! mbot (IX,3) : vertical indices for low, mid, hi cloud bases !
2037! de_lgth(ix) : clouds decorrelation length (km) !
2038! alpha(ix,nlay) : alpha decorrelation parameter !
2039! !
2040! ==================== end of description ===================== !
2041!
2042 implicit none
2043
2044! --- inputs
2045 integer, intent(in) :: ix, nlay, nlp1, ncnd
2046 logical, intent(in) :: effr_in, lcrick, lcnorm
2047
2048 real (kind=kind_phys), intent(in) :: con_ttp
2049 real (kind=kind_phys), dimension(:,:,:), intent(in) :: ccnd
2050 real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr,&
2051 & tlyr, tvly, cldtot, effrl, effri, effrr, effrs, dz, delp, &
2052 & dzlay
2053
2054 real (kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, &
2055 & slmsk
2056
2057 real (kind=kind_phys), dimension(:,:), intent(inout) :: cldtot1
2058
2059! --- inputs/outputs
2060
2061 real (kind=kind_phys), dimension(:,:), intent(inout) :: &
2062 & cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, &
2063 & cld_rwp, cld_rerain, cld_swp, cld_resnow
2064
2065! --- local variables:
2066 real (kind=kind_phys), dimension(IX,NLAY) :: cldcnv, cwp, cip, &
2067 & crp, csp, rew, rei, res, rer
2068 real (kind=kind_phys), dimension(IX,NLAY,ncnd) :: cndf
2069
2070 real (kind=kind_phys) :: tem1, tem2, tem3
2071
2072 integer :: i, k, id, nf, n
2073
2074!
2075!===> ... begin here
2076!
2077 do k = 1, nlay
2078 do i = 1, ix
2079 cldcnv(i,k) = 0.0
2080 cwp(i,k) = 0.0
2081 cip(i,k) = 0.0
2082 crp(i,k) = 0.0
2083 csp(i,k) = 0.0
2084 enddo
2085 enddo
2086 do n=1,ncnd
2087 do k = 1, nlay
2088 do i = 1, ix
2089 cndf(i,k,n) = ccnd(i,k,n)
2090 enddo
2091 enddo
2092 enddo
2093 if ( lcrick ) then ! vertical smoorthing
2094 do n=1,ncnd
2095 do i = 1, ix
2096 cndf(i,1,n) = 0.75*ccnd(i,1,n) + 0.25*ccnd(i,2,n)
2097 cndf(i,nlay,n) = 0.75*ccnd(i,nlay,n) + 0.25*ccnd(i,nlay-1,n)
2098 enddo
2099 do k = 2, nlay-1
2100 do i = 1, ix
2101 cndf(i,k,n) = 0.25 * (ccnd(i,k-1,n) + ccnd(i,k+1,n)) &
2102 & + 0.5 * ccnd(i,k,n)
2103 enddo
2104 enddo
2105 enddo
2106 endif
2107
2109
2110 if (ncnd == 2) then
2111 do k = 1, nlay
2112 do i = 1, ix
2113 tem1 = gfac * delp(i,k)
2114 cwp(i,k) = cndf(i,k,1) * tem1
2115 cip(i,k) = cndf(i,k,2) * tem1
2116 enddo
2117 enddo
2118 elseif (ncnd == 4) then
2119 do k = 1, nlay
2120 do i = 1, ix
2121 tem1 = gfac * delp(i,k)
2122 cwp(i,k) = cndf(i,k,1) * tem1
2123 cip(i,k) = cndf(i,k,2) * tem1
2124 crp(i,k) = cndf(i,k,3) * tem1
2125 csp(i,k) = cndf(i,k,4) * tem1
2126 enddo
2127 enddo
2128 endif
2129
2130 do k = 1, nlay
2131 do i = 1, ix
2132 if (cldtot(i,k) < climit) then
2133 cwp(i,k) = 0.0
2134 cip(i,k) = 0.0
2135 crp(i,k) = 0.0
2136 csp(i,k) = 0.0
2137 endif
2138 enddo
2139 enddo
2140
2141 if ( lcnorm ) then
2142 do k = 1, nlay
2143 do i = 1, ix
2144 if (cldtot(i,k) >= climit) then
2145 tem1 = 1.0 / max(climit2, cldtot(i,k))
2146 cwp(i,k) = cwp(i,k) * tem1
2147 cip(i,k) = cip(i,k) * tem1
2148 crp(i,k) = crp(i,k) * tem1
2149 csp(i,k) = csp(i,k) * tem1
2150 endif
2151 enddo
2152 enddo
2153 endif
2154
2155! assign/calculate efective radii for cloud water, ice, rain, snow
2156
2157 if (effr_in) then
2158 do k = 1, nlay
2159 do i = 1, ix
2160 rew(i,k) = effrl(i,k)
2161 rei(i,k) = max(10.0, min(150.0,effri(i,k)))
2162 rer(i,k) = effrr(i,k)
2163 res(i,k) = effrs(i,k)
2164 enddo
2165 enddo
2166 else
2167 do k = 1, nlay
2168 do i = 1, ix
2169 rew(i,k) = reliq_def ! default liq radius to 10 micron
2170 rei(i,k) = reice_def ! default ice radius to 50 micron
2171 rer(i,k) = rrain_def ! default rain radius to 1000 micron
2172 res(i,k) = rsnow_def ! default snow radius to 250 micron
2173 enddo
2174 enddo
2176 do i = 1, ix
2177 if (nint(slmsk(i)) == 1) then
2178 do k = 1, nlay
2179 tem1 = min(1.0, max(0.0, (con_ttp-tlyr(i,k))*0.05))
2180 rew(i,k) = 5.0 + 5.0 * tem1
2181 enddo
2182 endif
2183 enddo
2184
2187
2188 do k = 1, nlay
2189 do i = 1, ix
2190 tem2 = tlyr(i,k) - con_ttp
2191
2192 if (cip(i,k) > 0.0) then
2193 tem3 = gord * cip(i,k) * plyr(i,k) / (delp(i,k)*tvly(i,k))
2194
2195 if (tem2 < -50.0) then
2196 rei(i,k) = (1250.0/9.917) * tem3 ** 0.109
2197 elseif (tem2 < -40.0) then
2198 rei(i,k) = (1250.0/9.337) * tem3 ** 0.08
2199 elseif (tem2 < -30.0) then
2200 rei(i,k) = (1250.0/9.208) * tem3 ** 0.055
2201 else
2202 rei(i,k) = (1250.0/9.387) * tem3 ** 0.031
2203 endif
2204! rei(i,k) = max(20.0, min(rei(i,k), 300.0))
2205! rei(i,k) = max(10.0, min(rei(i,k), 100.0))
2206 rei(i,k) = max(10.0, min(rei(i,k), 150.0))
2207! rei(i,k) = max(5.0, min(rei(i,k), 130.0))
2208 endif
2209 enddo
2210 enddo
2211 endif
2212
2213 do k = 1, nlay
2214 do i = 1, ix
2215 cldtot1(i,k) = cldtot(i,k)
2216 enddo
2217 enddo
2218!
2219 do k = 1, nlay
2220 do i = 1, ix
2221 cld_frac(i,k) = cldtot(i,k)
2222 cld_lwp(i,k) = cwp(i,k)
2223 cld_reliq(i,k) = rew(i,k)
2224 cld_iwp(i,k) = cip(i,k)
2225 cld_reice(i,k) = rei(i,k)
2226 cld_rwp(i,k) = crp(i,k) ! added for Thompson
2227 cld_rerain(i,k) = rer(i,k)
2228 cld_swp(i,k) = csp(i,k) ! added for Thompson
2229 cld_resnow(i,k) = res(i,k)
2230 enddo
2231 enddo
2232!
2233!...................................
2234 end subroutine progclduni
2235!-----------------------------------
2236
2263 subroutine gethml &
2264 & ( plyr, ptop1, cldtot, cldcnv, dz, de_lgth, alpha, & ! --- inputs:
2265 & ix, nlay, iovr, iovr_rand, iovr_maxrand, iovr_max, &
2266 & iovr_dcorr, iovr_exp, iovr_exprand, top_at_1, si, &
2267 & clds, mtop, mbot & ! --- outputs:
2268 & )
2269
2270! =================================================================== !
2271! !
2272! abstract: compute high, mid, low, total, and boundary cloud fractions !
2273! and cloud top/bottom layer indices for model diagnostic output. !
2274! the three cloud domain boundaries are defined by ptopc. the cloud !
2275! overlapping method is defined by control flag 'iovr', which is also !
2276! used by lw and sw radiation programs. !
2277! !
2278! usage: call gethml !
2279! !
2280! subprograms called: none !
2281! !
2282! attributes: !
2283! language: fortran 90 !
2284! machine: ibm-sp, sgi !
2285! !
2286! !
2287! ==================== definition of variables ==================== !
2288! !
2289! input variables: !
2290! plyr (IX,NLAY) : model layer mean pressure in mb (100Pa) !
2291! ptop1 (IX,4) : pressure limits of cloud domain interfaces !
2292! (sfc,low,mid,high) in mb (100Pa) !
2293! cldtot(IX,NLAY) : total or straiform cloud profile in fraction !
2294! cldcnv(IX,NLAY) : convective cloud (for diagnostic scheme only) !
2295! dz (ix,nlay) : layer thickness (km) !
2296! de_lgth(ix) : clouds vertical de-correlation length (km) !
2297! alpha(ix,nlay) : alpha decorrelation parameter
2298! IX : horizontal dimention !
2299! NLAY : vertical layer dimensions !
2300! !
2301! output variables: !
2302! clds (IX,5) : fraction of clouds for low, mid, hi, tot, bl !
2303! mtop (IX,3) : vertical indices for low, mid, hi cloud tops !
2304! mbot (IX,3) : vertical indices for low, mid, hi cloud bases ! !
2305! internal module variables: !
2306! iovr : control flag for cloud overlap !
2307! =0 random overlapping clouds !
2308! =1 max/ran overlapping clouds !
2309! =2 maximum overlapping ( for mcica only ) !
2310! =3 decorr-length ovlp ( for mcica only ) !
2311! =4: exponential cloud overlap (AER; mcica only) !
2312! =5: exponential-random overlap (AER; mcica only) !
2313! !
2314! ==================== end of description ===================== !
2315!
2316 implicit none!
2317
2318! --- inputs:
2319 logical, intent(in) :: top_at_1
2320 integer, intent(in) :: ix, nlay
2321 integer, intent(in) :: &
2322 & iovr, !
2323 & iovr_rand, ! Flag for random cloud overlap method
2324 & iovr_maxrand, ! Flag for maximum-random cloud overlap method
2325 & iovr_max, ! Flag for maximum cloud overlap method
2326 & iovr_dcorr, ! Flag for decorrelation-length cloud overlap method
2327 & iovr_exp, ! Flag for exponential cloud overlap method
2328 & iovr_exprand ! Flag for exponential-random cloud overlap method
2329
2330 real (kind=kind_phys), dimension(:,:), intent(in) :: plyr, ptop1, &
2331 & cldtot, cldcnv, dz
2332 real (kind=kind_phys), dimension(:), intent(in) :: de_lgth, si
2333 real (kind=kind_phys), dimension(:,:), intent(in) :: alpha
2334
2335! --- outputs
2336 real (kind=kind_phys), dimension(:,:), intent(out) :: clds
2337
2338 integer, dimension(:,:), intent(out) :: mtop, mbot
2339
2340! --- local variables:
2341 real (kind=kind_phys) :: cl1(ix), cl2(ix), dz1(ix)
2342 real (kind=kind_phys) :: pcur, pnxt, ccur, cnxt, alfa
2343
2344 integer, dimension(IX):: idom, kbt1, kth1, kbt2, kth2
2345 integer :: i, k, id, id1, kstr, kend, kinc,kl
2346
2347!
2348!===> ... begin here
2349!
2353
2354 if (top_at_1) then ! data from toa to sfc
2355 lab_do_k0 : do k = nlay, 2, -1
2356 kl = k
2357 if (si(k) < 0.9e0) exit lab_do_k0
2358 enddo lab_do_k0
2359 llyr = kl
2360 else ! data from sfc to top
2361 lab_do_k1 : do k = 2, nlay
2362 kl = k
2363 if (si(k) < 0.9e0) exit lab_do_k1
2364 enddo lab_do_k1
2365
2366 llyr = kl - 1
2367 endif ! end_if_top_at_1
2368
2369 clds(:,:) = 0.0
2370
2371 do i = 1, ix
2372 cl1(i) = 1.0
2373 cl2(i) = 1.0
2374 enddo
2375
2376! --- total and bl clouds, where cl1, cl2 are fractions of clear-sky view
2377! layer processed from surface and up
2378
2381
2382 if (top_at_1) then ! input data from toa to sfc
2383 kstr = nlay
2384 kend = 1
2385 kinc = -1
2386 else ! input data from sfc to toa
2387 kstr = 1
2388 kend = nlay
2389 kinc = 1
2390 endif ! end_if_top_at_1
2391
2392 if ( iovr == iovr_rand ) then ! random overlap
2393
2394 do k = kstr, kend, kinc
2395 do i = 1, ix
2396 ccur = min( ovcst, max( cldtot(i,k), cldcnv(i,k) ))
2397 if (ccur >= climit) cl1(i) = cl1(i) * (1.0 - ccur)
2398 enddo
2399
2400 if (k == llyr) then
2401 do i = 1, ix
2402 clds(i,5) = 1.0 - cl1(i) ! save bl cloud
2403 enddo
2404 endif
2405 enddo
2406
2407 do i = 1, ix
2408 clds(i,4) = 1.0 - cl1(i) ! save total cloud
2409 enddo
2410
2411 elseif ( iovr == iovr_maxrand ) then ! max/ran overlap
2412
2413 do k = kstr, kend, kinc
2414 do i = 1, ix
2415 ccur = min( ovcst, max( cldtot(i,k), cldcnv(i,k) ))
2416 if (ccur >= climit) then ! cloudy layer
2417 cl2(i) = min( cl2(i), (1.0 - ccur) )
2418 else ! clear layer
2419 cl1(i) = cl1(i) * cl2(i)
2420 cl2(i) = 1.0
2421 endif
2422 enddo
2423
2424 if (k == llyr) then
2425 do i = 1, ix
2426 clds(i,5) = 1.0 - cl1(i) * cl2(i) ! save bl cloud
2427 enddo
2428 endif
2429 enddo
2430
2431 do i = 1, ix
2432 clds(i,4) = 1.0 - cl1(i) * cl2(i) ! save total cloud
2433 enddo
2434
2435 elseif ( iovr == iovr_max ) then ! maximum overlap all levels
2436
2437 cl1(:) = 0.0
2438
2439 do k = kstr, kend, kinc
2440 do i = 1, ix
2441 ccur = min( ovcst, max( cldtot(i,k), cldcnv(i,k) ))
2442 if (ccur >= climit) cl1(i) = max( cl1(i), ccur )
2443 enddo
2444
2445 if (k == llyr) then
2446 do i = 1, ix
2447 clds(i,5) = cl1(i) ! save bl cloud
2448 enddo
2449 endif
2450 enddo
2451
2452 do i = 1, ix
2453 clds(i,4) = cl1(i) ! save total cloud
2454 enddo
2455
2456 elseif ( iovr == iovr_dcorr ) then ! random if clear-layer divided,
2457 ! otherwise de-corrlength method
2458 do i = 1, ix
2459 dz1(i) = - dz(i,kstr)
2460 enddo
2461
2462 do k = kstr, kend, kinc
2463 do i = 1, ix
2464 ccur = min( ovcst, max( cldtot(i,k), cldcnv(i,k) ))
2465 if (ccur >= climit) then ! cloudy layer
2466 alfa = exp( -0.5*((dz1(i)+dz(i,k)))/de_lgth(i) )
2467 dz1(i) = dz(i,k)
2468 cl2(i) = alfa * min(cl2(i), (1.0 - ccur)) & ! maximum part
2469 & + (1.0 - alfa) * (cl2(i) * (1.0 - ccur)) ! random part
2470 else ! clear layer
2471 cl1(i) = cl1(i) * cl2(i)
2472 cl2(i) = 1.0
2473 if (k /= kend) dz1(i) = -dz(i,k+kinc)
2474 endif
2475 enddo
2476
2477 if (k == llyr) then
2478 do i = 1, ix
2479 clds(i,5) = 1.0 - cl1(i) * cl2(i) ! save bl cloud
2480 enddo
2481 endif
2482 enddo
2483
2484 do i = 1, ix
2485 clds(i,4) = 1.0 - cl1(i) * cl2(i) ! save total cloud
2486 enddo
2487
2488 elseif ( iovr == iovr_exp .or. iovr == iovr_exprand ) then ! exponential overlap (iovr=4), or
2489 ! exponential-random (iovr=5);
2490 ! distinction defined by alpha
2491
2492 do k = kstr, kend, kinc
2493 do i = 1, ix
2494 ccur = min( ovcst, max( cldtot(i,k), cldcnv(i,k) ))
2495 if (ccur >= climit) then ! cloudy layer
2496 cl2(i) = alpha(i,k) * min(cl2(i), (1.0 - ccur)) & ! maximum part
2497 & + (1.0 - alpha(i,k)) * (cl2(i) * (1.0 - ccur)) ! random part
2498 else ! clear layer
2499 cl1(i) = cl1(i) * cl2(i)
2500 cl2(i) = 1.0
2501 endif
2502 enddo
2503
2504 if (k == llyr) then
2505 do i = 1, ix
2506 clds(i,5) = 1.0 - cl1(i) * cl2(i) ! save bl cloud
2507 enddo
2508 endif
2509 enddo
2510
2511 do i = 1, ix
2512 clds(i,4) = 1.0 - cl1(i) * cl2(i) ! save total cloud
2513 enddo
2514
2515 endif ! end_if_iovr
2516
2517! --- high, mid, low clouds, where cl1, cl2 are cloud fractions
2518! layer processed from one layer below llyr and up
2519! --- change! layer processed from surface to top, so low clouds will
2520! contains both bl and low clouds.
2521
2524 if (top_at_1) then ! input data from toa to sfc
2525
2526 do i = 1, ix
2527 cl1(i) = 0.0
2528 cl2(i) = 0.0
2529 kbt1(i) = nlay
2530 kbt2(i) = nlay
2531 kth1(i) = 0
2532 kth2(i) = 0
2533 idom(i) = 1
2534 mbot(i,1) = nlay
2535 mtop(i,1) = nlay
2536 mbot(i,2) = nlay - 1
2537 mtop(i,2) = nlay - 1
2538 mbot(i,3) = nlay - 1
2539 mtop(i,3) = nlay - 1
2540 enddo
2541
2542!org do k = llyr-1, 1, -1
2543 do k = nlay, 1, -1
2544 do i = 1, ix
2545 id = idom(i)
2546 id1= id + 1
2547
2548 pcur = plyr(i,k)
2549 ccur = min( ovcst, max( cldtot(i,k), cldcnv(i,k) ))
2550
2551 if (k > 1) then
2552 pnxt = plyr(i,k-1)
2553 cnxt = min( ovcst, max( cldtot(i,k-1), cldcnv(i,k-1) ))
2554 else
2555 pnxt = -1.0
2556 cnxt = 0.0
2557 endif
2558
2559 if (pcur < ptop1(i,id1)) then
2560 id = id + 1
2561 id1= id1 + 1
2562 idom(i) = id
2563 endif
2564
2565 if (ccur >= climit) then
2566 if (kth2(i) == 0) kbt2(i) = k
2567 kth2(i) = kth2(i) + 1
2568
2569 if ( iovr == iovr_rand ) then
2570 cl2(i) = cl2(i) + ccur - cl2(i)*ccur
2571 else
2572 cl2(i) = max( cl2(i), ccur )
2573 endif
2574
2575 if (cnxt < climit .or. pnxt < ptop1(i,id1)) then
2576 kbt1(i) = nint( (cl1(i)*kbt1(i) + cl2(i)*kbt2(i) ) &
2577 & / (cl1(i) + cl2(i)) )
2578 kth1(i) = nint( (cl1(i)*kth1(i) + cl2(i)*kth2(i) ) &
2579 & / (cl1(i) + cl2(i)) )
2580 cl1(i) = cl1(i) + cl2(i) - cl1(i)*cl2(i)
2581
2582 kbt2(i) = k - 1
2583 kth2(i) = 0
2584 cl2(i) = 0.0
2585 endif ! end_if_cnxt_or_pnxt
2586 endif ! end_if_ccur
2587
2588 if (pnxt < ptop1(i,id1)) then
2589 clds(i,id) = cl1(i)
2590 mtop(i,id) = min( kbt1(i), kbt1(i)-kth1(i)+1 )
2591 mbot(i,id) = kbt1(i)
2592
2593 cl1(i) = 0.0
2594 kbt1(i) = k - 1
2595 kth1(i) = 0
2596
2597 if (id1 <= nk_clds) then
2598 mbot(i,id1) = kbt1(i)
2599 mtop(i,id1) = kbt1(i)
2600 endif
2601 endif ! end_if_pnxt
2602
2603 enddo ! end_do_i_loop
2604 enddo ! end_do_k_loop
2605
2606 else ! input data from sfc to toa
2607
2608 do i = 1, ix
2609 cl1(i) = 0.0
2610 cl2(i) = 0.0
2611 kbt1(i) = 1
2612 kbt2(i) = 1
2613 kth1(i) = 0
2614 kth2(i) = 0
2615 idom(i) = 1
2616 mbot(i,1) = 1
2617 mtop(i,1) = 1
2618 mbot(i,2) = 2
2619 mtop(i,2) = 2
2620 mbot(i,3) = 2
2621 mtop(i,3) = 2
2622 enddo
2623
2624!org do k = llyr+1, NLAY
2625 do k = 1, nlay
2626 do i = 1, ix
2627 id = idom(i)
2628 id1= id + 1
2629
2630 pcur = plyr(i,k)
2631 ccur = min( ovcst, max( cldtot(i,k), cldcnv(i,k) ))
2632
2633 if (k < nlay) then
2634 pnxt = plyr(i,k+1)
2635 cnxt = min( ovcst, max( cldtot(i,k+1), cldcnv(i,k+1) ))
2636 else
2637 pnxt = -1.0
2638 cnxt = 0.0
2639 endif
2640
2641 if (pcur < ptop1(i,id1)) then
2642 id = id + 1
2643 id1= id1 + 1
2644 idom(i) = id
2645 endif
2646
2647 if (ccur >= climit) then
2648 if (kth2(i) == 0) kbt2(i) = k
2649 kth2(i) = kth2(i) + 1
2650
2651 if ( iovr == iovr_rand ) then
2652 cl2(i) = cl2(i) + ccur - cl2(i)*ccur
2653 else
2654 cl2(i) = max( cl2(i), ccur )
2655 endif
2656
2657 if (cnxt < climit .or. pnxt < ptop1(i,id1)) then
2658 kbt1(i) = nint( (cl1(i)*kbt1(i) + cl2(i)*kbt2(i)) &
2659 & / (cl1(i) + cl2(i)) )
2660 kth1(i) = nint( (cl1(i)*kth1(i) + cl2(i)*kth2(i)) &
2661 & / (cl1(i) + cl2(i)) )
2662 cl1(i) = cl1(i) + cl2(i) - cl1(i)*cl2(i)
2663
2664 kbt2(i) = k + 1
2665 kth2(i) = 0
2666 cl2(i) = 0.0
2667 endif ! end_if_cnxt_or_pnxt
2668 endif ! end_if_ccur
2669
2670 if (pnxt < ptop1(i,id1)) then
2671 clds(i,id) = cl1(i)
2672 mtop(i,id) = max( kbt1(i), kbt1(i)+kth1(i)-1 )
2673 mbot(i,id) = kbt1(i)
2674
2675 cl1(i) = 0.0
2676 kbt1(i) = min(k+1, nlay)
2677 kth1(i) = 0
2678
2679 if (id1 <= nk_clds) then
2680 mbot(i,id1) = kbt1(i)
2681 mtop(i,id1) = kbt1(i)
2682 endif
2683 endif ! end_if_pnxt
2684
2685 enddo ! end_do_i_loop
2686 enddo ! end_do_k_loop
2687
2688 endif ! end_if_top_at_1
2689
2690!
2691!...................................
2692 end subroutine gethml
2693!-----------------------------------
2694
2705 SUBROUTINE cal_cldfra3(CLDFRA, qv, qc, qi, qs, dz, &
2706 & p, t, XLAND, gridkm, &
2707 & modify_qvapor, max_relh, &
2708 & kts,kte, debug_flag)
2709!
2710 USE module_mp_thompson , ONLY : rsif, rslf
2711 IMPLICIT NONE
2712!
2713 INTEGER, INTENT(IN):: kts, kte
2714 LOGICAL, INTENT(IN):: modify_qvapor
2715 REAL, DIMENSION(kts:kte), INTENT(INOUT):: qv, qc, qi, cldfra
2716 REAL, DIMENSION(kts:kte), INTENT(IN):: p, t, dz, qs
2717 REAL, INTENT(IN):: gridkm, xland, max_relh
2718 LOGICAL, INTENT(IN):: debug_flag
2719
2720!..Local vars.
2721 REAL:: rh_00l, rh_00o, rh_00
2722 REAL:: entrmnt=0.5
2723 INTEGER:: k
2724 REAL:: tc, qvsi, qvsw, rhum, delz, var_temp
2725 REAL, DIMENSION(kts:kte):: qvs, rh, rhoa
2726 integer:: ndebug = 0
2727
2728 character*512 dbg_msg
2729
2730!+---+
2731
2732!..Initialize cloud fraction, compute RH, and rho-air.
2733
2734 DO k = kts,kte
2735 cldfra(k) = 0.0
2736
2737 qvsw = rslf(p(k), t(k))
2738 qvsi = rsif(p(k), t(k))
2739
2740 tc = t(k) - 273.15
2741 if (tc .ge. -12.0) then
2742 qvs(k) = qvsw
2743 elseif (tc .lt. -35.0) then
2744 qvs(k) = qvsi
2745 else
2746 qvs(k) = qvsw - (qvsw-qvsi)*(-12.0-tc)/(-12.0+35.)
2747 endif
2748
2749 if (modify_qvapor) then
2750 if (qc(k).gt.1.e-8) then
2751 qv(k) = max(qv(k), qvsw)
2752 qvs(k) = qvsw
2753 endif
2754 if (qc(k).le.1.e-8 .and. qi(k).ge.1.e-9) then
2755 qv(k) = max(qv(k), qvsi*1.005) !..To ensure a tiny bit ice supersaturated
2756 qvs(k) = qvsi
2757 endif
2758 endif
2759
2760 rh(k) = max(0.01, qv(k)/qvs(k))
2761 rhoa(k) = p(k)/(287.0*t(k))
2762
2763 ENDDO
2764
2765
2766!..First cut scale-aware. Higher resolution should require closer to
2767!.. saturated grid box for higher cloud fraction. Simple functions
2768!.. chosen based on Mocko and Cotton (1995) starting point and desire
2769!.. to get near 100% RH as grid spacing moves toward 1.0km, but higher
2770!.. RH over ocean required as compared to over land.
2771
2772 DO k = kts,kte
2773
2774 delz = max(100., dz(k))
2775 rh_00l = 0.77+min(0.22,sqrt(1./(50.0+gridkm*gridkm*delz*0.01)))
2776 rh_00o = 0.85+min(0.14,sqrt(1./(50.0+gridkm*gridkm*delz*0.01)))
2777 rhum = rh(k)
2778
2779 if (qc(k).ge.1.e-6 .or. qi(k).ge.1.e-7 &
2780 & .or. (qs(k).gt.1.e-6 .and. t(k).lt.273.)) then
2781 cldfra(k) = 1.0
2782 elseif (((qc(k)+qi(k)).gt.1.e-10) .and. &
2783 & ((qc(k)+qi(k)).lt.1.e-6)) then
2784 var_temp = min(0.99, 0.1*(11.0 + log10(qc(k)+qi(k))))
2785 cldfra(k) = var_temp*var_temp
2786 else
2787
2788 IF ((xland-1.5).GT.0.) THEN !--- Ocean
2789 rh_00 = rh_00o
2790 ELSE !--- Land
2791 rh_00 = rh_00l
2792 ENDIF
2793
2794 tc = max(-80.0, t(k) - 273.15)
2795 if (tc .lt. -24.0) rh_00 = rh_00l
2796
2797 if (tc .gt. 20.0) then
2798 cldfra(k) = 0.0
2799 elseif (tc .ge. -24.0) then
2800 rhum = min(rh(k), 1.0)
2801 var_temp = sqrt(sqrt((1.001-rhum)/(1.001-rh_00)))
2802 cldfra(k) = max(0., 1.0-var_temp)
2803 else
2804 if (max_relh.gt.1.12 .or. (.NOT.(modify_qvapor)) ) then
2805!..For HRRR model, the following look OK.
2806 rhum = min(rh(k), 1.45)
2807 rh_00 = rh_00 + (1.45-rh_00)*(-24.0-tc)/(-24.0+85.)
2808 var_temp = sqrt(sqrt((1.46-rhum)/(1.46-rh_00)))
2809 cldfra(k) = max(0., 1.0-var_temp)
2810 else
2811!..but for the GFS model, RH is way lower.
2812 rhum = min(rh(k), 1.05)
2813 rh_00 = rh_00 + (1.05-rh_00)*(-24.0-tc)/(-24.0+85.)
2814 var_temp = sqrt(sqrt((1.06-rhum)/(1.06-rh_00)))
2815 cldfra(k) = max(0., 1.0-var_temp)
2816 endif
2817 endif
2818 if (cldfra(k).gt.0.) cldfra(k)=max(0.01,min(cldfra(k),0.99))
2819
2820 endif
2821 if (cldfra(k).gt.0.0 .and. p(k).lt.7000.0) cldfra(k) = 0.0
2822 ENDDO
2823
2824 call find_cloudlayers(qvs, cldfra, t, p, dz, entrmnt, &
2825 & debug_flag, qc, qi, qs, kts,kte)
2826
2827!..Do a final total column adjustment since we may have added more than 1 mm
2828!.. LWP/IWP for multiple cloud decks.
2829
2830 call adjust_cloudfinal(cldfra, qc, qi, rhoa, dz, kts,kte)
2831
2832!..Intended for cold start model runs, we use modify_qvapor to ensure that cloudy
2833!.. areas are actually saturated such that the inserted clouds do not evaporate a
2834!.. timestep later.
2835
2836 if (modify_qvapor) then
2837 DO k = kts,kte
2838 if (cldfra(k).gt.0.2 .and. cldfra(k).lt.1.0) then
2839 qv(k) = max(qv(k),qvs(k))
2840 endif
2841 ENDDO
2842 endif
2843
2844
2845 END SUBROUTINE cal_cldfra3
2846
2850 SUBROUTINE find_cloudlayers(qvs1d, cfr1d, T1d, P1d, Dz1d, entrmnt,&
2851 & debugfl, qc1d, qi1d, qs1d, kts,kte)
2852!
2853 IMPLICIT NONE
2854!
2855 INTEGER, INTENT(IN):: kts, kte
2856 LOGICAL, INTENT(IN):: debugfl
2857 REAL, INTENT(IN):: entrmnt
2858 REAL, DIMENSION(kts:kte), INTENT(IN):: qs1d,qvs1d,t1d,p1d,dz1d
2859 REAL, DIMENSION(kts:kte), INTENT(INOUT):: cfr1d, qc1d, qi1d
2860
2861!..Local vars.
2862 REAL, DIMENSION(kts:kte):: theta
2863 REAL:: theta1, theta2, delz
2864 INTEGER:: k, k2, k_tropo, k_m12c, k_cldb, k_cldt, kbot, k_p200
2865 LOGICAL:: in_cloud
2866 character*512 dbg_msg
2867
2868!+---+
2869
2870 k_m12c = 0
2871 k_p200 = 0
2872 DO k = kte, kts, -1
2873 theta(k) = t1d(k)*((100000.0/p1d(k))**(287.05/1004.))
2874 if (t1d(k)-273.16 .gt. -12.0 .and. p1d(k).gt.10100.0) &
2875 & k_m12c = max(k_m12c, k)
2876 if (p1d(k).gt.19999.0 .and. k_p200.eq.0) k_p200 = k
2877 ENDDO
2878 if (k_m12c .le. kts) k_m12c = kts
2879
2880!..Find tropopause height, best surrogate, because we would not really
2881!.. wish to put fake clouds into the stratosphere. The 10/1500 ratio
2882!.. d(Theta)/d(Z) approximates a vertical line on typical SkewT chart
2883!.. near typical (mid-latitude) tropopause height. Since messy data
2884!.. could give us a false signal of such a transition, do the check over
2885!.. three K-level change, not just a level-to-level check. This method
2886!.. has potential failure in arctic-like conditions with extremely low
2887!.. tropopause height, as would any other diagnostic, so ensure resulting
2888!.. k_tropo level is above 700hPa.
2889
2890 if ( (kte-k_p200) .lt. 3) k_p200 = kte-3
2891 DO k = k_p200-2, kts, -1
2892 theta1 = theta(k)
2893 theta2 = theta(k+2)
2894 delz = 0.5*dz1d(k) + dz1d(k+1) + 0.5*dz1d(k+2)
2895 if ( (((theta2-theta1)/delz).lt.10./1500.) .OR. &
2896 & p1d(k).gt.70000.) EXIT
2897 ENDDO
2898 k_tropo = max(kts+2, min(k+2, kte-1))
2899
2900 if (k_tropo .gt. k_p200) then
2901 DO k = kte-3, k_p200-2, -1
2902 theta1 = theta(k)
2903 theta2 = theta(k+2)
2904 delz = 0.5*dz1d(k) + dz1d(k+1) + 0.5*dz1d(k+2)
2905 if ( (((theta2-theta1)/delz).lt.10./1500.) .AND. &
2906 & p1d(k).gt.9000.) EXIT
2907 ENDDO
2908 k_tropo = max(k_p200-1, min(k+2, kte-1))
2909 endif
2910
2911!..Eliminate possible fractional clouds above supposed tropopause.
2912 DO k = k_tropo+1, kte
2913 if (cfr1d(k).gt.0.0 .and. cfr1d(k).lt.1.0) then
2914 cfr1d(k) = 0.
2915 endif
2916 ENDDO
2917
2918!..Be a bit more conservative with lower cloud fraction in scenario with
2919!.. well-mixed convective boundary layer below LCL.
2920
2921 kbot = kts+1
2922 DO k = kbot, k_m12c
2923 if ( (theta(k)-theta(k-1)) .gt. 0.010e-3*dz1d(k)) EXIT
2924 ENDDO
2925 kbot = max(kts+1, k-2)
2926 DO k = kts, kbot
2927 if (cfr1d(k).gt.0.0 .and. cfr1d(k).lt.1.0) &
2928 & cfr1d(k) = max(0.01,0.33*cfr1d(k))
2929 ENDDO
2930 DO k = kts,k_tropo
2931 if (cfr1d(k).gt.0.0) kbot = min(k,kbot)
2932 ENDDO
2933
2934!..Starting below tropo height, if cloud fraction greater than 1 percent,
2935!.. compute an approximate total layer depth of cloud, determine a total
2936!.. liquid water/ice path (LWP/IWP), then reduce that amount with tuning
2937!.. parameter to represent entrainment factor, then divide up LWP/IWP
2938!.. into delta-Z weighted amounts for individual levels per cloud layer.
2939
2940 k_cldb = k_tropo
2941 in_cloud = .false.
2942 k = k_tropo
2943 outer_loop: DO WHILE (.not. in_cloud .AND. k.gt.k_m12c+1)
2944 k_cldt = 0
2945 if (cfr1d(k).ge.0.01) then
2946 in_cloud = .true.
2947 k_cldt = max(k_cldt, k)
2948 endif
2949 if (in_cloud) then
2950 inner_search: DO k2 = k_cldt-1, k_m12c, -1
2951 if (cfr1d(k2).lt.0.01 .or. k2.eq.k_m12c) then
2952 k_cldb = k2+1
2953 exit inner_search
2954 endif
2955 END DO inner_search
2956 in_cloud = .false.
2957 endif
2958 if ((k_cldt - k_cldb + 1) .ge. 2) then
2959 call adjust_cloudice(cfr1d, qi1d, qs1d, qvs1d, t1d, dz1d, &
2960 & entrmnt, k_cldb,k_cldt,kts,kte)
2961 k = k_cldb
2962 elseif ((k_cldt - k_cldb + 1) .eq. 1) then
2963 if (cfr1d(k_cldb).gt.0.and.cfr1d(k_cldb).lt.1.) &
2964 & qi1d(k_cldb)=qi1d(k_cldb)+0.05*qvs1d(k_cldb)*cfr1d(k_cldb)
2965 k = k_cldb
2966 endif
2967 k = k - 1
2968 END DO outer_loop
2969
2970 k_cldb = k_m12c + 3
2971 in_cloud = .false.
2972 k = k_m12c + 2
2973 outer_loop2: DO WHILE (.not. in_cloud .AND. k.gt.kbot)
2974 k_cldt = 0
2975 if (cfr1d(k).ge.0.01) then
2976 in_cloud = .true.
2977 k_cldt = max(k_cldt, k)
2978 endif
2979 if (in_cloud) then
2980 inner_loop2: DO k2 = k_cldt-1, kbot, -1
2981 if (cfr1d(k2).lt.0.01 .or. k2.eq.kbot) then
2982 k_cldb = k2+1
2983 exit inner_loop2
2984 endif
2985 END DO inner_loop2
2986 in_cloud = .false.
2987 endif
2988 if ((k_cldt - k_cldb + 1) .ge. 2) then
2989 call adjust_cloudh2o(cfr1d, qc1d, qvs1d, t1d, dz1d, &
2990 & entrmnt, k_cldb,k_cldt,kts,kte)
2991 k = k_cldb
2992 elseif ((k_cldt - k_cldb + 1) .eq. 1) then
2993 if (cfr1d(k_cldb).gt.0.and.cfr1d(k_cldb).lt.1.) &
2994 & qc1d(k_cldb)=qc1d(k_cldb)+0.05*qvs1d(k_cldb)*cfr1d(k_cldb)
2995 k = k_cldb
2996 endif
2997 k = k - 1
2998 END DO outer_loop2
2999
3000 END SUBROUTINE find_cloudlayers
3001
3002!+---+-----------------------------------------------------------------+
3003
3005 SUBROUTINE adjust_cloudice(cfr,qi,qs,qvs,T,dz,entr, k1,k2,kts,kte)
3006!
3007 IMPLICIT NONE
3008!
3009 INTEGER, INTENT(IN):: k1,k2, kts,kte
3010 REAL, INTENT(IN):: entr
3011 REAL, DIMENSION(kts:kte), INTENT(IN):: cfr, qs, qvs, t, dz
3012 REAL, DIMENSION(kts:kte), INTENT(INOUT):: qi
3013 REAL:: iwc, max_iwc, tdz, this_iwc, this_dz
3014 INTEGER:: k
3015
3016 tdz = 0.
3017 do k = k1, k2
3018 tdz = tdz + dz(k)
3019 enddo
3020! max_iwc = ABS(qvs(k2)-qvs(k1))
3021 max_iwc = max(0.0, qvs(k1)-qvs(k2))
3022
3023 do k = k1, k2
3024 max_iwc = max(1.e-6, max_iwc - (qi(k)+qs(k)))
3025 enddo
3026 max_iwc = min(1.e-4, max_iwc)
3027
3028 this_dz = 0.0
3029 do k = k1, k2
3030 if (k.eq.k1) then
3031 this_dz = this_dz + 0.5*dz(k)
3032 else
3033 this_dz = this_dz + dz(k)
3034 endif
3035 this_iwc = max_iwc*this_dz/tdz
3036 iwc = max(1.e-6, this_iwc*(1.-entr))
3037 if (cfr(k).gt.0.0.and.cfr(k).lt.1.0.and.t(k).ge.203.16) then
3038 qi(k) = qi(k) + cfr(k)*cfr(k)*iwc
3039 endif
3040 enddo
3041
3042 END SUBROUTINE adjust_cloudice
3043
3044!+---+-----------------------------------------------------------------+
3045
3047 SUBROUTINE adjust_cloudh2o(cfr, qc, qvs,T,dz,entr, k1,k2,kts,kte)
3048!
3049 IMPLICIT NONE
3050!
3051 INTEGER, INTENT(IN):: k1,k2, kts,kte
3052 REAL, INTENT(IN):: entr
3053 REAL, DIMENSION(kts:kte), INTENT(IN):: cfr, qvs, t, dz
3054 REAL, DIMENSION(kts:kte), INTENT(INOUT):: qc
3055 REAL:: lwc, max_lwc, tdz, this_lwc, this_dz
3056 INTEGER:: k
3057
3058 tdz = 0.
3059 do k = k1, k2
3060 tdz = tdz + dz(k)
3061 enddo
3062! max_lwc = ABS(qvs(k2)-qvs(k1))
3063 max_lwc = max(0.0, qvs(k1)-qvs(k2))
3064! print*, ' max_lwc = ', max_lwc, ' over DZ=',tdz
3065
3066 do k = k1, k2
3067 max_lwc = max(1.e-6, max_lwc - qc(k))
3068 enddo
3069 max_lwc = min(1.e-4, max_lwc)
3070
3071 this_dz = 0.0
3072 do k = k1, k2
3073 if (k.eq.k1) then
3074 this_dz = this_dz + 0.5*dz(k)
3075 else
3076 this_dz = this_dz + dz(k)
3077 endif
3078 this_lwc = max_lwc*this_dz/tdz
3079 lwc = max(1.e-6, this_lwc*(1.-entr))
3080 if (cfr(k).gt.0.0.and.cfr(k).lt.1.0.and.t(k).ge.258.16) then
3081 qc(k) = qc(k) + cfr(k)*cfr(k)*lwc
3082 endif
3083 enddo
3084
3085 END SUBROUTINE adjust_cloudh2o
3086
3087!+---+-----------------------------------------------------------------+
3088
3091 SUBROUTINE adjust_cloudfinal(cfr, qc, qi, Rho,dz, kts,kte)
3092!
3093 IMPLICIT NONE
3094!
3095 INTEGER, INTENT(IN):: kts,kte
3096 REAL, DIMENSION(kts:kte), INTENT(IN):: cfr, rho, dz
3097 REAL, DIMENSION(kts:kte), INTENT(INOUT):: qc, qi
3098 REAL:: lwp, iwp, xfac
3099 INTEGER:: k
3100
3101 lwp = 0.
3102 iwp = 0.
3103 do k = kts, kte
3104 if (cfr(k).gt.0.0 .and. cfr(k).lt.1.0) then
3105 lwp = lwp + qc(k)*rho(k)*dz(k)
3106 iwp = iwp + qi(k)*rho(k)*dz(k)
3107 endif
3108 enddo
3109
3110 if (lwp .gt. 1.0) then
3111 xfac = 1.0/lwp
3112 do k = kts, kte
3113 if (cfr(k).gt.0.0 .and. cfr(k).lt.1.0) then
3114 qc(k) = qc(k)*xfac
3115 endif
3116 enddo
3117 endif
3118
3119 if (iwp .gt. 1.0) then
3120 xfac = 1.0/iwp
3121 do k = kts, kte
3122 if (cfr(k).gt.0.0 .and. cfr(k).lt.1.0) then
3123 qi(k) = qi(k)*xfac
3124 endif
3125 enddo
3126 endif
3127
3128 END SUBROUTINE adjust_cloudfinal
3129
3133 function cld_frac_xurandall(p_lay, qs_lay, relhum, cld_mr, alpha, & ! --- inputs
3134 & lambda, factor, cond_cfrac_onRH)
3135 implicit none
3136 ! Inputs
3137 logical, intent(in), optional :: &
3138 & cond_cfrac_onRH ! If true, cloud-fracion set to unity when rh>99%
3139
3140 real(kind_phys), intent(in) :: &
3141 & p_lay, & !< Pressure (100Pa)
3142 & qs_lay, & !< Saturation vapor-pressure (Pa)
3143 & relhum, & !< Relative humidity
3144 & cld_mr, & !< Total cloud mixing ratio
3145 & alpha, & !< Scheme parameter (default=100)
3146 & lambda, &
3147 & factor ! factor=1.0 for RRTMGP, factor=0 for RRTMG
3148
3149 ! Outputs
3150 real(kind_phys) :: cld_frac_xurandall
3151
3152 ! Locals
3153 real(kind_phys) :: clwt, clwm, onemrh, tem1, tem2, tem3
3154
3155! ! Parameters
3156! real(kind_phys) :: &
3157! lambda = 0.50 ! , &
3158! P = 0.25
3159
3160 clwt = 1.0e-6 * (p_lay*0.001)
3161 clwm = clwt * factor
3162 if (cld_mr > clwt) then
3163 if(present(cond_cfrac_onrh) .and. relhum > 0.99) then
3165 else
3166 onemrh = max(1.e-10, 1.0 - relhum)
3167 tem1 = alpha/min(max((onemrh*qs_lay)**lambda,0.0001),1.0)
3168 tem2 = max(min(tem1*(cld_mr - clwm), 50.0 ), 0.0 )
3169 tem3 = sqrt(sqrt(relhum)) ! This assumes "p" = 0.25. Identical, but cheaper than relhum**p
3170 !
3171 cld_frac_xurandall = max( tem3*(1.0-exp(-tem2)), 0.0 )
3172 endif
3173 else
3174 cld_frac_xurandall = 0.0
3175 endif
3176
3177 return
3178 end function
3179
3180!........................................!
3181 end module module_radiation_clouds
real function rsif(p, t)
THIS FUNCTION CALCULATES THE ICE SATURATION VAPOR MIXING RATIO AS A FUNCTION OF TEMPERATURE AND PRESS...
real function rslf(p, t)
THIS FUNCTION CALCULATES THE LIQUID SATURATION VAPOR MIXING RATIO AS A FUNCTION OF TEMPERATURE AND PR...
subroutine, public progcld_thompson(plyr, plvl, tlyr, qlyr, qstl, rhly, clw, xlat, xlon, slmsk, dz, delp, ntrac, ntcw, ntiw, ntrw, ntsw, ntgl, ix, nlay, nlp1, uni_cld, lmfshal, lmfdeep2, cldcov, re_cloud, re_ice, re_snow, lwp_ex, iwp_ex, lwp_fc, iwp_fc, dzlay, gridkm, top_at_1, cldtot, cldcnv, cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, cld_rwp, cld_rerain, cld_swp, cld_resnow)
This subroutine added by G. Thompson specifically to account for explicit (microphysics-produced) clo...
subroutine, public radiation_clouds_prop(plyr, plvl, tlyr, tvly, qlyr, qstl, rhly, ccnd, ncndl, cnvw, cnvc, tracer1, xlat, xlon, slmsk, dz, delp, ix, lm, nlay, nlp1, deltaq, sup, dcorr_con, me, icloud, kdt, ntrac, ntcw, ntiw, ntrw, ntsw, ntgl, ntclamt, imp_physics, imp_physics_nssl, imp_physics_fer_hires, imp_physics_gfdl, imp_physics_thompson, imp_physics_wsm6, imp_physics_tempo, imp_physics_mg, iovr, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, iovr_exp, iovr_exprand, idcor, idcor_con, idcor_hogan, idcor_oreopoulos, lcrick, lcnorm, imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, do_mynnedmf, lgfdlmprad, xr_cnvcld, uni_cld, lmfshal, lmfdeep2, cldcov, clouds1, effrl, effri, effrr, effrs, effr_in, effrl_inout, effri_inout, effrs_inout, lwp_ex, iwp_ex, lwp_fc, iwp_fc, dzlay, latdeg, julian, yearlen, gridkm, top_at_1, si, xr_con, xr_exp, con_ttp, con_pi, con_g, con_rd, con_thgni, cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, cld_rwp, cld_rerain, cld_swp, cld_resnow, clds, mtop, mbot, de_lgth, alpha)
Subroutine radiation_clouds_prop computes cloud related quantities for different cloud microphysics s...
subroutine, public progcld_thompson_wsm6(plyr, plvl, tlyr, qlyr, qstl, rhly, clw, xlat, xlon, slmsk, dz, delp, ntrac, ntcw, ntiw, ntrw, ntsw, ntgl, con_ttp, xr_cnvcld, ix, nlay, nlp1, xr_con, xr_exp, uni_cld, lmfshal, lmfdeep2, cldcov, cnvw, re_cloud, re_ice, re_snow, lwp_ex, iwp_ex, lwp_fc, iwp_fc, dzlay, cldtot, cldcnv, lcnorm, cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, cld_rwp, cld_rerain, cld_swp, cld_resnow)
This subroutine is used by Thompson/WSM6/NSSL cloud microphysics (EMC)
integer, parameter, public nk_clds
number of cloud vertical domains
subroutine, public gethml(plyr, ptop1, cldtot, cldcnv, dz, de_lgth, alpha, ix, nlay, iovr, iovr_rand, iovr_maxrand, iovr_max, iovr_dcorr, iovr_exp, iovr_exprand, top_at_1, si, clds, mtop, mbot)
This subroutine computes high, mid, low, total, and boundary cloud fractions and cloud top/bottom lay...
integer, parameter, public nf_clds
number of fields in cloud array
subroutine, public progcld_gfdl_lin(plyr, plvl, tlyr, tvly, qlyr, qstl, rhly, clw, cnvw, cnvc, xlat, xlon, slmsk, cldtot, dz, delp, ix, nlay, nlp1, dzlay, cldtot1, cldcnv, lcrick, lcnorm, con_ttp, cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, cld_rwp, cld_rerain, cld_swp, cld_resnow)
This subroutine computes cloud related quantities using GFDL Lin MP prognostic cloud microphysics sch...
subroutine, public progcld_fer_hires(plyr, plvl, tlyr, tvly, qlyr, qstl, rhly, clw, xlat, xlon, slmsk, dz, delp, ntrac, ntcw, ntiw, ntrw, ix, nlay, nlp1, icloud, xr_con, xr_exp, uni_cld, lmfshal, lmfdeep2, cldcov, re_cloud, re_ice, re_snow, dzlay, cldtot, cldcnv, lcnorm, cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, cld_rwp, cld_rerain, cld_swp, cld_resnow)
This subroutine computes cloud related quantities using Ferrier-Aligo cloud microphysics scheme.
subroutine, public adjust_cloudfinal(cfr, qc, qi, rho, dz, kts, kte)
Do not alter any grid-explicitly resolved hydrometeors, rather only the supposed amounts due to the c...
subroutine, public cld_init(si, nlay, imp_physics, me, con_g, con_rd, errflg, errmsg)
This subroutine is an initialization program for cloud-radiation calculations and sets up boundary la...
real(kind_phys) function, public cld_frac_xurandall(p_lay, qs_lay, relhum, cld_mr, alpha, lambda, factor, cond_cfrac_onrh)
This function computes the cloud-fraction following Xu-Randall(1996) .
subroutine, public progclduni(plyr, plvl, tlyr, tvly, ccnd, ncnd, xlat, xlon, slmsk, dz, delp, ix, nlay, nlp1, cldtot, effrl, effri, effrr, effrs, effr_in, dzlay, cldtot1, cldcnv, lcrick, lcnorm, con_ttp, cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, cld_rwp, cld_rerain, cld_swp, cld_resnow)
This subroutine computes cloud related quantities using for unified cloud microphysics scheme.
subroutine, public cal_cldfra3(cldfra, qv, qc, qi, qs, dz, p, t, xland, gridkm, modify_qvapor, max_relh, kts, kte, debug_flag)
Cloud fraction scheme by G. Thompson (NCAR-RAL), not intended for combining with any cumulus or shall...
subroutine, public find_cloudlayers(qvs1d, cfr1d, t1d, p1d, dz1d, entrmnt, debugfl, qc1d, qi1d, qs1d, kts, kte)
From cloud fraction array, find clouds of multi-level depth and compute a reasonable value of LWP or ...
this module defines fortran unit numbers for input/output data files for the ncep gfs model.
Definition iounitdef.f:53
This module computes the moisture tendencies of water vapor, cloud droplets, rain,...
This module contains the calculation of cloud overlap parameters for both RRTMG and RRTMGP.
This module computes cloud related quantities for radiation computations.