/* putnod.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 value[200000];
} blank_;

#define blank_1 blank_

/* Table of constant values */

static integer c__1 = 1;

/*<       subroutine putnod(node) >*/
/* Subroutine */ int putnod_(node)
integer *node;
{
    /* System generated locals */
    integer i_1;

    /* Local variables */
    static integer jknt;
    extern /* Subroutine */ int copy4_();
    static integer k;
#define nodplc ((integer *)&blank_1)
#define cvalue ((complex *)&blank_1)
    extern /* Subroutine */ int extmem_();

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

/*     this routine adds 'node' to the list of user input nodes in table 
*/
/* junode. */

/* 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=blank 3/15/83 */
/*<       common /blank/ value(200000) >*/
/*<       integer nodplc(64) >*/
/*<       complex cvalue(32) >*/
/*<       equivalence (value(1),nodplc(1),cvalue(1)) >*/


/*<       jknt=0 >*/
    jknt = 0;
/*<    10 jknt=jknt+1 >*/
L10:
    ++jknt;
/*<       if (jknt.gt.nunods) go to 20 >*/
    if (jknt > cirdat_1.nunods) {
	goto L20;
    }
/*<       if (node-nodplc(junode+jknt)) 20,100,10 >*/
    if ((i_1 = *node - nodplc[tabinf_1.junode + jknt - 1]) < 0) {
	goto L20;
    } else if (i_1 == 0) {
	goto L100;
    } else {
	goto L10;
    }
/*<    20 k=nunods+1 >*/
L20:
    k = cirdat_1.nunods + 1;
/*<       call extmem(junode,1) >*/
    extmem_(&tabinf_1.junode, &c__1);
/*<       if (k.le.jknt) go to 30 >*/
    if (k <= jknt) {
	goto L30;
    }
/*<       call copy4(nodplc(junode+jknt),nodplc(junode+jknt+1),k-jknt) >*/
    i_1 = k - jknt;
    copy4_(&nodplc[tabinf_1.junode + jknt - 1], &nodplc[tabinf_1.junode + 
	    jknt], &i_1);
/*<       k=jknt >*/
    k = jknt;
/*<    30 nodplc(junode+k)=node >*/
L30:
    nodplc[tabinf_1.junode + k - 1] = *node;
/*<       nunods=nunods+1 >*/
    ++cirdat_1.nunods;

/*  finished */

/*<   100 return >*/
L100:
    return 0;
/*<       end >*/
} /* putnod_ */

#undef cvalue
#undef nodplc


