From b7abbf0408f0efe9adced557ef250ff4be461e8b Mon Sep 17 00:00:00 2001 From: Andrew Roberts Date: Wed, 2 Sep 2020 11:12:20 -0600 Subject: [PATCH 1/3] Added catch for unusual case of (hicen_init(n+1) - hicen_init(n))>0 --- columnphysics/icepack_therm_itd.F90 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/columnphysics/icepack_therm_itd.F90 b/columnphysics/icepack_therm_itd.F90 index ba2bc8134..63ea3b790 100644 --- a/columnphysics/icepack_therm_itd.F90 +++ b/columnphysics/icepack_therm_itd.F90 @@ -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 + + ! 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 From 3e13a8a1e3a02c6a487f8474121c4da4ba1f6483 Mon Sep 17 00:00:00 2001 From: Andrew Roberts Date: Sun, 14 Mar 2021 23:20:28 -0600 Subject: [PATCH 2/3] fix conditional --- columnphysics/icepack_therm_itd.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/columnphysics/icepack_therm_itd.F90 b/columnphysics/icepack_therm_itd.F90 index 63ea3b790..31a6319d9 100644 --- a/columnphysics/icepack_therm_itd.F90 +++ b/columnphysics/icepack_therm_itd.F90 @@ -306,7 +306,7 @@ subroutine linear_itd (ncat, hin_max, & if (hicen_init(n) > puny .and. & hicen_init(n+1) > puny) then - if (hicen_init(n+1) - hicen_init(n))>0 + if ((hicen_init(n+1) - hicen_init(n))>0) then ! interpolate between adjacent category growth rates slope = (dhicen(n+1) - dhicen(n)) / & From 244b34a5d512ff8d8f0fb2cebbbef33b5675bdc1 Mon Sep 17 00:00:00 2001 From: Andrew Roberts Date: Sun, 14 Mar 2021 22:46:00 -0700 Subject: [PATCH 3/3] fortran not malab! --- columnphysics/icepack_therm_itd.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/columnphysics/icepack_therm_itd.F90 b/columnphysics/icepack_therm_itd.F90 index 31a6319d9..c66e1bd5e 100644 --- a/columnphysics/icepack_therm_itd.F90 +++ b/columnphysics/icepack_therm_itd.F90 @@ -316,7 +316,7 @@ subroutine linear_itd (ncat, hin_max, & else - write(warnstr,*) subname,... + write(warnstr,*) subname, & 'ITD Thermodynamics: hicen_init(n+1) <= hicen_init(n)' call icepack_warnings_setabort(.true.) call icepack_warnings_add(warnstr)