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

#define miscel_1 miscel_

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

/*<       subroutine tmpupd >*/
/* Subroutine */ int tmpupd_()
{
    /* Initialized data */

    static struct {
	char e_1[32];
	doublereal e_2;
	} equiv_64 = { {'t', 'e', 'm', 'p', 'e', 'r', 'a', 't', 'u', 'r', 'e',
		 '-', 'a', 'd', 'j', 'u', 's', 't', 'e', 'd', ' ', 'v', 'a', 
		'l', 'u', 'e', 's', ' ', ' ', ' ', ' ', ' '}, 0. };

#define tmptit ((doublereal *)&equiv_64)


    /* Format strings */
    static char fmt_21[] = "(//\0020**** resistors\002,/,\0020name\002,8x\
,\002value\002,//)";
    static char fmt_31[] = "(1x,a8,1p6d11.3)";
    static char fmt_101[] = "(//\0020**** diode model parameters\002,/,\0020\
name\002,9x,\002is\002,9x,\002vj\002,8x,\002cjo\002,//)";
    static char fmt_201[] = "(//\0020**** bjt model parameters\002,/,\0020na\
me\002,9x,\002js\002,8x,\002bf \002,7x,\002ise\002,7x,\002br \002,7x,\002is\
c\002,7x,\002vje\002,7x,\002cje\002,7x,\002vjc\002,7x,\002cjc\002,//)";
    static char fmt_211[] = "(1x,a8,1p9d10.3)";
    static char fmt_301[] = "(//\0020**** jfet model parameters\002,/,\0020n\
ame\002,9x,\002is\002,9x,\002pb\002,8x,\002cgs\002,8x,\002cgd\002,//)";
    static char fmt_401[] = "(//\0020**** mosfet model parameters\002,/,\002\
0name\002,8x,\002vto\002,8x,\002phi\002,9x,\002pb\002,7x,\002is(js)\002,7x\
,\002kp\002,9x,\002uo\002//)";

    /* System generated locals */
    doublereal d_1, d_2;

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

    /* Local variables */
    static doublereal delt, csat, phio;
    static integer locv;
    static doublereal rnew, type, fact1, fact2, temp1, temp2, oldeg, oldpb, 
	    dtemp, pbrat, ratio, oldvt;
    extern /* Subroutine */ int title_();
    static integer iprnt;
    static doublereal egfet1, pbfat1, ratio1, ratio4, tb, cjfact, pbfact, 
	    bfactr, oldcjf, gmaold, xn;
#define nodplc ((integer *)&blank_1)
#define cvalue ((complex *)&blank_1)
    static doublereal reftmp, ratlog, deltsq, vt1;
    static integer ititle;
    static doublereal tc1, tc2, factor, gmanew, factln, oldphi, arg, coeold, 
	    coenew;
    static integer loc;
    static doublereal vfb, pbo, phi, vte, xkt, arg1, xkt1;

    /* Fortran I/O blocks */
    static cilist io__30 = { 0, 0, 0, fmt_21, 0 };
    static cilist io__32 = { 0, 0, 0, fmt_31, 0 };
    static cilist io__33 = { 0, 0, 0, fmt_101, 0 };
    static cilist io__42 = { 0, 0, 0, fmt_31, 0 };
    static cilist io__43 = { 0, 0, 0, fmt_201, 0 };
    static cilist io__47 = { 0, 0, 0, fmt_211, 0 };
    static cilist io__48 = { 0, 0, 0, fmt_301, 0 };
    static cilist io__51 = { 0, 0, 0, fmt_31, 0 };
    static cilist io__54 = { 0, 0, 0, fmt_401, 0 };
    static cilist io__63 = { 0, 0, 0, fmt_31, 0 };


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

/*     this routine updates the temperature-dependent parameters in the */

/* device models.  it also updates the values of temperature-dependent */
/* resistors.  the updated values are printed. */

/* 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=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=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=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 tmptit(4) >*/
/*<       data tmptit / 8htemperat, 8hure-adju, 8hsted val, 8hues      / >*/


/*<       reftmp=27.0d0+ctok >*/
    reftmp = knstnt_1.ctok + 27.;
/*<       temp1=value(itemps+itemno-1)+ctok >*/
    temp1 = blank_1.value[tabinf_1.itemps + status_1.itemno - 2] + 
	    knstnt_1.ctok;
/*<       temp2=value(itemps+itemno)+ctok >*/
    temp2 = blank_1.value[tabinf_1.itemps + status_1.itemno - 1] + 
	    knstnt_1.ctok;
/*<       xkt=boltz*temp2 >*/
    xkt = knstnt_1.boltz * temp2;
/*<       oldvt=vt >*/
    oldvt = status_1.vt;
/*<       vt=xkt/charge >*/
    status_1.vt = xkt / knstnt_1.charge;
/*<       oldeg=egfet >*/
    oldeg = status_1.egfet;
/*<       egfet=1.16d0-(7.02d-4*temp2*temp2)/(temp2+1108.0d0) >*/
    status_1.egfet = 1.16 - temp2 * 7.02e-4 * temp2 / (temp2 + 1108.);
/*<       arg=-egfet/(xkt+xkt)+1.1150877d0/(boltz*(reftmp+reftmp)) >*/
    arg = -status_1.egfet / (xkt + xkt) + 1.1150877 / (knstnt_1.boltz * (
	    reftmp + reftmp));
/*<       ratio=temp2/temp1 >*/
    ratio = temp2 / temp1;
/*<       ratlog=dlog(ratio) >*/
    ratlog = log(ratio);
/*<       ratio1=ratio-1.0d0 >*/
    ratio1 = ratio - 1.;
/*<       dtemp=temp2-reftmp >*/
    dtemp = temp2 - reftmp;
/*<       delt=value(itemps+itemno)-value(itemps+1) >*/
    delt = blank_1.value[tabinf_1.itemps + status_1.itemno - 1] - 
	    blank_1.value[tabinf_1.itemps];
/*<       deltsq=delt*delt >*/
    deltsq = delt * delt;
/*<       fact2=temp2/reftmp >*/
    fact2 = temp2 / reftmp;
/*<       xni=1.45d16*fact2*dsqrt(fact2)*dexp(charge*arg) >*/
    status_1.xni = fact2 * 1.45e16 * sqrt(fact2) * exp(knstnt_1.charge * arg);

/*<       pbfact=-2*vt*(1.5d0*dlog(fact2)+charge*arg) >*/
    pbfact = status_1.vt * -2 * (log(fact2) * 1.5 + knstnt_1.charge * arg);
/*<       xkt1=boltz*temp1 >*/
    xkt1 = knstnt_1.boltz * temp1;
/*<       vt1=xkt1/charge >*/
    vt1 = xkt1 / knstnt_1.charge;
/*<       egfet1=1.16d0-(7.02d-4*temp1*temp1)/(temp1+1108.0d0) >*/
    egfet1 = 1.16 - temp1 * 7.02e-4 * temp1 / (temp1 + 1108.);
/*<       arg1=-egfet1/(xkt1+xkt1)+1.1150877d0/(boltz*(reftmp+reftmp)) >*/
    arg1 = -egfet1 / (xkt1 + xkt1) + 1.1150877 / (knstnt_1.boltz * (reftmp + 
	    reftmp));
/*<       fact1=temp1/reftmp >*/
    fact1 = temp1 / reftmp;
/*<       pbfat1=-2*vt1*(1.5d0*dlog(fact1)+charge*arg1) >*/
    pbfat1 = vt1 * -2 * (log(fact1) * 1.5 + knstnt_1.charge * arg1);
/*<     5 call title(0,lwidth,1,tmptit) >*/
/* L5: */
    title_(&c__0, &miscel_1.lwidth, &c__1, tmptit);

/*  resistors */

/*<       loc=locate(1) >*/
    loc = cirdat_1.locate[0];
/*<       ititle=0 >*/
    ititle = 0;
/*<    10 if (loc.eq.0) go to 100 >*/
L10:
    if (loc == 0) {
	goto L100;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       tc1=value(locv+3) >*/
    tc1 = blank_1.value[locv + 2];
/*<       tc2=value(locv+4) >*/
    tc2 = blank_1.value[locv + 3];
/*<       if (tc1.ne.0.0d0) go to 20 >*/
    if (tc1 != 0.) {
	goto L20;
    }
/*<       if (tc2.eq.0.0d0) go to 40 >*/
    if (tc2 == 0.) {
	goto L40;
    }
/*<    20 if (ititle.ne.0) go to 30 >*/
L20:
    if (ititle != 0) {
	goto L30;
    }
/*<       write (iofile,21) >*/
    io__30.ciunit = status_1.iofile;
    s_wsfe(&io__30);
    e_wsfe();
/*<    21 format(//'0**** resistors',/,'0name',8x,'value',//) >*/
/*<       ititle=1 >*/
    ititle = 1;
/*<    30 rnew=value(locv+2)*(1.0d0+tc1*delt+tc2*deltsq) >*/
L30:
    rnew = blank_1.value[locv + 1] * (tc1 * delt + 1. + tc2 * deltsq);
/*<       value(locv+1)=1.0d0/rnew >*/
    blank_1.value[locv] = 1. / rnew;
/*<       write (iofile,31) value(locv),rnew >*/
    io__32.ciunit = status_1.iofile;
    s_wsfe(&io__32);
    do_fio(&c__1, (char *)&blank_1.value[locv - 1], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&rnew, (ftnlen)sizeof(doublereal));
    e_wsfe();
/*<    31 format(1x,a8,1p6d11.3) >*/
/*<    40 loc=nodplc(loc) >*/
L40:
    loc = nodplc[loc - 1];
/*<       go to 10 >*/
    goto L10;

/*  diode model */

/*<   100 loc=locate(21) >*/
L100:
    loc = cirdat_1.locate[20];
/*<       if (loc.eq.0) go to 200 >*/
    if (loc == 0) {
	goto L200;
    }
/*<       write (iofile,101) >*/
    io__33.ciunit = status_1.iofile;
    s_wsfe(&io__33);
    e_wsfe();
/*<   101 format(//'0**** diode model parameters',/,'0name',9x,'is',9x,'vj', >*/
/*<      1   8x,'cjo',//) >*/
/*<   110 if (loc.eq.0) go to 200 >*/
L110:
    if (loc == 0) {
	goto L200;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/* ...  is(t2)=is(t1)*dexp(eg/(n*vt)*(t2/t1-1))*(t2/t1)**(xti/n) */
/*<       xn=value(locv+3) >*/
    xn = blank_1.value[locv + 2];
/*<       factor=ratio1*value(locv+8)/(xn*vt)+value(locv+9)/xn*ratlog >*/
    factor = ratio1 * blank_1.value[locv + 7] / (xn * status_1.vt) + 
	    blank_1.value[locv + 8] / xn * ratlog;
/*<       factor=dexp(factor) >*/
    factor = exp(factor);
/*<       value(locv+1)=value(locv+1)*factor >*/
    blank_1.value[locv] *= factor;
/*<       oldpb=value(locv+6) >*/
    oldpb = blank_1.value[locv + 5];
/*<       pbo=(value(locv+6)-pbfat1)/fact1 >*/
    pbo = (blank_1.value[locv + 5] - pbfat1) / fact1;
/*<       gmaold=(oldpb-pbo)/pbo >*/
    gmaold = (oldpb - pbo) / pbo;
/*<       value(locv+5)=value(locv+5)/(1.0d0+value(locv+7) >*/
/*<      1     *(400.0d-6*(temp1-reftmp)-gmaold)) >*/
    blank_1.value[locv + 4] /= blank_1.value[locv + 6] * ((temp1 - reftmp) * 
	    4e-4 - gmaold) + 1.;
/*<   120 value(locv+6)=fact2*pbo+pbfact >*/
/* L120: */
    blank_1.value[locv + 5] = fact2 * pbo + pbfact;
/*<       gmanew=(value(locv+6)-pbo)/pbo >*/
    gmanew = (blank_1.value[locv + 5] - pbo) / pbo;
/*<       value(locv+5)=value(locv+5) >*/
/*<      1   *(1.0d0+value(locv+7)*(400.0d-6*dtemp-gmanew)) >*/
    blank_1.value[locv + 4] *= blank_1.value[locv + 6] * (dtemp * 4e-4 - 
	    gmanew) + 1.;
/*<       pbrat=value(locv+6)/oldpb >*/
    pbrat = blank_1.value[locv + 5] / oldpb;
/*<       value(locv+12)=value(locv+12)*pbrat >*/
    blank_1.value[locv + 11] *= pbrat;
/*<       value(locv+15)=value(locv+15)*pbrat >*/
    blank_1.value[locv + 14] *= pbrat;
/*<       vte=value(locv+3)*vt >*/
    vte = blank_1.value[locv + 2] * status_1.vt;
/*<       value(locv+18)=vte*dlog(vte/(root2*value(locv+1))) >*/
    blank_1.value[locv + 17] = vte * log(vte / (knstnt_1.root2 * 
	    blank_1.value[locv]));
/*<       write (iofile,31) value(locv),value(locv+1),value(locv+6), >*/
/*<      1                  value(locv+5) >*/
    io__42.ciunit = status_1.iofile;
    s_wsfe(&io__42);
    do_fio(&c__1, (char *)&blank_1.value[locv - 1], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv], (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&blank_1.value[locv + 5], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv + 4], (ftnlen)sizeof(doublereal)
	    );
    e_wsfe();
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 110 >*/
    goto L110;

/*  bipolar transistor model */

/*<   200 loc=locate(22) >*/
L200:
    loc = cirdat_1.locate[21];
/*<       if (loc.eq.0) go to 300 >*/
    if (loc == 0) {
	goto L300;
    }
/*<       write (iofile,201) >*/
    io__43.ciunit = status_1.iofile;
    s_wsfe(&io__43);
    e_wsfe();
/*<   201 format(//'0**** bjt model parameters',/,'0name',9x,'js',8x,'bf ', >*/
/*<      1   7x,'ise',7x,'br ',7x,'isc',7x,'vje',7x,'cje',7x,'vjc', >*/
/*<      2   7x,'cjc',//) >*/
/*<   210 if (loc.eq.0) go to 300 >*/
L210:
    if (loc == 0) {
	goto L300;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/* ...  is(t2)=is(t1)*dexp(eg/vt*(t2/t1-1))*(t2/t1)**xti */
/*<       factln=ratio1*value(locv+42)/vt+value(locv+43)*ratlog >*/
    factln = ratio1 * blank_1.value[locv + 41] / status_1.vt + blank_1.value[
	    locv + 42] * ratlog;
/*<       factor=dexp(factln) >*/
    factor = exp(factln);
/*<       value(locv+1)=value(locv+1)*factor >*/
    blank_1.value[locv] *= factor;
/*<       tb=value(locv+41) >*/
    tb = blank_1.value[locv + 40];
/*<       bfactr=dexp(tb*ratlog) >*/
    bfactr = exp(tb * ratlog);
/*<       value(locv+2)=value(locv+2)*bfactr >*/
    blank_1.value[locv + 1] *= bfactr;
/*<       value(locv+8)=value(locv+8)*bfactr >*/
    blank_1.value[locv + 7] *= bfactr;
/*<       value(locv+6)=value(locv+6)*dexp(factln/value(locv+7))/bfactr >*/
    blank_1.value[locv + 5] = blank_1.value[locv + 5] * exp(factln / 
	    blank_1.value[locv + 6]) / bfactr;
/*<       value(locv+12)=value(locv+12)*dexp(factln/value(locv+13)) >*/
/*<      1               /bfactr >*/
    blank_1.value[locv + 11] = blank_1.value[locv + 11] * exp(factln / 
	    blank_1.value[locv + 12]) / bfactr;
/*<       oldpb=value(locv+22) >*/
    oldpb = blank_1.value[locv + 21];
/*<       pbo=(value(locv+22)-pbfat1)/fact1 >*/
    pbo = (blank_1.value[locv + 21] - pbfat1) / fact1;
/*<       gmaold=(oldpb-pbo)/pbo >*/
    gmaold = (oldpb - pbo) / pbo;
/*<       value(locv+21)=value(locv+21)/(1.0d0+value(locv+23) >*/
/*<      1     *(400.0d-6*(temp1-reftmp)-gmaold)) >*/
    blank_1.value[locv + 20] /= blank_1.value[locv + 22] * ((temp1 - reftmp) *
	     4e-4 - gmaold) + 1.;
/*<   220 value(locv+22)=fact2*pbo+pbfact >*/
/* L220: */
    blank_1.value[locv + 21] = fact2 * pbo + pbfact;
/*<       gmanew=(value(locv+22)-pbo)/pbo >*/
    gmanew = (blank_1.value[locv + 21] - pbo) / pbo;
/*<       value(locv+21)=value(locv+21) >*/
/*<      1   *(1.0d0+value(locv+23)*(400.0d-6*dtemp-gmanew)) >*/
    blank_1.value[locv + 20] *= blank_1.value[locv + 22] * (dtemp * 4e-4 - 
	    gmanew) + 1.;
/*<       pbrat=value(locv+22)/oldpb >*/
    pbrat = blank_1.value[locv + 21] / oldpb;
/*<       value(locv+46)=value(locv+46)*pbrat >*/
    blank_1.value[locv + 45] *= pbrat;
/*<       value(locv+47)=value(locv+47)*pbrat >*/
    blank_1.value[locv + 46] *= pbrat;
/*<       oldpb=value(locv+30) >*/
    oldpb = blank_1.value[locv + 29];
/*<       pbo=(value(locv+30)-pbfat1)/fact1 >*/
    pbo = (blank_1.value[locv + 29] - pbfat1) / fact1;
/*<       gmaold=(oldpb-pbo)/pbo >*/
    gmaold = (oldpb - pbo) / pbo;
/*<       value(locv+29)=value(locv+29)/(1.0d0+value(locv+31) >*/
/*<      1     *(400.0d-6*(temp1-reftmp)-gmaold)) >*/
    blank_1.value[locv + 28] /= blank_1.value[locv + 30] * ((temp1 - reftmp) *
	     4e-4 - gmaold) + 1.;
/*<   230 value(locv+30)=fact2*pbo+pbfact >*/
/* L230: */
    blank_1.value[locv + 29] = fact2 * pbo + pbfact;
/*<       gmanew=(value(locv+30)-pbo)/pbo >*/
    gmanew = (blank_1.value[locv + 29] - pbo) / pbo;
/*<       value(locv+29)=value(locv+29) >*/
/*<      1   *(1.0d0+value(locv+31)*(400.0d-6*dtemp-gmanew)) >*/
    blank_1.value[locv + 28] *= blank_1.value[locv + 30] * (dtemp * 4e-4 - 
	    gmanew) + 1.;
/*<       pbrat=value(locv+30)/oldpb >*/
    pbrat = blank_1.value[locv + 29] / oldpb;
/*<       value(locv+50)=value(locv+50)*pbrat >*/
    blank_1.value[locv + 49] *= pbrat;
/*<       value(locv+51)=value(locv+51)*pbrat >*/
    blank_1.value[locv + 50] *= pbrat;
/*<       value(locv+54)=vt*dlog(vt/(root2*value(locv+1))) >*/
    blank_1.value[locv + 53] = status_1.vt * log(status_1.vt / (
	    knstnt_1.root2 * blank_1.value[locv]));
/*<       write (iofile,211) value(locv),value(locv+1),value(locv+2), >*/
/*<      1   value(locv+6),value(locv+8),value(locv+12),value(locv+22), >*/
/*<      2   value(locv+21),value(locv+30),value(locv+29) >*/
    io__47.ciunit = status_1.iofile;
    s_wsfe(&io__47);
    do_fio(&c__1, (char *)&blank_1.value[locv - 1], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv], (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&blank_1.value[locv + 1], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv + 5], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv + 7], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv + 11], (ftnlen)sizeof(
	    doublereal));
    do_fio(&c__1, (char *)&blank_1.value[locv + 21], (ftnlen)sizeof(
	    doublereal));
    do_fio(&c__1, (char *)&blank_1.value[locv + 20], (ftnlen)sizeof(
	    doublereal));
    do_fio(&c__1, (char *)&blank_1.value[locv + 29], (ftnlen)sizeof(
	    doublereal));
    do_fio(&c__1, (char *)&blank_1.value[locv + 28], (ftnlen)sizeof(
	    doublereal));
    e_wsfe();
/*<   211 format(1x,a8,1p9d10.3) >*/
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 210 >*/
    goto L210;

/*  jfet model */

/*<   300 loc=locate(23) >*/
L300:
    loc = cirdat_1.locate[22];
/*<       if (loc.eq.0) go to 400 >*/
    if (loc == 0) {
	goto L400;
    }
/*<       write (iofile,301) >*/
    io__48.ciunit = status_1.iofile;
    s_wsfe(&io__48);
    e_wsfe();
/*<   301 format(//'0**** jfet model parameters',/,'0name',9x,'is',9x,'pb', >*/
/*<      1   8x,'cgs',8x,'cgd',//) >*/
/*<   310 if (loc.eq.0) go to 400 >*/
L310:
    if (loc == 0) {
	goto L400;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       value(locv+9)=value(locv+9)*dexp(ratio1*1.11d0/vt) >*/
    blank_1.value[locv + 8] *= exp(ratio1 * 1.11 / status_1.vt);
/*<       oldpb=value(locv+8) >*/
    oldpb = blank_1.value[locv + 7];
/*<       pbo=(value(locv+8)-pbfat1)/fact1 >*/
    pbo = (blank_1.value[locv + 7] - pbfat1) / fact1;
/*<       gmaold=(oldpb-pbo)/pbo >*/
    gmaold = (oldpb - pbo) / pbo;
/*<       oldcjf=1.0d0+0.5d0*(400.0d-6*(temp1-reftmp)-gmaold) >*/
    oldcjf = ((temp1 - reftmp) * 4e-4 - gmaold) * .5 + 1.;
/*<       value(locv+6)=value(locv+6)/oldcjf >*/
    blank_1.value[locv + 5] /= oldcjf;
/*<       value(locv+7)=value(locv+7)/oldcjf >*/
    blank_1.value[locv + 6] /= oldcjf;
/*<   320 value(locv+8)=fact2*pbo+pbfact >*/
/* L320: */
    blank_1.value[locv + 7] = fact2 * pbo + pbfact;
/*<       gmanew=(value(locv+8)-pbo)/pbo >*/
    gmanew = (blank_1.value[locv + 7] - pbo) / pbo;
/*<       cjfact=1.0d0+0.5d0*(400.0d-6*dtemp-gmanew) >*/
    cjfact = (dtemp * 4e-4 - gmanew) * .5 + 1.;
/*<       value(locv+6)=value(locv+6)*cjfact >*/
    blank_1.value[locv + 5] *= cjfact;
/*<       value(locv+7)=value(locv+7)*cjfact >*/
    blank_1.value[locv + 6] *= cjfact;
/*<       pbrat=value(locv+8)/oldpb >*/
    pbrat = blank_1.value[locv + 7] / oldpb;
/*<       value(locv+12)=value(locv+12)*pbrat >*/
    blank_1.value[locv + 11] *= pbrat;
/*<       value(locv+13)=value(locv+13)*pbrat >*/
    blank_1.value[locv + 12] *= pbrat;
/*<       value(locv+16)=vt*dlog(vt/(root2*value(locv+9))) >*/
    blank_1.value[locv + 15] = status_1.vt * log(status_1.vt / (
	    knstnt_1.root2 * blank_1.value[locv + 8]));
/*<       write (iofile,31) value(locv),value(locv+9),value(locv+8), >*/
/*<      1   value(locv+6),value(locv+7) >*/
    io__51.ciunit = status_1.iofile;
    s_wsfe(&io__51);
    do_fio(&c__1, (char *)&blank_1.value[locv - 1], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv + 8], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv + 7], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv + 5], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv + 6], (ftnlen)sizeof(doublereal)
	    );
    e_wsfe();
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 310 >*/
    goto L310;

/*  mosfet model */

/*<   400 loc=locate(24) >*/
L400:
    loc = cirdat_1.locate[23];
/*<       iprnt=1 >*/
    iprnt = 1;
/*<   410 if (loc.eq.0) go to 1000 >*/
L410:
    if (loc == 0) {
	goto L1000;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       type=nodplc(loc+2) >*/
    type = (doublereal) nodplc[loc + 1];
/*<       if(iprnt.ne.0) write (iofile,401) >*/
    if (iprnt != 0) {
	io__54.ciunit = status_1.iofile;
	s_wsfe(&io__54);
	e_wsfe();
    }
/*<   401 format(//'0**** mosfet model parameters',/,'0name',8x,'vto',8x, >*/
/*<      1   'phi',9x,'pb',7x,'is(js)',7x,'kp',9x,'uo'//) >*/
/*<       iprnt=0 >*/
    iprnt = 0;
/*<       ratio4=ratio*dsqrt(ratio) >*/
    ratio4 = ratio * sqrt(ratio);
/*<       value(locv+3)=value(locv+3)/ratio4 >*/
    blank_1.value[locv + 2] /= ratio4;
/*<       value(locv+29)=value(locv+29)/ratio4 >*/
    blank_1.value[locv + 28] /= ratio4;
/*<       oldphi=value(locv+5) >*/
    oldphi = blank_1.value[locv + 4];
/*<       phio=(value(locv+5)-pbfat1)/fact1 >*/
    phio = (blank_1.value[locv + 4] - pbfat1) / fact1;
/*<   415 value(locv+5)=fact2*phio+pbfact >*/
/* L415: */
    blank_1.value[locv + 4] = fact2 * phio + pbfact;
/*<       phi=value(locv+5) >*/
    phi = blank_1.value[locv + 4];
/*<       vfb=value(locv+44)-type*0.5d0*oldphi >*/
    vfb = blank_1.value[locv + 43] - type * .5 * oldphi;
/*<       vfb=vfb+0.5d0*(oldeg-egfet) >*/
    vfb += (oldeg - status_1.egfet) * .5;
/*<       value(locv+44)=vfb+type*0.5d0*phi >*/
    blank_1.value[locv + 43] = vfb + type * .5 * phi;
/*<       value(locv+2)=value(locv+44)+type*value(locv+4)*dsqrt(phi) >*/
    blank_1.value[locv + 1] = blank_1.value[locv + 43] + type * blank_1.value[
	    locv + 3] * sqrt(phi);
/*<       value(locv+11)=value(locv+11)*dexp(-egfet/vt+oldeg/oldvt) >*/
    blank_1.value[locv + 10] *= exp(-status_1.egfet / status_1.vt + oldeg / 
	    oldvt);
/*<       value(locv+21)=value(locv+21)*dexp(-egfet/vt+oldeg/oldvt) >*/
    blank_1.value[locv + 20] *= exp(-status_1.egfet / status_1.vt + oldeg / 
	    oldvt);
/*<       oldpb=value(locv+12) >*/
    oldpb = blank_1.value[locv + 11];
/*<       pbo=(value(locv+12)-pbfat1)/fact1 >*/
    pbo = (blank_1.value[locv + 11] - pbfat1) / fact1;
/*<       gmaold=(oldpb-pbo)/pbo >*/
    gmaold = (oldpb - pbo) / pbo;
/*<       coeold=1.0d0+value(locv+18)*(400.0d-6*(temp1-reftmp)-gmaold) >*/
    coeold = blank_1.value[locv + 17] * ((temp1 - reftmp) * 4e-4 - gmaold) + 
	    1.;
/*<       value(locv+9)=value(locv+9)/coeold >*/
    blank_1.value[locv + 8] /= coeold;
/*<       value(locv+10)=value(locv+10)/coeold >*/
    blank_1.value[locv + 9] /= coeold;
/*<       value(locv+17)=value(locv+17)/coeold >*/
    blank_1.value[locv + 16] /= coeold;
/*<       value(locv+19)=value(locv+19)/(1.0d0+value(locv+20) >*/
/*<      1     *(400.0d-6*(temp1-reftmp)-gmaold)) >*/
    blank_1.value[locv + 18] /= blank_1.value[locv + 19] * ((temp1 - reftmp) *
	     4e-4 - gmaold) + 1.;
/*<   420 value(locv+12)=fact2*pbo+pbfact >*/
/* L420: */
    blank_1.value[locv + 11] = fact2 * pbo + pbfact;
/*<       gmanew=(value(locv+12)-pbo)/pbo >*/
    gmanew = (blank_1.value[locv + 11] - pbo) / pbo;
/*<       coenew=1.0d0+value(locv+18)*(400.0d-6*dtemp-gmanew) >*/
    coenew = blank_1.value[locv + 17] * (dtemp * 4e-4 - gmanew) + 1.;
/*<       value(locv+9)=value(locv+9)*coenew >*/
    blank_1.value[locv + 8] *= coenew;
/*<       value(locv+10)=value(locv+10)*coenew >*/
    blank_1.value[locv + 9] *= coenew;
/*<       value(locv+17)=value(locv+17)*coenew >*/
    blank_1.value[locv + 16] *= coenew;
/*<       value(locv+19)=value(locv+19)* >*/
/*<      1   (1.0d0+value(locv+20)*(400.0d-6*dtemp-gmanew)) >*/
    blank_1.value[locv + 18] *= blank_1.value[locv + 19] * (dtemp * 4e-4 - 
	    gmanew) + 1.;
/*<       pbrat=value(locv+12)/oldpb >*/
    pbrat = blank_1.value[locv + 11] / oldpb;
/*<       value(locv+37)=value(locv+37)*pbrat >*/
    blank_1.value[locv + 36] *= pbrat;
/*<       value(locv+38)=value(locv+38)*pbrat >*/
    blank_1.value[locv + 37] *= pbrat;
/*<       csat=dmax1(value(locv+11),value(locv+21)) >*/
/* Computing MAX */
    d_1 = blank_1.value[locv + 10], d_2 = blank_1.value[locv + 20];
    csat = max(d_2,d_1);
/*<       write (iofile,31) value(locv),value(locv+2),value(locv+5), >*/
/*<      1   value(locv+12),csat,value(locv+3),value(locv+29) >*/
    io__63.ciunit = status_1.iofile;
    s_wsfe(&io__63);
    do_fio(&c__1, (char *)&blank_1.value[locv - 1], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv + 1], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv + 4], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv + 11], (ftnlen)sizeof(
	    doublereal));
    do_fio(&c__1, (char *)&csat, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&blank_1.value[locv + 2], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locv + 28], (ftnlen)sizeof(
	    doublereal));
    e_wsfe();
/*<   430 loc=nodplc(loc) >*/
/* L430: */
    loc = nodplc[loc - 1];
/*<       go to 410 >*/
    goto L410;

/*  finished */

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

#undef cvalue
#undef nodplc
#undef tmptit


