Skip to content

Commit

Permalink
Avoid chl=0 in lookup_ohlmann_opacity()
Browse files Browse the repository at this point in the history
previous commit only avoiding log10(0) in lookup_ohlmann_swpen() but we have
another log10(chl) in the opacity function
  • Loading branch information
mnlevy1981 committed Oct 1, 2024
1 parent 5726d94 commit 8fb8aaf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/parameterizations/vertical/MOM_opacity.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1377,7 +1377,11 @@ function lookup_ohlmann_opacity(chl,optics) result(B)
integer :: n

! Make sure we are in the table
log10chl = max(optics%log10chl_min,min(log10(chl),optics%log10chl_max))
if (chl > optics%chl_min) then
log10chl = min(log10(chl),optics%log10chl_max)
else
log10chl = optics%log10chl_min
endif
! Do a nearest neighbor lookup
n = nint( (log10chl - optics%log10chl_min)/optics%dlog10chl ) + 1

Expand Down

0 comments on commit 8fb8aaf

Please sign in to comment.