FTN66,Y,J,E 
*************************************************************** 
* (C) COPYRIGHT HEWLETT-PACKARD COMPANY 1980.  ALL RIGHTS     * 
* RESERVED.  NO PART OF THIS PROGRAM MAY BE PHOTOCOPIED, RE-  * 
* REPRODUCED, OR TRANSLATED TO ANOTHER PROGRAM LANGUAGE WITH- * 
* OUT THE PRIOR WRITTEN CONSENT OF HEWLETT-PACKARD COMPANY.   * 
*************************************************************** 
*  NAME:   SYNTX                      * 
*  SOURCE: 92091-18020                * 
*  RELOC:  92091-16020                * 
*  PGMR:   C. GEBER                   * 
*************************************** 
$PAGE 
$FILES(1,3) 
$EMA /BLANK/
$CDS ON 
      PROGRAM SYNTX (6,99)
     + ,92091-16020 REV.2201 <880503.1111>
      IMPLICIT REAL*8 (A-H,O-Z) 
C 
C     *** VERSION 2G.5 (10AUG81) ***
C 
C     SPICE IS AN ELECTRONIC CIRCUIT SIMULATION PROGRAM THAT WAS DEVE-
C LOPED BY THE INTEGRATED CIRCUITS GROUP OF THE ELECTRONICS RESEARCH
C LABORATORY AND THE DEPARTMENT OF ELECTRICAL ENGINEERING AND COMPUTER
C SCIENCES AT THE UNIVERSITY OF CALIFORNIA, BERKELEY, CALIFORNIA.  THE
C PROGRAM SPICE IS AVAILABLE FREE OF CHARGE TO ANY INTERESTED PARTY.
C THE SALE, RESALE, OR USE OF THIS PROGRAM FOR PROFIT WITHOUT THE 
C EXPRESS WRITTEN CONSENT OF THE DEPARTMENT OF ELECTRICAL ENGINEERING 
C AND COMPUTER SCIENCES, UNIVERSITY OF CALIFORNIA, BERKELEY, CALIFORNIA,
C IS FORBIDDEN. 
************************************************************************
* 
* SPECIFIC PERMISSION FOR LICENSING A MODIFIED VERSION OF SPICE2 AT A 
* PROFIT HAS BEEN GRANTED FROM THE UNIVERSITY OF CALIFORNIA AT BERKELEY 
* AS OF NOVEMBER 23, 1981.  HEWLETT-PACKARD OWNS AND RETAINS A PROPRI-
* ETARY INTEREST IN THOSE ENHANCEMENTS AND IMPROVEMENTS MADE TO ADAPT 
* SPICE2 TO ITS COMPUTER SYSTEMS. 
* 
************************************************************************
$PAGE 
      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 
      COMMON /MISCEL/ ATIME,APROG(3),ADATE,ATITLE(10),DEFL,DEFW,DEFAD,
     1  DEFAS,RSTATS(50),IWIDTH,LWIDTH,NOPAGE 
      COMMON /LINE/ ACHAR,AFIELD(15),OLDLIN(15),KNTRC,KNTLIM
      COMMON /CIRDAT/ LOCATE(50),JELCNT(50),NUNODS,NCNODS,NUMNOD,NSTOP, 
     1   NUT,NLT,NXTRM,NDIST,NTLIN,IBR,NUMVS
      COMMON /MOSARG/ VTO,BETA,GAMMA,PHI,PHIB,COX,XNSUB,XNFS,XD,XJ,XLD, 
     1   XLAMDA,UO,UEXP,VBP,UTRA,VMAX,XNEFF,XL,XW,VBI,VON,VDSAT,QSPOF,
     2   BETA0,BETA1,CDRAIN,XQCO,XQC,FNARRW,FSHORT,LEV
      COMMON /STATUS/ OMEGA,TIME,DELTA,DELOLD(7),AG(7),VT,XNI,EGFET,
     1   XMU,MODE,MODEDC,ICALC,INITF,METHOD,IORD,MAXORD,NONCON,ITERNO,
     2   ITEMNO,NOSOLV,MODAC,IPIV,IVMFLG,IPOSTP,ISCRCH,IOFILE 
      COMMON /FLAGS/ IPRNTA,IPRNTL,IPRNTM,IPRNTN,IPRNTO,LIMTIM,LIMPTS,
     1   LVLCOD,LVLTIM,ITL1,ITL2,ITL3,ITL4,ITL5,IGOOF,NOGO,KEOF 
      COMMON /KNSTNT/ TWOPI,XLOG2,XLOG10,ROOT2,RAD,BOLTZ,CHARGE,CTOK, 
     1   GMIN,RELTOL,ABSTOL,VNTOL,TRTOL,CHGTOL,EPS0,EPSSIL,EPSOX, 
     2   PIVTOL,PIVREL
      COMMON /MEMMGR/ CPYKNT,ISTACK(1),LORG,ICORE,MAXCOR,MAXUSE,MEMAVL, 
     1   LDVAL,NUMBLK,LOCTAB,LTAB,IFWA,NWOFF,NTAB,MAXMEM,MEMERR,NWD4, 
     2   NWD8,NWD16 
      COMMON /DC/ TCSTAR(2),TCSTOP(2),TCINCR(2),ICVFLG,ITCELM(2),KSSOP, 
     1   KINEL,KIDIN,KOVAR,KIDOUT 
      COMMON /AC/ FSTART,FSTOP,FINCR,SKW2,REFPRL,SPW2,JACFLG,IDFREQ,
     1   INOISE,NOSPRT,NOSOUT,NOSIN,IDIST,IDPRT 
      COMMON /TRAN/ TSTEP,TSTOP,TSTART,DELMAX,TDMAX,FORFRE,JTRFLG 
      COMMON /OUTINF/ XINCR,STRING(15),XSTART,YVAR(8),ITAB(8),ITYPE(8), 
     1   ILOGY(8),NPOINT,NUMOUT,KNTR,NUMDGT 
      COMMON /CJE/ MAXTIM,ITIME,ICOST 
      COMMON/DEBUG/ IDEBUG(20)
      COMMON /BLANK/ VALUE(64)
      INTEGER NODPLC(64)
      COMPLEX CVALUE(32)
      EQUIVALENCE (VALUE(1),NODPLC(1),CVALUE(1))
$PAGE 
      DIMENSION ACCTIT(4) 
      DIMENSION REMAIN(4) 
      DATA AMRJE /4HMRJE/ 
      DATA ABLNK /1H  / 
      DATA ACCTIT / 8HJOB STAT, 8HISTICS S, 8HUMMARY  , 8H         /
      DATA AHDR1,AHDR2,AHDR3 / 8H  SPICE ,8H2G.5 (10,8HAUG81)  /
C 
      IPOSTP=0
      CALL ERRSET(208,256,-1,1,1,0) 
      MAXMEM=2*64 
      MAXTIM=1E8
      ICOST=0 
      IOFILE=6
C 
C  INITIALIZATION 
C 
      APROG(1)=AHDR1
      APROG(2)=AHDR2
      APROG(3)=AHDR3
      ACHAR=ABLNK 
      KEOF=0
      CALL DATIME(ADATE,ATIME)
      BOLTZ=1.3806226D-23 
      CHARGE=1.6021918D-19
      MGRIBM=0
      CTOK=273.15D0 
      EPS0=8.854214871D-12
      EPSSIL=11.7D0*EPS0
      EPSOX=3.9D0*EPS0
      TWOPI=8.0D0*DATAN2(1.0D0,1.0D0) 
      RAD=360.0D0/TWOPI 
      XLOG2=DLOG(2.0D0) 
      XLOG10=DLOG(10.0D0) 
      ROOT2=DSQRT(2.0D0)
      NODATA=1
********************************************************************
* 
      CALL INITIO(APROG)
* 
********************************************************************
$PAGE 
C 
C  BEGIN JOB
C 
   10 IF (KEOF.EQ.1) GO TO 1000 
      CALL GETCJE 
      CALL SECOND(TIME1)
      ICOST1=ICOST
      IGOOF=0 
      MODE=0
      NOGO=0
      CALL SETMEM(NODPLC(1),MAXMEM,MGRIBM)
      IF (NOGO.NE.0) GO TO 1000 
      CALL ZERO8(RSTATS,50) 
C 
C  READ REMAINDER OF DATA DECK AND CHECK FOR INPUT ERRORS 
C 
      CALL READIN 
      IF (NOGO.NE.0) GO TO 300
      IF (KEOF.EQ.1) GO TO 1000 
      NODATA=0
      IF (NOGO.EQ.0) GO TO 310
C 
C  JOB CONCLUDED
C 
  300 WRITE (IOFILE,301)
  301 FORMAT(1H0,9X,'***** JOB ABORTED')
      NODATA=0
      GO TO 320 
  310 WRITE (IOFILE,311)
  311 FORMAT(1H0,/,9X,'JOB CONCLUDED')
$PAGE 
C 
C  JOB ACCOUNTING 
C 
  320 CONTINUE
      NUMEL=0 
      DO 360 I=1,18 
  360 NUMEL=NUMEL+JELCNT(I) 
      NUMTEM=MAX0(NUMTEM-1,1) 
      IDIST=MIN0(IDIST,1) 
      IF (IPRNTA.EQ.0) GO TO 800
      CALL TITLE(-1,LWIDTH,1,ACCTIT)
      WRITE (IOFILE,361) NUNODS,NCNODS,NUMNOD,NUMEL,(JELCNT(I),I=11,14) 
  361 FORMAT('   NUNODS NCNODS NUMNOD NUMEL  DIODES  BJTS  JFETS  MFETS'
     1   //,I9,2I7,I6,I8,I6,2I7)
      WRITE (IOFILE,371) NUMTEM,ICVFLG,JTRFLG,JACFLG,INOISE,IDIST,NOGO
  371 FORMAT(/'0  NUMTEM ICVFLG JTRFLG JACFLG INOISE  IDIST   NOGO'/, 
     1   2H0 ,7I7)
      WRITE (IOFILE,381) RSTATS(20),RSTATS(21),RSTATS(22),RSTATS(23), 
     1   RSTATS(26),RSTATS(27)
  381 FORMAT(/'0  NSTOP   NTTBR   NTTAR   IFILL    IOPS    PERSPA'//, 
     1   1X,5F8.0,F9.3) 
********************************************************************
* 
      WRITE (IOFILE,391) RSTATS(30),RSTATS(31),RSTATS(32),2*MAXMEM, 
     1   2*MAXUSE,CPYKNT
  391 FORMAT(/'0  NUMTTP  NUMRTP  NUMNIT  MAXMEM  MEMUSE  COPYKNT',//,
     1   2X,3F8.0,1X,I6,2X,I6,2X,F8.0)
* 
********************************************************************
      WRITE (IOFILE,401) (RSTATS(I),I=1,6),RSTATS(50),RSTATS(49), 
     1   RSTATS(46),(RSTATS(I),I=7,11)
  401 FORMAT(/, 
     1   1H0,9X,'READIN  ',12X,F10.2/,
     2   1H0,9X,'SETUP   ',12X,F10.2/,
     3   1H0,9X,'TRCURV  ',12X,F10.2,10X,F6.0/, 
     4   1H0,9X,'DCAN    ',12X,F10.2,10X,F6.0/, 
     5   1H0,9X,'DCDCMP  ',12X,F10.3,10X,F6.0/, 
     6   1H0,9X,'DCSOL   ',12X,F10.3/,
     7   1H0,9X,'ACAN    ',12X,F10.2,10X,F6.0/, 
     8   1H0,9X,'TRANAN  ',12X,F10.2,10X,F6.0/, 
     9   1H0,9X,'OUTPUT  ',12X,F10.2) 
      WRITE (6,402) RSTATS(45),RSTATS(48),RSTATS(47),RSTATS(44),
     1   RSTATS(43) 
  402 FORMAT( 
     1   1H0,9X,'LOAD    ',12X,F10.3/,
     2   1H0,9X,'CODGEN  ',12X,F10.3,10X,F6.0/, 
     3   1H0,9X,'CODEXC  ',12X,F10.3/,
     4   1H0,9X,'MACINS  ',12X,F10.3) 
$PAGE 
  800 CALL GETCJE 
      CALL SECOND(TIME2)
      ET=TIME2-TIME1
      TCOST=DFLOAT(ICOST-ICOST1)/100.0D0
      IF (IPRNTA.EQ.0) GO TO 810
      OHEAD=ET-(RSTATS(1)+RSTATS(2)+RSTATS(3)+RSTATS(5)+RSTATS(7) 
     1   +RSTATS(9)+RSTATS(11)) 
      WRITE (IOFILE,801) OHEAD
  801 FORMAT(1H0,9X,'OVERHEAD',12X,F10.2) 
  810 WRITE (IOFILE,811) ET 
  811 FORMAT(1H0,9X,'TOTAL JOB TIME      ',F10.2) 
      RSTATS(33)=CPYKNT 
      RSTATS(34)=ET 
      RSTATS(35)=TCOST
      RSTATS(36)=OHEAD
********************************************************************
* 
* 900 IF ((MAXTIM-ITIME).GE.LIMTIM) GO TO 10
*     WRITE (IOFILE,901)
* 901 FORMAT('1WARNING:  FURTHER ANALYSIS STOPPED DUE TO CPU TIME LIMIT'
*    1/)
* 
********************************************************************
 1000 IF (NODATA.NE.0) WRITE(IOFILE,1001) 
 1001 FORMAT(/1X,'INPUT DECK (FILE) CONTAINS NO DATA.') 
********************************************************************
* 
      CALL STOPIO(NOGO,ATIME,ADATE) 
* 
********************************************************************
      STOP
      END 
