Improve error messages.

This commit is contained in:
Holger Vogt 2025-10-15 17:37:14 +02:00
parent e4aacf352a
commit 7fe6ab5424
2 changed files with 8 additions and 5 deletions

View File

@ -1397,7 +1397,7 @@ int main(int argc, char **argv)
tpf = smktemp("sp");
tempfile = fopen(tpf, "w+bTD");
if (tempfile == NULL) {
fprintf(stderr, "Could not open a temporary file "
fprintf(stderr, "Error: Could not open a temporary file "
"to save and use optional arguments.\n");
sp_shutdown(EXIT_BAD);
}

View File

@ -131,6 +131,7 @@ DCtran(CKTcircuit *ckt,
int redostep;
#endif
if(restart || ckt->CKTtime == 0) {
/* set the first step time */
delta=MIN(ckt->CKTfinalTime/100,ckt->CKTstep)/10;
#ifdef STEPDEBUG
@ -251,10 +252,10 @@ DCtran(CKTcircuit *ckt,
ckt->CKTdcMaxIter);
if(converged != 0) {
fprintf(stdout,"\nTransient solution failed -\n");
fprintf(stderr,"\nError: Finding the operating point for transient simulation failed \n");
CKTncDump(ckt);
fprintf(stdout,"\n");
fflush(stdout);
fprintf(stderr,"\n");
fflush(stderr);
} else if (ckt->CKTmode & MODEUIC && !ft_ngdebug) {
fprintf(stdout,"Operating point simulation skipped by 'uic',\n");
fprintf(stdout," now using transient initial conditions.\n");
@ -273,6 +274,7 @@ DCtran(CKTcircuit *ckt,
fflush(stdout);
}
/* return upon failure to converge during op */
if (converged != 0) {
SPfrontEnd->OUTendPlot(job->TRANplot);
return(converged);
@ -311,7 +313,7 @@ DCtran(CKTcircuit *ckt,
for(i=0;i<7;i++) {
ckt->CKTdeltaOld[i]=ckt->CKTmaxStep;
}
ckt->CKTdelta = delta;
ckt->CKTdelta = delta; /* delta set in line 135 */
#ifdef STEPDEBUG
(void)printf("delta initialized to %g\n",ckt->CKTdelta);
#endif
@ -983,6 +985,7 @@ resume:
SPfrontEnd->OUTendPlot(job->TRANplot);
job->TRANplot = NULL;
UPDATE_STATS(0);
/* return upon convergence failure */
return(E_TIMESTEP);
}
}