C     Last change:  LKS   1 Nov 2007    2:08 pm
      subroutine user_abmodel(depth, compconc)
c
c     This file selects the concentration routine to be used in the run,
c     in the provided as well as user-developed 'ab' 
c     routines
c
      INCLUDE 'dimens_XL.inc'
c
      real depth, conc, compconc(mxcomp)
c
      COMMON /Cmisc/ imisc(30),fmisc(30) 
      wavenm = fmisc(13)
c
c     Component 1 is pure water.  No calc needed.
c
c     Component 2 is chlorophyll.  A subroutine will be called
      icomp = 2
      call chlzfunc(icomp, depth, conc)
      compconc(2) = conc 
c
c     Component 3 is CDOM.  A subroutine will be called
c     to get aCDOM
      icomp = 3
      call acdom(depth, wavenm, conc)
      compconc(3) = conc 
c
c     Component 4 is minerals.  A subroutine will be called
      icomp = 4
      call minzdata(icomp, depth, conc)
      compconc(4) = conc 
c
      return
      end
c     -----------------------------------------

      subroutine user_abscat(depth,wavelen,ncomp,acomp,bcomp,
     1                       atotal, btotal)
c
c     This file selects the 'ab' routine to be used in the run,
c     called by routines inishamp, rhotau, zetatoz, and ztozeta.
c
      INCLUDE 'dimens_XL.inc'
c
      integer ncomp
      real depth,wavelen,atotal,btotal
      real acomp(mxcomp),bcomp(mxcomp)
c
c
      call abcase2(depth,wavelen,ncomp,acomp,bcomp,atotal,btotal)
      return
      end
c     -----------------------------------------

      subroutine user_acdomsub(depth, wavelen, abscdom)
c
c     This file specifies the 'aCDOM' to be used in the run,
c     by calls from the 'ab' routines, and the CDOM fluorescence routine 'shatcdom'
c
      INCLUDE 'dimens_XL.inc'
c
      integer ncomp, icomp
      real depth,wavelen, abscdom, cdomconc, atotal,btotal
      real acomp(mxcomp),bcomp(mxcomp), achlRef, waveRef
      real aw, bw, cw
c
c     a subroutine will be called to give aCDOM as a function
c     of depth and wavelength
      call acdom(depth, wavelen, cdomconc)
      abscdom = cdomconc
c
      return
      end
c     -----------------------------------------

      subroutine user_achlz(depth, wavelen, achl)
c
c     This file selects how the chlorophyll profile is specified for the run,
c     for use by the 'ab' routines and the chlorophyll fluorescence
c     routine 'shatchl'
c
      integer icomp
      real depth, wavelen, achl, chlconc, ac440, waveRef, ac
c
      data kall/0/
      save

c
c     Specify component index for chorophyll for astar routines
      icomp = 2
c
      If(kall.eq.0) then
        waveRef = 440.0
        ac440 = astar(icomp, waveRef)
        kall = 1
      Endif

c     a subroutine will be called to read chl concentration
c     from the data file 
      call chlzfunc(icomp, depth, chlconc)
c
       ac = astar(icomp, wavelen)/ac440
       achl = 0.06*ac*chlconc**(0.65)

c
      return
      end
c     -----------------------------------------

      Real Function s0bioSub(depth,wavelen)
c
c     This file calls the bioluminescent function to be used in the run,
c     (if needed at all) by shat.f
c
      real depth,wavelen, S0biolum
c
c      Bioluminescence is not included in this run
       s0bioSub = 0.0
c
      return
      end
c     -----------------------------------------

