@@ -250,7 +250,7 @@ subroutine gas_optical_depths_minor(ncol, nlay,ngpt,ngas,nflav, &
250
250
! -----------------
251
251
! local variables
252
252
real (wp), parameter :: PaTohPa = 0.01
253
- real (wp), dimension (ngas) :: vmr
253
+ real (wp) :: vmr_fact, dry_fact ! conversion from column abundance to dry vol. mixing ratio;
254
254
real (wp) :: scaling, kminor_loc, tau_minor ! minor species absorption coefficient, optical depth
255
255
integer :: icol, ilay, iflav, igpt, imnr
256
256
integer :: itl, itu, iml, imu
@@ -269,7 +269,6 @@ subroutine gas_optical_depths_minor(ncol, nlay,ngpt,ngas,nflav, &
269
269
!
270
270
if (layer_limits(icol,1 ) > 0 ) then
271
271
do ilay = layer_limits(icol,1 ), layer_limits(icol,2 )
272
- vmr(1 :ngas) = col_gas(icol,ilay,1 :ngas)/ col_gas(icol,ilay,0 )
273
272
!
274
273
! Scaling of minor gas absortion coefficient begins with column amount of minor gas
275
274
!
@@ -283,11 +282,13 @@ subroutine gas_optical_depths_minor(ncol, nlay,ngpt,ngas,nflav, &
283
282
!
284
283
scaling = scaling * (PaTohPa* play(icol,ilay)/ tlay(icol,ilay))
285
284
if (idx_minor_scaling(imnr) > 0 ) then ! there is a second gas that affects this gas's absorption
285
+ vmr_fact = 1._wp / col_gas(icol,ilay,0 )
286
+ dry_fact = 1._wp / (1._wp + col_gas(icol,ilay,idx_h2o) * vmr_fact)
286
287
! scale by density of special gas
287
288
if (scale_by_complement(imnr)) then ! scale by densities of all gases but the special one
288
- scaling = scaling * (1._wp - vmr( idx_minor_scaling(imnr)) / ( 1._wp + vmr(idx_h2o)) )
289
+ scaling = scaling * (1._wp - col_gas(icol,ilay, idx_minor_scaling(imnr)) * vmr_fact * dry_fact )
289
290
else
290
- scaling = scaling * vmr( idx_minor_scaling(imnr)) / ( 1._wp + vmr(idx_h2o))
291
+ scaling = scaling * col_gas(icol,ilay, idx_minor_scaling(imnr)) * vmr_fact * dry_fact
291
292
endif
292
293
endif
293
294
endif
0 commit comments