/* setplt.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 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 tcstar[2], tcstop[2], tcincr[2];
    integer icvflg, itcelm[2], kssop, kinel, kidin, kovar, kidout;
} dc_;

#define dc_1 dc_

struct {
    doublereal fstart, fstop, fincr, skw2, refprl, spw2;
    integer jacflg, idfreq, inoise, nosprt, nosout, nosin, idist, idprt;
} ac_;

#define ac_1 ac_

struct {
    doublereal tstep, tstop, tstart, delmax, tdmax, forfre;
    integer jtrflg;
} tran_;

#define tran_1 tran_

struct {
    doublereal xincr, string[15], xstart, yvar[8];
    integer itab[8], itype[8], ilogy[8], npoint, numout, kntr, numdgt;
} outinf_;

#define outinf_1 outinf_

struct {
    doublereal value[200000];
} blank_;

#define blank_1 blank_

/* Table of constant values */

static integer c__1 = 1;
static integer c__7 = 7;

/*<       subroutine setplt(loc) >*/
/* Subroutine */ int setplt_(loc)
integer *loc;
{
    /* Initialized data */

    static integer logopt[6] = { 2,2,1,1,1,1 };
    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_21 = { {' ', ' ', ' ', ' ', ' ', ' ', ' ', ' '}, 0. };

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

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_22 = { {' ', ' ', 't', 'i', 'm', 'e', ' ', ' '}, 0. };

#define atimex (*(doublereal *)&equiv_22)

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

#define afreq (*(doublereal *)&equiv_23)

    static struct {
	char e_1[8];
	doublereal e_2;
	} equiv_24 = { {'*', '+', '=', '$', '0', '<', '>', '?'}, 0. };

#define pltsym (*(doublereal *)&equiv_24)


    /* Format strings */
    static char fmt_41[] = "(\0020legend:\002/)";
    static char fmt_61[] = "(1x,a1,\002: \002,5a8)";
    static char fmt_101[] = "(\002x\002/3x,a8,4x,5a8)";

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

    /* Builtin functions */
    integer s_wsfe(), e_wsfe(), do_fio();

    /* Local variables */
    static integer loce, loct;
    extern /* Subroutine */ int move_();
    static integer ipos, i, j;
    static doublereal achar;
    static integer itemp, jstop;
#define nodplc ((integer *)&blank_1)
#define cvalue ((complex *)&blank_1)
    static doublereal asweep;
    static integer ioutyp;
    extern /* Subroutine */ int outnam_();

    /* Fortran I/O blocks */
    static cilist io__12 = { 0, 0, 0, fmt_41, 0 };
    static cilist io__18 = { 0, 0, 0, fmt_61, 0 };
    static cilist io__20 = { 0, 0, 0, fmt_101, 0 };


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

/*     this routine generates the 'legend' subheading used to identify */
/* individual traces on multi-trace line-printer plots. */

/* 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=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=dc 3/15/83 */
/*<       common /dc/ tcstar(2),tcstop(2),tcincr(2),icvflg,itcelm(2),kssop, >*/
/*<      1   kinel,kidin,kovar,kidout >*/
/* 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=tran 3/15/83 */
/*<       common /tran/ tstep,tstop,tstart,delmax,tdmax,forfre,jtrflg >*/
/* spice version 2g.6  sccsid=outinf 3/15/83 */
/*<       common /outinf/ xincr,string(15),xstart,yvar(8),itab(8),itype(8), >*/
/*<      1   ilogy(8),npoint,numout,kntr,numdgt >*/
/* 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 logopt(6) >*/
/*<       data logopt / 2, 2, 1, 1, 1, 1 / >*/
/*<       data ablnk, atimex, afreq / 1h , 6h  time, 6h  freq / >*/
/*<       data pltsym / 8h*+=$0<>? / >*/

/*  set limits depending upon the analysis mode */

/*<       if (mode-2) 10,20,30 >*/
    if ((i_1 = status_1.mode - 2) < 0) {
	goto L10;
    } else if (i_1 == 0) {
	goto L20;
    } else {
	goto L30;
    }
/*<    10 xstart=tcstar(1) >*/
L10:
    outinf_1.xstart = dc_1.tcstar[0];
/*<       xincr=tcincr(1) >*/
    outinf_1.xincr = dc_1.tcincr[0];
/*<       npoint=icvflg >*/
    outinf_1.npoint = dc_1.icvflg;
/*<       itemp=itcelm(1) >*/
    itemp = dc_1.itcelm[0];
/*<       loce=nodplc(itemp+1) >*/
    loce = nodplc[itemp];
/*<       asweep=value(loce) >*/
    asweep = blank_1.value[loce - 1];
/*<       go to 40 >*/
    goto L40;
/*<    20 xstart=tstart >*/
L20:
    outinf_1.xstart = tran_1.tstart;
/*<       xincr=tstep >*/
    outinf_1.xincr = tran_1.tstep;
/*<       npoint=jtrflg >*/
    outinf_1.npoint = tran_1.jtrflg;
/*<       asweep=atimex >*/
    asweep = atimex;
/*<       go to 40 >*/
    goto L40;
/*<    30 xstart=fstart >*/
L30:
    outinf_1.xstart = ac_1.fstart;
/*<       xincr=fincr >*/
    outinf_1.xincr = ac_1.fincr;
/*<       npoint=icalc >*/
    outinf_1.npoint = status_1.icalc;
/*<       asweep=afreq >*/
    asweep = afreq;

/*  construct and print the output variables with corresponding plot */
/*    symbols */

/*<    40 loct=loc+2 >*/
L40:
    loct = *loc + 2;
/*<       if (kntr.eq.1) go to 80 >*/
    if (outinf_1.kntr == 1) {
	goto L80;
    }
/*<       write (iofile,41) >*/
    io__12.ciunit = status_1.iofile;
    s_wsfe(&io__12);
    e_wsfe();
/*<    41 format('0legend:'/) >*/
/*<       do 70 i=1,kntr >*/
    i_1 = outinf_1.kntr;
    for (i = 1; i <= i_1; ++i) {
/*<       loct=loct+2 >*/
	loct += 2;
/*<       itab(i)=nodplc(loct) >*/
	outinf_1.itab[i - 1] = nodplc[loct - 1];
/*<       ioutyp=nodplc(loct+1) >*/
	ioutyp = nodplc[loct];
/*<       itype(i)=ioutyp >*/
	outinf_1.itype[i - 1] = ioutyp;
/*<       ilogy(i)=1 >*/
	outinf_1.ilogy[i - 1] = 1;
/*<       if (mode.le.2) go to 50 >*/
	if (status_1.mode <= 2) {
	    goto L50;
	}
/*<       ilogy(i)=logopt(ioutyp) >*/
	outinf_1.ilogy[i - 1] = logopt[ioutyp - 1];
/*<    50 ipos=1 >*/
L50:
	ipos = 1;
/*<       call outnam(itab(i),itype(i),string,ipos) >*/
	outnam_(&outinf_1.itab[i - 1], &outinf_1.itype[i - 1], 
		outinf_1.string, &ipos);
/*<       call move(string,ipos,ablnk,1,7) >*/
	move_(outinf_1.string, &ipos, &ablnk, &c__1, &c__7);
/*<       jstop=(ipos+6)/8 >*/
	jstop = (ipos + 6) / 8;
/*<       call move(achar,1,pltsym,i,1) >*/
	move_(&achar, &c__1, &pltsym, &i, &c__1);
/*<       write (iofile,61) achar,(string(j),j=1,jstop) >*/
	io__18.ciunit = status_1.iofile;
	s_wsfe(&io__18);
	do_fio(&c__1, (char *)&achar, (ftnlen)sizeof(doublereal));
	i_2 = jstop;
	for (j = 1; j <= i_2; ++j) {
	    do_fio(&c__1, (char *)&outinf_1.string[j - 1], (ftnlen)sizeof(
		    doublereal));
	}
	e_wsfe();
/*<    61 format(1x,a1,2h: ,5a8) >*/
/*<    70 continue >*/
/* L70: */
    }
/*<    80 if (kntr.ge.2) go to 90 >*/
L80:
    if (outinf_1.kntr >= 2) {
	goto L90;
    }
/*<       itab(1)=nodplc(loc+4) >*/
    outinf_1.itab[0] = nodplc[*loc + 3];
/*<       ioutyp=nodplc(loc+5) >*/
    ioutyp = nodplc[*loc + 4];
/*<       itype(1)=ioutyp >*/
    outinf_1.itype[0] = ioutyp;
/*<       ilogy(1)=1 >*/
    outinf_1.ilogy[0] = 1;
/*<       if (mode.le.2) go to 90 >*/
    if (status_1.mode <= 2) {
	goto L90;
    }
/*<       ilogy(1)=logopt(ioutyp) >*/
    outinf_1.ilogy[0] = logopt[ioutyp - 1];
/*<    90 ipos=1 >*/
L90:
    ipos = 1;
/*<       call outnam(itab(1),itype(1),string,ipos) >*/
    outnam_(outinf_1.itab, outinf_1.itype, outinf_1.string, &ipos);
/*<       call move(string,ipos,ablnk,1,7) >*/
    move_(outinf_1.string, &ipos, &ablnk, &c__1, &c__7);
/*<       jstop=(ipos+6)/8 >*/
    jstop = (ipos + 6) / 8;
/*<       write (iofile,101) asweep,(string(j),j=1,jstop) >*/
    io__20.ciunit = status_1.iofile;
    s_wsfe(&io__20);
    do_fio(&c__1, (char *)&asweep, (ftnlen)sizeof(doublereal));
    i_1 = jstop;
    for (j = 1; j <= i_1; ++j) {
	do_fio(&c__1, (char *)&outinf_1.string[j - 1], (ftnlen)sizeof(
		doublereal));
    }
    e_wsfe();
/*<   101 format(1hx/3x,a8,4x,5a8) >*/
/*<       return >*/
    return 0;
/*<       end >*/
} /* setplt_ */

#undef cvalue
#undef nodplc
#undef pltsym
#undef afreq
#undef atimex
#undef ablnk


