inp2q.c, #12/23, move code down

Note; here i==4 and nodeflag still was 4
This commit is contained in:
rlar 2017-03-10 18:33:53 +01:00
parent c8b1d18289
commit d2d9bffed0
1 changed files with 17 additions and 11 deletions

View File

@ -83,20 +83,9 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode)
i = 4;
INPgetTok(&line, &model, 1);
if (INPlookMod(model)) {
/* 4-terminal device - special case with tnodeout flag not handled */
INPinsert(&model, tab);
current->error = INPgetMod(ckt, model, &thismodel, tab);
#ifdef ADMS
if (thismodel == NULL) {
fprintf(stderr, "%s\nPlease check model, level or number of terminals!\n", current->error);
controlled_exit(EXIT_BAD);
}
if (5 == model_numnodes(thismodel->INPmodType)) {
node[4] = gnode; /* 4-terminal adms device - thermal node to ground */
nname[4] = copy("0");
INPtermInsert(ckt, &nname[4], tab, &node[4]);
nodeflag = 5; /* now specify a 5 node device */
}
} else {
nodeflag = 5; /* now specify a 5 node device */
nname[i] = model;
@ -115,6 +104,23 @@ void INP2Q(CKTcircuit *ckt, INPtables * tab, card * current, CKTnode *gnode)
nodeflag = 4;
}
if (i == 4) {
nodeflag = 4;
#ifdef ADMS
/* 4-terminal device - special case with tnodeout flag not handled */
if (thismodel == NULL) {
fprintf(stderr, "%s\nPlease check model, level or number of terminals!\n", current->error);
controlled_exit(EXIT_BAD);
}
if (5 == model_numnodes(thismodel->INPmodType)) {
node[4] = gnode; /* 4-terminal adms device - thermal node to ground */
nname[4] = copy("0");
INPtermInsert(ckt, &nname[4], tab, &node[4]);
nodeflag = 5; /* now specify a 5 node device */
}
#endif
}
#ifdef TRACE
printf("INP2Q: Looking up model\n");
#endif