Skip to content
11 changes: 10 additions & 1 deletion physics/GFS_rrtmg_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -854,6 +854,15 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, &
enddo
endif

if(imp_physics == imp_physics_thompson) then
do k=1,lm
k1 = k + kd
do i=1,im
cnvw (i,k1) = cnvw_in(i,k)
enddo
enddo
endif

!mz HWRF physics: icloud=3
if(icloud == 3) then

Expand Down Expand Up @@ -1036,7 +1045,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, &
ntrac-1, ntcw-1,ntiw-1,ntrw-1, &
ntsw-1,ntgl-1, &
im, lmk, lmp, uni_cld, lmfshal, lmfdeep2, &
cldcov(:,1:LMK), effrl_inout(:,:), &
cldcov(:,1:LMK), cnvw, effrl_inout(:,:), &
effri_inout(:,:), effrs_inout(:,:), &
dzb, xlat_d, julian, yearlen, &
clouds, cldsa, mtopa ,mbota, de_lgth, alpha) ! --- outputs
Expand Down
47 changes: 28 additions & 19 deletions physics/radiation_clouds.f
Original file line number Diff line number Diff line change
Expand Up @@ -2861,7 +2861,7 @@ subroutine progcld6 &
& xlat,xlon,slmsk,dz,delp, &
& ntrac,ntcw,ntiw,ntrw,ntsw,ntgl, &
& IX, NLAY, NLP1, &
& uni_cld, lmfshal, lmfdeep2, cldcov, &
& uni_cld, lmfshal, lmfdeep2, cldcov, cnvw, &
& re_cloud,re_ice,re_snow, &
& dzlay, latdeg, julian, yearlen, &
& clouds,clds,mtop,mbot,de_lgth,alpha & ! --- outputs:
Expand Down Expand Up @@ -2955,7 +2955,7 @@ subroutine progcld6 &

real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, &
& tlyr, qlyr, qstl, rhly, cldcov, delp, dz, dzlay, &
& re_cloud, re_ice, re_snow
& re_cloud, re_ice, re_snow, cnvw

real (kind=kind_phys), dimension(:,:,:), intent(in) :: clw

Expand Down Expand Up @@ -2987,8 +2987,8 @@ subroutine progcld6 &
integer :: i, k, id, nf

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure why we need to keep the old value of xrc3 in a comment. From doing git differences of versions, this can be detected pretty easily. Furthermore, this constant is used (I think) in only a single line of code, so is it really needed as a declared variable at all?


!
!===> ... begin here
Expand Down Expand Up @@ -3042,6 +3042,7 @@ subroutine progcld6 &
do k = 1, NLAY
do i = 1, IX
clwf(i,k) = clw(i,k,ntcw) + clw(i,k,ntiw) + clw(i,k,ntsw)
& +clw(i,k,ntrw) + cnvw(i,k)
enddo
enddo
!> - Find top pressure for each cloud domain for given latitude.
Expand All @@ -3068,8 +3069,9 @@ subroutine progcld6 &
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))
crp(i,k) = max(0.0, clw(i,k,ntrw) * gfac * delp(i,k))
csp(i,k) = max(0.0, (clw(i,k,ntsw)+clw(i,k,ntgl)) * &
& gfac * delp(i,k))
! csp(i,k) = max(0.0, (clw(i,k,ntsw)+clw(i,k,ntgl)) * &

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graupel was removed, thank you. But I still wonder why we need the old line of code commented out rather than eliminated.

! & gfac * delp(i,k))
csp(i,k) = max(0.0, clw(i,k,ntsw) * gfac * delp(i,k))
enddo
enddo

Expand Down Expand Up @@ -3111,24 +3113,31 @@ subroutine progcld6 &
else
do k = 1, NLAY
do i = 1, IX
clwt = 1.0e-6 * (plyr(i,k)*0.001)
! clwt = 1.0e-6 * (plyr(i,k)*0.001)
! clwt = 2.0e-6 * (plyr(i,k)*0.001)
clwt = 1.0e-10 * (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
if(rhly(i,k) > 1.) then
cldtot(i,k) = 1.
else
tem1 = 100.0 / tem1
endif
onemrh= max( 1.e-10, 1.0-rhly(i,k) )
clwm = clwmin / max( 0.01, plyr(i,k)*0.001 )
!
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 )
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
else
cldtot(i,k) = 0.0
endif
enddo
enddo
Expand Down