Skip to content

Commit

Permalink
Bug fix for aerosol optics Mie extrapolation WRFchem (#1592)
Browse files Browse the repository at this point in the history
TYPE: bug fix

KEYWORDS: aerosol optics, Mie calculation, interpolation, extrapolation

SOURCE: Cenlin He and Rajesh Kumar (NCAR)

DESCRIPTION OF CHANGES:
Problem:
When the aerosol refractive indices are outside the lookup table ranges (which are very rare occasions), the 
extrapolation in the parameterized Mie calculation ('mieaer' subroutine) will create unrealistic values for the 
extrapolated aerosol optical parameters. These unphysical fluctuations cause unrealistically high AOD 
values (10^10 and greater) and the model crashes.

Solution:
Force the out-of-range aerosol refractive index to be the min or max boundary values of the lookup table.

LIST OF MODIFIED FILES:
chem/module_optical_averaging.F

TESTS CONDUCTED: 
1. This solution fixes the issue and has been tested in NCAR Cheyenne HPC by Cenlin He (NCAR).
2. Jenkins testing is all PASS.

RELEASE NOTE: Minor bugfix for aerosol optics Mie extrapolation cases in chemistry. When the aerosol refractive indices are outside the lookup table ranges, the extrapolation in the parameterized Mie calculation will create unrealistic values for the extrapolated aerosol optical parameters. These unphysical fluctuations cause unrealistically high AOD values and the model crashes. The solution is to force the out-of-range aerosol refractive index to be the minimum or maximum boundary values of the lookup table.
  • Loading branch information
cenlinhe authored Dec 15, 2021
1 parent e1c4e3f commit 23c5db5
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions chem/module_optical_averaging.F
Original file line number Diff line number Diff line change
Expand Up @@ -4695,6 +4695,24 @@ subroutine mieaer( &
endif
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

! check for refr and refi outside of lookup table range to prevent unstable extrapolation 'binterp' below
if (refr < refrtabsw(1,ns)) then
refr = refrtabsw(1,ns)
write(*,*), 'Warning: refr is smaller than lookup table range and reset to minimum bound at SW band ', ns
endif
if (refr > refrtabsw(prefr,ns)) then
refr = refrtabsw(prefr,ns)
write(*,*), 'Warning: refr is larger than lookup table range and reset to maximum bound at SW band ', ns
endif
if (refi < refitabsw(1,ns)) then
refi = refitabsw(1,ns)
write(*,*), 'Warning: refi is smaller than lookup table range and reset to minimum bound at SW band ', ns
endif
if (refi > refitabsw(prefi,ns)) then
refi = refitabsw(prefi,ns)
write(*,*), 'Warning: refi is larger than lookup table range and reset to maximum bound at SW band ', ns
endif

! interpolate coefficients linear in refractive index
! first call calcs itab,jtab,ttab,utab
itab=0
Expand Down Expand Up @@ -4952,6 +4970,24 @@ subroutine mieaer( &
endif
!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
! check for refr and refi outside of lookup table range to prevent unstable extrapolation 'binterp' below
if (refr < refrtablw(1,ns)) then
refr = refrtablw(1,ns)
write(*,*), 'Warning: refr is smaller than lookup table range and reset to minimum bound at LW band ', ns
endif
if (refr > refrtablw(prefr,ns)) then
refr = refrtablw(prefr,ns)
write(*,*), 'Warning: refr is larger than lookup table range and reset to maximum bound at LW band ', ns
endif
if (refi < refitablw(1,ns)) then
refi = refitablw(1,ns)
write(*,*), 'Warning: refi is smaller than lookup table range and reset to minimum bound at LW band ', ns
endif
if (refi > refitablw(prefi,ns)) then
refi = refitablw(prefi,ns)
write(*,*), 'Warning: refi is larger than lookup table range and reset to maximum bound at LW band ', ns
endif
! interpolate coefficients linear in refractive index
! first call calcs itab,jtab,ttab,utab
itab=0
Expand Down

0 comments on commit 23c5db5

Please sign in to comment.