From c8b8ffb858cd31657c1c2a8eb826415440ba32fa Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 28 Sep 2022 15:48:10 -0600 Subject: [PATCH 1/4] Add in RRTMGP changes. --- physics/GFS_rrtmgp_cloud_mp.F90 | 37 +++++++++++++++++++++----------- physics/GFS_rrtmgp_cloud_mp.meta | 7 ++++++ physics/radiation_clouds.f | 10 +++++---- 3 files changed, 37 insertions(+), 17 deletions(-) diff --git a/physics/GFS_rrtmgp_cloud_mp.F90 b/physics/GFS_rrtmgp_cloud_mp.F90 index ca9457b4c..bc8c2172f 100644 --- a/physics/GFS_rrtmgp_cloud_mp.F90 +++ b/physics/GFS_rrtmgp_cloud_mp.F90 @@ -50,7 +50,8 @@ 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, & @@ -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 @@ -266,8 +268,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 @@ -658,13 +661,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 @@ -676,6 +680,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 @@ -686,7 +691,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) :: & @@ -706,16 +712,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 cld_lwp(:,:) = 0.0 cld_iwp(:,:) = 0.0 @@ -725,6 +730,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) @@ -737,7 +748,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 diff --git a/physics/GFS_rrtmgp_cloud_mp.meta b/physics/GFS_rrtmgp_cloud_mp.meta index 88530d84c..c142fe9f4 100644 --- a/physics/GFS_rrtmgp_cloud_mp.meta +++ b/physics/GFS_rrtmgp_cloud_mp.meta @@ -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 diff --git a/physics/radiation_clouds.f b/physics/radiation_clouds.f index edfa94439..e588a7c39 100644 --- a/physics/radiation_clouds.f +++ b/physics/radiation_clouds.f @@ -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 @@ -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 @@ -2216,8 +2216,10 @@ subroutine progcld_thompson_wsm6 & 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)* + & (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 From dea43c27075e1f8b571b2196cfaed49f210554d9 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Thu, 29 Sep 2022 13:26:27 -0600 Subject: [PATCH 2/4] Add scientific documentation. --- physics/radiation_clouds.f | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/radiation_clouds.f b/physics/radiation_clouds.f index e588a7c39..e071b48b1 100644 --- a/physics/radiation_clouds.f +++ b/physics/radiation_clouds.f @@ -2212,8 +2212,8 @@ 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)+cnvw(i,k)* From c635c0503e3909eb9e0ccfd08f4e7a275ec8679d Mon Sep 17 00:00:00 2001 From: dustinswales Date: Fri, 7 Oct 2022 11:18:18 -0600 Subject: [PATCH 3/4] NCAR/ccpp-physics issue 957. --- physics/GFS_rrtmgp_cloud_mp.F90 | 12 +++++++++++- physics/GFS_rrtmgp_cloud_mp.meta | 8 ++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/physics/GFS_rrtmgp_cloud_mp.F90 b/physics/GFS_rrtmgp_cloud_mp.F90 index bc8c2172f..0d39432f9 100644 --- a/physics/GFS_rrtmgp_cloud_mp.F90 +++ b/physics/GFS_rrtmgp_cloud_mp.F90 @@ -55,7 +55,7 @@ subroutine GFS_rrtmgp_cloud_mp_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldic 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 @@ -136,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 @@ -295,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 + 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 diff --git a/physics/GFS_rrtmgp_cloud_mp.meta b/physics/GFS_rrtmgp_cloud_mp.meta index c142fe9f4..12407204a 100644 --- a/physics/GFS_rrtmgp_cloud_mp.meta +++ b/physics/GFS_rrtmgp_cloud_mp.meta @@ -646,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 From 5d42ea93a362be0dd886c0bb5713257b74040596 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Tue, 1 Nov 2022 13:37:10 -0600 Subject: [PATCH 4/4] Adjust conversion factor in radiation_clouds.f --- physics/radiation_clouds.f | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/radiation_clouds.f b/physics/radiation_clouds.f index e071b48b1..d092a0198 100644 --- a/physics/radiation_clouds.f +++ b/physics/radiation_clouds.f @@ -3906,7 +3906,7 @@ subroutine cloud_fraction_mass_flx_2 & clwmin = 0.0 do k = 1, NLAY-1 do i = 1, IX - clwt = 1.0e-10 * (plyr(i,k)*0.001) + clwt = 1.0e-6 * (plyr(i,k)*0.001) if (clwf(i,k) > clwt) then if(rhly(i,k) > 0.99) then