/* modchk.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 {
    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__1 = 1;
static integer c__0 = 0;

/*<       subroutine modchk >*/
/* Subroutine */ int modchk_()
{
    /* Initialized data */

    static struct {
	char e_1[16];
	doublereal e_2;
	} equiv_73 = { {'c', '2', ' ', ' ', ' ', ' ', ' ', ' ', 'c', '4', ' ',
		 ' ', ' ', ' ', ' ', ' '}, 0. };

#define cpar ((doublereal *)&equiv_73)

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

#define aundef (*(doublereal *)&equiv_74)

    static struct {
	char e_1[912];
	doublereal e_2;
	} equiv_75 = { {'i', 's', ' ', ' ', ' ', ' ', ' ', ' ', 'r', 's', ' ',
		 ' ', ' ', ' ', ' ', ' ', 'n', ' ', ' ', ' ', ' ', ' ', ' ', 
		' ', 't', 't', ' ', ' ', ' ', ' ', ' ', ' ', 'c', 'j', 'o', 
		' ', ' ', ' ', ' ', ' ', 'v', 'j', ' ', ' ', ' ', ' ', ' ', 
		' ', 'm', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'e', 'g', ' ', 
		' ', ' ', ' ', ' ', ' ', 'x', 't', 'i', ' ', ' ', ' ', ' ', 
		' ', 'k', 'f', ' ', ' ', ' ', ' ', ' ', ' ', 'a', 'f', ' ', 
		' ', ' ', ' ', ' ', ' ', 'f', 'c', ' ', ' ', ' ', ' ', ' ', 
		' ', 'b', 'v', ' ', ' ', ' ', ' ', ' ', ' ', 'i', 'b', 'v', 
		' ', ' ', ' ', ' ', ' ', 'i', 's', ' ', ' ', ' ', ' ', ' ', 
		' ', 'b', 'f', ' ', ' ', ' ', ' ', ' ', ' ', 'n', 'f', ' ', 
		' ', ' ', ' ', ' ', ' ', 'v', 'a', 'f', ' ', ' ', ' ', ' ', 
		' ', 'i', 'k', 'f', ' ', ' ', ' ', ' ', ' ', 'i', 's', 'e', 
		' ', ' ', ' ', ' ', ' ', 'n', 'e', ' ', ' ', ' ', ' ', ' ', 
		' ', 'b', 'r', ' ', ' ', ' ', ' ', ' ', ' ', 'n', 'r', ' ', 
		' ', ' ', ' ', ' ', ' ', 'v', 'a', 'r', ' ', ' ', ' ', ' ', 
		' ', 'i', 'k', 'r', ' ', ' ', ' ', ' ', ' ', 'i', 's', 'c', 
		' ', ' ', ' ', ' ', ' ', 'n', 'c', ' ', ' ', ' ', ' ', ' ', 
		' ', '0', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0', ' ', ' ', 
		' ', ' ', ' ', ' ', ' ', 'r', 'b', ' ', ' ', ' ', ' ', ' ', 
		' ', 'i', 'r', 'b', ' ', ' ', ' ', ' ', ' ', 'r', 'b', 'm', 
		' ', ' ', ' ', ' ', ' ', 'r', 'e', ' ', ' ', ' ', ' ', ' ', 
		' ', 'r', 'c', ' ', ' ', ' ', ' ', ' ', ' ', 'c', 'j', 'e', 
		' ', ' ', ' ', ' ', ' ', 'v', 'j', 'e', ' ', ' ', ' ', ' ', 
		' ', 'm', 'j', 'e', ' ', ' ', ' ', ' ', ' ', 't', 'f', ' ', 
		' ', ' ', ' ', ' ', ' ', 'x', 't', 'f', ' ', ' ', ' ', ' ', 
		' ', 'v', 't', 'f', ' ', ' ', ' ', ' ', ' ', 'i', 't', 'f', 
		' ', ' ', ' ', ' ', ' ', 'p', 't', 'f', ' ', ' ', ' ', ' ', 
		' ', 'c', 'j', 'c', ' ', ' ', ' ', ' ', ' ', 'v', 'j', 'c', 
		' ', ' ', ' ', ' ', ' ', 'm', 'j', 'c', ' ', ' ', ' ', ' ', 
		' ', 'x', 'c', 'j', 'c', ' ', ' ', ' ', ' ', 't', 'r', ' ', 
		' ', ' ', ' ', ' ', ' ', '0', ' ', ' ', ' ', ' ', ' ', ' ', 
		' ', '0', ' ', ' ', ' ', ' ', ' ', ' ', ' ', '0', ' ', ' ', 
		' ', ' ', ' ', ' ', ' ', '0', ' ', ' ', ' ', ' ', ' ', ' ', 
		' ', 'c', 'j', 's', ' ', ' ', ' ', ' ', ' ', 'v', 'j', 's', 
		' ', ' ', ' ', ' ', ' ', 'm', 'j', 's', ' ', ' ', ' ', ' ', 
		' ', 'x', 't', 'b', ' ', ' ', ' ', ' ', ' ', 'e', 'g', ' ', 
		' ', ' ', ' ', ' ', ' ', 'x', 't', 'i', ' ', ' ', ' ', ' ', 
		' ', 'k', 'f', ' ', ' ', ' ', ' ', ' ', ' ', 'a', 'f', ' ', 
		' ', ' ', ' ', ' ', ' ', 'f', 'c', ' ', ' ', ' ', ' ', ' ', 
		' ', 'v', 't', 'o', ' ', ' ', ' ', ' ', ' ', 'b', 'e', 't', 
		'a', ' ', ' ', ' ', ' ', 'l', 'a', 'm', 'b', 'd', 'a', ' ', 
		' ', 'r', 'd', ' ', ' ', ' ', ' ', ' ', ' ', 'r', 's', ' ', 
		' ', ' ', ' ', ' ', ' ', 'c', 'g', 's', ' ', ' ', ' ', ' ', 
		' ', 'c', 'g', 'd', ' ', ' ', ' ', ' ', ' ', 'p', 'b', ' ', 
		' ', ' ', ' ', ' ', ' ', 'i', 's', ' ', ' ', ' ', ' ', ' ', 
		' ', 'k', 'f', ' ', ' ', ' ', ' ', ' ', ' ', 'a', 'f', ' ', 
		' ', ' ', ' ', ' ', ' ', 'f', 'c', ' ', ' ', ' ', ' ', ' ', 
		' ', 'l', 'e', 'v', 'e', 'l', ' ', ' ', ' ', 'v', 't', 'o', 
		' ', ' ', ' ', ' ', ' ', 'k', 'p', ' ', ' ', ' ', ' ', ' ', 
		' ', 'g', 'a', 'm', 'm', 'a', ' ', ' ', ' ', 'p', 'h', 'i', 
		' ', ' ', ' ', ' ', ' ', 'l', 'a', 'm', 'b', 'd', 'a', ' ', 
		' ', 'r', 'd', ' ', ' ', ' ', ' ', ' ', ' ', 'r', 's', ' ', 
		' ', ' ', ' ', ' ', ' ', 'c', 'b', 'd', ' ', ' ', ' ', ' ', 
		' ', 'c', 'b', 's', ' ', ' ', ' ', ' ', ' ', 'i', 's', ' ', 
		' ', ' ', ' ', ' ', ' ', 'p', 'b', ' ', ' ', ' ', ' ', ' ', 
		' ', 'c', 'g', 's', 'o', ' ', ' ', ' ', ' ', 'c', 'g', 'd', 
		'o', ' ', ' ', ' ', ' ', 'c', 'g', 'b', 'o', ' ', ' ', ' ', 
		' ', 'r', 's', 'h', ' ', ' ', ' ', ' ', ' ', 'c', 'j', ' ', 
		' ', ' ', ' ', ' ', ' ', 'm', 'j', ' ', ' ', ' ', ' ', ' ', 
		' ', 'c', 'j', 's', 'w', ' ', ' ', ' ', ' ', 'm', 'j', 's', 
		'w', ' ', ' ', ' ', ' ', 'j', 's', ' ', ' ', ' ', ' ', ' ', 
		' ', 't', 'o', 'x', ' ', ' ', ' ', ' ', ' ', 'n', 's', 'u', 
		'b', ' ', ' ', ' ', ' ', 'n', 's', 's', ' ', ' ', ' ', ' ', 
		' ', 'n', 'f', 's', ' ', ' ', ' ', ' ', ' ', 't', 'p', 'g', 
		' ', ' ', ' ', ' ', ' ', 'x', 'j', ' ', ' ', ' ', ' ', ' ', 
		' ', 'l', 'd', ' ', ' ', ' ', ' ', ' ', ' ', 'u', 'o', ' ', 
		' ', ' ', ' ', ' ', ' ', 'u', 'c', 'r', 'i', 't', ' ', ' ', 
		' ', 'u', 'e', 'x', 'p', ' ', ' ', ' ', ' ', 'u', 't', 'r', 
		'a', ' ', ' ', ' ', ' ', 'v', 'm', 'a', 'x', ' ', ' ', ' ', 
		' ', 'n', 'e', 'f', 'f', ' ', ' ', ' ', ' ', 'x', 'q', 'c', 
		' ', ' ', ' ', ' ', ' ', 'k', 'f', ' ', ' ', ' ', ' ', ' ', 
		' ', 'a', 'f', ' ', ' ', ' ', ' ', ' ', ' ', 'f', 'c', ' ', 
		' ', ' ', ' ', ' ', ' ', 'd', 'e', 'l', 't', 'a', ' ', ' ', 
		' ', 't', 'h', 'e', 't', 'a', ' ', ' ', ' ', 'e', 't', 'a', 
		' ', ' ', ' ', ' ', ' ', 'k', 'a', 'p', 'p', 'a', ' ', ' ', 
		' '}, 0. };

#define ampar ((doublereal *)&equiv_75)

    static doublereal defval[115] = { 1e-14,0.,1.,0.,0.,1.,.5,1.11,3.,0.,1.,
	    .5,0.,.001,1e-16,100.,1.,0.,0.,0.,1.5,1.,1.,0.,0.,0.,2.,0.,1.,0.,
	    0.,0.,0.,0.,0.,.75,.33,0.,0.,0.,0.,0.,0.,.75,.33,1.,0.,0.,0.,0.,
	    0.,0.,.75,0.,0.,1.11,3.,0.,1.,.5,-2.,1e-4,0.,0.,0.,0.,0.,1.,1e-14,
	    0.,1.,.5,1.,0.,2e-5,0.,.6,0.,0.,0.,0.,0.,1e-14,.8,0.,0.,0.,0.,0.,
	    .5,0.,.33,0.,0.,0.,0.,0.,1.,0.,0.,600.,1e4,0.,0.,0.,1.,1.,0.,1.,
	    .5,0.,0.,0.,.2,0. };
    static integer ifmt[115] = { 4,1,1,2,2,1,1,1,1,2,1,1,2,2,4,3,3,2,2,2,1,3,
	    3,2,2,2,1,0,0,1,2,1,1,1,2,1,1,2,2,2,2,1,2,1,1,1,2,0,0,0,0,2,1,1,2,
	    1,1,2,2,2,3,4,1,1,1,2,2,1,2,2,1,1,3,3,4,1,1,2,1,1,2,2,2,1,2,2,2,1,
	    2,1,2,1,2,2,2,2,2,1,2,2,1,2,1,1,2,1,1,2,1,1,1,1,1,1,0 };
    static integer ivchk[115] = { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
	    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
	    0,-1,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,-1,0,0,0,0,0,0,0,0,0,
	    0,0,0,0,0,0,0,0,0,-1,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
    static struct {
	char e_1[32];
	doublereal e_2;
	} equiv_76 = { {'d', 'i', 'o', 'd', 'e', ' ', 'm', 'o', 'd', 'e', 'l',
		 ' ', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', ' ', 
		' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define titled ((doublereal *)&equiv_76)

    static struct {
	char e_1[32];
	doublereal e_2;
	} equiv_77 = { {'b', 'j', 't', ' ', 'm', 'o', 'd', 'e', 'l', ' ', 'p',
		 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', ' ', ' ', ' ', 
		' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define titleb ((doublereal *)&equiv_77)

    static struct {
	char e_1[32];
	doublereal e_2;
	} equiv_78 = { {'j', 'f', 'e', 't', ' ', 'm', 'o', 'd', 'e', 'l', ' ',
		 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', ' ', ' ', 
		' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define titlej ((doublereal *)&equiv_78)

    static struct {
	char e_1[32];
	doublereal e_2;
	} equiv_79 = { {'m', 'o', 's', 'f', 'e', 't', ' ', 'm', 'o', 'd', 'e',
		 'l', ' ', 'p', 'a', 'r', 'a', 'm', 'e', 't', 'e', 'r', 's', 
		' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

#define titlem ((doublereal *)&equiv_79)

    static struct {
	char e_1[32];
	doublereal e_2;
	} equiv_80 = { {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'n', 'p', 'n',
		 ' ', ' ', ' ', ' ', ' ', 'n', 'j', 'f', ' ', ' ', ' ', ' ', 
		' ', 'n', 'm', 'o', 's', ' ', ' ', ' ', ' '}, 0. };

#define antype ((doublereal *)&equiv_80)

    static struct {
	char e_1[32];
	doublereal e_2;
	} equiv_81 = { {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', 'p', 'n', 'p',
		 ' ', ' ', ' ', ' ', ' ', 'p', 'j', 'f', ' ', ' ', ' ', ' ', 
		' ', 'p', 'm', 'o', 's', ' ', ' ', ' ', ' '}, 0. };

#define aptype ((doublereal *)&equiv_81)

    static integer ipar[5] = { 0,14,60,72,114 };

    /* Format strings */
    static char fmt_31[] = "(\0020*error*:  nsub <= ni in mosfet model \002,\
a8,/)";
    static char fmt_89[] = "(\0020warning:  minimum base resistance (rbm) is\
 less than \002,\002total (rb) for model \002,a8,/10x,\002 rbm set equal to \
rb\002,/)";
    static char fmt_121[] = "(\0020warning:  the value of lambda for mosfet \
model \002,a8,/,\002 is unusually large and might cause nonconvergence\002,/)"
	    ;
    static char fmt_241[] = "(//11x,12(2x,a8))";
    static char fmt_261[] = "(\0020type\002,4x,12(4x,a6))";
    static char fmt_321[] = "(\0020\002,a8,12f10.3)";
    static char fmt_331[] = "(\0020\002,a8,1p12d10.2)";
    static char fmt_411[] = "(\0020warning:  in diode model \002,a8,\002 ibv\
 increased to \002,1pe10.3,11x,\002to resolve incompatibility with specified\
 is\002/)";
    static char fmt_415[] = "(\0020warning:  unable to match forward and rev\
erse diode regions\002,/,11x,\002bv = \002,1pd10.3,\002 and ibv = \002,d10.3\
,/)";
    static char fmt_911[] = "(\0020*error*:  effective channel length of \
\002,a8,\002 less than \002,\002zero.\002,/\002 check value of ld for model\
 \002,a8)";

    /* System generated locals */
    integer i_1, i_2;
    doublereal d_1;

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

    /* Local variables */
    static integer itab[50], locm, locv, locs, locn;
    static doublereal tnom;
    static integer kntr;
    static doublereal type, csat;
    static integer iter;
    static doublereal xcbv;
    static integer i, k;
    static doublereal xleff, wkfng;
    static integer nopar;
    static doublereal xnsub;
    extern /* Subroutine */ int title_();
    static doublereal ad, fc;
    static integer id;
    static doublereal cj, pb, pc, as, pe;
    static integer iccflg;
    static doublereal atable[12], btable[12], bv, xm;
#define nodplc ((integer *)&blank_1)
#define cvalue ((complex *)&blank_1)
    static integer nummod, loc;
    static doublereal fermis, fermig, wkfngs;
    static integer kntlim;
    static doublereal xfc, cbv;
    static integer lev;
    static doublereal xmc, cox, xme, vte, xbv, tol, xkt;

    /* Fortran I/O blocks */
    static cilist io__29 = { 0, 0, 0, fmt_31, 0 };
    static cilist io__36 = { 0, 0, 0, fmt_89, 0 };
    static cilist io__38 = { 0, 0, 0, fmt_121, 0 };
    static cilist io__43 = { 0, 0, 0, fmt_241, 0 };
    static cilist io__45 = { 0, 0, 0, fmt_261, 0 };
    static cilist io__48 = { 0, 0, 0, fmt_321, 0 };
    static cilist io__49 = { 0, 0, 0, fmt_331, 0 };
    static cilist io__50 = { 0, 0, 0, fmt_321, 0 };
    static cilist io__59 = { 0, 0, 0, fmt_411, 0 };
    static cilist io__64 = { 0, 0, 0, fmt_415, 0 };
    static cilist io__70 = { 0, 0, 0, fmt_911, 0 };


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

/*     this routine performs one-time processing of device model para- */
/* meters and prints out a device model summary.  it also reserves the */
/* additional nodes required by nonzero device extrinsic resistances. */

/* 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=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 itab(50),atable(12) >*/
/*<       dimension cpar(2),btable(12) >*/
/*<       dimension antype(4),aptype(4) >*/
/*<       dimension ipar(5),ampar(115),defval(115),ifmt(115),ivchk(115) >*/
/*<       dimension titled(4),titleb(4),titlej(4),titlem(4) >*/
/*<       data titled / 8hdiode mo, 8hdel para, 8hmeters  , 8h         / >*/
/*<       data titleb / 8hbjt mode, 8hl parame, 8hters    , 8h         / >*/
/*<       data titlej / 8hjfet mod, 8hel param, 8heters   , 8h         / >*/
/*<       data titlem / 8hmosfet m, 8hodel par, 8hameters , 8h         / >*/
/*<       data antype /1h ,3hnpn,3hnjf,4hnmos/ >*/
/*<       data aptype /1h ,3hpnp,3hpjf,4hpmos/ >*/
/*<       data ipar /0,14,60,72,114/ >*/
/*<       data cpar / 3hc2 ,3hc4 / >*/
/*<       data aundef /2h.u/ >*/
/*<       data ampar / >*/
/*<      1   6his    ,6hrs    ,6hn     ,6htt    ,6hcjo   ,6hvj    ,6hm     , >*/
/*<      2   6heg    ,6hxti   ,6hkf    ,6haf    ,6hfc    ,6hbv    ,6hibv   , >*/
/*<      1   6his    ,6hbf    ,6hnf    ,6hvaf   ,6hikf   ,6hise   ,6hne    , >*/
/*<      2   6hbr    ,6hnr    ,6hvar   ,6hikr   ,6hisc   ,6hnc    ,6h0     , >*/
/*<      3   6h0     ,6hrb    ,6hirb   ,6hrbm   ,6hre    ,6hrc    ,6hcje   , >*/
/*<      4   6hvje   ,6hmje   ,6htf    ,6hxtf   ,6hvtf   ,6hitf   ,6hptf   , >*/
/*<      5   6hcjc   ,6hvjc   ,6hmjc   ,6hxcjc  ,6htr    ,6h0     ,6h0     , >*/
/*<      6   6h0     ,6h0     ,6hcjs   ,6hvjs   ,6hmjs   ,6hxtb   ,6heg    , >*/
/*<      7   6hxti   ,6hkf    ,6haf    ,6hfc    , >*/
/*<      1   6hvto   ,6hbeta  ,6hlambda,6hrd    ,6hrs    ,6hcgs   ,6hcgd   , >*/
/*<      2   6hpb    ,6his    ,6hkf    ,6haf    ,6hfc    , >*/
/*<      1   6hlevel ,6hvto   ,6hkp    ,6hgamma ,6hphi   ,6hlambda,6hrd    , >*/
/*<      2   6hrs    ,6hcbd   ,6hcbs   ,6his    ,6hpb    ,6hcgso  ,6hcgdo  , >*/
/*<      3   6hcgbo  ,6hrsh   ,6hcj    ,6hmj    ,6hcjsw  ,6hmjsw  ,6hjs    , >*/
/*<      4   6htox   ,6hnsub  ,6hnss   ,6hnfs   ,6htpg   ,6hxj    ,6hld    , >*/
/*<      5   6huo    ,6hucrit ,6huexp  ,6hutra  ,6hvmax  ,6hneff  ,6hxqc   , >*/
/*<      6   6hkf    ,6haf    ,6hfc    ,6hdelta ,6htheta ,6heta   ,6hkappa , >*/
/*<      7   0.0d0   / >*/
/*<       data defval / >*/
/*<      1   1.0d-14,  0.0d0,  1.0d0,2*0.0d0,  1.0d0,  0.5d0, 1.11d0, >*/
/*<      2     3.0d0,  0.0d0,  1.0d0,  0.5d0,  0.0d0, 1.0d-3, >*/
/*<      1   1.0d-16,100.0d0,  1.0d0,3*0.0d0,  1.5d0,2*1.0d0,3*0.0d0, >*/
/*<      2     2.0d0,  0.0d0,  1.0d0,6*0.0d0, 0.75d0, 0.33d0,2*0.0d0, >*/
/*<      3   4*0.0d0, 0.75d0, 0.33d0,  1.0d0,6*0.0d0, 0.75d0,2*0.0d0, >*/
/*<      4    1.11d0,  3.0d0,  0.0d0,  1.0d0,  0.5d0, >*/
/*<      1    -2.0d0, 1.0d-4,5*0.0d0,  1.0d0,1.0d-14,  0.0d0,  1.0d0, >*/
/*<      2     0.5d0, >*/
/*<      1     1.0d0,  0.0d0, 2.0d-5,  0.0d0,  0.6d0,5*0.0d0,1.0d-14, >*/
/*<      2     0.8d0,5*0.0d0,  0.5d0,  0.0d0, 0.33d0,5*0.0d0,  1.0d0, >*/
/*<      3   2*0.0d0,600.0d0, 1.0d+4,3*0.0d0,  1.0d0,  1.0d0,  0.0d0, >*/
/*<      4     1.0d0,  0.5d0,3*0.0d0,  0.2d0, >*/
/*<      5     0.0d0/ >*/
/*<       data ifmt / >*/
/*<      1   4,1,1,2,2,1,1,1,1,2,1,1,2,2, >*/
/*<      2   4,3,3,2,2,2,1,3,3,2,2,2,1,0,0,1,2,1,1,1,2,1,1,2,2,2,2,1,2,1, >*/
/*<      2   1,1,2,0,0,0,0,2,1,1,2,1,1,2,2,2, >*/
/*<      3   3,4,1,1,1,2,2,1,2,2,1,1, >*/
/*<      4   3,3,4,1,1,2,1,1,2,2,2,1,2,2,2,1,2,1,2,1,2,2,2,2,2,1,2,2, >*/
/*<      4   1,2,1,1,2,1,1,2,1,1,1,1,1,1, >*/
/*<      5   0/ >*/
/*<       data ivchk / >*/
/*<      1   0,0,0,0,0,0,0,0,0,0,0,0,0,0, >*/
/*<      2   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, >*/
/*<      2   0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0, >*/
/*<      3   -1,0,0,0,0,0,0,0,0,0,0,0, >*/
/*<      4   0,-1,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,-1, >*/
/*<      4   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, >*/
/*<      5   0/ >*/


/*<       tnom=value(itemps+1)+ctok >*/
    tnom = blank_1.value[tabinf_1.itemps] + knstnt_1.ctok;
/*<       xkt=boltz*tnom >*/
    xkt = knstnt_1.boltz * tnom;
/*<       vt=xkt/charge >*/
    status_1.vt = xkt / knstnt_1.charge;
/*<       xni=1.45d16 >*/
    status_1.xni = 1.45e16;
/*<       egfet=1.16d0-(7.02d-4*tnom*tnom)/(tnom+1108.0d0) >*/
    status_1.egfet = 1.16 - tnom * 7.02e-4 * tnom / (tnom + 1108.);
/*<       nummod=jelcnt(21)+jelcnt(22)+jelcnt(23)+jelcnt(24) >*/
    nummod = cirdat_1.jelcnt[20] + cirdat_1.jelcnt[21] + cirdat_1.jelcnt[22] 
	    + cirdat_1.jelcnt[23];
/*<       if (nummod.eq.0) go to 1000 >*/
    if (nummod == 0) {
	goto L1000;
    }

/*  special preprocessing for mosfet models */

/*<       loc=locate(24) >*/
    loc = cirdat_1.locate[23];
/*<     5 if (loc.eq.0) go to 35 >*/
L5:
    if (loc == 0) {
	goto L35;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       type=nodplc(loc+2) >*/
    type = (doublereal) nodplc[loc + 1];

/*     default parameters for higher level mos models */

/*<       lev=value(locv+1) >*/
    lev = (integer) blank_1.value[locv];
/*<       if (value(locv+1).eq.aundef) lev=1 >*/
    if (blank_1.value[locv] == aundef) {
	lev = 1;
    }
/*<       if (value(locv+23).ne.aundef) xnsub=value(locv+23)*1.0d6 >*/
    if (blank_1.value[locv + 22] != aundef) {
	xnsub = blank_1.value[locv + 22] * 1e6;
    }
/*<       if (value(locv+22).eq.aundef.and.lev.gt.1) value(locv+22)=1.0d-7 >*/
    if (blank_1.value[locv + 21] == aundef && lev > 1) {
	blank_1.value[locv + 21] = 1e-7;
    }
/*<       if (value(locv+22).eq.aundef) go to 33 >*/
    if (blank_1.value[locv + 21] == aundef) {
	goto L33;
    }
/*<       cox=epsox/value(locv+22) >*/
    cox = knstnt_1.epsox / blank_1.value[locv + 21];

/*     compute kp, if not input, using default mobility 600 cm**2/v*sec */


/*<       if (value(locv+3).ne.aundef) go to 10 >*/
    if (blank_1.value[locv + 2] != aundef) {
	goto L10;
    }
/*<       if (value(locv+29).eq.aundef) value(locv+29)=600.0d0 >*/
    if (blank_1.value[locv + 28] == aundef) {
	blank_1.value[locv + 28] = 600.;
    }
/*<       value(locv+3)=value(locv+29)*cox*1.0d-4 >*/
    blank_1.value[locv + 2] = blank_1.value[locv + 28] * cox * 1e-4;
/*<    10 if (value(locv+23).eq.aundef) go to 33 >*/
L10:
    if (blank_1.value[locv + 22] == aundef) {
	goto L33;
    }
/*<       if (xnsub.le.xni) go to 30 >*/
    if (xnsub <= status_1.xni) {
	goto L30;
    }

/*     nsub nonzero => process oriented model */

/*<       if (value(locv+5).eq.aundef) value(locv+5)= >*/
/*<      1   dmax1((2.0d0*vt*dlog(xnsub/xni)),0.1d0) >*/
    if (blank_1.value[locv + 4] == aundef) {
/* Computing MAX */
	d_1 = status_1.vt * 2. * log(xnsub / status_1.xni);
	blank_1.value[locv + 4] = max(.1,d_1);
    }
/*<       fermis=type*0.5d0*value(locv+5) >*/
    fermis = type * .5 * blank_1.value[locv + 4];
/*<       wkfng=3.2d0 >*/
    wkfng = 3.2;
/*<       if (value(locv+26).eq.aundef) value(locv+26)=1.0d0 >*/
    if (blank_1.value[locv + 25] == aundef) {
	blank_1.value[locv + 25] = 1.;
    }
/*<       if (value(locv+26).eq.0.0d0) go to 15 >*/
    if (blank_1.value[locv + 25] == 0.) {
	goto L15;
    }

/*  polysilicon gate */

/*<       fermig=type*value(locv+26)*0.5d0*egfet >*/
    fermig = type * blank_1.value[locv + 25] * .5 * status_1.egfet;
/*<       wkfng=3.25d0+0.5d0*egfet-fermig >*/
    wkfng = status_1.egfet * .5 + 3.25 - fermig;
/*<    15 wkfngs=wkfng-(3.25d0+0.5d0*egfet+fermis) >*/
L15:
    wkfngs = wkfng - (status_1.egfet * .5 + 3.25 + fermis);
/*<       if (value(locv+4).eq.aundef) >*/
/*<      1   value(locv+4)=dsqrt(2.0d0*epssil*charge*xnsub)/cox >*/
    if (blank_1.value[locv + 3] == aundef) {
	blank_1.value[locv + 3] = sqrt(knstnt_1.epssil * 2. * knstnt_1.charge 
		* xnsub) / cox;
    }

/*     computed vto */

/*<       if (value(locv+2).ne.aundef) go to 20 >*/
    if (blank_1.value[locv + 1] != aundef) {
	goto L20;
    }
/*<       if (value(locv+24).eq.aundef) value(locv+24)=0.0d0 >*/
    if (blank_1.value[locv + 23] == aundef) {
	blank_1.value[locv + 23] = 0.;
    }
/*<       value(locv+44)=wkfngs-value(locv+24)*1.0d4*charge/cox >*/
    blank_1.value[locv + 43] = wkfngs - blank_1.value[locv + 23] * 1e4 * 
	    knstnt_1.charge / cox;
/*<       value(locv+2)=value(locv+44) >*/
/*<      1   +type*(value(locv+4)*dsqrt(value(locv+5))+value(locv+5)) >*/
    blank_1.value[locv + 1] = blank_1.value[locv + 43] + type * (
	    blank_1.value[locv + 3] * sqrt(blank_1.value[locv + 4]) + 
	    blank_1.value[locv + 4]);
/*<       go to 25 >*/
    goto L25;

/*     measured vto has been input */

/*<    20 value(locv+44)=value(locv+2) >*/
/*<      1   -type*(value(locv+4)*dsqrt(value(locv+5))+value(locv+5)) >*/
L20:
    blank_1.value[locv + 43] = blank_1.value[locv + 1] - type * (
	    blank_1.value[locv + 3] * sqrt(blank_1.value[locv + 4]) + 
	    blank_1.value[locv + 4]);
/*<    25 value(locv+45)=dsqrt((epssil+epssil)/(charge*xnsub)) >*/
L25:
    blank_1.value[locv + 44] = sqrt((knstnt_1.epssil + knstnt_1.epssil) / (
	    knstnt_1.charge * xnsub));
/*<       go to 33 >*/
    goto L33;
/*<    30 value(locv+23)=0.0d0 >*/
L30:
    blank_1.value[locv + 22] = 0.;
/*<       write (iofile,31) value(locv) >*/
    io__29.ciunit = status_1.iofile;
    s_wsfe(&io__29);
    do_fio(&c__1, (char *)&blank_1.value[locv - 1], (ftnlen)sizeof(doublereal)
	    );
    e_wsfe();
/*<    31 format('0*error*:  nsub <= ni in mosfet model ',a8,/) >*/
/*<       nogo=1 >*/
    flags_1.nogo = 1;

/*   special processing for mos3: limit kappa>0, */
/*   set to zero lambda,ucrit,uexp and utar */

/*<    33 if (lev.ne.3) go to 34 >*/
L33:
    if (lev != 3) {
	goto L34;
    }
/*<       if (value(locv+42).eq.aundef) value(locv+42)=0.2d0 >*/
    if (blank_1.value[locv + 41] == aundef) {
	blank_1.value[locv + 41] = .2;
    }
/*<       value(locv+6)=0.0d0 >*/
    blank_1.value[locv + 5] = 0.;
/*<       value(locv+30)=0.0d0 >*/
    blank_1.value[locv + 29] = 0.;
/*<       value(locv+31)=0.0d0 >*/
    blank_1.value[locv + 30] = 0.;
/*<       value(locv+32)=0.0d0 >*/
    blank_1.value[locv + 31] = 0.;
/*<    34 loc=nodplc(loc) >*/
L34:
    loc = nodplc[loc - 1];
/*<       go to 5 >*/
    goto L5;

/*     cycle thru devices */

/*<    35 kntlim=lwidth/11 >*/
L35:
    kntlim = miscel_1.lwidth / 11;
/*<       do 390 id=1,4 >*/
    for (id = 1; id <= 4; ++id) {
/*<       if (jelcnt(id+20).eq.0) go to 390 >*/
	if (cirdat_1.jelcnt[id + 19] == 0) {
	    goto L390;
	}
/*<       locm=ipar(id) >*/
	locm = ipar[id - 1];
/*<       nopar=ipar(id+1)-locm >*/
	nopar = ipar[id] - locm;
/*<       do 45 i=1,nopar >*/
	i_1 = nopar;
	for (i = 1; i <= i_1; ++i) {
/*<       if (ifmt(locm+i).ge.3) go to 40 >*/
	    if (ifmt[locm + i - 1] >= 3) {
		goto L40;
	    }
/*<       itab(i)=0 >*/
	    itab[i - 1] = 0;
/*<       go to 45 >*/
	    goto L45;
/*<    40 itab(i)=ifmt(locm+i)-2 >*/
L40:
	    itab[i - 1] = ifmt[locm + i - 1] - 2;
/*<    45 continue >*/
L45:
	;}

/*  assign default values */

/*<       loc=locate(id+20) >*/
	loc = cirdat_1.locate[id + 19];
/*<    50 if (loc.eq.0) go to 70 >*/
L50:
	if (loc == 0) {
	    goto L70;
	}
/*<       locv=nodplc(loc+1) >*/
	locv = nodplc[loc];
/*<       do 65 i=1,nopar >*/
	i_1 = nopar;
	for (i = 1; i <= i_1; ++i) {
/*<       if (value(locv+i).eq.aundef) go to 62 >*/
	    if (blank_1.value[locv + i - 1] == aundef) {
		goto L62;
	    }
/*<       if (ivchk(locm+i).lt.0) go to 55 >*/
	    if (ivchk[locm + i - 1] < 0) {
		goto L55;
	    }
/*<       if (value(locv+i).lt.0.0d0) go to 62 >*/
	    if (blank_1.value[locv + i - 1] < 0.) {
		goto L62;
	    }
/*<    55 if (itab(i).ne.0) go to 65 >*/
L55:
	    if (itab[i - 1] != 0) {
		goto L65;
	    }
/*<       itab(i)=ifmt(locm+i) >*/
	    itab[i - 1] = ifmt[locm + i - 1];
/*<       go to 65 >*/
	    goto L65;
/*<    62 value(locv+i)=defval(locm+i) >*/
L62:
	    blank_1.value[locv + i - 1] = defval[locm + i - 1];
/*<    65 continue >*/
L65:
	;}
/*<       loc=nodplc(loc) >*/
	loc = nodplc[loc - 1];
/*<       go to 50 >*/
	goto L50;

/*     limit model values */

/*<    70 go to (80,85,90,95), id >*/
L70:
	switch (id) {
	    case 1:  goto L80;
	    case 2:  goto L85;
	    case 3:  goto L90;
	    case 4:  goto L95;
	}
/* ...  diodes */
/*<    80 loc=locate(21) >*/
L80:
	loc = cirdat_1.locate[20];
/*<    82 if (loc.eq.0) go to 130 >*/
L82:
	if (loc == 0) {
	    goto L130;
	}
/*<       locv=nodplc(loc+1) >*/
	locv = nodplc[loc];
/*<       value(locv+7)=dmin1(value(locv+7),0.9d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 6];
	blank_1.value[locv + 6] = min(.9,d_1);
/*<       value(locv+8)=dmax1(value(locv+8),0.1d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 7];
	blank_1.value[locv + 7] = max(.1,d_1);
/*<       value(locv+11)=dmax1(value(locv+11),0.1d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 10];
	blank_1.value[locv + 10] = max(.1,d_1);
/*<       value(locv+12)=dmin1(value(locv+12),0.95d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 11];
	blank_1.value[locv + 11] = min(.95,d_1);
/*<       loc=nodplc(loc) >*/
	loc = nodplc[loc - 1];
/*<       go to 82 >*/
	goto L82;
/* ...  bipolar transistors */
/*<    85 loc=locate(22) >*/
L85:
	loc = cirdat_1.locate[21];
/*<    87 if (loc.eq.0) go to 130 >*/
L87:
	if (loc == 0) {
	    goto L130;
	}
/*<       locv=nodplc(loc+1) >*/
	locv = nodplc[loc];
/*<       value(locv+23)=dmin1(value(locv+23),0.9d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 22];
	blank_1.value[locv + 22] = min(.9,d_1);
/*<       if (value(locv+24).eq.0.0d0) value(locv+28)=0.0d0 >*/
	if (blank_1.value[locv + 23] == 0.) {
	    blank_1.value[locv + 27] = 0.;
	}
/*<       value(locv+31)=dmin1(value(locv+31),0.9d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 30];
	blank_1.value[locv + 30] = min(.9,d_1);
/*<       value(locv+32)=dmin1(value(locv+32),1.0d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 31];
	blank_1.value[locv + 31] = min(1.,d_1);
/*<       value(locv+40)=dmin1(value(locv+40),0.9d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 39];
	blank_1.value[locv + 39] = min(.9,d_1);
/*<       value(locv+42)=dmax1(value(locv+42),0.1d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 41];
	blank_1.value[locv + 41] = max(.1,d_1);
/*<       value(locv+45)=dmax1(value(locv+45),0.1d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 44];
	blank_1.value[locv + 44] = max(.1,d_1);
/*<       value(locv+46)=dmin1(value(locv+46),0.9999d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 45];
	blank_1.value[locv + 45] = min(.9999,d_1);
/*<       loc=nodplc(loc) >*/
	loc = nodplc[loc - 1];
/*<       if (value(locv+18).eq.0.0d0) value(locv+18)=value(locv+16) >*/
	if (blank_1.value[locv + 17] == 0.) {
	    blank_1.value[locv + 17] = blank_1.value[locv + 15];
	}
/*<       if (value(locv+16).ge.value(locv+18)) go to 87 >*/
	if (blank_1.value[locv + 15] >= blank_1.value[locv + 17]) {
	    goto L87;
	}
/*<       write(iofile,89) value(locv) >*/
	io__36.ciunit = status_1.iofile;
	s_wsfe(&io__36);
	do_fio(&c__1, (char *)&blank_1.value[locv - 1], (ftnlen)sizeof(
		doublereal));
	e_wsfe();
/*<    89 format('0warning:  minimum base resistance (rbm) is less than ' >*/
/*<      1       ,'total (rb) for model ',a8,/10x,' rbm set equal to rb',/) >*/
/*<       value(locv+18)=value(locv+16) >*/
	blank_1.value[locv + 17] = blank_1.value[locv + 15];
/*<       go to 87 >*/
	goto L87;
/* ...  jfets */
/*<    90 loc=locate(23) >*/
L90:
	loc = cirdat_1.locate[22];
/*<    92 if (loc.eq.0) go to 130 >*/
L92:
	if (loc == 0) {
	    goto L130;
	}
/*<       locv=nodplc(loc+1) >*/
	locv = nodplc[loc];
/*<       value(locv+11)=dmax1(value(locv+11),0.1d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 10];
	blank_1.value[locv + 10] = max(.1,d_1);
/*<       value(locv+12)=dmin1(value(locv+12),0.95d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 11];
	blank_1.value[locv + 11] = min(.95,d_1);
/*<       loc=nodplc(loc) >*/
	loc = nodplc[loc - 1];
/*<       go to 92 >*/
	goto L92;
/* ...  mosfets */
/*<    95 loc=locate(24) >*/
L95:
	loc = cirdat_1.locate[23];
/*<    97 if (loc.eq.0) go to 130 >*/
L97:
	if (loc == 0) {
	    goto L130;
	}
/*<       locv=nodplc(loc+1) >*/
	locv = nodplc[loc];

/*<   100 value(locv+37)=dmax1(value(locv+37),0.1d0) >*/
/* L100: */
/* Computing MAX */
	d_1 = blank_1.value[locv + 36];
	blank_1.value[locv + 36] = max(.1,d_1);
/*<       value(locv+38)=dmin1(value(locv+38),0.95d0) >*/
/* Computing MAX */
	d_1 = blank_1.value[locv + 37];
	blank_1.value[locv + 37] = min(.95,d_1);
/*<       if (value(locv+23).le.0.0d0) go to 120 >*/
	if (blank_1.value[locv + 22] <= 0.) {
	    goto L120;
	}
/*<       cj=dsqrt(epssil*charge*value(locv+23)*1.0d6/ >*/
/*<      1   (2.0d0*value(locv+12))) >*/
	cj = sqrt(knstnt_1.epssil * knstnt_1.charge * blank_1.value[locv + 22]
		 * 1e6 / (blank_1.value[locv + 11] * 2.));
/*<       if (value(locv+9).le.0.0d0) go to 105 >*/
	if (blank_1.value[locv + 8] <= 0.) {
	    goto L105;
	}
/*<       itab(9)=2 >*/
	itab[8] = 2;
/*<   105 if (value(locv+10).le.0.0d0) go to 110 >*/
L105:
	if (blank_1.value[locv + 9] <= 0.) {
	    goto L110;
	}
/*<       itab(10)=2 >*/
	itab[9] = 2;
/*<       go to 115 >*/
	goto L115;
/*<   110 if (value(locv+17).le.0.0d0) value(locv+17)=cj >*/
L110:
	if (blank_1.value[locv + 16] <= 0.) {
	    blank_1.value[locv + 16] = cj;
	}
/*<       itab(17)=2 >*/
	itab[16] = 2;
/*<   115 if ((value(locv+7).le.0.0d0).and. >*/
/*<      1    (value(locv+8).le.0.0d0)) go to 120 >*/
L115:
	if (blank_1.value[locv + 6] <= 0. && blank_1.value[locv + 7] <= 0.) {
	    goto L120;
	}
/*<       itab(7)=2 >*/
	itab[6] = 2;
/*<       itab(8)=2 >*/
	itab[7] = 2;
/*<   120 if (value(locv+6).ge.0.2d0) write (iofile,121) value(locv) >*/
L120:
	if (blank_1.value[locv + 5] >= .2) {
	    io__38.ciunit = status_1.iofile;
	    s_wsfe(&io__38);
	    do_fio(&c__1, (char *)&blank_1.value[locv - 1], (ftnlen)sizeof(
		    doublereal));
	    e_wsfe();
	}
/*<   121 format ('0warning:  the value of lambda for mosfet model ',a8,/, >*/
/*<      1   ' is unusually large and might cause nonconvergence',/) >*/
/*<       if (lev.ne.2) value(locv+35)=1.0d0 >*/
	if (lev != 2) {
	    blank_1.value[locv + 34] = 1.;
	}
/*<       if (lev.ne.3) go to 125 >*/
	if (lev != 3) {
	    goto L125;
	}
/*<       itab(40)=1 >*/
	itab[39] = 1;
/*<       itab(41)=1 >*/
	itab[40] = 1;
/*<       itab(42)=1 >*/
	itab[41] = 1;
/*<       itab(43)=1 >*/
	itab[42] = 1;
/*<   125 loc=nodplc(loc) >*/
L125:
	loc = nodplc[loc - 1];
/*<       go to 97 >*/
	goto L97;

/*     print model parameters */

/*<   130 if (iprntm.eq.0) go to 360 >*/
L130:
	if (flags_1.iprntm == 0) {
	    goto L360;
	}
/*<       locs=locate(id+20) >*/
	locs = cirdat_1.locate[id + 19];
/*<   140 kntr=0 >*/
L140:
	kntr = 0;
/*<       loc=locs >*/
	loc = locs;
/*<       go to (150,160,170,180), id >*/
	switch (id) {
	    case 1:  goto L150;
	    case 2:  goto L160;
	    case 3:  goto L170;
	    case 4:  goto L180;
	}
/*<   150 call title(0,lwidth,1,titled) >*/
L150:
	title_(&c__0, &miscel_1.lwidth, &c__1, titled);
/*<       go to 200 >*/
	goto L200;
/*<   160 call title(0,lwidth,1,titleb) >*/
L160:
	title_(&c__0, &miscel_1.lwidth, &c__1, titleb);
/*<       go to 200 >*/
	goto L200;
/*<   170 call title(0,lwidth,1,titlej) >*/
L170:
	title_(&c__0, &miscel_1.lwidth, &c__1, titlej);
/*<       go to 200 >*/
	goto L200;
/*<   180 call title(0,lwidth,1,titlem) >*/
L180:
	title_(&c__0, &miscel_1.lwidth, &c__1, titlem);
/*<   200 if (loc.eq.0) go to 210 >*/
L200:
	if (loc == 0) {
	    goto L210;
	}
/*<       if (kntr.lt.kntlim) go to 220 >*/
	if (kntr < kntlim) {
	    goto L220;
	}
/*<   210 locn=loc >*/
L210:
	locn = loc;
/*<       go to 240 >*/
	goto L240;
/*<   220 kntr=kntr+1 >*/
L220:
	++kntr;
/*<       locv=nodplc(loc+1) >*/
	locv = nodplc[loc];
/*<       atable(kntr)=value(locv) >*/
	atable[kntr - 1] = blank_1.value[locv - 1];
/*<   230 loc=nodplc(loc) >*/
/* L230: */
	loc = nodplc[loc - 1];
/*<       go to 200 >*/
	goto L200;
/*<   240 write (iofile,241) (atable(k),k=1,kntr) >*/
L240:
	io__43.ciunit = status_1.iofile;
	s_wsfe(&io__43);
	i_1 = kntr;
	for (k = 1; k <= i_1; ++k) {
	    do_fio(&c__1, (char *)&atable[k - 1], (ftnlen)sizeof(doublereal));

	}
	e_wsfe();
/*<   241 format(//11x,12(2x,a8)) >*/
/*<       if (id.eq.1) go to 300 >*/
	if (id == 1) {
	    goto L300;
	}
/*<       kntr=0 >*/
	kntr = 0;
/*<       loc=locs >*/
	loc = locs;
/*<   250 if (loc.eq.0) go to 260 >*/
L250:
	if (loc == 0) {
	    goto L260;
	}
/*<       if (kntr.ge.kntlim) go to 260 >*/
	if (kntr >= kntlim) {
	    goto L260;
	}
/*<       kntr=kntr+1 >*/
	++kntr;
/*<       atable(kntr)=antype(id) >*/
	atable[kntr - 1] = antype[id - 1];
/*<       if (nodplc(loc+2).eq.-1) atable(kntr)=aptype(id) >*/
	if (nodplc[loc + 1] == -1) {
	    atable[kntr - 1] = aptype[id - 1];
	}
/*<       loc=nodplc(loc) >*/
	loc = nodplc[loc - 1];
/*<       go to 250 >*/
	goto L250;
/*<   260 write (iofile,261) (atable(k),k=1,kntr) >*/
L260:
	io__45.ciunit = status_1.iofile;
	s_wsfe(&io__45);
	i_1 = kntr;
	for (k = 1; k <= i_1; ++k) {
	    do_fio(&c__1, (char *)&atable[k - 1], (ftnlen)sizeof(doublereal));

	}
	e_wsfe();
/*<   261 format('0type',4x,12(4x,a6)) >*/
/*<   300 do 340 i=1,nopar >*/
L300:
	i_1 = nopar;
	for (i = 1; i <= i_1; ++i) {
/*<       if (itab(i).eq.0) go to 340 >*/
	    if (itab[i - 1] == 0) {
		goto L340;
	    }
/*<       kntr=0 >*/
	    kntr = 0;
/*<       iccflg=0 >*/
	    iccflg = 0;
/*<       loc=locs >*/
	    loc = locs;
/*<   310 if (loc.eq.0) go to 320 >*/
L310:
	    if (loc == 0) {
		goto L320;
	    }
/*<       if (kntr.ge.kntlim) go to 320 >*/
	    if (kntr >= kntlim) {
		goto L320;
	    }
/*<       locv=nodplc(loc+1) >*/
	    locv = nodplc[loc];
/*<       kntr=kntr+1 >*/
	    ++kntr;
/*<       if (iccflg.ne.0) go to 313 >*/
	    if (iccflg != 0) {
		goto L313;
	    }
/*<       if (id.ne.2) go to 315 >*/
	    if (id != 2) {
		goto L315;
	    }
/*<       if ((i.ne.6).and.(i.ne.12)) go to 315 >*/
	    if (i != 6 && i != 12) {
		goto L315;
	    }
/*<       if (value(locv+i).le.1.0d0) go to 315 >*/
	    if (blank_1.value[locv + i - 1] <= 1.) {
		goto L315;
	    }
/*<       iccflg=i/6 >*/
	    iccflg = i / 6;
/*<   313 btable(kntr)=value(locv+i) >*/
L313:
	    btable[kntr - 1] = blank_1.value[locv + i - 1];
/*<       value(locv+i)=value(locv+i)*value(locv+1) >*/
	    blank_1.value[locv + i - 1] *= blank_1.value[locv];
/*<   315 atable(kntr)=value(locv+i) >*/
L315:
	    atable[kntr - 1] = blank_1.value[locv + i - 1];
/*<       loc=nodplc(loc) >*/
	    loc = nodplc[loc - 1];
/*<       go to 310 >*/
	    goto L310;
/*<   320 if (itab(i).eq.2) go to 330 >*/
L320:
	    if (itab[i - 1] == 2) {
		goto L330;
	    }
/*<       write (iofile,321) ampar(locm+i),(atable(k),k=1,kntr) >*/
	    io__48.ciunit = status_1.iofile;
	    s_wsfe(&io__48);
	    do_fio(&c__1, (char *)&ampar[locm + i - 1], (ftnlen)sizeof(
		    doublereal));
	    i_2 = kntr;
	    for (k = 1; k <= i_2; ++k) {
		do_fio(&c__1, (char *)&atable[k - 1], (ftnlen)sizeof(
			doublereal));
	    }
	    e_wsfe();
/*<   321 format(1h0,a8,12f10.3) >*/
/*<       go to 340 >*/
	    goto L340;
/*<   330 write (iofile,331) ampar(locm+i),(atable(k),k=1,kntr) >*/
L330:
	    io__49.ciunit = status_1.iofile;
	    s_wsfe(&io__49);
	    do_fio(&c__1, (char *)&ampar[locm + i - 1], (ftnlen)sizeof(
		    doublereal));
	    i_2 = kntr;
	    for (k = 1; k <= i_2; ++k) {
		do_fio(&c__1, (char *)&atable[k - 1], (ftnlen)sizeof(
			doublereal));
	    }
	    e_wsfe();
/*<   331 format(1h0,a8,1p12d10.2) >*/
/*<       if (iccflg.eq.0) go to 340 >*/
	    if (iccflg == 0) {
		goto L340;
	    }
/*<       write (iofile,321) cpar(iccflg),(btable(k),k=1,kntr) >*/
	    io__50.ciunit = status_1.iofile;
	    s_wsfe(&io__50);
	    do_fio(&c__1, (char *)&cpar[iccflg - 1], (ftnlen)sizeof(
		    doublereal));
	    i_2 = kntr;
	    for (k = 1; k <= i_2; ++k) {
		do_fio(&c__1, (char *)&btable[k - 1], (ftnlen)sizeof(
			doublereal));
	    }
	    e_wsfe();
/*<   340 continue >*/
L340:
	;}
/*<       if (locn.eq.0) go to 390 >*/
	if (locn == 0) {
	    goto L390;
	}
/*<       locs=locn >*/
	locs = locn;
/*<       go to 140 >*/
	goto L140;

/*  special  treatment for c2 & c4 in the bjt model */
/*  when no model parameter print */

/*<   360 if (id.ne.2) go to 390 >*/
L360:
	if (id != 2) {
	    goto L390;
	}
/*<       loc=locate(id+20) >*/
	loc = cirdat_1.locate[id + 19];
/*<   370 if (loc.eq.0) go to 390 >*/
L370:
	if (loc == 0) {
	    goto L390;
	}
/*<       locv=nodplc(loc+1) >*/
	locv = nodplc[loc];
/*<       if (value(locv+6).ge.1.0d0) >*/
/*<      1   value(locv+6)=value(locv+6)*value(locv+1) >*/
	if (blank_1.value[locv + 5] >= 1.) {
	    blank_1.value[locv + 5] *= blank_1.value[locv];
	}
/*<       if (value(locv+12).ge.1.0d0) >*/
/*<      1   value(locv+12)=value(locv+12)*value(locv+1) >*/
	if (blank_1.value[locv + 11] >= 1.) {
	    blank_1.value[locv + 11] *= blank_1.value[locv];
	}
/*<       loc=nodplc(loc) >*/
	loc = nodplc[loc - 1];
/*<       go to 370 >*/
	goto L370;
/*<   390 continue >*/
L390:
    ;}

/*  process model parameters */

/*  diodes */

/*<   400 loc=locate(21) >*/
/* L400: */
    loc = cirdat_1.locate[20];
/*<   410 if (loc.eq.0) go to 420 >*/
L410:
    if (loc == 0) {
	goto L420;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       if (value(locv+2).ne.0.0d0) value(locv+2)=1.0d0/value(locv+2) >*/
    if (blank_1.value[locv + 1] != 0.) {
	blank_1.value[locv + 1] = 1. / blank_1.value[locv + 1];
    }
/*<       pb=value(locv+6) >*/
    pb = blank_1.value[locv + 5];
/*<       xm=value(locv+7) >*/
    xm = blank_1.value[locv + 6];
/*<       fc=value(locv+12) >*/
    fc = blank_1.value[locv + 11];
/*<       value(locv+12)=fc*pb >*/
    blank_1.value[locv + 11] = fc * pb;
/*<       xfc=dlog(1.0d0-fc) >*/
    xfc = log(1. - fc);
/*<       value(locv+15)=pb*(1.0d0-dexp((1.0d0-xm)*xfc))/(1.0d0-xm) >*/
    blank_1.value[locv + 14] = pb * (1. - exp((1. - xm) * xfc)) / (1. - xm);
/*<       value(locv+16)=dexp((1.0d0+xm)*xfc) >*/
    blank_1.value[locv + 15] = exp((xm + 1.) * xfc);
/*<       value(locv+17)=1.0d0-fc*(1.0d0+xm) >*/
    blank_1.value[locv + 16] = 1. - fc * (xm + 1.);
/*<       csat=value(locv+1) >*/
    csat = blank_1.value[locv];
/*<       vte=value(locv+3)*vt >*/
    vte = blank_1.value[locv + 2] * status_1.vt;
/*<       value(locv+18)=vte*dlog(vte/(root2*csat)) >*/
    blank_1.value[locv + 17] = vte * log(vte / (knstnt_1.root2 * csat));
/*<       bv=value(locv+13) >*/
    bv = blank_1.value[locv + 12];
/*<       if (bv.eq.0) go to 418 >*/
    if (bv == 0.) {
	goto L418;
    }
/*<       cbv=value(locv+14) >*/
    cbv = blank_1.value[locv + 13];
/*<       if (cbv.ge.csat*bv/vt) go to 412 >*/
    if (cbv >= csat * bv / status_1.vt) {
	goto L412;
    }
/*<       cbv=csat*bv/vt >*/
    cbv = csat * bv / status_1.vt;
/*<       write (iofile,411) value(locv),cbv >*/
    io__59.ciunit = status_1.iofile;
    s_wsfe(&io__59);
    do_fio(&c__1, (char *)&blank_1.value[locv - 1], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&cbv, (ftnlen)sizeof(doublereal));
    e_wsfe();
/*<   411 format('0warning:  in diode model ',a8,' ibv increased to ',1pe10. >*/
/*<      1   3,11x,'to resolve incompatibility with specified is'/) >*/
/*<       xbv=bv >*/
    xbv = bv;
/*<       go to 416 >*/
    goto L416;
/*<   412 tol=reltol*cbv >*/
L412:
    tol = knstnt_1.reltol * cbv;
/*<       xbv=bv-vt*dlog(1.0d0+cbv/csat) >*/
    xbv = bv - status_1.vt * log(cbv / csat + 1.);
/*<       iter=0 >*/
    iter = 0;
/*<   413 xbv=bv-vt*dlog(cbv/csat+1.0d0-xbv/vt) >*/
L413:
    xbv = bv - status_1.vt * log(cbv / csat + 1. - xbv / status_1.vt);
/*<       xcbv=csat*(dexp((bv-xbv)/vt)-1.0d0+xbv/vt) >*/
    xcbv = csat * (exp((bv - xbv) / status_1.vt) - 1. + xbv / status_1.vt);
/*<       if (dabs(xcbv-cbv).le.tol) go to 416 >*/
    if ((d_1 = xcbv - cbv, abs(d_1)) <= tol) {
	goto L416;
    }
/*<       iter=iter+1 >*/
    ++iter;
/*<       if (iter.lt.25) go to 413 >*/
    if (iter < 25) {
	goto L413;
    }
/*<       write (iofile,415) xbv,xcbv >*/
    io__64.ciunit = status_1.iofile;
    s_wsfe(&io__64);
    do_fio(&c__1, (char *)&xbv, (ftnlen)sizeof(doublereal));
    do_fio(&c__1, (char *)&xcbv, (ftnlen)sizeof(doublereal));
    e_wsfe();
/*<   415 format('0warning:  unable to match forward and reverse diode regio >*/
/*<      1ns',/,11x,'bv = ',1pd10.3,' and ibv = ',d10.3,/) >*/
/*<   416 value(locv+13)=xbv >*/
L416:
    blank_1.value[locv + 12] = xbv;
/*<   418 loc=nodplc(loc) >*/
L418:
    loc = nodplc[loc - 1];
/*<       go to 410 >*/
    goto L410;

/*  bipolar transistor models */

/*<   420 loc=locate(22) >*/
L420:
    loc = cirdat_1.locate[21];
/*<   430 if (loc.eq.0) go to 440 >*/
L430:
    if (loc == 0) {
	goto L440;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       if (value(locv+4).ne.0.0d0) value(locv+4)=1.0d0/value(locv+4) >*/
    if (blank_1.value[locv + 3] != 0.) {
	blank_1.value[locv + 3] = 1. / blank_1.value[locv + 3];
    }
/*<       if (value(locv+5).ne.0.0d0) value(locv+5)=1.0d0/value(locv+5) >*/
    if (blank_1.value[locv + 4] != 0.) {
	blank_1.value[locv + 4] = 1. / blank_1.value[locv + 4];
    }
/*<       if (value(locv+10).ne.0.0d0) value(locv+10)=1.0d0/value(locv+10) >*/
    if (blank_1.value[locv + 9] != 0.) {
	blank_1.value[locv + 9] = 1. / blank_1.value[locv + 9];
    }
/*<       if (value(locv+11).ne.0.0d0) value(locv+11)=1.0d0/value(locv+11) >*/
    if (blank_1.value[locv + 10] != 0.) {
	blank_1.value[locv + 10] = 1. / blank_1.value[locv + 10];
    }
/*<       if (value(locv+19).ne.0.0d0) value(locv+19)=1.0d0/value(locv+19) >*/
    if (blank_1.value[locv + 18] != 0.) {
	blank_1.value[locv + 18] = 1. / blank_1.value[locv + 18];
    }
/*<       if (value(locv+20).ne.0.0d0) value(locv+20)=1.0d0/value(locv+20) >*/
    if (blank_1.value[locv + 19] != 0.) {
	blank_1.value[locv + 19] = 1. / blank_1.value[locv + 19];
    }
/*<       if (value(locv+26).ne.0.0d0) value(locv+26)=1.0d0/value(locv+26) >*/
/*<      1   /1.44d0 >*/
    if (blank_1.value[locv + 25] != 0.) {
	blank_1.value[locv + 25] = 1. / blank_1.value[locv + 25] / 1.44;
    }
/*<       value(locv+28)=value(locv+28)/rad*value(locv+24) >*/
    blank_1.value[locv + 27] = blank_1.value[locv + 27] / knstnt_1.rad * 
	    blank_1.value[locv + 23];
/*<       if (value(locv+35).ne.0.0d0) value(locv+35)=1.0d0/value(locv+35) >*/
/*<      1   /1.44d0 >*/
    if (blank_1.value[locv + 34] != 0.) {
	blank_1.value[locv + 34] = 1. / blank_1.value[locv + 34] / 1.44;
    }
/*<       pe=value(locv+22) >*/
    pe = blank_1.value[locv + 21];
/*<       xme=value(locv+23) >*/
    xme = blank_1.value[locv + 22];
/*<       pc=value(locv+30) >*/
    pc = blank_1.value[locv + 29];
/*<       xmc=value(locv+31) >*/
    xmc = blank_1.value[locv + 30];
/*<       fc=value(locv+46) >*/
    fc = blank_1.value[locv + 45];
/*<       value(locv+46)=fc*pe >*/
    blank_1.value[locv + 45] = fc * pe;
/*<       xfc=dlog(1.0d0-fc) >*/
    xfc = log(1. - fc);
/*<       value(locv+47)=pe*(1.0d0-dexp((1.0d0-xme)*xfc))/(1.0d0-xme) >*/
    blank_1.value[locv + 46] = pe * (1. - exp((1. - xme) * xfc)) / (1. - xme);

/*<       value(locv+48)=dexp((1.0d0+xme)*xfc) >*/
    blank_1.value[locv + 47] = exp((xme + 1.) * xfc);
/*<       value(locv+49)=1.0d0-fc*(1.0d0+xme) >*/
    blank_1.value[locv + 48] = 1. - fc * (xme + 1.);
/*<       value(locv+50)=fc*pc >*/
    blank_1.value[locv + 49] = fc * pc;
/*<       value(locv+51)=pc*(1.0d0-dexp((1.0d0-xmc)*xfc))/(1.0d0-xmc) >*/
    blank_1.value[locv + 50] = pc * (1. - exp((1. - xmc) * xfc)) / (1. - xmc);

/*<       value(locv+52)=dexp((1.0d0+xmc)*xfc) >*/
    blank_1.value[locv + 51] = exp((xmc + 1.) * xfc);
/*<       value(locv+53)=1.0d0-fc*(1.0d0+xmc) >*/
    blank_1.value[locv + 52] = 1. - fc * (xmc + 1.);
/*<       csat=value(locv+1) >*/
    csat = blank_1.value[locv];
/*<       value(locv+54)=vt*dlog(vt/(root2*csat)) >*/
    blank_1.value[locv + 53] = status_1.vt * log(status_1.vt / (
	    knstnt_1.root2 * csat));
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 430 >*/
    goto L430;

/*  jfet models */

/*<   440 loc=locate(23) >*/
L440:
    loc = cirdat_1.locate[22];
/*<   450 if (loc.eq.0) go to 460 >*/
L450:
    if (loc == 0) {
	goto L460;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       if (value(locv+4).ne.0.0d0) value(locv+4)=1.0d0/value(locv+4) >*/
    if (blank_1.value[locv + 3] != 0.) {
	blank_1.value[locv + 3] = 1. / blank_1.value[locv + 3];
    }
/*<       if (value(locv+5).ne.0.0d0) value(locv+5)=1.0d0/value(locv+5) >*/
    if (blank_1.value[locv + 4] != 0.) {
	blank_1.value[locv + 4] = 1. / blank_1.value[locv + 4];
    }
/*<       pb=value(locv+8) >*/
    pb = blank_1.value[locv + 7];
/*<       xm=0.5d0 >*/
    xm = .5;
/*<       fc=value(locv+12) >*/
    fc = blank_1.value[locv + 11];
/*<       value(locv+12)=fc*pb >*/
    blank_1.value[locv + 11] = fc * pb;
/*<       xfc=dlog(1.0d0-fc) >*/
    xfc = log(1. - fc);
/*<       value(locv+13)=pb*(1.0d0-dexp((1.0d0-xm)*xfc))/(1.0d0-xm) >*/
    blank_1.value[locv + 12] = pb * (1. - exp((1. - xm) * xfc)) / (1. - xm);
/*<       value(locv+14)=dexp((1.0d0+xm)*xfc) >*/
    blank_1.value[locv + 13] = exp((xm + 1.) * xfc);
/*<       value(locv+15)=1.0d0-fc*(1.0d0+xm) >*/
    blank_1.value[locv + 14] = 1. - fc * (xm + 1.);
/*<       csat=value(locv+9) >*/
    csat = blank_1.value[locv + 8];
/*<       value(locv+16)=vt*dlog(vt/(root2*csat)) >*/
    blank_1.value[locv + 15] = status_1.vt * log(status_1.vt / (
	    knstnt_1.root2 * csat));
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 450 >*/
    goto L450;

/*  mosfet models */

/*<   460 loc=locate(24) >*/
L460:
    loc = cirdat_1.locate[23];
/*<   470 if (loc.eq.0) go to 600 >*/
L470:
    if (loc == 0) {
	goto L600;
    }
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       type=nodplc(loc+2) >*/
    type = (doublereal) nodplc[loc + 1];
/*<       if (value(locv+7).ne.0.0d0) value(locv+7)=1.0d0/value(locv+7) >*/
    if (blank_1.value[locv + 6] != 0.) {
	blank_1.value[locv + 6] = 1. / blank_1.value[locv + 6];
    }
/*<       if (value(locv+8).ne.0.0d0) value(locv+8)=1.0d0/value(locv+8) >*/
    if (blank_1.value[locv + 7] != 0.) {
	blank_1.value[locv + 7] = 1. / blank_1.value[locv + 7];
    }
/*<       if (value(locv+16).ne.0.0d0) value(locv+16)=1.0d0/value(locv+16) >*/
    if (blank_1.value[locv + 15] != 0.) {
	blank_1.value[locv + 15] = 1. / blank_1.value[locv + 15];
    }
/*<       value(locv+23)=value(locv+23)*1.0d6 >*/
    blank_1.value[locv + 22] *= 1e6;
/*<       value(locv+24)=value(locv+24)*1.0d4 >*/
    blank_1.value[locv + 23] *= 1e4;
/*<       value(locv+25)=value(locv+25)*1.0d4 >*/
    blank_1.value[locv + 24] *= 1e4;
/*<       if (value(locv+22).ne.0.0d0) value(locv+22)=epsox/value(locv+22) >*/
    if (blank_1.value[locv + 21] != 0.) {
	blank_1.value[locv + 21] = knstnt_1.epsox / blank_1.value[locv + 21];
    }
/*<       value(locv+29)=value(locv+29)*1.0d-4 >*/
    blank_1.value[locv + 28] *= 1e-4;
/*<       if (lev.eq.3) go to 472 >*/
    if (lev == 3) {
	goto L472;
    }
/*<       value(locv+30)=value(locv+30)*1.0d2 >*/
    blank_1.value[locv + 29] *= 100.;
/*<       go to 473 >*/
    goto L473;

/*   move mos3 parameters : theta from locations locv+40 to locv+30 */
/*                          eta                       41         31 */
/*                          kappa                     42         32 */
/*   and replace locv+6 by (xd)**2 */

/*<   472 value(locv+39)=value(locv+39) >*/
/*<      1   *0.25d0*twopi*epssil/value(locv+22) >*/
L472:
    blank_1.value[locv + 38] = blank_1.value[locv + 38] * .25 * 
	    knstnt_1.twopi * knstnt_1.epssil / blank_1.value[locv + 21];
/*<       value(locv+30)=value(locv+40) >*/
    blank_1.value[locv + 29] = blank_1.value[locv + 39];
/*<       value(locv+31)=value(locv+41)*8.15d-22/value(locv+22) >*/
    blank_1.value[locv + 30] = blank_1.value[locv + 40] * 8.15e-22 / 
	    blank_1.value[locv + 21];
/*<       value(locv+32)=value(locv+42) >*/
    blank_1.value[locv + 31] = blank_1.value[locv + 41];
/*<       if (value(locv+23).gt.0.0d0) >*/
/*<      1    value(locv+6)=(epssil+epssil)/(charge*value(locv+23)) >*/
    if (blank_1.value[locv + 22] > 0.) {
	blank_1.value[locv + 5] = (knstnt_1.epssil + knstnt_1.epssil) / (
		knstnt_1.charge * blank_1.value[locv + 22]);
    }

/*   noise parameters */

/*<   473 pb=value(locv+12) >*/
L473:
    pb = blank_1.value[locv + 11];
/*<       xm=0.5d0 >*/
    xm = .5;
/*<       fc=value(locv+38) >*/
    fc = blank_1.value[locv + 37];
/*<       value(locv+38)=fc*pb >*/
    blank_1.value[locv + 37] = fc * pb;
/*<       xfc=dlog(1.0d0-fc) >*/
    xfc = log(1. - fc);
/*<       value(locv+40)=pb*(1.0d0-dexp((1.0d0-xm)*xfc))/(1.0d0-xm) >*/
    blank_1.value[locv + 39] = pb * (1. - exp((1. - xm) * xfc)) / (1. - xm);
/*<       value(locv+41)=dexp((1.0d0+xm)*xfc) >*/
    blank_1.value[locv + 40] = exp((xm + 1.) * xfc);
/*<       value(locv+42)=1.0d0-fc*(1.0d0+xm) >*/
    blank_1.value[locv + 41] = 1. - fc * (xm + 1.);
/*<       value(locv+43)=-1.0d0 >*/
    blank_1.value[locv + 42] = -1.;
/*<       value(locv+44)=value(locv+2)- >*/
/*<      1   type*value(locv+4)*dsqrt(value(locv+5)) >*/
    blank_1.value[locv + 43] = blank_1.value[locv + 1] - type * blank_1.value[
	    locv + 3] * sqrt(blank_1.value[locv + 4]);
/*<   475 if (value(locv+22).ne.0.0d0.and.lev.ne.3) >*/
/*<      1   value(locv+30)=value(locv+30)*epssil/value(locv+22) >*/
/* L475: */
    if (blank_1.value[locv + 21] != 0. && lev != 3) {
	blank_1.value[locv + 29] = blank_1.value[locv + 29] * knstnt_1.epssil 
		/ blank_1.value[locv + 21];
    }
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 470 >*/
    goto L470;

/*  reserve additional nodes */

/*  diodes */

/*<   600 loc=locate(11) >*/
L600:
    loc = cirdat_1.locate[10];
/*<   610 if ((loc.eq.0).or.(nodplc(loc+16).ne.0)) go to 700 >*/
L610:
    if (loc == 0 || nodplc[loc + 15] != 0) {
	goto L700;
    }
/*<       locm=nodplc(loc+5) >*/
    locm = nodplc[loc + 4];
/*<       locm=nodplc(locm+1) >*/
    locm = nodplc[locm];
/*<       if (value(locm+2).eq.0.0d0) go to 620 >*/
    if (blank_1.value[locm + 1] == 0.) {
	goto L620;
    }
/*<       numnod=numnod+1 >*/
    ++cirdat_1.numnod;
/*<       nodplc(loc+4)=numnod >*/
    nodplc[loc + 3] = cirdat_1.numnod;
/*<       go to 630 >*/
    goto L630;
/*<   620 nodplc(loc+4)=nodplc(loc+2) >*/
L620:
    nodplc[loc + 3] = nodplc[loc + 1];
/*<   630 loc=nodplc(loc) >*/
L630:
    loc = nodplc[loc - 1];
/*<       go to 610 >*/
    goto L610;

/*  transistors */

/*<   700 loc=locate(12) >*/
L700:
    loc = cirdat_1.locate[11];
/*<   710 if ((loc.eq.0).or.(nodplc(loc+36).ne.0)) go to 800 >*/
L710:
    if (loc == 0 || nodplc[loc + 35] != 0) {
	goto L800;
    }
/*<       nodplc(loc+30)=nodplc(loc+5) >*/
    nodplc[loc + 29] = nodplc[loc + 4];
/*<       locm=nodplc(loc+8) >*/
    locm = nodplc[loc + 7];
/*<       locm=nodplc(locm+1) >*/
    locm = nodplc[locm];
/*<       if (value(locm+16).eq.0.0d0) go to 720 >*/
    if (blank_1.value[locm + 15] == 0.) {
	goto L720;
    }
/*<       numnod=numnod+1 >*/
    ++cirdat_1.numnod;
/*<       nodplc(loc+6)=numnod >*/
    nodplc[loc + 5] = cirdat_1.numnod;
/*<       go to 730 >*/
    goto L730;
/*<   720 nodplc(loc+6)=nodplc(loc+3) >*/
L720:
    nodplc[loc + 5] = nodplc[loc + 2];
/*<   730 if (value(locm+20).eq.0.0d0) go to 740 >*/
L730:
    if (blank_1.value[locm + 19] == 0.) {
	goto L740;
    }
/*<       numnod=numnod+1 >*/
    ++cirdat_1.numnod;
/*<       nodplc(loc+5)=numnod >*/
    nodplc[loc + 4] = cirdat_1.numnod;
/*<       go to 750 >*/
    goto L750;
/*<   740 nodplc(loc+5)=nodplc(loc+2) >*/
L740:
    nodplc[loc + 4] = nodplc[loc + 1];
/*<   750 if (value(locm+19).eq.0.0d0) go to 760 >*/
L750:
    if (blank_1.value[locm + 18] == 0.) {
	goto L760;
    }
/*<       numnod=numnod+1 >*/
    ++cirdat_1.numnod;
/*<       nodplc(loc+7)=numnod >*/
    nodplc[loc + 6] = cirdat_1.numnod;
/*<       go to 770 >*/
    goto L770;
/*<   760 nodplc(loc+7)=nodplc(loc+4) >*/
L760:
    nodplc[loc + 6] = nodplc[loc + 3];
/*<   770 loc=nodplc(loc) >*/
L770:
    loc = nodplc[loc - 1];
/*<       go to 710 >*/
    goto L710;

/*  jfets */

/*<   800 loc=locate(13) >*/
L800:
    loc = cirdat_1.locate[12];
/*<   810 if ((loc.eq.0).or.(nodplc(loc+25).ne.0)) go to 900 >*/
L810:
    if (loc == 0 || nodplc[loc + 24] != 0) {
	goto L900;
    }
/*<       locm=nodplc(loc+7) >*/
    locm = nodplc[loc + 6];
/*<       locm=nodplc(locm+1) >*/
    locm = nodplc[locm];
/*<       if (value(locm+4).eq.0.0d0) go to 820 >*/
    if (blank_1.value[locm + 3] == 0.) {
	goto L820;
    }
/*<       numnod=numnod+1 >*/
    ++cirdat_1.numnod;
/*<       nodplc(loc+5)=numnod >*/
    nodplc[loc + 4] = cirdat_1.numnod;
/*<       go to 830 >*/
    goto L830;
/*<   820 nodplc(loc+5)=nodplc(loc+2) >*/
L820:
    nodplc[loc + 4] = nodplc[loc + 1];
/*<   830 if (value(locm+5).eq.0.0d0) go to 840 >*/
L830:
    if (blank_1.value[locm + 4] == 0.) {
	goto L840;
    }
/*<       numnod=numnod+1 >*/
    ++cirdat_1.numnod;
/*<       nodplc(loc+6)=numnod >*/
    nodplc[loc + 5] = cirdat_1.numnod;
/*<       go to 850 >*/
    goto L850;
/*<   840 nodplc(loc+6)=nodplc(loc+4) >*/
L840:
    nodplc[loc + 5] = nodplc[loc + 3];
/*<   850 loc=nodplc(loc) >*/
L850:
    loc = nodplc[loc - 1];
/*<       go to 810 >*/
    goto L810;

/*  mosfets */

/*<   900 loc=locate(14) >*/
L900:
    loc = cirdat_1.locate[13];
/*<   910 if (loc.eq.0) go to 1000 >*/
L910:
    if (loc == 0) {
	goto L1000;
    }
/*<       locm=nodplc(loc+8) >*/
    locm = nodplc[loc + 7];
/*<       locm=nodplc(locm+1) >*/
    locm = nodplc[locm];
/*<       locv=nodplc(loc+1) >*/
    locv = nodplc[loc];
/*<       xleff=value(locv+1)-2.0d0*value(locm+28) >*/
    xleff = blank_1.value[locv] - blank_1.value[locm + 27] * 2.;
/*<       if (xleff.gt.0.0d0) go to 915 >*/
    if (xleff > 0.) {
	goto L915;
    }
/*<       write(iofile,911) value(locv),value(locm) >*/
    io__70.ciunit = status_1.iofile;
    s_wsfe(&io__70);
    do_fio(&c__1, (char *)&blank_1.value[locv - 1], (ftnlen)sizeof(doublereal)
	    );
    do_fio(&c__1, (char *)&blank_1.value[locm - 1], (ftnlen)sizeof(doublereal)
	    );
    e_wsfe();
/*<   911 format('0*error*:  effective channel length of ',a8,' less than ', >*/
/*<      1   'zero.',/' check value of ld for model ',a8) >*/
/*<       if (nodplc(loc+33).ne.0) go to 960 >*/
    if (nodplc[loc + 32] != 0) {
	goto L960;
    }
/*<   915 if ((value(locm+7).eq.0.0d0).and. >*/
/*<      1    (value(locm+16).eq.0.0d0)) go to 920 >*/
L915:
    if (blank_1.value[locm + 6] == 0. && blank_1.value[locm + 15] == 0.) {
	goto L920;
    }
/*<       numnod=numnod+1 >*/
    ++cirdat_1.numnod;
/*<       nodplc(loc+6)=numnod >*/
    nodplc[loc + 5] = cirdat_1.numnod;
/*<       go to 930 >*/
    goto L930;
/*<   920 nodplc(loc+6)=nodplc(loc+2) >*/
L920:
    nodplc[loc + 5] = nodplc[loc + 1];
/*<   930 if ((value(locm+8).eq.0.0d0).and. >*/
/*<      1    (value(locm+16).eq.0.0d0)) go to 940 >*/
L930:
    if (blank_1.value[locm + 7] == 0. && blank_1.value[locm + 15] == 0.) {
	goto L940;
    }
/*<       numnod=numnod+1 >*/
    ++cirdat_1.numnod;
/*<       nodplc(loc+7)=numnod >*/
    nodplc[loc + 6] = cirdat_1.numnod;
/*<       go to 950 >*/
    goto L950;
/*<   940 nodplc(loc+7)=nodplc(loc+4) >*/
L940:
    nodplc[loc + 6] = nodplc[loc + 3];
/*<   950 ad=value(locv+3) >*/
L950:
    ad = blank_1.value[locv + 2];
/*<       as=value(locv+4) >*/
    as = blank_1.value[locv + 3];
/*<       if ((ad.le.0.0d0).or.(as.le.0.0d0) >*/
/*<      1   .and.value(locm+11).le.0.0d0) >*/
/*<      2   value(locm+11)=1.0d-14 >*/
    if (ad <= 0. || as <= 0. && blank_1.value[locm + 10] <= 0.) {
	blank_1.value[locm + 10] = 1e-14;
    }
/*<   960 loc=nodplc(loc) >*/
L960:
    loc = nodplc[loc - 1];
/*<       go to 910 >*/
    goto L910;

/*  transmission lines */

/*<  1000 loc=locate(17) >*/
L1000:
    loc = cirdat_1.locate[16];
/*<  1010 if ((loc.eq.0).or.(nodplc(loc+33).ne.0)) go to 2000 >*/
L1010:
    if (loc == 0 || nodplc[loc + 32] != 0) {
	goto L2000;
    }
/*<       numnod=numnod+1 >*/
    ++cirdat_1.numnod;
/*<       nodplc(loc+6)=numnod >*/
    nodplc[loc + 5] = cirdat_1.numnod;
/*<       numnod=numnod+1 >*/
    ++cirdat_1.numnod;
/*<       nodplc(loc+7)=numnod >*/
    nodplc[loc + 6] = cirdat_1.numnod;
/*<       loc=nodplc(loc) >*/
    loc = nodplc[loc - 1];
/*<       go to 1010 >*/
    goto L1010;

/*  finished */

/*<  2000 return >*/
L2000:
    return 0;
/*<       end >*/
} /* modchk_ */

#undef cvalue
#undef nodplc
#undef aptype
#undef antype
#undef titlem
#undef titlej
#undef titleb
#undef titled
#undef ampar
#undef aundef
#undef cpar


