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:   SIMSP                      * 
*  SOURCE: 92091-18001                * 
*  RELOC:  92091-16001                * 
*  PGMR:   C. GEBER                   * 
*************************************** 
$PAGE 
$FILES(1,3)   !      modif RM 20/07/87
$EMA /BLANK/
$CDS ON 
      PROGRAM SIMSP (6,99)
     + ,92091-16001 REV.2201 <870722.1603>
      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 
      LOGICAL FROMLIB 
      COMMON /CMRMEXPLORELIB/ FROMLIB 
      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 
      FROMLIB=.FALSE. 
      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
      CALL ERRCHK 
      IF (NOGO.NE.0) GO TO 300
      CALL SETUP
      IF (NOGO.NE.0) GO TO 300
C 
C  CYCLE THROUGH TEMPERATURES 
C 
      ITEMNO=1
      IF (NUMTEM.EQ.1) GO TO 110
  100 IF (ITEMNO.EQ.NUMTEM) GO TO 310 
      ITEMNO=ITEMNO+1 
      CALL TMPUPD 
C 
C  DC TRANSFER CURVES 
C 
  110 IF (ICVFLG.EQ.0) GO TO 150
C 
C...  SEE ROUTINE *DCTRAN* FOR EXPLANATION OF *MODE*, ETC.
C 
      MODE=1
      MODEDC=3
      CALL DCTRAN 
      CALL OVTPVT 
      IF (NOGO.NE.0) GO TO 300
$PAGE 
C 
C  SMALL SIGNAL OPERATING POINT 
C 
  150 IF (KSSOP.GT.0) GO TO 170 
      IF (JACFLG.NE.0) GO TO 170
      IF ((ICVFLG+JTRFLG).GT.0) GO TO 250 
  170 MODE=1
      MODEDC=1
      CALL DCTRAN 
      IF (NOGO.NE.0) GO TO 300
      CALL DCOP 
      IF (NOGO.NE.0) GO TO 300
C 
C  AC SMALL SIGNAL ANALYSIS 
C 
  200 IF (JACFLG.EQ.0) GO TO 250
      MODE=3
      CALL ACAN 
      CALL OVTPVT 
      IF (NOGO.NE.0) GO TO 300
C 
C  TRANSIENT ANALYSIS 
C 
  250 IF (JTRFLG.EQ.0) GO TO 100
      MODE=1
      MODEDC=2
      CALL DCTRAN 
      IF (NOGO.NE.0) GO TO 300
      CALL DCOP 
      IF (NOGO.NE.0) GO TO 300
      MODE=2
      CALL DCTRAN 
      CALL OVTPVT 
      IF (NOGO.NE.0) GO TO 300
      GO TO 100 
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 
$EMA /BLANK/
      SUBROUTINE TMPUPD 
     + ,92091-16001 REV.2201 <870722.1603>
      IMPLICIT REAL*8 (A-H,O-Z) 
C 
C     THIS ROUTINE UPDATES THE TEMPERATURE-DEPENDENT PARAMETERS IN THE
C DEVICE MODELS.  IT ALSO UPDATES THE VALUES OF TEMPERATURE-DEPENDENT 
C RESISTORS.  THE UPDATED VALUES ARE PRINTED. 
C 
      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 /CIRDAT/ LOCATE(50),JELCNT(50),NUNODS,NCNODS,NUMNOD,NSTOP, 
     1   NUT,NLT,NXTRM,NDIST,NTLIN,IBR,NUMVS
      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 /KNSTNT/ TWOPI,XLOG2,XLOG10,ROOT2,RAD,BOLTZ,CHARGE,CTOK, 
     1   GMIN,RELTOL,ABSTOL,VNTOL,TRTOL,CHGTOL,EPS0,EPSSIL,EPSOX, 
     2   PIVTOL,PIVREL
      COMMON /BLANK/ VALUE(64)
      INTEGER NODPLC(64)
      COMPLEX CVALUE(32)
      EQUIVALENCE (VALUE(1),NODPLC(1),CVALUE(1))
C 
      DIMENSION TMPTIT(4) 
      DATA TMPTIT / 8HTEMPERAT, 8HURE-ADJU, 8HSTED VAL, 8HUES      /
$PAGE 
      REFTMP=27.0D0+CTOK
      TEMP1=VALUE(ITEMPS+ITEMNO-1)+CTOK 
      TEMP2=VALUE(ITEMPS+ITEMNO)+CTOK 
      XKT=BOLTZ*TEMP2 
      OLDVT=VT
      VT=XKT/CHARGE 
      OLDEG=EGFET 
      EGFET=1.16D0-(7.02D-4*TEMP2*TEMP2)/(TEMP2+1108.0D0) 
      ARG=-EGFET/(XKT+XKT)+1.1150877D0/(BOLTZ*(REFTMP+REFTMP))
      RATIO=TEMP2/TEMP1 
      RATLOG=DLOG(RATIO)
      RATIO1=RATIO-1.0D0
      DTEMP=TEMP2-REFTMP
      DELT=VALUE(ITEMPS+ITEMNO)-VALUE(ITEMPS+1) 
      DELTSQ=DELT*DELT
      FACT2=TEMP2/REFTMP
      XNI=1.45D16*FACT2*DSQRT(FACT2)*DEXP(CHARGE*ARG) 
      PBFACT=-2*VT*(1.5D0*DLOG(FACT2)+CHARGE*ARG) 
      XKT1=BOLTZ*TEMP1
      VT1=XKT1/CHARGE 
      EGFET1=1.16D0-(7.02D-4*TEMP1*TEMP1)/(TEMP1+1108.0D0)
      ARG1=-EGFET1/(XKT1+XKT1)+1.1150877D0/(BOLTZ*(REFTMP+REFTMP))
      FACT1=TEMP1/REFTMP
      PBFAT1=-2*VT1*(1.5D0*DLOG(FACT1)+CHARGE*ARG1) 
    5 CALL TITLE(0,LWIDTH,1,TMPTIT) 
C 
C  RESISTORS
C 
      LOC=LOCATE(1) 
      ITITLE=0
   10 IF (LOC.EQ.0) GO TO 100 
      LOCV=NODPLC(LOC+1)
      TC1=VALUE(LOCV+3) 
      TC2=VALUE(LOCV+4) 
      IF (TC1.NE.0.0D0) GO TO 20
      IF (TC2.EQ.0.0D0) GO TO 40
   20 IF (ITITLE.NE.0) GO TO 30 
      WRITE (IOFILE,21) 
   21 FORMAT(//'0**** RESISTORS',/,'0NAME',8X,'VALUE',//) 
      ITITLE=1
   30 RNEW=VALUE(LOCV+2)*(1.0D0+TC1*DELT+TC2*DELTSQ)
      VALUE(LOCV+1)=1.0D0/RNEW
      WRITE (IOFILE,31) VALUE(LOCV),RNEW
   31 FORMAT(1X,A8,1P6D11.3)
   40 LOC=NODPLC(LOC) 
      GO TO 10
$PAGE 
C 
C  DIODE MODEL
C 
  100 LOC=LOCATE(21)
      IF (LOC.EQ.0) GO TO 200 
      WRITE (IOFILE,101)
  101 FORMAT(//'0**** DIODE MODEL PARAMETERS',/,'0NAME',9X,'IS',9X,'VJ',
     1   8X,'CJO',//) 
  110 IF (LOC.EQ.0) GO TO 200 
      LOCV=NODPLC(LOC+1)
C...  IS(T2)=IS(T1)*DEXP(EG/(N*VT)*(T2/T1-1))*(T2/T1)**(XTI/N)
      XN=VALUE(LOCV+3)
      FACTOR=RATIO1*VALUE(LOCV+8)/(XN*VT)+VALUE(LOCV+9)/XN*RATLOG 
      FACTOR=DEXP(FACTOR) 
      VALUE(LOCV+1)=VALUE(LOCV+1)*FACTOR
      OLDPB=VALUE(LOCV+6) 
      PBO=(VALUE(LOCV+6)-PBFAT1)/FACT1
      GMAOLD=(OLDPB-PBO)/PBO
      VALUE(LOCV+5)=VALUE(LOCV+5)/(1.0D0+VALUE(LOCV+7)
     1     *(400.0D-6*(TEMP1-REFTMP)-GMAOLD)) 
  120 VALUE(LOCV+6)=FACT2*PBO+PBFACT
      GMANEW=(VALUE(LOCV+6)-PBO)/PBO
      VALUE(LOCV+5)=VALUE(LOCV+5) 
     1   *(1.0D0+VALUE(LOCV+7)*(400.0D-6*DTEMP-GMANEW)) 
      PBRAT=VALUE(LOCV+6)/OLDPB 
      VALUE(LOCV+12)=VALUE(LOCV+12)*PBRAT 
      VALUE(LOCV+15)=VALUE(LOCV+15)*PBRAT 
      VTE=VALUE(LOCV+3)*VT
      VALUE(LOCV+18)=VTE*DLOG(VTE/(ROOT2*VALUE(LOCV+1)))
      WRITE (IOFILE,31) VALUE(LOCV),VALUE(LOCV+1),VALUE(LOCV+6),
     1                  VALUE(LOCV+5) 
      LOC=NODPLC(LOC) 
      GO TO 110 
$PAGE 
C 
C  BIPOLAR TRANSISTOR MODEL 
C 
  200 LOC=LOCATE(22)
      IF (LOC.EQ.0) GO TO 300 
      WRITE (IOFILE,201)
  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 
      LOCV=NODPLC(LOC+1)
C...  IS(T2)=IS(T1)*DEXP(EG/VT*(T2/T1-1))*(T2/T1)**XTI
      FACTLN=RATIO1*VALUE(LOCV+42)/VT+VALUE(LOCV+43)*RATLOG 
      FACTOR=DEXP(FACTLN) 
      VALUE(LOCV+1)=VALUE(LOCV+1)*FACTOR
      TB=VALUE(LOCV+41) 
      BFACTR=DEXP(TB*RATLOG)
      VALUE(LOCV+2)=VALUE(LOCV+2)*BFACTR
      VALUE(LOCV+8)=VALUE(LOCV+8)*BFACTR
      VALUE(LOCV+6)=VALUE(LOCV+6)*DEXP(FACTLN/VALUE(LOCV+7))/BFACTR 
      VALUE(LOCV+12)=VALUE(LOCV+12)*DEXP(FACTLN/VALUE(LOCV+13)) 
     1               /BFACTR
      OLDPB=VALUE(LOCV+22)
      PBO=(VALUE(LOCV+22)-PBFAT1)/FACT1 
      GMAOLD=(OLDPB-PBO)/PBO
      VALUE(LOCV+21)=VALUE(LOCV+21)/(1.0D0+VALUE(LOCV+23) 
     1     *(400.0D-6*(TEMP1-REFTMP)-GMAOLD)) 
  220 VALUE(LOCV+22)=FACT2*PBO+PBFACT 
      GMANEW=(VALUE(LOCV+22)-PBO)/PBO 
      VALUE(LOCV+21)=VALUE(LOCV+21) 
     1   *(1.0D0+VALUE(LOCV+23)*(400.0D-6*DTEMP-GMANEW))
      PBRAT=VALUE(LOCV+22)/OLDPB
      VALUE(LOCV+46)=VALUE(LOCV+46)*PBRAT 
      VALUE(LOCV+47)=VALUE(LOCV+47)*PBRAT 
      OLDPB=VALUE(LOCV+30)
      PBO=(VALUE(LOCV+30)-PBFAT1)/FACT1 
      GMAOLD=(OLDPB-PBO)/PBO
      VALUE(LOCV+29)=VALUE(LOCV+29)/(1.0D0+VALUE(LOCV+31) 
     1     *(400.0D-6*(TEMP1-REFTMP)-GMAOLD)) 
  230 VALUE(LOCV+30)=FACT2*PBO+PBFACT 
      GMANEW=(VALUE(LOCV+30)-PBO)/PBO 
      VALUE(LOCV+29)=VALUE(LOCV+29) 
     1   *(1.0D0+VALUE(LOCV+31)*(400.0D-6*DTEMP-GMANEW))
      PBRAT=VALUE(LOCV+30)/OLDPB
      VALUE(LOCV+50)=VALUE(LOCV+50)*PBRAT 
      VALUE(LOCV+51)=VALUE(LOCV+51)*PBRAT 
      VALUE(LOCV+54)=VT*DLOG(VT/(ROOT2*VALUE(LOCV+1)))
      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) 
  211 FORMAT(1X,A8,1P9D10.3)
      LOC=NODPLC(LOC) 
      GO TO 210 
$PAGE 
C 
C  JFET MODEL 
C 
  300 LOC=LOCATE(23)
      IF (LOC.EQ.0) GO TO 400 
      WRITE (IOFILE,301)
  301 FORMAT(//'0**** JFET MODEL PARAMETERS',/,'0NAME',9X,'IS',9X,'PB', 
     1   8X,'CGS',8X,'CGD',//)
  310 IF (LOC.EQ.0) GO TO 400 
      LOCV=NODPLC(LOC+1)
      VALUE(LOCV+9)=VALUE(LOCV+9)*DEXP(RATIO1*1.11D0/VT)
      OLDPB=VALUE(LOCV+8) 
      PBO=(VALUE(LOCV+8)-PBFAT1)/FACT1
      GMAOLD=(OLDPB-PBO)/PBO
      OLDCJF=1.0D0+0.5D0*(400.0D-6*(TEMP1-REFTMP)-GMAOLD) 
      VALUE(LOCV+6)=VALUE(LOCV+6)/OLDCJF
      VALUE(LOCV+7)=VALUE(LOCV+7)/OLDCJF
  320 VALUE(LOCV+8)=FACT2*PBO+PBFACT
      GMANEW=(VALUE(LOCV+8)-PBO)/PBO
      CJFACT=1.0D0+0.5D0*(400.0D-6*DTEMP-GMANEW)
      VALUE(LOCV+6)=VALUE(LOCV+6)*CJFACT
      VALUE(LOCV+7)=VALUE(LOCV+7)*CJFACT
      PBRAT=VALUE(LOCV+8)/OLDPB 
      VALUE(LOCV+12)=VALUE(LOCV+12)*PBRAT 
      VALUE(LOCV+13)=VALUE(LOCV+13)*PBRAT 
      VALUE(LOCV+16)=VT*DLOG(VT/(ROOT2*VALUE(LOCV+9)))
      WRITE (IOFILE,31) VALUE(LOCV),VALUE(LOCV+9),VALUE(LOCV+8),
     1   VALUE(LOCV+6),VALUE(LOCV+7)
      LOC=NODPLC(LOC) 
      GO TO 310 
$PAGE 
C 
C  MOSFET MODEL 
C 
  400 LOC=LOCATE(24)
      IPRNT=1 
  410 IF (LOC.EQ.0) GO TO 1000
      LOCV=NODPLC(LOC+1)
      TYPE=NODPLC(LOC+2)
      IF (IPRNT.NE.0) WRITE (IOFILE,401)
  401 FORMAT(//'0**** MOSFET MODEL PARAMETERS',/,'0NAME',8X,'VTO',8X, 
     1   'PHI',9X,'PB',7X,'IS(JS)',7X,'KP',9X,'UO'//) 
      IPRNT=0 
      RATIO4=RATIO*DSQRT(RATIO) 
      VALUE(LOCV+3)=VALUE(LOCV+3)/RATIO4
      VALUE(LOCV+29)=VALUE(LOCV+29)/RATIO4
      OLDPHI=VALUE(LOCV+5)
      PHIO=(VALUE(LOCV+5)-PBFAT1)/FACT1 
  415 VALUE(LOCV+5)=FACT2*PHIO+PBFACT 
      PHI=VALUE(LOCV+5) 
      VFB=VALUE(LOCV+44)-TYPE*0.5D0*OLDPHI
      VFB=VFB+0.5D0*(OLDEG-EGFET) 
      VALUE(LOCV+44)=VFB+TYPE*0.5D0*PHI 
      VALUE(LOCV+2)=VALUE(LOCV+44)+TYPE*VALUE(LOCV+4)*DSQRT(PHI)
      VALUE(LOCV+11)=VALUE(LOCV+11)*DEXP(-EGFET/VT+OLDEG/OLDVT) 
      VALUE(LOCV+21)=VALUE(LOCV+21)*DEXP(-EGFET/VT+OLDEG/OLDVT) 
      OLDPB=VALUE(LOCV+12)
      PBO=(VALUE(LOCV+12)-PBFAT1)/FACT1 
      GMAOLD=(OLDPB-PBO)/PBO
      COEOLD=1.0D0+VALUE(LOCV+18)*(400.0D-6*(TEMP1-REFTMP)-GMAOLD)
      VALUE(LOCV+9)=VALUE(LOCV+9)/COEOLD
      VALUE(LOCV+10)=VALUE(LOCV+10)/COEOLD
      VALUE(LOCV+17)=VALUE(LOCV+17)/COEOLD
      VALUE(LOCV+19)=VALUE(LOCV+19)/(1.0D0+VALUE(LOCV+20) 
     1     *(400.0D-6*(TEMP1-REFTMP)-GMAOLD)) 
  420 VALUE(LOCV+12)=FACT2*PBO+PBFACT 
      GMANEW=(VALUE(LOCV+12)-PBO)/PBO 
      COENEW=1.0D0+VALUE(LOCV+18)*(400.0D-6*DTEMP-GMANEW) 
      VALUE(LOCV+9)=VALUE(LOCV+9)*COENEW
      VALUE(LOCV+10)=VALUE(LOCV+10)*COENEW
      VALUE(LOCV+17)=VALUE(LOCV+17)*COENEW
      VALUE(LOCV+19)=VALUE(LOCV+19)*
     1   (1.0D0+VALUE(LOCV+20)*(400.0D-6*DTEMP-GMANEW)) 
      PBRAT=VALUE(LOCV+12)/OLDPB
      VALUE(LOCV+37)=VALUE(LOCV+37)*PBRAT 
      VALUE(LOCV+38)=VALUE(LOCV+38)*PBRAT 
      CSAT=DMAX1(VALUE(LOCV+11),VALUE(LOCV+21)) 
      WRITE (IOFILE,31) VALUE(LOCV),VALUE(LOCV+2),VALUE(LOCV+5),
     1   VALUE(LOCV+12),CSAT,VALUE(LOCV+3),VALUE(LOCV+29) 
  430 LOC=NODPLC(LOC) 
      GO TO 410 
$PAGE 
C 
C  FINISHED 
C 
 1000 RETURN
      END 
