From a564c8b379708caa55a7484038574fc5b1245838 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 2 Jan 2020 12:02:56 -0700 Subject: [PATCH] Moved aggregation into conditional loop. LW only. --- physics/rrtmg_lw_cloud_optics.F90 | 23 ++++++++++------------- physics/rrtmgp_lw_cloud_optics.F90 | 7 +++---- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/physics/rrtmg_lw_cloud_optics.F90 b/physics/rrtmg_lw_cloud_optics.F90 index 31551d797..0447caea5 100644 --- a/physics/rrtmg_lw_cloud_optics.F90 +++ b/physics/rrtmg_lw_cloud_optics.F90 @@ -646,19 +646,16 @@ subroutine rrtmg_lw_cloud_optics(ncol, nlay, nBandsLW, cld_lwp, cld_ref_liq, cld fint*(absice3(index+1,ib) - absice3(index,ib)) )) enddo endif - endif - else - tau_rain = 0. - tau_snow = 0. - tau_liq(:) = 0. - tau_ice(:) = 0. - endif - ! Cloud optical depth - do ib = 1, nBandsLW - tau_cld(ij,ik,ib) = tau_ice(ib) + tau_liq(ib) + tau_rain + tau_snow - enddo - end do - end do + endif + + ! Cloud optical depth + do ib = 1, nBandsLW + tau_cld(ij,ik,ib) = tau_ice(ib) + tau_liq(ib) + tau_rain + tau_snow + enddo + + endif ! Cloud layer? + end do ! Layer + end do ! Column endif end subroutine rrtmg_lw_cloud_optics ! ####################################################################################### diff --git a/physics/rrtmgp_lw_cloud_optics.F90 b/physics/rrtmgp_lw_cloud_optics.F90 index aacecd6df..1ba051768 100644 --- a/physics/rrtmgp_lw_cloud_optics.F90 +++ b/physics/rrtmgp_lw_cloud_optics.F90 @@ -395,8 +395,7 @@ subroutine rrtmgp_lw_cloud_optics_run(doLWrad, nCol, nLev, cld_optics_scheme, nr ! Local variables logical,dimension(ncol,nLev) :: liqmask, icemask - real(kind_phys), dimension(ncol,nLev,lw_gas_props%get_nband()) :: & - tau_cld + integer :: k ! Initialize CCPP error handling variables errmsg = '' @@ -412,6 +411,7 @@ subroutine rrtmgp_lw_cloud_optics_run(doLWrad, nCol, nLev, cld_optics_scheme, nr ! Cloud optics [nCol,nLev,nBands] call check_error_msg('rrtmgp_lw_cloud_optics_run',lw_optical_props_cloudsByBand%alloc_1scl(& ncol, nLev, lw_gas_props%get_band_lims_wavenumber())) + lw_optical_props_cloudsByBand%tau(:,:,:) = 0._kind_phys ! Compute cloud-optics for RTE. if (rrtmgp_cld_optics .gt. 0) then @@ -434,8 +434,7 @@ subroutine rrtmgp_lw_cloud_optics_run(doLWrad, nCol, nLev, cld_optics_scheme, nr if (any(cld_frac .gt. 0)) then call rrtmg_lw_cloud_optics(ncol, nLev, lw_gas_props%get_nband(), cld_lwp, & cld_reliq, cld_iwp, cld_reice, cld_rwp, cld_rerain, cld_swp, cld_resnow, & - cld_frac, tau_cld) - lw_optical_props_cloudsByBand%tau = tau_cld + cld_frac, lw_optical_props_cloudsByBand%tau) endif endif