Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Mar 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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