@@ -198,11 +198,19 @@ subroutine rrtmgp_set_aer_sw( &
198198 ! set aerosol optical depth, clip to zero
199199 aer_sw% optical_props% tau(i,ktoprad:,:) = max (aer_tau(idxday(i),ktopcam:,:), 0._r8 )
200200 ! set value of single scattering albedo
201- aer_sw% optical_props% ssa(i,ktoprad:,:) = merge (aer_tau_w(idxday(i),ktopcam:,:)/ aer_tau(idxday(i),ktopcam:,:), &
202- 1._r8 , aer_tau(idxday(i),ktopcam:,:) > 0._r8 )
201+ where (aer_tau(idxday(i),ktopcam:,:) > 0._r8 )
202+ aer_sw% optical_props% ssa(i,ktoprad:,:) = aer_tau_w(idxday(i),ktopcam:,:) &
203+ / aer_tau(idxday(i),ktopcam:,:)
204+ elsewhere
205+ aer_sw% optical_props% ssa(i,ktoprad:,:) = 1._r8
206+ end where
203207 ! set value of asymmetry
204- aer_sw% optical_props% g(i,ktoprad:,:) = merge (aer_tau_w_g(idxday(i),ktopcam:,:)/ aer_tau_w(idxday(i),ktopcam:,:), &
205- 0._r8 , aer_tau_w(idxday(i),ktopcam:,:) > tiny)
208+ where (aer_tau_w(idxday(i),ktopcam:,:) > tiny)
209+ aer_sw% optical_props% g(i,ktoprad:,:) = aer_tau_w_g(idxday(i),ktopcam:,:) &
210+ / aer_tau_w(idxday(i),ktopcam:,:)
211+ elsewhere
212+ aer_sw% optical_props% g(i,ktoprad:,:) = 0._r8
213+ end where
206214 end do
207215
208216 ! impose limits on the components
0 commit comments