From f5bd31452559f6a484d2e2d13fd8f1137ae1aa9f Mon Sep 17 00:00:00 2001 From: dgilford Date: Tue, 7 Oct 2025 15:50:29 +0000 Subject: [PATCH 1/2] change non-convergence flag==>2 --- src/tcpyPI/pi.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/tcpyPI/pi.py b/src/tcpyPI/pi.py index 0161bc2..44547ac 100644 --- a/src/tcpyPI/pi.py +++ b/src/tcpyPI/pi.py @@ -31,6 +31,7 @@ Revised 10/15/2020 by D. Gilford to add missing SST-->IFL=0 condition/check Revised 2/1/2021 by D. Gilford to validate units of input SSTs/T profile (should be Celsius) Modernized 2/20/2025 by B. Mares and D. Gilford + Revised 10/7/2025 by D. Gilford updating non-convergence flag==>2 """ # doctest: +ELLIPSIS @@ -657,16 +658,18 @@ def pi(SSTC,MSL,P,TC,R,CKCD=0.9,ascent_flag=0,diss_flag=1,V_reduc=0.8,ptop=50,mi PMOLD=PM # store the current step's pressure PM=PNEW + print(float(PM)) + # increase iteration count in the loop NP += 1 - + print(NP) # - # *** If the routine does not converge, set IFL=0 and return missing PI *** + # *** If the routine does not converge, set IFL=2 and return missing PI *** # if (NP > 200) or (PM < 400): VMAX=np.nan PMIN=np.nan - IFL=0 + IFL=2 TO=np.nan OTL=np.nan return(VMAX,PMIN,IFL,TO,OTL) From b142d451a871c092e2d59e1af39e69536903027e Mon Sep 17 00:00:00 2001 From: dgilford Date: Tue, 7 Oct 2025 16:17:02 +0000 Subject: [PATCH 2/2] fixed print error --- src/tcpyPI/pi.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/tcpyPI/pi.py b/src/tcpyPI/pi.py index 44547ac..48db444 100644 --- a/src/tcpyPI/pi.py +++ b/src/tcpyPI/pi.py @@ -658,11 +658,9 @@ def pi(SSTC,MSL,P,TC,R,CKCD=0.9,ascent_flag=0,diss_flag=1,V_reduc=0.8,ptop=50,mi PMOLD=PM # store the current step's pressure PM=PNEW - print(float(PM)) # increase iteration count in the loop NP += 1 - print(NP) # # *** If the routine does not converge, set IFL=2 and return missing PI *** #