Skip to content

Commit 1593b91

Browse files
committed
More descriptive names for absorption coefficient files. More sparing division in one gas optics kernel. Optimzation rather than debugging by default for Intel compiler.
1 parent 00a2019 commit 1593b91

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

build/Makefile.conf.ifort

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ export F77FLAGS = -m64 -O3 -traceback -qo
1313
#
1414
# Debugging
1515
#
16-
export FCFLAGS = -m64 -g -traceback -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f03
17-
export F77FLAGS = -m64 -g -traceback -check bounds,uninit,pointers,stack
16+
# export FCFLAGS = -m64 -g -traceback -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f03
17+
# export F77FLAGS = -m64 -g -traceback -check bounds,uninit,pointers,stack

examples/rfmip-clear-sky/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,4 @@ mo_rfmip_io.o: mo_rfmip_io.F90 mo_simple_netcdf.o
6868
mo_load_coefficients.o: mo_load_coefficients.F90 mo_simple_netcdf.o
6969

7070
clean:
71-
-rm rrtmgp_rfmip_lw *.o *.mod *.optrpt ../*.optrpt
71+
-rm rrtmgp_rfmip_sw rrtmgp_rfmip_lw *.o *.mod *.optrpt ../*.optrpt

rrtmgp/kernels/mo_gas_optics_kernels.F90

+5-4
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ subroutine gas_optical_depths_minor(ncol, nlay,ngpt,ngas,nflav, &
250250
! -----------------
251251
! local variables
252252
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;
254254
real(wp) :: scaling, kminor_loc, tau_minor ! minor species absorption coefficient, optical depth
255255
integer :: icol, ilay, iflav, igpt, imnr
256256
integer :: itl, itu, iml, imu
@@ -269,7 +269,6 @@ subroutine gas_optical_depths_minor(ncol, nlay,ngpt,ngas,nflav, &
269269
!
270270
if(layer_limits(icol,1) > 0) then
271271
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)
273272
!
274273
! Scaling of minor gas absortion coefficient begins with column amount of minor gas
275274
!
@@ -283,11 +282,13 @@ subroutine gas_optical_depths_minor(ncol, nlay,ngpt,ngas,nflav, &
283282
!
284283
scaling = scaling * (PaTohPa*play(icol,ilay)/tlay(icol,ilay))
285284
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)
286287
! scale by density of special gas
287288
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)
289290
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
291292
endif
292293
endif
293294
endif

0 commit comments

Comments
 (0)