! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! 
! Initialization File
! 
! Generated by KPP-2.2.3 symbolic chemistry Kinetics PreProcessor
!       (http://www.cs.vt.edu/~asandu/Software/KPP)
! KPP is distributed under GPL, the general public licence
!       (http://www.gnu.org/copyleft/gpl.html)
! (C) 1995-1997, V. Damian & A. Sandu, CGRER, Univ. Iowa
! (C) 1997-2005, A. Sandu, Michigan Tech, Virginia Tech
!     With important contributions from:
!        M. Damian, Villanova University, USA
!        R. Sander, Max-Planck Institute for Chemistry, Mainz, Germany
! 
! File                 : MCMv3_3_Initialize.f90
! Time                 : Mon Jul 19 14:16:06 2021
! Working directory    : /Users/lechriso/git/boxmox/boxmox/tmp_MCMv3_3_3654_BOXMOX
! Equation file        : MCMv3_3.kpp
! Output root filename : MCMv3_3
! 
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



MODULE MCMv3_3_Initialize

  USE MCMv3_3_Parameters, ONLY: dp, NVAR, NFIX
  IMPLICIT NONE

CONTAINS


! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
! 
! Initialize - function to initialize concentrations
!   Arguments :
! 
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

SUBROUTINE Initialize ( )


  USE MCMv3_3_Global

  USE MCMv3_3_Util

  INTEGER :: i
  REAL(kind=dp) :: x

  CFACTOR = 1.000000e+00_dp

  x = (1.0E-9)*CFACTOR
  DO i = 1, NVAR
    VAR(i) = x
  END DO

  x = (1.0E-9)*CFACTOR
  DO i = 1, NFIX
    FIX(i) = x
  END DO

! constant rate coefficients
  RCONST(1) = 1e-20
  RCONST(2595) = 9.258e-11
  RCONST(7295) = 1.867e-11
  RCONST(7296) = 1.513e-11
  RCONST(7298) = 1.865e-11
! END constant rate coefficients

! INLINED initializations


  IF (.NOT. llibrary) THEN

    ! Write version number to VERSION file
    CALL writeVersion()

    ! Initialization (time step, run length, etc.) happening
    ! in namelist BOXMOX.nml. Read it!
    CALL readConfig()

  ENDIF

  ! Check configuration values
  CALL checkConfig()



  ! BOXMOX defaults for global variables

  ! Environment.csv
  temp         =         293.15   ! K
  pres         =      101325.0    ! Pa
  dxdydz(:)    =           1.0    ! m

  ! Aerosol.csv
  AER_SAD      =           0.0    ! m^2 m^-3
  AER_R        =           1.0e-6 ! m

  ! Turbulent mixing
  Kturb        =           0.0    ! m2 s-1


! End INLINED initializations

      
END SUBROUTINE Initialize

! End of Initialize function
! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



END MODULE MCMv3_3_Initialize

