Skip to content

Commit

Permalink
More descriptive names for absorption coefficient files. More sparing…
Browse files Browse the repository at this point in the history
… division in one gas optics kernel. Optimzation rather than debugging by default for Intel compiler.
  • Loading branch information
RobertPincus committed Jan 16, 2019
1 parent 00a2019 commit 1593b91
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions build/Makefile.conf.ifort
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export F77FLAGS = -m64 -O3 -traceback -qo
#
# Debugging
#
export FCFLAGS = -m64 -g -traceback -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f03
export F77FLAGS = -m64 -g -traceback -check bounds,uninit,pointers,stack
# export FCFLAGS = -m64 -g -traceback -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f03
# export F77FLAGS = -m64 -g -traceback -check bounds,uninit,pointers,stack
2 changes: 1 addition & 1 deletion examples/rfmip-clear-sky/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,4 @@ mo_rfmip_io.o: mo_rfmip_io.F90 mo_simple_netcdf.o
mo_load_coefficients.o: mo_load_coefficients.F90 mo_simple_netcdf.o

clean:
-rm rrtmgp_rfmip_lw *.o *.mod *.optrpt ../*.optrpt
-rm rrtmgp_rfmip_sw rrtmgp_rfmip_lw *.o *.mod *.optrpt ../*.optrpt
File renamed without changes.
File renamed without changes.
9 changes: 5 additions & 4 deletions rrtmgp/kernels/mo_gas_optics_kernels.F90
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ subroutine gas_optical_depths_minor(ncol, nlay,ngpt,ngas,nflav, &
! -----------------
! local variables
real(wp), parameter :: PaTohPa = 0.01
real(wp), dimension(ngas) :: vmr
real(wp) :: vmr_fact, dry_fact ! conversion from column abundance to dry vol. mixing ratio;
real(wp) :: scaling, kminor_loc, tau_minor ! minor species absorption coefficient, optical depth
integer :: icol, ilay, iflav, igpt, imnr
integer :: itl, itu, iml, imu
Expand All @@ -269,7 +269,6 @@ subroutine gas_optical_depths_minor(ncol, nlay,ngpt,ngas,nflav, &
!
if(layer_limits(icol,1) > 0) then
do ilay = layer_limits(icol,1), layer_limits(icol,2)
vmr(1:ngas) = col_gas(icol,ilay,1:ngas)/col_gas(icol,ilay,0)
!
! Scaling of minor gas absortion coefficient begins with column amount of minor gas
!
Expand All @@ -283,11 +282,13 @@ subroutine gas_optical_depths_minor(ncol, nlay,ngpt,ngas,nflav, &
!
scaling = scaling * (PaTohPa*play(icol,ilay)/tlay(icol,ilay))
if(idx_minor_scaling(imnr) > 0) then ! there is a second gas that affects this gas's absorption
vmr_fact = 1._wp / col_gas(icol,ilay,0)
dry_fact = 1._wp / (1._wp + col_gas(icol,ilay,idx_h2o) * vmr_fact)
! scale by density of special gas
if (scale_by_complement(imnr)) then ! scale by densities of all gases but the special one
scaling = scaling * (1._wp - vmr(idx_minor_scaling(imnr)) / (1._wp+vmr(idx_h2o)) )
scaling = scaling * (1._wp - col_gas(icol,ilay,idx_minor_scaling(imnr)) * vmr_fact * dry_fact)
else
scaling = scaling * vmr(idx_minor_scaling(imnr)) / (1._wp+vmr(idx_h2o))
scaling = scaling * col_gas(icol,ilay,idx_minor_scaling(imnr)) * vmr_fact * dry_fact
endif
endif
endif
Expand Down

0 comments on commit 1593b91

Please sign in to comment.