c
c    @(#)readtrc.f	1.4
c
      subroutine readtrc
      include'mladv.inc'
      include'trc.inc'
      common /unit/iin,iout,idff,idif,iorr,iowr,iplt,ifndd

      write(iout,*)
      write(iout,*)'Biological Parameters'
      write(iout,*)
c
c     defaults
c
      ino3in = 1
      idinml = 1
      ifrest = 0

      do 10 i=1,ntrace
         wsinkfac(i) = 0.0
 10    continue

 1    continue
 
      read(iin,*,end=999)icard

      if (icard.le.0) goto 200

      if (icard .eq. 1) then
         read(iin,*)kw,kc,emax
         write(iout,*)'kw, kc, emax'
         write(iout,*)kw,kc,emax

      else if (icard.eq.2) then
         read(iin,*)umax,ks
         write(iout,*)'umax,ks'
         write(iout,*)umax,ks

      else if (icard.eq.3) then
         read(iin,*)kq,cqmin,cqmax
         write(iout,*)'kq,cqmin,cqmax'
         write(iout,*)kq,cqmin,cqmax

      else if (icard.eq.4) then
         read(iin,*)gmax
         write(iout,*)'gmax'
         write(iout,*)gmax

      else if (icard.eq.5) then
         read(iin,*)ploss
         write(iout,*)'ploss'
         write(iout,*)ploss

      else if (icard.eq.6) then
         read(iin,*)rm,civlev,zloss,zloss2,fslop
         write(iout,*)'rm,civlev,zloss,fslop'
         write(iout,*)rm,civlev,zloss,fslop

      else if (icard.eq.7) then
         read(iin,*)pno31,zoo1
         write(iout,*)'pno31,zoo1'
         write(iout,*)pno31,zoo1

      else if (icard.eq.8) then
         read(iin,*)pmax,p1,p2
         write(iout,*)'pmax,p1,p2'
         write(iout,*)pmax,p1,p2

      else if (icard.eq.9) then
         read(iin,*)kn,ks2
         write(iout,*)'kn,ks2'
         write(iout,*)kn,ks2

      else if (icard.eq.10) then
         read(iin,*)ibio
         write(iout,*)'ibio'
         write(iout,*)ibio
 
      else if (icard.eq.11) then
         read(iin,*)irdtrc
         write(iout,*)'irdtrc'
         write(iout,*)irdtrc  
         if (irdtrc .eq. 1) then 
            read(iin,*)trfile 
            write(iout,*)trfile
           endif 

      else if (icard.eq.12) then
         read(iin,*)zeuph
         write(iout,*)'zeuph, keuph'
         call findkml(zeuph,zml,l,keuph)
         write(iout,*)zeuph,keuph

      else if (icard.eq.13) then
         read(iin,*)ifrest
         write(iout,*)'ifrest'
         write(iout,*)ifrest
 
      else if (icard.eq.23) then
         read(iin,*)ino3in
         write(iout,*)'ino3in'
         write(iout,*)ino3in
         if (ino3in.eq.2) then
            read(iin,*)surno3,grdno3
            write(iout,*)'surno3,grdno3'
            write(iout,*)surno3,grdno3
          endif

      else if (icard.eq.24) then
         read(iin,*)idinml
         write(iout,*)'idinml'
         write(iout,*)idinml

      else if (icard.eq.25) then
         read(iin,*)xnh41
         write(iout,*)'xnh41'
         write(iout,*)xnh41

      else if (icard .eq. 26) then
         read(iin,*)rkeps,rkh1,rkmax
         write(iout,*)'rkeps,rkh1,rkmax'
         write(iout,*)rkeps,rkh1,rkmax

      else if (icard .eq. 27) then
         read(iin,*)(wsinkfac(i),i=1,ntrace)
         write(iout,*)'(wsinkfac(i),i=1,ntrace)'
         write(iout,*)(wsinkfac(i),i=1,ntrace)

      else if (icard .eq. 28) then
         read(iin,*)zeff1,zeff2
         write(iout,*)'zeff1,zeff2'
         write(iout,*)zeff1,zeff2

      else
         write(*,*)'Invalid icard in rdtrc'
         stop
      endif

      goto 1

 999  print*,'Error in readtrc'
      stop

 200  continue

      return
      end
