Skip to content

Commit

Permalink
Moved aggregation into conditional loop. LW only.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinswales committed Jan 2, 2020
1 parent 2e161eb commit a564c8b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
23 changes: 10 additions & 13 deletions physics/rrtmg_lw_cloud_optics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
! #######################################################################################
Expand Down
7 changes: 3 additions & 4 deletions physics/rrtmgp_lw_cloud_optics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand All @@ -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
Expand All @@ -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

Expand Down

0 comments on commit a564c8b

Please sign in to comment.