Skip to content

Commit

Permalink
Merge branch 'rrtmg-cloud-overlap-updates' of https://github.com/mjia…
Browse files Browse the repository at this point in the history
  • Loading branch information
climbfuji committed Jul 23, 2020
2 parents 82a73dd + a609790 commit b0bc1ab
Show file tree
Hide file tree
Showing 9 changed files with 811 additions and 122 deletions.
132 changes: 85 additions & 47 deletions physics/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
faerlw1, faerlw2, faerlw3, aerodp, &
clouds1, clouds2, clouds3, clouds4, clouds5, clouds6, &
clouds7, clouds8, clouds9, cldsa, &
mtopa, mbota, de_lgth, alb1d, errmsg, errflg)
mtopa, mbota, de_lgth, alpha, alb1d, errmsg, errflg)

use machine, only: kind_phys
use GFS_typedefs, only: GFS_statein_type, &
Expand Down Expand Up @@ -146,6 +146,7 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
integer, dimension(size(Grid%xlon,1),3), intent(out) :: mbota
integer, dimension(size(Grid%xlon,1),3), intent(out) :: mtopa
real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: de_lgth
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP), intent(out) :: alpha
real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(out) :: alb1d

character(len=*), intent(out) :: errmsg
Expand All @@ -156,22 +157,22 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input

integer :: i, j, k, k1, k2, lsk, lv, n, itop, ibtc, LP1, lla, llb, lya, lyb

real(kind=kind_phys) :: es, qs, delt, tem0d
real(kind=kind_phys) :: es, qs, delt, tem0d, pfac

real(kind=kind_phys), dimension(size(Grid%xlon,1)) :: cvt1, cvb1, tem1d, tskn

real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP) :: &
htswc, htlwc, gcice, grain, grime, htsw0, htlw0, &
rhly, tvly,qstl, vvel, clw, ciw, prslk1, tem2da, &
cldcov, deltaq, cnvc, cnvw, &
dzb, hzb, cldcov, deltaq, cnvc, cnvw, &
effrl, effri, effrr, effrs, rho, orho
! for Thompson MP
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP) :: &
re_cloud, re_ice, re_snow, qv_mp, qc_mp, &
qi_mp, qs_mp, nc_mp, ni_mp, nwfa

real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP+1) :: tem2db
! real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP+1) :: hz
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP+1) :: hz

real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP,min(4,Model%ncnd)) :: ccnd
real(kind=kind_phys), dimension(size(Grid%xlon,1),Model%levr+LTP,2:Model%ntrac) :: tracer1
Expand Down Expand Up @@ -432,17 +433,31 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
enddo

! --- ... level height and layer thickness (km)
! dz: Layer thickness between layer boundaries
! dzb: Layer thickness between layer centers (lowest is from surface to lowest layer center)
! hz: Height of each level (i.e. layer boundary)
! hzb: Height of each layer center

tem0d = 0.001 * rog
do i = 1, IM
do k = 1, LMK
dz(i,k) = tem0d * (tem2db(i,k+1) - tem2db(i,k)) * tvly(i,k)
enddo

! hz(i,LMP) = 0.0
! do k = LMK, 1, -1
! hz(i,k) = hz(i,k+1) + dz(i,k)
! enddo
hz(i,LMP) = 0.0
do k = LMK, 1, -1
hz(i,k) = hz(i,k+1) + dz(i,k)
enddo

do k = LMK, 1, -1
pfac = (tem2db(i,k+1) - tem2da(i,k)) / (tem2db(i,k+1) - tem2db(i,k))
hzb(i,k) = hz(i,k+1) + pfac * (hz(i,k) - hz(i,k+1))
enddo

do k = LMK-1, 1, -1
dzb(i,k) = hzb(i,k) - hzb(i,k+1)
enddo
dzb(i,LMK) = hzb(i,LMK) - hz(i,LMP)
enddo

else ! input data from sfc to toa
Expand Down Expand Up @@ -483,17 +498,31 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
enddo

! --- ... level height and layer thickness (km)
! dz: Layer thickness between layer boundaries
! dzb: Layer thickness between layer centers (lowest is from surface to lowest layer center)
! hz: Height of each level (i.e. layer boundary)
! hzb: Height of each layer center

tem0d = 0.001 * rog
do i = 1, IM
do k = LMK, 1, -1
dz(i,k) = tem0d * (tem2db(i,k) - tem2db(i,k+1)) * tvly(i,k)
enddo

! hz(i,1) = 0.0
! do k = 1, LMP
! hz(i,k+1) = hz(i,k) + dz(i,k)
! enddo
hz(i,1) = 0.0
do k = 1, LMK
hz(i,k+1) = hz(i,k) + dz(i,k)
enddo

do k = 1, LMK
pfac = (tem2db(i,k) - tem2da(i,k)) / (tem2db(i,k) - tem2db(i,k+1))
hzb(i,k) = hz(i,k) + pfac * (hz(i,k+1) - hz(i,k))
enddo

do k = 2, LMK
dzb(i,k) = hzb(i,k) - hzb(i,k-1)
enddo
dzb(i,1) = hzb(i,1) - hz(i,1)
enddo

endif ! end_if_ivflip
Expand Down Expand Up @@ -815,19 +844,21 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
! or unified cloud and/or with MG microphysics

if (Model%uni_cld .and. Model%ncld >= 2) then
call progclduni (plyr, plvl, tlyr, tvly, ccnd, ncndl, & ! --- inputs
Grid%xlat, Grid%xlon, Sfcprop%slmsk,dz,delp, &
IM, LMK, LMP, cldcov, &
effrl, effri, effrr, effrs, Model%effr_in, &
clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs
call progclduni (plyr, plvl, tlyr, tvly, ccnd, ncndl, & ! --- inputs
Grid%xlat, Grid%xlon, Sfcprop%slmsk,dz,delp, &
IM, LMK, LMP, cldcov, &
effrl, effri, effrr, effrs, Model%effr_in, &
dzb, Grid%xlat_d, Model%julian, Model%yearlen, &
clouds, cldsa, mtopa, mbota, de_lgth, alpha) ! --- outputs
else
call progcld1 (plyr ,plvl, tlyr, tvly, qlyr, qstl, rhly, & ! --- inputs
ccnd(1:IM,1:LMK,1), Grid%xlat,Grid%xlon, &
Sfcprop%slmsk, dz, delp, IM, LMK, LMP, &
Model%uni_cld, Model%lmfshal, &
Model%lmfdeep2, cldcov, &
effrl, effri, effrr, effrs, Model%effr_in, &
clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs
call progcld1 (plyr ,plvl, tlyr, tvly, qlyr, qstl, rhly, & ! --- inputs
ccnd(1:IM,1:LMK,1), Grid%xlat,Grid%xlon, &
Sfcprop%slmsk, dz, delp, IM, LMK, LMP, &
Model%uni_cld, Model%lmfshal, &
Model%lmfdeep2, cldcov, &
effrl, effri, effrr, effrs, Model%effr_in, &
dzb, Grid%xlat_d, Model%julian, Model%yearlen, &
clouds, cldsa, mtopa, mbota, de_lgth, alpha) ! --- outputs
endif

elseif(Model%imp_physics == 98) then ! zhao/moorthi's prognostic cloud+pdfcld
Expand All @@ -837,7 +868,8 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
cnvw, cnvc, Grid%xlat, Grid%xlon, &
Sfcprop%slmsk, dz, delp, im, lmk, lmp, deltaq, &
Model%sup, Model%kdt, me, &
clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs
dzb, Grid%xlat_d, Model%julian, Model%yearlen, &
clouds, cldsa, mtopa, mbota, de_lgth, alpha) ! --- outputs


elseif (Model%imp_physics == 11) then ! GFDL cloud scheme
Expand All @@ -847,21 +879,24 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
ccnd(1:IM,1:LMK,1), cnvw, cnvc, &
Grid%xlat, Grid%xlon, Sfcprop%slmsk, &
cldcov, dz, delp, im, lmk, lmp, &
clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs
dzb, Grid%xlat_d, Model%julian, Model%yearlen, &
clouds, cldsa, mtopa, mbota, de_lgth, alpha) ! --- outputs
else

call progclduni (plyr, plvl, tlyr, tvly, ccnd, ncndl, & ! --- inputs
Grid%xlat, Grid%xlon, Sfcprop%slmsk, dz,delp, &
IM, LMK, LMP, cldcov, &
effrl, effri, effrr, effrs, Model%effr_in, &
clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs
dzb, Grid%xlat_d, Model%julian, Model%yearlen,&
clouds, cldsa, mtopa, mbota, de_lgth, alpha) ! --- outputs
! call progcld4o (plyr, plvl, tlyr, tvly, qlyr, qstl, rhly, & ! --- inputs
! tracer1, Grid%xlat, Grid%xlon, Sfcprop%slmsk, &
! dz, delp, &
! ntrac-1, Model%ntcw-1,Model%ntiw-1,Model%ntrw-1,&
! Model%ntsw-1,Model%ntgl-1,Model%ntclamt-1, &
! im, lmk, lmp, &
! clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs
! dzb, Grid%xlat_d, Model%julian, Model%yearlen, &
! clouds, cldsa, mtopa, mbota, de_lgth, alpha) ! --- outputs
endif

elseif(Model%imp_physics == 6 .or. Model%imp_physics == 15) then
Expand All @@ -871,15 +906,16 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
Tbd%phy_f3d(:,:,Model%nseffr) = 250.
endif

call progcld5 (plyr,plvl,tlyr,qlyr,qstl,rhly,tracer1, & ! --- inputs
Grid%xlat,Grid%xlon,Sfcprop%slmsk,dz,delp, &
ntrac-1, ntcw-1,ntiw-1,ntrw-1, &
ntsw-1,ntgl-1, &
im, lmk, lmp, Model%uni_cld, &
Model%lmfshal,Model%lmfdeep2, &
cldcov(:,1:LMK),Tbd%phy_f3d(:,:,1), &
Tbd%phy_f3d(:,:,2), Tbd%phy_f3d(:,:,3), &
clouds,cldsa,mtopa,mbota, de_lgth) ! --- outputs
call progcld5 (plyr,plvl,tlyr,qlyr,qstl,rhly,tracer1, & ! --- inputs
Grid%xlat,Grid%xlon,Sfcprop%slmsk,dz,delp, &
ntrac-1, ntcw-1,ntiw-1,ntrw-1, &
ntsw-1,ntgl-1, &
im, lmk, lmp, Model%uni_cld, &
Model%lmfshal,Model%lmfdeep2, &
cldcov(:,1:LMK),Tbd%phy_f3d(:,:,1), &
Tbd%phy_f3d(:,:,2), Tbd%phy_f3d(:,:,3), &
dzb, Grid%xlat_d, Model%julian, Model%yearlen,&
clouds,cldsa,mtopa,mbota, de_lgth, alpha) ! --- outputs


elseif(Model%imp_physics == Model%imp_physics_thompson) then ! Thompson MP
Expand All @@ -900,19 +936,21 @@ subroutine GFS_rrtmg_pre_run (Model, Grid, Sfcprop, Statein, & ! input
Grid%xlat, Grid%xlon, Sfcprop%slmsk, dz,delp, &
IM, LMK, LMP, clouds(:,1:LMK,1), &
effrl, effri, effrr, effrs, Model%effr_in , &
clouds, cldsa, mtopa, mbota, de_lgth) ! --- outputs
dzb, Grid%xlat_d, Model%julian, Model%yearlen, &
clouds, cldsa, mtopa, mbota, de_lgth, alpha) ! --- outputs

else
! MYNN PBL or GF convective are not used
call progcld5 (plyr,plvl,tlyr,qlyr,qstl,rhly,tracer1, & ! --- inputs
Grid%xlat,Grid%xlon,Sfcprop%slmsk,dz,delp, &
ntrac-1, ntcw-1,ntiw-1,ntrw-1, &
ntsw-1,ntgl-1, &
im, lmk, lmp, Model%uni_cld, &
Model%lmfshal,Model%lmfdeep2, &
cldcov(:,1:LMK),Tbd%phy_f3d(:,:,1), &
Tbd%phy_f3d(:,:,2), Tbd%phy_f3d(:,:,3), &
clouds,cldsa,mtopa,mbota, de_lgth) ! --- outputs
call progcld5 (plyr,plvl,tlyr,qlyr,qstl,rhly,tracer1, & ! --- inputs
Grid%xlat,Grid%xlon,Sfcprop%slmsk,dz,delp, &
ntrac-1, ntcw-1,ntiw-1,ntrw-1, &
ntsw-1,ntgl-1, &
im, lmk, lmp, Model%uni_cld, &
Model%lmfshal,Model%lmfdeep2, &
cldcov(:,1:LMK),Tbd%phy_f3d(:,:,1), &
Tbd%phy_f3d(:,:,2), Tbd%phy_f3d(:,:,3), &
dzb, Grid%xlat_d, Model%julian, Model%yearlen,&
clouds,cldsa,mtopa,mbota, de_lgth, alpha) ! --- outputs
endif ! MYNN PBL or GF

endif ! end if_imp_physics
Expand Down
9 changes: 9 additions & 0 deletions physics/GFS_rrtmg_pre.meta
Original file line number Diff line number Diff line change
Expand Up @@ -554,6 +554,15 @@
kind = kind_phys
intent = out
optional = F
[alpha]
standard_name = cloud_overlap_decorrelation_parameter
long_name = cloud overlap decorrelation parameter
units = frac
dimensions = (horizontal_dimension,adjusted_vertical_layer_dimension_for_radiation)
type = real
kind = kind_phys
intent = out
optional = F
[alb1d]
standard_name = surface_albedo_perturbation
long_name = surface albedo perturbation
Expand Down
3 changes: 3 additions & 0 deletions physics/physcons.F90
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ module physcons
real(kind=kind_phys),parameter:: rhosnow = 100._kind_phys !< density of snow (kg/m^3)
real(kind=kind_phys),parameter:: rhoair = 1.28_kind_phys !< density of air near surface (kg/m^3)

! Decorrelation length constant (km) for iovrlw/iovrsw = 4 or 5 and idcor = 0
real(kind=kind_phys),parameter:: decorr_con = 2.50_kind_phys

!........................................!
end module physcons !
!========================================!
8 changes: 8 additions & 0 deletions physics/physparam.f
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,23 @@ module physparam
!!\n =1:use maximum-random cloud overlapping method
!!\n =2:use maximum cloud overlapping method
!!\n =3:use decorrelation length overlapping method
!!\n =4:use exponential overlapping method
!!\n =5:use exponential-random overlapping method
!!\n Opr GFS/CFS=1; see IOVR_SW in run scripts
integer, save :: iovrsw = 1
!> cloud overlapping control flag for LW
!!\n =0:use random cloud overlapping method
!!\n =1:use maximum-random cloud overlapping method
!!\n =2:use maximum cloud overlapping method
!!\n =3:use decorrelation length overlapping method
!!\n =4:use exponential overlapping method
!!\n =5:use exponential-random overlapping method
!!\n Opr GFS/CFS=1; see IOVR_LW in run scripts
integer, save :: iovrlw = 1
!!\n Decorrelation length type for iovrlw/iovrsw = 4 or 5
!!\n =0:use constant decorrelation length defined by decorr_con (in module physcons)
!!\n =1:use day-of-year and latitude-varying decorrelation length
integer, save :: idcor = 1

!> sub-column cloud approx flag in SW radiation
!!\n =0:no McICA approximation in SW radiation
Expand Down
Loading

0 comments on commit b0bc1ab

Please sign in to comment.