! Copyright 2008-2021 Earth Sciences Department, BSC-CNS
!
! This file is part of MONARCH.
!
! MONARCH is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! MONARCH is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with MONARCH. If not, see <http://www.gnu.org/licenses/>.
!-----------------------------------------------------------------------
!
                        module module_bsc_chem_data
!
!-----------------------------------------------------------------------
!
      USE MODULE_DM_PARALLEL,ONLY : ITS,ITE,IMS,IME,IDS,IDE             &
                                   ,JTS,JTE,JMS,JME,JDS,JDE             &
                                   ,MYPE_SHARE,MPI_COMM_COMP            &
                                   ,MPI_REAL
                            
!
!-----------------------------------------------------------------------
!
      implicit none
!      
      SAVE
!-----------------------------------------------------------------------
!
      INTEGER,PRIVATE :: MYPE, IRTN
!
!-----------------------------------------------------------------------
!***  DEFINITION OF CHEMICAL MECHANISMS INDEXES
!-----------------------------------------------------------------------
integer :: MECH, STE, LMV, INIT, CNST, BIO_MOD, NUM_LAY_EMISS, NUM_EMISS_VERT
real :: CONVEMI
logical :: ONLINE_BIOG
integer :: NEW_EMISS
integer :: EMI_SOA_DENT !=1 DENTENER;2 TSIGARIDIS;3 HODZIC+SPRACKLEN
!***  INDEXES FOR CHEMICAL MECHANISM
integer ::                         &
                      P_HCHO         ! TODO: check if still needed

integer ::                         &
                       P_NO2       &
                      ,P_NO        &
                      ,P_O3        &
                      ,P_NO3       &
                      ,P_N2O5      &
                      ,P_HNO3      &
                      ,P_HONO      &
                      ,P_PNA       &
                      ,P_H2O2      &
                      ,P_NTR       &
                      ,P_ROOH      &
                      ,P_FORM      &
                      ,P_ALD2      &
                      ,P_ALDX      &
                      ,P_PAR       &
                      ,P_CO        &
                      ,P_MEPX      &
                      ,P_MEOH      &
                      ,P_FACD      &
                      ,P_PAN       &
                      ,P_PACD      &
                      ,P_AACD      &
                      ,P_PANX      &
                      ,P_OLE       &
                      ,P_ETH       &
                      ,P_IOLE      &
                      ,P_TOL       &
                      ,P_CRES      &
                      ,P_OPEN      &
                      ,P_MGLY      &
                      ,P_XYL       &
                      ,P_ISOP      &
                      ,P_ISPD      &
                      ,P_TERP      &
                      ,P_SO2       &
                      ,P_SULF      &
                      ,P_ETOH      &
                      ,P_ETHA      &
!NON-ADVECTED SPECIES
                      ,P_O         &
                      ,P_O1D       &
                      ,P_OH        &
                      ,P_HO2       &
                      ,P_XO2       &
                      ,P_XO2N      &
                      ,P_MEO2      &
                      ,P_HCO3      &
                      ,P_C2O3      &
                      ,P_CXO3      &
                      ,P_ROR       &
                      ,P_TO2       &
                      ,P_CRO       &
                      ,P_CH4       &
                      ,P_NO2E
!INDEXES FOR EXTENDED CB05
integer ::                         &
                       P_CL2       &
                      ,P_HOCL      &
                      ,P_FMCL      &
                      ,P_HCL       &
                      ,P_BENZENE   &
                      ,P_SESQ      &
                      ,P_ISOPRXN   &
                      ,P_TRPRXN    &
                      ,P_SULRXN    &
                      ,P_CL        &
                      ,P_CLO       &
                      ,P_TOLNRXN   &
                      ,P_TOLHRXN   &
                      ,P_XYLNRXN   &
                      ,P_XYLHRXN   &
                      ,P_BENZRO2   &
                      ,P_BNZNRXN   &
                      ,P_BNZHRXN   &
                      ,P_SESQRXN   &
                      ,P_XYLRO2    &
                      ,P_TOLRO2
integer ::             P_TRACER
integer ::             P_NH3
integer ::             P_DMS       &
                      ,P_PINENE_A  &
!                      ,P_ISOP      &
                      ,P_ISOPP1G   &
                      ,P_ISOPP2G   &
                      ,P_APINP1G   &
                      ,P_APINP2G
integer ::             P_VOCA,P_VOCBB
INTEGER ::       &
                 P_BC1   & !fine phob bc
                ,P_BC2   & !fine phil bc
                ,P_SO4   & !fine so4--
                ,P_NO3b1 & !fine as sulfate no3-
                ,P_NO3b2 & !coarse_on_dustbin5 no3-
                ,P_NO3b3 & !coarse_on_ssabin5  no3-
                ,P_NH4   & !fine as sulfate nh4+
                ,P_UNSPCF & !fine unspeciated matter
                ,P_UNSPCC & !coarse unspeciated matter
                           !OA DESCRIPTION
                           !DENENER                TSIGARIDIS             HODZIC+SPRACKLEN
                ,P_OM1   & !PRIMARY ORGANIC PHOB   POA PHOB               POA ANTHRO PHOB  
                ,P_OM2   & !PRIMARY ORGANIC PHIL   POA PHIL               POA ANTHRO PHIL
                ,P_OM3   & !SOA PHOB               NOT USED               POA BIOMASS BURNING PHOB
                ,P_OM4   & !SOA PHIL               SOA ISOPP1A            POA BIOMASS BURNING PHIL
                ,P_OM5   & !NOT USED               SOA ISOPP2A            BIOGENIC SOA
                ,P_OM6   & !NOT USED               SOA APINP1A            ANTRHO SOA
                ,P_OM7   & !NOT USED               SOA APINP2A            BIOMASS BURNING SOA
                ,P_OM8     !NOT USED               NOT USED               ENHANCED BIOGENIC SOA

!-----------------------------------------------------------------------
!*** PHOTOLYSIS INDEXES AND MATRIXS
!-----------------------------------------------------------------------
integer ::   &
   nphoto_fastj, jppjm  !,NS   from module_phot_fastj
                        ! , module_fastj_data
integer ::   &
   lfastj_no2,   & !NO2 = NO + O         ph_no2
   lfastj_o3a,   & !O3  = O              ph_o33p
   lfastj_o3b,   & !O3  = O1D            ph_o31d
   lfastj_h2o2,  & !H2O2 = 2*OH          ph_h2o2
   lfastj_hchoa, & !HCHO = 2*HO2 + CO    ph_ch2or
   lfastj_hchob, & !HCHO = CO            ph_ch2om
   lfastj_ch3ooh,& 
   lfastj_no3x,  & !NO3 = NO2 + O        ph_no3o
   lfastj_no3l,  & !NO3 = NO             ph_no3o2
   lfastj_hono,  & !HONO = NO + OH       ph_hno2
   lfastj_n2o5,  & !N2O5 = NO2 + NO3     ph_n2o5
   lfastj_hno3,  & !HNO3 = OH + NO2      ph_hno3
   lfastj_hno4     !PNA = 0.61*HO2 + 0.61*NO2... ph_hno4
!specific for CB05
integer ::   &
   lfastj_ntr,  &  !NTR = ...             ph_ntr
   lfastj_ald2, &  !ALD2 = MEO2 + CO + HO2 ph_ald2
   lfastj_pan,  &  !PAN = C2O3 + NO2      ph_pan
   lfastj_aldx, &  !ALDX = MEO2 + CO + HO2  ph_aldx
   lfastj_mgly, &  !MGLY = C2O3 + HO2 + CO  ph_mgly
   lfastj_ispd, &  !ISPD = ...             ph_ispd
   lfastj_pacd, &  !PACD = MEO2 + OH       ph_pacd
   lfastj_no2e, &  !NO2 = NO2E             ph_no2e
!extended cb05
   lfastj_cl2,  &  !CL2 = 2 CL             ph_cl2
   lfastj_hocl, &  !HOCL = OH + CL         ph_hocl
   lfastj_fmcl     !FMCL = CL + CO + HO2   ph_fmcl
real,allocatable,dimension(:,:,:) ::   &
           ph_o2,ph_o31d,ph_o33p,ph_no2,ph_no3o2,ph_no3o,ph_hno2,  &
           ph_hno3,ph_hno4,ph_h2o2,ph_ch2or,ph_ch2om,ph_ch3cho,    &
           ph_ch3coch3,ph_ch3coc2h5,ph_hcocho,ph_ch3cocho,         &
           ph_hcochest,ph_ch3o2h,ph_ch3coo2h,ph_ch3ono2,ph_hcochob,&
           ph_n2o5,ph_no2e
!specific for CB05
real,allocatable,dimension(:,:,:) ::   &
           ph_ntr,ph_ald2,ph_pan,ph_aldx,ph_mgly,ph_ispd,    &
           ph_mepx,ph_pacd,ph_open,ph_panx
!extended for cb05
real,allocatable,dimension(:,:,:) ::   &
           ph_cl2,ph_hocl,ph_fmcl
!-----------------------------------------------------------------------
!***  DEFINITION OF CLOUD CHEMISTRY MAPPING INDEXES AND ARRAYS
!-----------------------------------------------------------------------
!GC_SPC_kppcb4.EXT
        INTEGER        N_GC_SPC
        INTEGER        N_GC_SPC_CHEM
        INTEGER        N_GC_SPCD
        CHARACTER*16 :: GC_SPC(100)  !If more than 100 chem species increase
        REAL :: GC_MOLWT(100)
!GC_SCAV_kppcb4.EXT
        INTEGER        N_GC_SCAV
        INTEGER        N_GC_SCAVD
        CHARACTER*16 :: GC_SCAV(100)
        INTEGER :: GC_SCAV_MAP(100)
        REAL :: GC_SCAV_FAC(100)
!GC_WDEP_kppcb4.EXT
        INTEGER        N_GC_WDEP
        INTEGER        N_GC_WDEPD
        CHARACTER*16 :: GC_WDEP(100)
        INTEGER :: GC_WDEP_MAP(100)
!BC CHEM
        INTEGER        N_GC_BCCHEM
        CHARACTER*16 :: GC_BCCHEM(100)
        INTEGER :: GC_BCCHEM_MAP(100)
!
!-----------------------------------------------------------------------
!***  CARIOLLE MODEL COEFFICIENTS
!-----------------------------------------------------------------------
!
      INTEGER,PARAMETER :: NLAT=64,NLEV=91,NCOEFF=9,NMONTH=12
!
       REAL,ALLOCATABLE,DIMENSION(:) :: PHI,PRESC
!
       REAL,ALLOCATABLE,DIMENSION(:,:,:,:) :: COEFF
!
!-----------------------------------------------------------------------
!***  COPCAT MODEL COEFFICIENTS
!-----------------------------------------------------------------------
!
      INTEGER,PARAMETER :: NLEV_COP=24, NCOEFF_COP=7  
!
!      REAL :: PHI(JDE-2), PRESC(NLEV)   
!
!      REAL :: COEFF(JDE-2,NLEV,NCOEFF,NMONTH)
!
!      REAL :: PHI(NLAT), PRESC(NLEV)
!
!      REAL :: COEFF(NLAT,NLEV,NCOEFF,NMONTH)
!
!-----------------------------------------------------------------------
!***  O3 STRATOSPHERIC CLIMATOLOGY ---> moved to module_chemistry.F90
!-----------------------------------------------------------------------
!
!       REAL,ALLOCATABLE,DIMENSION(:,:,:) :: O3CLIMATO
!
!-----------------------------------------------------------------------
!***  Flag to indicate chemistry indices have been initialized
!
      LOGICAL :: CHEM_INDICES_ARE_INITIALIZED = .false.
!
!-----------------------------------------------------------------------
!
      CONTAINS
!
!-----------------------------------------------------------------------
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
!-----------------------------------------------------------------------
      SUBROUTINE INDX_CHEM_INIT(CHEM_MECH,CHEM_IC,NUM_BC_CHEM                    &
                               ,NUM_ASH,NUM_DUST,NUM_SALT,NUM_OM,NUM_BC          &
                               ,NUM_SO4,NUM_NO3,NUM_NH4,NUM_UNSPC                &
                               ,LPHOT,INDX_GAS_START,CHEM_STE                    &
                               ,LEMILINE,LCNST,LNEWEMISS,LBIOMOD,LCONVEMI        &
                               ,LNUM_LAY_EMISS,LNUM_EMISS_VERT,LM)
!***********************************************************************
!$$$  SUBPROGRAM DOCUMENTATION BLOCK
!                .      .    .
! SUBPROGRAM:  INDX_CHEM_INIT
!   PRGRMMR: JORBA           ORG: W/NP22     DATE: 09-11-24
!
! ABSTRACT:
!     INITIALIZATION OF INDX_ GAS-PHASE SPECIES AND STE INDEXES
!
! PROGRAM HISTORY LOG (with changes to called routines) :
!   09-11-24  JORBA      - ORIGINATOR 
!   09-12-11  JORBA      - STE INDEXES OF CARIOLLE LINEAR MODEL
!   11-09-06  JORBA      - STE = 2 USE O3CLIMATOLOGY
!   11-10-24  JORBA      - NUM_BC_CHEM and CHEM BC
!   11-12-05  JORBA      - STE INDEXES OF COPCAT LINEAR MODEL
!   13-03-15  JORBA      - MECH OPT. 3
!
! USAGE: CALL INDX_CHEM_INIT FROM MODULE_CONTROL
!
! ATTRIBUTES:
!   LANGUAGE: FORTRAN 90
!   MACHINE : IBM
!$$$
!-----------------------------------------------------------------------
!
      IMPLICIT NONE
!
!-----------------------------------------------------------------------
!
      INTEGER,INTENT(IN) :: CHEM_MECH,CHEM_IC,NUM_BC_CHEM,INDX_GAS_START,CHEM_STE,LM
      INTEGER,INTENT(IN) :: LCNST,LBIOMOD,LNUM_LAY_EMISS,LNUM_EMISS_VERT,LNEWEMISS
      INTEGER,INTENT(IN) :: NUM_ASH,NUM_DUST,NUM_SALT,NUM_OM,NUM_BC          &
                           ,NUM_SO4,NUM_NO3,NUM_NH4,NUM_UNSPC                
      REAL,INTENT(IN) :: LCONVEMI
      LOGICAL,INTENT(IN) :: LPHOT,LEMILINE
!-----------------------------------------------------------------------
!***
!***  LOCAL VARIABLES
!***
!-----------------------------------------------------------------------

!     PARAMETERS AND VARIABLES FOR CARIOLLE MODEL
      INTEGER,PARAMETER :: NIN=1999
!
      CHARACTER*5 :: TYEAR
      CHARACTER*6 :: TMONTH
      INTEGER :: IM,K,L,JC,IMONTH,IYEAR
      INTEGER :: NUM_AERO_LOCAL
!
      LOGICAL,PARAMETER :: LPHOT2=.TRUE.
!-----------------------------------------------------------------------

      MYPE=MYPE_SHARE

      MECH = CHEM_MECH
      INIT = CHEM_IC
      STE  = CHEM_STE
      LMV  = LM
      ONLINE_BIOG = LEMILINE
      CNST = LCNST
      BIO_MOD = LBIOMOD
      CONVEMI = LCONVEMI
      NEW_EMISS = LNEWEMISS
      NUM_LAY_EMISS = LNUM_LAY_EMISS
      NUM_EMISS_VERT = LNUM_EMISS_VERT

!0. Define position of aerosols
       EMI_SOA_DENT = 3 !=1 DENTENER;2 TSIGARIDIS;3 HODZIC+SPRACKLEN !TEMPORAL MUST HAVE SAME VALUE AS IN AERO_MECHANISM
       IF(NUM_OM>0)THEN
         P_OM1=NUM_ASH+NUM_DUST+NUM_SALT+1; P_OM2=P_OM1+1; P_OM3=P_OM2+1; P_OM4=P_OM3+1
         IF(EMI_SOA_DENT.GT.1)THEN
          P_OM5=P_OM4+1; P_OM6=P_OM5+1; P_OM7=P_OM6+1
         ENDIF
         IF(EMI_SOA_DENT.GT.2)THEN
          P_OM8=P_OM7+1
         ENDIF
       ELSE
         P_OM1=0;P_OM2=0;P_OM3=0;P_OM4=0;P_OM5=0;P_OM6=0;P_OM7=0;P_OM8=0
       ENDIF
!
       IF(NUM_BC>0)THEN
         P_BC1=NUM_ASH+NUM_DUST+NUM_SALT+NUM_OM+1;P_BC2=P_BC1+1
       ELSE
         P_BC1=0;P_BC2=0
       ENDIF
!
       IF(NUM_SO4>0)THEN
         P_SO4=NUM_ASH+NUM_DUST+NUM_SALT+NUM_OM+NUM_BC+1
       ELSE
         P_SO4=0
       ENDIF
!
       IF(NUM_NO3>0)THEN
         P_NO3b1=NUM_ASH+NUM_DUST+NUM_SALT+NUM_OM+NUM_BC+NUM_SO4+1
         P_NO3b2=P_NO3b1+1
         P_NO3b3=P_NO3b2+1
       ELSE
         P_NO3b1=0;P_NO3b2=0;P_NO3b3=0
       ENDIF
!
       IF(NUM_NH4>0)THEN
         P_NH4=NUM_ASH+NUM_DUST+NUM_SALT+NUM_OM+NUM_BC+NUM_SO4+NUM_NO3+1
       ELSE
         P_NH4=0
       ENDIF
!
       IF(NUM_UNSPC>0)THEN
         P_UNSPCF=NUM_ASH+NUM_DUST+NUM_SALT+NUM_OM+NUM_BC+NUM_SO4+NUM_NO3+NUM_NH4+1
         P_UNSPCC=P_UNSPCF+1
       ELSE
         P_UNSPCF=0;P_UNSPCC=0
       ENDIF
!
       NUM_AERO_LOCAL=NUM_ASH+NUM_DUST+NUM_SALT+NUM_OM+NUM_BC          &
                     +NUM_SO4+NUM_NO3+NUM_NH4+NUM_UNSPC
        IF(MYPE==0)THEN
   
          WRITE(0,*) '*************************************'
          WRITE(0,*) '       CHEMISTRY OPTIONS             '
          WRITE(0,*) '   CHEM_MECH = ',MECH
          WRITE(0,*) '   CHEM_IC   = ',INIT
          WRITE(0,*) '   STE       = ',STE
          WRITE(0,*) '   LEMILINE  = ',ONLINE_BIOG
          WRITE(0,*) '   LCNST     = ',CNST
          WRITE(0,*) '   LBIOMOD   = ',BIO_MOD
          WRITE(0,*) '   LCONVEMI  = ',CONVEMI
          WRITE(0,*) '   LNEWWEMISS= ',NEW_EMISS
          WRITE(0,*) '   LNUMLAYEMIS=',LNUM_LAY_EMISS
          WRITE(0,*) '   NUMEMIVERT =',LNUM_EMISS_VERT
          WRITE(0,*) '*************************************'

        ENDIF

      IF(MECH==1) THEN !*** CBM-IV CHEMICAL MECHANISM
!INITIALIZATION OF INDEXES
                      P_O1D  = 1        
                      P_H2O2 = 2      
                      P_PAN  = 3     
                      P_CRO  = 4      
                      P_TOL  = 5      
                      P_N2O5 = 6      
                      P_XYL  = 7      
                      P_XO2N = 8      
                      P_HONO = 9      
                      P_PNA  = 10  
                      P_TO2  = 11    
                      P_HNO3 = 12     
                      P_ROR  = 13    
                      P_CRES = 14     
                      P_MGLY = 15     
                      P_CO   = 16   
                      P_ETH  = 17   
                      P_XO2  = 18   
                      P_OPEN = 19   
                      P_PAR  = 20   
                      P_HCHO = 21   
                      P_ISOP = 22   
                      P_OLE  = 23   
                      P_ALD2 = 24   
                      P_O3   = 25   
                      P_NO2  = 26   
                      P_OH   = 27   
                      P_HO2  = 28   
                      P_O    = 29   
                      P_NO3  = 30   
                      P_NO   = 31   
                      P_C2O3 = 32

!*******************************************************
! INITIALIZATION OF MAPPING ARRAYS FOR CLOUD CHEMISTRY *
!*******************************************************
        N_GC_SPC = 32
        N_GC_SPCD = N_GC_SPC + 1

        GC_SPC(  1)= 'O1D             '
        GC_SPC(  2)= 'H2O2            '
        GC_SPC(  3)= 'PAN             '
        GC_SPC(  4)= 'CRO             '
        GC_SPC(  5)= 'TOL             '
        GC_SPC(  6)= 'N2O5            '
        GC_SPC(  7)= 'XYL             '
        GC_SPC(  8)= 'XO2N            '
        GC_SPC(  9)= 'HONO            '
        GC_SPC( 10)= 'PNA             '
        GC_SPC( 11)= 'TO2             '
        GC_SPC( 12)= 'HNO3            '
        GC_SPC( 13)= 'ROR             '
        GC_SPC( 14)= 'CRES            '
        GC_SPC( 15)= 'MGLY            '
        GC_SPC( 16)= 'CO              '
        GC_SPC( 17)= 'ETH             '
        GC_SPC( 18)= 'XO2             '
        GC_SPC( 19)= 'OPEN            '
        GC_SPC( 20)= 'PAR             '
        GC_SPC( 21)= 'FORM            '
        GC_SPC( 22)= 'ISOP            '
        GC_SPC( 23)= 'OLE             '
        GC_SPC( 24)= 'ALD2            '
        GC_SPC( 25)= 'O3              '
        GC_SPC( 26)= 'NO2             '
        GC_SPC( 27)= 'OH              '
        GC_SPC( 28)= 'HO2             '
        GC_SPC( 29)= 'O               '
        GC_SPC( 30)= 'NO3             '
        GC_SPC( 31)= 'NO              '
        GC_SPC( 32)= 'C2O3            '

        GC_MOLWT(  1) = 16.0 
        GC_MOLWT(  2) = 34.0 
        GC_MOLWT(  3) = 121.0 
        GC_MOLWT(  4) = 139.0 
        GC_MOLWT(  5) = 92.0 
        GC_MOLWT(  6) = 108.0 
        GC_MOLWT(  7) = 106.0 
        GC_MOLWT(  8) = 1.0 
        GC_MOLWT(  9) = 47.0 
        GC_MOLWT( 10) = 79.0 
        GC_MOLWT( 11) = 109.0 
        GC_MOLWT( 12) = 63.0 
        GC_MOLWT( 13) = 31.0 
        GC_MOLWT( 14) = 108.0 
        GC_MOLWT( 15) = 72.0 
        GC_MOLWT( 16) = 28.0 
        GC_MOLWT( 17) = 28.0 
        GC_MOLWT( 18) = 1.0 
        GC_MOLWT( 19) = 84.0 
        GC_MOLWT( 20) = 14.0 
        GC_MOLWT( 21) = 30.0 
        GC_MOLWT( 22) = 68.0 
        GC_MOLWT( 23) = 27.0 
        GC_MOLWT( 24) = 44.0 
        GC_MOLWT( 25) = 48.0 
        GC_MOLWT( 26) = 46.0 
        GC_MOLWT( 27) = 17.0 
        GC_MOLWT( 28) = 33.0 
        GC_MOLWT( 29) = 16.0 
        GC_MOLWT( 30) = 62.0 
        GC_MOLWT( 31) = 30.0 
        GC_MOLWT( 32) = 75.0 

        N_GC_SCAV = 21
        N_GC_SCAVD = N_GC_SCAV

        GC_SCAV(  1) =     'NO2             '
        GC_SCAV_FAC(  1) =      1.0 
        GC_SCAV(  2) =     'NO              '       
        GC_SCAV_FAC(  2) =      1.0 
        GC_SCAV(  3) =     'O3              '
        GC_SCAV_FAC(  3) =      1.0 
        GC_SCAV(  4) =     'NO3             '
        GC_SCAV_FAC(  4) =      1.0 
        GC_SCAV(  5) =     'N2O5            '
        GC_SCAV_FAC(  5) =      1.0 
        GC_SCAV(  6) =     'HNO3            '
        GC_SCAV_FAC(  6) =      1.0 
        GC_SCAV(  7) =     'HNO2            '
        GC_SCAV_FAC(  7) =      1.0 
        GC_SCAV(  8) =     'HNO4            '
        GC_SCAV_FAC(  8) =      1.0 
        GC_SCAV(  9) =     'H2O2            '
        GC_SCAV_FAC(  9) =      1.0 
        GC_SCAV( 10) =     'CO              '
        GC_SCAV_FAC( 10) =      1.0 
        GC_SCAV( 11) =     'FORMALDEHYDE    '
        GC_SCAV_FAC( 11) =      1.0 
        GC_SCAV( 12) =     'ACETALDEHYDE    '
        GC_SCAV_FAC( 12) =      1.0 
        GC_SCAV( 13) =     'PAN             '
        GC_SCAV_FAC( 13) =      1.0 
        GC_SCAV( 14) =     'ETHANE          '
        GC_SCAV_FAC( 14) =      1.0 
        GC_SCAV( 15) =     'ETHENE          '
        GC_SCAV_FAC( 15) =      1.0 
        GC_SCAV( 16) =     'ETHENE          '
        GC_SCAV_FAC( 16) =      1.0 
        GC_SCAV( 17) =     'TOLUENE         '
        GC_SCAV_FAC( 17) =      1.0 
        GC_SCAV( 18) =     '2-CRESOL        '
        GC_SCAV_FAC( 18) =      1.0 
        GC_SCAV( 19) =     'O-XYLENE        '
        GC_SCAV_FAC( 19) =      1.0 
        GC_SCAV( 20) =     'METHYL_GLYOXAL  '
        GC_SCAV_FAC( 20) =      1.0 
        GC_SCAV( 21) =     'ISOPRENE        '
        GC_SCAV_FAC( 21) =      1.0 

        GC_SCAV_MAP(  1) = 26 
        GC_SCAV_MAP(  2) = 31
        GC_SCAV_MAP(  3) = 2 
        GC_SCAV_MAP(  4) = 30 
        GC_SCAV_MAP(  5) =  6 
        GC_SCAV_MAP(  6) = 12 
        GC_SCAV_MAP(  7) =  9 
        GC_SCAV_MAP(  8) = 10 
        GC_SCAV_MAP(  9) =  2 
        GC_SCAV_MAP( 10) = 16 
        GC_SCAV_MAP( 11) = 21 
        GC_SCAV_MAP( 12) = 24 
        GC_SCAV_MAP( 13) =  3 
        GC_SCAV_MAP( 14) = 20 
        GC_SCAV_MAP( 15) = 23 
        GC_SCAV_MAP( 16) = 17 
        GC_SCAV_MAP( 17) =  5 
        GC_SCAV_MAP( 18) = 14 
        GC_SCAV_MAP( 19) =  7 
        GC_SCAV_MAP( 20) = 15 
        GC_SCAV_MAP( 21) = 22 

        N_GC_WDEP = 12
        N_GC_WDEPD = N_GC_WDEP

        GC_WDEP(  1)= 'NO2             ' 
        GC_WDEP(  2)= 'NO              ' 
        GC_WDEP(  3)= 'O3              ' 
        GC_WDEP(  4)= 'NO3             ' 
        GC_WDEP(  5)= 'N2O5            ' 
        GC_WDEP(  6)= 'HNO3            ' 
        GC_WDEP(  7)= 'HONO            ' 
        GC_WDEP(  8)= 'PNA             ' 
        GC_WDEP(  9)= 'H2O2            ' 
        GC_WDEP( 10)= 'FORM            ' 
        GC_WDEP( 11)= 'ALD2            '  
        GC_WDEP( 12)= 'PAN             '   

        GC_WDEP_MAP(  1) = 26 
        GC_WDEP_MAP(  2) = 31 
        GC_WDEP_MAP(  3) = 25 
        GC_WDEP_MAP(  4) = 30 
        GC_WDEP_MAP(  5) =  6 
        GC_WDEP_MAP(  6) = 12 
        GC_WDEP_MAP(  7) =  9 
        GC_WDEP_MAP(  8) = 10 
        GC_WDEP_MAP(  9) =  2 
        GC_WDEP_MAP( 10) = 21 
        GC_WDEP_MAP( 11) = 24 
        GC_WDEP_MAP( 12) =  3 
!-----------------------------------------------------------------
!*** INITIALIZATION AND ALLOCATION OF PHOTOLYSIS MATRIXS & INDEXES
!-----------------------------------------------------------------
!   IF(LPHOT2) THEN
   nphoto_fastj = 14 !   from module_phot_fastj
   jppjm = 14         
!        NS = 15          ! , module_fastj_data

   lfastj_no2   = 1 
   lfastj_o3a   = 2 
   lfastj_o3b   = 3 
   lfastj_h2o2  = 4 
   lfastj_hchoa = 5 
   lfastj_hchob = 6 
   lfastj_ch3ooh= 7 
   lfastj_no3x  = 8 
   lfastj_no3l  = 9 
   lfastj_hono  = 10 
   lfastj_n2o5  = 11 
   lfastj_hno3  = 12 
   lfastj_hno4  = 13 


   IF(.NOT.ALLOCATED(ph_o2))THEN
   allocate(ph_o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_o31d(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_o33p(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no3o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no3o(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno3(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno4(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_h2o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch2or(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch2om(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3cho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coch3(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coc2h5(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcocho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3cocho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcochest(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3o2h(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coo2h(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3ono2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcochob(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_n2o5(ITS:ITE,1:LMV,JTS:JTE))
   ENDIF

   ph_o2=0.
   ph_o31d=0.
   ph_o33p=0.
   ph_no2=0.
   ph_no3o2=0.
   ph_no3o=0.
   ph_hno2=0.
   ph_hno3=0.
   ph_hno4=0.
   ph_h2o2=0.
   ph_ch2or=0.
   ph_ch2om=0.
   ph_ch3cho=0.
   ph_ch3coch3=0.
   ph_ch3coc2h5=0.
   ph_hcocho=0.
   ph_ch3cocho=0.
   ph_hcochest=0.
   ph_ch3o2h=0.
   ph_ch3coo2h=0.
   ph_ch3ono2=0.
   ph_hcochob=0.
   ph_n2o5=0.

      ELSEIF(MECH==2 .OR. MECH==22) THEN !*** CBM-05 CHEMICAL MECHANISM
!INITIALIZATION OF INDEXES
                      P_NO2=1
                      P_NO=2
                      P_O3=3
                      P_NO3=4
                      P_N2O5=5
                      P_HNO3=6
                      P_HONO=7
                      P_PNA=8
                      P_H2O2=9
                      P_NTR=10
                      P_ROOH=11
                      P_FORM=12
                      P_ALD2=13
                      P_ALDX=14
                      P_PAR=15
                      P_CO=16
                      P_MEPX=17
                      P_MEOH=18
                      P_FACD=19
                      P_PAN=20
                      P_PACD=21
                      P_AACD=22
                      P_PANX=23
                      P_OLE=24
                      P_ETH=25
                      P_IOLE=26
                      P_TOL=27
                      P_CRES=28
                      P_OPEN=29
                      P_MGLY=30
                      P_XYL=31
                      P_ISOP=32
                      P_ISPD=33
                      P_TERP=34
                      P_SO2=35
                      P_SULF=36
                      P_ETOH=37
                      P_ETHA=38
!NON-ADVECTED SPECIES
                      P_O=39
                      P_O1D=40
                      P_OH=41
                      P_HO2=42
                      P_XO2=43
                      P_XO2N=44
                      P_MEO2=45
                      P_HCO3=46
                      P_C2O3=47
                      P_CXO3=48
                      P_ROR=49
                      P_TO2=50
                      P_CRO=51
                      P_CH4=52
                      P_NO2E=53

!*******************************************************
! INITIALIZATION OF MAPPING ARRAYS FOR CLOUD CHEMISTRY *
!*******************************************************
        N_GC_SPC = 53
        N_GC_SPCD = N_GC_SPC + 1

      GC_SPC( 1) = 'NO2'
      GC_SPC( 2) = 'NO'
      GC_SPC( 3) = 'O3'
      GC_SPC( 4) = 'NO3'
      GC_SPC( 5) = 'N2O5'
      GC_SPC( 6) = 'HNO3'
      GC_SPC( 7) = 'HNO2' !'HONO'
      GC_SPC( 8) = 'HNO4' !'PNA'
      GC_SPC( 9) = 'H2O2'
      GC_SPC(10) = 'NTR'
      GC_SPC(11) = 'ROOH'
      GC_SPC(12) = 'FORMALDEHYDE' !'FORM'
      GC_SPC(13) = 'ACETALDEHYDE' !'ALD2'
      GC_SPC(14) = 'GENERIC_ALDEHYDE' !'ALDX'
      GC_SPC(15) = 'ETHANE' !'PAR'
      GC_SPC(16) = 'CO'
      GC_SPC(17) = 'METHYLHYDROPEROX' !'MEPX'
      GC_SPC(18) = 'METHANOL' !'MEOH'
      GC_SPC(19) = 'FORMIC_ACID' !'FACD'
      GC_SPC(20) = 'PAN'
      GC_SPC(21) = 'PEROXYACETIC_ACI' !'PACD'
      GC_SPC(22) = 'ACETIC_ACID' !'AACD'
      GC_SPC(23) = 'PPN' !'PANX'
      GC_SPC(24) = 'ETHENE' !'OLE'
      GC_SPC(25) = 'ETHENE' !'ETH'
      GC_SPC(26) = 'ETHENE' !'IOLE'
      GC_SPC(27) = 'TOLUENE' !'TOL'
      GC_SPC(28) = '2-CRESOL' !'CRES'
      GC_SPC(29) = 'OPEN'
      GC_SPC(30) = 'METHYL_GLYOXAL' !'MGLY'
      GC_SPC(31) = 'O-XYLENE' !'XYL'
      GC_SPC(32) = 'ISOPRENE' !'ISOP'
      GC_SPC(33) = 'ISPD'
      GC_SPC(34) = 'PINENE' !'TERP'
      GC_SPC(35) = 'SO2'
      GC_SPC(36) = 'H2SO4' !'SULF'
      GC_SPC(37) = 'ETHANOL' !'ETOH'
      GC_SPC(38) = 'ETHANE' !'ETHA'
!NON-ADVECTED SPECIES
      GC_SPC(39) = 'O'
      GC_SPC(40) = 'O1D'
      GC_SPC(41) = 'OH'
      GC_SPC(42) = 'HO2'
      GC_SPC(43) = 'XO2'
      GC_SPC(44) = 'XO2N'
      GC_SPC(45) = 'MEO2'
      GC_SPC(46) = 'HCO3'
      GC_SPC(47) = 'C2O3'
      GC_SPC(48) = 'CXO3'
      GC_SPC(49) = 'ROR'
      GC_SPC(50) = 'TO2'
      GC_SPC(51) = 'CRO'
      GC_SPC(52) = 'CH4'
      GC_SPC(53) = 'NO2E'

      GC_MOLWT( 1) = 46.0 
      GC_MOLWT( 2) = 30.0 
      GC_MOLWT( 3) = 48.0
      GC_MOLWT( 4) = 62.0 
      GC_MOLWT( 5) = 108.0 
      GC_MOLWT( 6) = 63.0  
      GC_MOLWT( 7) = 47.0  
      GC_MOLWT( 8) = 79.0 
      GC_MOLWT( 9) = 34.0  
      GC_MOLWT(10) = 130.0
      GC_MOLWT(11) = 62.0  
      GC_MOLWT(12) = 30.0  
      GC_MOLWT(13) = 44.0  
      GC_MOLWT(14) = 44.0  
      GC_MOLWT(15) = 14.0 
      GC_MOLWT(16) = 28.0
      GC_MOLWT(17) = 48.0  
      GC_MOLWT(18) = 32.0  
      GC_MOLWT(19) = 46.0  
      GC_MOLWT(20) = 121.0
      GC_MOLWT(21) = 76.0  
      GC_MOLWT(22) = 60.0  
      GC_MOLWT(23) = 121.0 
      GC_MOLWT(24) = 27.0 
      GC_MOLWT(25) = 28.0 
      GC_MOLWT(26) = 48.0  
      GC_MOLWT(27) = 92.0 
      GC_MOLWT(28) = 108.0 
      GC_MOLWT(29) = 84.0  
      GC_MOLWT(30) = 72.0  
      GC_MOLWT(31) = 106.0 
      GC_MOLWT(32) = 68.0  
      GC_MOLWT(33) = 70.0  
      GC_MOLWT(34) = 136.0 
      GC_MOLWT(35) = 64.0 
      GC_MOLWT(36) = 98.0  
      GC_MOLWT(37) = 46.0  
      GC_MOLWT(38) = 30.0  
!NON-ADVECTED SPECIES
      GC_MOLWT(39) = 16.0 
      GC_MOLWT(40) = 16.0 
      GC_MOLWT(41) = 17.0 
      GC_MOLWT(42) = 33.0 
      GC_MOLWT(43) = 1.0  
      GC_MOLWT(44) = 1.0   
      GC_MOLWT(45) = 47.0  
      GC_MOLWT(46) = 63.0  
      GC_MOLWT(47) = 75.0  
      GC_MOLWT(48) = 75.0  
      GC_MOLWT(49) = 31.0 
      GC_MOLWT(50) = 109.0
      GC_MOLWT(51) = 139.0
      GC_MOLWT(52) = 18.0 
      GC_MOLWT(53) = 46.0

        N_GC_SCAV = 36
        N_GC_SCAVD = N_GC_SCAV

        GC_SCAV( 1) = 'NO2'
        GC_SCAV_MAP( 1) = 1
        GC_SCAV_FAC( 1) = 1.0 
        GC_SCAV( 2) = 'NO' 
        GC_SCAV_MAP( 2) = 2
        GC_SCAV_FAC( 2) = 1.0 
        GC_SCAV( 3) = 'O3'
        GC_SCAV_MAP( 3) = 3
        GC_SCAV_FAC( 3) = 1.0 
        GC_SCAV( 4) = 'NO3'
        GC_SCAV_MAP( 4) = 4
        GC_SCAV_FAC( 4) = 1.0 
        GC_SCAV( 5) = 'N2O5'
        GC_SCAV_MAP( 5) = 5
        GC_SCAV_FAC( 5) = 1.0 
        GC_SCAV( 6) = 'HNO3'
        GC_SCAV_MAP( 6) = 6 
        GC_SCAV_FAC( 6) = 1.0 
        GC_SCAV( 7) = 'HNO2'
        GC_SCAV_MAP( 7) = 7
        GC_SCAV_FAC( 7) = 1.0 
        GC_SCAV( 8) = 'HNO4'
        GC_SCAV_MAP( 8) = 8 
        GC_SCAV_FAC( 8) = 1.0 
        GC_SCAV( 9) = 'H2O2'
        GC_SCAV_MAP( 9) = 9
        GC_SCAV_FAC( 9) = 1.0 
        GC_SCAV( 10) = 'MPAN' !NTR
        GC_SCAV_MAP( 10) = 10
        GC_SCAV_FAC( 10) = 1.0 
        GC_SCAV( 11) = 'METHYLHYDROPEROX' !ROOH'
        GC_SCAV_MAP( 11) = 11 
        GC_SCAV_FAC( 11) = 1.0 
        GC_SCAV( 12) = 'FORMALDEHYDE'
        GC_SCAV_MAP( 12) = 12
        GC_SCAV_FAC( 12) = 1.0 
        GC_SCAV( 13) = 'ACETALDEHYDE'
        GC_SCAV_MAP( 13) = 13 
        GC_SCAV_FAC( 13) = 1.0 
        GC_SCAV( 14) = 'GENERIC_ALDEHYDE'
        GC_SCAV_MAP( 14) = 14
        GC_SCAV_FAC( 14) = 1.0 
        GC_SCAV( 15) = 'ETHANE'
        GC_SCAV_MAP( 15) = 15
        GC_SCAV_FAC( 15) = 1.0 
        GC_SCAV( 16) = 'CO'
        GC_SCAV_MAP( 16) = 16
        GC_SCAV_FAC( 16) = 1.0 
        GC_SCAV( 17) = 'METHYLHYDROPEROX'
        GC_SCAV_MAP( 17) = 17 
        GC_SCAV_FAC( 17) = 1.0 
        GC_SCAV( 18) = 'METHANOL'
        GC_SCAV_MAP( 18) = 18 
        GC_SCAV_FAC( 18) = 1.0 
        GC_SCAV( 19) = 'FORMIC_ACID'
        GC_SCAV_MAP( 19) = 19 
        GC_SCAV_FAC( 19) = 1.0 
        GC_SCAV( 20) = 'PAN'
        GC_SCAV_MAP( 20) = 20 
        GC_SCAV_FAC( 20) = 1.0 
        GC_SCAV( 21) = 'PEROXYACETIC_ACI'
        GC_SCAV_MAP( 21) = 21
        GC_SCAV_FAC( 21) = 1.0 
        GC_SCAV( 22) = 'ACETIC_ACID'
        GC_SCAV_MAP( 22) = 22 
        GC_SCAV_FAC( 22) = 1.0 
        GC_SCAV( 23) = 'PPN'
        GC_SCAV_MAP( 23) = 23 
        GC_SCAV_FAC( 23) = 1.0 
        GC_SCAV( 24) = 'ETHENE' 
        GC_SCAV_MAP( 24) = 24
        GC_SCAV_FAC( 24) = 1.0 
        GC_SCAV( 25) = 'ETHENE'
        GC_SCAV_MAP( 25) = 25
        GC_SCAV_FAC( 25) = 1.0 
        GC_SCAV( 26) = 'ETHENE'
        GC_SCAV_MAP( 26) = 26 
        GC_SCAV_FAC( 26) = 1.0 
        GC_SCAV( 27) = 'TOLUENE'
        GC_SCAV_MAP( 27) = 27 
        GC_SCAV_FAC( 27) = 1.0 
        GC_SCAV( 28) = '2-CRESOL'
        GC_SCAV_MAP( 28) = 28
        GC_SCAV_FAC( 28) = 1.0 
        GC_SCAV( 29) = 'METHYL_GLYOXAL'
        GC_SCAV_MAP( 29) = 30 
        GC_SCAV_FAC( 29) = 1.0 
        GC_SCAV( 30) = 'O-XYLENE'
        GC_SCAV_MAP( 30) = 31
        GC_SCAV_FAC( 30) = 1.0 
        GC_SCAV( 31) = 'ISOPRENE'
        GC_SCAV_MAP( 31) = 32 
        GC_SCAV_FAC( 31) = 1.0 
        GC_SCAV( 32) = 'PINENE'
        GC_SCAV_MAP( 32) = 34 
        GC_SCAV_FAC( 32) = 1.0 
        GC_SCAV( 33) = 'SO2'
        GC_SCAV_MAP( 33) = 35 
        GC_SCAV_FAC( 33) = 1.0 
        GC_SCAV( 34) = 'H2SO4'
        GC_SCAV_MAP( 34) = 36
        GC_SCAV_FAC( 34) = 1.0 
        GC_SCAV( 35) = 'ETHANOL'
        GC_SCAV_MAP( 35) = 37 
        GC_SCAV_FAC( 35) = 1.0 
        GC_SCAV( 36) = 'ETHANE'
        GC_SCAV_MAP( 36) = 38
        GC_SCAV_FAC( 36) = 1.0 

        N_GC_WDEP = 23
        N_GC_WDEPD = N_GC_WDEP

        GC_WDEP( 1) = 'NO2'
        GC_WDEP_MAP( 1) = 1
        GC_WDEP( 2) = 'NO'
        GC_WDEP_MAP( 2) = 2
        GC_WDEP( 3) = 'O3'
        GC_WDEP_MAP( 3) = 3
        GC_WDEP( 4) = 'NO3'
        GC_WDEP_MAP( 4) = 4
        GC_WDEP( 5) = 'N2O5'
        GC_WDEP_MAP( 5) = 5
        GC_WDEP( 6) = 'HNO3'
        GC_WDEP_MAP( 6) = 6
        GC_WDEP( 7) = 'HONO'
        GC_WDEP_MAP( 7) = 7
        GC_WDEP( 8) = 'H2O2'
        GC_WDEP_MAP( 8) = 9
        GC_WDEP( 9) = 'NTR'
        GC_WDEP_MAP( 9) = 10
        GC_WDEP( 10) = 'ROOH'
        GC_WDEP_MAP( 10) = 11
        GC_WDEP( 11) = 'FORM'
        GC_WDEP_MAP( 11) = 12
        GC_WDEP( 12) = 'ALD2'
        GC_WDEP_MAP( 12) = 13
        GC_WDEP( 13) = 'ALDX'
        GC_WDEP_MAP( 13) = 14
        GC_WDEP( 14) = 'CO'
        GC_WDEP_MAP( 14) = 16
        GC_WDEP( 15) = 'MEPX'
        GC_WDEP_MAP( 15) = 17
        GC_WDEP( 16) = 'MEOH'
        GC_WDEP_MAP( 16) = 18
        GC_WDEP( 17) = 'FACD'
        GC_WDEP_MAP( 17) = 19
        GC_WDEP( 18) = 'PAN'
        GC_WDEP_MAP( 18) = 20
        GC_WDEP( 19) = 'PACD'
        GC_WDEP_MAP( 19) = 21
        GC_WDEP( 20) = 'AACD'
        GC_WDEP_MAP( 20) = 22
        GC_WDEP( 21) = 'PANX'
        GC_WDEP_MAP( 21) = 23
        GC_WDEP( 22) = 'SO2'
        GC_WDEP_MAP( 22) = 35
        GC_WDEP( 23) = 'SULF'
        GC_WDEP_MAP( 23) = 36
!*******************************************************
! INITIALIZATION OF MAPPING ARRAYS FOR CHEM BC         *
!*******************************************************
! CHEM BC
        N_GC_BCCHEM = NUM_BC_CHEM 

        GC_BCCHEM( 1) = 'NO2'
        GC_BCCHEM_MAP( 1) = 1 + NUM_AERO_LOCAL
        GC_BCCHEM( 2) = 'NO'
        GC_BCCHEM_MAP( 2) = 2 + NUM_AERO_LOCAL
        GC_BCCHEM( 3) = 'O3'
        GC_BCCHEM_MAP( 3) = 3 + NUM_AERO_LOCAL
        GC_BCCHEM( 4) = 'HNO3'
        GC_BCCHEM_MAP( 4) = 6 + NUM_AERO_LOCAL
        GC_BCCHEM( 5) = 'H2O2'
        GC_BCCHEM_MAP( 5) = 9 + NUM_AERO_LOCAL
        GC_BCCHEM( 6) = 'FORM'
        GC_BCCHEM_MAP( 6) = 12 + NUM_AERO_LOCAL
        GC_BCCHEM( 7) = 'CO'
        GC_BCCHEM_MAP( 7) = 16 + NUM_AERO_LOCAL
        GC_BCCHEM( 8) = 'PAN'
        GC_BCCHEM_MAP( 8) = 20 + NUM_AERO_LOCAL
!
!-----------------------------------------------------------------
!*** INITIALIZATION AND ALLOCATION OF PHOTOLYSIS MATRIXS & INDEXES
!-----------------------------------------------------------------
!   IF(LPHOT2) THEN
   nphoto_fastj = 22 !20 !   from module_phot_fastj
   jppjm = 22 !20
!        NS = 22 !21          ! , module_fastj_data

   lfastj_no2   = 1
   lfastj_o3a   = 2
   lfastj_o3b   = 3
   lfastj_h2o2  = 4
   lfastj_hchoa = 5
   lfastj_hchob = 6
   lfastj_ch3ooh= 7
   lfastj_no3x  = 8
   lfastj_no3l  = 9
   lfastj_hono  = 10
   lfastj_n2o5  = 11
   lfastj_hno3  = 12
   lfastj_hno4  = 13
   lfastj_ntr   = 14
   lfastj_ald2  = 15
   lfastj_pan   = 16
   lfastj_aldx  = 17
   lfastj_mgly  = 18
   lfastj_ispd  = 19
   lfastj_pacd  = 20
   lfastj_no2e  = 21

   IF(.NOT.ALLOCATED(ph_o2))THEN
   allocate(ph_o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_o31d(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_o33p(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no3o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no3o(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno3(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno4(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_h2o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch2or(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch2om(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3cho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coch3(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coc2h5(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcocho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3cocho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcochest(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3o2h(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coo2h(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3ono2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcochob(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_n2o5(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ntr(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ald2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_pan(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_aldx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_mgly(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ispd(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_mepx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_pacd(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_open(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_panx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no2e(ITS:ITE,1:LMV,JTS:JTE))
   ENDIF

   ph_o2=0.
   ph_o31d=0.
   ph_o33p=0.
   ph_no2=0.
   ph_no3o2=0.
   ph_no3o=0.
   ph_hno2=0.
   ph_hno3=0.
   ph_hno4=0.
   ph_h2o2=0.
   ph_ch2or=0.
   ph_ch2om=0.
   ph_ch3cho=0.
   ph_ch3coch3=0.
   ph_ch3coc2h5=0.
   ph_hcocho=0.
   ph_ch3cocho=0.
   ph_hcochest=0.
   ph_ch3o2h=0.
   ph_ch3coo2h=0.
   ph_ch3ono2=0.
   ph_hcochob=0.
   ph_n2o5=0.
   ph_ntr=0.
   ph_ald2=0.
   ph_pan=0.
   ph_aldx=0.
   ph_mgly=0.
   ph_ispd=0.
   ph_mepx=0.
   ph_pacd=0.
   ph_open=0.
   ph_panx=0.
   ph_no2e=0.

    ELSEIF(MECH==3) THEN !*** CBM-05Ext FOR AERO_UCI CHEMICAL MECHANISM - NH3 ADDED
!INITIALIZATION OF INDEXES
                      P_NO2=1
                      P_NO=2
                      P_O3=3
                      P_NO3=4
                      P_N2O5=5
                      P_HNO3=6
                      P_HONO=7
                      P_PNA=8
                      P_H2O2=9
                      P_NTR=10
                      P_ROOH=11
                      P_FORM=12
                      P_ALD2=13
                      P_ALDX=14
                      P_PAR=15
                      P_CO=16
                      P_MEPX=17
                      P_MEOH=18
                      P_FACD=19
                      P_PAN=20
                      P_PACD=21
                      P_AACD=22
                      P_PANX=23
                      P_OLE=24
                      P_ETH=25
                      P_IOLE=26
                      P_TOL=27
                      P_CRES=28
                      P_OPEN=29
                      P_MGLY=30
                      P_XYL=31
                      P_ISOP=32
                      P_ISPD=33
                      P_TERP=34
                      P_SO2=35
                      P_SULF=36
                      P_ETOH=37
                      P_ETHA=38
                      P_CL2=39
                      P_HOCL=40
                      P_FMCL=41
                      P_HCL=42
                      P_BENZENE=43
                      P_SESQ=44
!NON-ADVECTED SPECIES
                      P_O=45
                      P_O1D=46
                      P_OH=47
                      P_HO2=48
                      P_XO2=49
                      P_XO2N=50
                      P_MEO2=51
                      P_HCO3=52
                      P_C2O3=53
                      P_CXO3=54
                      P_ROR=55
                      P_TO2=56
                      P_TOLRO2=57
                      P_CRO=58
                      P_XYLRO2=59
                      P_ISOPRXN=60
                      P_TRPRXN=61
                      P_SULRXN=62
                      P_CL=63
                      P_CLO=64
                      P_TOLNRXN=65
                      P_TOLHRXN=66
                      P_XYLNRXN=67
                      P_XYLHRXN=68
                      P_BENZRO2=69
                      P_BNZNRXN=70
                      P_BNZHRXN=71
                      P_SESQRXN=72
                      P_NH3=73
!
!*******************************************************
! INITIALIZATION OF MAPPING ARRAYS FOR CLOUD CHEMISTRY *
!*******************************************************
        N_GC_SPC = 72 !+1 !NH3 72
        N_GC_SPC_CHEM=72
        N_GC_SPCD = N_GC_SPC + 1
      
      GC_SPC( 1) = 'NO2'
      GC_MOLWT( 1)=46.0
      GC_SPC( 2) = 'NO'
      GC_MOLWT( 2)=30.0
      GC_SPC( 3) = 'O3'
      GC_MOLWT( 3)=48.0
      GC_SPC( 4) = 'NO3'
      GC_MOLWT( 4)=62.0
      GC_SPC( 5) = 'N2O5'
      GC_MOLWT( 5)=108.0
      GC_SPC( 6) = 'HNO3'
      GC_MOLWT( 6)=63.0
      GC_SPC( 7) = 'HONO'
      GC_MOLWT( 7)=47.0
      GC_SPC( 8) = 'PNA'
      GC_MOLWT( 8)=79.0
      GC_SPC( 9) = 'H2O2'
      GC_MOLWT( 9)=34.0
      GC_SPC(10) = 'NTR'
      GC_MOLWT(10)=130.0
      GC_SPC(11) = 'ROOH'
      GC_MOLWT(11)=62.0
      GC_SPC(12) = 'FORM'
      GC_MOLWT(12)=30.0
      GC_SPC(13) = 'ALD2'
      GC_MOLWT(13)=44.0
      GC_SPC(14) = 'ALDX'
      GC_MOLWT(14)=44.0
      GC_SPC(15) = 'PAR'
      GC_MOLWT(15)=14.0
      GC_SPC(16) = 'CO'
      GC_MOLWT(16)=28.0
      GC_SPC(17) = 'MEPX'
      GC_MOLWT(17)=48.0
      GC_SPC(18) = 'MEOH'
      GC_MOLWT(18)=32.0
      GC_SPC(19) = 'FACD'
      GC_MOLWT(19)=46.0
      GC_SPC(20) = 'PAN'
      GC_MOLWT(20)=121.0
      GC_SPC(21) = 'PACD'
      GC_MOLWT(21)=76.0
      GC_SPC(22) = 'AACD'
      GC_MOLWT(22)=60.0
      GC_SPC(23) = 'PANX'
      GC_MOLWT(23)=121.0
      GC_SPC(24) = 'OLE'
      GC_MOLWT(24)=27.0
      GC_SPC(25) = 'ETH'
      GC_MOLWT(25)=28.0
      GC_SPC(26) = 'IOLE'
      GC_MOLWT(26)=48.0
      GC_SPC(27) = 'TOL'
      GC_MOLWT(27)=92.0
      GC_SPC(28) = 'CRES'
      GC_MOLWT(28)=108.0
      GC_SPC(29) = 'OPEN'
      GC_MOLWT(29)=84.0
      GC_SPC(30) = 'MGLY'
      GC_MOLWT(30)=72.0
      GC_SPC(31) = 'XYL'
      GC_MOLWT(31)=106.0
      GC_SPC(32) = 'ISOP'
      GC_MOLWT(32)=68.0
      GC_SPC(33) = 'ISPD'
      GC_MOLWT(33)=70.0
      GC_SPC(34) = 'TERP'
      GC_MOLWT(34)=136.0
      GC_SPC(35) = 'SO2'
      GC_MOLWT(35)=64.0
      GC_SPC(36) = 'SULF'
      GC_MOLWT(36)=98.0
      GC_SPC(37) = 'ETOH'
      GC_MOLWT(37)=46.0
      GC_SPC(38) = 'ETHA'
      GC_MOLWT(38)=30.0
      GC_SPC(39) = 'CL2'
      GC_MOLWT(39)=71.0
      GC_SPC(40) = 'HOCL'
      GC_MOLWT(40)=52.5
      GC_SPC(41) = 'FMCL'
      GC_MOLWT(41)=64.5
      GC_SPC(42) = 'HCL'
      GC_MOLWT(42)=36.5
      GC_SPC(43) = 'BENZENE'
      GC_MOLWT(43)=78.0
      GC_SPC(44) = 'SESQ'
      GC_MOLWT(44)=204.0
      GC_SPC(45) = 'O'
      GC_MOLWT(45)=16.0
      GC_SPC(46) = 'O1D'
      GC_MOLWT(46)=16.0
      GC_SPC(47) = 'OH'
      GC_MOLWT(47)=17.0
      GC_SPC(48) = 'HO2'
      GC_MOLWT(48)=33.0
      GC_SPC(49) = 'XO2'
      GC_MOLWT(49)=1.0
      GC_SPC(50) = 'XO2N'
      GC_MOLWT(50)=1.0
      GC_SPC(51) = 'MEO2'
      GC_MOLWT(51)=47.0
      GC_SPC(52) = 'HCO3'
      GC_MOLWT(52)=63.0
      GC_SPC(53) = 'C2O3'
      GC_MOLWT(53)=75.0
      GC_SPC(54) = 'CXO3'
      GC_MOLWT(54)=75.0
      GC_SPC(55) = 'ROR'
      GC_MOLWT(55)=31.0
      GC_SPC(56) = 'TO2'
      GC_MOLWT(56)=109.0
      GC_SPC(57) = 'TOLRO2'
      GC_MOLWT(57)=141.0
      GC_SPC(58) = 'CRO'
      GC_MOLWT(58)=139.0
      GC_SPC(59) = 'XYLRO2'
      GC_MOLWT(59)=155.0
      GC_SPC(60) = 'ISOPRXN'
      GC_MOLWT(60)=68.0
      GC_SPC(61) = 'TRPRXN'
      GC_MOLWT(61)=136.0
      GC_SPC(62) = 'SULRXN'
      GC_MOLWT(62)=98.0
      GC_SPC(63) = 'CL'
      GC_MOLWT(63)=35.5
      GC_SPC(64) = 'CLO'
      GC_MOLWT(64)=51.5
      GC_SPC(65) = 'TOLNRXN'
      GC_MOLWT(65)=141.0
      GC_SPC(66) = 'TOLHRXN'
      GC_MOLWT(66)=141.0
      GC_SPC(67) = 'XYLNRXN'
      GC_MOLWT(67)=155.0
      GC_SPC(68) = 'XYLHRXN'
      GC_MOLWT(68)=155.0
      GC_SPC(69) = 'BENZRO2'
      GC_MOLWT(69)=127.0
      GC_SPC(70) = 'BNZNRXN'
      GC_MOLWT(70)=127.0
      GC_SPC(71) = 'BNZHRXN'
      GC_MOLWT(71)=127.0
      GC_SPC(72) = 'SESQRXN'
      GC_MOLWT(72)=204.0
      GC_SPC(73) = 'NH3'
      GC_MOLWT(73)=17.0
      
!GC_SCAV_CBM05.EXT
        N_GC_SCAV = 42+1 !NH3 42
        N_GC_SCAVD = N_GC_SCAV
      
        GC_SCAV( 1) = 'NO2'
        GC_SCAV_MAP( 1) = 1
        GC_SCAV_FAC( 1) = 1.0
        GC_SCAV( 2) = 'NO'
        GC_SCAV_MAP( 2) = 2
        GC_SCAV_FAC( 2) = 1.0
        GC_SCAV( 3) = 'O3'
        GC_SCAV_MAP( 3) = 3
        GC_SCAV_FAC( 3) = 1.0
        GC_SCAV( 4) = 'NO3'
        GC_SCAV_MAP( 4) = 4
        GC_SCAV_FAC( 4) = 1.0
        GC_SCAV( 5) = 'N2O5'
        GC_SCAV_MAP( 5) = 5
        GC_SCAV_FAC( 5) = 1.0
        GC_SCAV( 6) = 'HNO3'
        GC_SCAV_MAP( 6) = 6
        GC_SCAV_FAC( 6) = 1.0
        GC_SCAV( 7) = 'HNO2'
        GC_SCAV_MAP( 7) = 7
        GC_SCAV_FAC( 7) = 1.0
        GC_SCAV( 8) = 'HNO4'
        GC_SCAV_MAP( 8) = 8
        GC_SCAV_FAC( 8) = 1.0
        GC_SCAV( 9) = 'H2O2'
        GC_SCAV_MAP( 9) = 9
        GC_SCAV_FAC( 9) = 1.0
        GC_SCAV(10) = 'MPAN'
        GC_SCAV_MAP(10) = 10
        GC_SCAV_FAC(10) = 1.0
        GC_SCAV(11) = 'METHYLHYDROPEROX'
        GC_SCAV_MAP(11) = 11
        GC_SCAV_FAC(11) = 1.0
        GC_SCAV(12) = 'FORMALDEHYDE'
        GC_SCAV_MAP(12) = 12
        GC_SCAV_FAC(12) = 1.0
        GC_SCAV(13) = 'ACETALDEHYDE'
        GC_SCAV_MAP(13) = 13
        GC_SCAV_FAC(13) = 1.0
        GC_SCAV(14) = 'GENERIC_ALDEHYDE'
        GC_SCAV_MAP(14) = 14
        GC_SCAV_FAC(14) = 1.0
        GC_SCAV(15) = 'ETHANE'
        GC_SCAV_MAP(15) = 15
        GC_SCAV_FAC(15) = 1.0
        GC_SCAV(16) = 'CO'
        GC_SCAV_MAP(16) = 16
        GC_SCAV_FAC(16) = 1.0
        GC_SCAV(17) = 'METHYLHYDROPEROX'
        GC_SCAV_MAP(17) = 17
        GC_SCAV_FAC(17) = 1.0
        GC_SCAV(18) = 'METHANOL'
        GC_SCAV_MAP(18) = 18
        GC_SCAV_FAC(18) = 1.0
        GC_SCAV(19) = 'FORMIC_ACID'
        GC_SCAV_MAP(19) = 19
        GC_SCAV_FAC(19) = 1.0
        GC_SCAV(20) = 'PAN'
        GC_SCAV_MAP(20) = 20
        GC_SCAV_FAC(20) = 1.0
        GC_SCAV(21) = 'PEROXYACETIC_ACI'
        GC_SCAV_MAP(21) = 21
        GC_SCAV_FAC(21) = 1.0
        GC_SCAV(22) = 'ACETIC_ACID'
        GC_SCAV_MAP(22) = 22
        GC_SCAV_FAC(22) = 1.0
        GC_SCAV(23) = 'PPN'
        GC_SCAV_MAP(23) = 23
        GC_SCAV_FAC(23) = 1.0
        GC_SCAV(24) = 'ETHENE'
        GC_SCAV_MAP(24) = 24
        GC_SCAV_FAC(24) = 1.0
        GC_SCAV(25) = 'ETHENE'
        GC_SCAV_MAP(25) = 25
        GC_SCAV_FAC(25) = 1.0
        GC_SCAV(26) = 'ETHENE'
        GC_SCAV_MAP(26) = 26
        GC_SCAV_FAC(26) = 1.0
        GC_SCAV(27) = 'TOLUENE'
        GC_SCAV_MAP(27) = 27
        GC_SCAV_FAC(27) = 1.0
        GC_SCAV(28) = '2-CRESOL'
        GC_SCAV_MAP(28) = 28
        GC_SCAV_FAC(28) = 1.0
        GC_SCAV(29) = 'METHYL_GLYOXAL'
        GC_SCAV_MAP(29) = 30
        GC_SCAV_FAC(29) = 1.0
        GC_SCAV(30) = 'O-XYLENE'
        GC_SCAV_MAP(30) = 31
        GC_SCAV_FAC(30) = 1.0
        GC_SCAV(31) = 'ISOPRENE'
        GC_SCAV_MAP(31) = 32
        GC_SCAV_FAC(31) = 1.0
        GC_SCAV(32) = 'PINENE'
        GC_SCAV_MAP(32) = 34
        GC_SCAV_FAC(32) = 1.0
        GC_SCAV(33) = 'SO2'
        GC_SCAV_MAP(33) = 35
        GC_SCAV_FAC(33) = 1.0
        GC_SCAV(34) = 'H2SO4'
        GC_SCAV_MAP(34) = 36
        GC_SCAV_FAC(34) = 1.0
        GC_SCAV(35) = 'ETHANOL'
        GC_SCAV_MAP(35) = 37
        GC_SCAV_FAC(35) = 1.0
        GC_SCAV(36) = 'ETHANE'
        GC_SCAV_MAP(36) = 38
        GC_SCAV_FAC(36) = 1.0
        GC_SCAV(37) = 'CL2'
        GC_SCAV_MAP(37) = 39
        GC_SCAV_FAC(37) = 1.0
        GC_SCAV(38) = 'HOCL'
        GC_SCAV_MAP(38) = 40
        GC_SCAV_FAC(38) = 1.0
        GC_SCAV(39) = 'FMCL'
        GC_SCAV_MAP(39) = 41
        GC_SCAV_FAC(39) = 1.0
        GC_SCAV(40) = 'HCL'
        GC_SCAV_MAP(40) = 42
        GC_SCAV_FAC(40) = 1.0
        GC_SCAV(41) = 'BENZENE'
        GC_SCAV_MAP(41) = 43
        GC_SCAV_FAC(41) = 1.0
        GC_SCAV(42) = 'PINENE'
        GC_SCAV_MAP(42) = 44
        GC_SCAV_FAC(42) = 1.0
        GC_SCAV(43) = 'NH3'
        GC_SCAV_MAP(43) = 73
        GC_SCAV_FAC(43) = 1.0 
!GC_WDEP.EXT
        N_GC_WDEP = 28+1 !NH3
        N_GC_WDEPD = N_GC_WDEP
        
        GC_WDEP( 1) = 'NO2'
        GC_WDEP_MAP( 1) = 1
        GC_WDEP( 2) = 'NO'
        GC_WDEP_MAP( 2) = 2
        GC_WDEP( 3) = 'O3'
        GC_WDEP_MAP( 3) = 3
        GC_WDEP( 4) = 'NO3'
        GC_WDEP_MAP( 4) = 4
        GC_WDEP( 5) = 'N2O5'
        GC_WDEP_MAP( 5) = 5
        GC_WDEP( 6) = 'HNO3'
        GC_WDEP_MAP( 6) = 6
        GC_WDEP( 7) = 'HONO'
        GC_WDEP_MAP( 7) = 7
        GC_WDEP( 8) = 'PNA'
        GC_WDEP_MAP( 8) = 8
        GC_WDEP( 9) = 'H2O2'
        GC_WDEP_MAP( 9) = 9
        GC_WDEP(10) = 'NTR'
        GC_WDEP_MAP(10) = 10
        GC_WDEP( 11) = 'ROOH'
        GC_WDEP_MAP( 11) = 11
        GC_WDEP( 12) = 'FORM'
        GC_WDEP_MAP( 12) = 12
        GC_WDEP( 13) = 'ALD2'
        GC_WDEP_MAP( 13) = 13
        GC_WDEP( 14) = 'ALDX'
        GC_WDEP_MAP( 14) = 14
        GC_WDEP( 15) = 'CO'
        GC_WDEP_MAP( 15) = 16
        GC_WDEP( 16) = 'MEPX'
        GC_WDEP_MAP( 16) = 17
        GC_WDEP( 17) = 'MEOH'
        GC_WDEP_MAP( 17) = 18
        GC_WDEP( 18) = 'FACD'
        GC_WDEP_MAP( 18) = 19
        GC_WDEP( 19) = 'PAN'
        GC_WDEP_MAP( 19) = 20
        GC_WDEP( 20) = 'PACD'
        GC_WDEP_MAP( 20) = 21
        GC_WDEP( 21) = 'AACD'
        GC_WDEP_MAP( 21) = 22
        GC_WDEP( 22) = 'PANX'
        GC_WDEP_MAP( 22) = 23
        GC_WDEP( 23) = 'SO2'
        GC_WDEP_MAP( 23) = 35
        GC_WDEP( 24) = 'SULF'
        GC_WDEP_MAP( 24) = 36
        GC_WDEP( 25) = 'CL2'
        GC_WDEP_MAP( 25) = 39
        GC_WDEP( 26) = 'HOCL'
        GC_WDEP_MAP( 26) = 40
        GC_WDEP( 27) = 'FMCL'
        GC_WDEP_MAP( 27) = 41
        GC_WDEP( 28) = 'HCL'
        GC_WDEP_MAP( 28) = 42
        GC_WDEP( 29) = 'NH3'
        GC_WDEP_MAP( 29) = 73

!*******************************************************
! INITIALIZATION OF MAPPING ARRAYS FOR CHEM BC         *
!*******************************************************
! CHEM BC
        N_GC_BCCHEM = NUM_BC_CHEM

        GC_BCCHEM( 1) = 'NO2'
        GC_BCCHEM_MAP( 1) = 1 + NUM_AERO_LOCAL
        GC_BCCHEM( 2) = 'NO'
        GC_BCCHEM_MAP( 2) = 2 + NUM_AERO_LOCAL
        GC_BCCHEM( 3) = 'O3'
        GC_BCCHEM_MAP( 3) = 3 + NUM_AERO_LOCAL
        GC_BCCHEM( 4) = 'HNO3'
        GC_BCCHEM_MAP( 4) = 6 + NUM_AERO_LOCAL
        GC_BCCHEM( 5) = 'H2O2'
        GC_BCCHEM_MAP( 5) = 9 + NUM_AERO_LOCAL
        GC_BCCHEM( 6) = 'FORM'
        GC_BCCHEM_MAP( 6) = 12 + NUM_AERO_LOCAL
        GC_BCCHEM( 7) = 'CO'
        GC_BCCHEM_MAP( 7) = 16 + NUM_AERO_LOCAL
        GC_BCCHEM( 8) = 'PAN'
        GC_BCCHEM_MAP( 8) = 20 + NUM_AERO_LOCAL
!
!-----------------------------------------------------------------
!*** INITIALIZATION AND ALLOCATION OF PHOTOLYSIS MATRIXS & INDEXES
!-----------------------------------------------------------------
!   IF(LPHOT2) THEN
!....
   nphoto_fastj = 22 !20 !   from module_phot_fastj
   jppjm = 22 !20
!        NS = 22 !21          ! , module_fastj_data

   lfastj_no2   = 1
   lfastj_o3a   = 2
   lfastj_o3b   = 3
   lfastj_h2o2  = 4
   lfastj_hchoa = 5
   lfastj_hchob = 6
   lfastj_ch3ooh= 7
   lfastj_no3x  = 8
   lfastj_no3l  = 9
   lfastj_hono  = 10
   lfastj_n2o5  = 11
   lfastj_hno3  = 12
   lfastj_hno4  = 13
   lfastj_ntr   = 14
   lfastj_ald2  = 15
   lfastj_pan   = 16
   lfastj_aldx  = 17
   lfastj_mgly  = 18
   lfastj_ispd  = 19
   lfastj_pacd  = 20
   lfastj_no2e  = 21

   IF(.NOT.ALLOCATED(ph_o2))THEN
   allocate(ph_o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_o31d(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_o33p(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no3o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no3o(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno3(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno4(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_h2o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch2or(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch2om(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3cho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coch3(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coc2h5(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcocho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3cocho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcochest(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3o2h(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coo2h(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3ono2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcochob(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_n2o5(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ntr(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ald2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_pan(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_aldx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_mgly(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ispd(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_mepx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_pacd(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_open(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_panx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no2e(ITS:ITE,1:LMV,JTS:JTE))
   ENDIF

   ph_o2=0.
   ph_o31d=0.
   ph_o33p=0.
   ph_no2=0.
   ph_no3o2=0.
   ph_no3o=0.
   ph_hno2=0.
   ph_hno3=0.
   ph_hno4=0.
   ph_h2o2=0.
   ph_ch2or=0.
   ph_ch2om=0.
   ph_ch3cho=0.
   ph_ch3coch3=0.
   ph_ch3coc2h5=0.
   ph_hcocho=0.
   ph_ch3cocho=0.
   ph_hcochest=0.
   ph_ch3o2h=0.
   ph_ch3coo2h=0.
   ph_ch3ono2=0.
   ph_hcochob=0.
   ph_n2o5=0.
   ph_ntr=0.
   ph_ald2=0.
   ph_pan=0.
   ph_aldx=0.
   ph_mgly=0.
   ph_ispd=0.
   ph_mepx=0.
   ph_pacd=0.
   ph_open=0.
   ph_panx=0.
   ph_no2e=0.

    ELSEIF(MECH==4) THEN !*** 1 GAS TRACER
!INITIALIZATION OF INDEXES
                      P_TRACER=1
                      P_O3=1 !for runs with only O3 strato
    ELSEIF(MECH==6) THEN !*** FOR SULFATE AND SOA_GLOBAL
                      P_SO2=1
                      P_DMS=2
                      P_H2O2=3
                      P_PINENE_A=4
                      P_ISOP=5
                      P_ISOPP1G=6
                      P_ISOPP2G=7
                      P_APINP1G=8
                      P_APINP2G=9
                      P_TOL=10
                      P_XYL=11
                      P_O3=12
                      P_OH=13
                      P_HO2=14

!*******************************************************
! INITIALIZATION OF MAPPING ARRAYS FOR CLOUD CHEMISTRY *
!*******************************************************
        N_GC_SPC = 9 !53
        N_GC_SPCD = N_GC_SPC + 1

      GC_SPC( 1) = 'SO2'
      GC_SPC( 2) = 'DMS'
      GC_SPC( 3) = 'H2O2'
      GC_SPC( 4) = 'PINENE_A'
      GC_SPC( 5) = 'ISOP' !                P_ISOP=5
      GC_SPC( 6) = 'ISOPP1G' !                P_ISOPP1G=6
      GC_SPC( 7) = 'ISOPP2G'
      GC_SPC( 8) = 'APINP1G'
      GC_SPC( 9) = 'APINP2G'
      GC_MOLWT( 1) = 64.0 
      GC_MOLWT( 2) = 62.13 
      GC_MOLWT( 3) = 34.0
      GC_MOLWT( 4) = 136.23 !apin
      GC_MOLWT( 5) = 68.12 !isop
      GC_MOLWT( 6) = 170.00 !isop-gas-p1
      GC_MOLWT( 7) = 170.00 !isop-gas-p2
      GC_MOLWT( 8) = 170.00 !apin-gas-p1
      GC_MOLWT( 9) = 170.00 !apin-gas-p2

        N_GC_SCAV = 9 
        N_GC_SCAVD = N_GC_SCAV

        GC_SCAV( 1) = 'SO2'
        GC_SCAV_MAP( 1) = 1
        GC_SCAV_FAC( 1) = 1.0 
        GC_SCAV( 2) = 'SO2' 
        GC_SCAV_MAP( 2) = 2
        GC_SCAV_FAC( 2) = 0.0 
        GC_SCAV( 3) = 'H2O2'
        GC_SCAV_MAP( 3) = 3
        GC_SCAV_FAC( 3) = 1.0 
        GC_SCAV( 4) = 'PINENE'
        GC_SCAV_MAP( 4) = 4
        GC_SCAV_FAC( 4) = 1.0
        GC_SCAV( 5) = 'ISOPRENE'
        GC_SCAV_MAP( 5) = 5
        GC_SCAV_FAC( 5) = 1.0
        GC_SCAV( 6) = 'FORMIC_ACID'
        GC_SCAV_MAP( 6) = 6
        GC_SCAV_FAC( 6) = 1.0
        GC_SCAV( 7) = 'FORMIC_ACID'
        GC_SCAV_MAP( 7) = 7
        GC_SCAV_FAC( 7) = 1.0
        GC_SCAV( 8) = 'FORMIC_ACID'
        GC_SCAV_MAP( 8) = 8
        GC_SCAV_FAC( 8) = 1.0
        GC_SCAV( 9) = 'FORMIC_ACID'
        GC_SCAV_MAP( 9) = 9
        GC_SCAV_FAC( 9) = 1.0

        N_GC_WDEP = 9
        N_GC_WDEPD = N_GC_WDEP

        GC_WDEP( 1) = 'SO2'
        GC_WDEP_MAP( 1) = 1
        GC_WDEP( 2) = 'SO2'
        GC_WDEP_MAP( 2) = 2
        GC_WDEP( 3) = 'H2O2'
        GC_WDEP_MAP( 3) = 3
        GC_WDEP( 4) = 'PINENE'
        GC_WDEP_MAP( 4) = 4
        GC_WDEP( 5) = 'ISOPRENE'
        GC_WDEP_MAP( 5) = 5
        GC_WDEP( 6) = 'FORMIC_ACID'
        GC_WDEP_MAP( 6) = 6
        GC_WDEP( 7) = 'FORMIC_ACID'
        GC_WDEP_MAP( 7) = 7
        GC_WDEP( 8) = 'FORMIC_ACID'
        GC_WDEP_MAP( 8) = 8
        GC_WDEP( 9) = 'FORMIC_ACID'
        GC_WDEP_MAP( 9) = 9

!
!-----------------------------------------------------------------
!*** INITIALIZATION AND ALLOCATION OF PHOTOLYSIS MATRIXS & INDEXES
!-----------------------------------------------------------------
!   IF(LPHOT2) THEN
   nphoto_fastj = 22 !20 !   from module_phot_fastj
   jppjm = 22 !20
!        NS = 22 !21          ! , module_fastj_data

   lfastj_no2   = 1
   lfastj_o3a   = 2
   lfastj_o3b   = 3
   lfastj_h2o2  = 4
   lfastj_hchoa = 5
   lfastj_hchob = 6
   lfastj_ch3ooh= 7
   lfastj_no3x  = 8
   lfastj_no3l  = 9
   lfastj_hono  = 10
   lfastj_n2o5  = 11
   lfastj_hno3  = 12
   lfastj_hno4  = 13
   lfastj_ntr   = 14
   lfastj_ald2  = 15
   lfastj_pan   = 16
   lfastj_aldx  = 17
   lfastj_mgly  = 18
   lfastj_ispd  = 19
   lfastj_pacd  = 20
   lfastj_no2e  = 21

   IF(.NOT.ALLOCATED(ph_o2))THEN
   allocate(ph_o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_o31d(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_o33p(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no3o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no3o(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno3(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno4(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_h2o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch2or(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch2om(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3cho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coch3(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coc2h5(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcocho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3cocho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcochest(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3o2h(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coo2h(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3ono2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcochob(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_n2o5(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ntr(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ald2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_pan(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_aldx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_mgly(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ispd(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_mepx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_pacd(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_open(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_panx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no2e(ITS:ITE,1:LMV,JTS:JTE))
   ENDIF

   ph_o2=0.
   ph_o31d=0.
   ph_o33p=0.
   ph_no2=0.
   ph_no3o2=0.
   ph_no3o=0.
   ph_hno2=0.
   ph_hno3=0.
   ph_hno4=0.
   ph_h2o2=0.
   ph_ch2or=0.
   ph_ch2om=0.
   ph_ch3cho=0.
   ph_ch3coch3=0.
   ph_ch3coc2h5=0.
   ph_hcocho=0.
   ph_ch3cocho=0.
   ph_hcochest=0.
   ph_ch3o2h=0.
   ph_ch3coo2h=0.
   ph_ch3ono2=0.
   ph_hcochob=0.
   ph_n2o5=0.
   ph_ntr=0.
   ph_ald2=0.
   ph_pan=0.
   ph_aldx=0.
   ph_mgly=0.
   ph_ispd=0.
   ph_mepx=0.
   ph_pacd=0.
   ph_open=0.
   ph_panx=0.
   ph_no2e=0.

    ELSEIF(MECH==7) THEN !*** FOR SULFATE/NITRATE/AMMONIUM AND SOA_HODZIC_SPRACKLEN GLOBAL
                      P_SO2=1
                      P_DMS=2
                      P_H2O2=3
                      P_PINENE_A=4
                      P_ISOP=5
                      P_VOCA=6
                      P_VOCBB=7
                      P_NH3=8 
!NOT ADVECTED
                      P_O3=9 
                      P_OH=10
                      P_HO2=11
                      P_HNO3=12
                      P_NO3=13

!*******************************************************
! INITIALIZATION OF MAPPING ARRAYS FOR CLOUD CHEMISTRY *
!*******************************************************
      N_GC_SPC = 8 
      N_GC_SPCD = N_GC_SPC + 1
!
      GC_SPC( 1) = 'SO2'
      GC_SPC( 2) = 'DMS'
      GC_SPC( 3) = 'H2O2'
      GC_SPC( 4) = 'PINENE_A'
      GC_SPC( 5) = 'ISOP' 
      GC_SPC( 6) = 'VOCA'
      GC_SPC( 7) = 'VOCBB'
      GC_SPC( 8) = 'NH3'
!
      GC_MOLWT( 1) = 64.0 
      GC_MOLWT( 2) = 62.13 
      GC_MOLWT( 3) = 34.0
      GC_MOLWT( 4) = 136.23 !apin
      GC_MOLWT( 5) = 68.12  !isop
      GC_MOLWT( 6) = 170.0 
      GC_MOLWT( 7) = 170.0 
      GC_MOLWT( 8) = 17.0 

        N_GC_SCAV = 8 
        N_GC_SCAVD = N_GC_SCAV

        GC_SCAV( 1) = 'SO2'
        GC_SCAV_MAP( 1) = 1
        GC_SCAV_FAC( 1) = 1.0 
        GC_SCAV( 2) = 'SO2' 
        GC_SCAV_MAP( 2) = 2
        GC_SCAV_FAC( 2) = 0.0 
        GC_SCAV( 3) = 'H2O2'
        GC_SCAV_MAP( 3) = 3
        GC_SCAV_FAC( 3) = 1.0 
        GC_SCAV( 4) = 'PINENE'
        GC_SCAV_MAP( 4) = 4
        GC_SCAV_FAC( 4) = 1.0
        GC_SCAV( 5) = 'ISOPRENE'
        GC_SCAV_MAP( 5) = 5
        GC_SCAV_FAC( 5) = 1.0
        GC_SCAV( 6) = 'FORMIC_ACID'
        GC_SCAV_MAP( 6) = 6
        GC_SCAV_FAC( 6) = 1.0
        GC_SCAV( 7) = 'FORMIC_ACID'
        GC_SCAV_MAP( 7) = 7
        GC_SCAV_FAC( 7) = 1.0
        GC_SCAV( 8) = 'NH3'
        GC_SCAV_MAP( 8) = 8
        GC_SCAV_FAC( 8) = 1.0

        N_GC_WDEP = 8
        N_GC_WDEPD = N_GC_WDEP

        GC_WDEP( 1) = 'SO2'
        GC_WDEP_MAP( 1) = 1
        GC_WDEP( 2) = 'SO2'
        GC_WDEP_MAP( 2) = 2
        GC_WDEP( 3) = 'H2O2'
        GC_WDEP_MAP( 3) = 3
        GC_WDEP( 4) = 'PINENE'
        GC_WDEP_MAP( 4) = 4
        GC_WDEP( 5) = 'ISOPRENE'
        GC_WDEP_MAP( 5) = 5
        GC_WDEP( 6) = 'FORMIC_ACID'
        GC_WDEP_MAP( 6) = 6
        GC_WDEP( 7) = 'FORMIC_ACID'
        GC_WDEP_MAP( 7) = 7
        GC_WDEP( 8) = 'NH3'
        GC_WDEP_MAP( 8) = 8
!
!-----------------------------------------------------------------
!*** INITIALIZATION AND ALLOCATION OF PHOTOLYSIS MATRIXS & INDEXES
!-----------------------------------------------------------------
!   IF(LPHOT2) THEN
   nphoto_fastj = 22 !20 !   from module_phot_fastj
   jppjm = 22 !20
!        NS = 22 !21          ! , module_fastj_data

   lfastj_no2   = 1
   lfastj_o3a   = 2
   lfastj_o3b   = 3
   lfastj_h2o2  = 4
   lfastj_hchoa = 5
   lfastj_hchob = 6
   lfastj_ch3ooh= 7
   lfastj_no3x  = 8
   lfastj_no3l  = 9
   lfastj_hono  = 10
   lfastj_n2o5  = 11
   lfastj_hno3  = 12
   lfastj_hno4  = 13
   lfastj_ntr   = 14
   lfastj_ald2  = 15
   lfastj_pan   = 16
   lfastj_aldx  = 17
   lfastj_mgly  = 18
   lfastj_ispd  = 19
   lfastj_pacd  = 20
   lfastj_no2e  = 21

   IF(.NOT.ALLOCATED(ph_o2))THEN
   allocate(ph_o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_o31d(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_o33p(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no3o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no3o(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno3(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno4(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_h2o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch2or(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch2om(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3cho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coch3(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coc2h5(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcocho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3cocho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcochest(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3o2h(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coo2h(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3ono2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcochob(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_n2o5(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ntr(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ald2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_pan(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_aldx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_mgly(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ispd(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_mepx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_pacd(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_open(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_panx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no2e(ITS:ITE,1:LMV,JTS:JTE))
   ENDIF

   ph_o2=0.
   ph_o31d=0.
   ph_o33p=0.
   ph_no2=0.
   ph_no3o2=0.
   ph_no3o=0.
   ph_hno2=0.
   ph_hno3=0.
   ph_hno4=0.
   ph_h2o2=0.
   ph_ch2or=0.
   ph_ch2om=0.
   ph_ch3cho=0.
   ph_ch3coch3=0.
   ph_ch3coc2h5=0.
   ph_hcocho=0.
   ph_ch3cocho=0.
   ph_hcochest=0.
   ph_ch3o2h=0.
   ph_ch3coo2h=0.
   ph_ch3ono2=0.
   ph_hcochob=0.
   ph_n2o5=0.
   ph_ntr=0.
   ph_ald2=0.
   ph_pan=0.
   ph_aldx=0.
   ph_mgly=0.
   ph_ispd=0.
   ph_mepx=0.
   ph_pacd=0.
   ph_open=0.
   ph_panx=0.
   ph_no2e=0.


    ELSEIF(MECH==37) THEN !*** CBM-05Ext AND AERO_BSC OM+BC+SU+NI+NH4
!INITIALIZATION OF INDEXES
                      P_NO2=1
                      P_NO=2
                      P_O3=3
                      P_NO3=4
                      P_N2O5=5
                      P_HNO3=6
                      P_HONO=7
                      P_PNA=8
                      P_H2O2=9
                      P_NTR=10
                      P_ROOH=11
                      P_FORM=12
                      P_ALD2=13
                      P_ALDX=14
                      P_PAR=15
                      P_CO=16
                      P_MEPX=17
                      P_MEOH=18
                      P_FACD=19
                      P_PAN=20
                      P_PACD=21
                      P_AACD=22
                      P_PANX=23
                      P_OLE=24
                      P_ETH=25
                      P_IOLE=26
                      P_TOL=27
                      P_CRES=28
                      P_OPEN=29
                      P_MGLY=30
                      P_XYL=31
                      P_ISOP=32
                      P_ISPD=33
                      P_TERP=34
                      P_SO2=35
                      P_SULF=36
                      P_ETOH=37
                      P_ETHA=38
                      P_CL2=39
                      P_HOCL=40
                      P_FMCL=41
                      P_HCL=42
                      P_BENZENE=43
                      P_SESQ=44
!NON-ADVECTED SPECIES
                      P_O=45
                      P_O1D=46
                      P_OH=47
                      P_HO2=48
                      P_XO2=49
                      P_XO2N=50
                      P_MEO2=51
                      P_HCO3=52
                      P_C2O3=53
                      P_CXO3=54
                      P_ROR=55
                      P_TO2=56
                      P_TOLRO2=57
                      P_CRO=58
                      P_XYLRO2=59
                      P_ISOPRXN=60
                      P_TRPRXN=61
                      P_SULRXN=62
                      P_CL=63
                      P_CLO=64
                      P_TOLNRXN=65
                      P_TOLHRXN=66
                      P_XYLNRXN=67
                      P_XYLHRXN=68
                      P_BENZRO2=69
                      P_BNZNRXN=70
                      P_BNZHRXN=71
                      P_SESQRXN=72
                      P_NH3=73
!FOR AEROSOL_BSC
                      P_ISOPP1G=74
                      P_ISOPP2G=75
                      P_APINP1G=76
                      P_APINP2G=77
                      P_DMS=78

!
!*******************************************************
! INITIALIZATION OF MAPPING ARRAYS FOR CLOUD CHEMISTRY *
!*******************************************************
        N_GC_SPC = 78 !ALL GASES
        N_GC_SPC_CHEM=72 !ONLY THOSE GASES IN EBI
        N_GC_SPCD = N_GC_SPC + 1
      
      GC_SPC( 1) = 'NO2'
      GC_MOLWT( 1)=46.0
      GC_SPC( 2) = 'NO'
      GC_MOLWT( 2)=30.0
      GC_SPC( 3) = 'O3'
      GC_MOLWT( 3)=48.0
      GC_SPC( 4) = 'NO3'
      GC_MOLWT( 4)=62.0
      GC_SPC( 5) = 'N2O5'
      GC_MOLWT( 5)=108.0
      GC_SPC( 6) = 'HNO3'
      GC_MOLWT( 6)=63.0
      GC_SPC( 7) = 'HONO'
      GC_MOLWT( 7)=47.0
      GC_SPC( 8) = 'PNA'
      GC_MOLWT( 8)=79.0
      GC_SPC( 9) = 'H2O2'
      GC_MOLWT( 9)=34.0
      GC_SPC(10) = 'NTR'
      GC_MOLWT(10)=130.0
      GC_SPC(11) = 'ROOH'
      GC_MOLWT(11)=62.0
      GC_SPC(12) = 'FORM'
      GC_MOLWT(12)=30.0
      GC_SPC(13) = 'ALD2'
      GC_MOLWT(13)=44.0
      GC_SPC(14) = 'ALDX'
      GC_MOLWT(14)=44.0
      GC_SPC(15) = 'PAR'
      GC_MOLWT(15)=14.0
      GC_SPC(16) = 'CO'
      GC_MOLWT(16)=28.0
      GC_SPC(17) = 'MEPX'
      GC_MOLWT(17)=48.0
      GC_SPC(18) = 'MEOH'
      GC_MOLWT(18)=32.0
      GC_SPC(19) = 'FACD'
      GC_MOLWT(19)=46.0
      GC_SPC(20) = 'PAN'
      GC_MOLWT(20)=121.0
      GC_SPC(21) = 'PACD'
      GC_MOLWT(21)=76.0
      GC_SPC(22) = 'AACD'
      GC_MOLWT(22)=60.0
      GC_SPC(23) = 'PANX'
      GC_MOLWT(23)=121.0
      GC_SPC(24) = 'OLE'
      GC_MOLWT(24)=27.0
      GC_SPC(25) = 'ETH'
      GC_MOLWT(25)=28.0
      GC_SPC(26) = 'IOLE'
      GC_MOLWT(26)=48.0
      GC_SPC(27) = 'TOL'
      GC_MOLWT(27)=92.0
      GC_SPC(28) = 'CRES'
      GC_MOLWT(28)=108.0
      GC_SPC(29) = 'OPEN'
      GC_MOLWT(29)=84.0
      GC_SPC(30) = 'MGLY'
      GC_MOLWT(30)=72.0
      GC_SPC(31) = 'XYL'
      GC_MOLWT(31)=106.0
      GC_SPC(32) = 'ISOP'
      GC_MOLWT(32)=68.0
      GC_SPC(33) = 'ISPD'
      GC_MOLWT(33)=70.0
      GC_SPC(34) = 'TERP'
      GC_MOLWT(34)=136.0
      GC_SPC(35) = 'SO2'
      GC_MOLWT(35)=64.0
      GC_SPC(36) = 'SULF'
      GC_MOLWT(36)=98.0
      GC_SPC(37) = 'ETOH'
      GC_MOLWT(37)=46.0
      GC_SPC(38) = 'ETHA'
      GC_MOLWT(38)=30.0
      GC_SPC(39) = 'CL2'
      GC_MOLWT(39)=71.0
      GC_SPC(40) = 'HOCL'
      GC_MOLWT(40)=52.5
      GC_SPC(41) = 'FMCL'
      GC_MOLWT(41)=64.5
      GC_SPC(42) = 'HCL'
      GC_MOLWT(42)=36.5
      GC_SPC(43) = 'BENZENE'
      GC_MOLWT(43)=78.0
      GC_SPC(44) = 'SESQ'
      GC_MOLWT(44)=204.0
      GC_SPC(45) = 'O'
      GC_MOLWT(45)=16.0
      GC_SPC(46) = 'O1D'
      GC_MOLWT(46)=16.0
      GC_SPC(47) = 'OH'
      GC_MOLWT(47)=17.0
      GC_SPC(48) = 'HO2'
      GC_MOLWT(48)=33.0
      GC_SPC(49) = 'XO2'
      GC_MOLWT(49)=1.0
      GC_SPC(50) = 'XO2N'
      GC_MOLWT(50)=1.0
      GC_SPC(51) = 'MEO2'
      GC_MOLWT(51)=47.0
      GC_SPC(52) = 'HCO3'
      GC_MOLWT(52)=63.0
      GC_SPC(53) = 'C2O3'
      GC_MOLWT(53)=75.0
      GC_SPC(54) = 'CXO3'
      GC_MOLWT(54)=75.0
      GC_SPC(55) = 'ROR'
      GC_MOLWT(55)=31.0
      GC_SPC(56) = 'TO2'
      GC_MOLWT(56)=109.0
      GC_SPC(57) = 'TOLRO2'
      GC_MOLWT(57)=141.0
      GC_SPC(58) = 'CRO'
      GC_MOLWT(58)=139.0
      GC_SPC(59) = 'XYLRO2'
      GC_MOLWT(59)=155.0
      GC_SPC(60) = 'ISOPRXN'
      GC_MOLWT(60)=68.0
      GC_SPC(61) = 'TRPRXN'
      GC_MOLWT(61)=136.0
      GC_SPC(62) = 'SULRXN'
      GC_MOLWT(62)=98.0
      GC_SPC(63) = 'CL'
      GC_MOLWT(63)=35.5
      GC_SPC(64) = 'CLO'
      GC_MOLWT(64)=51.5
      GC_SPC(65) = 'TOLNRXN'
      GC_MOLWT(65)=141.0
      GC_SPC(66) = 'TOLHRXN'
      GC_MOLWT(66)=141.0
      GC_SPC(67) = 'XYLNRXN'
      GC_MOLWT(67)=155.0
      GC_SPC(68) = 'XYLHRXN'
      GC_MOLWT(68)=155.0
      GC_SPC(69) = 'BENZRO2'
      GC_MOLWT(69)=127.0
      GC_SPC(70) = 'BNZNRXN'
      GC_MOLWT(70)=127.0
      GC_SPC(71) = 'BNZHRXN'
      GC_MOLWT(71)=127.0
      GC_SPC(72) = 'SESQRXN'
      GC_MOLWT(72)=204.0
      GC_SPC(73) = 'NH3'
      GC_MOLWT(73)=17.0
      GC_SPC(74) = 'ISOPP1G' 
      GC_SPC(75) = 'ISOPP2G'
      GC_SPC(76) = 'APINP1G'
      GC_SPC(77) = 'APINP2G'
      GC_SPC(78) = 'DMS'
      GC_MOLWT(74) = 170.00 !isop-gas-p1
      GC_MOLWT(75) = 170.00 !isop-gas-p2
      GC_MOLWT(76) = 170.00 !apin-gas-p1
      GC_MOLWT(77) = 170.00 !apin-gas-p2
      GC_MOLWT(78) = 62.13 

        N_GC_SCAV = 48 !NH3 42
        N_GC_SCAVD = N_GC_SCAV
      
        GC_SCAV( 1) = 'NO2'
        GC_SCAV_MAP( 1) = 1
        GC_SCAV_FAC( 1) = 1.0
        GC_SCAV( 2) = 'NO'
        GC_SCAV_MAP( 2) = 2
        GC_SCAV_FAC( 2) = 1.0
        GC_SCAV( 3) = 'O3'
        GC_SCAV_MAP( 3) = 3
        GC_SCAV_FAC( 3) = 1.0
        GC_SCAV( 4) = 'NO3'
        GC_SCAV_MAP( 4) = 4
        GC_SCAV_FAC( 4) = 1.0
        GC_SCAV( 5) = 'N2O5'
        GC_SCAV_MAP( 5) = 5
        GC_SCAV_FAC( 5) = 1.0
        GC_SCAV( 6) = 'HNO3'
        GC_SCAV_MAP( 6) = 6
        GC_SCAV_FAC( 6) = 1.0
        GC_SCAV( 7) = 'HNO2'
        GC_SCAV_MAP( 7) = 7
        GC_SCAV_FAC( 7) = 1.0
        GC_SCAV( 8) = 'HNO4'
        GC_SCAV_MAP( 8) = 8
        GC_SCAV_FAC( 8) = 1.0
        GC_SCAV( 9) = 'H2O2'
        GC_SCAV_MAP( 9) = 9
        GC_SCAV_FAC( 9) = 1.0
        GC_SCAV(10) = 'MPAN'
        GC_SCAV_MAP(10) = 10
        GC_SCAV_FAC(10) = 1.0
        GC_SCAV(11) = 'METHYLHYDROPEROX'
        GC_SCAV_MAP(11) = 11
        GC_SCAV_FAC(11) = 1.0
        GC_SCAV(12) = 'FORMALDEHYDE'
        GC_SCAV_MAP(12) = 12
        GC_SCAV_FAC(12) = 1.0
        GC_SCAV(13) = 'ACETALDEHYDE'
        GC_SCAV_MAP(13) = 13
        GC_SCAV_FAC(13) = 1.0
        GC_SCAV(14) = 'GENERIC_ALDEHYDE'
        GC_SCAV_MAP(14) = 14
        GC_SCAV_FAC(14) = 1.0
        GC_SCAV(15) = 'ETHANE'
        GC_SCAV_MAP(15) = 15
        GC_SCAV_FAC(15) = 1.0
        GC_SCAV(16) = 'CO'
        GC_SCAV_MAP(16) = 16
        GC_SCAV_FAC(16) = 1.0
        GC_SCAV(17) = 'METHYLHYDROPEROX'
        GC_SCAV_MAP(17) = 17
        GC_SCAV_FAC(17) = 1.0
        GC_SCAV(18) = 'METHANOL'
        GC_SCAV_MAP(18) = 18
        GC_SCAV_FAC(18) = 1.0
        GC_SCAV(19) = 'FORMIC_ACID'
        GC_SCAV_MAP(19) = 19
        GC_SCAV_FAC(19) = 1.0
        GC_SCAV(20) = 'PAN'
        GC_SCAV_MAP(20) = 20
        GC_SCAV_FAC(20) = 1.0
        GC_SCAV(21) = 'PEROXYACETIC_ACI'
        GC_SCAV_MAP(21) = 21
        GC_SCAV_FAC(21) = 1.0
        GC_SCAV(22) = 'ACETIC_ACID'
        GC_SCAV_MAP(22) = 22
        GC_SCAV_FAC(22) = 1.0
        GC_SCAV(23) = 'PPN'
        GC_SCAV_MAP(23) = 23
        GC_SCAV_FAC(23) = 1.0
        GC_SCAV(24) = 'ETHENE'
        GC_SCAV_MAP(24) = 24
        GC_SCAV_FAC(24) = 1.0
        GC_SCAV(25) = 'ETHENE'
        GC_SCAV_MAP(25) = 25
        GC_SCAV_FAC(25) = 1.0
        GC_SCAV(26) = 'ETHENE'
        GC_SCAV_MAP(26) = 26
        GC_SCAV_FAC(26) = 1.0
        GC_SCAV(27) = 'TOLUENE'
        GC_SCAV_MAP(27) = 27
        GC_SCAV_FAC(27) = 1.0
        GC_SCAV(28) = '2-CRESOL'
        GC_SCAV_MAP(28) = 28
        GC_SCAV_FAC(28) = 1.0
        GC_SCAV(29) = 'METHYL_GLYOXAL'
        GC_SCAV_MAP(29) = 30
        GC_SCAV_FAC(29) = 1.0
        GC_SCAV(30) = 'O-XYLENE'
        GC_SCAV_MAP(30) = 31
        GC_SCAV_FAC(30) = 1.0
        GC_SCAV(31) = 'ISOPRENE'
        GC_SCAV_MAP(31) = 32
        GC_SCAV_FAC(31) = 1.0
        GC_SCAV(32) = 'PINENE'
        GC_SCAV_MAP(32) = 34
        GC_SCAV_FAC(32) = 1.0
        GC_SCAV(33) = 'SO2'
        GC_SCAV_MAP(33) = 35
        GC_SCAV_FAC(33) = 1.0
        GC_SCAV(34) = 'H2SO4'
        GC_SCAV_MAP(34) = 36
        GC_SCAV_FAC(34) = 1.0
        GC_SCAV(35) = 'ETHANOL'
        GC_SCAV_MAP(35) = 37
        GC_SCAV_FAC(35) = 1.0
        GC_SCAV(36) = 'ETHANE'
        GC_SCAV_MAP(36) = 38
        GC_SCAV_FAC(36) = 1.0
        GC_SCAV(37) = 'CL2'
        GC_SCAV_MAP(37) = 39
        GC_SCAV_FAC(37) = 1.0
        GC_SCAV(38) = 'HOCL'
        GC_SCAV_MAP(38) = 40
        GC_SCAV_FAC(38) = 1.0
        GC_SCAV(39) = 'FMCL'
        GC_SCAV_MAP(39) = 41
        GC_SCAV_FAC(39) = 1.0
        GC_SCAV(40) = 'HCL'
        GC_SCAV_MAP(40) = 42
        GC_SCAV_FAC(40) = 1.0
        GC_SCAV(41) = 'BENZENE'
        GC_SCAV_MAP(41) = 43
        GC_SCAV_FAC(41) = 1.0
        GC_SCAV(42) = 'PINENE'
        GC_SCAV_MAP(42) = 44
        GC_SCAV_FAC(42) = 1.0
        GC_SCAV(43) = 'NH3'
        GC_SCAV_MAP(43) = 73
        GC_SCAV_FAC(43) = 1.0 
        GC_SCAV(44) = 'FORMIC_ACID'
        GC_SCAV_MAP(44) = 74
        GC_SCAV_FAC(44) = 1.0
        GC_SCAV(45) = 'FORMIC_ACID'
        GC_SCAV_MAP(45) = 75
        GC_SCAV_FAC(45) = 1.0
        GC_SCAV(46) = 'FORMIC_ACID'
        GC_SCAV_MAP(46) = 76
        GC_SCAV_FAC(46) = 1.0
        GC_SCAV(47) = 'FORMIC_ACID'
        GC_SCAV_MAP(47) = 77
        GC_SCAV_FAC(47) = 1.0
        GC_SCAV(48) = 'SO2'
        GC_SCAV_MAP(48) = 78
        GC_SCAV_FAC(48) = 0.0

        N_GC_WDEP = 34        
        N_GC_WDEPD = N_GC_WDEP
        
        GC_WDEP( 1) = 'NO2'
        GC_WDEP_MAP( 1) = 1
        GC_WDEP( 2) = 'NO'
        GC_WDEP_MAP( 2) = 2
        GC_WDEP( 3) = 'O3'
        GC_WDEP_MAP( 3) = 3
        GC_WDEP( 4) = 'NO3'
        GC_WDEP_MAP( 4) = 4
        GC_WDEP( 5) = 'N2O5'
        GC_WDEP_MAP( 5) = 5
        GC_WDEP( 6) = 'HNO3'
        GC_WDEP_MAP( 6) = 6
        GC_WDEP( 7) = 'HONO'
        GC_WDEP_MAP( 7) = 7
        GC_WDEP( 8) = 'PNA'
        GC_WDEP_MAP( 8) = 8
        GC_WDEP( 9) = 'H2O2'
        GC_WDEP_MAP( 9) = 9
        GC_WDEP(10) = 'NTR'
        GC_WDEP_MAP(10) = 10
        GC_WDEP( 11) = 'ROOH'
        GC_WDEP_MAP( 11) = 11
        GC_WDEP( 12) = 'FORM'
        GC_WDEP_MAP( 12) = 12
        GC_WDEP( 13) = 'ALD2'
        GC_WDEP_MAP( 13) = 13
        GC_WDEP( 14) = 'ALDX'
        GC_WDEP_MAP( 14) = 14
        GC_WDEP( 15) = 'CO'
        GC_WDEP_MAP( 15) = 16
        GC_WDEP( 16) = 'MEPX'
        GC_WDEP_MAP( 16) = 17
        GC_WDEP( 17) = 'MEOH'
        GC_WDEP_MAP( 17) = 18
        GC_WDEP( 18) = 'FACD'
        GC_WDEP_MAP( 18) = 19
        GC_WDEP( 19) = 'PAN'
        GC_WDEP_MAP( 19) = 20
        GC_WDEP( 20) = 'PACD'
        GC_WDEP_MAP( 20) = 21
        GC_WDEP( 21) = 'AACD'
        GC_WDEP_MAP( 21) = 22
        GC_WDEP( 22) = 'PANX'
        GC_WDEP_MAP( 22) = 23
        GC_WDEP( 23) = 'SO2'
        GC_WDEP_MAP( 23) = 35
        GC_WDEP( 24) = 'SULF'
        GC_WDEP_MAP( 24) = 36
        GC_WDEP( 25) = 'CL2'
        GC_WDEP_MAP( 25) = 39
        GC_WDEP( 26) = 'HOCL'
        GC_WDEP_MAP( 26) = 40
        GC_WDEP( 27) = 'FMCL'
        GC_WDEP_MAP( 27) = 41
        GC_WDEP( 28) = 'HCL'
        GC_WDEP_MAP( 28) = 42
        GC_WDEP( 29) = 'NH3'
        GC_WDEP_MAP( 29) = 73
        GC_WDEP(30) = 'FORMIC_ACID'
        GC_WDEP_MAP(30) = 74
        GC_WDEP(31) = 'FORMIC_ACID'
        GC_WDEP_MAP(31) = 75
        GC_WDEP(32) = 'FORMIC_ACID'
        GC_WDEP_MAP(32) = 76
        GC_WDEP(33) = 'FORMIC_ACID'
        GC_WDEP_MAP(33) = 77
        GC_WDEP(34) = 'SO2'
        GC_WDEP_MAP(34) = 78

!*******************************************************
! INITIALIZATION OF MAPPING ARRAYS FOR CHEM BC         *
!*******************************************************
! CHEM BC
        N_GC_BCCHEM = NUM_BC_CHEM
        IF(NUM_BC_CHEM == 9)THEN
        GC_BCCHEM( 1) = 'NO2'
        GC_BCCHEM_MAP( 1) = 1 + NUM_AERO_LOCAL
        GC_BCCHEM( 2) = 'NO'
        GC_BCCHEM_MAP( 2) = 2 + NUM_AERO_LOCAL
        GC_BCCHEM( 3) = 'O3'
        GC_BCCHEM_MAP( 3) = 3 + NUM_AERO_LOCAL
        GC_BCCHEM( 4) = 'HNO3'
        GC_BCCHEM_MAP( 4) = 6 + NUM_AERO_LOCAL
        GC_BCCHEM( 5) = 'H2O2'
        GC_BCCHEM_MAP( 5) = 9 + NUM_AERO_LOCAL
        GC_BCCHEM( 6) = 'FORM'
        GC_BCCHEM_MAP( 6) = 12 + NUM_AERO_LOCAL
        GC_BCCHEM( 7) = 'CO'
        GC_BCCHEM_MAP( 7) = 16 + NUM_AERO_LOCAL
        GC_BCCHEM( 8) = 'PAN'
        GC_BCCHEM_MAP( 8) = 20 + NUM_AERO_LOCAL
        GC_BCCHEM( 9) = 'SO2'
        GC_BCCHEM_MAP( 9) = 35 + NUM_AERO_LOCAL
        ELSEIF(NUM_BC_CHEM == 30)THEN
        GC_BCCHEM( 1) = 'DUST BIN1'
        GC_BCCHEM_MAP( 1) = 1
        GC_BCCHEM( 2) = 'DUST BIN2'
        GC_BCCHEM_MAP( 2) = 2
        GC_BCCHEM( 3) = 'DUST BIN3'
        GC_BCCHEM_MAP( 3) = 3
        GC_BCCHEM( 4) = 'DUST BIN4'
        GC_BCCHEM_MAP( 4) = 4
        GC_BCCHEM( 5) = 'DUST BIN5'
        GC_BCCHEM_MAP( 5) = 5
        GC_BCCHEM( 6) = 'DUST BIN6'
        GC_BCCHEM_MAP( 6) = 6
        GC_BCCHEM( 7) = 'DUST BIN7'
        GC_BCCHEM_MAP( 7) = 7
        GC_BCCHEM( 8) = 'DUST BIN8'
        GC_BCCHEM_MAP( 8) = 8
        GC_BCCHEM( 9) = 'SSA BIN1'
        GC_BCCHEM_MAP( 9) = 9
        GC_BCCHEM(10) = 'SSA BIN2'
        GC_BCCHEM_MAP(10) = 10
        GC_BCCHEM(11) = 'SSA BIN3'
        GC_BCCHEM_MAP(11) = 11
        GC_BCCHEM(12) = 'SSA BIN4'
        GC_BCCHEM_MAP(12) = 12
        GC_BCCHEM(13) = 'SSA BIN5'
        GC_BCCHEM_MAP(13) = 13
        GC_BCCHEM(14) = 'SSA BIN6'
        GC_BCCHEM_MAP(14) = 14
        GC_BCCHEM(15) = 'SSA BIN7'
        GC_BCCHEM_MAP(15) = 15
        GC_BCCHEM(16) = 'SSA BIN8'
        GC_BCCHEM_MAP(16) = 16
        GC_BCCHEM(17) = 'OM PHOB'
        GC_BCCHEM_MAP(17) = P_OM1
        GC_BCCHEM(18) = 'OM PHIL'
        GC_BCCHEM_MAP(18) = P_OM2
        GC_BCCHEM(19) = 'BC PHOB'
        GC_BCCHEM_MAP(19) = P_BC1
        GC_BCCHEM(20) = 'BC PHIL'
        GC_BCCHEM_MAP(20) = P_BC2
        GC_BCCHEM(21) = 'SULFATE'
        GC_BCCHEM_MAP(21) = P_SO4
!
        GC_BCCHEM(22) = 'NO2'
        GC_BCCHEM_MAP(22) = 1 + NUM_AERO_LOCAL
        GC_BCCHEM(23) = 'NO'
        GC_BCCHEM_MAP(23) = 2 + NUM_AERO_LOCAL
        GC_BCCHEM(24) = 'O3'
        GC_BCCHEM_MAP(24) = 3 + NUM_AERO_LOCAL
        GC_BCCHEM(25) = 'HNO3'
        GC_BCCHEM_MAP(25) = 6 + NUM_AERO_LOCAL
        GC_BCCHEM(26) = 'H2O2'
        GC_BCCHEM_MAP(26) = 9 + NUM_AERO_LOCAL
        GC_BCCHEM(27) = 'FORM'
        GC_BCCHEM_MAP(27) = 12 + NUM_AERO_LOCAL
        GC_BCCHEM(28) = 'CO'
        GC_BCCHEM_MAP(28) = 16 + NUM_AERO_LOCAL
        GC_BCCHEM(29) = 'PAN'
        GC_BCCHEM_MAP(29) = 20 + NUM_AERO_LOCAL
        GC_BCCHEM(30) = 'SO2'
        GC_BCCHEM_MAP(30) = 35 + NUM_AERO_LOCAL
        ENDIF
!
!-----------------------------------------------------------------
!*** INITIALIZATION AND ALLOCATION OF PHOTOLYSIS MATRIXS & INDEXES
!-----------------------------------------------------------------
!   IF(LPHOT2) THEN
!....

   nphoto_fastj = 22 !20 !   from module_phot_fastj
   jppjm = 22 !20
!        NS = 22 !21          ! , module_fastj_data

   lfastj_no2   = 1
   lfastj_o3a   = 2
   lfastj_o3b   = 3
   lfastj_h2o2  = 4
   lfastj_hchoa = 5
   lfastj_hchob = 6
   lfastj_ch3ooh= 7
   lfastj_no3x  = 8
   lfastj_no3l  = 9
   lfastj_hono  = 10
   lfastj_n2o5  = 11
   lfastj_hno3  = 12
   lfastj_hno4  = 13
   lfastj_ntr   = 14
   lfastj_ald2  = 15
   lfastj_pan   = 16
   lfastj_aldx  = 17
   lfastj_mgly  = 18
   lfastj_ispd  = 19
   lfastj_pacd  = 20
   lfastj_no2e  = 21

   IF(.NOT.ALLOCATED(ph_o2))THEN
   allocate(ph_o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_o31d(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_o33p(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no3o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no3o(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno3(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hno4(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_h2o2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch2or(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch2om(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3cho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coch3(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coc2h5(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcocho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3cocho(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcochest(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3o2h(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3coo2h(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ch3ono2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_hcochob(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_n2o5(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ntr(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ald2(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_pan(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_aldx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_mgly(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_ispd(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_mepx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_pacd(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_open(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_panx(ITS:ITE,1:LMV,JTS:JTE))
   allocate(ph_no2e(ITS:ITE,1:LMV,JTS:JTE))
   ENDIF

   ph_o2=0.
   ph_o31d=0.
   ph_o33p=0.
   ph_no2=0.
   ph_no3o2=0.
   ph_no3o=0.
   ph_hno2=0.
   ph_hno3=0.
   ph_hno4=0.
   ph_h2o2=0.
   ph_ch2or=0.
   ph_ch2om=0.
   ph_ch3cho=0.
   ph_ch3coch3=0.
   ph_ch3coc2h5=0.
   ph_hcocho=0.
   ph_ch3cocho=0.
   ph_hcochest=0.
   ph_ch3o2h=0.
   ph_ch3coo2h=0.
   ph_ch3ono2=0.
   ph_hcochob=0.
   ph_n2o5=0.
   ph_ntr=0.
   ph_ald2=0.
   ph_pan=0.
   ph_aldx=0.
   ph_mgly=0.
   ph_ispd=0.
   ph_mepx=0.
   ph_pacd=0.
   ph_open=0.
   ph_panx=0.
   ph_no2e=0.

    ENDIF !MECH

!----------------------------------------------------------------------
!  STE=1
!      READ STE CARIOLLE LINEAR MODEL COEFFICIENTS
!      CARIOLLE AND TEYSSEDRE (2007)
!
!      READS COEF_91_v2.9.ascii FILE
!
!  STE=2
!      READ STE FROM CLIMATOLOGY
!
!  STE=3
!      READ STE COPCAT LINEAR MODEL COEFFICIENTS
!      MONGE-SANZ (2011)
!----------------------------------------------------------------------

      IF ( STE == 1 )THEN
        PRINT *,'READ CARIOLLE COEFFICIENTS - LINEAR OZONE MODEL', JDE
        IM=JDE-2
 
        IF(.NOT.ALLOCATED(PHI))THEN
        ALLOCATE(PHI(IM))
        ALLOCATE(PRESC(NLEV))
        ALLOCATE(COEFF(IM,NLEV,NCOEFF,NMONTH))
        ENDIF

        IF(MYPE==0)THEN

        open(NIN,file='COEF_91_v2.9.nmmb.ascii',status='old')

        DO IM=1,NMONTH
          READ (NIN,*)TYEAR, IYEAR
          READ (NIN,*)TMONTH, IMONTH
          PRINT *,TYEAR, IYEAR
          PRINT *,TMONTH, IMONTH
          DO K=1,JDE-2   !NLAT OF NMMB  JDE INCLUDES 2 ROWS MORE FOR COMUNICATION IN GLOBAL
           DO L=1,NLEV
            READ (NIN,*) PHI(K),PRESC(L),(COEFF(K,L,JC,IM),JC=1,NCOEFF)
           ENDDO
          ENDDO
!   
!     PRINTING FOR CONTROL
!
          PRINT *, 'THIS IS PHI:',PHI
          PRINT *, 'THIS IS PRESC:',PRESC
!      DO 3 JC=1,NCOEFF
!      PRINT *, COEFF (1,1,JC,IM), COEFF(NLAT,NLEV,JC,IM)
! 3    CONTINUE
        ENDDO

        CLOSE(NIN)
       ENDIF

       CALL MPI_BCAST(PHI,SIZE(PHI),MPI_REAL,0,MPI_COMM_COMP,IRTN)
       CALL MPI_BCAST(PRESC,SIZE(PRESC),MPI_REAL,0,MPI_COMM_COMP,IRTN)
       CALL MPI_BCAST(COEFF,SIZE(COEFF),MPI_REAL,0,MPI_COMM_COMP,IRTN)

       ENDIF

!O3CLIMATOLOGY - WE READ IT IN MODULE_CHEMISTRY
!       IF ( STE == 2 )THEN
!         PRINT *,'READ O3 STRATOSPHERIC CLIMATOLOGY', IDS,JDE
!
!         IF(.NOT.ALLOCATED(O3CLIMATO))THEN
!           ALLOCATE(O3CLIMATO(IDS:IDE,JDS:JDE,3))
!         ENDIF 
!
!         IF(MYPE==0)THEN
!           OPEN(NIN,file='O3CLIMATO.dat',status='old')
!           READ(NIN,*) O3CLIMATO
!           CLOSE(NIN)
!         ENDIF
!
!         CALL MPI_BCAST(O3CLIMATO,SIZE(O3CLIMATO),MPI_REAL,0,MPI_COMM_COMP,IRTN)
!
!       ENDIF
!-----------------------------------------------------------------------

      IF ( STE == 3 )THEN
        PRINT *,'READ COPCAT COEFFICIENTS - LINEAR OZONE MODEL', JDE
        IM=JDE-2

        IF(.NOT.ALLOCATED(PHI))THEN
        ALLOCATE(PHI(IM))
        ALLOCATE(PRESC(NLEV_COP))
        ALLOCATE(COEFF(IM,NLEV_COP,NCOEFF_COP,NMONTH))
        ENDIF

        IF(MYPE==0)THEN

        open(NIN,file='COEF_COPCAT.nmmb.ascii',status='old')

        DO IM=1,NMONTH
          READ (NIN,*)TYEAR, IYEAR
          READ (NIN,*)TMONTH, IMONTH
          PRINT *,TYEAR, IYEAR
          PRINT *,TMONTH, IMONTH
          DO K=1,JDE-2   !NLAT OF NMMB  JDE INCLUDES 2 ROWS MORE FOR COMUNICATION IN GLOBAL
           DO L=1,NLEV_COP
            READ (NIN,*) PHI(K),PRESC(L),(COEFF(K,L,JC,IM),JC=1,NCOEFF_COP)
           ENDDO
          ENDDO
!
!     PRINTING FOR CONTROL
!
          PRINT *, 'THIS IS PHI:',PHI
          PRINT *, 'THIS IS PRESC:',PRESC
!      DO 3 JC=1,NCOEFF
!      PRINT *, COEFF (1,1,JC,IM), COEFF(NLAT,NLEV,JC,IM)
! 3    CONTINUE
        ENDDO

        CLOSE(NIN)
       ENDIF

       CALL MPI_BCAST(PHI,SIZE(PHI),MPI_REAL,0,MPI_COMM_COMP,IRTN)
       CALL MPI_BCAST(PRESC,SIZE(PRESC),MPI_REAL,0,MPI_COMM_COMP,IRTN)
       CALL MPI_BCAST(COEFF,SIZE(COEFF),MPI_REAL,0,MPI_COMM_COMP,IRTN)

       ENDIF

      CHEM_INDICES_ARE_INITIALIZED = .true.

      RETURN
!
!-----------------------------------------------------------------------
!
      END SUBROUTINE INDX_CHEM_INIT
!
!---------------------------------------------------------------------
!
!-----------------------------------------------------------------------
!&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
!-----------------------------------------------------------------------
!
      END MODULE module_bsc_chem_data
!
!-----------------------------------------------------------------------
