CCPP SciDoc v7.0.0  v7.0.0
Common Community Physics Package Developed at DTC
 
Loading...
Searching...
No Matches
GFS_rrtmgp_cloud_overlap.F90
1
7 use machine, only: kind_phys
8 use radiation_tools, only: check_error_msg
9 use module_radiation_cloud_overlap, only: cmp_dcorr_lgth, get_alpha_exper
10
11 public gfs_rrtmgp_cloud_overlap_run
12
13contains
14
23 subroutine gfs_rrtmgp_cloud_overlap_run(nCol, nLev, yearlen, doSWrad, doLWrad, &
24 julian, lat, deltaZc, con_pi, con_g, con_rd, con_epsq, &
25 dcorr_con, idcor, iovr, iovr_dcorr, iovr_exp, iovr_exprand, idcor_con, &
26 idcor_hogan, idcor_oreopoulos, cld_frac, cld_cnv_frac, iovr_convcld, top_at_1, &
27 imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_samf, de_lgth, cloud_overlap_param, &
28 cnv_cloud_overlap_param, precip_overlap_param, errmsg, errflg)
29 implicit none
30
31 ! Inputs
32 integer, intent(in) :: &
33 ncol, & !< Number of horizontal grid points
34 nlev, & !< Number of vertical layers
35 yearlen, & !< Length of current year (365/366) WTF?
36 imfdeepcnv, & !<
37 imfdeepcnv_gf, & !<
38 imfdeepcnv_samf, & !<
39 iovr, & !< Choice of cloud-overlap method
40 iovr_convcld, & !< Choice of convective cloud-overlap method
41 iovr_dcorr, & !< Flag for decorrelation-length cloud overlap method
42 iovr_exp, & !< Flag for exponential cloud overlap method
43 iovr_exprand, & !< Flag for exponential-random cloud overlap method
44 idcor, & !< Choice of method for decorrelation length computation
45 idcor_con, & !< Flag for decorrelation-length. Use constant value
46 idcor_hogan, & !< Flag for decorrelation-length. (https://rmets.onlinelibrary.wiley.com/doi/full/10.1002/qj.647)
47 idcor_oreopoulos
48 logical, intent(in) :: &
49 top_at_1, & !< Vertical ordering flag
50 doswrad, & !< Call SW radiation?
51 dolwrad
52 real(kind_phys), intent(in) :: &
53 julian, & !< Julian day
54 con_pi, & !< Physical constant: pi
55 con_g, & !< Physical constant: gravitational constant
56 con_rd, & !< Physical constant: gas-constant for dry air
57 con_epsq, & !< Physical constant: Minimum value for specific humidity
58 dcorr_con
59 real(kind_phys), dimension(:), intent(in) :: &
60 lat
61 real(kind_phys), dimension(:,:), intent(in) :: &
62 cld_frac
63 real(kind_phys), dimension(:,:), intent(in), optional :: &
64 cld_cnv_frac
65 real(kind_phys), dimension(:,:), intent(in), optional :: &
66 deltazc
67
68 ! Outputs
69 real(kind_phys), dimension(:),intent(out) :: &
70 de_lgth
71 real(kind_phys), dimension(:,:),intent(out), optional :: &
72 cloud_overlap_param, & !< Cloud-overlap parameter
73 cnv_cloud_overlap_param,& !< Convective cloud-overlap parameter
74 precip_overlap_param
75 character(len=*), intent(out) :: &
76 errmsg
77 integer, intent(out) :: &
78 errflg
79
80 ! Local variables
81 integer :: icol,ilay
82
83 ! Initialize CCPP error handling variables
84 errmsg = ''
85 errflg = 0
86
87 if (.not. (doswrad .or. dolwrad)) return
88
89 !
90 ! Cloud decorrelation length
91 !
92 de_lgth(:) = 0.
93 if (idcor == idcor_hogan) then
94 call cmp_dcorr_lgth(ncol, lat, con_pi, de_lgth)
95 endif
96 if (idcor == idcor_oreopoulos) then
97 call cmp_dcorr_lgth(ncol, lat*(180._kind_phys/con_pi), julian, yearlen, de_lgth)
98 endif
99 if (idcor == idcor_con) then
100 de_lgth(:) = dcorr_con
101 endif
102
103 !
104 ! Cloud overlap parameter
105 !
106 if (iovr == iovr_dcorr .or. iovr == iovr_exp .or. iovr == iovr_exprand) then
107 call get_alpha_exper(ncol, nlev, iovr, iovr_exprand, deltazc*0.001, de_lgth, cld_frac, cloud_overlap_param)
108 else
109 cloud_overlap_param(:,:) = 0.
110 endif
111
112 !
113 ! Convective cloud overlap parameter
114 !
115 if (imfdeepcnv == imfdeepcnv_samf .or. imfdeepcnv == imfdeepcnv_gf) then
116 if (iovr_convcld == iovr_dcorr .or. iovr_convcld == iovr_exp .or. iovr_convcld == iovr_exprand) then
117 call get_alpha_exper(ncol, nlev, iovr_convcld, iovr_exprand, deltazc*0.001, de_lgth, cld_cnv_frac, cnv_cloud_overlap_param)
118 else
119 cnv_cloud_overlap_param(:,:) = 0.
120 endif
121 endif
122
123 !
124 ! Compute precipitation overlap parameter (Hack. Using same as cloud for now)
125 !
126 precip_overlap_param = cloud_overlap_param
127
128 end subroutine gfs_rrtmgp_cloud_overlap_run