Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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