Skip to content

Commit

Permalink
Added catch for unusual case of (hicen_init(n+1) - hicen_init(n))>0 (#…
Browse files Browse the repository at this point in the history
…337)

* Added catch for unusual case of (hicen_init(n+1) - hicen_init(n))>0

* fix conditional

Co-authored-by: Andrew Roberts <[email protected]>
  • Loading branch information
proteanplanet and Andrew Roberts authored Mar 17, 2021
1 parent ee7cf8e commit 7223366
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions columnphysics/icepack_therm_itd.F90
Original file line number Diff line number Diff line change
Expand Up @@ -305,11 +305,24 @@ subroutine linear_itd (ncat, hin_max, &

if (hicen_init(n) > puny .and. &
hicen_init(n+1) > puny) then
! interpolate between adjacent category growth rates
slope = (dhicen(n+1) - dhicen(n)) / &

if ((hicen_init(n+1) - hicen_init(n))>0) then

! interpolate between adjacent category growth rates
slope = (dhicen(n+1) - dhicen(n)) / &
(hicen_init(n+1) - hicen_init(n))
hbnew(n) = hin_max(n) + dhicen(n) &
hbnew(n) = hin_max(n) + dhicen(n) &
+ slope * (hin_max(n) - hicen_init(n))

else

write(warnstr,*) subname, &
'ITD Thermodynamics: hicen_init(n+1) <= hicen_init(n)'
call icepack_warnings_setabort(.true.)
call icepack_warnings_add(warnstr)

endif

elseif (hicen_init(n) > puny) then ! hicen_init(n+1)=0
hbnew(n) = hin_max(n) + dhicen(n)
elseif (hicen_init(n+1) > puny) then ! hicen_init(n)=0
Expand Down

0 comments on commit 7223366

Please sign in to comment.