-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathradiation_clouds.f
4532 lines (3957 loc) · 182 KB
/
radiation_clouds.f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
!> \file radiation_clouds.f
!! This file contains routines to compute cloud related quantities
!! for radiation computations.
! module_radiation_clouds description !!!!!
! ========================================================== !!!!!
! !
! the 'radiation_clouds.f' contains: !
! !
! 'module_radiation_clouds' --- compute cloud related quantities!
! for radiation computations !
! !
! the following are the externally accessable subroutines: !
! !
! 'cld_init' --- initialization routine !
! inputs: !
! ( si, NLAY, imp_physics, me ) !
! outputs: !
! ( none ) !
! !
! 'progcld1' --- zhao/moorthi prognostic cloud scheme !
! inputs: !
! (plyr,plvl,tlyr,tvly,qlyr,qstl,rhly,clw, !
! xlat,xlon,slmsk, !
! IX, NLAY, NLP1, !
! outputs: !
! clouds,clds,mtop,mbot) !
! !
! 'progcld2' --- ferrier prognostic cloud microphysics !
! inputs: !
! (plyr,plvl,tlyr,tvly,qlyr,qstl,rhly,clw, !
! xlat,xlon,slmsk, f_ice,f_rain,r_rime,flgmin, !
! IX, NLAY, NLP1, !
! outputs: !
! clouds,clds,mtop,mbot) !
! !
! 'progcld3' --- zhao/moorthi prognostic cloud + pdfcld!
! inputs: !
! (plyr,plvl,tlyr,tvly,qlyr,qstl,rhly,clw, cnvw,cnvc, !
! xlat,xlon,slmsk, !
! ix, nlay, nlp1, !
! deltaq,sup,kdt,me, !
! outputs: !
! clouds,clds,mtop,mbot)
! !
! 'progclduni' --- for unified clouds with MG microphys!
! inputs: !
! (plyr,plvl,tlyr,tvly,clw,ciw, !
! xlat,xlon,slmsk, !
! IX, NLAY, NLP1, !
! outputs: !
! clouds,clds,mtop,mbot) !
! !
! 'diagcld1' --- diagnostic cloud calc routine !
! inputs: !
! (plyr,plvl,tlyr,rhly,vvel,cv,cvt,cvb, !
! xlat,xlon,slmsk, !
! IX, NLAY, NLP1, !
! outputs: !
! clouds,clds,mtop,mbot) !
! !
! internal accessable only subroutines: !
! 'gethml' --- get diagnostic hi, mid, low clouds !
! !
! 'rhtable' --- rh lookup table for diag cloud scheme !
! !
! !
! cloud array description: !
! --- for prognostic cloud: icldflg=1 --- !
! clouds(:,:,1) - layer total cloud fraction !
! clouds(:,:,2) - layer cloud liq water path !
! clouds(:,:,3) - mean effective radius for liquid cloud !
! clouds(:,:,4) - layer cloud ice water path !
! clouds(:,:,5) - mean effective radius for ice cloud !
! clouds(:,:,6) - layer rain drop water path !
! clouds(:,:,7) - mean effective radius for rain drop !
! ** clouds(:,:,8) - layer snow flake water path !
! clouds(:,:,9) - mean effective radius for snow flake !
! ** fu's scheme need to be normalized by snow density (g/m**3/1.0e6)!
! --- for diagnostic cloud: icldflg=0 --- !
! clouds(:,:,1) - layer total cloud fraction !
! clouds(:,:,2) - layer cloud optical depth !
! clouds(:,:,3) - layer cloud single scattering albedo !
! clouds(:,:,4) - layer cloud asymmetry factor !
! !
! external modules referenced: !
! !
! 'module physparam' in 'physparam.f' !
! 'module physcons' in 'physcons.f' !
! 'module module_microphysics' in 'module_bfmicrophysics.f' !
! !
! !
! program history log: !
! nov 1992, y.h., k.a.c, a.k. - cloud parameterization !
! 'cldjms' patterned after slingo and slingo's work (jgr, !
! 1992), stratiform clouds are allowed in any layer except !
! the surface and upper stratosphere. the relative humidity !
! criterion may cery in different model layers. !
! mar 1993, kenneth campana - created original crhtab tables !
! for critical rh look up references.
! feb 1994, kenneth campana - modified to use only one table !
! for all forecast hours. !
! oct 1995, kenneth campana - tuned cloud rh curves !
! rh-cld relation from tables created using mitchell-hahn !
! tuning technique on airforce rtneph observations. !
! nov 1995, kenneth campana - the bl relationships used !
! below llyr, except in marine stratus regions. !
! apr 1996, kenneth campana - save bl cld amt in cld(,5) !
! aug 1997, kenneth campana - smooth out last bunch of bins !
! of the rh look up tables !
! dec 1998, s. moorthi - added prognostic cloud method !
! apr 2003, yu-tai hou - rewritten in frotran 90 !
! modulized form 'module_rad_clouds' from combining the original!
! subroutines 'cldjms', 'cldprp', and 'gcljms'. and seperated !
! prognostic and diagnostic methods into two packages. !
! --- 2003, s. moorthi - adapted b. ferrier's prognostic !
! cloud scheme to ncep gfs model as additional option. !
! apr 2004, yu-tai hou - separated calculation of the !
! averaged h,m,l,bl cloud amounts from each of the cld schemes !
! to become an shared individule subprogram 'gethml'. !
! may 2004, yu-tai hou - rewritten ferrier's scheme as a !
! separated program 'progcld2' in the cloud module. !
! apr 2005, yu-tai hou - modified cloud array and module !
! structures. !
! dec 2008, yu-tai hou - changed low-cld calculation, !
! now cantains clds from sfc layer and upward to the low/mid !
! boundary (include bl-cld). h,m,l clds domain boundaries are !
! adjusted for better agreement with observations. !
! jan 2011, yu-tai hou - changed virtual temperature !
! as input variable instead of originally computed inside the !
! two prognostic cld schemes 'progcld1' and 'progcld2'. !
! aug 2012, yu-tai hou - modified subroutine cld_init !
! to pass all fixed control variables at the start. and set !
! their correponding internal module variables to be used by !
! module subroutines. !
! nov 2012, yu-tai hou - modified control parameters !
! thru module 'physparam'. !
! apr 2013, h.lin/y.hou - corrected error in calculating !
! llyr for different vertical indexing directions. !
! jul 2013, r. sun/h. pan - modified to use pdf cloud and !
! convective cloud cover and water for radiation !
! !
! jul 2014 s. moorthi - merging with gfs version !
! feb 2017 a. cheng - add odepth output, effective radius input !
! !
!!!!! ========================================================== !!!!!
!!!!! end descriptions !!!!!
!!!!! ========================================================== !!!!!
!> \defgroup module_radiation_clouds RRTMG Clouds Module
!! \brief This module computes cloud related quantities for radiation
!! computations.
!!
!! Knowledge of cloud properties and their vertical structure is
!! important for meteorological studies due to their impact on both the
!! Earth's radiation budget and adiabatic heating within the atmosphere.
!! Cloud properties in the US National Oceanic and Atmospheric
!! Administration National Centers for Environmental Prediction Global
!! Forecast System (GFS) include (i) cloud liquid/ice water path; (ii)
!! the fraction of clouds; (iii) effective radius of water/ice droplet:
!!
!! Cloud prediction model (namelist control parameter - \b NTCW, \b IMP_PHYSICS):
!!\n NTCW=0: legacy diagnostic cloud scheme based on RH-table lookup table
!!\n NTCW>0: prognostic cloud condensate
!!\n IMP_PHYSICS =98/99: Zhao-Carr-Sundqvist MP - Xu-Randall diagnostic cloud fraction
!!\n IMP_PHYSICS =11: GFDL MP - unified diagnostic cloud fraction provided by GFDL MP
!!
!! Cloud overlapping method (namelist control parameter - \b IOVR_LW, \b IOVR_SW)
!!\n IOVR=0: randomly overlapping vertical cloud layers
!!\n IOVR=1: maximum-random overlapping vertical cloud layers
!!
!! Sub-grid cloud approximation (namelist control parameter - \b ISUBC_LW=2, \b ISUBC_SW=2)
!!\n ISUBC=0: grid averaged quantities, without sub-grid cloud approximation
!!\n ISUBC=1: with McICA sub-grid approximation (use prescribed permutation seeds)
!!\n ISUBC=2: with McICA sub-grid approximation (use random permutation seeds)
!!
!!\version NCEP-Radiation_clouds v5.1 Nov 2012
!!
!> \section gen_al_clouds Zhao-Carr-Sundqvist MP - Xu-Randall Diagnostic Cloud Fraction Calculation
!! @{
!! \n The cloud fraction in a given grid box of the GFS model is
!! computed using the parameterization scheme of
!! Xu and Randall (1996) \cite xu_and_randall_1996 :
!! \f[
!! \sigma =RH^{k_{1}}\left[1-exp\left(-\frac{k_{2}q_{l}}{\left[\left(1-RH\right)q_{s}\right]^{k_{3}}}\right)\right]
!! \f]
!! Where \f$RH\f$ is relative humidity, \f$q_{l}\f$ is the cloud
!! condensate, \f$q_{s}\f$ is saturation specific humidity,
!! \f$k_{1}(=0.25)\f$, \f$k_{2}(=100)\f$, \f$k_{3}(=0.49)\f$ are the
!! empirical parameters. The cloud condensate is partitioned into
!! cloud water and ice in radiation based on temperature. Cloud drop
!! effective radius ranges 5-10 microns over land depending on
!! temperature. Ice crystal radius is function of ice water content
!! (Heymsfield and McFarquhar (1996) \cite heymsfield_and_mcfarquhar_1996).
!! Maximum-randomly cloud overlapping is used in both long-wave
!! radiation and short-wave radiation. Convective clouds are not
!! considered in radiation.
!! @}
!> This module computes cloud related quantities for radiation computations.
module module_radiation_clouds
!
use physparam, only : icldflg, iovrsw, iovrlw, &
& lcrick, lcnorm, lnoprec, &
& ivflip, kind_phys, kind_io4
use physcons, only : con_fvirt, con_ttp, con_rocp, &
& con_t0c, con_pi, con_g, con_rd, &
& con_thgni
use module_microphysics, only : rsipath2
use module_iounitdef, only : NICLTUN
!
implicit none
!
private
! --- version tag and last revision date
character(40), parameter :: &
& VTAGCLD='NCEP-Radiation_clouds v5.1 Nov 2012 '
! & VTAGCLD='NCEP-Radiation_clouds v5.0 Aug 2012 '
! --- set constant parameters
real (kind=kind_phys), parameter :: gfac=1.0e5/con_g &
&, gord=con_g/con_rd
!> number of fields in cloud array
integer, parameter, public :: NF_CLDS = 11
!> number of cloud vertical domains
integer, parameter, public :: NK_CLDS = 3
! pressure limits of cloud domain interfaces (low,mid,high) in mb (0.1kPa)
real (kind=kind_phys), save :: ptopc(NK_CLDS+1,2)
!org data ptopc / 1050., 642., 350., 0.0, 1050., 750., 500., 0.0 /
data ptopc / 1050., 650., 400., 0.0, 1050., 750., 500., 0.0 /
! real (kind=kind_phys), parameter :: climit = 0.01
real (kind=kind_phys), parameter :: climit = 0.001, climit2=0.05
real (kind=kind_phys), parameter :: ovcst = 1.0 - 1.0e-8
! default liq radius to 10 micron
real (kind=kind_phys), parameter :: reliq_def = 10.0
! default ice radius to 50 micron
real (kind=kind_phys), parameter :: reice_def = 50.0
! default rain radius to 1000 micron
real (kind=kind_phys), parameter :: rrain_def = 1000.0
! default snow radius to 250 micron
real (kind=kind_phys), parameter :: rsnow_def = 250.0
! rh in one percent interval
integer, parameter :: NBIN=100
! =1,2 for eastern and western hemispheres
integer, parameter :: NLON=2
! =1,4 for 60n-30n,30n-equ,equ-30s,30s-60s
integer, parameter :: NLAT=4
! =1,4 for bl,low,mid,hi cld type
integer, parameter :: MCLD=4
! =1,2 for land,sea
integer, parameter :: NSEAL=2
! default cld single scat albedo
real (kind=kind_phys), parameter :: cldssa_def = 0.99
! default cld asymmetry factor
real (kind=kind_phys), parameter :: cldasy_def = 0.84
! --- xlabdy: lat bndry between tuning regions, +/- xlim for transition
! xlobdy: lon bndry between tuning regions
! lat bndry between tuning regions
real (kind=kind_phys) :: xlabdy(3)
! lon bndry between tuning regions
real (kind=kind_phys) :: xlobdy(3)
! +/- xlim for transition
real (kind=kind_phys), parameter :: xlim=5.0
data xlabdy / 30.0, 0.0, -30.0 /, xlobdy / 0.0, 180., 360. /
! low cloud vertical velocity adjustment boundaries in mb/sec
real (kind=kind_phys), parameter :: vvcld1= 0.0003e0
! low cloud vertical velocity adjustment boundaries in mb/sec
real (kind=kind_phys), parameter :: vvcld2=-0.0005e0
! --- those data will be set up by "cld_init"
! rhcl : tuned rh relation table for diagnostic cloud scheme
! tuned relative humidity relation table for diagnostic cloud scheme
real (kind=kind_phys) :: rhcl(NBIN,NLON,NLAT,MCLD,NSEAL)
! upper limit of boundary layer clouds
integer :: llyr = 2
! maximum-random cloud overlapping method
integer :: iovr = 1
public progcld1, progcld2, progcld3, progcld4, progclduni, &
& diagcld1, cld_init, progcld5, progcld4o
! =================
contains
! =================
!> \ingroup module_radiation_clouds
!> This subroutine is an initialization program for cloud-radiation
!! calculations and sets up boundary layer cloud top.
!!\param si model vertical sigma layer interface
!!\param NLAY vertical layer number
!!\param imp_physics cloud microphysics scheme control flag
!!\n =99: Zhao-Carr/Sundqvist microphysics cloud
!!\n =98: Zhao-Carr/Sundqvist microphysics cloud = pdfcld
!!\n =11: GFDL microphysics cloud
!!\n =8: Thompson microphysics
!!\n =6: WSM6 microphysics
!!\n =10: MG microphysics
!!\param me print control flag
!>\section gen_cld_init cld_init General Algorithm
!! @{
subroutine cld_init &
& ( si, NLAY, imp_physics, me ) ! --- inputs
! --- outputs:
! ( none )
! =================================================================== !
! !
! abstract: cld_init is an initialization program for cloud-radiation !
! calculations. it sets up boundary layer cloud top. !
! !
! !
! inputs: !
! si (L+1) : model vertical sigma layer interface !
! NLAY : vertical layer number !
! imp_physics : MP identifier !
! me : print control flag !
! !
! outputs: (none) !
! to module variables !
! !
! external module variables: (in physparam) !
! icldflg : cloud optical property scheme control flag !
! =0: model use diagnostic cloud method !
! =1: model use prognostic cloud method !
! imp_physics : cloud microphysics scheme control flag !
! =99: zhao/carr/sundqvist microphysics cloud !
! =98: zhao/carr/sundqvist microphysics cloud+pdfcld!
! =11: GFDL microphysics cloud !
! =8: Thompson microphysics !
! =6: WSM6 microphysics !
! =10: MG microphysics !
! iovrsw/iovrlw : sw/lw control flag for cloud overlapping scheme !
! =0: random overlapping clouds !
! =1: max/ran overlapping clouds !
! ivflip : control flag for direction of vertical index !
! =0: index from toa to surface !
! =1: index from surface to toa !
! usage: call cld_init !
! !
! subroutines called: rhtable !
! !
! =================================================================== !
!
implicit none
! --- inputs:
integer, intent(in) :: NLAY, me, imp_physics
real (kind=kind_phys), intent(in) :: si(:)
! --- outputs: (none)
! --- locals:
integer :: k, kl, ier
!
!===> ... begin here
!
! --- set up module variables
iovr = max( iovrsw, iovrlw ) !cld ovlp used for diag HML cld output
if (me == 0) print *, VTAGCLD !print out version tag
if ( icldflg == 0 ) then
if (me == 0) print *,' - Using Diagnostic Cloud Method'
!> - If using diagnostic cloud method, call rhtable() to set up tuned relative humidity table;
!! If using prognostic cloud method, check if the MP exists.
call rhtable( me, ier )
if (ier < 0) then
write(6,99) ier
99 format(3x,' *** Error in finding tuned RH table ***' &
&, /3x,' STOP at calling subroutine RHTABLE !!'/)
stop 99
endif
else
if (me == 0) then
print *,' - Using Prognostic Cloud Method'
if (imp_physics == 99) then
print *,' --- Zhao/Carr/Sundqvist microphysics'
elseif (imp_physics == 98) then
print *,' --- zhao/carr/sundqvist + pdf cloud'
elseif (imp_physics == 11) then
print *,' --- GFDL Lin cloud microphysics'
elseif (imp_physics == 8) then
print *,' --- Thompson cloud microphysics'
elseif (imp_physics == 6) then
print *,' --- WSM6 cloud microphysics'
elseif (imp_physics == 10) then
print *,' --- MG cloud microphysics'
else
print *,' !!! ERROR in cloud microphysc specification!!!', &
& ' imp_physics (NP3D) =',imp_physics
stop
endif
endif
endif
!> - Compute the top of BL cld (llyr), which is the topmost non
!! cld(low) layer for stratiform (at or above lowest 0.1 of the
!! atmosphere).
if ( ivflip == 0 ) then ! data from toa to sfc
lab_do_k0 : do k = NLAY, 2, -1
kl = k
if (si(k) < 0.9e0) exit lab_do_k0
enddo lab_do_k0
llyr = kl
else ! data from sfc to top
lab_do_k1 : do k = 2, NLAY
kl = k
if (si(k) < 0.9e0) exit lab_do_k1
enddo lab_do_k1
llyr = kl - 1
endif ! end_if_ivflip
!
return
!...................................
end subroutine cld_init
!! @}
!-----------------------------------
!> \ingroup module_radiation_clouds
!> This subroutine computes cloud related quantities using
!! zhao/moorthi's prognostic cloud microphysics scheme.
!!\param plyr (IX,NLAY), model layer mean pressure in mb (100Pa)
!!\param plvl (IX,NLP1), model level pressure in mb (100Pa)
!!\param tlyr (IX,NLAY), model layer mean temperature in K
!!\param tvly (IX,NLAY), model layer virtual temperature in K
!!\param qlyr (IX,NLAY), layer specific humidity in gm/gm
!!\param qstl (IX,NLAY), layer saturate humidity in gm/gm
!!\param rhly (IX,NLAY), layer relative humidity \f$ (=qlyr/qstl) \f$
!!\param clw (IX,NLAY), layer cloud condensate amount
!!\param xlat (IX), grid latitude in radians, default to pi/2 ->
!! -pi/2 range, otherwise see in-line comment
!!\param xlon (IX), grid longitude in radians (not used)
!!\param slmsk (IX), sea/land mask array (sea:0,land:1,sea-ice:2)
!!\param IX horizontal dimention
!!\param NLAY1 vertical layer
!!\param NLP1 level dimensions
!!\param uni_cld logical, true for cloud fraction from shoc
!!\param lmfshal logical, mass-flux shallow convection scheme flag
!!\param lmfdeep2 logical, scale-aware mass-flux deep convection scheme flag
!!\param cldcov layer cloud fraction (used when uni_cld=.true.)
!!\param effrl effective radius for liquid water
!!\param effri effective radius for ice water
!!\param effrr effective radius for rain water
!!\param effrs effective radius for snow water
!!\param effr_in logical, if .true. use input effective radii
!!\param clouds (IX,NLAY,NF_CLDS), cloud profiles
!!\n (:,:,1) - layer total cloud fraction
!!\n (:,:,2) - layer cloud liq water path \f$(g/m^2)\f$
!!\n (:,:,3) - mean eff radius for liq cloud (micron)
!!\n (:,:,4) - layer cloud ice water path \f$(g/m^2)\f$
!!\n (:,:,5) - mean eff radius for ice cloud (micron)
!!\n (:,:,6) - layer rain drop water path (not assigned)
!!\n (:,:,7) - mean eff radius for rain drop (micron)
!!\n (:,:,8) - layer snow flake water path (not assigned)
!!\n (:,:,9) - mean eff radius for snow flake (micron)
!!\param clds (IX,5), fraction of clouds for low, mid, hi, tot, bl
!!\param mtop (IX,3), vertical indices for low, mid, hi cloud tops
!!\param mbot (IX,3), vertical indices for low, mid, hi cloud bases
!>\section gen_progcld1 progcld1 General Algorithm
!> @{
subroutine progcld1 &
& ( plyr,plvl,tlyr,tvly,qlyr,qstl,rhly,clw, & ! --- inputs:
& xlat,xlon,slmsk, IX, NLAY, NLP1, &
& uni_cld, lmfshal, lmfdeep2, cldcov, &
& effrl,effri,effrr,effrs,effr_in, &
& clouds,clds,mtop,mbot & ! --- outputs:
& )
! ================= subprogram documentation block ================ !
! !
! subprogram: progcld1 computes cloud related quantities using !
! zhao/moorthi's prognostic cloud microphysics scheme. !
! !
! abstract: this program computes cloud fractions from cloud !
! condensates, calculates liquid/ice cloud droplet effective radius, !
! and computes the low, mid, high, total and boundary layer cloud !
! fractions and the vertical indices of low, mid, and high cloud !
! top and base. the three vertical cloud domains are set up in the !
! initial subroutine "cld_init". !
! !
! usage: call progcld1 !
! !
! subprograms called: gethml !
! !
! attributes: !
! language: fortran 90 !
! machine: ibm-sp, sgi !
! !
! !
! ==================== definition of variables ==================== !
! !
! input variables: !
! plyr (IX,NLAY) : model layer mean pressure in mb (100Pa) !
! plvl (IX,NLP1) : model level pressure in mb (100Pa) !
! tlyr (IX,NLAY) : model layer mean temperature in k !
! tvly (IX,NLAY) : model layer virtual temperature in k !
! qlyr (IX,NLAY) : layer specific humidity in gm/gm !
! qstl (IX,NLAY) : layer saturate humidity in gm/gm !
! rhly (IX,NLAY) : layer relative humidity (=qlyr/qstl) !
! clw (IX,NLAY) : layer cloud condensate amount !
! xlat (IX) : grid latitude in radians, default to pi/2 -> -pi/2!
! range, otherwise see in-line comment !
! xlon (IX) : grid longitude in radians (not used) !
! slmsk (IX) : sea/land mask array (sea:0,land:1,sea-ice:2) !
! IX : horizontal dimention !
! NLAY,NLP1 : vertical layer/level dimensions !
! uni_cld : logical - true for cloud fraction from shoc !
! lmfshal : logical - true for mass flux shallow convection !
! lmfdeep2 : logical - true for mass flux deep convection !
! cldcov : layer cloud fraction (used when uni_cld=.true. !
! !
! output variables: !
! clouds(IX,NLAY,NF_CLDS) : cloud profiles !
! clouds(:,:,1) - layer total cloud fraction !
! clouds(:,:,2) - layer cloud liq water path (g/m**2) !
! clouds(:,:,3) - mean eff radius for liq cloud (micron) !
! clouds(:,:,4) - layer cloud ice water path (g/m**2) !
! clouds(:,:,5) - mean eff radius for ice cloud (micron) !
! clouds(:,:,6) - layer rain drop water path not assigned !
! clouds(:,:,7) - mean eff radius for rain drop (micron) !
! *** clouds(:,:,8) - layer snow flake water path not assigned !
! clouds(:,:,9) - mean eff radius for snow flake (micron) !
! *** fu's scheme need to be normalized by snow density (g/m**3/1.0e6) !
! clds (IX,5) : fraction of clouds for low, mid, hi, tot, bl !
! mtop (IX,3) : vertical indices for low, mid, hi cloud tops !
! mbot (IX,3) : vertical indices for low, mid, hi cloud bases !
! !
! module variables: !
! ivflip : control flag of vertical index direction !
! =0: index from toa to surface !
! =1: index from surface to toa !
! lmfshal : mass-flux shallow conv scheme flag !
! lmfdeep2 : scale-aware mass-flux deep conv scheme flag !
! lcrick : control flag for eliminating CRICK !
! =t: apply layer smoothing to eliminate CRICK !
! =f: do not apply layer smoothing !
! lcnorm : control flag for in-cld condensate !
! =t: normalize cloud condensate !
! =f: not normalize cloud condensate !
! !
! ==================== end of description ===================== !
!
implicit none
! --- inputs
integer, intent(in) :: IX, NLAY, NLP1
logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, effr_in
real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, &
& tlyr, tvly, qlyr, qstl, rhly, clw, cldcov, &
& effrl, effri, effrr, effrs
real (kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, &
& slmsk
! --- outputs
real (kind=kind_phys), dimension(:,:,:), intent(out) :: clouds
real (kind=kind_phys), dimension(:,:), intent(out) :: clds
integer, dimension(:,:), intent(out) :: mtop,mbot
! --- local variables:
real (kind=kind_phys), dimension(IX,NLAY) :: cldtot, cldcnv, &
& cwp, cip, crp, csp, rew, rei, res, rer, delp, tem2d, clwf
real (kind=kind_phys) :: ptop1(IX,NK_CLDS+1)
real (kind=kind_phys) :: clwmin, clwm, clwt, onemrh, value, &
& tem1, tem2, tem3
integer :: i, k, id, nf
! --- constant values
! real (kind=kind_phys), parameter :: xrc3 = 200.
real (kind=kind_phys), parameter :: xrc3 = 100.
!
!===> ... begin here
!
do nf=1,nf_clds
do k=1,nlay
do i=1,ix
clouds(i,k,nf) = 0.0
enddo
enddo
enddo
! clouds(:,:,:) = 0.0
!> - Assgin liquid/ice/rain/snow cloud effective radius from input or predefined values.
if(effr_in) then
do k = 1, NLAY
do i = 1, IX
cldtot(i,k) = 0.0
cldcnv(i,k) = 0.0
cwp (i,k) = 0.0
cip (i,k) = 0.0
crp (i,k) = 0.0
csp (i,k) = 0.0
rew (i,k) = effrl (i,k)
rei (i,k) = effri (i,k)
rer (i,k) = effrr (i,k)
res (i,k) = effrs (i,k)
tem2d (i,k) = min(1.0, max(0.0,(con_ttp-tlyr(i,k))*0.05))
clwf(i,k) = 0.0
enddo
enddo
else
do k = 1, NLAY
do i = 1, IX
cldtot(i,k) = 0.0
cldcnv(i,k) = 0.0
cwp (i,k) = 0.0
cip (i,k) = 0.0
crp (i,k) = 0.0
csp (i,k) = 0.0
rew (i,k) = reliq_def ! default liq radius to 10 micron
rei (i,k) = reice_def ! default ice radius to 50 micron
rer (i,k) = rrain_def ! default rain radius to 1000 micron
res (i,k) = rsnow_def ! default snow radius to 250 micron
tem2d (i,k) = min(1.0, max(0.0, (con_ttp-tlyr(i,k))*0.05))
clwf(i,k) = 0.0
enddo
enddo
endif
!
if ( lcrick ) then
do i = 1, IX
clwf(i,1) = 0.75*clw(i,1) + 0.25*clw(i,2)
clwf(i,nlay) = 0.75*clw(i,nlay) + 0.25*clw(i,nlay-1)
enddo
do k = 2, NLAY-1
do i = 1, IX
clwf(i,K) = 0.25*clw(i,k-1) + 0.5*clw(i,k) + 0.25*clw(i,k+1)
enddo
enddo
else
do k = 1, NLAY
do i = 1, IX
clwf(i,k) = clw(i,k)
enddo
enddo
endif
!> - Compute SFC/low/middle/high cloud top pressure for each cloud
!! domain for given latitude.
! ptopc(k,i): top presure of each cld domain (k=1-4 are sfc,L,m,h;
! --- i=1,2 are low-lat (<45 degree) and pole regions)
do id = 1, 4
tem1 = ptopc(id,2) - ptopc(id,1)
do i =1, IX
tem2 = xlat(i) / con_pi ! if xlat in pi/2 -> -pi/2 range
! tem2 = 0.5 - xlat(i)/con_pi ! if xlat in 0 -> pi range
ptop1(i,id) = ptopc(id,1) + tem1*max( 0.0, 4.0*abs(tem2)-1.0 )
enddo
enddo
!> - Compute cloud liquid/ice condensate path in \f$ g/m^2 \f$ .
if ( ivflip == 0 ) then ! input data from toa to sfc
do k = 1, NLAY
do i = 1, IX
delp(i,k) = plvl(i,k+1) - plvl(i,k)
clwt = max(0.0, clwf(i,k)) * gfac * delp(i,k)
cip(i,k) = clwt * tem2d(i,k)
cwp(i,k) = clwt - cip(i,k)
enddo
enddo
else ! input data from sfc to toa
do k = 1, NLAY
do i = 1, IX
delp(i,k) = plvl(i,k) - plvl(i,k+1)
clwt = max(0.0, clwf(i,k)) * gfac * delp(i,k)
cip(i,k) = clwt * tem2d(i,k)
cwp(i,k) = clwt - cip(i,k)
enddo
enddo
endif ! end_if_ivflip
!> - Compute effective liquid cloud droplet radius over land.
if(.not. effr_in) then
do i = 1, IX
if (nint(slmsk(i)) == 1) then
do k = 1, NLAY
rew(i,k) = 5.0 + 5.0 * tem2d(i,k)
enddo
endif
enddo
endif
!> - Compute layer cloud fraction.
if (uni_cld) then ! use unified sgs clouds generated outside
do k = 1, NLAY
do i = 1, IX
cldtot(i,k) = cldcov(i,k)
enddo
enddo
else
if ( ivflip == 0 ) then ! input data from toa to sfc
clwmin = 0.0
if (.not. lmfshal) then
do k = NLAY, 1, -1
do i = 1, IX
clwt = 1.0e-6 * (plyr(i,k)*0.001)
! clwt = 2.0e-6 * (plyr(i,k)*0.001)
if (clwf(i,k) > clwt) then
onemrh= max( 1.e-10, 1.0-rhly(i,k) )
clwm = clwmin / max( 0.01, plyr(i,k)*0.001 )
tem1 = min(max(sqrt(sqrt(onemrh*qstl(i,k))),0.0001),1.0)
tem1 = 2000.0 / tem1
! tem1 = 1000.0 / tem1
value = max( min( tem1*(clwf(i,k)-clwm), 50.0 ), 0.0 )
tem2 = sqrt( sqrt(rhly(i,k)) )
cldtot(i,k) = max( tem2*(1.0-exp(-value)), 0.0 )
endif
enddo
enddo
else
do k = NLAY, 1, -1
do i = 1, IX
clwt = 1.0e-6 * (plyr(i,k)*0.001)
! clwt = 2.0e-6 * (plyr(i,k)*0.001)
if (clwf(i,k) > clwt) then
onemrh= max( 1.e-10, 1.0-rhly(i,k) )
clwm = clwmin / max( 0.01, plyr(i,k)*0.001 )
!
tem1 = min(max((onemrh*qstl(i,k))**0.49,0.0001),1.0) !jhan
if (lmfdeep2) then
tem1 = xrc3 / tem1
else
tem1 = 100.0 / tem1
endif
!
value = max( min( tem1*(clwf(i,k)-clwm), 50.0 ), 0.0 )
tem2 = sqrt( sqrt(rhly(i,k)) )
cldtot(i,k) = max( tem2*(1.0-exp(-value)), 0.0 )
endif
enddo
enddo
endif
else ! input data from sfc to toa
clwmin = 0.0
if (.not. lmfshal) then
do k = 1, NLAY
do i = 1, IX
clwt = 1.0e-6 * (plyr(i,k)*0.001)
! clwt = 2.0e-6 * (plyr(i,k)*0.001)
if (clwf(i,k) > clwt) then
onemrh= max( 1.e-10, 1.0-rhly(i,k) )
clwm = clwmin / max( 0.01, plyr(i,k)*0.001 )
tem1 = min(max(sqrt(sqrt(onemrh*qstl(i,k))),0.0001),1.0)
tem1 = 2000.0 / tem1
! tem1 = 1000.0 / tem1
value = max( min( tem1*(clwf(i,k)-clwm), 50.0 ), 0.0 )
tem2 = sqrt( sqrt(rhly(i,k)) )
cldtot(i,k) = max( tem2*(1.0-exp(-value)), 0.0 )
endif
enddo
enddo
else
do k = 1, NLAY
do i = 1, IX
clwt = 1.0e-6 * (plyr(i,k)*0.001)
! clwt = 2.0e-6 * (plyr(i,k)*0.001)
if (clwf(i,k) > clwt) then
onemrh= max( 1.e-10, 1.0-rhly(i,k) )
clwm = clwmin / max( 0.01, plyr(i,k)*0.001 )
!
tem1 = min(max((onemrh*qstl(i,k))**0.49,0.0001),1.0) !jhan
if (lmfdeep2) then
tem1 = xrc3 / tem1
else
tem1 = 100.0 / tem1
endif
!
value = max( min( tem1*(clwf(i,k)-clwm), 50.0 ), 0.0 )
tem2 = sqrt( sqrt(rhly(i,k)) )
cldtot(i,k) = max( tem2*(1.0-exp(-value)), 0.0 )
endif
enddo
enddo
endif
endif ! end_if_flip
endif ! if (uni_cld) then
do k = 1, NLAY
do i = 1, IX
if (cldtot(i,k) < climit) then
cldtot(i,k) = 0.0
cwp(i,k) = 0.0
cip(i,k) = 0.0
crp(i,k) = 0.0
csp(i,k) = 0.0
endif
enddo
enddo
if ( lcnorm ) then
do k = 1, NLAY
do i = 1, IX
if (cldtot(i,k) >= climit) then
tem1 = 1.0 / max(climit2, cldtot(i,k))
cwp(i,k) = cwp(i,k) * tem1
cip(i,k) = cip(i,k) * tem1
crp(i,k) = crp(i,k) * tem1
csp(i,k) = csp(i,k) * tem1
endif
enddo
enddo
endif
!> - Compute effective ice cloud droplet radius following Heymsfield
!! and McFarquhar (1996) \cite heymsfield_and_mcfarquhar_1996.
if(.not.effr_in) then
do k = 1, NLAY
do i = 1, IX
tem2 = tlyr(i,k) - con_ttp
if (cip(i,k) > 0.0) then
tem3 = gord * cip(i,k) * plyr(i,k) / (delp(i,k)*tvly(i,k))
if (tem2 < -50.0) then
rei(i,k) = (1250.0/9.917) * tem3 ** 0.109
elseif (tem2 < -40.0) then
rei(i,k) = (1250.0/9.337) * tem3 ** 0.08
elseif (tem2 < -30.0) then
rei(i,k) = (1250.0/9.208) * tem3 ** 0.055
else
rei(i,k) = (1250.0/9.387) * tem3 ** 0.031
endif
! rei(i,k) = max(20.0, min(rei(i,k), 300.0))
! rei(i,k) = max(10.0, min(rei(i,k), 100.0))
rei(i,k) = max(10.0, min(rei(i,k), 150.0))
! rei(i,k) = max(5.0, min(rei(i,k), 130.0))
endif
enddo
enddo
endif
!
do k = 1, NLAY
do i = 1, IX
clouds(i,k,1) = cldtot(i,k)
clouds(i,k,2) = cwp(i,k)
clouds(i,k,3) = rew(i,k)
clouds(i,k,4) = cip(i,k)
clouds(i,k,5) = rei(i,k)
! clouds(i,k,6) = 0.0
clouds(i,k,7) = rer(i,k)
! clouds(i,k,8) = 0.0
clouds(i,k,9) = res(i,k)
enddo
enddo
!> - Call gethml() to compute low,mid,high,total, and boundary layer
!! cloud fractions and clouds top/bottom layer indices for low, mid,
!! and high clouds. The three cloud domain boundaries are defined by
!! ptopc. The cloud overlapping method is defined by control flag
!! 'iovr', which may be different for lw and sw radiation programs.
call gethml &
! --- inputs:
& ( plyr, ptop1, cldtot, cldcnv, &
& IX,NLAY, &
! --- outputs:
& clds, mtop, mbot &
& )
!
return
!...................................
end subroutine progcld1
!-----------------------------------
!> @}
!> \ingroup module_radiation_clouds
!> This subroutine computes cloud related quantities using Ferrier's
!! prognostic cloud microphysics scheme.
!!\param plyr (IX,NLAY), model layer mean pressure in mb (100Pa)
!!\param plvl (IX,NLP1), model level pressure in mb (100Pa)
!!\param tlyr (IX,NLAY), model layer mean temperature in K
!!\param tvly (IX,NLAY), model layer virtual temperature in K
!!\param qlyr (IX,NLAY), layer specific humidity in gm/gm
!!\param qstl (IX,NLAY), layer saturate humidity in gm/gm
!!\param rhly (IX,NLAY), layer relative humidity (=qlyr/qstl)
!!\param clw (IX,NLAY), layer cloud condensate amount
!!\param xlat (IX), grid latitude in radians, default to pi/2 ->
!! -pi/2 range, otherwise see in-line comment
!!\param xlon (IX), grid longitude in radians (not used)
!!\param slmsk (IX), sea/land mask array (sea:0,land:1,sea-ice:2)
!!\param f_ice (IX,NLAY), fraction of layer cloud ice (Ferrier micro-phys)
!!\param f_rain (IX,NLAY), fraction of layer rain water (Ferrier micro-phys)
!!\param r_rime (IX,NLAY), mass ratio of total ice to unrimed ice (>=1)
!!\param flgmin (IX), minimum large ice fraction
!!\param IX horizontal dimention
!!\param NLAY vertical layer dimension
!!\param NLP1 vertical level dimension
!!\param lmfshal mass-flux shallow convective scheme flag
!!\param lmfdeep2 scale-aware mass-flux deep convective scheme flag
!!\param clouds (IX,NLAY,NF_CLDS), cloud profiles
!!\n (:,:,1) - layer total cloud fraction
!!\n (:,:,2) - layer cloud liq water path \f$(g/m^2)\f$
!!\n (:,:,3) - mean eff radius for liq cloud (micron)
!!\n (:,:,4) - layer cloud ice water path \f$(g/m^2)\f$
!!\n (:,:,5) - mean eff radius for ice cloud (micron)
!!\n (:,:,6) - layer rain drop water path \f$(g/m^2)\f$
!!\n (:,:,7) - mean eff radius for rain drop (micron)
!!\n (:,:,8) - layer snow flake water path \f$(g/m^2)\f$
!!\n (:,:,9) - mean eff radius for snow flake (micron)
!!\param clds (IX,5), fraction of clouds for low, mid, hi, tot, bl
!!\param mtop (IX,3), vertical indices for low, mid, hi cloud tops
!!\param mbot (IX,3), vertical indices for low, mid, hi cloud bases
!>\section gen_progcld2 progcld2 General Algorithm
!! @{
subroutine progcld2 &
& ( plyr,plvl,tlyr,tvly,qlyr,qstl,rhly,clw, & ! --- inputs:
& xlat,xlon,slmsk, f_ice,f_rain,r_rime,flgmin, &
& IX, NLAY, NLP1, lmfshal, lmfdeep2, &
& clouds,clds,mtop,mbot & ! --- outputs:
& )
! ================= subprogram documentation block ================ !
! !
! subprogram: progcld2 computes cloud related quantities using !
! ferrier's prognostic cloud microphysics scheme. !
! !
! abstract: this program computes cloud fractions from cloud !
! condensates, calculates liquid/ice cloud droplet effective radius, !
! and computes the low, mid, high, total and boundary layer cloud !
! fractions and the vertical indices of low, mid, and high cloud !
! top and base. the three vertical cloud domains are set up in the !
! initial subroutine "cld_init". !
! !
! usage: call progcld2 !
! !
! subprograms called: gethml !
! !
! attributes: !
! language: fortran 90 !
! machine: ibm-sp, sgi !
! !
! !
! ==================== definition of variables ==================== !
! !
! input variables: !
! plyr (IX,NLAY) : model layer mean pressure in mb (100Pa) !
! plvl (IX,NLP1) : model level pressure in mb (100Pa) !
! tlyr (IX,NLAY) : model layer mean temperature in k !
! tvly (IX,NLAY) : model layer virtual temperature in k !
! qlyr (IX,NLAY) : layer specific humidity in gm/gm !
! qstl (IX,NLAY) : layer saturate humidity in gm/gm !