diff --git a/components/elm/src/biogeophys/SoilStateType.F90 b/components/elm/src/biogeophys/SoilStateType.F90 index 79ab33fcb8ea..aed21ffc739c 100644 --- a/components/elm/src/biogeophys/SoilStateType.F90 +++ b/components/elm/src/biogeophys/SoilStateType.F90 @@ -331,6 +331,7 @@ subroutine InitCold(this, bounds) use SharedParamsMod , only : ParamsShareInst use FuncPedotransferMod , only : pedotransf, get_ipedof use RootBiophysMod , only : init_vegrootfr + use, intrinsic :: ieee_exceptions ! ! !ARGUMENTS: class(soilstate_type) :: this @@ -468,10 +469,13 @@ subroutine InitCold(this, bounds) ! Try to read soil information from the file. call ncd_io(ncid=ncid, varname='ZSOI', flag='read', data=zsoifl, dim1name=grlnd, readvar=readvar) if (.not. readvar ) then - ! Variable ZSOI not found, use the ELM parameters. + if (ieee_support_halting(ieee_inexact)) then + call ieee_set_flag(ieee_all,.false.) + call ieee_set_halting_mode(ieee_inexact, .false.) + end if do j = 1, nlevsoifl - zsoifl(j) = scalez*(exp(zecoeff*(j-0.5_r8))-1._r8) !node depths - end do + zsoifl(j) = scalez*(exp(zecoeff*(dble(j)-0.5_r8))-1._r8) !node depths + enddo end if dzsoifl(1) = 0.5_r8*(zsoifl(1)+zsoifl(2)) !thickness b/n two interfaces diff --git a/components/elm/src/main/initVerticalMod.F90 b/components/elm/src/main/initVerticalMod.F90 index 27a089cc26d6..642579331a98 100755 --- a/components/elm/src/main/initVerticalMod.F90 +++ b/components/elm/src/main/initVerticalMod.F90 @@ -44,6 +44,7 @@ module initVerticalMod !------------------------------------------------------------------------ subroutine initVertical(bounds, snow_depth, thick_wall, thick_roof) + use, intrinsic :: ieee_exceptions ! ! !ARGUMENTS: type(bounds_type) , intent(in) :: bounds @@ -170,8 +171,13 @@ subroutine initVertical(bounds, snow_depth, thick_wall, thick_roof) ! Soil layers not available from the input, and no additional layers needed. Use the ! default soil thickness settings. ! ----------------------------------------------------------------- + if (ieee_support_halting(ieee_inexact)) then + call ieee_set_flag(ieee_all,.false.) + call ieee_set_halting_mode(ieee_inexact, .false.) + end if + do j = 1, nlevgrnd - zsoi(j) = scalez*(exp(zecoeff*(j-0.5_r8))-1._r8) !node depths + zsoi(j) = scalez*(exp(zecoeff*(dble(j)-0.5_r8))-1._r8) !node depths enddo end if deallocate(zsoi_in)