Skip to content

Commit

Permalink
Fix problem with "spval" exceeding integer range
Browse files Browse the repository at this point in the history
  • Loading branch information
TomasTorsvik committed Sep 28, 2022
1 parent f3444ba commit eb9b960
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hamocc/mo_intfcblom.F90
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,13 @@ subroutine blom2hamocc(m,n,mm,nn)
use mod_state, only: dp,temp,saln
use mod_eos, only: rho,p_alpha
use mod_vcoord, only: vcoord_type_tag, cntiso_hybrid
use mod_constants, only: spval
use mod_difest, only: hOBL
use mod_tracers, only: ntrbgc,itrbgc,trc
use mo_param1_bgc, only: ks,nsedtra,npowtra,natm
use mo_carbch, only: ocetra,atm
use mo_sedmnt, only: sedlay,powtra,sedhpl,burial
use mo_vgrid, only: kmle
use mo_vgrid, only: kmle, kmle_static

implicit none

Expand Down Expand Up @@ -299,7 +300,12 @@ subroutine blom2hamocc(m,n,mm,nn)
! --- - index of level above OBL depth
! --- Defined according to cvmix_kpp_compute_kOBL_depth
if (vcoord_type_tag == cntiso_hybrid) then
kmle(i,j) = nint(hOBL(i,j))-1
! nint(spval) returns arithmetic operation error
if (hOBL(i,j) < spval) then
kmle(i,j) = nint(hOBL(i,j))-1
else
kmle(i,j) = kmle_static
end if
endif
enddo
enddo
Expand Down

0 comments on commit eb9b960

Please sign in to comment.