/* nlcsrc.f -- translated by f2c (version of 3 February 1990  3:36:42).
   You must link the resulting object file with the libraries:
	-lF77 -lI77 -lm -lc   (in that order)
*/

#include "f2c.h"

/* Common Block Declarations */

struct {
    integer ielmnt, isbckt, nsbckt, iunsat, nunsat, itemps, numtem, isens, 
	    nsens, ifour, nfour, ifield, icode, idelim, icolum, insize, 
	    junode, lsbkpt, numbkp, iorder, jmnode, iur, iuc, ilc, ilr, 
	    numoff, isr, nmoffc, iseq, iseq1, neqn, nodevs, ndiag, iswap, 
	    iequa, macins, lvnim1, lx0, lvn, lynl, lyu, lyl, lx1, lx2, lx3, 
	    lx4, lx5, lx6, lx7, ld0, ld1, ltd, imynl, imvn, lcvn, nsnod, 
	    nsmat, nsval, icnod, icmat, icval, loutpt, lpol, lzer, irswpf, 
	    irswpr, icswpf, icswpr, irpt, jcpt, irowno, jcolno, nttbr, nttar, 
	    lvntmp;
} tabinf_;

#define tabinf_1 tabinf_

struct {
    integer locate[50], jelcnt[50], nunods, ncnods, numnod, nstop, nut, nlt, 
	    nxtrm, ndist, ntlin, ibr, numvs, numalt, numcyc;
} cirdat_;

#define cirdat_1 cirdat_

struct {
    doublereal omega, time, delta, delold[7], ag[7], vt, xni, egfet, xmu, 
	    sfactr;
    integer mode, modedc, icalc, initf, method, iord, maxord, noncon, iterno, 
	    itemno, nosolv, modac, ipiv, ivmflg, ipostp, iscrch, iofile;
} status_;

#define status_1 status_

struct {
    integer iprnta, iprntl, iprntm, iprntn, iprnto, limtim, limpts, lvlcod, 
	    lvltim, itl1, itl2, itl3, itl4, itl5, itl6, igoof, nogo, keof;
} flags_;

#define flags_1 flags_

struct {
    doublereal twopi, xlog2, xlog10, root2, rad, boltz, charge, ctok, gmin, 
	    reltol, abstol, vntol, trtol, chgtol, eps0, epssil, epsox, pivtol,
	     pivrel;
} knstnt_;

#define knstnt_1 knstnt_

struct {
    doublereal value[200000];
} blank_;

#define blank_1 blank_

/* Table of constant values */

static integer c__2 = 2;
static integer c__0 = 0;
static integer c__1 = 1;

/*<       subroutine nlcsrc >*/
/* Subroutine */ int nlcsrc_()
{
    /* System generated locals */
    integer i_1;
    doublereal d_1, d_2, d_3;

    /* Local variables */
    static doublereal cold;
    static integer larg, ndim;
    static doublereal csrc;
    static integer lnod, lmat, lexp, loct, locy, iptr;
    static doublereal volt;
    static integer node1, node2, i;
    static doublereal cgain;
    static integer lcoef, ncoef;
    static doublereal vgain;
    static integer icheck;
#define nodplc ((integer *)&blank_1)
#define cvalue ((complex *)&blank_1)
    extern /* Subroutine */ int sizmem_(), update_(), evpoly_();
    static doublereal transr;
    static integer lic;
    static doublereal ceq;
    static integer loc;
    static doublereal geq, veq, tol;
    static integer lvs;

/*<       implicit double precision (a-h,o-z) >*/

/*     this routine loads the nonlinear controlled sources into the */
/* coefficient matrix. */

/* spice version 2g.6  sccsid=tabinf 3/15/83 */
/*<       common /tabinf/ ielmnt,isbckt,nsbckt,iunsat,nunsat,itemps,numtem, >*/
/*<      1   isens,nsens,ifour,nfour,ifield,icode,idelim,icolum,insize, >*/
/*<      2   junode,lsbkpt,numbkp,iorder,jmnode,iur,iuc,ilc,ilr,numoff,isr, >*/
/*<      3   nmoffc,iseq,iseq1,neqn,nodevs,ndiag,iswap,iequa,macins,lvnim1, >*/
/*<      4   lx0,lvn,lynl,lyu,lyl,lx1,lx2,lx3,lx4,lx5,lx6,lx7,ld0,ld1,ltd, >*/
/*<      5   imynl,imvn,lcvn,nsnod,nsmat,nsval,icnod,icmat,icval, >*/
/*<      6   loutpt,lpol,lzer,irswpf,irswpr,icswpf,icswpr,irpt,jcpt, >*/
/*<      7   irowno,jcolno,nttbr,nttar,lvntmp >*/
/* spice version 2g.6  sccsid=cirdat 3/15/83 */
/*<       common /cirdat/ locate(50),jelcnt(50),nunods,ncnods,numnod,nstop, >*/
/*<      1   nut,nlt,nxtrm,ndist,ntlin,ibr,numvs,numalt,numcyc >*/
/* spice version 2g.6  sccsid=status 3/15/83 */
/*<       common /status/ omega,time,delta,delold(7),ag(7),vt,xni,egfet, >*/
/*<      1   xmu,sfactr,mode,modedc,icalc,initf,method,iord,maxord,noncon, >*/
/*<      2   iterno,itemno,nosolv,modac,ipiv,ivmflg,ipostp,iscrch,iofile >*/
/* spice version 2g.6  sccsid=flags 3/15/83 */
/*<       common /flags/ iprnta,iprntl,iprntm,iprntn,iprnto,limtim,limpts, >*/
/*<      1   lvlcod,lvltim,itl1,itl2,itl3,itl4,itl5,itl6,igoof,nogo,keof >*/
/* spice version 2g.6  sccsid=knstnt 3/15/83 */
/*<       common /knstnt/ twopi,xlog2,xlog10,root2,rad,boltz,charge,ctok, >*/
/*<      1   gmin,reltol,abstol,vntol,trtol,chgtol,eps0,epssil,epsox, >*/
/*<      2   pivtol,pivrel >*/
/* spice version 2g.6  sccsid=blank 3/15/83 */
/*<       common /blank/ value(200000) >*/
/*<       integer nodplc(64) >*/
/*<       complex cvalue(32) >*/
/*<       equivalence (value(1),nodplc(1),cvalue(1)) >*/

/*  nonlinear voltage-controlled current sources */

/*<       loc=locate(5) >*/
    loc = cirdat_1.locate[4];
/*<    10 if ((loc.eq.0).or.(nodplc(loc+13).ne.0)) go to 100 >*/
L10:
    if (loc == 0 || nodplc[loc + 12] != 0) {
	goto L100;
    }
/*<       node1=nodplc(loc+2) >*/
    node1 = nodplc[loc + 1];
/*<       node2=nodplc(loc+3) >*/
    node2 = nodplc[loc + 2];
/*<       ndim=nodplc(loc+4) >*/
    ndim = nodplc[loc + 3];
/*<       lnod=nodplc(loc+6) >*/
    lnod = nodplc[loc + 5];
/*<       lmat=nodplc(loc+7) >*/
    lmat = nodplc[loc + 6];
/*<       lcoef=nodplc(loc+8) >*/
    lcoef = nodplc[loc + 7];
/*<       call sizmem(nodplc(loc+8),ncoef) >*/
    sizmem_(&nodplc[loc + 7], &ncoef);
/*<       larg=nodplc(loc+9) >*/
    larg = nodplc[loc + 8];
/*<       lexp=nodplc(loc+10) >*/
    lexp = nodplc[loc + 9];
/*<       lic=nodplc(loc+11) >*/
    lic = nodplc[loc + 10];
/*<       loct=nodplc(loc+12)+1 >*/
    loct = nodplc[loc + 11] + 1;
/*<       icheck=0 >*/
    icheck = 0;
/*<       do 20 i=1,ndim >*/
    i_1 = ndim;
    for (i = 1; i <= i_1; ++i) {
/*<       call update(value(lic+i),loct,nodplc(lnod+1),nodplc(lnod+2),2, >*/
/*<      1   icheck) >*/
	update_(&blank_1.value[lic + i - 1], &loct, &nodplc[lnod], &nodplc[
		lnod + 1], &c__2, &icheck);
/*<       value(larg+i)=value(lx0+loct) >*/
	blank_1.value[larg + i - 1] = blank_1.value[tabinf_1.lx0 + loct - 1];
/*<       loct=loct+2 >*/
	loct += 2;
/*<       lnod=lnod+2 >*/
	lnod += 2;
/*<    20 continue >*/
/* L20: */
    }
/*<       call evpoly(cold,0,lcoef,ncoef,larg,ndim,lexp) >*/
    evpoly_(&cold, &c__0, &lcoef, &ncoef, &larg, &ndim, &lexp);
/*<       loct=nodplc(loc+12) >*/
    loct = nodplc[loc + 11];
/*<       if (icheck.eq.1) go to 30 >*/
    if (icheck == 1) {
	goto L30;
    }
/*<       if (initf.eq.6) go to 30 >*/
    if (status_1.initf == 6) {
	goto L30;
    }
/*<       tol=reltol*dmax1(dabs(cold),dabs(value(lx0+loct)))+abstol >*/
/* Computing MAX */
    d_2 = abs(cold), d_3 = (d_1 = blank_1.value[tabinf_1.lx0 + loct - 1], abs(
	    d_1));
    tol = knstnt_1.reltol * max(d_3,d_2) + knstnt_1.abstol;
/*<       if (dabs(cold-value(lx0+loct)).lt.tol) go to 40 >*/
    if ((d_1 = cold - blank_1.value[tabinf_1.lx0 + loct - 1], abs(d_1)) < tol)
	     {
	goto L40;
    }
/*<    30 noncon=noncon+1 >*/
L30:
    ++status_1.noncon;
/*<    40 value(lx0+loct)=cold >*/
L40:
    blank_1.value[tabinf_1.lx0 + loct - 1] = cold;
/*<       ceq=cold >*/
    ceq = cold;
/*<       do 50 i=1,ndim >*/
    i_1 = ndim;
    for (i = 1; i <= i_1; ++i) {
/*<       call evpoly(geq,i,lcoef,ncoef,larg,ndim,lexp) >*/
	evpoly_(&geq, &i, &lcoef, &ncoef, &larg, &ndim, &lexp);
/*<       loct=loct+2 >*/
	loct += 2;
/*<       value(lx0+loct)=geq >*/
	blank_1.value[tabinf_1.lx0 + loct - 1] = geq;
/*<       ceq=ceq-geq*value(larg+i) >*/
	ceq -= geq * blank_1.value[larg + i - 1];
/*<       locy=lvn+nodplc(lmat+1) >*/
	locy = tabinf_1.lvn + nodplc[lmat];
/*<       value(locy)=value(locy)+geq >*/
	blank_1.value[locy - 1] += geq;
/*<       locy=lvn+nodplc(lmat+2) >*/
	locy = tabinf_1.lvn + nodplc[lmat + 1];
/*<       value(locy)=value(locy)-geq >*/
	blank_1.value[locy - 1] -= geq;
/*<       locy=lvn+nodplc(lmat+3) >*/
	locy = tabinf_1.lvn + nodplc[lmat + 2];
/*<       value(locy)=value(locy)-geq >*/
	blank_1.value[locy - 1] -= geq;
/*<       locy=lvn+nodplc(lmat+4) >*/
	locy = tabinf_1.lvn + nodplc[lmat + 3];
/*<       value(locy)=value(locy)+geq >*/
	blank_1.value[locy - 1] += geq;
/*<       lmat=lmat+4 >*/
	lmat += 4;
/*<    50 continue >*/
/* L50: */
    }
/*<       value(lvn+node1)=value(lvn+node1)-ceq >*/
    blank_1.value[tabinf_1.lvn + node1 - 1] -= ceq;
/*<       value(lvn+node2)=value(lvn+node2)+ceq >*/
    blank_1.value[tabinf_1.lvn + node2 - 1] += ceq;
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 10 >*/
    goto L10;

/*  nonlinear voltage controlled voltage sources */

/*<   100 loc=locate(6) >*/
L100:
    loc = cirdat_1.locate[5];
/*<   110 if ((loc.eq.0).or.(nodplc(loc+14).ne.0)) go to 200 >*/
L110:
    if (loc == 0 || nodplc[loc + 13] != 0) {
	goto L200;
    }
/*<       node1=nodplc(loc+2) >*/
    node1 = nodplc[loc + 1];
/*<       node2=nodplc(loc+3) >*/
    node2 = nodplc[loc + 2];
/*<       ndim=nodplc(loc+4) >*/
    ndim = nodplc[loc + 3];
/*<       iptr=nodplc(loc+6) >*/
    iptr = nodplc[loc + 5];
/*<       lnod=nodplc(loc+7) >*/
    lnod = nodplc[loc + 6];
/*<       lmat=nodplc(loc+8) >*/
    lmat = nodplc[loc + 7];
/*<       lcoef=nodplc(loc+9) >*/
    lcoef = nodplc[loc + 8];
/*<       call sizmem(nodplc(loc+9),ncoef) >*/
    sizmem_(&nodplc[loc + 8], &ncoef);
/*<       larg=nodplc(loc+10) >*/
    larg = nodplc[loc + 9];
/*<       lexp=nodplc(loc+11) >*/
    lexp = nodplc[loc + 10];
/*<       lic=nodplc(loc+12) >*/
    lic = nodplc[loc + 11];
/*<       loct=nodplc(loc+13)+2 >*/
    loct = nodplc[loc + 12] + 2;
/*<       icheck=0 >*/
    icheck = 0;
/*<       do 120 i=1,ndim >*/
    i_1 = ndim;
    for (i = 1; i <= i_1; ++i) {
/*<       call update(value(lic+i),loct,nodplc(lnod+1),nodplc(lnod+2),2, >*/
/*<      1   icheck) >*/
	update_(&blank_1.value[lic + i - 1], &loct, &nodplc[lnod], &nodplc[
		lnod + 1], &c__2, &icheck);
/*<       value(larg+i)=value(lx0+loct) >*/
	blank_1.value[larg + i - 1] = blank_1.value[tabinf_1.lx0 + loct - 1];
/*<       loct=loct+2 >*/
	loct += 2;
/*<       lnod=lnod+2 >*/
	lnod += 2;
/*<   120 continue >*/
/* L120: */
    }
/*<       call evpoly(volt,0,lcoef,ncoef,larg,ndim,lexp) >*/
    evpoly_(&volt, &c__0, &lcoef, &ncoef, &larg, &ndim, &lexp);
/*<       loct=nodplc(loc+13) >*/
    loct = nodplc[loc + 12];
/*<       if (icheck.eq.1) go to 130 >*/
    if (icheck == 1) {
	goto L130;
    }
/*<       if (initf.eq.6) go to 130 >*/
    if (status_1.initf == 6) {
	goto L130;
    }
/*<       tol=reltol*dmax1(dabs(volt),dabs(value(lx0+loct)))+vntol >*/
/* Computing MAX */
    d_2 = abs(volt), d_3 = (d_1 = blank_1.value[tabinf_1.lx0 + loct - 1], abs(
	    d_1));
    tol = knstnt_1.reltol * max(d_3,d_2) + knstnt_1.vntol;
/*<       if (dabs(volt-value(lx0+loct)).lt.tol) go to 140 >*/
    if ((d_1 = volt - blank_1.value[tabinf_1.lx0 + loct - 1], abs(d_1)) < tol)
	     {
	goto L140;
    }
/*<   130 noncon=noncon+1 >*/
L130:
    ++status_1.noncon;
/*<   140 value(lx0+loct)=volt >*/
L140:
    blank_1.value[tabinf_1.lx0 + loct - 1] = volt;
/*<       value(lx0+loct+1)=value(lvnim1+iptr) >*/
    blank_1.value[tabinf_1.lx0 + loct] = blank_1.value[tabinf_1.lvnim1 + iptr 
	    - 1];
/*<       veq=volt >*/
    veq = volt;
/*<       locy=lvn+nodplc(lmat+1) >*/
    locy = tabinf_1.lvn + nodplc[lmat];
/*<       value(locy)=+1.0d0 >*/
    blank_1.value[locy - 1] = 1.;
/*<       locy=lvn+nodplc(lmat+2) >*/
    locy = tabinf_1.lvn + nodplc[lmat + 1];
/*<       value(locy)=-1.0d0 >*/
    blank_1.value[locy - 1] = -1.;
/*<       locy=lvn+nodplc(lmat+3) >*/
    locy = tabinf_1.lvn + nodplc[lmat + 2];
/*<       value(locy)=+1.0d0 >*/
    blank_1.value[locy - 1] = 1.;
/*<       locy=lvn+nodplc(lmat+4) >*/
    locy = tabinf_1.lvn + nodplc[lmat + 3];
/*<       value(locy)=-1.0d0 >*/
    blank_1.value[locy - 1] = -1.;
/*<       lmat=lmat+4 >*/
    lmat += 4;
/*<       loct=loct+1 >*/
    ++loct;
/*<       do 150 i=1,ndim >*/
    i_1 = ndim;
    for (i = 1; i <= i_1; ++i) {
/*<       call evpoly(vgain,i,lcoef,ncoef,larg,ndim,lexp) >*/
	evpoly_(&vgain, &i, &lcoef, &ncoef, &larg, &ndim, &lexp);
/*<       loct=loct+2 >*/
	loct += 2;
/*<       value(lx0+loct)=vgain >*/
	blank_1.value[tabinf_1.lx0 + loct - 1] = vgain;
/*<       veq=veq-vgain*value(larg+i) >*/
	veq -= vgain * blank_1.value[larg + i - 1];
/*<       locy=lvn+nodplc(lmat+1) >*/
	locy = tabinf_1.lvn + nodplc[lmat];
/*<       value(locy)=value(locy)-vgain >*/
	blank_1.value[locy - 1] -= vgain;
/*<       locy=lvn+nodplc(lmat+2) >*/
	locy = tabinf_1.lvn + nodplc[lmat + 1];
/*<       value(locy)=value(locy)+vgain >*/
	blank_1.value[locy - 1] += vgain;
/*<       lmat=lmat+2 >*/
	lmat += 2;
/*<   150 continue >*/
/* L150: */
    }
/*<       value(lvn+iptr)=veq >*/
    blank_1.value[tabinf_1.lvn + iptr - 1] = veq;
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 110 >*/
    goto L110;

/*  nonlinear current-controlled current sources */

/*<   200 loc=locate(7) >*/
L200:
    loc = cirdat_1.locate[6];
/*<   210 if ((loc.eq.0).or.(nodplc(loc+13).ne.0)) go to 300 >*/
L210:
    if (loc == 0 || nodplc[loc + 12] != 0) {
	goto L300;
    }
/*<       node1=nodplc(loc+2) >*/
    node1 = nodplc[loc + 1];
/*<       node2=nodplc(loc+3) >*/
    node2 = nodplc[loc + 2];
/*<       ndim=nodplc(loc+4) >*/
    ndim = nodplc[loc + 3];
/*<       lvs=nodplc(loc+6) >*/
    lvs = nodplc[loc + 5];
/*<       lmat=nodplc(loc+7) >*/
    lmat = nodplc[loc + 6];
/*<       lcoef=nodplc(loc+8) >*/
    lcoef = nodplc[loc + 7];
/*<       call sizmem(nodplc(loc+8),ncoef) >*/
    sizmem_(&nodplc[loc + 7], &ncoef);
/*<       larg=nodplc(loc+9) >*/
    larg = nodplc[loc + 8];
/*<       lexp=nodplc(loc+10) >*/
    lexp = nodplc[loc + 9];
/*<       lic=nodplc(loc+11) >*/
    lic = nodplc[loc + 10];
/*<       loct=nodplc(loc+12)+1 >*/
    loct = nodplc[loc + 11] + 1;
/*<       icheck=0 >*/
    icheck = 0;
/*<       do 220 i=1,ndim >*/
    i_1 = ndim;
    for (i = 1; i <= i_1; ++i) {
/*<       iptr=nodplc(lvs+i) >*/
	iptr = nodplc[lvs + i - 1];
/*<       iptr=nodplc(iptr+6) >*/
	iptr = nodplc[iptr + 5];
/*<       call update(value(lic+i),loct,iptr,1,2,icheck) >*/
	update_(&blank_1.value[lic + i - 1], &loct, &iptr, &c__1, &c__2, &
		icheck);
/*<       value(larg+i)=value(lx0+loct) >*/
	blank_1.value[larg + i - 1] = blank_1.value[tabinf_1.lx0 + loct - 1];
/*<       loct=loct+2 >*/
	loct += 2;
/*<   220 continue >*/
/* L220: */
    }
/*<       call evpoly(csrc,0,lcoef,ncoef,larg,ndim,lexp) >*/
    evpoly_(&csrc, &c__0, &lcoef, &ncoef, &larg, &ndim, &lexp);
/*<       loct=nodplc(loc+12) >*/
    loct = nodplc[loc + 11];
/*<       if (icheck.eq.1) go to 230 >*/
    if (icheck == 1) {
	goto L230;
    }
/*<       if (initf.eq.6) go to 230 >*/
    if (status_1.initf == 6) {
	goto L230;
    }
/*<       tol=reltol*dmax1(dabs(csrc),dabs(value(lx0+loct)))+abstol >*/
/* Computing MAX */
    d_2 = abs(csrc), d_3 = (d_1 = blank_1.value[tabinf_1.lx0 + loct - 1], abs(
	    d_1));
    tol = knstnt_1.reltol * max(d_3,d_2) + knstnt_1.abstol;
/*<       if (dabs(csrc-value(lx0+loct)).lt.tol) go to 240 >*/
    if ((d_1 = csrc - blank_1.value[tabinf_1.lx0 + loct - 1], abs(d_1)) < tol)
	     {
	goto L240;
    }
/*<   230 noncon=noncon+1 >*/
L230:
    ++status_1.noncon;
/*<   240 value(lx0+loct)=csrc >*/
L240:
    blank_1.value[tabinf_1.lx0 + loct - 1] = csrc;
/*<       ceq=csrc >*/
    ceq = csrc;
/*<       do 250 i=1,ndim >*/
    i_1 = ndim;
    for (i = 1; i <= i_1; ++i) {
/*<       call evpoly(cgain,i,lcoef,ncoef,larg,ndim,lexp) >*/
	evpoly_(&cgain, &i, &lcoef, &ncoef, &larg, &ndim, &lexp);
/*<       loct=loct+2 >*/
	loct += 2;
/*<       value(lx0+loct)=cgain >*/
	blank_1.value[tabinf_1.lx0 + loct - 1] = cgain;
/*<       ceq=ceq-cgain*value(larg+i) >*/
	ceq -= cgain * blank_1.value[larg + i - 1];
/*<       locy=lvn+nodplc(lmat+1) >*/
	locy = tabinf_1.lvn + nodplc[lmat];
/*<       value(locy)=value(locy)+cgain >*/
	blank_1.value[locy - 1] += cgain;
/*<       locy=lvn+nodplc(lmat+2) >*/
	locy = tabinf_1.lvn + nodplc[lmat + 1];
/*<       value(locy)=value(locy)-cgain >*/
	blank_1.value[locy - 1] -= cgain;
/*<       lmat=lmat+2 >*/
	lmat += 2;
/*<   250 continue >*/
/* L250: */
    }
/*<       value(lvn+node1)=value(lvn+node1)-ceq >*/
    blank_1.value[tabinf_1.lvn + node1 - 1] -= ceq;
/*<       value(lvn+node2)=value(lvn+node2)+ceq >*/
    blank_1.value[tabinf_1.lvn + node2 - 1] += ceq;
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 210 >*/
    goto L210;

/*  nonlinear current controlled voltage sources */

/*<   300 loc=locate(8) >*/
L300:
    loc = cirdat_1.locate[7];
/*<   310 if ((loc.eq.0).or.(nodplc(loc+14).ne.0)) go to 1000 >*/
L310:
    if (loc == 0 || nodplc[loc + 13] != 0) {
	goto L1000;
    }
/*<       node1=nodplc(loc+2) >*/
    node1 = nodplc[loc + 1];
/*<       node2=nodplc(loc+3) >*/
    node2 = nodplc[loc + 2];
/*<       ndim=nodplc(loc+4) >*/
    ndim = nodplc[loc + 3];
/*<       ibr=nodplc(loc+6) >*/
    cirdat_1.ibr = nodplc[loc + 5];
/*<       lvs=nodplc(loc+7) >*/
    lvs = nodplc[loc + 6];
/*<       lmat=nodplc(loc+8) >*/
    lmat = nodplc[loc + 7];
/*<       lcoef=nodplc(loc+9) >*/
    lcoef = nodplc[loc + 8];
/*<       call sizmem(nodplc(loc+9),ncoef) >*/
    sizmem_(&nodplc[loc + 8], &ncoef);
/*<       larg=nodplc(loc+10) >*/
    larg = nodplc[loc + 9];
/*<       lexp=nodplc(loc+11) >*/
    lexp = nodplc[loc + 10];
/*<       lic=nodplc(loc+12) >*/
    lic = nodplc[loc + 11];
/*<       loct=nodplc(loc+13)+2 >*/
    loct = nodplc[loc + 12] + 2;
/*<       icheck=0 >*/
    icheck = 0;
/*<       do 320 i=1,ndim >*/
    i_1 = ndim;
    for (i = 1; i <= i_1; ++i) {
/*<       iptr=nodplc(lvs+i) >*/
	iptr = nodplc[lvs + i - 1];
/*<       iptr=nodplc(iptr+6) >*/
	iptr = nodplc[iptr + 5];
/*<       call update(value(lic+i),loct,iptr,1,2,icheck) >*/
	update_(&blank_1.value[lic + i - 1], &loct, &iptr, &c__1, &c__2, &
		icheck);
/*<       value(larg+i)=value(lx0+loct) >*/
	blank_1.value[larg + i - 1] = blank_1.value[tabinf_1.lx0 + loct - 1];
/*<       loct=loct+2 >*/
	loct += 2;
/*<   320 continue >*/
/* L320: */
    }
/*<       call evpoly(volt,0,lcoef,ncoef,larg,ndim,lexp) >*/
    evpoly_(&volt, &c__0, &lcoef, &ncoef, &larg, &ndim, &lexp);
/*<       loct=nodplc(loc+13) >*/
    loct = nodplc[loc + 12];
/*<       if (icheck.eq.1) go to 330 >*/
    if (icheck == 1) {
	goto L330;
    }
/*<       if (initf.eq.6) go to 330 >*/
    if (status_1.initf == 6) {
	goto L330;
    }
/*<       tol=reltol*dmax1(dabs(volt),dabs(value(lx0+loct)))+vntol >*/
/* Computing MAX */
    d_2 = abs(volt), d_3 = (d_1 = blank_1.value[tabinf_1.lx0 + loct - 1], abs(
	    d_1));
    tol = knstnt_1.reltol * max(d_3,d_2) + knstnt_1.vntol;
/*<       if (dabs(volt-value(lx0+loct)).lt.tol) go to 340 >*/
    if ((d_1 = volt - blank_1.value[tabinf_1.lx0 + loct - 1], abs(d_1)) < tol)
	     {
	goto L340;
    }
/*<   330 noncon=noncon+1 >*/
L330:
    ++status_1.noncon;
/*<   340 value(lx0+loct)=volt >*/
L340:
    blank_1.value[tabinf_1.lx0 + loct - 1] = volt;
/*<       value(lx0+loct+1)=value(lvnim1+ibr) >*/
    blank_1.value[tabinf_1.lx0 + loct] = blank_1.value[tabinf_1.lvnim1 + 
	    cirdat_1.ibr - 1];
/*<       veq=volt >*/
    veq = volt;
/*<       locy=lvn+nodplc(lmat+1) >*/
    locy = tabinf_1.lvn + nodplc[lmat];
/*<       value(locy)=+1.0d0 >*/
    blank_1.value[locy - 1] = 1.;
/*<       locy=lvn+nodplc(lmat+2) >*/
    locy = tabinf_1.lvn + nodplc[lmat + 1];
/*<       value(locy)=-1.0d0 >*/
    blank_1.value[locy - 1] = -1.;
/*<       locy=lvn+nodplc(lmat+3) >*/
    locy = tabinf_1.lvn + nodplc[lmat + 2];
/*<       value(locy)=+1.0d0 >*/
    blank_1.value[locy - 1] = 1.;
/*<       locy=lvn+nodplc(lmat+4) >*/
    locy = tabinf_1.lvn + nodplc[lmat + 3];
/*<       value(locy)=-1.0d0 >*/
    blank_1.value[locy - 1] = -1.;
/*<       lmat=lmat+4 >*/
    lmat += 4;
/*<       loct=loct+1 >*/
    ++loct;
/*<       do 350 i=1,ndim >*/
    i_1 = ndim;
    for (i = 1; i <= i_1; ++i) {
/*<       call evpoly(transr,i,lcoef,ncoef,larg,ndim,lexp) >*/
	evpoly_(&transr, &i, &lcoef, &ncoef, &larg, &ndim, &lexp);
/*<       loct=loct+2 >*/
	loct += 2;
/*<       value(lx0+loct)=transr >*/
	blank_1.value[tabinf_1.lx0 + loct - 1] = transr;
/*<       veq=veq-transr*value(larg+i) >*/
	veq -= transr * blank_1.value[larg + i - 1];
/*<       locy=lvn+nodplc(lmat+i) >*/
	locy = tabinf_1.lvn + nodplc[lmat + i - 1];
/*<       value(locy)=value(locy)-transr >*/
	blank_1.value[locy - 1] -= transr;
/*<   350 continue >*/
/* L350: */
    }
/*<       value(lvn+ibr)=veq >*/
    blank_1.value[tabinf_1.lvn + cirdat_1.ibr - 1] = veq;
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 310 >*/
    goto L310;

/*  finished */

/*<  1000 return >*/
L1000:
    return 0;
/*<       end >*/
} /* nlcsrc_ */

#undef cvalue
#undef nodplc


