/* noise.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 {
    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 fstart, fstop, fincr, skw2, refprl, spw2;
    integer jacflg, idfreq, inoise, nosprt, nosout, nosin, idist, idprt;
} ac_;

#define ac_1 ac_

struct {
    doublereal value[200000];
} blank_;

#define blank_1 blank_

/* Table of constant values */

static integer c__1 = 1;
static integer c__2 = 2;
static integer c__0 = 0;
static integer c__8 = 8;
static integer c__5 = 5;

/*<       subroutine noise(loco) >*/
/* Subroutine */ int noise_(loco)
integer *loco;
{
    /* Initialized data */

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_106 = { {'r', 'c', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define alsrc (*(doublereal *)&equiv_106)

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_107 = { {'r', 'e', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define alsre (*(doublereal *)&equiv_107)

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_108 = { {'r', 's', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define alsrs (*(doublereal *)&equiv_108)

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_109 = { {'r', 'd', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define alsrd (*(doublereal *)&equiv_109)

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_110 = { {'i', 'b', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define alsib (*(doublereal *)&equiv_110)

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_111 = { {'i', 'c', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define alsic (*(doublereal *)&equiv_111)

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_112 = { {'i', 'd', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define alsid (*(doublereal *)&equiv_112)

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_113 = { {'f', 'n', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define alsfn (*(doublereal *)&equiv_113)

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_114 = { {'t', 'o', 't', 'a', 'l', ' ', ' ', ' '}, 0. };

#define alstot (*(doublereal *)&equiv_114)

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_115 = { {'/', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define aslash (*(doublereal *)&equiv_115)

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_116 = { {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define ablnk (*(doublereal *)&equiv_116)

    static struct {
	char e_1[24];
	doublereal e_2;
	} equiv_117 = { {'(', '/', '/', '/', '/', ',', '1', '1', 'x', ',', ' '
		, ' ', '(', '2', 'x', ',', 'a', '8', ')', ')', ' ', ' ', ' ', 
		' '}, 0. };

#define afmt1 ((doublereal *)&equiv_117)

    static struct {
	char e_1[24];
	doublereal e_2;
	} equiv_118 = { {'(', '1', 'h', '0', ',', 'a', '8', ',', '1', 'p', ' '
		, ' ', 'd', '1', '0', '.', '3', ')', ' ', ' ', ' ', ' ', ' ', 
		' '}, 0. };

#define afmt2 ((doublereal *)&equiv_118)

    static struct {
	char e_1[32];
	doublereal e_2;
	} equiv_119 = { {'n', 'o', 'i', 's', 'e', ' ', 'a', 'n', 'a', 'l', 'y'
		, 's', 'i', 's', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 
		' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define titln ((doublereal *)&equiv_119)

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_120 = { {'r', 'b', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define alsrb (*(doublereal *)&equiv_120)


    /* Format strings */
    static char fmt_16[] = "(\0020    frequency = \002,1pd10.3,\002 hz\002/)";

    static char fmt_91[] = "(//\0020**** resistor squared noise voltages (sq\
 v/hz)\002)";
    static char fmt_201[] = "(//\0020**** diode squared noise voltages (sq v\
/hz)\002)";
    static char fmt_301[] = "(//\0020**** transistor squared noise voltages \
(sq v/hz)\002)";
    static char fmt_401[] = "(//\0020**** jfet squared noise voltages (sq v/\
hz)\002)";
    static char fmt_501[] = "(//\0020**** mosfet squared noise voltages (sq \
v/hz)\002)";
    static char fmt_611[] = "(////,\0020**** total output noise voltage\002,\
9x,\002= \002,1pd10.3,\002 sq v/hz\002/,\0020\002,40x,\002= \002,d10.3,\002 \
v/rt hz\002/,\0020     transfer function value:\002,/,\0020\002,7x,4a8,a1\
,\002= \002,d10.3,/,\0020     equivalent input noise at \002,a8,\002 = \002,\
d10.3,\002 /rt hz\002)";

    /* System generated locals */
    integer i_1, i_2;
    doublereal d_1, d_2;
    complex q_1;
    static complex equiv_3[1];

    /* Builtin functions */
    integer s_wsfe(), do_fio(), e_wsfe();
    double sqrt(), log(), exp();

    /* Local variables */
    static doublereal area, anam[12];
#define cval (equiv_3)
    static integer locm;
    static doublereal freq;
    static integer locv;
    extern /* Subroutine */ int move_();
    static integer ipos, loct, kntr;
    static doublereal gdpr, gspr, vnin, twoq, vout, anam1;
    static integer node1, node2, node3, node4, node5, node6;
#define c (equiv_3)
    extern /* Subroutine */ int zero8_();
    static integer i;
#define v ((real *)equiv_3)
#define vimag ((real *)equiv_3 + 1)
#define vreal ((real *)equiv_3)
    static doublereal vntot[12];
    static integer nprnt, nkntr;
    extern /* Subroutine */ int title_();
    static doublereal vnrms, vtemp;
    static integer itype;
    static doublereal vnout, gm;
    extern /* Subroutine */ int acasol_();
    static doublereal xl;
#define nodplc ((integer *)&blank_1)
#define cvalue ((complex *)&blank_1)
    static doublereal string[5];
    extern /* Subroutine */ int alfnum_();
    static doublereal fourkt;
    static integer noposo, nonego, kntlim, ititle;
    static doublereal fna;
    static integer loc;
    static doublereal fnk, arg, xw;
    static integer ioutyp;
    extern /* Subroutine */ int outnam_();
    static doublereal cox, vno1[12], vno2[12], vno3[12], vno4[12], vno5[12], 
	    vno6[12];

    /* Fortran I/O blocks */
    static cilist io__33 = { 0, 0, 0, fmt_16, 0 };
    static cilist io__43 = { 0, 0, 0, fmt_91, 0 };
    static cilist io__44 = { 0, 0, 0, (char *)afmt1, 0 };
    static cilist io__46 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__58 = { 0, 0, 0, fmt_201, 0 };
    static cilist io__59 = { 0, 0, 0, (char *)afmt1, 0 };
    static cilist io__60 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__61 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__62 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__63 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__70 = { 0, 0, 0, fmt_301, 0 };
    static cilist io__71 = { 0, 0, 0, (char *)afmt1, 0 };
    static cilist io__72 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__73 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__74 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__75 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__76 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__77 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__78 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__79 = { 0, 0, 0, fmt_401, 0 };
    static cilist io__80 = { 0, 0, 0, (char *)afmt1, 0 };
    static cilist io__81 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__82 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__83 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__84 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__85 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__93 = { 0, 0, 0, fmt_501, 0 };
    static cilist io__94 = { 0, 0, 0, (char *)afmt1, 0 };
    static cilist io__95 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__96 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__97 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__98 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__99 = { 0, 0, 0, (char *)afmt2, 0 };
    static cilist io__105 = { 0, 0, 0, fmt_611, 0 };


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

/*     this routine computes the noise due to various circuit elements. */


/* 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=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=ac 3/15/83 */
/*<       common /ac/ fstart,fstop,fincr,skw2,refprl,spw2,jacflg,idfreq, >*/
/*<      1   inoise,nosprt,nosout,nosin,idist,idprt >*/
/* 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 vno1(12),vno2(12),vno3(12),vno4(12),vno5(12),vno6(12) >*/
/*<       dimension vntot(12),anam(12),string(5) >*/
/*<       real v,vreal,vimag >*/
/*<       dimension titln(4),v(2) >*/
/*<       dimension afmt1(3),afmt2(3) >*/
/*<       complex cval,c(1) >*/
/*<       equivalence (c(1),v(1),cval) >*/
/*<       equivalence (v(1),vreal),(v(2),vimag) >*/
/*<       data titln / 8hnoise an, 8halysis  , 8h        , 8h         / >*/
/*<       data alsrb,alsrc,alsre,alsrs,alsrd / 2hrb,2hrc,2hre,2hrs,2hrd / >*/
/*<       data alsib,alsic,alsid,alsfn / 2hib,2hic,2hid,2hfn / >*/
/*<       data alstot / 5htotal / >*/
/*<       data aslash,ablnk / 1h/, 1h  / >*/
/*<       data afmt1 /8h(////,11,8hx,  (2x,,8ha8))    / >*/
/*<       data afmt2 /8h(1h0,a8,,8h1p  d10.,8h3)      / >*/


/* .. fix-up formats */
/*<       kntr=12 >*/
    kntr = 12;
/*<       if(lwidth.le.80) kntr=7 >*/
    if (miscel_1.lwidth <= 80) {
	kntr = 7;
    }
/*<       ipos=11 >*/
    ipos = 11;
/*<       call move(afmt1,ipos,ablnk,1,2) >*/
    move_(afmt1, &ipos, &ablnk, &c__1, &c__2);
/*<       call alfnum(kntr,afmt1,ipos) >*/
    alfnum_(&kntr, afmt1, &ipos);
/*<       ipos=11 >*/
    ipos = 11;
/*<       call move(afmt2,ipos,ablnk,1,2) >*/
    move_(afmt2, &ipos, &ablnk, &c__1, &c__2);
/*<       call alfnum(kntr,afmt2,ipos) >*/
    alfnum_(&kntr, afmt2, &ipos);
/*<       nprnt=0 >*/
    nprnt = 0;
/*<       freq=omega/twopi >*/
    freq = status_1.omega / knstnt_1.twopi;
/*<       if (icalc.ge.2) go to 10 >*/
    if (status_1.icalc >= 2) {
	goto L10;
    }
/*<       fourkt=4.0d0*charge*vt >*/
    fourkt = knstnt_1.charge * 4. * status_1.vt;
/*<       twoq=2.0d0*charge >*/
    twoq = knstnt_1.charge * 2.;
/*<       noposo=nodplc(nosout+2) >*/
    noposo = nodplc[ac_1.nosout + 1];
/*<       nonego=nodplc(nosout+3) >*/
    nonego = nodplc[ac_1.nosout + 2];
/*<       kntlim=lwidth/11 >*/
    kntlim = miscel_1.lwidth / 11;
/*<       nkntr=1 >*/
    nkntr = 1;
/*<    10 if (nosprt.eq.0) go to 30 >*/
L10:
    if (ac_1.nosprt == 0) {
	goto L30;
    }
/*<       if (nkntr.gt.icalc) go to 30 >*/
    if (nkntr > status_1.icalc) {
	goto L30;
    }
/*<       nprnt=1 >*/
    nprnt = 1;
/*<       nkntr=nkntr+nosprt >*/
    nkntr += ac_1.nosprt;
/*<       call title(0,lwidth,1,titln) >*/
    title_(&c__0, &miscel_1.lwidth, &c__1, titln);
/*<       write (iofile,16) freq >*/
    io__33.ciunit = status_1.iofile;
    s_wsfe(&io__33);
    do_fio(&c__1, (char *)&freq, (ftnlen)sizeof(doublereal));
    e_wsfe();
/*<    16 format('0    frequency = ',1pd10.3,' hz'/) >*/

/*  obtain adjoint circuit solution */

/*<    30 vnrms=0.0d0 >*/
L30:
    vnrms = 0.;
/*<       cval=cvalue(lcvn+noposo)-cvalue(lcvn+nonego) >*/
    i_1 = tabinf_1.lcvn + noposo - 1;
    i_2 = tabinf_1.lcvn + nonego - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vout=dsqrt(dble(vreal*vreal)+dble(vimag*vimag)) >*/
    vout = sqrt((doublereal) (*vreal * *vreal) + (doublereal) (*vimag * *
	    vimag));
/*<       vout=dmax1(vout,1.0d-20) >*/
    vout = max(vout,1e-20);
/*<       call zero8(value(lvn+1),nstop) >*/
    zero8_(&blank_1.value[tabinf_1.lvn], &cirdat_1.nstop);
/*<       call zero8(value(imvn+1),nstop) >*/
    zero8_(&blank_1.value[tabinf_1.imvn], &cirdat_1.nstop);
/*<       value(lvn+noposo)=-1.0d0 >*/
    blank_1.value[tabinf_1.lvn + noposo - 1] = -1.;
/*<       value(lvn+nonego)=+1.0d0 >*/
    blank_1.value[tabinf_1.lvn + nonego - 1] = 1.;
/*<       call acasol >*/
    acasol_();

/*  resistors */

/*<       if (jelcnt(1).eq.0) go to 200 >*/
    if (cirdat_1.jelcnt[0] == 0) {
	goto L200;
    }
/*<       ititle=0 >*/
    ititle = 0;
/*<    91 format(//'0**** resistor squared noise voltages (sq v/hz)') >*/
/* L91: */
/*<   100 loc=locate(1) >*/
/* L100: */
    loc = cirdat_1.locate[0];
/*<       kntr=0 >*/
    kntr = 0;
/*<   110 if ((loc.eq.0).or.(nodplc(loc+8).ne.0)) go to 130 >*/
L110:
    if (loc == 0 || nodplc[loc + 7] != 0) {
	goto L130;
    }
/*<       kntr=kntr+1 >*/
    ++kntr;
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       anam(kntr)=value(locv) >*/
    anam[kntr - 1] = blank_1.value[locv - 1];
/*<       node1=nodplc(loc+2) >*/
    node1 = nodplc[loc + 1];
/*<       node2=nodplc(loc+3) >*/
    node2 = nodplc[loc + 2];
/*<       cval=cvalue(lcvn+node1)-cvalue(lcvn+node2) >*/
    i_1 = tabinf_1.lcvn + node1 - 1;
    i_2 = tabinf_1.lcvn + node2 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vntot(kntr)=(dble(vreal*vreal)+dble(vimag*vimag)) >*/
/*<      1   *fourkt*value(locv+1) >*/
    vntot[kntr - 1] = ((doublereal) (*vreal * *vreal) + (doublereal) (*vimag *
	     *vimag)) * fourkt * blank_1.value[locv];
/*<       vnrms=vnrms+vntot(kntr) >*/
    vnrms += vntot[kntr - 1];
/*<       if (kntr.ge.kntlim) go to 140 >*/
    if (kntr >= kntlim) {
	goto L140;
    }
/*<   120 loc=nodplc(loc) >*/
L120:
    loc = nodplc[loc - 1];
/*<       go to 110 >*/
    goto L110;
/*<   130 if (kntr.eq.0) go to 200 >*/
L130:
    if (kntr == 0) {
	goto L200;
    }
/*<   140 if (nprnt.eq.0) go to 160 >*/
L140:
    if (nprnt == 0) {
	goto L160;
    }
/*<       if (ititle.eq.0) write (iofile,91) >*/
    if (ititle == 0) {
	io__43.ciunit = status_1.iofile;
	s_wsfe(&io__43);
	e_wsfe();
    }
/*<       ititle=1 >*/
    ititle = 1;
/*<       write (iofile,afmt1) (anam(i),i=1,kntr) >*/
    io__44.ciunit = status_1.iofile;
    s_wsfe(&io__44);
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&anam[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alstot,(vntot(i),i=1,kntr) >*/
    io__46.ciunit = status_1.iofile;
    s_wsfe(&io__46);
    do_fio(&c__1, (char *)&alstot, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vntot[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<   160 kntr=0 >*/
L160:
    kntr = 0;
/*<       if (loc.ne.0) go to 120 >*/
    if (loc != 0) {
	goto L120;
    }

/*  diodes */

/*<   200 if (jelcnt(11).eq.0) go to 300 >*/
L200:
    if (cirdat_1.jelcnt[10] == 0) {
	goto L300;
    }
/*<       ititle=0 >*/
    ititle = 0;
/*<   201 format(//'0**** diode squared noise voltages (sq v/hz)') >*/
/* L201: */
/*<   210 loc=locate(11) >*/
/* L210: */
    loc = cirdat_1.locate[10];
/*<       kntr=0 >*/
    kntr = 0;
/*<   220 if ((loc.eq.0).or.(nodplc(loc+16).ne.0)) go to 240 >*/
L220:
    if (loc == 0 || nodplc[loc + 15] != 0) {
	goto L240;
    }
/*<       kntr=kntr+1 >*/
    ++kntr;
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       anam(kntr)=value(locv) >*/
    anam[kntr - 1] = blank_1.value[locv - 1];
/*<       node1=nodplc(loc+2) >*/
    node1 = nodplc[loc + 1];
/*<       node2=nodplc(loc+3) >*/
    node2 = nodplc[loc + 2];
/*<       node3=nodplc(loc+4) >*/
    node3 = nodplc[loc + 3];
/*<       locm=nodplc(loc+5) >*/
    locm = nodplc[loc + 4];
/*<       locm=nodplc(locm+1) >*/
    locm = nodplc[locm];
/*<       loct=nodplc(loc+11) >*/
    loct = nodplc[loc + 10];
/*<       area=value(locv+1) >*/
    area = blank_1.value[locv];
/*<       fnk=value(locm+10) >*/
    fnk = blank_1.value[locm + 9];
/*<       fna=value(locm+11) >*/
    fna = blank_1.value[locm + 10];

/*  ohmic resistance */

/*<       cval=cvalue(lcvn+node1)-cvalue(lcvn+node3) >*/
    i_1 = tabinf_1.lcvn + node1 - 1;
    i_2 = tabinf_1.lcvn + node3 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vno1(kntr)=(dble(vreal*vreal)+dble(vimag*vimag)) >*/
/*<      1   *fourkt*value(locm+2)*area >*/
    vno1[kntr - 1] = ((doublereal) (*vreal * *vreal) + (doublereal) (*vimag * 
	    *vimag)) * fourkt * blank_1.value[locm + 1] * area;

/*  junction shot noise and flicker noise */

/*<       cval=cvalue(lcvn+node3)-cvalue(lcvn+node2) >*/
    i_1 = tabinf_1.lcvn + node3 - 1;
    i_2 = tabinf_1.lcvn + node2 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vtemp=dble(vreal*vreal)+dble(vimag*vimag) >*/
    vtemp = (doublereal) (*vreal * *vreal) + (doublereal) (*vimag * *vimag);
/*<       arg=dmax1(dabs(value(lx0+loct+1)),1.0d-20) >*/
/* Computing MAX */
    d_2 = (d_1 = blank_1.value[tabinf_1.lx0 + loct], abs(d_1));
    arg = max(1e-20,d_2);
/*<       vno2(kntr)=vtemp*twoq*arg >*/
    vno2[kntr - 1] = vtemp * twoq * arg;
/*<       vno3(kntr)=vtemp*fnk*dexp(fna*dlog(arg))/freq >*/
    vno3[kntr - 1] = vtemp * fnk * exp(fna * log(arg)) / freq;
/*<       vntot(kntr)=vno1(kntr)+vno2(kntr)+vno3(kntr) >*/
    vntot[kntr - 1] = vno1[kntr - 1] + vno2[kntr - 1] + vno3[kntr - 1];
/*<       vnrms=vnrms+vntot(kntr) >*/
    vnrms += vntot[kntr - 1];
/*<       if (kntr.ge.kntlim) go to 250 >*/
    if (kntr >= kntlim) {
	goto L250;
    }
/*<   230 loc=nodplc(loc) >*/
L230:
    loc = nodplc[loc - 1];
/*<       go to 220 >*/
    goto L220;
/*<   240 if (kntr.eq.0) go to 300 >*/
L240:
    if (kntr == 0) {
	goto L300;
    }
/*<   250 if (nprnt.eq.0) go to 260 >*/
L250:
    if (nprnt == 0) {
	goto L260;
    }
/*<       if (ititle.eq.0) write (iofile,201) >*/
    if (ititle == 0) {
	io__58.ciunit = status_1.iofile;
	s_wsfe(&io__58);
	e_wsfe();
    }
/*<       ititle=1 >*/
    ititle = 1;
/*<       write (iofile,afmt1) (anam(i),i=1,kntr) >*/
    io__59.ciunit = status_1.iofile;
    s_wsfe(&io__59);
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&anam[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsrs,(vno1(i),i=1,kntr) >*/
    io__60.ciunit = status_1.iofile;
    s_wsfe(&io__60);
    do_fio(&c__1, (char *)&alsrs, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno1[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsid,(vno2(i),i=1,kntr) >*/
    io__61.ciunit = status_1.iofile;
    s_wsfe(&io__61);
    do_fio(&c__1, (char *)&alsid, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno2[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsfn,(vno3(i),i=1,kntr) >*/
    io__62.ciunit = status_1.iofile;
    s_wsfe(&io__62);
    do_fio(&c__1, (char *)&alsfn, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno3[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alstot,(vntot(i),i=1,kntr) >*/
    io__63.ciunit = status_1.iofile;
    s_wsfe(&io__63);
    do_fio(&c__1, (char *)&alstot, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vntot[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<   260 kntr=0 >*/
L260:
    kntr = 0;
/*<       if (loc.ne.0) go to 230 >*/
    if (loc != 0) {
	goto L230;
    }

/*  bipolar junction transistors */

/*<   300 if (jelcnt(12).eq.0) go to 400 >*/
L300:
    if (cirdat_1.jelcnt[11] == 0) {
	goto L400;
    }
/*<       ititle=0 >*/
    ititle = 0;
/*<   301 format(//'0**** transistor squared noise voltages (sq v/hz)') >*/
/* L301: */
/*<   310 loc=locate(12) >*/
/* L310: */
    loc = cirdat_1.locate[11];
/*<       kntr=0 >*/
    kntr = 0;
/*<   320 if ((loc.eq.0).or.(nodplc(loc+36).ne.0)) go to 340 >*/
L320:
    if (loc == 0 || nodplc[loc + 35] != 0) {
	goto L340;
    }
/*<       kntr=kntr+1 >*/
    ++kntr;
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       anam(kntr)=value(locv) >*/
    anam[kntr - 1] = blank_1.value[locv - 1];
/*<       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];
/*<       node5=nodplc(loc+6) >*/
    node5 = nodplc[loc + 5];
/*<       node6=nodplc(loc+7) >*/
    node6 = nodplc[loc + 6];
/*<       locm=nodplc(loc+8) >*/
    locm = nodplc[loc + 7];
/*<       locm=nodplc(locm+1) >*/
    locm = nodplc[locm];
/*<       loct=nodplc(loc+22) >*/
    loct = nodplc[loc + 21];
/*<       area=value(locv+1) >*/
    area = blank_1.value[locv];
/*<       fnk=value(locm+44) >*/
    fnk = blank_1.value[locm + 43];
/*<       fna=value(locm+45) >*/
    fna = blank_1.value[locm + 44];

/*  extrinsic resistances */

/* ...  base resistance */
/*<       cval=cvalue(lcvn+node2)-cvalue(lcvn+node5) >*/
    i_1 = tabinf_1.lcvn + node2 - 1;
    i_2 = tabinf_1.lcvn + node5 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vno1(kntr)=(dble(vreal*vreal)+dble(vimag*vimag)) >*/
/*<      1  *fourkt*value(lx0+loct+16) >*/
    vno1[kntr - 1] = ((doublereal) (*vreal * *vreal) + (doublereal) (*vimag * 
	    *vimag)) * fourkt * blank_1.value[tabinf_1.lx0 + loct + 15];
/* ...  collector resistance */
/*<       cval=cvalue(lcvn+node1)-cvalue(lcvn+node4) >*/
    i_1 = tabinf_1.lcvn + node1 - 1;
    i_2 = tabinf_1.lcvn + node4 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vno2(kntr)=(dble(vreal*vreal)+dble(vimag*vimag)) >*/
/*<      1   *fourkt*value(locm+20)*area >*/
    vno2[kntr - 1] = ((doublereal) (*vreal * *vreal) + (doublereal) (*vimag * 
	    *vimag)) * fourkt * blank_1.value[locm + 19] * area;
/* ...  emitter resistance */
/*<       cval=cvalue(lcvn+node3)-cvalue(lcvn+node6) >*/
    i_1 = tabinf_1.lcvn + node3 - 1;
    i_2 = tabinf_1.lcvn + node6 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vno3(kntr)=(dble(vreal*vreal)+dble(vimag*vimag)) >*/
/*<      1   *fourkt*value(locm+19)*area >*/
    vno3[kntr - 1] = ((doublereal) (*vreal * *vreal) + (doublereal) (*vimag * 
	    *vimag)) * fourkt * blank_1.value[locm + 18] * area;

/*  base current shot noise and flicker noise */

/*<       cval=cvalue(lcvn+node5)-cvalue(lcvn+node6) >*/
    i_1 = tabinf_1.lcvn + node5 - 1;
    i_2 = tabinf_1.lcvn + node6 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vtemp=dble(vreal*vreal)+dble(vimag*vimag) >*/
    vtemp = (doublereal) (*vreal * *vreal) + (doublereal) (*vimag * *vimag);
/*<       arg=dmax1(dabs(value(lx0+loct+3)),1.0d-20) >*/
/* Computing MAX */
    d_2 = (d_1 = blank_1.value[tabinf_1.lx0 + loct + 2], abs(d_1));
    arg = max(1e-20,d_2);
/*<       vno4(kntr)=vtemp*twoq*arg >*/
    vno4[kntr - 1] = vtemp * twoq * arg;
/*<       vno5(kntr)=vtemp*fnk*dexp(fna*dlog(arg))/freq >*/
    vno5[kntr - 1] = vtemp * fnk * exp(fna * log(arg)) / freq;

/*  collector current shot noise */

/*<       cval=cvalue(lcvn+node4)-cvalue(lcvn+node6) >*/
    i_1 = tabinf_1.lcvn + node4 - 1;
    i_2 = tabinf_1.lcvn + node6 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vno6(kntr)=(dble(vreal*vreal)+dble(vimag*vimag)) >*/
/*<      1   *twoq*dabs(value(lx0+loct+2)) >*/
    vno6[kntr - 1] = ((doublereal) (*vreal * *vreal) + (doublereal) (*vimag * 
	    *vimag)) * twoq * (d_1 = blank_1.value[tabinf_1.lx0 + loct + 1], 
	    abs(d_1));
/*<       vntot(kntr)=vno1(kntr)+vno2(kntr)+vno3(kntr)+vno4(kntr)+vno5(kntr) >*/
/*<      1   +vno6(kntr) >*/
    vntot[kntr - 1] = vno1[kntr - 1] + vno2[kntr - 1] + vno3[kntr - 1] + vno4[
	    kntr - 1] + vno5[kntr - 1] + vno6[kntr - 1];
/*<       vnrms=vnrms+vntot(kntr) >*/
    vnrms += vntot[kntr - 1];
/*<       if (kntr.ge.kntlim) go to 350 >*/
    if (kntr >= kntlim) {
	goto L350;
    }
/*<   330 loc=nodplc(loc) >*/
L330:
    loc = nodplc[loc - 1];
/*<       go to 320 >*/
    goto L320;
/*<   340 if (kntr.eq.0) go to 400 >*/
L340:
    if (kntr == 0) {
	goto L400;
    }
/*<   350 if (nprnt.eq.0) go to 360 >*/
L350:
    if (nprnt == 0) {
	goto L360;
    }
/*<       if (ititle.eq.0) write (iofile,301) >*/
    if (ititle == 0) {
	io__70.ciunit = status_1.iofile;
	s_wsfe(&io__70);
	e_wsfe();
    }
/*<       ititle=1 >*/
    ititle = 1;
/*<       write (iofile,afmt1) (anam(i),i=1,kntr) >*/
    io__71.ciunit = status_1.iofile;
    s_wsfe(&io__71);
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&anam[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsrb,(vno1(i),i=1,kntr) >*/
    io__72.ciunit = status_1.iofile;
    s_wsfe(&io__72);
    do_fio(&c__1, (char *)&alsrb, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno1[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsrc,(vno2(i),i=1,kntr) >*/
    io__73.ciunit = status_1.iofile;
    s_wsfe(&io__73);
    do_fio(&c__1, (char *)&alsrc, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno2[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsre,(vno3(i),i=1,kntr) >*/
    io__74.ciunit = status_1.iofile;
    s_wsfe(&io__74);
    do_fio(&c__1, (char *)&alsre, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno3[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsib,(vno4(i),i=1,kntr) >*/
    io__75.ciunit = status_1.iofile;
    s_wsfe(&io__75);
    do_fio(&c__1, (char *)&alsib, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno4[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsic,(vno6(i),i=1,kntr) >*/
    io__76.ciunit = status_1.iofile;
    s_wsfe(&io__76);
    do_fio(&c__1, (char *)&alsic, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno6[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsfn,(vno5(i),i=1,kntr) >*/
    io__77.ciunit = status_1.iofile;
    s_wsfe(&io__77);
    do_fio(&c__1, (char *)&alsfn, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno5[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alstot,(vntot(i),i=1,kntr) >*/
    io__78.ciunit = status_1.iofile;
    s_wsfe(&io__78);
    do_fio(&c__1, (char *)&alstot, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vntot[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<   360 kntr=0 >*/
L360:
    kntr = 0;
/*<       if (loc.ne.0) go to 330 >*/
    if (loc != 0) {
	goto L330;
    }

/*  jfets */

/*<   400 if (jelcnt(13).eq.0) go to 500 >*/
L400:
    if (cirdat_1.jelcnt[12] == 0) {
	goto L500;
    }
/*<       ititle=0 >*/
    ititle = 0;
/*<   401 format(//'0**** jfet squared noise voltages (sq v/hz)') >*/
/* L401: */
/*<   410 loc=locate(13) >*/
/* L410: */
    loc = cirdat_1.locate[12];
/*<       kntr=0 >*/
    kntr = 0;
/*<   420 if ((loc.eq.0).or.(nodplc(loc+25).ne.0)) go to 440 >*/
L420:
    if (loc == 0 || nodplc[loc + 24] != 0) {
	goto L440;
    }
/*<       kntr=kntr+1 >*/
    ++kntr;
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       anam(kntr)=value(locv) >*/
    anam[kntr - 1] = blank_1.value[locv - 1];
/*<       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];
/*<       node5=nodplc(loc+6) >*/
    node5 = nodplc[loc + 5];
/*<       locm=nodplc(loc+7) >*/
    locm = nodplc[loc + 6];
/*<       locm=nodplc(locm+1) >*/
    locm = nodplc[locm];
/*<       loct=nodplc(loc+19) >*/
    loct = nodplc[loc + 18];
/*<       area=value(locv+1) >*/
    area = blank_1.value[locv];
/*<       fnk=value(locm+10) >*/
    fnk = blank_1.value[locm + 9];
/*<       fna=value(locm+11) >*/
    fna = blank_1.value[locm + 10];

/*  extrinsic resistances */

/* ...  drain resistance */
/*<       cval=cvalue(lcvn+node1)-cvalue(lcvn+node4) >*/
    i_1 = tabinf_1.lcvn + node1 - 1;
    i_2 = tabinf_1.lcvn + node4 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vno1(kntr)=(dble(vreal*vreal)+dble(vimag*vimag)) >*/
/*<      1   *fourkt*value(locm+4)*area >*/
    vno1[kntr - 1] = ((doublereal) (*vreal * *vreal) + (doublereal) (*vimag * 
	    *vimag)) * fourkt * blank_1.value[locm + 3] * area;
/* ...  source resistance */
/*<       cval=cvalue(lcvn+node3)-cvalue(lcvn+node5) >*/
    i_1 = tabinf_1.lcvn + node3 - 1;
    i_2 = tabinf_1.lcvn + node5 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vno2(kntr)=(dble(vreal*vreal)+dble(vimag*vimag)) >*/
/*<      1   *fourkt*value(locm+5)*area >*/
    vno2[kntr - 1] = ((doublereal) (*vreal * *vreal) + (doublereal) (*vimag * 
	    *vimag)) * fourkt * blank_1.value[locm + 4] * area;

/*  drain current shot noise and flicker noise */

/*<       cval=cvalue(lcvn+node4)-cvalue(lcvn+node5) >*/
    i_1 = tabinf_1.lcvn + node4 - 1;
    i_2 = tabinf_1.lcvn + node5 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vtemp=dble(vreal*vreal)+dble(vimag*vimag) >*/
    vtemp = (doublereal) (*vreal * *vreal) + (doublereal) (*vimag * *vimag);
/*<       vno3(kntr)=vtemp*fourkt*2.0d0*dabs(value(lx0+loct+5))/3.0d0 >*/
    vno3[kntr - 1] = vtemp * fourkt * 2. * (d_1 = blank_1.value[tabinf_1.lx0 
	    + loct + 4], abs(d_1)) / 3.;
/*<       arg=dmax1(dabs(value(lx0+loct+3)),1.0d-20) >*/
/* Computing MAX */
    d_2 = (d_1 = blank_1.value[tabinf_1.lx0 + loct + 2], abs(d_1));
    arg = max(1e-20,d_2);
/*<       vno4(kntr)=vtemp*fnk*dexp(fna*dlog(arg))/freq >*/
    vno4[kntr - 1] = vtemp * fnk * exp(fna * log(arg)) / freq;
/*<       vntot(kntr)=vno1(kntr)+vno2(kntr)+vno3(kntr)+vno4(kntr) >*/
    vntot[kntr - 1] = vno1[kntr - 1] + vno2[kntr - 1] + vno3[kntr - 1] + vno4[
	    kntr - 1];
/*<       vnrms=vnrms+vntot(kntr) >*/
    vnrms += vntot[kntr - 1];
/*<       if (kntr.ge.kntlim) go to 450 >*/
    if (kntr >= kntlim) {
	goto L450;
    }
/*<   430 loc=nodplc(loc) >*/
L430:
    loc = nodplc[loc - 1];
/*<       go to 420 >*/
    goto L420;
/*<   440 if (kntr.eq.0) go to 500 >*/
L440:
    if (kntr == 0) {
	goto L500;
    }
/*<   450 if (nprnt.eq.0) go to 460 >*/
L450:
    if (nprnt == 0) {
	goto L460;
    }
/*<       if (ititle.eq.0) write (iofile,401) >*/
    if (ititle == 0) {
	io__79.ciunit = status_1.iofile;
	s_wsfe(&io__79);
	e_wsfe();
    }
/*<       ititle=1 >*/
    ititle = 1;
/*<       write (iofile,afmt1) (anam(i),i=1,kntr) >*/
    io__80.ciunit = status_1.iofile;
    s_wsfe(&io__80);
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&anam[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsrd,(vno1(i),i=1,kntr) >*/
    io__81.ciunit = status_1.iofile;
    s_wsfe(&io__81);
    do_fio(&c__1, (char *)&alsrd, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno1[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsrs,(vno2(i),i=1,kntr) >*/
    io__82.ciunit = status_1.iofile;
    s_wsfe(&io__82);
    do_fio(&c__1, (char *)&alsrs, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno2[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsid,(vno3(i),i=1,kntr) >*/
    io__83.ciunit = status_1.iofile;
    s_wsfe(&io__83);
    do_fio(&c__1, (char *)&alsid, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno3[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsfn,(vno4(i),i=1,kntr) >*/
    io__84.ciunit = status_1.iofile;
    s_wsfe(&io__84);
    do_fio(&c__1, (char *)&alsfn, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno4[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alstot,(vntot(i),i=1,kntr) >*/
    io__85.ciunit = status_1.iofile;
    s_wsfe(&io__85);
    do_fio(&c__1, (char *)&alstot, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vntot[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<   460 kntr=0 >*/
L460:
    kntr = 0;
/*<       if (loc.ne.0) go to 430 >*/
    if (loc != 0) {
	goto L430;
    }

/*  mosfets */

/*<   500 if (jelcnt(14).eq.0) go to 600 >*/
L500:
    if (cirdat_1.jelcnt[13] == 0) {
	goto L600;
    }
/*<       ititle=0 >*/
    ititle = 0;
/*<   501 format(//'0**** mosfet squared noise voltages (sq v/hz)') >*/
/* L501: */
/*<   510 loc=locate(14) >*/
/* L510: */
    loc = cirdat_1.locate[13];
/*<       kntr=0 >*/
    kntr = 0;
/*<   520 if ((loc.eq.0).or.(nodplc(loc+33).ne.0)) go to 540 >*/
L520:
    if (loc == 0 || nodplc[loc + 32] != 0) {
	goto L540;
    }
/*<       kntr=kntr+1 >*/
    ++kntr;
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       anam(kntr)=value(locv) >*/
    anam[kntr - 1] = blank_1.value[locv - 1];
/*<       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];
/*<       node5=nodplc(loc+6) >*/
    node5 = nodplc[loc + 5];
/*<       node6=nodplc(loc+7) >*/
    node6 = nodplc[loc + 6];
/*<       locm=nodplc(loc+8) >*/
    locm = nodplc[loc + 7];
/*<       itype=nodplc(locm+2) >*/
    itype = nodplc[locm + 1];
/*<       loct=nodplc(loc+26) >*/
    loct = nodplc[loc + 25];
/*<       locm=nodplc(locm+1) >*/
    locm = nodplc[locm];
/*<       xl=value(locv+1)-2.0d0*value(locm+28) >*/
    xl = blank_1.value[locv] - blank_1.value[locm + 27] * 2.;
/*<       xw=value(locv+2) >*/
    xw = blank_1.value[locv + 1];
/*<       cox=value(locm+22) >*/
    cox = blank_1.value[locm + 21];
/*<       if (cox.le.0.0d0) cox=epsox/1.0d-7 >*/
    if (cox <= 0.) {
	cox = knstnt_1.epsox / 1e-7;
    }
/*<       fnk=value(locm+36) >*/
    fnk = blank_1.value[locm + 35];
/*<       fna=value(locm+37) >*/
    fna = blank_1.value[locm + 36];

/*  extrinsic resistances */

/*<       if ((value(locm+7).le.0.0d0).and. >*/
/*<      1   (value(locm+8).le.0.0d0)) go to 522 >*/
    if (blank_1.value[locm + 6] <= 0. && blank_1.value[locm + 7] <= 0.) {
	goto L522;
    }
/*<       gdpr=value(locm+7) >*/
    gdpr = blank_1.value[locm + 6];
/*<       gspr=value(locm+8) >*/
    gspr = blank_1.value[locm + 7];
/*<       go to 524 >*/
    goto L524;
/*<   522 gdpr=value(locm+16)/value(locv+13) >*/
L522:
    gdpr = blank_1.value[locm + 15] / blank_1.value[locv + 12];
/*<       gspr=value(locm+16)/value(locv+14) >*/
    gspr = blank_1.value[locm + 15] / blank_1.value[locv + 13];
/* ...  drain resistance */
/*<   524 cval=cvalue(lcvn+node1)-cvalue(lcvn+node5) >*/
L524:
    i_1 = tabinf_1.lcvn + node1 - 1;
    i_2 = tabinf_1.lcvn + node5 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vno1(kntr)=(dble(vreal*vreal)+dble(vimag*vimag))*fourkt*gdpr >*/
    vno1[kntr - 1] = ((doublereal) (*vreal * *vreal) + (doublereal) (*vimag * 
	    *vimag)) * fourkt * gdpr;
/* ...  source resistance */
/*<       cval=cvalue(lcvn+node3)-cvalue(lcvn+node6) >*/
    i_1 = tabinf_1.lcvn + node3 - 1;
    i_2 = tabinf_1.lcvn + node6 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vno2(kntr)=(dble(vreal*vreal)+dble(vimag*vimag))*fourkt*gspr >*/
    vno2[kntr - 1] = ((doublereal) (*vreal * *vreal) + (doublereal) (*vimag * 
	    *vimag)) * fourkt * gspr;

/*  drain current shot noise and flicker noise */

/*<       cval=cvalue(lcvn+node5)-cvalue(lcvn+node6) >*/
    i_1 = tabinf_1.lcvn + node5 - 1;
    i_2 = tabinf_1.lcvn + node6 - 1;
    q_1.r = cvalue[i_1].r - cvalue[i_2].r, q_1.i = cvalue[i_1].i - cvalue[i_2]
	    .i;
    cval->r = q_1.r, cval->i = q_1.i;
/*<       vtemp=dble(vreal*vreal)+dble(vimag*vimag) >*/
    vtemp = (doublereal) (*vreal * *vreal) + (doublereal) (*vimag * *vimag);
/*<       gm=value(lx0+loct+7) >*/
    gm = blank_1.value[tabinf_1.lx0 + loct + 6];
/*<       arg=dmax1(dabs(value(lx0+loct+4)),1.0d-20) >*/
/* Computing MAX */
    d_2 = (d_1 = blank_1.value[tabinf_1.lx0 + loct + 3], abs(d_1));
    arg = max(1e-20,d_2);
/*<       vno3(kntr)=vtemp*fourkt*dabs(gm)/1.5d0 >*/
    vno3[kntr - 1] = vtemp * fourkt * abs(gm) / 1.5;
/*<       vno4(kntr)=vtemp*fnk*dexp(fna*dlog(arg))/(freq*cox*xl*xl) >*/
    vno4[kntr - 1] = vtemp * fnk * exp(fna * log(arg)) / (freq * cox * xl * 
	    xl);
/*<   525 vntot(kntr)=vno1(kntr)+vno2(kntr)+vno3(kntr)+vno4(kntr) >*/
/* L525: */
    vntot[kntr - 1] = vno1[kntr - 1] + vno2[kntr - 1] + vno3[kntr - 1] + vno4[
	    kntr - 1];
/*<       vnrms=vnrms+vntot(kntr) >*/
    vnrms += vntot[kntr - 1];
/*<       if (kntr.ge.kntlim) go to 550 >*/
    if (kntr >= kntlim) {
	goto L550;
    }
/*<   530 loc=nodplc(loc) >*/
L530:
    loc = nodplc[loc - 1];
/*<       go to 520 >*/
    goto L520;
/*<   540 if (kntr.eq.0) go to 600 >*/
L540:
    if (kntr == 0) {
	goto L600;
    }
/*<   550 if (nprnt.eq.0) go to 560 >*/
L550:
    if (nprnt == 0) {
	goto L560;
    }
/*<       if (ititle.eq.0) write (iofile,501) >*/
    if (ititle == 0) {
	io__93.ciunit = status_1.iofile;
	s_wsfe(&io__93);
	e_wsfe();
    }
/*<       ititle=1 >*/
    ititle = 1;
/*<       write (iofile,afmt1) (anam(i),i=1,kntr) >*/
    io__94.ciunit = status_1.iofile;
    s_wsfe(&io__94);
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&anam[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsrd,(vno1(i),i=1,kntr) >*/
    io__95.ciunit = status_1.iofile;
    s_wsfe(&io__95);
    do_fio(&c__1, (char *)&alsrd, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno1[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsrs,(vno2(i),i=1,kntr) >*/
    io__96.ciunit = status_1.iofile;
    s_wsfe(&io__96);
    do_fio(&c__1, (char *)&alsrs, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno2[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsid,(vno3(i),i=1,kntr) >*/
    io__97.ciunit = status_1.iofile;
    s_wsfe(&io__97);
    do_fio(&c__1, (char *)&alsid, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno3[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alsfn,(vno4(i),i=1,kntr) >*/
    io__98.ciunit = status_1.iofile;
    s_wsfe(&io__98);
    do_fio(&c__1, (char *)&alsfn, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vno4[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<       write (iofile,afmt2) alstot,(vntot(i),i=1,kntr) >*/
    io__99.ciunit = status_1.iofile;
    s_wsfe(&io__99);
    do_fio(&c__1, (char *)&alstot, (ftnlen)sizeof(doublereal));
    i_1 = kntr;
    for (i = 1; i <= i_1; ++i) {
	do_fio(&c__1, (char *)&vntot[i - 1], (ftnlen)sizeof(doublereal));
    }
    e_wsfe();
/*<   560 kntr=0 >*/
L560:
    kntr = 0;
/*<       if (loc.ne.0) go to 530 >*/
    if (loc != 0) {
	goto L530;
    }

/*  compute equivalent input noise voltage */

/*<   600 vnout=dsqrt(vnrms) >*/
L600:
    vnout = sqrt(vnrms);
/*<       vnin=vnout/vout >*/
    vnin = vnout / vout;
/*<       if (nprnt.eq.0) go to 620 >*/
    if (nprnt == 0) {
	goto L620;
    }
/*<       do 610 i=1,5 >*/
    for (i = 1; i <= 5; ++i) {
/*<       string(i)=ablnk >*/
	string[i - 1] = ablnk;
/*<   610 continue >*/
/* L610: */
    }
/*<       ioutyp=1 >*/
    ioutyp = 1;
/*<       ipos=1 >*/
    ipos = 1;
/*<       call outnam(nosout,ioutyp,string,ipos) >*/
    outnam_(&ac_1.nosout, &ioutyp, string, &ipos);
/*<       call move(string,ipos,aslash,1,1) >*/
    move_(string, &ipos, &aslash, &c__1, &c__1);
/*<       ipos=ipos+1 >*/
    ++ipos;
/*<       locv=nodplc(nosin+1) >*/
    locv = nodplc[ac_1.nosin];
/*<       anam1=value(locv) >*/
    anam1 = blank_1.value[locv - 1];
/*<       call move(string,ipos,anam1,1,8) >*/
    move_(string, &ipos, &anam1, &c__1, &c__8);
/*<       write (iofile,611) vnrms,vnout,string,vout,anam1,vnin >*/
    io__105.ciunit = status_1.iofile;
    s_wsfe(&io__105);
    do_fio(&c__1, (char *)&vnrms, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&vnout, (ftnlen)sizeof(doublereal));
    do_fio(&c__5, (char *)&string[0], (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&vout, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&anam1, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&vnin, (ftnlen)sizeof(doublereal));
    e_wsfe();
/*<   611 format(////, >*/
/*<      1   '0**** total output noise voltage',9x,'= ',1pd10.3,' sq v/hz'/, >*/
/*<      2   1h0,40x,'= ',d10.3,' v/rt hz'/, >*/
/*<      3   '0     transfer function value:',/, >*/
/*<      4   1h0,7x,4a8,a1,'= ',d10.3,/, >*/
/*<      5   '0     equivalent input noise at ',a8,' = ',d10.3,' /rt hz') >*/

/*  save noise outputs */

/*<   620 loc=locate(44) >*/
L620:
    loc = cirdat_1.locate[43];
/*<   630 if (loc.eq.0) go to 1000 >*/
L630:
    if (loc == 0) {
	goto L1000;
    }
/*<       iseq=nodplc(loc+4) >*/
    tabinf_1.iseq = nodplc[loc + 3];
/*<       if (nodplc(loc+5).ne.2) go to 640 >*/
    if (nodplc[loc + 4] != 2) {
	goto L640;
    }
/*<       cvalue(loco+iseq)=vnout >*/
    i_1 = *loco + tabinf_1.iseq - 1;
    cvalue[i_1].r = vnout, cvalue[i_1].i = (float)0.;
/*<       go to 650 >*/
    goto L650;
/*<   640 cvalue(loco+iseq)=vnin >*/
L640:
    i_1 = *loco + tabinf_1.iseq - 1;
    cvalue[i_1].r = vnin, cvalue[i_1].i = (float)0.;
/*<   650 loc=nodplc(loc) >*/
L650:
    loc = nodplc[loc - 1];
/*<       go to 630 >*/
    goto L630;

/*  finished */

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

#undef cvalue
#undef nodplc
#undef vreal
#undef vimag
#undef v
#undef c
#undef cval
#undef alsrb
#undef titln
#undef afmt2
#undef afmt1
#undef ablnk
#undef aslash
#undef alstot
#undef alsfn
#undef alsid
#undef alsic
#undef alsib
#undef alsrd
#undef alsrs
#undef alsre
#undef alsrc


