diff --git a/src/modradrrtmg.f90 b/src/modradrrtmg.f90 index 326ee5fd..abb2e649 100644 --- a/src/modradrrtmg.f90 +++ b/src/modradrrtmg.f90 @@ -195,7 +195,7 @@ subroutine radrrtmg lwu(2:i1,j,1:k1) = lwUp_slice (1:imax,1:k1) lwd(2:i1,j,1:k1) = -lwDown_slice(1:imax,1:k1) - if (.not. rad_longw) then !we get LW at surface identically to how it is done in sunray subroutine + if (.not. rad_longw) then !we get LW at surface identically to how it is done in sunray subroutine do i=2,i1 lwd(i,j,1) = -0.8 * boltz * thl0(i,j,1) ** 4. lwu(i,j,1) = 1.0 * boltz * tskin(i,j) ** 4. @@ -208,7 +208,7 @@ subroutine radrrtmg swdir(2:i1,j,1:k1) = -swDownDir_slice(1:imax,1:k1) swdif(2:i1,j,1:k1) = -swDownDif_slice(1:imax,1:k1) lwc (2:i1,j,1:k1) = LWP_slice (1:imax,1:k1) - + lwuca(2:i1,j,1:k1) = lwUpCS_slice (1:imax,1:k1) lwdca(2:i1,j,1:k1) = -lwDownCS_slice(1:imax,1:k1) swuca(2:i1,j,1:k1) = swUpCS_slice (1:imax,1:k1) @@ -594,7 +594,7 @@ subroutine setupSlicesFromProfiles(j,npatch_start, & ! JvdDussen, 24-6-2010 ! ! ============================================================================! - use modglobal, only: imax,jmax,kmax,i1,k1,grav,kind_rb,rlv,cp,Rd,pref0 + use modglobal, only: imax,jmax,kmax,i1,k1,grav,kind_rb,rlv,cp,Rd,pref0,tup,tdn use modfields, only: thl0,ql0,qt0,exnf use modsurfdata, only: tskin,ps use modmicrodata, only : Nc_0,sig_g @@ -651,9 +651,12 @@ subroutine setupSlicesFromProfiles(j,npatch_start, & tg_slice (im) = tskin(i,j) * exners ! Note: tskin = thlskin... do k=1,kmax - qv_slice (im,k) = max(qt0(i,j,k) - ql0(i,j,k),1e-18) !avoid RRTMG reading negative initial values - qcl_slice (im,k) = ql0(i,j,k) - qci_slice (im,k) = 0. + qv_slice (im,k) = max(qt0(i,j,k) - ql0(i,j,k),1e-18) !avoid RRTMG reading negative initial values + + ilratio = max(0.,min(1.,(tabs_slice(im,k)-tdn)/(tup-tdn)))! cloud water vs cloud ice partitioning + qcl_slice (im,k) = ql0(i,j,k) * ilratio + qci_slice (im,k) = ql0(i,j,k) * (1-ilratio) + o3_slice (im,k) = o3snd(npatch_start) ! o3 constant below domain top (if usero3!) h2ovmr (im,k) = mwdry/mwh2o * qv_slice(im, k)