    MODULE module_dep_simple

      IMPLICIT NONE
      INTEGER, PARAMETER :: dep_seasons = 5
      INTEGER, PARAMETER :: nlu = 25
      REAL, parameter :: small_value = 1.e-36
      REAL, parameter :: large_value = 1.e36
      integer, parameter :: isice_temp = 24
      integer, parameter :: iswater_temp = 16
      integer, parameter :: wrf2mz_lt_map(nlu) = (/ 1, 2, 2, 2, 2, &
                                                    4, 3, 3, 3, 3, &
                                                    4, 5, 4, 5, 6, &
                                                    7, 9, 6, 8, 9, &
                                                    6, 6, 8, 0, 0 /)
      real, parameter :: wh2o = 18.0153
      real, parameter :: wpan = 121.04793
      character(len=4), parameter :: mminlu = 'USGS'
      INTEGER :: month = 0
      INTEGER :: ixxxlu(nlu)
      INTEGER, allocatable :: luse2usgs(:)
      REAL :: kpart(nlu)
      REAL :: rac(nlu,dep_seasons), rclo(nlu,dep_seasons), rcls(nlu,dep_seasons)
      REAL :: rgso(nlu,dep_seasons), rgss(nlu,dep_seasons)
      REAL :: ri(nlu,dep_seasons), rlu(nlu,dep_seasons)
      REAL :: ri_pan(5,11)
      real :: c0_pan(11) = (/ 0.000, 0.006, 0.002, 0.009, 0.015, &
                                 0.006, 0.000, 0.000, 0.000, 0.002, 0.002 /)
      real :: k_pan (11) = (/ 0.000, 0.010, 0.005, 0.004, 0.003, &
                                 0.005, 0.000, 0.000, 0.000, 0.075, 0.002 /)
      REAL :: dratio(1000), hstar(1000), hstar4(1000)
      REAL :: f0(1000), dhr(1000), scpr23(1000)
      type wesely_pft
        integer :: npft
        integer :: months
        INTEGER, pointer :: seasonal_wes(:,:,:,:)
        logical :: is_allocated
      end type wesely_pft
      type(wesely_pft), allocatable :: seasonal_pft(:)
    PUBLIC
    logical, allocatable :: is_aerosol(:)
    CONTAINS
SUBROUTINE wesely_driver( id, ktau, dtstep, config_flags, current_month, &
                          gmt, julday, t_phy,moist, p8w, t8w, raincv, &
                          p_phy, chem, rho_phy, dz8w, ddvel, aer_res_def, &
                          aer_res_zcen, ivgtyp, tsk, gsw, vegfra, pbl, &
                          rmol, ust, znt, xlat, xlong, &
                          z, z_at_w, snowh, numgas, &
                          xice, &
                          ids,ide, jds,jde, kds,kde, &
                          ims,ime, jms,jme, kms,kme, &
                          its,ite, jts,jte, kts,kte )
  USE module_model_constants
  USE module_configure
  USE module_state_description
  USE module_data_sorgam
  USE module_state_description, only: param_first_scalar
   INTEGER, INTENT(IN ) :: id,julday, &
                                  numgas, current_month, &
                                  ids,ide, jds,jde, kds,kde, &
                                  ims,ime, jms,jme, kms,kme, &
                                  its,ite, jts,jte, kts,kte
   INTEGER, INTENT(IN ) :: ktau
      REAL, INTENT(IN ) :: dtstep,gmt
   REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_moist ), INTENT(IN ) :: &
                                                      moist
   REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ), INTENT(INOUT ) :: &
                                                      chem
   REAL, DIMENSION( its:ite, jts:jte, num_chem ), INTENT(INOUT ) :: &
                                                      ddvel
   REAL, DIMENSION( ims:ime , kms:kme , jms:jme ), INTENT(IN ) :: &
                                                      t_phy, &
                                                      p_phy, &
                                                      dz8w, &
                                                      z, &
                                                      t8w, &
                                                      p8w, &
                                                      z_at_w, &
                                                      rho_phy
   INTEGER,DIMENSION( ims:ime , jms:jme ), INTENT(IN ) :: &
                                                     ivgtyp
   REAL, DIMENSION( ims:ime , jms:jme ), INTENT(INOUT ) :: &
                                                     tsk, &
                                                     gsw, &
                                                     vegfra, &
                                                     pbl, &
                                                     rmol, &
                                                     ust, &
                                                     xlat, &
                                                     xlong, &
                                                     raincv, &
                                                     znt
   REAL, intent(inout) :: aer_res_def(its:ite,jts:jte)
   REAL, intent(inout) :: aer_res_zcen(its:ite,jts:jte)
   REAL, optional, INTENT(IN) :: snowh(ims:ime,jms:jme)
   REAL, optional, INTENT(IN) :: xice(ims:ime,jms:jme)
   TYPE(grid_config_rec_type), INTENT(IN) :: config_flags
      REAL :: clwchem, dvfog, dvpart, pa, rad, dep_vap
      REAL :: rhchem, ta, ustar, vegfrac, z1, zntt
      INTEGER :: i, iland, iprt, iseason, j, jce, jcs, n, nr, ipr,jpr,nvr
      LOGICAL :: highnh3, rainflag, vegflag, wetflag
      REAL :: p(kts:kte)
      REAL :: srfres(numgas)
      REAL :: ddvel0d(numgas)
      real :: rcx(numgas)
      INTRINSIC max, min
      dep_vap= config_flags%depo_fact
      CALL wrf_debug(15,'in dry_dep_wesely')
      if( config_flags%chem_opt /= MOZART_KPP .and. &
          config_flags%chem_opt /= MOZCART_KPP .and. &
          config_flags%chem_opt /= SAPRC99_MOSAIC_4BIN_VBS2_KPP .and. &
          config_flags%chem_opt /= SAPRC99_KPP .and. &
          config_flags%chem_opt /= SAPRC99_MOSAIC_4BIN_VBS9_KPP .and. &
          config_flags%chem_opt /= SAPRC99_MOSAIC_8BIN_VBS2_AQ_KPP .and. &
          config_flags%chem_opt /= SAPRC99_MOSAIC_8BIN_VBS2_KPP .and. &
          config_flags%chem_opt /= MOZART_MOSAIC_4BIN_VBS0_KPP ) then
         if( julday < 90 .or. julday > 270 ) then
            iseason = 2
            CALL wrf_debug(15,'setting iseason to 2')
         else
            iseason = 1
         endif
      end if
tile_lat_loop : &
      do j = jts,jte
tile_lon_loop : &
         do i = its,ite
            iprt = 0
            iland = luse2usgs( ivgtyp(i,j) )
            if( config_flags%chem_opt == MOZART_KPP .or. &
                config_flags%chem_opt == MOZCART_KPP .or. &
                config_flags%chem_opt == SAPRC99_MOSAIC_4BIN_VBS2_KPP .or. &
                config_flags%chem_opt == SAPRC99_KPP .or. &
                config_flags%chem_opt == SAPRC99_MOSAIC_4BIN_VBS9_KPP .or. &
                config_flags%chem_opt == SAPRC99_MOSAIC_8BIN_VBS2_AQ_KPP .or. &
                config_flags%chem_opt == SAPRC99_MOSAIC_8BIN_VBS2_KPP .or. &
                config_flags%chem_opt == MOZART_MOSAIC_4BIN_VBS0_KPP ) then
               if( snowh(i,j) < .01 ) then
                  iseason = seasonal_pft(id)%seasonal_wes(i,j,iland,current_month)
               else
                 iseason = 4
               endif
               if( xice(i,j) >= .15 ) then
                 iland = 8
                 iseason = 4
               endif
            end if
            ta = tsk(i,j)
            rad = gsw(i,j)
            vegfrac = vegfra(i,j)
            pa = .01*p_phy(i,kts,j)
            clwchem = moist(i,kts,j,p_qc)
            ustar = ust(i,j)
            zntt = znt(i,j)
            z1 = z_at_w(i,kts+1,j) - z_at_w(i,kts,j)
            rainflag = .FALSE.
            wetflag = .FALSE.
            highnh3 = .FALSE.
            if(p_qr > 1) then
               if(moist(i,kts,j,p_qr) > 1.e-18 .or. raincv(i,j) > 0.) then
                  rainflag = .true.
               endif
            endif
            rhchem = MIN( 100.,100. * moist(i,kts,j,p_qv) / &
                     (3.80*exp(17.27*(t_phy(i,kts,j)-273.)/(t_phy(i,kts,j)-36.))/pa))
            rhchem = MAX(5.,RHCHEM)
            if (rhchem >= 95.) wetflag = .true.
            if( p_nh3 > 1 .and. p_so2 > 1 ) then
               if( chem(i,kts,j,p_nh3) > 2.*chem(i,kts,j,p_so2) ) then
                  highnh3 = .true.
               endif
            endif
            CALL rc( rcx, ta, rad, rhchem, iland, &
                     iseason, numgas, wetflag, rainflag, highnh3, &
                     iprt, moist(i,kts,j,p_qv), p8w(i,kts,j), config_flags%chem_opt )
            if( config_flags%chem_opt /= MOZART_KPP .and. &
                config_flags%chem_opt /= MOZCART_KPP .and. &
          config_flags%chem_opt /= MOZART_MOSAIC_4BIN_VBS0_KPP) then
               srfres(1:numgas-2) = rcx(1:numgas-2)
               srfres(numgas-1:numgas) = 0.
            else
               srfres(1:numgas) = rcx(1:numgas)
            end if
            CALL deppart( rmol(i,j), ustar, rhchem, clwchem, iland, dvpart, dvfog )
            ddvel0d(1:numgas) = 0.
            aer_res_def(i,j) = 0.
            aer_res_zcen(i,j) = 0.
            CALL landusevg( ddvel0d, ustar, rmol(i,j), zntt, z1, dvpart, iland, &
                            numgas, srfres, aer_res_def(i,j), aer_res_zcen(i,j), p_sulf )
            ddvel(i,j,1:numgas) = ddvel0d(1:numgas)
            if ( (config_flags%chem_opt == RADM2 ) .or. &
                 (config_flags%chem_opt == RADM2SORG ) .or. &
                 (config_flags%chem_opt == RADM2SORG_AQ ) .or. &
                 (config_flags%chem_opt == RADM2SORG_AQCHEM) ) then
                     ddvel(i,j,p_hcl) = ddvel(i,j,p_hno3)
            end if
         end do tile_lon_loop
      end do tile_lat_loop
      if ( (config_flags%chem_opt == CBMZ ) .or. &
           (config_flags%chem_opt == CBMZ_BB ) .or. &
           (config_flags%chem_opt == CBMZ_BB_KPP ) .or. &
           (config_flags%chem_opt == CBMZ_SORGAM_KPP ) .or. &
           (config_flags%chem_opt == CBMZ_MOSAIC_KPP ) .or. &
           (config_flags%chem_opt == CBMZ_MOSAIC_4BIN_VBS2_KPP).or.&
           (config_flags%chem_opt == CBMZ_MOSAIC_8BIN_VBS9_KPP ) .or. &
           (config_flags%chem_opt == CBMZ_MOSAIC_4BIN_VBS9_KPP ) .or. &
           (config_flags%chem_opt == CBMZ_MOSAIC_4BIN_AQ) .or. &
           (config_flags%chem_opt == CBMZ_MOSAIC_8BIN_AQ) .or. &
           (config_flags%chem_opt == CBMZ_MOSAIC_4BIN) .or. &
           (config_flags%chem_opt == CBMZ_MOSAIC_8BIN) .or. &
           (config_flags%chem_opt == CBMZ_MOSAIC_DMS_4BIN_AQ) .or. &
           (config_flags%chem_opt == CBMZ_MOSAIC_DMS_8BIN_AQ) .or. &
           (config_flags%chem_opt == CBMZ_MOSAIC_DMS_4BIN) .or. &
           (config_flags%chem_opt == CBMZ_MOSAIC_DMS_8BIN) .or. &
           (config_flags%chem_opt == CBMZ_CAM_MAM3_NOAQ ) .or. &
           (config_flags%chem_opt == CBMZ_CAM_MAM3_AQ ) .or. &
           (config_flags%chem_opt == CBMZ_CAM_MAM7_NOAQ ) .or. &
           (config_flags%chem_opt == CBMZ_CAM_MAM7_AQ ) ) then
         do j=jts,jte
            do i=its,ite
               ddvel(i,j,p_sulf) = ddvel(i,j,p_hno3)
               ddvel(i,j,p_hcl) = ddvel(i,j,p_hno3)
               ddvel(i,j,p_ch3o2) = 0
               ddvel(i,j,p_ethp) = 0
               ddvel(i,j,p_ch3oh) = ddvel(i,j,p_hcho)
               ddvel(i,j,p_c2h5oh) = ddvel(i,j,p_hcho)
               ddvel(i,j,p_to2) = 0
               ddvel(i,j,p_cro) = 0
               ddvel(i,j,p_open) = ddvel(i,j,p_xyl)
               ddvel(i,j,p_op3) = ddvel(i,j,p_op2)
               ddvel(i,j,p_c2o3) = 0
               ddvel(i,j,p_ro2) = 0
               ddvel(i,j,p_ano2) = 0
               ddvel(i,j,p_nap) = 0
               ddvel(i,j,p_xo2) = 0
               ddvel(i,j,p_xpar) = 0
               ddvel(i,j,p_isoprd) = 0
               ddvel(i,j,p_isopp) = 0
               ddvel(i,j,p_isopn) = 0
               ddvel(i,j,p_isopo2) = 0
               if((config_flags%chem_opt == CBMZ ) .or. &
                  (config_flags%chem_opt == CBMZ_MOSAIC_DMS_4BIN) .or. &
                  (config_flags%chem_opt == CBMZ_MOSAIC_DMS_8BIN) .or. &
                  (config_flags%chem_opt == CBMZ_MOSAIC_DMS_4BIN_AQ) .or. &
                  (config_flags%chem_opt == CBMZ_MOSAIC_DMS_8BIN_AQ) ) then
                  ddvel(i,j,p_dms) = 0
                  ddvel(i,j,p_msa) = ddvel(i,j,p_hno3)
                  ddvel(i,j,p_dmso) = 0
                  ddvel(i,j,p_dmso2) = 0
                  ddvel(i,j,p_ch3so2h) = 0
                  ddvel(i,j,p_ch3sch2oo) = 0
                  ddvel(i,j,p_ch3so2) = 0
                  ddvel(i,j,p_ch3so3) = 0
                  ddvel(i,j,p_ch3so2oo) = 0
                  ddvel(i,j,p_ch3so2ch2oo) = 0
                  ddvel(i,j,p_mtf) = 0
               end if
               if( ( config_flags%chem_opt == CBMZ_CAM_MAM3_NOAQ ) .or. &
                   ( config_flags%chem_opt == CBMZ_CAM_MAM3_AQ ) .or. &
                   ( config_flags%chem_opt == CBMZ_CAM_MAM7_NOAQ ) .or. &
                   ( config_flags%chem_opt == CBMZ_CAM_MAM7_AQ ) ) then
                  ddvel(i,j,p_soag) = 0.0
               end if
            end do
         end do
      end if
     if( config_flags%chem_opt == SAPRC99_MOSAIC_8BIN_VBS2_AQ_KPP ) then
       do j=jts,jte
          do i=its,ite
               ddvel(i,j,p_dms) = 0.
               ddvel(i,j,p_mvk) = 0.
               ddvel(i,j,p_c2h6) = 0.
               ddvel(i,j,p_c3h6) = 0.
               ddvel(i,j,p_c3h8) = 0.
               ddvel(i,j,p_mek) = 0.
               ddvel(i,j,p_ch4) = 0.
               ddvel(i,j,p_co2) = 0.
               ddvel(i,j,p_hcl) = ddvel(i,j,p_hno3)
          end do
        end do
      end if
     if (config_flags%chem_opt == RACM_SOA_VBS_KPP) then
         do j=jts,jte
            do i=its,ite
               ddvel(i,j,p_cvasoa1) = dep_vap*ddvel(i,j,p_hno3)
               ddvel(i,j,p_cvasoa2) = dep_vap*ddvel(i,j,p_hno3)
               ddvel(i,j,p_cvasoa3) = dep_vap*ddvel(i,j,p_hno3)
               ddvel(i,j,p_cvasoa4) = dep_vap*ddvel(i,j,p_hno3)
               ddvel(i,j,p_cvbsoa1) = dep_vap*ddvel(i,j,p_hno3)
               ddvel(i,j,p_cvbsoa2) = dep_vap*ddvel(i,j,p_hno3)
               ddvel(i,j,p_cvbsoa3) = dep_vap*ddvel(i,j,p_hno3)
               ddvel(i,j,p_cvbsoa4) = dep_vap*ddvel(i,j,p_hno3)
               ddvel(i,j,p_sesq) = 0.
               ddvel(i,j,p_mbo) = 0.
            end do
         end do
      end if
      if (config_flags%chem_opt == CBM4_KPP ) then
         do j=jts,jte
            do i=its,ite
               ddvel(i,j,p_open) = ddvel(i,j,p_xyl)
               ddvel(i,j,p_ro2) = 0
               ddvel(i,j,p_xo2) = 0
               ddvel(i,j,p_ald2) = ddvel(i,j,p_ald)
               ddvel(i,j,p_iso) = 0
            end do
         end do
      end if
      if (config_flags%chem_opt == CBMZ_SORGAM_KPP ) then
         do j=jts,jte
            do i=its,ite
               ddvel(i,j,p_aro1) = 0
               ddvel(i,j,p_aro2) = 0
               ddvel(i,j,p_alk1) = 0
               ddvel(i,j,p_ole1) = 0
               ddvel(i,j,p_api1) = 0
               ddvel(i,j,p_api2) = 0
               ddvel(i,j,p_lim1) = 0
               ddvel(i,j,p_lim2) = 0
               ddvel(i,j,p_api) = 0
               ddvel(i,j,p_lim) = 0
            end do
         end do
      end if
      if (config_flags%chem_opt == CBMZ_MOSAIC_KPP ) then
         do j=jts,jte
            do i=its,ite
               ddvel(i,j,p_aro1) = 0
               ddvel(i,j,p_aro2) = 0
               ddvel(i,j,p_alk1) = 0
               ddvel(i,j,p_ole1) = 0
               ddvel(i,j,p_api1) = 0
               ddvel(i,j,p_api2) = 0
               ddvel(i,j,p_lim1) = 0
               ddvel(i,j,p_lim2) = 0
               ddvel(i,j,p_api) = 0
               ddvel(i,j,p_lim) = 0
            end do
         end do
      end if
      if (config_flags%chem_opt == CBMZ_MOSAIC_8BIN_VBS9_KPP ) then
         do j=jts,jte
            do i=its,ite
               ddvel(i,j,p_aro1) = 0
               ddvel(i,j,p_aro2) = 0
               ddvel(i,j,p_alk1) = 0
               ddvel(i,j,p_ole1) = 0
               ddvel(i,j,p_api1) = 0
               ddvel(i,j,p_api2) = 0
               ddvel(i,j,p_lim1) = 0
               ddvel(i,j,p_lim2) = 0
               ddvel(i,j,p_api) = 0
               ddvel(i,j,p_lim) = 0
            end do
         end do
      end if
      if (config_flags%chem_opt == CBMZ_MOSAIC_4BIN_VBS9_KPP ) then
         do j=jts,jte
            do i=its,ite
               ddvel(i,j,p_aro1) = 0
               ddvel(i,j,p_aro2) = 0
               ddvel(i,j,p_alk1) = 0
               ddvel(i,j,p_ole1) = 0
               ddvel(i,j,p_api1) = 0
               ddvel(i,j,p_api2) = 0
               ddvel(i,j,p_lim1) = 0
               ddvel(i,j,p_lim2) = 0
               ddvel(i,j,p_api) = 0
               ddvel(i,j,p_lim) = 0
            end do
         end do
      end if
      if ((config_flags%chem_opt == GOCARTRACM_KPP) .OR. &
           (config_flags%chem_opt == GOCARTRADM2_KPP) .OR. &
           (config_flags%chem_opt == GOCARTRADM2)) then
         do j=jts,jte
            do i=its,ite
               ddvel(i,j,p_sulf) = 0.
               ddvel(i,j,p_dms) = 0.
               ddvel(i,j,p_msa) = ddvel(i,j,p_hno3)
               if( config_flags%chem_opt == GOCARTRADM2 ) then
               ddvel(i,j,p_hcl) = ddvel(i,j,p_hno3)
               end if
            end do
         end do
      end if
      if (config_flags%chem_opt == GOCART_SIMPLE ) then
         do j=jts,jte
            do i=its,ite
               ddvel(i,j,p_msa) = ddvel(i,j,p_sulf)
               ddvel(i,j,p_sulf) = 0.
               ddvel(i,j,p_dms) = 0.
            end do
         end do
      end if
      if( config_flags%chem_opt == MOZART_KPP .or. &
          config_flags%chem_opt == MOZCART_KPP .or. &
          config_flags%chem_opt == MOZART_MOSAIC_4BIN_VBS0_KPP ) then
         do j=jts,jte
            do i=its,ite
               ddvel(i,j,p_mpan) = ddvel(i,j,p_mpan)/3.
               ddvel(i,j,p_mvkooh) = ddvel(i,j,p_hno3)
               ddvel(i,j,p_isooh) = ddvel(i,j,p_hno3)
               ddvel(i,j,p_xooh) = ddvel(i,j,p_hno3)
               ddvel(i,j,p_o) = 0.
               ddvel(i,j,p_o1d_cb4) = 0.
               ddvel(i,j,p_no3) = 0.
               ddvel(i,j,p_n2o5) = 0.
               ddvel(i,j,p_ho) = 0.
               ddvel(i,j,p_ho2) = 0.
               ddvel(i,j,p_ch3o2) = 0.
               ddvel(i,j,p_n2o) = 0.
               ddvel(i,j,p_ch4) = 0.
               ddvel(i,j,p_h2) = 0.
               ddvel(i,j,p_co2) = 0.
               ddvel(i,j,p_c2h4) = 0.
               ddvel(i,j,p_c2h6) = 0.
               ddvel(i,j,p_c3h6) = 0.
               ddvel(i,j,p_c3h8) = 0.
               ddvel(i,j,p_aco3) = 0.
               ddvel(i,j,p_gly) = 0.
               ddvel(i,j,p_macr) = 0.
               ddvel(i,j,p_mek) = 0.
               ddvel(i,j,p_eto2) = 0.
               ddvel(i,j,p_open) = 0.
               ddvel(i,j,p_eo) = 0.
               ddvel(i,j,p_pro2) = 0.
               ddvel(i,j,p_po2) = 0.
               ddvel(i,j,p_aceto2) = 0.
               ddvel(i,j,p_bigene) = 0.
               ddvel(i,j,p_bigalk) = 0.
               ddvel(i,j,p_eneo2) = 0.
               ddvel(i,j,p_alko2) = 0.
               ddvel(i,j,p_isopr) = 0.
               ddvel(i,j,p_iso2) = 0.
               ddvel(i,j,p_mvko2) = 0.
               ddvel(i,j,p_xo2) = 0.
               ddvel(i,j,p_c10h16) = 0.
               ddvel(i,j,p_terpo2) = 0.
               ddvel(i,j,p_tol) = 0.
               ddvel(i,j,p_to2) = 0.
               ddvel(i,j,p_xoh) = 0.
               ddvel(i,j,p_isopn) = 0.
               ddvel(i,j,p_meko2) = 0.
               ddvel(i,j,p_dms) = 0.
            if ( config_flags%chem_opt == MOZART_MOSAIC_4BIN_VBS0_KPP ) then
               ddvel(i,j,p_voca) = 0.
               ddvel(i,j,p_vocbb) = 0.
               ddvel(i,j,p_smpa) = 0
               ddvel(i,j,p_smpbb) = 0
            end if
            end do
            if ( config_flags%chem_opt == MOZCART_KPP ) then
               ddvel(its:ite,j,p_sulf) = 0.
            end if
         end do
      end if
      if( config_flags%chem_opt == crimech_kpp .or. &
          config_flags%chem_opt == cri_mosaic_8bin_aq_kpp .or. &
          config_flags%chem_opt == cri_mosaic_4bin_aq_kpp ) then
         do j=jts,jte
            do i=its,ite
               ddvel(i,j,p_ch3co2h) = 0.
               ddvel(i,j,p_clno2) = 0.
               ddvel(i,j,p_c2h6) = 0.
               ddvel(i,j,p_aco3) = 0.
               ddvel(i,j,p_hso3) = 0.
               ddvel(i,j,p_so3) = 0.
               ddvel(i,j,p_c3h8) = 0.
               ddvel(i,j,p_nc4h10) = 0.
               ddvel(i,j,p_c5h8) = 0.
               ddvel(i,j,p_benzene) = 0.
               ddvel(i,j,p_toluene) = 0.
               ddvel(i,j,p_oxyl) = 0.
               ddvel(i,j,p_npropol) = 0.
               ddvel(i,j,p_c2h2) = 0.
               ddvel(i,j,p_c3h6) = 0.
               ddvel(i,j,p_c2h4) = 0.
               ddvel(i,j,p_tbut2ene) = 0.
               ddvel(i,j,p_mek) = 0.
               ddvel(i,j,p_ipropol) = 0.
               ddvel(i,j,p_apinene) = 0.
               ddvel(i,j,p_bpinene) = 0.
               ddvel(i,j,p_ch3cl) = 0.
               ddvel(i,j,p_ch2cl2) = 0.
               ddvel(i,j,p_chcl3) = 0.
               ddvel(i,j,p_ch3ccl3) = 0.
               ddvel(i,j,p_cdicleth) = 0.
               ddvel(i,j,p_tdicleth) = 0.
               ddvel(i,j,p_tricleth ) = 0.
               ddvel(i,j,p_tce) = 0.
               ddvel(i,j,p_noa) = 0.
               ddvel(i,j,p_aroh14) = 0.
               ddvel(i,j,p_raroh14) = 0.
               ddvel(i,j,p_arnoh14) = 0.
               ddvel(i,j,p_aroh17) = 0.
               ddvel(i,j,p_raroh17) = 0.
               ddvel(i,j,p_arnoh17) = 0.
               ddvel(i,j,p_anhy) = 0.
               ddvel(i,j,p_ch4) = 0.
               ddvel(i,j,p_sulf) = ddvel(i,j,p_hno3)
               ddvel(i,j,p_hcl) = ddvel(i,j,p_hno3)
               ddvel(i,j,p_h2) = 0.
               ddvel(i,j,p_tm123b) = 0.
               ddvel(i,j,p_tm124b) = 0.
               ddvel(i,j,p_tm135b) = 0.
               ddvel(i,j,p_oethtol) = 0.
               ddvel(i,j,p_methtol) = 0.
               ddvel(i,j,p_pethtol) = 0.
               ddvel(i,j,p_dime35eb) = 0.
               ddvel(i,j,p_dms) = 0.
               ddvel(i,j,p_ch3sch2oo) = 0.
               ddvel(i,j,p_dmso) = 0.
               ddvel(i,j,p_ch3s) = 0.
               ddvel(i,j,p_ch3so) = 0.
               ddvel(i,j,p_ch3so3) = 0.
               ddvel(i,j,p_msa) = 0.
               ddvel(i,j,p_msia) = 0.
               ddvel(i,j,p_ho) = 0.
               ddvel(i,j,p_ho2) = 0.
               ddvel(i,j,p_ch3oo) = 0.
               ddvel(i,j,p_c2h5o2) = 0.
               ddvel(i,j,p_hoch2ch2o2) = 0.
               ddvel(i,j,p_ic3h7o2) = 0.
               ddvel(i,j,p_rn10o2) = 0.
               ddvel(i,j,p_rn13o2) = 0.
               ddvel(i,j,p_rn16o2) = 0.
               ddvel(i,j,p_rn19o2) = 0.
               ddvel(i,j,p_rn9o2) = 0.
               ddvel(i,j,p_rn12o2) = 0.
               ddvel(i,j,p_rn15o2) = 0.
               ddvel(i,j,p_rn18o2) = 0.
               ddvel(i,j,p_nrn6o2) = 0.
               ddvel(i,j,p_nrn9o2) = 0.
               ddvel(i,j,p_nrn12o2) = 0.
               ddvel(i,j,p_rn11o2) = 0.
               ddvel(i,j,p_rn14o2) = 0.
               ddvel(i,j,p_rn8o2) = 0.
               ddvel(i,j,p_rn17o2) = 0.
               ddvel(i,j,p_rn13ao2) = 0.
               ddvel(i,j,p_rn16ao2) = 0.
               ddvel(i,j,p_rn15ao2) = 0.
               ddvel(i,j,p_rn18ao2) = 0.
               ddvel(i,j,p_ru14o2) = 0.
               ddvel(i,j,p_ru12o2) = 0.
               ddvel(i,j,p_ru10o2) = 0.
               ddvel(i,j,p_nru14o2) = 0.
               ddvel(i,j,p_nru12o2) = 0.
               ddvel(i,j,p_ra13o2) = 0.
               ddvel(i,j,p_ra16o2) = 0.
               ddvel(i,j,p_ra19ao2) = 0.
               ddvel(i,j,p_ra19co2) = 0.
               ddvel(i,j,p_rtn28o2) = 0.
               ddvel(i,j,p_rtn26o2) = 0.
               ddvel(i,j,p_nrtn28o2) = 0.
               ddvel(i,j,p_rtn25o2) = 0.
               ddvel(i,j,p_rtn24o2) = 0.
               ddvel(i,j,p_rtn23o2) = 0.
               ddvel(i,j,p_rtn14o2) = 0.
               ddvel(i,j,p_rtn10o2) = 0.
               ddvel(i,j,p_rtx28o2) = 0.
               ddvel(i,j,p_rtx24o2) = 0.
               ddvel(i,j,p_rtx22o2) = 0.
               ddvel(i,j,p_nrtx28o2) = 0.
               ddvel(i,j,p_ch3o2no2) = 0.
               ddvel(i,j,p_ra22ao2) = 0.
               ddvel(i,j,p_ra22bo2) = 0.
               ddvel(i,j,p_ra25o2) = 0.
               ddvel(i,j,p_ch3so2) = 0.
               ddvel(i,j,p_dmso2 ) = 0.
            end do
         end do
      end if
END SUBROUTINE wesely_driver
      SUBROUTINE rc( rcx, t, rad, rh, iland, &
                     iseason, numgas, wetflag, rainflag, highnh3, &
                     iprt, spec_hum, p_srf, chem_opt )
  USE module_state_description
        INTEGER, intent(in) :: iland, iseason, numgas
        INTEGER, intent(in) :: iprt
        INTEGER, intent(in) :: chem_opt
        REAL, intent(in) :: rad, rh
        REAL, intent(in) :: t
        REAL, intent(in) :: p_srf
        REAL, intent(in) :: spec_hum
        real, intent(out) :: rcx(numgas)
        LOGICAL, intent(in) :: highnh3, rainflag, wetflag
        REAL, parameter :: t0 = 298.
        REAL, parameter :: tmelt = 273.16
        INTEGER :: lt, n
        REAL :: rclx, rdc, resice, rgsx, rluo1, rluo2
        REAL :: rlux, rmx, rs, rsmx, rdtheta, z, wrk
        REAL :: qs, es, ws, dewm, dv_pan, drat
        REAL :: crs, tc
        REAL :: rs_pan, tc_pan
        LOGICAL :: has_dew
        REAL :: hstary(numgas)
        INTRINSIC exp
        rcx(1:numgas) = 1.
        tc = t - 273.15
        rdtheta = 0.
        z = 200./(rad+0.1)
        IF ( tc<=0. .OR. tc>=40. ) THEN
          rs = 9999.
        ELSE
          rs = ri(iland,iseason)*(1+z*z)*(400./(tc*(40.-tc)))
        END IF
        rdc = 100.*(1. + 1000./(rad + 10.))/(1. + 1000.*rdtheta)
        rluo1 = 1./(1./3000. + 3./rlu(iland,iseason))
        rluo2 = 1./(1./1000. + 3./rlu(iland,iseason))
        resice = 1000.*exp( -(tc + 4.) )
        wrk = (t0 - t)/(t0*t)
        DO n = 1, numgas
          IF( hstar(n) /= 0. ) then
             hstary(n) = hstar(n)*exp( dhr(n)*wrk )
is_mozart : if( chem_opt == MOZART_KPP .or. chem_opt == MOZCART_KPP ) then
                 if( n == p_hno3 ) then
                    hstary(n) = 2.6e6*exp( 8700.*wrk )*1.e5
                 else if( n == p_hno4 ) then
                    hstary(n) = 32.e5
                 else if( n == p_h2o2 ) then
                    hstary(n) = hstary(n)*(1. + 2.2e-12*exp( -3730.*wrk )*1.e5)
                 else if( n == p_paa ) then
                    hstary(n) = hstary(n)*(1. + 1.8e-4*exp( -1510.*wrk )*1.e5)
                 end if
             endif is_mozart
             rmx = 1./(hstary(n)/3000. + 100.*f0(n))
             rsmx = rs*dratio(n) + rmx
             if( (chem_opt == MOZART_KPP .or. chem_opt == MOZCART_KPP .or. chem_opt == MOZART_MOSAIC_4BIN_VBS0_KPP ) .and. &
                 iseason /= 4 .and. p_pan > 1 ) then
                if( iland /= iswater_temp .and. n == p_pan ) then
                    es = 611.*exp( 5414.77*(t - tmelt)/(tmelt*t) )
                    ws = .622*es/(p_srf - es)
                    qs = ws/(1. + ws)
                    has_dew = .false.
                    if( qs <= spec_hum ) then
                      has_dew = .true.
                    end if
                    if( t < tmelt ) then
                       has_dew = .false.
                    end if
                    if( has_dew .or. rainflag ) then
                       dewm = 3.
                    else
                       dewm = 1.
                    endif
                    drat = wpan/wh2o
                    tc_pan = t - tmelt
                    if( t > tmelt .and. t < 313.15 ) then
                       crs = (1. + (200./(rad + .1))**2) * (400./(tc_pan*(40. - tc_pan)))
                    else
                       crs = large_value
                    end if
                    lt = wrf2mz_lt_map(iland)
                    rs_pan = ri_pan(iseason,lt)*crs
                    dv_pan = c0_pan(lt) * (1. - exp( -k_pan(lt)*(dewm*rs_pan*drat)*1.e-2 ))
                    if( dv_pan > 0. ) then
                       rsmx = 1./dv_pan
                    end if
                endif
             endif
             rclx = 1./(1.e-5*hstary(n)/rcls(iland,iseason) &
                        + f0(n)/rclo(iland,iseason)) + resice
             rgsx = 1./(1.e-5*hstary(n)/rgss(iland,iseason) &
                        + f0(n)/rgso(iland,iseason)) + resice
             rlux = rlu(iland,iseason)/(1.e-5*hstary(n) + f0(n)) + resice
             IF( wetflag ) THEN
               rlux = 1./(1./(3.*rlu(iland,iseason)) + 1.e-7*hstary(n) + f0(n)/rluo1)
             END IF
             IF( rainflag ) THEN
               rlux = 1./(1./(3.*rlu(iland,iseason)) + 1.e-7*hstary(n) + f0(n)/rluo2)
             END IF
             rcx(n) = 1./(1./rsmx + 1./rlux + 1./(rdc + rclx) + 1./(rac(iland,iseason) + rgsx))
             rcx(n) = max( 1.,rcx(n) )
          end IF
        END DO
        if(p_o3 > 1)then
           hstary(p_o3) = hstar(p_o3)*exp( dhr(p_o3)*(298. - t)/(298.*t) )
           rmx = 1./(hstary(p_o3)/3000.+100.*f0(p_o3))
           rsmx = rs*dratio(p_o3) + rmx
           rlux = rlu(iland,iseason)/(1.E-5*hstary(p_o3)+f0(p_o3)) + resice
           rclx = rclo(iland,iseason) + resice
           rgsx = rgso(iland,iseason) + resice
           IF (wetflag) rlux = rluo1
           IF (rainflag) rlux = rluo2
           rcx(p_o3) = 1. &
                       /(1./rsmx+1./rlux+1./(rdc+rclx)+1./(min(100.,rac(iland,iseason))+rgsx))
           rcx(p_o3) = max( 1.,rcx(p_o3) )
        endif
is_so2 : &
     if( p_so2 > 1 ) then
        rsmx = rs*dratio(p_so2)
        IF (tc> -1. ) THEN
          IF (rh<81.3) THEN
            rlux = 25000.*exp(-0.0693*rh)
          ELSE
            rlux = 0.58E12*exp(-0.278*rh)
          END IF
        END IF
        IF (((wetflag) .OR. (rainflag)) .AND. (tc> -1. )) THEN
          rlux = 1.
        END IF
        IF ((tc>= -5. ) .AND. (tc<= -1. )) THEN
          rlux = 200.
        END IF
        IF (tc< -5. ) THEN
          rlux = 500.
        END IF
        rclx = rcls(iland,iseason)
        rgsx = 1000.
        IF ((wetflag) .OR. (rainflag)) THEN
          IF (highnh3) THEN
            rgsx = 0.
          ELSE
            rgsx = 500.
          END IF
        END IF
        IF (iland==iswater_temp) THEN
          rgsx = 0.
        END IF
        IF( iseason==4 .OR. iland==isice_temp ) THEN
          IF( tc > 2. ) THEN
            rgsx = 0.
          else IF ( tc >= -1. .AND. tc <= 2. ) THEN
            rgsx = 70.*(2. - tc)
          else IF ( tc < -1. ) THEN
            rgsx = 500.
          END IF
        END IF
        IF ((iseason/=4) .AND. (ixxxlu(iland)/=1) .AND. (iland/=iswater_temp) .AND. &
            (iland/=isice_temp)) THEN
          rcx(p_so2) = 1./(1./rsmx+1./rlux+1./(rclx+rdc+rgsx))
        ELSE
          rcx(p_so2) = rgsx
        END IF
        rcx(p_so2) = max( 1.,rcx(p_so2) )
     end if is_so2
is_nh3: if( p_nh3 > 1 ) then
        rsmx = rs*dratio(p_nh3)
        IF (ixxxlu(iland)==3) THEN
          IF (iseason==1) THEN
            rcx(p_nh3) = 1000.
          END IF
          IF ((iseason==2) .OR. (iseason==3) .OR. (iseason==5)) THEN
            IF (tc>-1.) THEN
              IF (rad/=0.) THEN
                rcx(p_nh3) = 50.
              ELSE
                rcx(p_nh3) = 100.
              END IF
              IF ((wetflag) .OR. (rainflag)) THEN
                rcx(p_nh3) = 20.
              END IF
            END IF
            IF ((tc>=(-5.)) .AND. (tc<=-1.)) THEN
              rcx(p_nh3) = 200.
            END IF
            IF (tc<(-5.)) THEN
              rcx(p_nh3) = 500.
            END IF
          END IF
        END IF
        IF (ixxxlu(iland)==2) THEN
          IF (iseason==1) THEN
            IF (rad/=0.) THEN
              rcx(p_nh3) = rsmx
            ELSE
              rcx(p_nh3) = 200.
            END IF
            IF ((wetflag) .OR. (rainflag)) THEN
              rcx(p_nh3) = 50.
            END IF
          END IF
          IF ((iseason==2) .OR. (iseason==3) .OR. (iseason==5)) THEN
            IF (tc>-1.) THEN
              IF (rad/=0.) THEN
                rcx(p_nh3) = rsmx
              ELSE
                rcx(p_nh3) = 300.
              END IF
              IF ((wetflag) .OR. (rainflag)) THEN
                rcx(p_nh3) = 100.
              END IF
            END IF
            IF ((tc>=(-5.)) .AND. (tc<=-1.)) THEN
              rcx(p_nh3) = 200.
            END IF
            IF (tc<(-5.)) THEN
              rcx(p_nh3) = 500.
            END IF
          END IF
        END IF
        IF ((ixxxlu(iland)==4) .OR. (ixxxlu(iland)==5) .OR. (ixxxlu( &
            iland)==6)) THEN
          IF (rad/=0.) THEN
            rcx(p_nh3) = 500.
          ELSE
            rcx(p_nh3) = 1000.
          END IF
          IF ((wetflag) .OR. (rainflag)) THEN
            IF (highnh3) THEN
              rcx(p_nh3) = 100.
            ELSE
              rcx(p_nh3) = 0.
            END IF
          END IF
          IF ((iseason==2) .OR. (iseason==3) .OR. (iseason==5)) THEN
            IF ((tc>=(-5.)) .AND. (tc<=-1.)) THEN
              rcx(p_nh3) = 200.
            END IF
            IF (tc<(-5.)) THEN
              rcx(p_nh3) = 500.
            END IF
          END IF
        END IF
        IF (iland==iswater_temp) THEN
          rcx(p_nh3) = 0.
        END IF
        IF (ixxxlu(iland)==1) THEN
          IF ( .NOT. wetflag) THEN
            rcx(p_nh3) = 50.
          ELSE
            rcx(p_nh3) = 0.
          END IF
        END IF
        IF ((iseason==4) .OR. (iland==isice_temp)) THEN
          IF (tc>2.) THEN
            rcx(p_nh3) = 0.
          END IF
          IF ((tc>=(-1.)) .AND. (tc<=2.)) THEN
            rcx(p_nh3) = 70.*(2.-tc)
          END IF
          IF (tc<(-1.)) THEN
            rcx(p_nh3) = 500.
          END IF
        END IF
        rcx(p_nh3) = max( 1.,rcx(p_nh3) )
        endif is_nh3
      END SUBROUTINE rc
      SUBROUTINE deppart( rmol, ustar, rh, clw, iland, &
                          dvpart, dvfog )
        INTEGER, intent(in) :: iland
        REAL, intent(in) :: clw, rh, rmol, ustar
        REAL, intent(out) :: dvfog, dvpart
        INTRINSIC exp
        dvpart = ustar/kpart(iland)
        IF (rmol<0.) THEN
          dvpart = dvpart*(1.+(-300.*rmol)**0.66667)
        END IF
        IF (rh>80.) THEN
          dvpart = dvpart*(1.+0.37*exp((rh-80.)/20.))
        END IF
        dvfog = 0.06*clw
        IF (ixxxlu(iland)==5) THEN
          dvfog = dvfog + 0.195*ustar*ustar
        END IF
      END SUBROUTINE deppart
      SUBROUTINE landusevg( vgs, ustar, rmol, z0, zz, &
                            dvparx, iland, numgas, srfres, aer_res_def, &
                            aer_res_zcen, p_sulf )
        USE module_model_constants, only: karman
        INTEGER, intent(in) :: iland, numgas, p_sulf
        REAL, intent(in) :: dvparx, ustar, z0, zz
        REAL, intent(inout) :: rmol
        REAL, intent(inout) :: aer_res_def
        REAL, intent(inout) :: aer_res_zcen
        REAL, intent(in) :: srfres(numgas)
        REAL, intent(out) :: vgs(numgas)
        INTEGER :: jspec
        REAL :: vgp, vgpart, zr
        REAL :: rmol_tmp
        REAL :: vgspec(numgas)
        zr = zz*.5
        rmol_tmp = rmol
        CALL depvel( numgas, rmol_tmp, zr, z0, ustar, &
                     vgspec, vgpart, aer_res_zcen )
        zr = 2.0
        CALL depvel( numgas, rmol, zr, z0, ustar, &
                     vgspec, vgpart, aer_res_def )
        vgp = 1.0/((1.0/vgpart)+(1.0/dvparx))
        DO jspec = 1, numgas
          vgs(jspec) = 1.0/(1.0/vgspec(jspec) + srfres(jspec))
        END DO
        vgs(p_sulf) = vgp
        CALL cellvg( vgs, ustar, zz, zr, rmol, numgas )
      END SUBROUTINE landusevg
      SUBROUTINE cellvg( vgtemp, ustar, dz, zr, rmol, nspec )
        USE module_model_constants, only: karman
        INTEGER, intent(in) :: nspec
        REAL, intent(in) :: dz, rmol, ustar, zr
        REAL, intent(out) :: vgtemp(nspec)
        INTEGER :: nss
        REAL :: a, fac, pdz, pzr, vk
        INTRINSIC alog, sqrt
        vk = karman
        DO nss = 1, nspec
          IF (rmol < 0.) THEN
            pdz = sqrt(1.0 - 9.0*dz*rmol)
            pzr = sqrt(1.0 - 9.0*zr*rmol)
            fac = ((pdz - 1.0)/(pzr - 1.0))*((pzr + 1.0)/(pdz + 1.0))
            a = 0.74*dz*alog(fac) + (0.164/rmol)*(pdz-pzr)
          ELSE IF (rmol == 0.) THEN
            a = 0.74*(dz*alog(dz/zr) - dz + zr)
          ELSE
            a = 0.74*(dz*alog(dz/zr) - dz + zr) + (2.35*rmol)*(dz - zr)**2
          END IF
          vgtemp(nss) = vgtemp(nss)/(1.0 + vgtemp(nss)*a/(vk*ustar*(dz - zr)))
        END DO
      END SUBROUTINE cellvg
      SUBROUTINE depvel( numgas, rmol, zr, z0, ustar, &
                         depv, vgpart, aer_res )
        USE module_model_constants, only: karman
        INTEGER, intent(in) :: numgas
        REAL, intent(in) :: ustar, z0, zr
        REAL, intent(out) :: vgpart, aer_res
        REAL, intent(inout) :: rmol
        REAL, intent(out) :: depv(numgas)
        INTEGER :: l
        REAL :: ao, ar, polint, vk
        INTRINSIC alog
        vk = karman
        if(abs(rmol) < 1.E-6 ) rmol = 0.
        IF (rmol<0) THEN
          ar = ((1.0-9.0*zr*rmol)**(0.25)+0.001)**2
          ao = ((1.0-9.0*z0*rmol)**(0.25)+0.001)**2
          polint = 0.74*(alog((ar-1.0)/(ar+1.0))-alog((ao-1.0)/(ao+1.0)))
        ELSE IF (rmol==0.) THEN
          polint = 0.74*alog(zr/z0)
        ELSE
          polint = 0.74*alog(zr/z0) + 4.7*rmol*(zr-z0)
        END IF
        DO l = 1, numgas
          depv(l) = ustar*vk/(2.0*scpr23(l)+polint)
        END DO
        vgpart = ustar*vk/polint
        aer_res = polint/(karman*max(ustar,1.0e-4))
      END SUBROUTINE depvel
      SUBROUTINE dep_init( id, config_flags, numgas, mminlu_loc, &
                           ips, ipe, jps, jpe, ide, jde )
  USE module_model_constants
  USE module_configure
  USE module_state_description
   TYPE (grid_config_rec_type) , INTENT (in) :: config_flags
        character(len=*), intent(in) :: mminlu_loc
        integer, intent(in) :: id, numgas
        integer, intent(in) :: ips, ipe, jps, jpe
        integer, intent(in) :: ide, jde
        INTEGER :: iland, iseason, l
        integer :: iprt
        integer :: astat
        integer :: ncid
        integer :: dimid
        integer :: varid
        integer :: max_dom
        integer :: cpos, slen
        integer :: lon_e, lat_e
        integer :: iend, jend
        integer, allocatable :: input_wes_seasonal(:,:,:,:)
        REAL :: sc
        character(len=128) :: err_msg
        character(len=128) :: filename
        character(len=3) :: id_num
        REAL :: dat1(nlu,dep_seasons), dat2(nlu,dep_seasons), &
                dat3(nlu,dep_seasons), dat4(nlu,dep_seasons), &
                dat5(nlu,dep_seasons), dat6(nlu,dep_seasons), &
                dat7(nlu,dep_seasons), dvj(numgas)
      LOGICAL , EXTERNAL :: wrf_dm_on_monitor
include 'netcdf.inc'
        call nl_get_sf_surface_physics(id,l)
        if( l == 0 ) &
             call wrf_error_fatal3("<stdin>",1525,&
"ERROR: Cannot use dry deposition without using a soil model.")
        DATA ((dat1(iland,iseason),iland=1,nlu),iseason=1,dep_seasons)/0.10E+11, &
          0.60E+02, 0.60E+02, 0.60E+02, 0.60E+02, 0.70E+02, 0.12E+03, &
          0.12E+03, 0.12E+03, 0.12E+03, 0.70E+02, 0.13E+03, 0.70E+02, &
          0.13E+03, 0.10E+03, 0.10E+11, 0.80E+02, 0.10E+03, 0.10E+11, &
          0.80E+02, 0.10E+03, 0.10E+03, 0.10E+11, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.12E+03, 0.10E+11, 0.10E+11, &
          0.70E+02, 0.25E+03, 0.50E+03, 0.10E+11, 0.10E+11, 0.50E+03, &
          0.10E+11, 0.10E+11, 0.50E+03, 0.50E+03, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.12E+03, 0.10E+11, &
          0.10E+11, 0.70E+02, 0.25E+03, 0.50E+03, 0.10E+11, 0.10E+11, &
          0.50E+03, 0.10E+11, 0.10E+11, 0.50E+03, 0.50E+03, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.70E+02, 0.40E+03, 0.80E+03, 0.10E+11, &
          0.10E+11, 0.80E+03, 0.10E+11, 0.10E+11, 0.80E+03, 0.80E+03, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.12E+03, 0.12E+03, &
          0.12E+03, 0.12E+03, 0.14E+03, 0.24E+03, 0.24E+03, 0.24E+03, &
          0.12E+03, 0.14E+03, 0.25E+03, 0.70E+02, 0.25E+03, 0.19E+03, &
          0.10E+11, 0.16E+03, 0.19E+03, 0.10E+11, 0.16E+03, 0.19E+03, &
          0.19E+03, 0.10E+11, 0.10E+11, 0.10E+11/
        IF (nlu/=25) THEN
          call wrf_debug(0, 'number of land use classifications not correct ')
          CALL wrf_error_fatal3("<stdin>",1557,&
"LAND USE CLASSIFICATIONS NOT 25")
        END IF
        IF (dep_seasons/=5) THEN
          call wrf_debug(0, 'number of dep_seasons not correct ')
          CALL wrf_error_fatal3("<stdin>",1562,&
"DEP_SEASONS NOT 5")
        END IF
        DO iseason = 1, dep_seasons
           ri(1:nlu,iseason) = dat1(1:nlu,iseason)
        END DO
        DATA ((dat2(iland,iseason),iland=1,nlu),iseason=1,dep_seasons)/0.10E+11, &
          0.20E+04, 0.20E+04, 0.20E+04, 0.20E+04, 0.20E+04, 0.20E+04, &
          0.20E+04, 0.20E+04, 0.20E+04, 0.20E+04, 0.20E+04, 0.20E+04, &
          0.20E+04, 0.20E+04, 0.10E+11, 0.25E+04, 0.20E+04, 0.10E+11, &
          0.25E+04, 0.20E+04, 0.20E+04, 0.10E+11, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.90E+04, 0.90E+04, 0.90E+04, 0.90E+04, 0.90E+04, &
          0.90E+04, 0.90E+04, 0.90E+04, 0.20E+04, 0.90E+04, 0.90E+04, &
          0.20E+04, 0.40E+04, 0.80E+04, 0.10E+11, 0.90E+04, 0.80E+04, &
          0.10E+11, 0.90E+04, 0.80E+04, 0.80E+04, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.90E+04, 0.90E+04, 0.90E+04, 0.90E+04, &
          0.90E+04, 0.90E+04, 0.90E+04, 0.90E+04, 0.20E+04, 0.90E+04, &
          0.90E+04, 0.20E+04, 0.40E+04, 0.80E+04, 0.10E+11, 0.90E+04, &
          0.80E+04, 0.10E+11, 0.90E+04, 0.80E+04, 0.80E+04, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.20E+04, 0.60E+04, 0.90E+04, 0.10E+11, &
          0.90E+04, 0.90E+04, 0.10E+11, 0.90E+04, 0.90E+04, 0.90E+04, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.40E+04, 0.40E+04, &
          0.40E+04, 0.40E+04, 0.40E+04, 0.40E+04, 0.40E+04, 0.40E+04, &
          0.20E+04, 0.40E+04, 0.20E+04, 0.20E+04, 0.20E+04, 0.30E+04, &
          0.10E+11, 0.40E+04, 0.30E+04, 0.10E+11, 0.40E+04, 0.30E+04, &
          0.30E+04, 0.10E+11, 0.10E+11, 0.10E+11/
        DO iseason = 1, dep_seasons
           rlu(1:nlu,iseason) = dat2(1:nlu,iseason)
        END DO
        DATA ((dat3(iland,iseason),iland=1,nlu),iseason=1,dep_seasons)/0.10E+03, &
          0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, 0.20E+04, 0.10E+03, &
          0.10E+03, 0.10E+03, 0.10E+03, 0.20E+04, 0.20E+04, 0.20E+04, &
          0.20E+04, 0.20E+04, 0.00E+00, 0.30E+03, 0.20E+04, 0.00E+00, &
          0.30E+03, 0.20E+04, 0.20E+04, 0.00E+00, 0.00E+00, 0.00E+00, &
          0.10E+03, 0.15E+03, 0.15E+03, 0.15E+03, 0.15E+03, 0.15E+04, &
          0.10E+03, 0.10E+03, 0.10E+03, 0.10E+03, 0.15E+04, 0.20E+04, &
          0.20E+04, 0.20E+04, 0.17E+04, 0.00E+00, 0.20E+03, 0.17E+04, &
          0.00E+00, 0.20E+03, 0.17E+04, 0.17E+04, 0.00E+00, 0.00E+00, &
          0.00E+00, 0.10E+03, 0.10E+02, 0.10E+02, 0.10E+02, 0.10E+02, &
          0.10E+04, 0.10E+03, 0.10E+03, 0.10E+03, 0.10E+03, 0.10E+04, &
          0.20E+04, 0.20E+04, 0.20E+04, 0.15E+04, 0.00E+00, 0.10E+03, &
          0.15E+04, 0.00E+00, 0.10E+03, 0.15E+04, 0.15E+04, 0.00E+00, &
          0.00E+00, 0.00E+00, 0.10E+03, 0.10E+02, 0.10E+02, 0.10E+02, &
          0.10E+02, 0.10E+04, 0.10E+02, 0.10E+02, 0.10E+02, 0.10E+02, &
          0.10E+04, 0.20E+04, 0.20E+04, 0.20E+04, 0.15E+04, 0.00E+00, &
          0.50E+02, 0.15E+04, 0.00E+00, 0.50E+02, 0.15E+04, 0.15E+04, &
          0.00E+00, 0.00E+00, 0.00E+00, 0.10E+03, 0.50E+02, 0.50E+02, &
          0.50E+02, 0.50E+02, 0.12E+04, 0.80E+02, 0.80E+02, 0.80E+02, &
          0.10E+03, 0.12E+04, 0.20E+04, 0.20E+04, 0.20E+04, 0.15E+04, &
          0.00E+00, 0.20E+03, 0.15E+04, 0.00E+00, 0.20E+03, 0.15E+04, &
          0.15E+04, 0.00E+00, 0.00E+00, 0.00E+00/
        DO iseason = 1, dep_seasons
           rac(1:nlu,iseason) = dat3(1:nlu,iseason)
        END DO
        DATA ((dat4(iland,iseason),iland=1,nlu),iseason=1,dep_seasons)/0.40E+03, &
          0.15E+03, 0.15E+03, 0.15E+03, 0.15E+03, 0.50E+03, 0.35E+03, &
          0.35E+03, 0.35E+03, 0.35E+03, 0.50E+03, 0.50E+03, 0.50E+03, &
          0.50E+03, 0.10E+03, 0.10E+01, 0.10E+01, 0.10E+03, 0.10E+04, &
          0.10E+01, 0.10E+03, 0.10E+03, 0.10E+04, 0.10E+03, 0.10E+04, &
          0.40E+03, 0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, 0.50E+03, &
          0.35E+03, 0.35E+03, 0.35E+03, 0.35E+03, 0.50E+03, 0.50E+03, &
          0.50E+03, 0.50E+03, 0.10E+03, 0.10E+01, 0.10E+01, 0.10E+03, &
          0.10E+04, 0.10E+01, 0.10E+03, 0.10E+03, 0.10E+04, 0.10E+03, &
          0.10E+04, 0.40E+03, 0.15E+03, 0.15E+03, 0.15E+03, 0.15E+03, &
          0.50E+03, 0.35E+03, 0.35E+03, 0.35E+03, 0.35E+03, 0.50E+03, &
          0.50E+03, 0.50E+03, 0.50E+03, 0.20E+03, 0.10E+01, 0.10E+01, &
          0.20E+03, 0.10E+04, 0.10E+01, 0.20E+03, 0.20E+03, 0.10E+04, &
          0.10E+03, 0.10E+04, 0.10E+03, 0.10E+03, 0.10E+03, 0.10E+03, &
          0.10E+03, 0.10E+03, 0.10E+03, 0.10E+03, 0.10E+03, 0.10E+03, &
          0.10E+03, 0.10E+03, 0.50E+03, 0.10E+03, 0.10E+03, 0.10E+01, &
          0.10E+03, 0.10E+03, 0.10E+04, 0.10E+03, 0.10E+03, 0.10E+03, &
          0.10E+04, 0.10E+03, 0.10E+04, 0.50E+03, 0.15E+03, 0.15E+03, &
          0.15E+03, 0.15E+03, 0.50E+03, 0.35E+03, 0.35E+03, 0.35E+03, &
          0.35E+03, 0.50E+03, 0.50E+03, 0.50E+03, 0.50E+03, 0.20E+03, &
          0.10E+01, 0.10E+01, 0.20E+03, 0.10E+04, 0.10E+01, 0.20E+03, &
          0.20E+03, 0.10E+04, 0.10E+03, 0.10E+04/
        DO iseason = 1, dep_seasons
           rgss(1:nlu,iseason) = dat4(1:nlu,iseason)
        END DO
        DATA ((dat5(iland,iseason),iland=1,nlu),iseason=1,dep_seasons)/0.30E+03, &
          0.15E+03, 0.15E+03, 0.15E+03, 0.15E+03, 0.20E+03, 0.20E+03, &
          0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, &
          0.20E+03, 0.30E+03, 0.20E+04, 0.10E+04, 0.30E+03, 0.40E+03, &
          0.10E+04, 0.30E+03, 0.30E+03, 0.40E+03, 0.35E+04, 0.40E+03, &
          0.30E+03, 0.15E+03, 0.15E+03, 0.15E+03, 0.15E+03, 0.20E+03, &
          0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, &
          0.20E+03, 0.20E+03, 0.30E+03, 0.20E+04, 0.80E+03, 0.30E+03, &
          0.40E+03, 0.80E+03, 0.30E+03, 0.30E+03, 0.40E+03, 0.35E+04, &
          0.40E+03, 0.30E+03, 0.15E+03, 0.15E+03, 0.15E+03, 0.15E+03, &
          0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, &
          0.20E+03, 0.20E+03, 0.20E+03, 0.30E+03, 0.20E+04, 0.10E+04, &
          0.30E+03, 0.40E+03, 0.10E+04, 0.30E+03, 0.30E+03, 0.40E+03, &
          0.35E+04, 0.40E+03, 0.60E+03, 0.35E+04, 0.35E+04, 0.35E+04, &
          0.35E+04, 0.35E+04, 0.35E+04, 0.35E+04, 0.35E+04, 0.35E+04, &
          0.35E+04, 0.35E+04, 0.20E+03, 0.35E+04, 0.35E+04, 0.20E+04, &
          0.35E+04, 0.35E+04, 0.40E+03, 0.35E+04, 0.35E+04, 0.35E+04, &
          0.40E+03, 0.35E+04, 0.40E+03, 0.30E+03, 0.15E+03, 0.15E+03, &
          0.15E+03, 0.15E+03, 0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, &
          0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, 0.20E+03, 0.30E+03, &
          0.20E+04, 0.10E+04, 0.30E+03, 0.40E+03, 0.10E+04, 0.30E+03, &
          0.30E+03, 0.40E+03, 0.35E+04, 0.40E+03/
        DO iseason = 1, dep_seasons
           rgso(1:nlu,iseason) = dat5(1:nlu,iseason)
        END DO
        DATA ((dat6(iland,iseason),iland=1,nlu),iseason=1,dep_seasons)/0.10E+11, &
          0.20E+04, 0.20E+04, 0.20E+04, 0.20E+04, 0.20E+04, 0.20E+04, &
          0.20E+04, 0.20E+04, 0.20E+04, 0.20E+04, 0.20E+04, 0.20E+04, &
          0.20E+04, 0.20E+04, 0.10E+11, 0.25E+04, 0.20E+04, 0.10E+11, &
          0.25E+04, 0.20E+04, 0.20E+04, 0.10E+11, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.90E+04, 0.90E+04, 0.90E+04, 0.90E+04, 0.90E+04, &
          0.90E+04, 0.90E+04, 0.90E+04, 0.20E+04, 0.90E+04, 0.90E+04, &
          0.20E+04, 0.20E+04, 0.40E+04, 0.10E+11, 0.90E+04, 0.40E+04, &
          0.10E+11, 0.90E+04, 0.40E+04, 0.40E+04, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, &
          0.90E+04, 0.90E+04, 0.90E+04, 0.90E+04, 0.20E+04, 0.90E+04, &
          0.90E+04, 0.20E+04, 0.30E+04, 0.60E+04, 0.10E+11, 0.90E+04, &
          0.60E+04, 0.10E+11, 0.90E+04, 0.60E+04, 0.60E+04, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.90E+04, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, &
          0.90E+04, 0.90E+04, 0.20E+04, 0.20E+03, 0.40E+03, 0.10E+11, &
          0.90E+04, 0.40E+03, 0.10E+11, 0.90E+04, 0.40E+03, 0.40E+03, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.40E+04, 0.40E+04, &
          0.40E+04, 0.40E+04, 0.40E+04, 0.40E+04, 0.40E+04, 0.40E+04, &
          0.20E+04, 0.40E+04, 0.20E+04, 0.20E+04, 0.20E+04, 0.30E+04, &
          0.10E+11, 0.40E+04, 0.30E+04, 0.10E+11, 0.40E+04, 0.30E+04, &
          0.30E+04, 0.10E+11, 0.10E+11, 0.10E+11/
        DO iseason = 1, dep_seasons
           rcls(1:nlu,iseason) = dat6(1:nlu,iseason)
        END DO
        DATA ((dat7(iland,iseason),iland=1,nlu),iseason=1,dep_seasons)/0.10E+11, &
          0.10E+04, 0.10E+04, 0.10E+04, 0.10E+04, 0.10E+04, 0.10E+04, &
          0.10E+04, 0.10E+04, 0.10E+04, 0.10E+04, 0.10E+04, 0.10E+04, &
          0.10E+04, 0.10E+04, 0.10E+11, 0.10E+04, 0.10E+04, 0.10E+11, &
          0.10E+04, 0.10E+04, 0.10E+04, 0.10E+11, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.40E+03, 0.40E+03, 0.40E+03, 0.40E+03, 0.40E+03, &
          0.40E+03, 0.40E+03, 0.40E+03, 0.10E+04, 0.40E+03, 0.40E+03, &
          0.10E+04, 0.10E+04, 0.60E+03, 0.10E+11, 0.40E+03, 0.60E+03, &
          0.10E+11, 0.40E+03, 0.60E+03, 0.60E+03, 0.10E+11, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.10E+04, 0.10E+04, 0.10E+04, 0.10E+04, &
          0.40E+03, 0.40E+03, 0.40E+03, 0.40E+03, 0.10E+04, 0.40E+03, &
          0.40E+03, 0.10E+04, 0.10E+04, 0.60E+03, 0.10E+11, 0.80E+03, &
          0.60E+03, 0.10E+11, 0.80E+03, 0.60E+03, 0.60E+03, 0.10E+11, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+04, 0.10E+04, 0.10E+04, &
          0.10E+04, 0.40E+03, 0.10E+04, 0.10E+04, 0.10E+04, 0.10E+04, &
          0.40E+03, 0.40E+03, 0.10E+04, 0.15E+04, 0.60E+03, 0.10E+11, &
          0.80E+03, 0.60E+03, 0.10E+11, 0.80E+03, 0.60E+03, 0.60E+03, &
          0.10E+11, 0.10E+11, 0.10E+11, 0.10E+11, 0.10E+04, 0.10E+04, &
          0.10E+04, 0.10E+04, 0.50E+03, 0.50E+03, 0.50E+03, 0.50E+03, &
          0.10E+04, 0.50E+03, 0.15E+04, 0.10E+04, 0.15E+04, 0.70E+03, &
          0.10E+11, 0.60E+03, 0.70E+03, 0.10E+11, 0.60E+03, 0.70E+03, &
          0.70E+03, 0.10E+11, 0.10E+11, 0.10E+11/
        DO iseason = 1, dep_seasons
           rclo(1:nlu,iseason) = dat7(1:nlu,iseason)
        END DO
        hstar(1:numgas) = 0.
        hstar4(1:numgas) = 0.
        dhr(1:numgas) = 0.
        f0(1:numgas) = 0.
        dvj(1:numgas) = 99.
        if( id == 1 .or. id == 2 ) then
        if( allocated (luse2usgs) ) deallocate (luse2usgs)
        allocate( luse2usgs(config_flags%num_land_cat),stat=astat )
        if( astat /= 0 ) then
           CALL wrf_message( 'ftuv_init: failed to allocate luse2usgs array' )
           CALL wrf_abort
        end if
        if( trim(mminlu_loc) == 'USGS' ) then
           luse2usgs(:) = (/ (iland,iland=1,config_flags%num_land_cat) /)
        elseif( trim(mminlu_loc) == 'MODIFIED_IGBP_MODIS_NOAH' ) then
           luse2usgs(:) = (/ 14,13,12,11,15,8,9,10,10,7, &
                              17,4,1,5,24,19,16,21,22,23 /)
        endif
        endif
is_cbm4_kpp : &
        if (config_flags%chem_opt /= CBM4_KPP) then
           if( config_flags%chem_opt == MOZART_KPP .or. &
               config_flags%chem_opt == MOZCART_KPP .or. &
               config_flags%chem_opt == MOZART_MOSAIC_4BIN_VBS0_KPP ) then
              hstar(p_o3) = 1.15E-2
              hstar(p_co) = 1.e-3
              hstar(p_h2o2) = 8.33E+4
              hstar(p_hcho) = 6.3e3
              hstar(p_ch3ooh) = 311.
              hstar(p_ch3oh) = 220.
              hstar(p_ch3cooh) = 6.3e3
              hstar(p_acet) = 27.
              hstar(p_paa) = 837.
              hstar(p_c3h6ooh) = 220.
              hstar(p_pan) = 5.
              hstar(p_mpan) = 1.15e-2
              hstar(p_c2h5oh) = 200.
              hstar(p_etooh) = 336.
              hstar(p_prooh) = 336.
              hstar(p_acetp) = 336.
              hstar(p_onit) = 1.e3
              hstar(p_onitr) = 7.51e3
              hstar(p_acetol) = 6.3e3
              hstar(p_glyald) = 4.14e4
              hstar(p_hydrald) = 70.
              hstar(p_alkooh) = 311.
              hstar(p_mekooh) = 311.
              hstar(p_tolooh) = 311.
              hstar(p_terpooh) = 311.
     else if( config_flags%chem_opt == crimech_kpp .or. &
          config_flags%chem_opt == cri_mosaic_8bin_aq_kpp .or. &
          config_flags%chem_opt == cri_mosaic_4bin_aq_kpp ) then
              hstar(p_o3) = 1.15E-2
              hstar(p_co) = 1.e-3
              hstar(p_h2o2) = 8.33E+4
              hstar(p_hcho) = 6.3e3
              hstar(p_ch3ooh) = 311.
              hstar(p_ch3oh) = 220.
              hstar(p_ch3cooh) = 6.3e3
              hstar(p_ket) = 27.
              hstar(p_paa) = 837.
               hstar(p_c2h5co3h) = 837.
               hstar(p_hoch2co3h) = 837.
              hstar(p_pan) = 5.
              hstar(p_mpan) = 1.15e-2
              hstar(p_ru12pan) = 1.15e-2
              hstar(p_rtn26pan) = 1.15e-2
               hstar(p_phan) = 1.15e-2
               hstar(p_ppn) = 1.15e-2
              hstar(p_c2h5oh) = 200.
              hstar(p_c2h5ooh) = 336.
               hstar(p_hcooh) = 311.
               hstar(p_prooh) = 311.
               hstar(p_hoc2h4ooh) = 311.
               hstar(p_rn10ooh) = 311.
               hstar(p_rn13ooh) = 311.
               hstar(p_rn16ooh) = 311.
               hstar(p_rn19ooh) = 311.
               hstar(p_rn8ooh) = 311.
               hstar(p_rn11ooh) = 311.
               hstar(p_rn14ooh) = 311.
               hstar(p_rn17ooh) = 311.
               hstar(p_rn9ooh) = 311.
               hstar(p_rn12ooh) = 311.
               hstar(p_rn15ooh) = 311.
               hstar(p_rn18ooh) = 311.
               hstar(p_nrn6ooh) = 311.
               hstar(p_nrn9ooh) = 311.
               hstar(p_nrn12ooh) = 311.
               hstar(p_ru14ooh) = 311.
               hstar(p_ru12ooh) = 311.
               hstar(p_ru10ooh) = 311.
               hstar(p_nru14ooh) = 311.
               hstar(p_nru12ooh) = 311.
               hstar(p_ra13ooh) = 311.
               hstar(p_ra16ooh) = 311.
               hstar(p_ra19ooh) = 311.
               hstar(p_rtn28ooh) = 311.
               hstar(p_rtn26ooh) = 311.
               hstar(p_nrtn28ooh) = 311.
               hstar(p_rtn25ooh) = 311.
               hstar(p_rtn24ooh) = 311.
               hstar(p_rtn23ooh) = 311.
               hstar(p_rtn14ooh) = 311.
               hstar(p_rtn10ooh) = 311.
               hstar(p_rcooh25) = 311.
               hstar(p_rtx28ooh) = 311.
               hstar(p_rtx24ooh) = 311.
               hstar(p_rtx22ooh) = 311.
               hstar(p_nrtx28ooh) = 311.
               hstar(p_ra22ooh) = 311.
               hstar(p_ra25ooh) = 311.
               hstar(p_ch3no3) = 1.e3
               hstar(p_c2h5no3) = 1.e3
               hstar(p_hoc2h4no3) = 1.e3
               hstar(p_rn10no3) = 1.e3
               hstar(p_rn13no3) = 1.e3
               hstar(p_rn19no3) = 1.e3
               hstar(p_rn9no3) = 1.e3
               hstar(p_rn12no3) = 1.e3
               hstar(p_rn15no3) = 1.e3
               hstar(p_rn18no3) = 1.e3
               hstar(p_rn16no3) = 1.e3
               hstar(p_ru14no3) = 1.e3
               hstar(p_ra13no3) = 1.e3
               hstar(p_ra16no3) = 1.e3
               hstar(p_ra19no3) = 1.e3
               hstar(p_rtn28no3) = 1.e3
               hstar(p_rtn25no3) = 1.e3
               hstar(p_rtx28no3) = 1.e3
               hstar(p_rtx24no3) = 1.e3
               hstar(p_rtx22no3) = 1.e3
               hstar(p_rtn23no3) = 1.e3
               hstar(p_ra22no3) = 1.e3
               hstar(p_ra25no3) = 1.e3
               hstar(p_ic3h7no3) = 1.e3
         hstar(p_ch3cho) = 1.14E+1
            hstar(p_c2h5cho) = 1.14E+1
            hstar(p_hoch2cho) = 1.14E+1
               hstar(p_carb14) = 1.14E+1
               hstar(p_carb17) = 1.14E+1
               hstar(p_carb7) = 1.14E+1
               hstar(p_carb10) = 1.14E+1
               hstar(p_carb13) = 1.14E+1
               hstar(p_carb16) = 1.14E+1
               hstar(p_carb3) = 1.14E+1
               hstar(p_carb6) = 1.14E+1
               hstar(p_carb9) = 1.14E+1
               hstar(p_carb12) = 1.14E+1
               hstar(p_carb15) = 1.14E+1
               hstar(p_ccarb12) = 1.14E+1
               hstar(p_ucarb12) = 1.14E+1
               hstar(p_ucarb10) = 1.14E+1
               hstar(p_nucarb12) = 1.14E+1
               hstar(p_udcarb8) = 1.14E+1
               hstar(p_udcarb11) = 1.14E+1
               hstar(p_udcarb14) = 1.14E+1
               hstar(p_tncarb26) = 1.14E+1
               hstar(p_tncarb10) = 1.14E+1
               hstar(p_tncarb15) = 1.14E+1
               hstar(p_txcarb24) = 1.14E+1
               hstar(p_txcarb22) = 1.14E+1
               hstar(p_carb11a) = 1.14E+1
               hstar(p_tncarb12) = 1.14E+1
               hstar(p_tncarb11) = 1.14E+1
               hstar(p_udcarb17) = 1.14E+1
           else
              hstar(p_o3) = 1.13E-2
              hstar(p_co) = 8.20E-3
              hstar(p_h2o2) = 7.45E+4
              hstar(p_hcho) = 2.97E+3
              hstar(p_pan) = 2.97
              hstar(p_paa) = 473.
              hstar(p_onit) = 1.13
           end if
        hstar(p_no2) = 6.40E-3
        hstar(p_no) = 1.90E-3
        hstar(p_aco3) = 1.14E+1
        hstar(p_tpan) = 2.97E+0
        hstar(p_hono) = 3.47E+5
        hstar(p_no3) = 1.50E+1
        hstar(p_hno4) = 2.00E+13
        hstar(p_ald) = 1.14E+1
        hstar(p_op1) = 2.21E+2
        hstar(p_op2) = 1.68E+6
        hstar(p_ket) = 3.30E+1
        hstar(p_gly) = 1.40E+6
        hstar(p_mgly) = 3.71E+3
        hstar(p_dcb) = 1.40E+6
        hstar(p_so2) = 2.53E+5
        hstar(p_eth) = 2.00E-3
        hstar(p_hc3) = 1.42E-3
        hstar(p_hc5) = 1.13E-3
        hstar(p_hc8) = 1.42E-3
        hstar(p_olt) = 4.76E-3
        hstar(p_oli) = 1.35E-3
        hstar(p_tol) = 1.51E-1
        hstar(p_csl) = 4.00E+5
        hstar(p_xyl) = 1.45E-1
        hstar(p_iso) = 4.76E-3
        hstar(p_hno3) = 2.69E+13
        hstar(p_ora1) = 9.85E+6
        hstar(p_ora2) = 9.63E+5
        hstar(p_nh3) = 1.04E+4
        hstar(p_n2o5) = 1.00E+10
        if(p_ol2 > 1) hstar(p_ol2) = 4.67E-3
        if(p_par > 1) hstar(p_par) = 1.13E-3
        if(p_ch4 > 1) then
           hstar(p_ch4) = 1.50E-3
           dhr(p_ch4) = 0.
           f0(p_ch4) = 0.
           dvj(p_ch4) = 0.250
        end if
        if(p_co2 > 1) then
           hstar(p_co2) = 1.86E-1
           dhr(p_co2) = 1636.
           f0(p_co2) = 0.
           dvj(p_co2) = 0.151
        end if
        if( p_ete > 1 ) then
           HSTAR(p_ETE )=4.67E-3
           HSTAR(p_API )=4.76E-3
           HSTAR(p_LIM )=4.76E-3
           HSTAR(p_DIEN)=4.76E-3
           HSTAR(p_MACR)=1.14E+1
           HSTAR(p_UDD )=1.40E+6
           HSTAR(p_HKET)=7.80E+3
           DHR(p_ETE )= 0.
           DHR(p_API )= 0.
           DHR(p_LIM )= 0.
           DHR(p_DIEN)= 0.
           DHR(p_MACR)= 6266.
           DHR(p_UDD )= 0.
           DHR(p_HKET)= 0.
           F0(p_ETE )=0.
           F0(p_API )=0.
           F0(p_LIM )=0.
           F0(p_DIEN)=0.
           F0(p_MACR)=0.
           F0(p_UDD )=0.
           F0(p_HKET)=0.
           DVJ(p_ETE )=0.189
           DVJ(p_API )=0.086
           DVJ(p_LIM )=0.086
           DVJ(p_DIEN)=0.136
           DVJ(p_MACR)=0.120
           DVJ(p_UDD )=0.092
           DVJ(p_HKET)=0.116
        endif
        if( config_flags%chem_opt == MOZART_KPP .or. &
            config_flags%chem_opt == MOZCART_KPP .or. &
            config_flags%chem_opt == MOZART_MOSAIC_4BIN_VBS0_KPP ) then
           dhr(p_o3) = 2560.
           dhr(p_h2o2) = 7379.
           dhr(p_hcho) = 6425.
           dhr(p_ch3ooh) = 5241.
           dhr(p_ch3oh) = 4934.
           dhr(p_ch3cooh) = 6425.
           dhr(p_acet) = 5300.
           dhr(p_paa) = 5308.
           dhr(p_c3h6ooh) = 5653.
           dhr(p_pan) = 0.
           dhr(p_mpan) = 2560.
           dhr(p_c2h5oh) = 6500.
           dhr(p_etooh) = 5995.
           dhr(p_prooh) = 5995.
           dhr(p_acetp) = 5995.
           dhr(p_onit) = 6000.
           dhr(p_onitr) = 6485.
           dhr(p_acetol) = 6425.
           dhr(p_glyald) = 4630.
           dhr(p_hydrald) = 6000.
           dhr(p_alkooh) = 5241.
           dhr(p_mekooh) = 5241.
           dhr(p_tolooh) = 5241.
           dhr(p_terpooh) = 5241.
      else if( config_flags%chem_opt == crimech_kpp .or. &
          config_flags%chem_opt == cri_mosaic_8bin_aq_kpp .or. &
          config_flags%chem_opt == cri_mosaic_4bin_aq_kpp ) then
           dhr(p_o3) = 2560.
           dhr(p_h2o2) = 7379.
           dhr(p_hcho) = 6425.
           dhr(p_ch3ooh) = 5241.
           dhr(p_ch3oh) = 4934.
           dhr(p_ch3cooh) = 6425.
           dhr(p_ket) = 5300.
           dhr(p_paa) = 5308.
            dhr(p_c2h5co3h) = 5308.
            dhr(p_hoch2co3h) = 5308.
           dhr(p_pan) = 0.
           dhr(p_mpan) = 2560.
           dhr(p_ru12pan) = 2560.
           dhr(p_rtn26pan) = 2560.
           dhr(p_phan) = 2560.
           dhr(p_ppn) = 2560.
           dhr(p_c2h5oh) = 6500.
           dhr(p_c2h5ooh) = 5995.
               dhr(p_hcooh) = 5241.
               dhr(p_prooh) = 5241.
               dhr(p_hoc2h4ooh) = 5241.
               dhr(p_rn10ooh) = 5241.
               dhr(p_rn13ooh) = 5241.
               dhr(p_rn16ooh) = 5241.
               dhr(p_rn19ooh) = 5241.
               dhr(p_rn8ooh) = 5241.
               dhr(p_rn11ooh) = 5241.
               dhr(p_rn14ooh) = 5241.
               dhr(p_rn17ooh) = 5241.
               dhr(p_rn9ooh) = 5241.
               dhr(p_rn12ooh) = 5241.
               dhr(p_rn15ooh) = 5241.
               dhr(p_rn18ooh) = 5241.
               dhr(p_nrn6ooh) = 5241.
               dhr(p_nrn9ooh) = 5241.
               dhr(p_nrn12ooh) = 5241.
               dhr(p_ru14ooh) = 5241.
               dhr(p_ru12ooh) = 5241.
               dhr(p_ru10ooh) = 5241.
               dhr(p_nru14ooh) = 5241.
               dhr(p_nru12ooh) = 5241.
               dhr(p_ra13ooh) = 5241.
               dhr(p_ra16ooh) = 5241.
               dhr(p_ra19ooh) = 5241.
               dhr(p_rtn28ooh) = 5241.
               dhr(p_rtn26ooh) = 5241.
               dhr(p_nrtn28ooh) = 5241.
               dhr(p_rtn25ooh) = 5241.
               dhr(p_rtn24ooh) = 5241.
               dhr(p_rtn23ooh) = 5241.
               dhr(p_rtn14ooh) = 5241.
               dhr(p_rtn10ooh) = 5241.
               dhr(p_rcooh25) = 5241.
               dhr(p_rtx28ooh) = 5241.
               dhr(p_rtx24ooh) = 5241.
               dhr(p_rtx22ooh) = 5241.
               dhr(p_nrtx28ooh) = 5241.
               dhr(p_ra22ooh) = 5241.
               dhr(p_ra25ooh) = 5241.
               dhr(p_ch3no3) = 6000.
               dhr(p_c2h5no3) = 6000.
               dhr(p_hoc2h4no3) = 6000.
               dhr(p_rn10no3) = 6000.
               dhr(p_rn13no3) = 6000.
               dhr(p_rn19no3) = 6000.
               dhr(p_rn9no3) = 6000.
               dhr(p_rn12no3) = 6000.
               dhr(p_rn15no3) = 6000.
               dhr(p_rn18no3) = 6000.
               dhr(p_rn16no3) = 6000.
               dhr(p_ru14no3) = 6000.
               dhr(p_ra13no3) = 6000.
               dhr(p_ra16no3) = 6000.
               dhr(p_ra19no3) = 6000.
               dhr(p_rtn28no3) = 6000.
               dhr(p_rtn25no3) = 6000.
               dhr(p_rtx28no3) = 6000.
               dhr(p_rtx24no3) = 6000.
               dhr(p_rtx22no3) = 6000.
               dhr(p_rtn23no3) = 6000.
               dhr(p_ra22no3) = 6000.
               dhr(p_ra25no3) = 6000.
               dhr(p_ic3h7no3) = 6000.
            dhr(p_ch3cho) = 6266.
            dhr(p_c2h5cho) = 6266.
            dhr(p_hoch2cho) = 6266.
               dhr(p_carb14) = 6266.
               dhr(p_carb17) = 6266.
               dhr(p_carb7) = 6266.
               dhr(p_carb10) = 6266.
               dhr(p_carb13) = 6266.
               dhr(p_carb16) = 6266.
               dhr(p_carb3) = 6266.
               dhr(p_carb6) = 6266.
               dhr(p_carb9) = 6266.
               dhr(p_carb12) = 6266.
               dhr(p_carb15) = 6266.
               dhr(p_ccarb12) = 6266.
               dhr(p_ucarb12) = 6266.
               dhr(p_ucarb10) = 6266.
               dhr(p_nucarb12) = 6266.
               dhr(p_udcarb8) = 6266.
               dhr(p_udcarb11) = 6266.
               dhr(p_udcarb14) = 6266.
               dhr(p_tncarb26) = 6266.
               dhr(p_tncarb10) = 6266.
               dhr(p_tncarb15) = 6266.
               dhr(p_txcarb24) = 6266.
               dhr(p_txcarb22) = 6266.
               dhr(p_carb11a) = 6266.
               dhr(p_tncarb12) = 6266.
               dhr(p_tncarb11) = 6266.
               dhr(p_udcarb17) = 6266.
        else
           dhr(p_o3) = 2300.
           dhr(p_h2o2) = 6615.
           dhr(p_hcho) = 7190.
           dhr(p_pan) = 5760.
           dhr(p_onit) = 5487.
           dhr(p_paa) = 6170.
        end if
        dhr(p_no2) = 2500.
        dhr(p_no) = 1480.
        dhr(p_aco3) = 6266.
        dhr(p_tpan) = 5760.
        dhr(p_hono) = 3775.
        dhr(p_no3) = 0.
        dhr(p_hno4) = 0.
        dhr(p_co) = 0.
        dhr(p_ald) = 6266.
        dhr(p_op1) = 5607.
        dhr(p_op2) = 10240.
        dhr(p_ket) = 5773.
        dhr(p_gly) = 0.
        dhr(p_mgly) = 7541.
        dhr(p_dcb) = 0.
        dhr(p_so2) = 5816.
        dhr(p_eth) = 0.
        dhr(p_hc3) = 0.
        dhr(p_hc5) = 0.
        dhr(p_hc8) = 0.
        dhr(p_olt) = 0.
        dhr(p_oli) = 0.
        dhr(p_tol) = 0.
        dhr(p_csl) = 0.
        dhr(p_xyl) = 0.
        dhr(p_iso) = 0.
        dhr(p_hno3) = 8684.
        dhr(p_ora1) = 5716.
        dhr(p_ora2) = 8374.
        dhr(p_nh3) = 3660.
        dhr(p_n2o5) = 0.
        if(p_ol2 > 1) dhr(p_ol2) = 0.
        if(p_par > 1) dhr(p_par) = 0.
        if( config_flags%chem_opt == MOZART_KPP .or. &
            config_flags%chem_opt == MOZCART_KPP .or. &
            config_flags%chem_opt == MOZART_MOSAIC_4BIN_VBS0_KPP ) then
           f0(p_hcho) = small_value
           f0(p_ch3ooh) = .1
           f0(p_ch3oh) = small_value
           f0(p_ch3cooh) = small_value
           f0(p_acet) = small_value
           f0(p_c3h6ooh) = .1
           f0(p_mpan) = 1.
           f0(p_c2h5oh) = small_value
           f0(p_etooh) = .1
           f0(p_prooh) = .1
           f0(p_acetp) = .1
           f0(p_onit) = .1
           f0(p_onitr) = .1
           f0(p_acetol) = small_value
           f0(p_glyald) = small_value
           f0(p_hydrald) = small_value
           f0(p_alkooh) = .1
           f0(p_mekooh) = .1
           f0(p_tolooh) = .1
           f0(p_terpooh) = .1
      else if( config_flags%chem_opt == crimech_kpp .or. &
          config_flags%chem_opt == cri_mosaic_8bin_aq_kpp .or. &
          config_flags%chem_opt == cri_mosaic_4bin_aq_kpp ) then
           f0(p_hcho) = small_value
           f0(p_ch3ooh) = .1
           f0(p_ch3oh) = small_value
           f0(p_ch3cooh) = small_value
           f0(p_ket) = small_value
           f0(p_mpan) = .1
           f0(p_ru12pan) = .1
           f0(p_rtn26pan) = .1
           f0(p_phan) = .1
           f0(p_ppn) = .1
           f0(p_c2h5oh) = small_value
           f0(p_c2h5ooh) = .1
               f0(p_hcooh) = .1
               f0(p_prooh) = .1
               f0(p_hoc2h4ooh) = .1
               f0(p_rn10ooh) = .1
               f0(p_rn13ooh) = .1
               f0(p_rn16ooh) = .1
               f0(p_rn19ooh) = .1
               f0(p_rn8ooh) = .1
               f0(p_rn11ooh) = .1
               f0(p_rn14ooh) = .1
               f0(p_rn17ooh) = .1
               f0(p_rn9ooh) = .1
               f0(p_rn12ooh) = .1
               f0(p_rn15ooh) = .1
               f0(p_rn18ooh) = .1
               f0(p_nrn6ooh) = .1
               f0(p_nrn9ooh) = .1
               f0(p_nrn12ooh) = .1
               f0(p_ru14ooh) = .1
               f0(p_ru12ooh) = .1
               f0(p_ru10ooh) = .1
               f0(p_nru14ooh) = .1
               f0(p_nru12ooh) = .1
               f0(p_ra13ooh) = .1
               f0(p_ra16ooh) = .1
               f0(p_ra19ooh) = .1
               f0(p_rtn28ooh) = .1
               f0(p_rtn26ooh) = .1
               f0(p_nrtn28ooh) = .1
               f0(p_rtn25ooh) = .1
               f0(p_rtn24ooh) = .1
               f0(p_rtn23ooh) = .1
               f0(p_rtn14ooh) = .1
               f0(p_rtn10ooh) = .1
               f0(p_rcooh25) = .1
               f0(p_rtx28ooh) = .1
               f0(p_rtx24ooh) = .1
               f0(p_rtx22ooh) = .1
               f0(p_nrtx28ooh) = .1
               f0(p_ra22ooh) = .1
               f0(p_ra25ooh) = .1
               f0(p_ch3no3) = .1
               f0(p_c2h5no3) = .1
               f0(p_hoc2h4no3) = .1
               f0(p_rn10no3) = .1
               f0(p_rn13no3) = .1
               f0(p_rn19no3) = .1
               f0(p_rn9no3) = .1
               f0(p_rn12no3) = .1
               f0(p_rn15no3) = .1
               f0(p_rn18no3) = .1
               f0(p_rn16no3) = .1
               f0(p_ru14no3) = .1
               f0(p_ra13no3) = .1
               f0(p_ra16no3) = .1
               f0(p_ra19no3) = .1
               f0(p_rtn28no3) = .1
               f0(p_rtn25no3) = .1
               f0(p_rtx28no3) = .1
               f0(p_rtx24no3) = .1
               f0(p_rtx22no3) = .1
               f0(p_rtn23no3) = .1
               f0(p_ra22no3) = .1
               f0(p_ra25no3) = .1
               f0(p_ic3h7no3) = .1
               f0(p_ch3cho) = 0.
               f0(p_c2h5cho) = 0.
               f0(p_hoch2cho) = 0.
               f0(p_carb14) = 0.
               f0(p_carb17) = 0.
               f0(p_carb7) = 0.
               f0(p_carb10) = 0.
               f0(p_carb13) = 0.
               f0(p_carb16) = 0.
               f0(p_carb3) = 0.
               f0(p_carb6) = 0.
               f0(p_carb9) = 0.
               f0(p_carb12) = 0.
               f0(p_carb15) = 0.
               f0(p_ccarb12) = 0.
               f0(p_ucarb12) = 0.
               f0(p_ucarb10) = 0.
               f0(p_nucarb12) = 0.
               f0(p_udcarb8) = 0.
               f0(p_udcarb11) = 0.
               f0(p_udcarb14) = 0.
               f0(p_tncarb26) = 0.
               f0(p_tncarb10) = 0.
               f0(p_tncarb15) = 0.
               f0(p_txcarb24) = 0.
               f0(p_txcarb22) = 0.
               f0(p_carb11a) = 0.
               f0(p_tncarb12) = 0.
               f0(p_tncarb11) = 0.
               f0(p_udcarb17) = 0.
        else
           f0(p_hcho) = 0.
           f0(p_onit) = 0.
        end if
        f0(p_no2) = 0.1
        f0(p_no) = 0.
        f0(p_pan) = 0.1
        f0(p_o3) = 1.
        f0(p_aco3) = 1.
        f0(p_tpan) = 0.1
        f0(p_hono) = 0.1
        f0(p_no3) = 1.
        f0(p_hno4) = 0.1
        f0(p_h2o2) = 1.
        f0(p_co) = 0.
        f0(p_ald) = 0.
        f0(p_op1) = 0.1
        f0(p_op2) = 0.1
        f0(p_paa) = 0.1
        f0(p_ket) = 0.
        f0(p_gly) = 0.
        f0(p_mgly) = 0.
        f0(p_dcb) = 0.
        f0(p_so2) = 0.
        f0(p_eth) = 0.
        f0(p_hc3) = 0.
        f0(p_hc5) = 0.
        f0(p_hc8) = 0.
        f0(p_olt) = 0.
        f0(p_oli) = 0.
        f0(p_tol) = 0.
        f0(p_csl) = 0.
        f0(p_xyl) = 0.
        f0(p_iso) = 0.
        f0(p_hno3) = 0.
        f0(p_ora1) = 0.
        f0(p_ora2) = 0.
        f0(p_nh3) = 0.
        f0(p_n2o5) = 1.
        if(p_ol2 > 1) f0(p_ol2) = 0.
        if(p_par > 1) f0(p_par) = 0.
        if( config_flags%chem_opt == MOZART_KPP .or. &
            config_flags%chem_opt == MOZCART_KPP .or. &
            config_flags%chem_opt == MOZART_MOSAIC_4BIN_VBS0_KPP ) then
           dvj(p_o3) = 0.144
           dvj(p_h2o2) = 0.1715
           dvj(p_hcho) = 0.1825
           dvj(p_ch3ooh) = 0.144
           dvj(p_ch3oh) = 0.1767
           dvj(p_ch3cooh) = 0.129
           dvj(p_acet) = 0.1312
           dvj(p_paa) = 0.1147
           dvj(p_c3h6ooh) = 0.1042
           dvj(p_mpan) = 0.0825
           dvj(p_c2h5oh) = 0.1473
           dvj(p_etooh) = 0.127
           dvj(p_prooh) = 0.1146
           dvj(p_acetp) = 0.1054
           dvj(p_onit) = 0.0916
           dvj(p_onitr) = 0.0824
           dvj(p_acetol) = 0.116
           dvj(p_glyald) = 0.129
           dvj(p_hydrald) = 0.0999
           dvj(p_alkooh) = 0.098
           dvj(p_mekooh) = 0.098
           dvj(p_tolooh) = 0.084
           dvj(p_terpooh) = 0.073
     else if( config_flags%chem_opt == crimech_kpp .or. &
          config_flags%chem_opt == cri_mosaic_8bin_aq_kpp .or. &
          config_flags%chem_opt == cri_mosaic_4bin_aq_kpp ) then
           dvj(p_o3) = 0.144
           dvj(p_h2o2) = 0.1715
           dvj(p_hcho) = 0.1825
           dvj(p_ch3ooh) = 0.144
           dvj(p_ch3oh) = 0.1767
           dvj(p_ch3cooh) = 0.129
           dvj(p_ket) = 0.1312
           dvj(p_paa) = 0.1147
            dvj(p_c2h5co3h) = 0.1147
            dvj(p_hoch2co3h) = 0.1147
           dvj(p_mpan) = 0.0825
            dvj(p_ru12pan) = 0.0825
            dvj(p_rtn26pan) = 0.0825
            dvj(p_phan) = 0.0825
            dvj(p_ppn) = 0.0825
           dvj(p_c2h5oh) = 0.1473
           dvj(p_c2h5ooh) = 0.091627
               dvj(p_hcooh) = 0.098
               dvj(p_prooh) = 0.098
               dvj(p_hoc2h4ooh) = 0.098
               dvj(p_rn10ooh) = 0.098
               dvj(p_rn13ooh) = 0.098
               dvj(p_rn16ooh) = 0.098
               dvj(p_rn19ooh) = 0.098
               dvj(p_rn8ooh) = 0.098
               dvj(p_rn11ooh) = 0.098
               dvj(p_rn14ooh) = 0.098
               dvj(p_rn17ooh) = 0.098
               dvj(p_rn9ooh) = 0.098
               dvj(p_rn12ooh) = 0.098
               dvj(p_rn15ooh) = 0.098
               dvj(p_rn18ooh) = 0.098
               dvj(p_nrn6ooh) = 0.098
               dvj(p_nrn9ooh) = 0.098
               dvj(p_nrn12ooh) = 0.098
               dvj(p_ru14ooh) = 0.098
               dvj(p_ru12ooh) = 0.098
               dvj(p_ru10ooh) = 0.098
               dvj(p_nru14ooh) = 0.098
               dvj(p_nru12ooh) = 0.098
               dvj(p_ra13ooh) = 0.084
               dvj(p_ra16ooh) = 0.084
               dvj(p_ra19ooh) = 0.084
               dvj(p_rtn28ooh) = 0.073
               dvj(p_rtn26ooh) = 0.073
               dvj(p_nrtn28ooh) = 0.073
               dvj(p_rtn25ooh) = 0.073
               dvj(p_rtn24ooh) = 0.073
               dvj(p_rtn23ooh) = 0.073
               dvj(p_rtn14ooh) = 0.073
               dvj(p_rtn10ooh) = 0.073
               dvj(p_rcooh25) = 0.073
               dvj(p_rtx28ooh) = 0.073
               dvj(p_rtx24ooh) = 0.073
               dvj(p_rtx22ooh) = 0.073
               dvj(p_nrtx28ooh) = 0.073
               dvj(p_ra22ooh) = 0.084
               dvj(p_ra25ooh) = 0.084
               dvj(p_ch3no3) = 0.0916
               dvj(p_c2h5no3) = 0.0916
               dvj(p_hoc2h4no3) = 0.0916
               dvj(p_rn10no3) = 0.0916
               dvj(p_rn13no3) = 0.0916
               dvj(p_rn19no3) = 0.0916
               dvj(p_rn9no3) = 0.0916
               dvj(p_rn12no3) = 0.0916
               dvj(p_rn15no3) = 0.0916
               dvj(p_rn18no3) = 0.0916
               dvj(p_rn16no3) = 0.0916
               dvj(p_ru14no3) = 0.0916
               dvj(p_ra13no3) = 0.0916
               dvj(p_ra16no3) = 0.0916
               dvj(p_ra19no3) = 0.0916
               dvj(p_rtn28no3) = 0.0916
               dvj(p_rtn25no3) = 0.0916
               dvj(p_rtx28no3) = 0.0916
               dvj(p_rtx24no3) = 0.0916
               dvj(p_rtx22no3) = 0.0916
               dvj(p_rtn23no3) = 0.0916
               dvj(p_ra22no3) = 0.0916
               dvj(p_ra25no3) = 0.0916
               dvj(p_ic3h7no3) = 0.0916
               dvj(p_ch3cho) = 0.151
               dvj(p_c2h5cho) = 0.151
               dvj(p_hoch2cho) = 0.151
               dvj(p_carb14) = 0.151
               dvj(p_carb17) = 0.151
               dvj(p_carb7) = 0.151
               dvj(p_carb10) = 0.151
               dvj(p_carb13) = 0.151
               dvj(p_carb16) = 0.151
               dvj(p_carb3) = 0.151
               dvj(p_carb6) = 0.151
               dvj(p_carb9) = 0.151
               dvj(p_carb12) = 0.151
               dvj(p_carb15) = 0.151
               dvj(p_ccarb12) = 0.151
               dvj(p_ucarb12) = 0.151
               dvj(p_ucarb10) = 0.151
               dvj(p_nucarb12) = 0.151
               dvj(p_udcarb8) = 0.151
               dvj(p_udcarb11) = 0.151
               dvj(p_udcarb14) = 0.151
               dvj(p_tncarb26) = 0.151
               dvj(p_tncarb10) = 0.151
               dvj(p_tncarb15) = 0.151
               dvj(p_txcarb24) = 0.151
               dvj(p_txcarb22) = 0.151
               dvj(p_carb11a) = 0.151
               dvj(p_tncarb12) = 0.151
               dvj(p_tncarb11) = 0.151
               dvj(p_udcarb17) = 0.151
        else
           dvj(p_o3) = 0.175
           dvj(p_h2o2) = 0.171
           dvj(p_hcho) = 0.183
           dvj(p_paa) = 0.115
           dvj(p_onit) = 0.092
        end if
        dvj(p_no2) = 0.147
        dvj(p_no) = 0.183
        dvj(p_pan) = 0.091
        dvj(p_aco3) = 0.115
        dvj(p_tpan) = 0.082
        dvj(p_hono) = 0.153
        dvj(p_no3) = 0.127
        dvj(p_hno4) = 0.113
        dvj(p_co) = 0.189
        dvj(p_ald) = 0.151
        dvj(p_op1) = 0.144
        dvj(p_op2) = 0.127
        dvj(p_ket) = 0.118
        dvj(p_gly) = 0.131
        dvj(p_mgly) = 0.118
        dvj(p_dcb) = 0.107
        dvj(p_so2) = 0.126
        dvj(p_eth) = 0.183
        dvj(p_hc3) = 0.151
        dvj(p_hc5) = 0.118
        dvj(p_hc8) = 0.094
        dvj(p_olt) = 0.154
        dvj(p_oli) = 0.121
        dvj(p_tol) = 0.104
        dvj(p_csl) = 0.096
        dvj(p_xyl) = 0.097
        dvj(p_iso) = 0.121
        dvj(p_hno3) = 0.126
        dvj(p_ora1) = 0.153
        dvj(p_ora2) = 0.124
        dvj(p_nh3) = 0.227
        dvj(p_n2o5) = 0.110
        dvj(p_ho) = 0.243
        dvj(p_ho2) = 0.174
        if(p_ol2 > 1) dvj(p_ol2) = 0.189
        if(p_par > 1) dvj(p_par) = 0.118
        if(p_methacro.gt.1)then
          hstar(p_h2so4) = 2.600E+06
          hstar(p_ccho) = 1.700E+01
          hstar(p_rcho) = 4.200E+03
          hstar(p_etoh) = 2.200E+02
          hstar(p_cco_oh) = 4.100E+03
          hstar(p_rco_oh) = 4.100E+03
          hstar(p_bacl) = 2.700E+01
          hstar(p_bald) = 4.200E+01
          hstar(p_isoprod) = 1.300E-02
          hstar(p_methacro) = 6.500E+00
          hstar(p_prod2) = 2.000E+01
          hstar(p_dcb1) = 4.200E+03
          hstar(p_dcb2) = 4.200E+03
          hstar(p_dcb3) = 4.200E+03
          hstar(p_ethene) = 4.700E-03
          hstar(p_isoprene) = 1.300E-02
          hstar(p_c2h2) = 1.000E-03
          hstar(p_alk3) = 1.200E-03
          hstar(p_alk4) = 1.200E-03
          hstar(p_alk5) = 1.200E-03
          hstar(p_aro1) = 2.100E-01
          hstar(p_aro2) = 2.100E-01
          hstar(p_ole1) = 1.300E-02
          hstar(p_ole2) = 1.300E-02
          hstar(p_terp) = 1.200E-03
          hstar(p_sesq) = 1.200E-03
          hstar(p_rno3) = 2.000E+00
          hstar(p_nphe) = 2.100E-01
          hstar(p_phen) = 1.900E+03
          hstar(p_pan2) = 2.900E+00
          hstar(p_pbzn) = 2.900E+00
          hstar(p_ma_pan) = 2.900E+00
          hstar(p_cco_ooh) = 3.100E+02
          hstar(p_rco_o2) = 4.100E+03
          hstar(p_rco_ooh) = 3.100E+02
          hstar(p_xn) = 1.000E+00
          hstar(p_xc) = 1.000E+00
          hstar(p_c_o2) = 4.000E+03
          hstar(p_cooh) = 3.100E+02
          hstar(p_rooh) = 3.400E+02
          hstar(p_ro2_r) = 4.000E+03
          hstar(p_r2o2) = 4.000E+03
          hstar(p_ro2_n) = 4.000E+03
          hstar(p_cco_o2) = 1.700E+01
          hstar(p_bzco_o2) = 2.100E-01
          hstar(p_ma_rco3) = 6.500E+00
          dhr(p_h2so4) = 0.000E+00
          dhr(p_ccho) = 5.000E+03
          dhr(p_rcho) = 0.000E+00
          dhr(p_etoh) = 5.200E+03
          dhr(p_cco_oh) = 6.300E+03
          dhr(p_rco_oh) = 6.300E+03
          dhr(p_bacl) = 0.000E+00
          dhr(p_bald) = 4.600E+03
          dhr(p_isoprod) = 0.000E+00
          dhr(p_methacro) = 0.000E+00
          dhr(p_prod2) = 5.000E+03
          dhr(p_dcb1) = 0.000E+00
          dhr(p_dcb2) = 0.000E+00
          dhr(p_dcb3) = 0.000E+00
          dhr(p_ethene) = 1.800E+03
          dhr(p_isoprene) = 0.000E+00
          dhr(p_c2h2) = 0.000E+00
          dhr(p_alk3) = 3.100E+03
          dhr(p_alk4) = 3.100E+03
          dhr(p_alk5) = 3.100E+03
          dhr(p_aro1) = 3.600E+03
          dhr(p_aro2) = 3.600E+03
          dhr(p_ole1) = 6.400E+03
          dhr(p_ole2) = 6.400E+03
          dhr(p_terp) = 3.100E+03
          dhr(p_sesq) = 3.100E+03
          dhr(p_rno3) = 2.000E+03
          dhr(p_nphe) = 3.600E+03
          dhr(p_phen) = 7.300E+03
          dhr(p_pan2) = 0.000E+00
          dhr(p_pbzn) = 5.900E+03
          dhr(p_ma_pan) = 0.000E+00
          dhr(p_cco_ooh) = 5.200E+03
          dhr(p_rco_o2) = 6.300E+03
          dhr(p_rco_ooh) = 5.200E+03
          dhr(p_xn) = 1.000E+00
          dhr(p_xc) = 1.000E+00
          dhr(p_c_o2) = 5.900E+03
          dhr(p_cooh) = 5.200E+03
          dhr(p_rooh) = 6.000E+03
          dhr(p_ro2_r) = 5.900E+03
          dhr(p_r2o2) = 5.900E+03
          dhr(p_ro2_n) = 5.900E+03
          dhr(p_cco_o2) = 5.000E+03
          dhr(p_bzco_o2) = 3.600E+03
          dhr(p_ma_rco3) = 0.000E+00
          f0(p_h2so4) = 0.000E+00
          f0(p_ccho) = 0.000E+00
          f0(p_rcho) = 0.000E+00
          f0(p_etoh) = 0.000E+00
          f0(p_cco_oh) = 0.000E+00
          f0(p_rco_oh) = 0.000E+00
          f0(p_bacl) = 0.000E+00
          f0(p_bald) = 0.000E+00
          f0(p_isoprod) = 0.000E+00
          f0(p_methacro) = 0.000E+00
          f0(p_prod2) = 0.000E+00
          f0(p_dcb1) = 0.000E+00
          f0(p_dcb2) = 0.000E+00
          f0(p_dcb3) = 0.000E+00
          f0(p_ethene) = 0.000E+00
          f0(p_isoprene) = 0.000E+00
          f0(p_c2h2) = 0.000E+00
          f0(p_alk3) = 0.000E+00
          f0(p_alk4) = 0.000E+00
          f0(p_alk5) = 0.000E+00
          f0(p_aro1) = 0.000E+00
          f0(p_aro2) = 0.000E+00
          f0(p_ole1) = 0.000E+00
          f0(p_ole2) = 0.000E+00
          f0(p_terp) = 0.000E+00
          f0(p_sesq) = 0.000E+00
          f0(p_rno3) = 0.000E+00
          f0(p_nphe) = 0.000E+00
          f0(p_phen) = 0.000E+00
          f0(p_pan2) = 0.000E+00
          f0(p_pbzn) = 0.000E+00
          f0(p_ma_pan) = 0.000E+00
          f0(p_cco_ooh) = 0.000E+00
          f0(p_rco_o2) = 0.000E+00
          f0(p_rco_ooh) = 0.000E+00
          f0(p_xn) = 0.000E+00
          f0(p_xc) = 0.000E+00
          f0(p_c_o2) = 0.000E+00
          f0(p_cooh) = 0.000E+00
          f0(p_rooh) = 0.000E+00
          f0(p_ro2_r) = 0.000E+00
          f0(p_r2o2) = 0.000E+00
          f0(p_ro2_n) = 0.000E+00
          f0(p_cco_o2) = 0.000E+00
          f0(p_bzco_o2) = 0.000E+00
          f0(p_ma_rco3) = 0.000E+00
          dvj(p_h2so4) = 1.200E-01
          dvj(p_ccho) = 1.420E-01
          dvj(p_rcho) = 1.420E-01
          dvj(p_etoh) = 1.280E-01
          dvj(p_cco_oh) = 1.000E-01
          dvj(p_rco_oh) = 1.000E-01
          dvj(p_bacl) = 1.000E-01
          dvj(p_bald) = 1.420E-01
          dvj(p_isoprod) = 1.000E-01
          dvj(p_methacro) = 1.420E-01
          dvj(p_prod2) = 9.800E-02
          dvj(p_dcb1) = 1.420E-01
          dvj(p_dcb2) = 1.420E-01
          dvj(p_dcb3) = 1.420E-01
          dvj(p_ethene) = 1.780E-01
          dvj(p_isoprene) = 1.000E-01
          dvj(p_c2h2) = 1.000E-01
          dvj(p_alk3) = 2.000E-01
          dvj(p_alk4) = 2.000E-01
          dvj(p_alk5) = 2.000E-01
          dvj(p_aro1) = 9.800E-02
          dvj(p_aro2) = 9.800E-02
          dvj(p_ole1) = 1.780E-01
          dvj(p_ole2) = 1.780E-01
          dvj(p_terp) = 1.000E-01
          dvj(p_sesq) = 1.000E-01
          dvj(p_rno3) = 1.390E-01
          dvj(p_nphe) = 1.000E-01
          dvj(p_phen) = 1.000E-01
          dvj(p_pan2) = 3.600E-02
          dvj(p_pbzn) = 3.600E-02
          dvj(p_ma_pan) = 3.600E-02
          dvj(p_cco_ooh) = 1.500E-01
          dvj(p_rco_o2) = 1.000E-01
          dvj(p_rco_ooh) = 1.500E-01
          dvj(p_xn) = 1.000E-01
          dvj(p_xc) = 1.000E-01
          dvj(p_c_o2) = 1.760E-01
          dvj(p_cooh) = 1.500E-01
          dvj(p_rooh) = 1.500E-01
          dvj(p_ro2_r) = 1.000E-01
          dvj(p_r2o2) = 1.760E-01
          dvj(p_ro2_n) = 1.000E-01
          dvj(p_cco_o2) = 1.000E-01
          dvj(p_bzco_o2) = 1.000E-01
          dvj(p_ma_rco3) = 1.420E-01
          endif
     if (config_flags%chem_opt == SAPRC99_MOSAIC_8BIN_VBS2_AQ_KPP) then
   hstar(p_acet) = 27.
     dhr(p_acet) = 5300.
    f0(p_acet) = small_value
     dvj(p_acet) = 0.1312
    hstar(p_hcooh) = 311.
   dhr(p_hcooh) = 5241.
   f0(p_hcooh) = .1
    dvj(p_hcooh) = 0.098
    hstar(p_meoh) = 220.
   dhr(p_meoh) = 4934.
    f0(p_meoh) = small_value
  dvj(p_meoh) = 0.1767
  hstar(p_cres) = 4.00E+5
   dhr(p_cres) = 0.
   f0(p_cres) = 0.
  dvj(p_cres) = 0.096
     end if
     if(p_pcg1_b_c.gt.1) hstar(p_pcg1_b_c) =2.7E+3
     if(p_pcg2_b_c.gt.1) hstar(p_pcg2_b_c) =2.7E+3
     if(p_pcg3_b_c.gt.1) hstar(p_pcg3_b_c)=2.7E+3
     if(p_pcg4_b_c.gt.1) hstar(p_pcg4_b_c)=2.7E+3
     if(p_pcg5_b_c.gt.1) hstar(p_pcg5_b_c)=2.7E+3
     if(p_pcg6_b_c.gt.1) hstar(p_pcg6_b_c)=2.7E+3
     if(p_pcg7_b_c.gt.1) hstar(p_pcg7_b_c)=2.7E+3
     if(p_pcg8_b_c.gt.1) hstar(p_pcg8_b_c)=2.7E+3
     if(p_pcg9_b_c.gt.1) hstar(p_pcg9_b_c)=2.7E+3
     if(p_opcg1_b_c.gt.1) hstar(p_opcg1_b_c) =2.7E+3
     if(p_opcg2_b_c.gt.1) hstar(p_opcg2_b_c) =2.7E+3
     if(p_opcg3_b_c.gt.1) hstar(p_opcg3_b_c)=2.7E+3
     if(p_opcg4_b_c.gt.1) hstar(p_opcg4_b_c)=2.7E+3
     if(p_opcg5_b_c.gt.1) hstar(p_opcg5_b_c)=2.7E+3
     if(p_opcg6_b_c.gt.1) hstar(p_opcg6_b_c)=2.7E+3
     if(p_opcg7_b_c.gt.1) hstar(p_opcg7_b_c)=2.7E+3
     if(p_opcg8_b_c.gt.1) hstar(p_opcg8_b_c)=2.7E+3
     if(p_pcg1_b_o.gt.1) hstar(p_pcg1_b_o) =2.7E+3
     if(p_pcg2_b_o.gt.1) hstar(p_pcg2_b_o) =2.7E+3
     if(p_pcg3_b_o.gt.1) hstar(p_pcg3_b_o)=2.7E+3
     if(p_pcg4_b_o.gt.1) hstar(p_pcg4_b_o)=2.7E+3
     if(p_pcg5_b_o.gt.1) hstar(p_pcg5_b_o)=2.7E+3
     if(p_pcg6_b_o.gt.1) hstar(p_pcg6_b_o)=2.7E+3
     if(p_pcg7_b_o.gt.1) hstar(p_pcg7_b_o)=2.7E+3
     if(p_pcg8_b_o.gt.1) hstar(p_pcg8_b_o)=2.7E+3
     if(p_pcg9_b_o.gt.1) hstar(p_pcg9_b_o)=2.7E+3
     if(p_opcg1_b_o.gt.1) hstar(p_opcg1_b_o) =2.7E+3
     if(p_opcg2_b_o.gt.1) hstar(p_opcg2_b_o) =2.7E+3
     if(p_opcg3_b_o.gt.1) hstar(p_opcg3_b_o)=2.7E+3
     if(p_opcg4_b_o.gt.1) hstar(p_opcg4_b_o)=2.7E+3
     if(p_opcg5_b_o.gt.1) hstar(p_opcg5_b_o)=2.7E+3
     if(p_opcg6_b_o.gt.1) hstar(p_opcg6_b_o)=2.7E+3
     if(p_opcg7_b_o.gt.1) hstar(p_opcg7_b_o)=2.7E+3
     if(p_opcg8_b_o.gt.1) hstar(p_opcg8_b_o)=2.7E+3
     if(p_pcg1_f_c.gt.1) hstar(p_pcg1_f_c) =2.7E+3
     if(p_pcg2_f_c.gt.1) hstar(p_pcg2_f_c) =2.7E+3
     if(p_pcg3_f_c.gt.1) hstar(p_pcg3_f_c)=2.7E+3
     if(p_pcg4_f_c.gt.1) hstar(p_pcg4_f_c)=2.7E+3
     if(p_pcg5_f_c.gt.1) hstar(p_pcg5_f_c)=2.7E+3
     if(p_pcg6_f_c.gt.1) hstar(p_pcg6_f_c)=2.7E+3
     if(p_pcg7_f_c.gt.1) hstar(p_pcg7_f_c)=2.7E+3
     if(p_pcg8_f_c.gt.1) hstar(p_pcg8_f_c)=2.7E+3
     if(p_pcg9_f_c.gt.1) hstar(p_pcg9_f_c)=2.7E+3
     if(p_opcg1_f_c.gt.1) hstar(p_opcg1_f_c) =2.7E+3
     if(p_opcg2_f_c.gt.1) hstar(p_opcg2_f_c) =2.7E+3
     if(p_opcg3_f_c.gt.1) hstar(p_opcg3_f_c)=2.7E+3
     if(p_opcg4_f_c.gt.1) hstar(p_opcg4_f_c)=2.7E+3
     if(p_opcg5_f_c.gt.1) hstar(p_opcg5_f_c)=2.7E+3
     if(p_opcg6_f_c.gt.1) hstar(p_opcg6_f_c)=2.7E+3
     if(p_opcg7_f_c.gt.1) hstar(p_opcg7_f_c)=2.7E+3
     if(p_opcg8_f_c.gt.1) hstar(p_opcg8_f_c)=2.7E+3
     if(p_pcg1_f_o.gt.1) hstar(p_pcg1_f_o) =2.7E+3
     if(p_pcg2_f_o.gt.1) hstar(p_pcg2_f_o) =2.7E+3
     if(p_pcg3_f_o.gt.1) hstar(p_pcg3_f_o)=2.7E+3
     if(p_pcg4_f_o.gt.1) hstar(p_pcg4_f_o)=2.7E+3
     if(p_pcg5_f_o.gt.1) hstar(p_pcg5_f_o)=2.7E+3
     if(p_pcg6_f_o.gt.1) hstar(p_pcg6_f_o)=2.7E+3
     if(p_pcg7_f_o.gt.1) hstar(p_pcg7_f_o)=2.7E+3
     if(p_pcg8_f_o.gt.1) hstar(p_pcg8_f_o)=2.7E+3
     if(p_pcg9_f_o.gt.1) hstar(p_pcg9_f_o)=2.7E+3
     if(p_opcg1_f_o.gt.1) hstar(p_opcg1_f_o) =2.7E+3
     if(p_opcg2_f_o.gt.1) hstar(p_opcg2_f_o) =2.7E+3
     if(p_opcg3_f_o.gt.1) hstar(p_opcg3_f_o)=2.7E+3
     if(p_opcg4_f_o.gt.1) hstar(p_opcg4_f_o)=2.7E+3
     if(p_opcg5_f_o.gt.1) hstar(p_opcg5_f_o)=2.7E+3
     if(p_opcg6_f_o.gt.1) hstar(p_opcg6_f_o)=2.7E+3
     if(p_opcg7_f_o.gt.1) hstar(p_opcg7_f_o)=2.7E+3
     if(p_opcg8_f_o.gt.1) hstar(p_opcg8_f_o)=2.7E+3
     if(p_ant1_c.gt.1) hstar(p_ant1_c)=2.7E+3
     if(p_ant2_c.gt.1) hstar(p_ant2_c)=2.7E+3
     if(p_ant3_c.gt.1) hstar(p_ant3_c)=2.7E+3
     if(p_ant4_c.gt.1) hstar(p_ant4_c)=2.7E+3
     if(p_ant1_o.gt.1) hstar(p_ant1_o)=2.7E+3
     if(p_ant2_o.gt.1) hstar(p_ant2_o)=2.7E+3
     if(p_ant3_o.gt.1) hstar(p_ant3_o)=2.7E+3
     if(p_ant4_o.gt.1) hstar(p_ant4_o)=2.7E+3
     if(p_biog1_c.gt.1) hstar(p_biog1_c)=2.7E+3
     if(p_biog2_c.gt.1) hstar(p_biog2_c)=2.7E+3
     if(p_biog3_c.gt.1) hstar(p_biog3_c)=2.7E+3
     if(p_biog4_c.gt.1) hstar(p_biog4_c)=2.7E+3
     if(p_biog1_o.gt.1) hstar(p_biog1_o)=2.7E+3
     if(p_biog2_o.gt.1) hstar(p_biog2_o)=2.7E+3
     if(p_biog3_o.gt.1) hstar(p_biog3_o)=2.7E+3
     if(p_biog4_o.gt.1) hstar(p_biog4_o)=2.7E+3
     if(p_pcg1_b_c.gt.1) dhr(p_pcg1_b_c) =6.4E+3
     if(p_pcg2_b_c.gt.1) dhr(p_pcg2_b_c) =6.4E+3
     if(p_pcg3_b_c.gt.1) dhr(p_pcg3_b_c)=6.4E+3
     if(p_pcg4_b_c.gt.1) dhr(p_pcg4_b_c)=6.4E+3
     if(p_pcg5_b_c.gt.1) dhr(p_pcg5_b_c)=6.4E+3
     if(p_pcg6_b_c.gt.1) dhr(p_pcg6_b_c)=6.4E+3
     if(p_pcg7_b_c.gt.1) dhr(p_pcg7_b_c)=6.4E+3
     if(p_pcg8_b_c.gt.1) dhr(p_pcg8_b_c)=6.4E+3
     if(p_pcg9_b_c.gt.1) dhr(p_pcg9_b_c)=6.4E+3
     if(p_opcg1_b_c.gt.1) dhr(p_opcg1_b_c) =6.4E+3
     if(p_opcg2_b_c.gt.1) dhr(p_opcg2_b_c) =6.4E+3
     if(p_opcg3_b_c.gt.1) dhr(p_opcg3_b_c)=6.4E+3
     if(p_opcg4_b_c.gt.1) dhr(p_opcg4_b_c)=6.4E+3
     if(p_opcg5_b_c.gt.1) dhr(p_opcg5_b_c)=6.4E+3
     if(p_opcg6_b_c.gt.1) dhr(p_opcg6_b_c)=6.4E+3
     if(p_opcg7_b_c.gt.1) dhr(p_opcg7_b_c)=6.4E+3
     if(p_opcg8_b_c.gt.1) dhr(p_opcg8_b_c)=6.4E+3
     if(p_pcg1_b_o.gt.1) dhr(p_pcg1_b_o) =6.4E+3
     if(p_pcg2_b_o.gt.1) dhr(p_pcg2_b_o) =6.4E+3
     if(p_pcg3_b_o.gt.1) dhr(p_pcg3_b_o)=6.4E+3
     if(p_pcg4_b_o.gt.1) dhr(p_pcg4_b_o)=6.4E+3
     if(p_pcg5_b_o.gt.1) dhr(p_pcg5_b_o)=6.4E+3
     if(p_pcg6_b_o.gt.1) dhr(p_pcg6_b_o)=6.4E+3
     if(p_pcg7_b_o.gt.1) dhr(p_pcg7_b_o)=6.4E+3
     if(p_pcg8_b_o.gt.1) dhr(p_pcg8_b_o)=6.4E+3
     if(p_pcg9_b_o.gt.1) dhr(p_pcg9_b_o)=6.4E+3
     if(p_opcg1_b_o.gt.1) dhr(p_opcg1_b_o) =6.4E+3
     if(p_opcg2_b_o.gt.1) dhr(p_opcg2_b_o) =6.4E+3
     if(p_opcg3_b_o.gt.1) dhr(p_opcg3_b_o)=6.4E+3
     if(p_opcg4_b_o.gt.1) dhr(p_opcg4_b_o)=6.4E+3
     if(p_opcg5_b_o.gt.1) dhr(p_opcg5_b_o)=6.4E+3
     if(p_opcg6_b_o.gt.1) dhr(p_opcg6_b_o)=6.4E+3
     if(p_opcg7_b_o.gt.1) dhr(p_opcg7_b_o)=6.4E+3
     if(p_opcg8_b_o.gt.1) dhr(p_opcg8_b_o)=6.4E+3
     if(p_pcg1_f_c.gt.1) dhr(p_pcg1_f_c) =6.4E+3
     if(p_pcg2_f_c.gt.1) dhr(p_pcg2_f_c) =6.4E+3
     if(p_pcg3_f_c.gt.1) dhr(p_pcg3_f_c)=6.4E+3
     if(p_pcg4_f_c.gt.1) dhr(p_pcg4_f_c)=6.4E+3
     if(p_pcg5_f_c.gt.1) dhr(p_pcg5_f_c)=6.4E+3
     if(p_pcg6_f_c.gt.1) dhr(p_pcg6_f_c)=6.4E+3
     if(p_pcg7_f_c.gt.1) dhr(p_pcg7_f_c)=6.4E+3
     if(p_pcg8_f_c.gt.1) dhr(p_pcg8_f_c)=6.4E+3
     if(p_pcg9_f_c.gt.1) dhr(p_pcg9_f_c)=6.4E+3
     if(p_opcg1_f_c.gt.1) dhr(p_opcg1_f_c) =6.4E+3
     if(p_opcg2_f_c.gt.1) dhr(p_opcg2_f_c) =6.4E+3
     if(p_opcg3_f_c.gt.1) dhr(p_opcg3_f_c)=6.4E+3
     if(p_opcg4_f_c.gt.1) dhr(p_opcg4_f_c)=6.4E+3
     if(p_opcg5_f_c.gt.1) dhr(p_opcg5_f_c)=6.4E+3
     if(p_opcg6_f_c.gt.1) dhr(p_opcg6_f_c)=6.4E+3
     if(p_opcg7_f_c.gt.1) dhr(p_opcg7_f_c)=6.4E+3
     if(p_opcg8_f_c.gt.1) dhr(p_opcg8_f_c)=6.4E+3
     if(p_pcg1_f_o.gt.1) dhr(p_pcg1_f_o) =6.4E+3
     if(p_pcg2_f_o.gt.1) dhr(p_pcg2_f_o) =6.4E+3
     if(p_pcg3_f_o.gt.1) dhr(p_pcg3_f_o)=6.4E+3
     if(p_pcg4_f_o.gt.1) dhr(p_pcg4_f_o)=6.4E+3
     if(p_pcg5_f_o.gt.1) dhr(p_pcg5_f_o)=6.4E+3
     if(p_pcg6_f_o.gt.1) dhr(p_pcg6_f_o)=6.4E+3
     if(p_pcg7_f_o.gt.1) dhr(p_pcg7_f_o)=6.4E+3
     if(p_pcg8_f_o.gt.1) dhr(p_pcg8_f_o)=6.4E+3
     if(p_pcg9_f_o.gt.1) dhr(p_pcg9_f_o)=6.4E+3
     if(p_opcg1_f_o.gt.1) dhr(p_opcg1_f_o) =6.4E+3
     if(p_opcg2_f_o.gt.1) dhr(p_opcg2_f_o) =6.4E+3
     if(p_opcg3_f_o.gt.1) dhr(p_opcg3_f_o)=6.4E+3
     if(p_opcg4_f_o.gt.1) dhr(p_opcg4_f_o)=6.4E+3
     if(p_opcg5_f_o.gt.1) dhr(p_opcg5_f_o)=6.4E+3
     if(p_opcg6_f_o.gt.1) dhr(p_opcg6_f_o)=6.4E+3
     if(p_opcg7_f_o.gt.1) dhr(p_opcg7_f_o)=6.4E+3
     if(p_opcg8_f_o.gt.1) dhr(p_opcg8_f_o)=6.4E+3
     if(p_ant1_c.gt.1) dhr(p_ant1_c)=6.4E+3
     if(p_ant2_c.gt.1) dhr(p_ant2_c)=6.4E+3
     if(p_ant3_c.gt.1) dhr(p_ant3_c)=6.4E+3
     if(p_ant4_c.gt.1) dhr(p_ant4_c)=6.4E+3
     if(p_ant1_o.gt.1) dhr(p_ant1_o)=6.4E+3
     if(p_ant2_o.gt.1) dhr(p_ant2_o)=6.4E+3
     if(p_ant3_o.gt.1) dhr(p_ant3_o)=6.4E+3
     if(p_ant4_o.gt.1) dhr(p_ant4_o)=6.4E+3
     if(p_biog1_c.gt.1) dhr(p_biog1_c)=6.4E+3
     if(p_biog2_c.gt.1) dhr(p_biog2_c)=6.4E+3
     if(p_biog3_c.gt.1) dhr(p_biog3_c)=6.4E+3
     if(p_biog4_c.gt.1) dhr(p_biog4_c)=6.4E+3
     if(p_biog1_o.gt.1) dhr(p_biog1_o)=6.4E+3
     if(p_biog2_o.gt.1) dhr(p_biog2_o)=6.4E+3
     if(p_biog3_o.gt.1) dhr(p_biog3_o)=6.4E+3
     if(p_biog4_o.gt.1) dhr(p_biog4_o)=6.4E+3
     if(p_pcg1_b_c.gt.1) f0(p_pcg1_b_c) =0.0000
     if(p_pcg2_b_c.gt.1) f0(p_pcg2_b_c) =0.0000
     if(p_pcg3_b_c.gt.1) f0(p_pcg3_b_c)=0.0000
     if(p_pcg4_b_c.gt.1) f0(p_pcg4_b_c)=0.0000
     if(p_pcg5_b_c.gt.1) f0(p_pcg5_b_c)=0.0000
     if(p_pcg6_b_c.gt.1) f0(p_pcg6_b_c)=0.0000
     if(p_pcg7_b_c.gt.1) f0(p_pcg7_b_c)=0.0000
     if(p_pcg8_b_c.gt.1) f0(p_pcg8_b_c)=0.0000
     if(p_pcg9_b_c.gt.1) f0(p_pcg9_b_c)=0.0000
     if(p_opcg1_b_c.gt.1) f0(p_opcg1_b_c) =0.0000
     if(p_opcg2_b_c.gt.1) f0(p_opcg2_b_c) =0.0000
     if(p_opcg3_b_c.gt.1) f0(p_opcg3_b_c)=0.0000
     if(p_opcg4_b_c.gt.1) f0(p_opcg4_b_c)=0.0000
     if(p_opcg5_b_c.gt.1) f0(p_opcg5_b_c)=0.0000
     if(p_opcg6_b_c.gt.1) f0(p_opcg6_b_c)=0.0000
     if(p_opcg7_b_c.gt.1) f0(p_opcg7_b_c)=0.0000
     if(p_opcg8_b_c.gt.1) f0(p_opcg8_b_c)=0.0000
     if(p_pcg1_b_o.gt.1) f0(p_pcg1_b_o) =0.0000
     if(p_pcg2_b_o.gt.1) f0(p_pcg2_b_o) =0.0000
     if(p_pcg3_b_o.gt.1) f0(p_pcg3_b_o)=0.0000
     if(p_pcg4_b_o.gt.1) f0(p_pcg4_b_o)=0.0000
     if(p_pcg5_b_o.gt.1) f0(p_pcg5_b_o)=0.0000
     if(p_pcg6_b_o.gt.1) f0(p_pcg6_b_o)=0.0000
     if(p_pcg7_b_o.gt.1) f0(p_pcg7_b_o)=0.0000
     if(p_pcg8_b_o.gt.1) f0(p_pcg8_b_o)=0.0000
     if(p_pcg9_b_o.gt.1) f0(p_pcg9_b_o)=0.0000
     if(p_opcg1_b_o.gt.1) f0(p_opcg1_b_o) =0.0000
     if(p_opcg2_b_o.gt.1) f0(p_opcg2_b_o) =0.0000
     if(p_opcg3_b_o.gt.1) f0(p_opcg3_b_o)=0.0000
     if(p_opcg4_b_o.gt.1) f0(p_opcg4_b_o)=0.0000
     if(p_opcg5_b_o.gt.1) f0(p_opcg5_b_o)=0.0000
     if(p_opcg6_b_o.gt.1) f0(p_opcg6_b_o)=0.0000
     if(p_opcg7_b_o.gt.1) f0(p_opcg7_b_o)=0.0000
     if(p_opcg8_b_o.gt.1) f0(p_opcg8_b_o)=0.0000
     if(p_pcg1_f_c.gt.1) f0(p_pcg1_f_c) =0.0000
     if(p_pcg2_f_c.gt.1) f0(p_pcg2_f_c) =0.0000
     if(p_pcg3_f_c.gt.1) f0(p_pcg3_f_c)=0.0000
     if(p_pcg4_f_c.gt.1) f0(p_pcg4_f_c)=0.0000
     if(p_pcg5_f_c.gt.1) f0(p_pcg5_f_c)=0.0000
     if(p_pcg6_f_c.gt.1) f0(p_pcg6_f_c)=0.0000
     if(p_pcg7_f_c.gt.1) f0(p_pcg7_f_c)=0.0000
     if(p_pcg8_f_c.gt.1) f0(p_pcg8_f_c)=0.0000
     if(p_pcg9_f_c.gt.1) f0(p_pcg9_f_c)=0.0000
     if(p_opcg1_f_c.gt.1) f0(p_opcg1_f_c) =0.0000
     if(p_opcg2_f_c.gt.1) f0(p_opcg2_f_c) =0.0000
     if(p_opcg3_f_c.gt.1) f0(p_opcg3_f_c)=0.0000
     if(p_opcg4_f_c.gt.1) f0(p_opcg4_f_c)=0.0000
     if(p_opcg5_f_c.gt.1) f0(p_opcg5_f_c)=0.0000
     if(p_opcg6_f_c.gt.1) f0(p_opcg6_f_c)=0.0000
     if(p_opcg7_f_c.gt.1) f0(p_opcg7_f_c)=0.0000
     if(p_opcg8_f_c.gt.1) f0(p_opcg8_f_c)=0.0000
     if(p_pcg1_f_o.gt.1) f0(p_pcg1_f_o) =0.0000
     if(p_pcg2_f_o.gt.1) f0(p_pcg2_f_o) =0.0000
     if(p_pcg3_f_o.gt.1) f0(p_pcg3_f_o)=0.0000
     if(p_pcg4_f_o.gt.1) f0(p_pcg4_f_o)=0.0000
     if(p_pcg5_f_o.gt.1) f0(p_pcg5_f_o)=0.0000
     if(p_pcg6_f_o.gt.1) f0(p_pcg6_f_o)=0.0000
     if(p_pcg7_f_o.gt.1) f0(p_pcg7_f_o)=0.0000
     if(p_pcg8_f_o.gt.1) f0(p_pcg8_f_o)=0.0000
     if(p_pcg9_f_o.gt.1) f0(p_pcg9_f_o)=0.0000
     if(p_opcg1_f_o.gt.1) f0(p_opcg1_f_o) =0.0000
     if(p_opcg2_f_o.gt.1) f0(p_opcg2_f_o) =0.0000
     if(p_opcg3_f_o.gt.1) f0(p_opcg3_f_o)=0.0000
     if(p_opcg4_f_o.gt.1) f0(p_opcg4_f_o)=0.0000
     if(p_opcg5_f_o.gt.1) f0(p_opcg5_f_o)=0.0000
     if(p_opcg6_f_o.gt.1) f0(p_opcg6_f_o)=0.0000
     if(p_opcg7_f_o.gt.1) f0(p_opcg7_f_o)=0.0000
     if(p_opcg8_f_o.gt.1) f0(p_opcg8_f_o)=0.0000
     if(p_ant1_c.gt.1) f0(p_ant1_c)=0.0000
     if(p_ant2_c.gt.1) f0(p_ant2_c)=0.0000
     if(p_ant3_c.gt.1) f0(p_ant3_c)=0.0000
     if(p_ant4_c.gt.1) f0(p_ant4_c)=0.0000
     if(p_ant1_o.gt.1) f0(p_ant1_o)=0.0000
     if(p_ant2_o.gt.1) f0(p_ant2_o)=0.0000
     if(p_ant3_o.gt.1) f0(p_ant3_o)=0.0000
     if(p_ant4_o.gt.1) f0(p_ant4_o)=0.0000
     if(p_biog1_c.gt.1) f0(p_biog1_c)=0.0000
     if(p_biog2_c.gt.1) f0(p_biog2_c)=0.0000
     if(p_biog3_c.gt.1) f0(p_biog3_c)=0.0000
     if(p_biog4_c.gt.1) f0(p_biog4_c)=0.0000
     if(p_biog1_o.gt.1) f0(p_biog1_o)=0.0000
     if(p_biog2_o.gt.1) f0(p_biog2_o)=0.0000
     if(p_biog3_o.gt.1) f0(p_biog3_o)=0.0000
     if(p_biog4_o.gt.1) f0(p_biog4_o)=0.0000
     if(p_pcg1_b_c.gt.1) dvj(p_pcg1_b_c) =1.0E-1
     if(p_pcg2_b_c.gt.1) dvj(p_pcg2_b_c) =1.0E-1
     if(p_pcg3_b_c.gt.1) dvj(p_pcg3_b_c)=1.0E-1
     if(p_pcg4_b_c.gt.1) dvj(p_pcg4_b_c)=1.0E-1
     if(p_pcg5_b_c.gt.1) dvj(p_pcg5_b_c)=1.0E-1
     if(p_pcg6_b_c.gt.1) dvj(p_pcg6_b_c)=1.0E-1
     if(p_pcg7_b_c.gt.1) dvj(p_pcg7_b_c)=1.0E-1
     if(p_pcg8_b_c.gt.1) dvj(p_pcg8_b_c)=1.0E-1
     if(p_pcg9_b_c.gt.1) dvj(p_pcg9_b_c)=1.0E-1
     if(p_opcg1_b_c.gt.1) dvj(p_opcg1_b_c) =1.0E-1
     if(p_opcg2_b_c.gt.1) dvj(p_opcg2_b_c) =1.0E-1
     if(p_opcg3_b_c.gt.1) dvj(p_opcg3_b_c)=1.0E-1
     if(p_opcg4_b_c.gt.1) dvj(p_opcg4_b_c)=1.0E-1
     if(p_opcg5_b_c.gt.1) dvj(p_opcg5_b_c)=1.0E-1
     if(p_opcg6_b_c.gt.1) dvj(p_opcg6_b_c)=1.0E-1
     if(p_opcg7_b_c.gt.1) dvj(p_opcg7_b_c)=1.0E-1
     if(p_opcg8_b_c.gt.1) dvj(p_opcg8_b_c)=1.0E-1
     if(p_pcg1_b_o.gt.1) dvj(p_pcg1_b_o) =1.0E-1
     if(p_pcg2_b_o.gt.1) dvj(p_pcg2_b_o) =1.0E-1
     if(p_pcg3_b_o.gt.1) dvj(p_pcg3_b_o)=1.0E-1
     if(p_pcg4_b_o.gt.1) dvj(p_pcg4_b_o)=1.0E-1
     if(p_pcg5_b_o.gt.1) dvj(p_pcg5_b_o)=1.0E-1
     if(p_pcg6_b_o.gt.1) dvj(p_pcg6_b_o)=1.0E-1
     if(p_pcg7_b_o.gt.1) dvj(p_pcg7_b_o)=1.0E-1
     if(p_pcg8_b_o.gt.1) dvj(p_pcg8_b_o)=1.0E-1
     if(p_pcg9_b_o.gt.1) dvj(p_pcg9_b_o)=1.0E-1
     if(p_opcg1_b_o.gt.1) dvj(p_opcg1_b_o) =1.0E-1
     if(p_opcg2_b_o.gt.1) dvj(p_opcg2_b_o) =1.0E-1
     if(p_opcg3_b_o.gt.1) dvj(p_opcg3_b_o)=1.0E-1
     if(p_opcg4_b_o.gt.1) dvj(p_opcg4_b_o)=1.0E-1
     if(p_opcg5_b_o.gt.1) dvj(p_opcg5_b_o)=1.0E-1
     if(p_opcg6_b_o.gt.1) dvj(p_opcg6_b_o)=1.0E-1
     if(p_opcg7_b_o.gt.1) dvj(p_opcg7_b_o)=1.0E-1
     if(p_opcg8_b_o.gt.1) dvj(p_opcg8_b_o)=1.0E-1
     if(p_pcg1_f_c.gt.1) dvj(p_pcg1_f_c) =1.0E-1
     if(p_pcg2_f_c.gt.1) dvj(p_pcg2_f_c) =1.0E-1
     if(p_pcg3_f_c.gt.1) dvj(p_pcg3_f_c)=1.0E-1
     if(p_pcg4_f_c.gt.1) dvj(p_pcg4_f_c)=1.0E-1
     if(p_pcg5_f_c.gt.1) dvj(p_pcg5_f_c)=1.0E-1
     if(p_pcg6_f_c.gt.1) dvj(p_pcg6_f_c)=1.0E-1
     if(p_pcg7_f_c.gt.1) dvj(p_pcg7_f_c)=1.0E-1
     if(p_pcg8_f_c.gt.1) dvj(p_pcg8_f_c)=1.0E-1
     if(p_pcg9_f_c.gt.1) dvj(p_pcg9_f_c)=1.0E-1
     if(p_opcg1_f_c.gt.1) dvj(p_opcg1_f_c) =1.0E-1
     if(p_opcg2_f_c.gt.1) dvj(p_opcg2_f_c) =1.0E-1
     if(p_opcg3_f_c.gt.1) dvj(p_opcg3_f_c)=1.0E-1
     if(p_opcg4_f_c.gt.1) dvj(p_opcg4_f_c)=1.0E-1
     if(p_opcg5_f_c.gt.1) dvj(p_opcg5_f_c)=1.0E-1
     if(p_opcg6_f_c.gt.1) dvj(p_opcg6_f_c)=1.0E-1
     if(p_opcg7_f_c.gt.1) dvj(p_opcg7_f_c)=1.0E-1
     if(p_opcg8_f_c.gt.1) dvj(p_opcg8_f_c)=1.0E-1
     if(p_pcg1_f_o.gt.1) dvj(p_pcg1_f_o) =1.0E-1
     if(p_pcg2_f_o.gt.1) dvj(p_pcg2_f_o) =1.0E-1
     if(p_pcg3_f_o.gt.1) dvj(p_pcg3_f_o)=1.0E-1
     if(p_pcg4_f_o.gt.1) dvj(p_pcg4_f_o)=1.0E-1
     if(p_pcg5_f_o.gt.1) dvj(p_pcg5_f_o)=1.0E-1
     if(p_pcg6_f_o.gt.1) dvj(p_pcg6_f_o)=1.0E-1
     if(p_pcg7_f_o.gt.1) dvj(p_pcg7_f_o)=1.0E-1
     if(p_pcg8_f_o.gt.1) dvj(p_pcg8_f_o)=1.0E-1
     if(p_pcg9_f_o.gt.1) dvj(p_pcg9_f_o)=1.0E-1
     if(p_opcg1_f_o.gt.1) dvj(p_opcg1_f_o) =1.0E-1
     if(p_opcg2_f_o.gt.1) dvj(p_opcg2_f_o) =1.0E-1
     if(p_opcg3_f_o.gt.1) dvj(p_opcg3_f_o)=1.0E-1
     if(p_opcg4_f_o.gt.1) dvj(p_opcg4_f_o)=1.0E-1
     if(p_opcg5_f_o.gt.1) dvj(p_opcg5_f_o)=1.0E-1
     if(p_opcg6_f_o.gt.1) dvj(p_opcg6_f_o)=1.0E-1
     if(p_opcg7_f_o.gt.1) dvj(p_opcg7_f_o)=1.0E-1
     if(p_opcg8_f_o.gt.1) dvj(p_opcg8_f_o)=1.0E-1
     if(p_ant1_c.gt.1) dvj(p_ant1_c)=1.0E-1
     if(p_ant2_c.gt.1) dvj(p_ant2_c)=1.0E-1
     if(p_ant3_c.gt.1) dvj(p_ant3_c)=1.0E-1
     if(p_ant4_c.gt.1) dvj(p_ant4_c)=1.0E-1
     if(p_ant1_o.gt.1) dvj(p_ant1_o)=1.0E-1
     if(p_ant2_o.gt.1) dvj(p_ant2_o)=1.0E-1
     if(p_ant3_o.gt.1) dvj(p_ant3_o)=1.0E-1
     if(p_ant4_o.gt.1) dvj(p_ant4_o)=1.0E-1
     if(p_biog1_c.gt.1) dvj(p_biog1_c)=1.0E-1
     if(p_biog2_c.gt.1) dvj(p_biog2_c)=1.0E-1
     if(p_biog3_c.gt.1) dvj(p_biog3_c)=1.0E-1
     if(p_biog4_c.gt.1) dvj(p_biog4_c)=1.0E-1
     if(p_biog1_o.gt.1) dvj(p_biog1_o)=1.0E-1
     if(p_biog2_o.gt.1) dvj(p_biog2_o)=1.0E-1
     if(p_biog3_o.gt.1) dvj(p_biog3_o)=1.0E-1
     if(p_biog4_o.gt.1) dvj(p_biog4_o)=1.0E-1
        DO l = 1, numgas
          hstar4(l) = hstar(l)
          dvj(l) = dvj(l)*(293.15/298.15)**1.75
          sc = 0.15/dvj(l)
          dratio(l) = 0.242/dvj(l)
          scpr23(l) = (sc/0.72)**(2./3.)
        END DO
        else is_cbm4_kpp
        hstar(p_no2) = 6.40E-3
        hstar(p_no) = 1.90E-3
        hstar(p_pan) = 2.97E+0
        hstar(p_o3) = 1.13E-2
        hstar(p_hcho) = 2.97E+3
        hstar(p_hono) = 3.47E+5
        hstar(p_no3) = 1.50E+1
        hstar(p_h2o2) = 7.45E+4
        hstar(p_co) = 8.20E-3
        hstar(p_ald2) = 1.14E+1
        hstar(p_onit) = 1.13E+0
        hstar(p_so2) = 2.53E+5
        hstar(p_eth) = 2.00E-3
        hstar(p_ole) = 3.05E-3
        hstar(p_tol) = 1.51E-1
        hstar(p_cres) = 4.00E+5
        hstar(p_xyl) = 1.45E-1
        hstar(p_iso) = 4.76E-3
        hstar(p_hno3) = 2.69E+13
        hstar(p_nh3) = 1.04E+4
        hstar(p_n2o5) = 1.00E+10
        hstar(p_par) = 1.13E-3
        dhr(p_no2) = 2500.
        dhr(p_no) = 1480.
        dhr(p_pan) = 5760.
        dhr(p_o3) = 2300.
        dhr(p_hcho) = 7190.
        dhr(p_hono) = 3775.
        dhr(p_no3) = 0.
        dhr(p_h2o2) = 6615.
        dhr(p_co) = 0.
        dhr(p_ald2) = 6266.
        dhr(p_onit) = 5487.
        dhr(p_so2) = 5816.
        dhr(p_eth) = 0.
        dhr(p_ole) = 0.
        dhr(p_tol) = 0.
        dhr(p_cres) = 0.
        dhr(p_xyl) = 0.
        dhr(p_iso) = 0.
        dhr(p_hno3) = 8684.
        dhr(p_nh3) = 3660.
        dhr(p_n2o5) = 0.
        dhr(p_par) = 0.
        f0(p_no2) = 0.1
        f0(p_no) = 0.
        f0(p_pan) = 0.1
        f0(p_o3) = 1.
        f0(p_hcho) = 0.
        f0(p_hono) = 0.1
        f0(p_no3) = 1.
        f0(p_h2o2) = 1.
        f0(p_co) = 0.
        f0(p_ald2) = 0.
        f0(p_onit) = 0.
        f0(p_so2) = 0.
        f0(p_eth) = 0.
        f0(p_ole) = 0.
        f0(p_tol) = 0.
        f0(p_csl) = 0.
        f0(p_xyl) = 0.
        f0(p_iso) = 0.
        f0(p_hno3) = 0.
        f0(p_nh3) = 0.
        f0(p_n2o5) = 1.
        f0(p_par) = 0.
        dvj(p_no2) = 0.147
        dvj(p_no) = 0.183
        dvj(p_pan) = 0.091
        dvj(p_o3) = 0.175
        dvj(p_hcho) = 0.183
        dvj(p_hono) = 0.153
        dvj(p_no3) = 0.127
        dvj(p_h2o2) = 0.171
        dvj(p_co) = 0.189
        dvj(p_ald2) = 0.151
        dvj(p_onit) = 0.092
        dvj(p_so2) = 0.126
        dvj(p_eth) = 0.183
        dvj(p_ole) = 0.135
        dvj(p_tol) = 0.104
        dvj(p_csl) = 0.096
        dvj(p_xyl) = 0.097
        dvj(p_iso) = 0.121
        dvj(p_hno3) = 0.126
        dvj(p_nh3) = 0.227
        dvj(p_n2o5) = 0.110
        dvj(p_par) = 0.118
        DO l = 1, numgas
          hstar4(l) = hstar(l)
          dvj(l) = dvj(l)*(293.15/298.15)**1.75
          sc = 0.15/dvj(l)
          dratio(l) = 0.242/dvj(l)
          scpr23(l) = (sc/0.72)**(2./3.)
       end DO
    end if is_cbm4_kpp
        kpart(1) = 500.
        kpart(2) = 500.
        kpart(3) = 500.
        kpart(4) = 500.
        kpart(5) = 500.
        kpart(6) = 100.
        kpart(7) = 500.
        kpart(8) = 500.
        kpart(9) = 500.
        kpart(10) = 500.
        kpart(11) = 100.
        kpart(12) = 100.
        kpart(13) = 100.
        kpart(14) = 100.
        kpart(15) = 100.
        kpart(16) = 500.
        kpart(17) = 500.
        kpart(18) = 500.
        kpart(19) = 500.
        kpart(20) = 500.
        kpart(21) = 100.
        kpart(22) = 500.
        kpart(23) = 500.
        kpart(24) = 500.
        kpart(25) = 500.
        IF (mminlu=='OLD ') THEN
          ixxxlu(1) = 1
          ixxxlu(2) = 2
          ixxxlu(3) = 3
          ixxxlu(4) = 4
          ixxxlu(5) = 5
          ixxxlu(6) = 5
          ixxxlu(7) = 0
          ixxxlu(8) = 6
          ixxxlu(9) = 1
          ixxxlu(10) = 6
          ixxxlu(11) = 0
          ixxxlu(12) = 4
          ixxxlu(13) = 6
        END IF
        IF (mminlu=='USGS') THEN
          ixxxlu(1) = 1
          ixxxlu(2) = 2
          ixxxlu(3) = 2
          ixxxlu(4) = 2
          ixxxlu(5) = 2
          ixxxlu(6) = 4
          ixxxlu(7) = 3
          ixxxlu(8) = 6
          ixxxlu(9) = 3
          ixxxlu(10) = 6
          ixxxlu(11) = 4
          ixxxlu(12) = 5
          ixxxlu(13) = 4
          ixxxlu(14) = 5
          ixxxlu(15) = 5
          ixxxlu(16) = 0
          ixxxlu(17) = 6
          ixxxlu(18) = 4
          ixxxlu(19) = 1
          ixxxlu(20) = 6
          ixxxlu(21) = 4
          ixxxlu(22) = 6
          ixxxlu(23) = 1
          ixxxlu(24) = 0
          ixxxlu(25) = 1
        END IF
        IF (mminlu=='SiB ') THEN
          ixxxlu(1) = 4
          ixxxlu(2) = 4
          ixxxlu(3) = 4
          ixxxlu(4) = 5
          ixxxlu(5) = 5
          ixxxlu(6) = 6
          ixxxlu(7) = 3
          ixxxlu(8) = 6
          ixxxlu(9) = 6
          ixxxlu(10) = 6
          ixxxlu(11) = 1
          ixxxlu(12) = 2
          ixxxlu(13) = 6
          ixxxlu(14) = 1
          ixxxlu(15) = 0
          ixxxlu(16) = 0
          ixxxlu(17) = 1
        END IF
is_mozart : &
      if( config_flags%chem_opt == MOZART_KPP .or. &
          config_flags%chem_opt == MOZCART_KPP .or. &
          config_flags%chem_opt == SAPRC99_MOSAIC_4BIN_VBS2_KPP .or. &
          config_flags%chem_opt == SAPRC99_KPP .or. &
          config_flags%chem_opt == SAPRC99_MOSAIC_4BIN_VBS9_KPP .or. &
          config_flags%chem_opt == SAPRC99_MOSAIC_8BIN_VBS2_AQ_KPP .or. &
          config_flags%chem_opt == SAPRC99_MOSAIC_8BIN_VBS2_KPP .or. &
          config_flags%chem_opt == MOZART_MOSAIC_4BIN_VBS0_KPP ) then
        if( id == 1 .and. .not. allocated(seasonal_pft) ) then
          CALL nl_get_max_dom( 1,max_dom )
          allocate( seasonal_pft(max_dom),stat=astat )
          if( astat /= 0 ) then
            CALL wrf_message( 'dep_init: failed to allocate wesely_pft type seasonal_pft' )
            CALL wrf_abort
          endif
          write(err_msg,*) 'dep_init: initializing for ',max_dom,' domains'
          CALL wrf_message( trim(err_msg) )
          seasonal_pft(:)%is_allocated = .false.
        endif
seasonal_pft_allocated : &
        IF( .not. seasonal_pft(id)%is_allocated ) then
        IF( wrf_dm_on_monitor() ) THEN
         write(id_num,'(i3)') 100+id
         err_msg = 'dep_init: initializing domain ' // id_num(2:3)
         CALL wrf_message( trim(err_msg) )
         cpos = index( config_flags%wes_seasonal_inname, '<domain>' )
         if( cpos > 0 ) then
           filename = ' '
           filename = config_flags%wes_seasonal_inname(:cpos-1) // 'd' // id_num(2:3)
           cpos = cpos + 8
           slen = len_trim( config_flags%wes_seasonal_inname )
           if( cpos < slen ) then
             filename(len_trim(filename)+1:) = config_flags%wes_seasonal_inname(cpos:slen)
           endif
         else
           filename = trim( config_flags%wes_seasonal_inname )
         endif
         err_msg = 'dep_init: failed to open file ' // trim(filename)
         call handle_ncerr( nf_open( trim(filename), nf_noclobber, ncid ), trim(err_msg) )
         err_msg = 'dep_init: failed to get npft id'
         call handle_ncerr( nf_inq_dimid( ncid, 'npft', dimid ), trim(err_msg) )
         err_msg = 'dep_init: failed to npft'
         call handle_ncerr( nf_inq_dimlen( ncid, dimid, seasonal_pft(id)%npft ), trim(err_msg) )
         err_msg = 'dep_init: failed to get months year id'
         call handle_ncerr( nf_inq_dimid( ncid, 'months', dimid ), trim(err_msg) )
         err_msg = 'dep_init: failed to get months'
         call handle_ncerr( nf_inq_dimlen( ncid, dimid, seasonal_pft(id)%months ), trim(err_msg) )
         err_msg = 'ftuv_init: failed to get west_east id'
         call handle_ncerr( nf_inq_dimid( ncid, 'west_east', dimid ), trim(err_msg) )
         err_msg = 'ftuv_init: failed to get west_east'
         call handle_ncerr( nf_inq_dimlen( ncid, dimid, lon_e ), trim(err_msg) )
         err_msg = 'ftuv_init: failed to get south_north id'
         call handle_ncerr( nf_inq_dimid( ncid, 'south_north', dimid ), trim(err_msg) )
         err_msg = 'ftuv_init: failed to get south_north'
         call handle_ncerr( nf_inq_dimlen( ncid, dimid, lat_e ), trim(err_msg) )
        end IF
         CALL wrf_dm_bcast_bytes ( seasonal_pft(id)%npft , 4 )
         CALL wrf_dm_bcast_bytes ( seasonal_pft(id)%months , 4 )
         CALL wrf_dm_bcast_bytes ( lon_e , 4 )
         CALL wrf_dm_bcast_bytes ( lat_e , 4 )
         iend = min( ipe,ide-1 )
         jend = min( jpe,jde-1 )
         allocate( input_wes_seasonal(lon_e,lat_e,seasonal_pft(id)%npft,seasonal_pft(id)%months), stat=astat )
         if( astat /= 0 ) then
            call wrf_message( 'dep_init: failed to allocate input_wes_seasonal' )
            call wrf_abort
         end if
         allocate( seasonal_pft(id)%seasonal_wes(ips:iend,jps:jend,seasonal_pft(id)%npft,seasonal_pft(id)%months), stat=astat )
         if( astat /= 0 ) then
            call wrf_message( 'dep_init: failed to allocate seasonal_wes' )
            call wrf_abort
         end if
         seasonal_pft(id)%is_allocated = .true.
        IF ( wrf_dm_on_monitor() ) THEN
         err_msg = 'dep_init: failed to get seasonal_wes variable id'
         call handle_ncerr( nf_inq_varid( ncid, 'seasonal_wes', varid ), trim(err_msg) )
         err_msg = 'dep_init: failed to read seasonal_wes variable'
         call handle_ncerr( nf_get_var_int( ncid, varid, input_wes_seasonal ), trim(err_msg) )
         err_msg = 'dep_init: failed to close file wrf_season_wes_usgs.nc'
         call handle_ncerr( nf_close( ncid ), trim(err_msg) )
        end if
        CALL wrf_dm_bcast_bytes ( input_wes_seasonal , size ( input_wes_seasonal ) * 4 )
        seasonal_pft(id)%seasonal_wes(ips:iend,jps:jend,:seasonal_pft(id)%npft,:seasonal_pft(id)%months) = &
                input_wes_seasonal(ips:iend,jps:jend,:seasonal_pft(id)%npft,:seasonal_pft(id)%months)
        deallocate( input_wes_seasonal )
        endif seasonal_pft_allocated
      endif is_mozart
      END SUBROUTINE dep_init
      subroutine handle_ncerr( ret, mes )
      implicit none
      integer, intent(in) :: ret
      character(len=*), intent(in) :: mes
include 'netcdf.inc'
      if( ret /= nf_noerr ) then
         call wrf_message( trim(mes) )
         call wrf_message( trim(nf_strerror(ret)) )
         call wrf_abort
      end if
      end subroutine handle_ncerr
    END MODULE module_dep_simple