From fe158341bad52da0146a0a54ff15cc0f56532072 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Sun, 27 Jun 2021 14:12:58 +0200 Subject: [PATCH] Don't show message for every iteration --- src/spicelib/devices/devsup.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/spicelib/devices/devsup.c b/src/spicelib/devices/devsup.c index cdba6629c..762199cae 100644 --- a/src/spicelib/devices/devsup.c +++ b/src/spicelib/devices/devsup.c @@ -160,13 +160,16 @@ DEVlimitlog( double LIM_TOL, int *check) { + static bool shown = FALSE; *check = 0; - if (isnan (deltemp) || isnan (deltemp_old)) + if (!shown && (isnan (deltemp) || isnan (deltemp_old))) { - fprintf(stderr, "\nThe temperature limiting function received NaN.\n"); + fprintf(stderr, "\n\nThe temperature limiting function received NaN.\n"); fprintf(stderr, "Please check your power dissipation and improve your heat sink Rth!\n"); + fprintf(stderr, " This message will be shown only once.\n\n"); deltemp = 0.0; *check = 1; + shown = TRUE; } /* Logarithmic damping of deltemp beyond LIM_TOL */ if (deltemp > deltemp_old + LIM_TOL) {