Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couple convective cloud to radiation #9

Merged
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 35 additions & 14 deletions physics/GFS_rrtmgp_cloud_mp.F90
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ subroutine GFS_rrtmgp_cloud_mp_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldic
relhum, lsmask, xlon, xlat, dx, tv_lay, effrin_cldliq, effrin_cldice, &
effrin_cldrain, effrin_cldsnow, tracer, cnv_mixratio, cld_cnv_frac, qci_conv, &
deltaZ, deltaZc, deltaP, qc_mynn, qi_mynn, cld_pbl_frac, con_g, con_rd, con_eps, &
con_ttp, doGP_cldoptics_PADE, doGP_cldoptics_LUT, cld_frac, cld_lwp, cld_reliq, &
con_ttp, doGP_cldoptics_PADE, doGP_cldoptics_LUT, doGP_smearclds, &
cld_frac, cld_lwp, cld_reliq, &
cld_iwp, cld_reice, cld_swp, cld_resnow, cld_rwp, cld_rerain, precip_frac, &
cld_cnv_lwp, cld_cnv_reliq, cld_cnv_iwp, cld_cnv_reice, cld_pbl_lwp, &
cld_pbl_reliq, cld_pbl_iwp, cld_pbl_reice, lwp_ex, iwp_ex, lwp_fc, iwp_fc, &
errmsg, errflg)
cldfra2d, errmsg, errflg)
implicit none

! Inputs
Expand Down Expand Up @@ -91,7 +92,8 @@ subroutine GFS_rrtmgp_cloud_mp_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldic
uni_cld, & ! Flag for unified cloud scheme
lmfdeep2, & ! Flag for mass flux deep convection
doGP_cldoptics_LUT, & ! Flag to do GP cloud-optics (LUTs)
doGP_cldoptics_PADE ! (PADE approximation)
doGP_cldoptics_PADE, & ! (PADE approximation)
doGP_smearclds ! If true, add sgs clouds to gridmean clouds
real(kind_phys), intent(in) :: &
con_g, & ! Physical constant: gravitational constant
con_rd, & ! Physical constant: gas-constant for dry air
Expand Down Expand Up @@ -134,6 +136,8 @@ subroutine GFS_rrtmgp_cloud_mp_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldic
iwp_ex, & ! Total ice water path from explicit microphysics
lwp_fc, & ! Total liquid water path from cloud fraction scheme
iwp_fc ! Total ice water path from cloud fraction scheme
real(kind_phys), dimension(:), intent(out) :: &
cldfra2d ! Instantaneous 2D (max-in-column) cloud fraction
real(kind_phys), dimension(:,:),intent(inout) :: &
cld_frac, & ! Cloud-fraction for stratiform clouds
cld_lwp, & ! Water path for stratiform liquid cloud-particles
Expand Down Expand Up @@ -266,8 +270,9 @@ subroutine GFS_rrtmgp_cloud_mp_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldic
endif
call cloud_mp_thompson(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldice, i_cldrain,&
i_cldsnow, i_cldgrpl, p_lev, p_lay, tv_lay, t_lay, tracer, qs_lay, q_lay, &
relhum, con_g, con_rd, con_eps, alpha0, lwp_ex, iwp_ex, lwp_fc, iwp_fc, &
cld_frac, cld_lwp, cld_iwp, cld_swp, cld_rwp, cond_cfrac_onRH = .true.)
relhum, con_ttp, con_g, con_rd, con_eps, alpha0, cnv_mixratio, lwp_ex, &
iwp_ex, lwp_fc, iwp_fc, cld_frac, cld_lwp, cld_iwp, cld_swp, cld_rwp, &
cond_cfrac_onRH = .true., doGP_smearclds = doGP_smearclds)
endif

! Bound effective radii for RRTMGP, LUT's for cloud-optics go from
Expand All @@ -292,6 +297,14 @@ subroutine GFS_rrtmgp_cloud_mp_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldic
endif
endif

! Instantaneous 2D (max-in-column) cloud fraction
do iCol = 1, nCol
cldfra2d(iCol) = 0._kind_phys
do iLay = 1, nLev-1
grantfirl marked this conversation as resolved.
Show resolved Hide resolved
cldfra2d(iCol) = max(cldfra2d(iCol), cld_frac(iCol,iLay))
enddo
enddo

precip_frac(1:nCol,1:nLev) = cld_frac(1:nCol,1:nLev)

end subroutine GFS_rrtmgp_cloud_mp_run
Expand Down Expand Up @@ -658,13 +671,14 @@ end subroutine cloud_mp_uni
!! \section cloud_mp_thompson_gen General Algorithm
subroutine cloud_mp_thompson(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldice, i_cldrain,&
i_cldsnow, i_cldgrpl, p_lev, p_lay, tv_lay, t_lay, tracer, qs_lay, q_lay, relhum, &
con_g, con_rd, con_eps, alpha0, lwp_ex, iwp_ex, lwp_fc, iwp_fc, cld_frac, cld_lwp,&
cld_iwp, cld_swp, cld_rwp, cond_cfrac_onRH)
con_ttp, con_g, con_rd, con_eps, alpha0, cnv_mixratio, lwp_ex, iwp_ex, lwp_fc, &
iwp_fc, cld_frac, cld_lwp, cld_iwp, cld_swp, cld_rwp, cond_cfrac_onRH, doGP_smearclds)
implicit none

! Inputs
logical, intent(in), optional :: &
cond_cfrac_onRH
cond_cfrac_onRH, & ! If true, cloud-fracion set to unity when rh>99%
doGP_smearclds ! If true, add sgs clouds to gridmean clouds
integer, intent(in) :: &
nCol, & ! Number of horizontal grid points
nLev, & ! Number of vertical layers
Expand All @@ -676,6 +690,7 @@ subroutine cloud_mp_thompson(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldice, i_c
i_cldsnow, & ! cloud snow amount.
i_cldgrpl ! cloud groupel amount.
real(kind_phys), intent(in) :: &
con_ttp, & ! Triple point temperature of water (K)
con_g, & ! Physical constant: gravitational constant
con_rd, & ! Physical constant: gas-constant for dry air
con_eps, & ! Physical constant: gas constant air / gas constant H2O
Expand All @@ -686,7 +701,8 @@ subroutine cloud_mp_thompson(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldice, i_c
qs_lay, & ! Saturation vapor pressure (Pa)
q_lay, & ! water-vapor mixing ratio (kg/kg)
relhum, & ! Relative humidity
p_lay ! Pressure at model-layers (Pa)
p_lay, & ! Pressure at model-layers (Pa)
cnv_mixratio ! Convective cloud mixing-ratio (kg/kg)
real(kind_phys), dimension(:,:), intent(in) :: &
p_lev ! Pressure at model-level interfaces (Pa)
real(kind_phys), dimension(:,:,:),intent(in) :: &
Expand All @@ -706,16 +722,15 @@ subroutine cloud_mp_thompson(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldice, i_c
cld_rwp ! Cloud rain water path

! Local variables
real(kind_phys) :: tem1, pfac, cld_mr, deltaP
real(kind_phys) :: tem1, pfac, cld_mr, deltaP, tem2
real(kind_phys), dimension(nCol, nLev, min(4,ncnd)) :: cld_condensate
integer :: iCol,iLay,l

! Cloud condensate
cld_condensate(1:nCol,1:nLev,1) = tracer(1:nCol,1:nLev,i_cldliq) ! -liquid water
cld_condensate(1:nCol,1:nLev,2) = tracer(1:nCol,1:nLev,i_cldice) ! -ice water
cld_condensate(1:nCol,1:nLev,3) = tracer(1:nCol,1:nLev,i_cldrain) ! -rain water
cld_condensate(1:nCol,1:nLev,4) = tracer(1:nCol,1:nLev,i_cldsnow) + &! -snow + grapuel
tracer(1:nCol,1:nLev,i_cldgrpl)
cld_condensate(1:nCol,1:nLev,3) = tracer(1:nCol,1:nLev,i_cldrain) ! -rain hydrometeors
cld_condensate(1:nCol,1:nLev,4) = tracer(1:nCol,1:nLev,i_cldsnow) ! -snow hydrometeors
grantfirl marked this conversation as resolved.
Show resolved Hide resolved

cld_lwp(:,:) = 0.0
cld_iwp(:,:) = 0.0
Expand All @@ -725,6 +740,12 @@ subroutine cloud_mp_thompson(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldice, i_c
tem1 = 1.0e5/con_g
do iLay = 1, nLev-1
do iCol = 1, nCol
! Add convective cloud to gridmean cloud?
if (doGP_smearclds) then
tem2 = min(1.0, max(0.0, (con_ttp-t_lay(iCol,iLay))*0.05))
cld_condensate(iCol,iLay,1) = cld_condensate(iCol,iLay,1) + cnv_mixratio(iCol,iLay)*(1._kind_phys - tem2)
cld_condensate(iCol,iLay,2) = cld_condensate(iCol,iLay,2) + cnv_mixratio(iCol,iLay)*tem2
endif
! Compute liquid/ice condensate path from mixing ratios (kg/kg)->(g/m2)
deltaP = abs(p_lev(iCol,iLay+1)-p_lev(iCol,iLay))*0.01
cld_lwp(iCol,iLay) = max(0., cld_condensate(iCol,iLay,1) * tem1 * deltaP)
Expand All @@ -737,7 +758,7 @@ subroutine cloud_mp_thompson(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldice, i_c
cld_frac(iCol,iLay) = 1._kind_phys
else
cld_mr = cld_condensate(iCol,iLay,1) + cld_condensate(iCol,iLay,2) + &
cld_condensate(iCol,iLay,4)
cld_condensate(iCol,iLay,3) + cld_condensate(iCol,iLay,4)
cld_frac(iCol,iLay) = cld_frac_XuRandall(p_lay(iCol,iLay), &
qs_lay(iCol,iLay), relhum(iCol,iLay), cld_mr, alpha0)
endif
Expand Down
15 changes: 15 additions & 0 deletions physics/GFS_rrtmgp_cloud_mp.meta
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,13 @@
dimensions = ()
type = logical
intent = in
[doGP_smearclds]
standard_name = flag_for_implicit_sgs_cloud_in_RRTMGP
long_name = logical flag to impicit SGS cloud in RRTMGP
units = flag
dimensions = ()
type = logical
intent = in
[cld_frac]
standard_name = total_cloud_fraction
long_name = layer total cloud fraction
Expand Down Expand Up @@ -639,6 +646,14 @@
type = real
kind = kind_phys
intent = inout
[cldfra2d]
standard_name = max_in_column_cloud_fraction
long_name = instantaneous 2D (max-in-column) cloud fraction
units = frac
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
intent = out
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP
Expand Down
14 changes: 8 additions & 6 deletions physics/radiation_clouds.f
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,7 @@ subroutine progcld_thompson_wsm6 &
integer :: i, k, id, nf

! --- constant values
real (kind=kind_phys), parameter :: xrc3 = 200.
real (kind=kind_phys), parameter :: xrc3 = 100.

!
!===> ... begin here
Expand All @@ -2181,7 +2181,7 @@ subroutine progcld_thompson_wsm6 &
rei (i,k) = re_ice(i,k)
rer (i,k) = rrain_def ! default rain radius to 1000 micron
res (i,k) = re_snow(i,K)
! tem2d (i,k) = min( 1.0, max( 0.0, (con_ttp-tlyr(i,k))*0.05 ) )
tem2d (i,k) = min( 1.0, max( 0.0, (con_ttp-tlyr(i,k))*0.05 ) )
clwf(i,k) = 0.0
enddo
enddo
Expand Down Expand Up @@ -2212,12 +2212,14 @@ subroutine progcld_thompson_wsm6 &
enddo
enddo

!> - Compute cloud liquid/ice condensate path in \f$ g/m^2 \f$ .

!> - Compute total-cloud liquid/ice condensate path in \f$ g/m^2 \f$.
!> The total condensate includes convective condensate.
do k = 1, NLAY-1
do i = 1, IX
cwp(i,k) = max(0.0, clw(i,k,ntcw) * gfac * delp(i,k))
cip(i,k) = max(0.0, clw(i,k,ntiw) * gfac * delp(i,k))
cwp(i,k) = max(0.0, (clw(i,k,ntcw)+cnvw(i,k)*
ChunxiZhang-NOAA marked this conversation as resolved.
Show resolved Hide resolved
& (1.-tem2d(i,k))) * gfac * delp(i,k))
cip(i,k) = max(0.0, (clw(i,k,ntiw) + cnvw(i,k)*
& tem2d(i,k)) *gfac * delp(i,k))
crp(i,k) = max(0.0, clw(i,k,ntrw) * gfac * delp(i,k))
csp(i,k) = max(0.0, clw(i,k,ntsw) * gfac * delp(i,k))
enddo
Expand Down