/* load.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 {
    doublereal atime, aprog[3], adate, atitle[10], defl, defw, defad, defas, 
	    rstats[50];
    integer iwidth, lwidth, nopage;
} miscel_;

#define miscel_1 miscel_

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_n1 = -1;
static integer c__1 = 1;
static integer c__0 = 0;

/*<       subroutine load >*/
/* Subroutine */ int load_()
{
    /* System generated locals */
    integer i_1, i_2;

    /* Local variables */
#define ccap ((doublereal *)&blank_1 + 1)
    static doublereal cind;
#define find ((doublereal *)&blank_1)
#define qcap ((doublereal *)&blank_1)
    extern /* Subroutine */ int jfet_();
    static doublereal vcap;
    static integer node;
#define vind ((doublereal *)&blank_1 + 1)
    static integer locv, locy, loct, iptr, node1, node2, node3, node4, loct1, 
	    loct2, iptr1, iptr2;
    extern /* Subroutine */ int zero8_();
    static doublereal g;
    static integer i;
    extern /* Subroutine */ int diode_();
    static integer lcoef, ncoef, ipoly, ntest;
    static doublereal t1, t2, z0, y0;
    extern /* Subroutine */ int intgr8_();
#define nodplc ((integer *)&blank_1)
#define cvalue ((complex *)&blank_1)
    extern /* Subroutine */ int second_(), sizmem_(), evpoly_();
    static doublereal ceq;
    static integer nl1, nl2;
    extern /* Subroutine */ int nlcsrc_();
    static integer loc;
    static doublereal geq;
    extern /* Subroutine */ int bjt_(), mosfet_();
    static doublereal val;
    static integer nic;
    static doublereal req, veq;
    static integer ibr1, ibr2;

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

/*     this routine zeroes-out and then loads the coefficient matrix. */
/* the active devices and the controlled sources are loaded by separate */

/* subroutines. */

/* 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=miscel 3/15/83 */
/*<       common /miscel/ atime,aprog(3),adate,atitle(10),defl,defw,defad, >*/
/*<      1  defas,rstats(50),iwidth,lwidth,nopage >*/
/* 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)) >*/


/*<       dimension qcap(1),ccap(1) >*/
/*<       equivalence (qcap(1),value(1)),(ccap(1),value(2)) >*/
/*<       dimension find(1),vind(1) >*/
/*<       equivalence (find(1),value(1)),(vind(1),value(2)) >*/

/*<       call second(t1) >*/
    second_(&t1);

/*  zero y matrix and current vector */

/*<       call zero8(value(lvn+1),nstop+nttbr) >*/
    i_1 = cirdat_1.nstop + tabinf_1.nttbr;
    zero8_(&blank_1.value[tabinf_1.lvn], &i_1);

/*  resistors */

/*<       loc=locate(1) >*/
    loc = cirdat_1.locate[0];
/*<    20 if ((loc.eq.0).or.(nodplc(loc+8).ne.0)) go to 30 >*/
L20:
    if (loc == 0 || nodplc[loc + 7] != 0) {
	goto L30;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       val=value(locv+1) >*/
    val = blank_1.value[locv];
/*<       locy=lvn+nodplc(loc+6) >*/
    locy = tabinf_1.lvn + nodplc[loc + 5];
/*<       value(locy)=value(locy)+val >*/
    blank_1.value[locy - 1] += val;
/*<       locy=lvn+nodplc(loc+7) >*/
    locy = tabinf_1.lvn + nodplc[loc + 6];
/*<       value(locy)=value(locy)+val >*/
    blank_1.value[locy - 1] += val;
/*<       locy=lvn+nodplc(loc+4) >*/
    locy = tabinf_1.lvn + nodplc[loc + 3];
/*<       value(locy)=value(locy)-val >*/
    blank_1.value[locy - 1] -= val;
/*<       locy=lvn+nodplc(loc+5) >*/
    locy = tabinf_1.lvn + nodplc[loc + 4];
/*<       value(locy)=value(locy)-val >*/
    blank_1.value[locy - 1] -= val;
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 20 >*/
    goto L20;

/*  capacitors */

/*<    30 loc=locate(2) >*/
L30:
    loc = cirdat_1.locate[1];
/*<       if ((mode.eq.1).and.(modedc.ne.2)) go to 100 >*/
    if (status_1.mode == 1 && status_1.modedc != 2) {
	goto L100;
    }
/*<    40 if ((loc.eq.0).or.(nodplc(loc+12).ne.0)) go to 100 >*/
L40:
    if (loc == 0 || nodplc[loc + 11] != 0) {
	goto L100;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       node1=nodplc(loc+2) >*/
    node1 = nodplc[loc + 1];
/*<       node2=nodplc(loc+3) >*/
    node2 = nodplc[loc + 2];
/*<       loct=nodplc(loc+8) >*/
    loct = nodplc[loc + 7];
/*<       ipoly=nodplc(loc+4) >*/
    ipoly = nodplc[loc + 3];
/*<       if (ipoly.eq.1) go to 43 >*/
    if (ipoly == 1) {
	goto L43;
    }
/*<       lcoef=nodplc(loc+7) >*/
    lcoef = nodplc[loc + 6];
/*<       call sizmem(nodplc(loc+7),ncoef) >*/
    sizmem_(&nodplc[loc + 6], &ncoef);
/*<    43 vcap=value(locv+2) >*/
L43:
    vcap = blank_1.value[locv + 1];
/*<       if ((mode.eq.1).and.(initf.eq.2)) go to 45 >*/
    if (status_1.mode == 1 && status_1.initf == 2) {
	goto L45;
    }
/*<       if ((nosolv.ne.0).and.(initf.eq.5)) go to 45 >*/
    if (status_1.nosolv != 0 && status_1.initf == 5) {
	goto L45;
    }
/*<       vcap=value(lvnim1+node1)-value(lvnim1+node2) >*/
    vcap = blank_1.value[tabinf_1.lvnim1 + node1 - 1] - blank_1.value[
	    tabinf_1.lvnim1 + node2 - 1];
/*<    45 value(locv+3)=vcap >*/
L45:
    blank_1.value[locv + 2] = vcap;
/*<       if (mode.eq.1) go to 60 >*/
    if (status_1.mode == 1) {
	goto L60;
    }
/*<    47 if (initf.ne.6) go to 50 >*/
/* L47: */
    if (status_1.initf != 6) {
	goto L50;
    }
/*<       qcap(lx0+loct)=qcap(lx1+loct) >*/
    qcap[tabinf_1.lx0 + loct - 1] = qcap[tabinf_1.lx1 + loct - 1];
/*<       go to 60 >*/
    goto L60;
/*<    50 if (ipoly.eq.0) go to 53 >*/
L50:
    if (ipoly == 0) {
	goto L53;
    }
/*<       qcap(lx0+loct)=value(locv+1)*vcap >*/
    qcap[tabinf_1.lx0 + loct - 1] = blank_1.value[locv] * vcap;
/*<       if (initf.ne.5) go to 60 >*/
    if (status_1.initf != 5) {
	goto L60;
    }
/*<       if (nosolv.ne.0) qcap(lx0+loct)=value(locv+1)*value(locv+2) >*/
    if (status_1.nosolv != 0) {
	qcap[tabinf_1.lx0 + loct - 1] = blank_1.value[locv] * blank_1.value[
		locv + 1];
    }
/*<       qcap(lx1+loct)=qcap(lx0+loct) >*/
    qcap[tabinf_1.lx1 + loct - 1] = qcap[tabinf_1.lx0 + loct - 1];
/*<       go to 60 >*/
    goto L60;
/*<    53 call evpoly(qcap(lx0+loct),-1,lcoef,ncoef,locv+2,1,loc+8) >*/
L53:
    i_1 = locv + 2;
    i_2 = loc + 8;
    evpoly_(&qcap[tabinf_1.lx0 + loct - 1], &c_n1, &lcoef, &ncoef, &i_1, &
	    c__1, &i_2);
/*<       if (initf.ne.5) go to 60 >*/
    if (status_1.initf != 5) {
	goto L60;
    }
/*<       if (nosolv.eq.0) go to 55 >*/
    if (status_1.nosolv == 0) {
	goto L55;
    }
/*<       vcap=value(locv+2) >*/
    vcap = blank_1.value[locv + 1];
/*<       value(locv+3)=vcap >*/
    blank_1.value[locv + 2] = vcap;
/*<       call evpoly(qcap(lx0+loct),-1,lcoef,ncoef,locv+2,1,loc+8) >*/
    i_1 = locv + 2;
    i_2 = loc + 8;
    evpoly_(&qcap[tabinf_1.lx0 + loct - 1], &c_n1, &lcoef, &ncoef, &i_1, &
	    c__1, &i_2);
/*<    55 qcap(lx1+loct)=qcap(lx0+loct) >*/
L55:
    qcap[tabinf_1.lx1 + loct - 1] = qcap[tabinf_1.lx0 + loct - 1];
/*<    60 if (ipoly.eq.1) go to 62 >*/
L60:
    if (ipoly == 1) {
	goto L62;
    }
/*<       call evpoly(value(locv+1),0,lcoef,ncoef,locv+2,1,loc+8) >*/
    i_1 = locv + 2;
    i_2 = loc + 8;
    evpoly_(&blank_1.value[locv], &c__0, &lcoef, &ncoef, &i_1, &c__1, &i_2);
/*<    62 if (mode.eq.1) go to 90 >*/
L62:
    if (status_1.mode == 1) {
	goto L90;
    }
/*<       call intgr8(geq,ceq,value(locv+1),loct) >*/
    intgr8_(&geq, &ceq, &blank_1.value[locv], &loct);
/*<       if (ipoly.eq.1) go to 65 >*/
    if (ipoly == 1) {
	goto L65;
    }
/*<       ceq=ceq-geq*vcap+ag(1)*qcap(lx0+loct) >*/
    ceq = ceq - geq * vcap + status_1.ag[0] * qcap[tabinf_1.lx0 + loct - 1];
/*<    65 if(initf.ne.5) go to 70 >*/
L65:
    if (status_1.initf != 5) {
	goto L70;
    }
/*<       ccap(lx1+loct)=ccap(lx0+loct) >*/
    ccap[tabinf_1.lx1 + loct - 1] = ccap[tabinf_1.lx0 + loct - 1];
/*<    70 locy=lvn+nodplc(loc+10) >*/
L70:
    locy = tabinf_1.lvn + nodplc[loc + 9];
/*<       value(locy)=value(locy)+geq >*/
    blank_1.value[locy - 1] += geq;
/*<       locy=lvn+nodplc(loc+11) >*/
    locy = tabinf_1.lvn + nodplc[loc + 10];
/*<       value(locy)=value(locy)+geq >*/
    blank_1.value[locy - 1] += geq;
/*<       locy=lvn+nodplc(loc+5) >*/
    locy = tabinf_1.lvn + nodplc[loc + 4];
/*<       value(locy)=value(locy)-geq >*/
    blank_1.value[locy - 1] -= geq;
/*<       locy=lvn+nodplc(loc+6) >*/
    locy = tabinf_1.lvn + nodplc[loc + 5];
/*<       value(locy)=value(locy)-geq >*/
    blank_1.value[locy - 1] -= geq;
/*<       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;
/*<    90 loc=nodplc(loc) >*/
L90:
    loc = nodplc[loc - 1];
/*<       go to 40 >*/
    goto L40;

/*  inductors */

/*<   100 if (jelcnt(3).eq.0) go to 400 >*/
L100:
    if (cirdat_1.jelcnt[2] == 0) {
	goto L400;
    }
/*<       if (mode.eq.1) go to 150 >*/
    if (status_1.mode == 1) {
	goto L150;
    }
/*<       if (initf.eq.6) go to 150 >*/
    if (status_1.initf == 6) {
	goto L150;
    }
/*<       loc=locate(3) >*/
    loc = cirdat_1.locate[2];
/*<   110 if ((loc.eq.0).or.(nodplc(loc+14).ne.0)) go to 120 >*/
L110:
    if (loc == 0 || nodplc[loc + 13] != 0) {
	goto L120;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       iptr=nodplc(loc+5) >*/
    iptr = nodplc[loc + 4];
/*<       loct=nodplc(loc+11) >*/
    loct = nodplc[loc + 10];
/*<       ipoly=nodplc(loc+4) >*/
    ipoly = nodplc[loc + 3];
/*<       if (ipoly.eq.0) go to 115 >*/
    if (ipoly == 0) {
	goto L115;
    }
/*<       find(lx0+loct)=value(locv+1)*value(lvnim1+iptr) >*/
    find[tabinf_1.lx0 + loct - 1] = blank_1.value[locv] * blank_1.value[
	    tabinf_1.lvnim1 + iptr - 1];
/*<       if ((initf.eq.5).and.(nosolv.ne.0)) >*/
/*<      1   find(lx0+loct)=value(locv+1)*value(locv+2) >*/
    if (status_1.initf == 5 && status_1.nosolv != 0) {
	find[tabinf_1.lx0 + loct - 1] = blank_1.value[locv] * blank_1.value[
		locv + 1];
    }
/*<       go to 118 >*/
    goto L118;
/*<   115 lcoef=nodplc(loc+10) >*/
L115:
    lcoef = nodplc[loc + 9];
/*<       call sizmem(nodplc(loc+10),ncoef) >*/
    sizmem_(&nodplc[loc + 9], &ncoef);
/*<       cind=value(lvnim1+iptr) >*/
    cind = blank_1.value[tabinf_1.lvnim1 + iptr - 1];
/*<       if ((initf.eq.5).and.(nosolv.ne.0)) cind=value(locv+2) >*/
    if (status_1.initf == 5 && status_1.nosolv != 0) {
	cind = blank_1.value[locv + 1];
    }
/*<       value(locv+3)=cind >*/
    blank_1.value[locv + 2] = cind;
/*<       call evpoly(find(lx0+loct),-1,lcoef,ncoef,locv+2,1,loc+11) >*/
    i_1 = locv + 2;
    i_2 = loc + 11;
    evpoly_(&find[tabinf_1.lx0 + loct - 1], &c_n1, &lcoef, &ncoef, &i_1, &
	    c__1, &i_2);
/*<   118 loc=nodplc(loc) >*/
L118:
    loc = nodplc[loc - 1];
/*<       go to 110 >*/
    goto L110;
/*<   120 loc=locate(4) >*/
L120:
    loc = cirdat_1.locate[3];
/*<   130 if ((loc.eq.0).or.(nodplc(loc+6).ne.0)) go to 150 >*/
L130:
    if (loc == 0 || nodplc[loc + 5] != 0) {
	goto L150;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       nl1=nodplc(loc+2) >*/
    nl1 = nodplc[loc + 1];
/*<       nl2=nodplc(loc+3) >*/
    nl2 = nodplc[loc + 2];
/*<       iptr1=nodplc(nl1+5) >*/
    iptr1 = nodplc[nl1 + 4];
/*<       iptr2=nodplc(nl2+5) >*/
    iptr2 = nodplc[nl2 + 4];
/*<       loct1=nodplc(nl1+11) >*/
    loct1 = nodplc[nl1 + 10];
/*<       loct2=nodplc(nl2+11) >*/
    loct2 = nodplc[nl2 + 10];
/*<       find(lx0+loct1)=find(lx0+loct1)+value(locv+1)*value(lvnim1+iptr2) >*/
    find[tabinf_1.lx0 + loct1 - 1] += blank_1.value[locv] * blank_1.value[
	    tabinf_1.lvnim1 + iptr2 - 1];
/*<       find(lx0+loct2)=find(lx0+loct2)+value(locv+1)*value(lvnim1+iptr1) >*/
    find[tabinf_1.lx0 + loct2 - 1] += blank_1.value[locv] * blank_1.value[
	    tabinf_1.lvnim1 + iptr1 - 1];
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 130 >*/
    goto L130;
/*<   150 loc=locate(3) >*/
L150:
    loc = cirdat_1.locate[2];
/*<   160 if ((loc.eq.0).or.(nodplc(loc+14).ne.0)) go to 300 >*/
L160:
    if (loc == 0 || nodplc[loc + 13] != 0) {
	goto L300;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       iptr=nodplc(loc+5) >*/
    iptr = nodplc[loc + 4];
/*<       loct=nodplc(loc+11) >*/
    loct = nodplc[loc + 10];
/*<       ipoly=nodplc(loc+4) >*/
    ipoly = nodplc[loc + 3];
/*<       if (ipoly.eq.1) go to 170 >*/
    if (ipoly == 1) {
	goto L170;
    }
/*<       lcoef=nodplc(loc+10) >*/
    lcoef = nodplc[loc + 9];
/*<       call sizmem(nodplc(loc+10),ncoef) >*/
    sizmem_(&nodplc[loc + 9], &ncoef);
/*<   170 cind=value(lvnim1+iptr) >*/
L170:
    cind = blank_1.value[tabinf_1.lvnim1 + iptr - 1];
/*<       if ((nosolv.ne.0).and.(initf.eq.5)) cind=value(locv+2) >*/
    if (status_1.nosolv != 0 && status_1.initf == 5) {
	cind = blank_1.value[locv + 1];
    }
/*<       value(locv+3)=cind >*/
    blank_1.value[locv + 2] = cind;
/*<   180 if (mode.ne.1) go to 200 >*/
/* L180: */
    if (status_1.mode != 1) {
	goto L200;
    }
/*<       veq=0.0d0 >*/
    veq = 0.;
/*<       req=0.0d0 >*/
    req = 0.;
/*<       go to 210 >*/
    goto L210;
/*<   200 if (initf.ne.6) go to 205 >*/
L200:
    if (status_1.initf != 6) {
	goto L205;
    }
/*<       find(lx0+loct)=find(lx1+loct) >*/
    find[tabinf_1.lx0 + loct - 1] = find[tabinf_1.lx1 + loct - 1];
/*<       go to 210 >*/
    goto L210;
/*<   205 if (initf.ne.5) go to 210 >*/
L205:
    if (status_1.initf != 5) {
	goto L210;
    }
/*<       find(lx1+loct)=find(lx0+loct) >*/
    find[tabinf_1.lx1 + loct - 1] = find[tabinf_1.lx0 + loct - 1];
/*<   210 if (ipoly.eq.1) go to 220 >*/
L210:
    if (ipoly == 1) {
	goto L220;
    }
/*<       call evpoly(value(locv+1),0,lcoef,ncoef,locv+2,1,loc+11) >*/
    i_1 = locv + 2;
    i_2 = loc + 11;
    evpoly_(&blank_1.value[locv], &c__0, &lcoef, &ncoef, &i_1, &c__1, &i_2);
/*<   220 if (mode.eq.1) go to 250 >*/
L220:
    if (status_1.mode == 1) {
	goto L250;
    }
/*<       call intgr8(req,veq,value(locv+1),loct) >*/
    intgr8_(&req, &veq, &blank_1.value[locv], &loct);
/*<       if (ipoly.eq.1) go to 250 >*/
    if (ipoly == 1) {
	goto L250;
    }
/*<       veq=veq-req*cind+ag(1)*find(lx0+loct) >*/
    veq = veq - req * cind + status_1.ag[0] * find[tabinf_1.lx0 + loct - 1];
/*<   250 value(lvn+iptr)=veq >*/
L250:
    blank_1.value[tabinf_1.lvn + iptr - 1] = veq;
/*<       if(initf.ne.5) go to 260 >*/
    if (status_1.initf != 5) {
	goto L260;
    }
/*<       vind(lx1+loct)=vind(lx0+loct) >*/
    vind[tabinf_1.lx1 + loct - 1] = vind[tabinf_1.lx0 + loct - 1];
/*<   260 locy=lvn+nodplc(loc+13) >*/
L260:
    locy = tabinf_1.lvn + nodplc[loc + 12];
/*<       value(locy)=-req >*/
    blank_1.value[locy - 1] = -req;
/*<       locy=lvn+nodplc(loc+6) >*/
    locy = tabinf_1.lvn + nodplc[loc + 5];
/*<       value(locy)=1.0d0 >*/
    blank_1.value[locy - 1] = 1.;
/*<       locy=lvn+nodplc(loc+7) >*/
    locy = tabinf_1.lvn + nodplc[loc + 6];
/*<       value(locy)=-1.0d0 >*/
    blank_1.value[locy - 1] = -1.;
/*<       locy=lvn+nodplc(loc+8) >*/
    locy = tabinf_1.lvn + nodplc[loc + 7];
/*<       value(locy)=1.0d0 >*/
    blank_1.value[locy - 1] = 1.;
/*<       locy=lvn+nodplc(loc+9) >*/
    locy = tabinf_1.lvn + nodplc[loc + 8];
/*<       value(locy)=-1.0d0 >*/
    blank_1.value[locy - 1] = -1.;
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 160 >*/
    goto L160;

/*  mutual inductances */

/*<   300 loc=locate(4) >*/
L300:
    loc = cirdat_1.locate[3];
/*<   310 if ((loc.eq.0).or.(nodplc(loc+6).ne.0)) go to 400 >*/
L310:
    if (loc == 0 || nodplc[loc + 5] != 0) {
	goto L400;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       req=ag(1)*value(locv+1) >*/
    req = status_1.ag[0] * blank_1.value[locv];
/*<       locy=lvn+nodplc(loc+4) >*/
    locy = tabinf_1.lvn + nodplc[loc + 3];
/*<       value(locy)=-req >*/
    blank_1.value[locy - 1] = -req;
/*<       locy=lvn+nodplc(loc+5) >*/
    locy = tabinf_1.lvn + nodplc[loc + 4];
/*<       value(locy)=-req >*/
    blank_1.value[locy - 1] = -req;
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 310 >*/
    goto L310;

/*  nonlinear controlled sources */

/*<   400 call nlcsrc >*/
L400:
    nlcsrc_();

/*  voltage sources */

/*<       loc=locate(9) >*/
    loc = cirdat_1.locate[8];
/*<   610 if ((loc.eq.0).or.(nodplc(loc+11).ne.0)) go to 700 >*/
L610:
    if (loc == 0 || nodplc[loc + 10] != 0) {
	goto L700;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       iptr=nodplc(loc+6) >*/
    iptr = nodplc[loc + 5];
/*<       value(lvn+iptr)=value(locv+1)*sfactr >*/
    blank_1.value[tabinf_1.lvn + iptr - 1] = blank_1.value[locv] * 
	    status_1.sfactr;
/*<       locy=lvn+nodplc(loc+7) >*/
    locy = tabinf_1.lvn + nodplc[loc + 6];
/*<       value(locy)=value(locy)+1.0d0 >*/
    blank_1.value[locy - 1] += 1.;
/*<       locy=lvn+nodplc(loc+8) >*/
    locy = tabinf_1.lvn + nodplc[loc + 7];
/*<       value(locy)=value(locy)-1.0d0 >*/
    blank_1.value[locy - 1] += -1.;
/*<       locy=lvn+nodplc(loc+9) >*/
    locy = tabinf_1.lvn + nodplc[loc + 8];
/*<       value(locy)=value(locy)+1.0d0 >*/
    blank_1.value[locy - 1] += 1.;
/*<       locy=lvn+nodplc(loc+10) >*/
    locy = tabinf_1.lvn + nodplc[loc + 9];
/*<       value(locy)=value(locy)-1.0d0 >*/
    blank_1.value[locy - 1] += -1.;
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 610 >*/
    goto L610;

/*  current sources */

/*<   700 loc=locate(10) >*/
L700:
    loc = cirdat_1.locate[9];
/*<   710 if ((loc.eq.0).or.(nodplc(loc+6).ne.0)) go to 800 >*/
L710:
    if (loc == 0 || nodplc[loc + 5] != 0) {
	goto L800;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       node1=nodplc(loc+2) >*/
    node1 = nodplc[loc + 1];
/*<       node2=nodplc(loc+3) >*/
    node2 = nodplc[loc + 2];
/*<       val=value(locv+1)*sfactr >*/
    val = blank_1.value[locv] * status_1.sfactr;
/*<       value(lvn+node1)=value(lvn+node1)-val >*/
    blank_1.value[tabinf_1.lvn + node1 - 1] -= val;
/*<       value(lvn+node2)=value(lvn+node2)+val >*/
    blank_1.value[tabinf_1.lvn + node2 - 1] += val;
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 710 >*/
    goto L710;

/*  call device model routines */

/*<   800 call diode >*/
L800:
    diode_();
/*<       call bjt >*/
    bjt_();
/*<       call jfet >*/
    jfet_();
/*<       call mosfet >*/
    mosfet_();

/*  transmission lines */

/*<       loc=locate(17) >*/
    loc = cirdat_1.locate[16];
/*<   910 if ((loc.eq.0).or.(nodplc(loc+33).ne.0)) go to 980 >*/
L910:
    if (loc == 0 || nodplc[loc + 32] != 0) {
	goto L980;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       z0=value(locv+1) >*/
    z0 = blank_1.value[locv];
/*<       y0=1.0d0/z0 >*/
    y0 = 1. / z0;
/*<       node1=nodplc(loc+2) >*/
    node1 = nodplc[loc + 1];
/*<       node2=nodplc(loc+3) >*/
    node2 = nodplc[loc + 2];
/*<       node3=nodplc(loc+4) >*/
    node3 = nodplc[loc + 3];
/*<       node4=nodplc(loc+5) >*/
    node4 = nodplc[loc + 4];
/*<       ibr1=nodplc(loc+8) >*/
    ibr1 = nodplc[loc + 7];
/*<       ibr2=nodplc(loc+9) >*/
    ibr2 = nodplc[loc + 8];
/*<       locy=lvn+nodplc(loc+10) >*/
    locy = tabinf_1.lvn + nodplc[loc + 9];
/*<       value(locy)=value(locy)+y0 >*/
    blank_1.value[locy - 1] += y0;
/*<       locy=lvn+nodplc(loc+11) >*/
    locy = tabinf_1.lvn + nodplc[loc + 10];
/*<       value(locy)=-y0 >*/
    blank_1.value[locy - 1] = -y0;
/*<       locy=lvn+nodplc(loc+12) >*/
    locy = tabinf_1.lvn + nodplc[loc + 11];
/*<       value(locy)=-1.0d0 >*/
    blank_1.value[locy - 1] = -1.;
/*<       locy=lvn+nodplc(loc+13) >*/
    locy = tabinf_1.lvn + nodplc[loc + 12];
/*<       value(locy)=value(locy)+y0 >*/
    blank_1.value[locy - 1] += y0;
/*<       locy=lvn+nodplc(loc+14) >*/
    locy = tabinf_1.lvn + nodplc[loc + 13];
/*<       value(locy)=-1.0d0 >*/
    blank_1.value[locy - 1] = -1.;
/*<       locy=lvn+nodplc(loc+15) >*/
    locy = tabinf_1.lvn + nodplc[loc + 14];
/*<       value(locy)=-y0 >*/
    blank_1.value[locy - 1] = -y0;
/*<       locy=lvn+nodplc(loc+16) >*/
    locy = tabinf_1.lvn + nodplc[loc + 15];
/*<       value(locy)=+y0 >*/
    blank_1.value[locy - 1] = y0;
/*<       locy=lvn+nodplc(loc+17) >*/
    locy = tabinf_1.lvn + nodplc[loc + 16];
/*<       value(locy)=+1.0d0 >*/
    blank_1.value[locy - 1] = 1.;
/*<       locy=lvn+nodplc(loc+18) >*/
    locy = tabinf_1.lvn + nodplc[loc + 17];
/*<       value(locy)=+y0 >*/
    blank_1.value[locy - 1] = y0;
/*<       locy=lvn+nodplc(loc+19) >*/
    locy = tabinf_1.lvn + nodplc[loc + 18];
/*<       value(locy)=+1.0d0 >*/
    blank_1.value[locy - 1] = 1.;
/*<       locy=lvn+nodplc(loc+20) >*/
    locy = tabinf_1.lvn + nodplc[loc + 19];
/*<       value(locy)=-1.0d0 >*/
    blank_1.value[locy - 1] = -1.;
/*<       locy=lvn+nodplc(loc+23) >*/
    locy = tabinf_1.lvn + nodplc[loc + 22];
/*<       value(locy)=+1.0d0 >*/
    blank_1.value[locy - 1] = 1.;
/*<       locy=lvn+nodplc(loc+27) >*/
    locy = tabinf_1.lvn + nodplc[loc + 26];
/*<       value(locy)=-1.0d0 >*/
    blank_1.value[locy - 1] = -1.;
/*<       locy=lvn+nodplc(loc+28) >*/
    locy = tabinf_1.lvn + nodplc[loc + 27];
/*<       value(locy)=+1.0d0 >*/
    blank_1.value[locy - 1] = 1.;
/*<       locy=lvn+nodplc(loc+31) >*/
    locy = tabinf_1.lvn + nodplc[loc + 30];
/*<       value(locy)=-y0 >*/
    blank_1.value[locy - 1] = -y0;
/*<       locy=lvn+nodplc(loc+32) >*/
    locy = tabinf_1.lvn + nodplc[loc + 31];
/*<       value(locy)=-y0 >*/
    blank_1.value[locy - 1] = -y0;
/*<       if (mode.ne.1) go to 920 >*/
    if (status_1.mode != 1) {
	goto L920;
    }
/*<       locy=lvn+nodplc(loc+21) >*/
    locy = tabinf_1.lvn + nodplc[loc + 20];
/*<       value(locy)=-1.0d0 >*/
    blank_1.value[locy - 1] = -1.;
/*<       locy=lvn+nodplc(loc+22) >*/
    locy = tabinf_1.lvn + nodplc[loc + 21];
/*<       value(locy)=+1.0d0 >*/
    blank_1.value[locy - 1] = 1.;
/*<       locy=lvn+nodplc(loc+24) >*/
    locy = tabinf_1.lvn + nodplc[loc + 23];
/*<       value(locy)=-(1.0d0-gmin)*z0 >*/
    blank_1.value[locy - 1] = -(1. - knstnt_1.gmin) * z0;
/*<       locy=lvn+nodplc(loc+25) >*/
    locy = tabinf_1.lvn + nodplc[loc + 24];
/*<       value(locy)=-1.0d0 >*/
    blank_1.value[locy - 1] = -1.;
/*<       locy=lvn+nodplc(loc+26) >*/
    locy = tabinf_1.lvn + nodplc[loc + 25];
/*<       value(locy)=+1.0d0 >*/
    blank_1.value[locy - 1] = 1.;
/*<       locy=lvn+nodplc(loc+29) >*/
    locy = tabinf_1.lvn + nodplc[loc + 28];
/*<       value(locy)=-(1.0d0-gmin)*z0 >*/
    blank_1.value[locy - 1] = -(1. - knstnt_1.gmin) * z0;
/*<       go to 950 >*/
    goto L950;
/*<   920 if (initf.ne.5) go to 930 >*/
L920:
    if (status_1.initf != 5) {
	goto L930;
    }
/*<       if (nosolv.ne.0) go to 925 >*/
    if (status_1.nosolv != 0) {
	goto L925;
    }
/*<       value(locv+3)=value(lvnim1+node3)-value(lvnim1+node4) >*/
/*<      1   +value(lvnim1+ibr2)*z0 >*/
    blank_1.value[locv + 2] = blank_1.value[tabinf_1.lvnim1 + node3 - 1] - 
	    blank_1.value[tabinf_1.lvnim1 + node4 - 1] + blank_1.value[
	    tabinf_1.lvnim1 + ibr2 - 1] * z0;
/*<       value(locv+4)=value(lvnim1+node1)-value(lvnim1+node2) >*/
/*<      1   +value(lvnim1+ibr1)*z0 >*/
    blank_1.value[locv + 3] = blank_1.value[tabinf_1.lvnim1 + node1 - 1] - 
	    blank_1.value[tabinf_1.lvnim1 + node2 - 1] + blank_1.value[
	    tabinf_1.lvnim1 + ibr1 - 1] * z0;
/*<       go to 930 >*/
    goto L930;
/*<   925 value(locv+3)=value(locv+7)+value(locv+8)*z0 >*/
L925:
    blank_1.value[locv + 2] = blank_1.value[locv + 6] + blank_1.value[locv + 
	    7] * z0;
/*<       value(locv+4)=value(locv+5)+value(locv+6)*z0 >*/
    blank_1.value[locv + 3] = blank_1.value[locv + 4] + blank_1.value[locv + 
	    5] * z0;
/*<   930 value(lvn+ibr1)=value(locv+3) >*/
L930:
    blank_1.value[tabinf_1.lvn + ibr1 - 1] = blank_1.value[locv + 2];
/*<       value(lvn+ibr2)=value(locv+4) >*/
    blank_1.value[tabinf_1.lvn + ibr2 - 1] = blank_1.value[locv + 3];
/*<   950 loc=nodplc(loc) >*/
L950:
    loc = nodplc[loc - 1];
/*<       go to 910 >*/
    goto L910;

/*  initialize nodes */

/*<   980 if(mode.ne.1) go to 995 >*/
L980:
    if (status_1.mode != 1) {
	goto L995;
    }
/*<       if(initf.ne.3.and.initf.ne.2) go to 995 >*/
    if (status_1.initf != 3 && status_1.initf != 2) {
	goto L995;
    }
/*<       call sizmem(nsnod,nic) >*/
    sizmem_(&tabinf_1.nsnod, &nic);
/*<       if(nic.eq.0) go to 995 >*/
    if (nic == 0) {
	goto L995;
    }
/*<       call sizmem(icnod,ntest) >*/
    sizmem_(&tabinf_1.icnod, &ntest);
/*<       if(modedc.eq.2.and.ntest.ne.0) go to 995 >*/
    if (status_1.modedc == 2 && ntest != 0) {
	goto L995;
    }
/*<       g=1.0d0 >*/
    g = 1.;
/*<       do 990 i=1,nic >*/
    i_1 = nic;
    for (i = 1; i <= i_1; ++i) {
/*<       locy=lvn+nodplc(nsmat+i) >*/
	locy = tabinf_1.lvn + nodplc[tabinf_1.nsmat + i - 1];
/*<       value(locy)=value(locy)+g >*/
	blank_1.value[locy - 1] += g;
/*<       node=nodplc(nsnod+i) >*/
	node = nodplc[tabinf_1.nsnod + i - 1];
/*<       value(lvn+node)=value(lvn+node)+value(nsval+i)*g >*/
	blank_1.value[tabinf_1.lvn + node - 1] += blank_1.value[
		tabinf_1.nsval + i - 1] * g;
/*<   990 continue >*/
/* L990: */
    }

/*  transient initial conditions (uic not specified) */

/*<   995 if(mode.ne.1) go to 1000 >*/
L995:
    if (status_1.mode != 1) {
	goto L1000;
    }
/*<       if(modedc.ne.2) go to 1000 >*/
    if (status_1.modedc != 2) {
	goto L1000;
    }
/*<       if(nosolv.ne.0) go to 1000 >*/
    if (status_1.nosolv != 0) {
	goto L1000;
    }
/*<       call sizmem(icnod,nic) >*/
    sizmem_(&tabinf_1.icnod, &nic);
/*<       if(nic.eq.0) go to 1000 >*/
    if (nic == 0) {
	goto L1000;
    }
/*<       g=1.0d0 >*/
    g = 1.;
/*<       do 996 i=1,nic >*/
    i_1 = nic;
    for (i = 1; i <= i_1; ++i) {
/*<       locy=lvn+nodplc(icmat+i) >*/
	locy = tabinf_1.lvn + nodplc[tabinf_1.icmat + i - 1];
/*<       value(locy)=value(locy)+g >*/
	blank_1.value[locy - 1] += g;
/*<       node=nodplc(icnod+i) >*/
	node = nodplc[tabinf_1.icnod + i - 1];
/*<       value(lvn+node)=value(lvn+node)+value(icval+i)*g >*/
	blank_1.value[tabinf_1.lvn + node - 1] += blank_1.value[
		tabinf_1.icval + i - 1] * g;
/*<   996 continue >*/
/* L996: */
    }

/*  finished */

/*<  1000 call second(t2) >*/
L1000:
    second_(&t2);
/*<       rstats(45)=rstats(45)+t2-t1 >*/
    miscel_1.rstats[44] = miscel_1.rstats[44] + t2 - t1;
/*<       return >*/
    return 0;
/*<       end >*/
} /* load_ */

#undef cvalue
#undef nodplc
#undef vind
#undef qcap
#undef find
#undef ccap


