Skip to content

Commit 1e05fe5

Browse files
add check in case compiler doesn't support inexact halting
1 parent 57a57af commit 1e05fe5

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

components/elm/src/biogeophys/SoilStateType.F90

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,10 @@ subroutine InitCold(this, bounds)
469469
! Try to read soil information from the file.
470470
call ncd_io(ncid=ncid, varname='ZSOI', flag='read', data=zsoifl, dim1name=grlnd, readvar=readvar)
471471
if (.not. readvar ) then
472-
call ieee_set_flag(ieee_all,.false.)
473-
call ieee_set_halting_mode(ieee_inexact, .false.)
472+
if (ieee_support_halting(ieee_inexact)) then
473+
call ieee_set_flag(ieee_all,.false.)
474+
call ieee_set_halting_mode(ieee_inexact, .false.)
475+
end if
474476
do j = 1, nlevsoifl
475477
zsoifl(j) = scalez*(exp(zecoeff*(dble(j)-0.5_r8))-1._r8) !node depths
476478
enddo

components/elm/src/main/initVerticalMod.F90

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,10 @@ subroutine initVertical(bounds, snow_depth, thick_wall, thick_roof)
171171
! Soil layers not available from the input, and no additional layers needed. Use the
172172
! default soil thickness settings.
173173
! -----------------------------------------------------------------
174-
call ieee_set_flag(ieee_all,.false.)
175-
call ieee_set_halting_mode(ieee_inexact, .false.)
174+
if (ieee_support_halting(ieee_inexact)) then
175+
call ieee_set_flag(ieee_all,.false.)
176+
call ieee_set_halting_mode(ieee_inexact, .false.)
177+
end if
176178

177179
do j = 1, nlevgrnd
178180
zsoi(j) = scalez*(exp(zecoeff*(dble(j)-0.5_r8))-1._r8) !node depths

0 commit comments

Comments
 (0)