!
#include "tm5.inc"
!
!----------------------------------------------------------------------------
!                    TM5                                                    !
!----------------------------------------------------------------------------
!BOP
!
! !MODULE:  chem_param
!
! !DESCRIPTION:
!
! definition of the chemistry: #reactions, order of species, etc.
! parameters needed for chemistry and rate constants 
!
!\\
!\\
! !INTERFACE: 
!
module chem_param
  !
  ! !USES:
  !
  use binas, only : xmair
  use reaction_data
  use deposition_data

  implicit none
  !
  ! !PUBLIC DATA MEMBERS:
  !
  ! nmark: number of 'marked' tracers 
  integer, parameter :: nmark = 1
  character(len=8),dimension(nmark) :: marknam = (/ 'test    ' /)
  !
  integer, parameter :: ntrace  = 1  ! number of tracers for chemistry
  integer, parameter :: ntracet = 1  ! number of transported tracers
  integer, parameter :: ntrace_chem  = ntrace-ntracet ! non-transported tracers
  integer, parameter :: maxtrace = ntrace + 0 ! total number of tracers
  !
  ! components numbers
  !
  integer, parameter :: itracer=1
  !
  ! additional fields used in chemistry routine alone 
  ! (more meteo-like files in units different from #/cm3)
  !
  integer, parameter                  :: n_extra = 0
  integer, parameter                  :: nstd    = 1
  integer, dimension(nstd), parameter :: istd    = (/ itracer /)
  !
  ! species name
  !
  integer, parameter  ::  tracer_name_len = 8
  Character(len=tracer_name_len), dimension(maxtrace) :: names = (/  'TEST1   ' /)
  !
  ! molar weights of components
  !
  real,    parameter :: xmh  =  1.0079
  real,    parameter :: xmn  = 14.0067
  real,    parameter :: xmc  = 12.01115
  real,    parameter :: xms  = 32.064
  real,    parameter :: xmo  = 15.9994
  real,    parameter :: xmcl = 35.453

  ! used in wet_depos ...
  real, parameter     ::  xmhno3 = xmh + xmn + xmo*3.0

  real,dimension(maxtrace),parameter :: ra = (/ xmair /)

  real,dimension(maxtrace),parameter :: fscale = xmair/ra(:)

  !   fscale(ntrace): scaling factor for conversion of mixing ratios 
  !   in kg tracer per kg air to practical mixing ratio units (e.g. ppm)
  !   In this version: ratio of molecular weight  of tracer to that of air 


  ! ********************************************************************
  ! rates
  ! ********************************************************************
  
  ! heterogeneous removal rates
  real                 :: henry(ntracet,ntemp)


  ! ********************************************************************
  ! dummy tracers
  ! ********************************************************************

  ! dummy indices for tracers not included in this chemistry;
  ! comparision of tracer index with this numbers will fail ...

  integer, parameter   ::  iso2  = -999
  integer, parameter   ::  iso4  = -998
  integer, parameter   ::  inh3  = -997
  integer, parameter   ::  ihno3 = -996
  integer, parameter   ::  ino   = -995
  integer, parameter   ::  ino2  = -994
  integer, parameter   ::  inox  = -994
  integer, parameter   ::  io3   = -993
  integer, parameter   ::  ihno4 = -992
  integer, parameter   ::  ih2o2 = -991


  ! ********************************************************************
  ! aerosol
  ! ********************************************************************

  real, parameter :: density_ref = 1800.0   ! for 'reference' density calculations


  ! ********************************************************************
  ! dry deposition
  ! ********************************************************************

  ! number of tracers on which dry depositions should be applied:
  integer, parameter  ::  ndep = 0

  ! tracer indices on which dry depositions should be applied:
  integer, parameter  ::  idep(1) = (/ -999 /)

  ! deposition parameters:
  real,    parameter  ::  ddep_diffrb(1) = (/ -999.9 /)
  real,    parameter  ::  ddep_rsoil (1) = (/ -999.9 /)
  real,    parameter  ::  ddep_rwat  (1) = (/ -999.9 /)
  real,    parameter  ::  ddep_rws   (1) = (/ -999.9 /)
  real,    parameter  ::  ddep_rsnow (1) = (/ -999.9 /)
  real,    parameter  ::  ddep_rmes  (1) = (/ -999.9 /)
  real,    parameter  ::  ddep_rcut  (1) = (/ -999.9 /)
  real,    parameter  ::  ddep_diffcf(1) = (/ -999.9 /)

  ! some vd fields are copies:
  integer, parameter  ::  vd_ncopy = 0   ! dummy
  integer, parameter  ::  vd_copy_itarget(1) = (/ -999 /)
  integer, parameter  ::  vd_copy_isource(1) = (/ -999 /)

  ! number of aerosol bins used for deposition:
  integer, parameter  ::  nrdep = 0

  ! aerosol radii used for each bin:
  real,    parameter  ::  lur(1) = (/ -999.9 /)


  ! ********************************************************************
  ! wet deposition
  ! ********************************************************************
  !
  ! nscav       : selected species for scavenging
  ! nscav_index : index for scavenging:
  ! nscav_type  : type of scavenging:
  !               0 no scavenging
  !               1 scavenging 100 % solubility assumed
  !               2 scavenging henry solubility assumed
  !               3 scavenging, aerosol removal assumed
  !               4 scavenging, special case for SO2 with aq phase diss.
  !
  integer, parameter  ::  nscav = 0
  integer, parameter  ::  nscav_index(1) = (/ -999 /)
  !
  ! note CMK CFD: wetS accounts for removal of SO2, so nscav_type = 0
  !               nh3 is taken out anyhow, since most will be scavenged
  !               by acidic falling frops below cloud
  integer, parameter  :: nscav_type(1) =  (/ -999 /)
  !
  ! !REVISION HISTORY: 
  !    9 Sep 2010 - Philippe Le Sager - Added "tracer_name_len"
  !
  ! !REMARKS:
  !
  !EOP
  !------------------------------------------------------------------------

end module chem_param
