SUBROUTINE SU_AERM7

!**** *SU_AERM7*   - DEFINES INDICES AND PARAMETERS FOR THE M7 AEROSOL MODEL

!     PURPOSE.
!     --------
!           INITIALIZE YO_AERO_M7, THE MODULE THAT CONTAINS PARAMETERS 
!           DEFINING THE M7 PROGNOSTIC AEROSOL MODEL CONFIGURATION.

!**   INTERFACE.
!     ----------
!        *CALL* *SU_AERM7   FROM *SUPHEC*

!        EXPLICIT ARGUMENTS :
!        --------------------
!        NONE

!        IMPLICIT ARGUMENTS :
!        --------------------
!        YO_AERO_M7

!     METHOD.
!     -------
!        FULL REWRITING OF MODULES *mo_aero*, *mo_aero_m7*, and *mo_aero_trac* 
!        of ECHAM5-HAM originally from
!
!     Authors:
!     --------
!        P. Stier (MPI)                                 2001/2002
!        E. Vignati and J. Wilson (JRC / EI)            2000

!        SEE DOCUMENTATION

!     EXTERNALS.
!     ----------

!     REFERENCE.
!     ----------
!        ECMWF RESEARCH DEPARTMENT DOCUMENTATION OF THE IFS

!     AUTHOR.
!     -------
!        JEAN-JACQUES MORCRETTE *ECMWF*

!     MODIFICATIONS.
!     --------------
!        ORIGINAL : 20091113

!     ------------------------------------------------------------------

USE PARKIND1  ,ONLY : JPIM  , JPRB
USE YOMHOOK   ,ONLY : LHOOK , DR_HOOK

USE YOMLUN   , ONLY : NULNAM
USE YOMCST   , ONLY : RPI
USE YOM_YGFL , ONLY : NAERO

USE YO_AERO_M7,ONLY : LEPAEM7,LSNUCL, LSCOAG, LSCOND, NNUCL, LMASS_DIAG, &
  & NAERMOD, NMOD  , NSS   , NSOL  , NGAS  , NSULF, NM7AER, NTRAC, &
  & ISO4NS , ISO4KS, ISO4AS, ISO4CS,                  &
  &          IBCKS , IBCAS , IBCCS , IBCKI ,          &
  &          IOCKS , IOCAS , IOCCS , IOCKI ,          &
  &                  ISSAS , ISSCS ,                  &
  &                  IDUAS , IDUCS         , IDUAI, IDUCI, &
  & INUCS  , IAITS , IACCS , ICOAS , IAITI , IACCI, ICOAI, &
  & rdens  , rosm  , rion  , rmowg , ndryd , nsolu, nmode, &
  & lwetd  , lsedi , rhenr , rdryr , cphas , ctrac       , &
  & CRDIV  , SIGMA , SIGMALN                             , &
  & CMR2RAS, CMR2MMR,CMEDR2MMEDR   , CMR2RAM    , RAM2CMR, &
  & CMIN_AERML, CMIN_AERNL, CACCSO4, CRH   ,  BK, AVO, RERG, R_KCAL , &
  & DH2SO4 , DDUST , DBC   , DOC   , DNACL , DNA2SO4, &
  & DNAHSO4, DH2O  , WH2SO4, WH2O  , WSO4  , WSO2   , &
  & WNA    , WCL   , WNACL , WNA2SO4,WNAHSO4        , &
  & FMAX   , CRITN                                  , &
  & WVB    , GMB   , CLAYERTHICKNESS, LOCOAGMASK    , &
  & PM6RP_LON_LEV  , PCRTCST,PRAS   , PAS           , &
  & NDUST  , NSEASALT, NPIST, NEMISS, NTYPE         , &
  & CMODE  , CTYPE , RSULFATE2SULFUR                , &
  & RBB_WSOC_PERC  , RBGE_WSOC_PERC , ROM2OC        , &
  & RCMR_FF, RCMR_BB, RCMR_BG, RCMR_SK, RCMR_SA, RCMR_SC, &
  & RFACSO2, RSO2TS                                 , &
  & RM2N_BCKI_FF, RM2N_BCKI_BB, RM2N_BCKS_BB        , &
  & RM2N_OCKI_FF, RM2N_OCKI_BB, RM2N_OCKI_BG, RM2N_OCKS_BB, RM2N_OCKS_BG, &
  & RM2N_S4KS_SK, RM2N_S4AS_SA, RM2N_S4CS_SC        , &
  & rmonSS1, rmonSS2, rmass1, rmass2, rnumb1, rnumb2, &
  & rdmas1 , rdmas2 , rdnum1, rdnum2, rfcon_ai, rfcon_ci, &
  & rmmr_ai, rmmr_ci, rcarbon_nh, rcarbon_sh        , &
  & rbcr   , rbcs   , rwu                           , &
  & csr_strat_wat, csr_strat_mix, csr_strat_ice, csr_conv,&
  & NAERM7, LM7UPHYS

USE YO_AERO_TRAC, ONLY : idt_dms  , idt_so2  , idt_so4              & ! mass mixing ratio dms, so2, so4
  &                    , idt_ms4ns, idt_ms4ks, idt_ms4as, idt_ms4cs & ! mass mixing ratio sulfate 
  &                    , idt_mbcki, idt_mbcks, idt_mbcas, idt_mbccs & ! mass mixing ratio black carbon
  &                    , idt_mocki, idt_mocks, idt_mocas, idt_moccs & ! mass mixing ratio organic carbon
  &                    , idt_mssas, idt_msscs                       & ! mass mixing ratio seasalt
  &                    , idt_mduai, idt_mduas, idt_mduci, idt_mducs & ! mass mixing ratio dust
  &                    , idt_mwans, idt_mwaks, idt_mwaas, idt_mwacs & ! mass mixing ratio aerosol water
  &                    , idt_nns  , idt_nki  , idt_nks  , idt_nai   & ! number mixing ratio      
  &                    , idt_nas  , idt_nci  , idt_ncs                ! number mixing ratio

!-- original from MPI had the following line
!  &                    , idt_oh   , idt_h2o2 , idt_o3   , idt_no2   & ! mass mixing ratio oh, h2o2, o3, no2
!  &                    , idt_cdnc , idt_icnc                          ! cloud and ice cristal number concentration
!                                                                      !  - currently prescribed offline
IMPLICIT NONE

INTEGER(KIND=JPIM) :: JMOD, JND

REAL(KIND=JPRB) :: ZSURF_MOLEC

REAL(KIND=JPRB) :: zd_mbcki, zd_mbcks, zd_mocki, zd_mocks, &
  &                zd_ms4ks, zd_ms4as, zd_ms4cs

REAL(KIND=JPRB) :: zr1, zr2, zb1, zb2, zx1, zx2, zdr1, zdr2, zfact

REAL(KIND=JPRB) :: zsig_ai, zsig_ci, zdensdust

REAL(KIND=JPRB) :: ZHOOK_HANDLE
!     ----------------------------------------------------------------

#include "posnam.intfb.h"

#include "naeaem7.h"
!      ----------------------------------------------------------------
IF (LHOOK) CALL DR_HOOK('SU_AERM7',0,ZHOOK_HANDLE)


!--quantities originally in mo_aero.f90

!*      0.5       Control variables and preset with default values
!
! Choice of the dust emission scheme:
ndust   = 2                   !    ndust = 1  Balkanski et al. (2002)
                              !          = 2  Tegen et al. (2002)

! Choice of the Sea Salt emission scheme:
nseasalt= 2                   !    nseasalt = 1  Monahan (1986)
                              !             = 2  Schulz et al. (2002)

! Choice of the air-sea exchange scheme:
npist   = 3                   !    npist = 1 Liss & Merlivat (1986) 
                              !          = 2 Wanninkhof (1992)
                              !          = 3 Nightingale (2000)		

! Choice for emission inventory:
nemiss  = 2                   !    nemiss = 1 old emissions
			      !           = 2 AEROCOM emissions 2000	

! Number of aerosol compounds: (needs to be harmonized with nmode in mo_aero_m7)
ntype   = 6

! Mode names:
cmode(1:7) = (/'NS', 'KS', 'AS', 'CS', 'KI', 'AI', 'CI' /)

! Compound names:
ctype(1:6) = (/'SO4', 'BC ', 'OC ', 'SS ', 'DU ', 'WAT' /)

! Ratio of sulfate mass to mass of sulfur:
!   depends on the assumed degree of neutralization.
rsulfate2sulfur = 3.063_JPRB    ! H2SO4     - 0%   neutralization
                                !=3.594     (NH4)HSO4 - 50%  neutralization
                                !=4.125     (NH4)2SO4 - 100% neutralization

!-- Emissions

rbb_wsoc_perc  = 0.65_JPRB      ! Biom. Burn. Percentage of Water Soluble OC (WSOC) [1]
                                ! (M.O. Andreae; Talk: Smoke and Climate)
rbge_wsoc_perc = 0.65_JPRB      ! Assume same Percentage of WSOC for biogenic OC

rom2oc         = 1.4_JPRB       ! Mass ratio organic species to organic carbon
                                ! (Seinfeld and Pandis, 1998, p709;
                                !  Ferek et al., JGR, 1998) 

rcmr_ff        = 0.030E-06_JPRB ! Fossil fuel emissions:
                                ! assumed number median radius of the emitted
                                ! particles with the standard deviation given
                                ! in mo_aero_m7 [m]. Has to lie within the 
                                ! Aitken mode for the current setup!

rcmr_bb        = 0.075E-06_JPRB ! Biomass burning emissions:
                                ! Assumed number median radius of the emitted
                                ! particles with the standard deviation given
                                ! in mo_aero_m7 [m]. Has to lie within the 
                                ! Aitken mode for the current setup!

rcmr_bg        = 0.030E-06_JPRB ! Biogenic secondary particle formation:
                                ! Assumed number median radius of the emitted
                                ! particles with the standard deviation given
                                ! in mo_aero_m7 [m]. Has to lie within the  
                                ! Aitken mode for the current setup!

rcmr_sk        = 0.030E-06_JPRB ! SO4 primary emission  ---> aitken mode
                                ! Assumed number median radius of the emitted
                                ! particles with the standard deviation given 
                                ! in mo_aero_m7 [m]. Has to lie within the 
                                ! Aitken mode for the current setup!

rcmr_sa        = 0.075E-06_JPRB ! SO4 primary emission  ---> accumulation mode
                                ! Assumed number median radius of the emitted
                                ! particles with the standard deviation given
                                ! in mo_aero_m7 [m]. Has to lie within the 
                                ! Accumulation mode for the current setup!

rcmr_sc        = 0.075E-06_JPRB ! SO4 primary emission  ---> coarse mode
                                ! Assumed number median radius of the emitted
                                ! particles with the standard deviation given
                                ! in mo_aero_m7 [m]. Has to lie within the 
                                ! Coarse mode for the current setup!

rfacso2         = 0.975_JPRB    ! factor to scale primary SO4 emissions 
                                ! AEROCOM assumption 2.5 % of the SO2 emissions 

rso2ts     = 1._JPRB/1.998_JPRB ! conversion factor SO2 to S


!-- Emissions: factors to convert mass flux in number flux for
!         given number median radii (cmr) and standard deviation 
!         (implicitly by the conversion factor cmr2ram) of the modes
!     (see end of routine)
!
!-----------------------------------------------------------------------------------

!*       1.       DEFAULT VALUES OF PARAMETERS
!                

!--- 1) Define and pre-set switches for the processes of M7: -----------------------
!--- Physical:

LM7UPHYS   = .TRUE.    ! M7 aerosol microphysics on

lsnucl     = .TRUE.    ! nucleation
lscoag     = .TRUE.    ! coagulation
lscond     = .TRUE.    ! condensation of H2SO4
  
nnucl      = 1         ! Choice of the nucleation scheme:
                       ! 
                       !    nnucl = 1  Vehkamaeki (2002)
                       !          = 2  Kulmala (1998)

!--- Technical:

lmass_diag = .FALSE.   ! mass balance check in m7_interface


!--- 2) Numbers of compounds and modes of m7: --------------------------------------

naermod=18             !number of all compounds
nmod=7                 !number of modes
nss=2                  !number of sea salt compounds 
nsol=4                 !number of soluble  compounds 
ngas=3                 !number of gaseous  compounds 
nsulf=4                !number of sulfate  compounds

nm7aer=naermod+nmod+ngas+nsulf    ! NB: nm7aer should be equal to JPAERO 
                                  ! in ifs/module/yom_ygfl.F90
ntrac =naermod+nmod+ngas          ! going through ...

                        
!--- 3) List of indexes corresponding to the compound masses and mode numbers:------

!--- 3.1) Mass index (in array aerml and ttn): 
!
!         Attention:
!         The mass of sulfate compounds is always given in [molec. cm-3] 
!         whilst the mass of other compounds is given in [ug cm-3].
!
!         Compounds:
!
!           so4 = sulphate
!           bc  = black carbon
!           oc  = organic carbon, 
!           ss  = sea salt
!           du  = dust 
!
!         Modes:
!
!           n   = nucleation mode
!           k   = aitken mode 
!           a   = accumulation mode
!           c   = coarse mode
!
!         Type:
!
!           s   = soluble mode
!           i   = insoluble mode
!                                                                               !  COMPOUND:
!        iso4ns=1, iso4ks=2, iso4as=3, iso4cs=4,                              & !- Sulfate
!                  ibcks =5, ibcas =6, ibccs =7, ibcki =8,                    & !- Black Carbon
!                  iocks =9, iocas=10, ioccs=11, iocki=12,                    & !- Organic Carbon
!                            issas=13, isscs=14,                              & !- Sea Salt
!                            iduas=15, iducs=16,           iduai=17, iduci=18   !- Dust  
! MODE:           |         |         |         |         |
!         nucl.   | aitk.   | acc.    | coar.   | aitk.   | acc.    | coar.   |
!         soluble | soluble | soluble | soluble | insol.  | insol.  | insol.  |
!- Sulfate
  iso4ns=1
  iso4ks=2
  iso4as=3
  iso4cs=4
!- Black Carbon
  ibcks =5
  ibcas =6
  ibccs =7
  ibcki =8
!- Organic Carbon
  iocks =9
  iocas=10
  ioccs=11
  iocki=12
!- Sea salt
  issas=13
  isscs=14
!- Dust
  iduas=15
  iducs=16
  iduai=17
  iduci=18
    
!--- 3.2) Number index (in array aernl):
!
!         inucs=1,  iaits=2,  iaccs=3,  icoas=4,  iaiti=5,  iacci=6,  icoai=7    
! MODE:           |         |         |         |         |
!         nucl.   | aitk.   | acc.    | coar.   | aitk.   | acc.    | coar.   |
!         soluble | soluble | soluble | soluble | insol.  | insol.  | insol.  |
  inucs=1
  iaits=2
  iaccs=3
  icoas=4
  iaiti=5
  iacci=6
  icoai=7

!--- 3.3) Defines the indices of the various constituents considered for M7 in 
!         the aerosl-related GFL. The first 18 are the aerosol components, 
!         the next 7 the aerosol number concentrations.
!    JJMorcrette, 20100105

!-- mass mixing ratios in kg kg-1

idt_ms4ns  = iso4ns          ! mass mixing ratio sulfate        nuclea. soluble
idt_ms4ks  = iso4ks          ! mass mixing ratio sulfate        aitken  soluble
idt_ms4as  = iso4as          ! mass mixing ratio sulfate        accum.  soluble
idt_ms4cs  = iso4cs          ! mass mixing ratio sulfate        coarse  soluble

idt_mbcki  = ibcki           ! mass mixing ratio black carbon   aitken  insoluble
idt_mbcks  = ibcks           ! mass mixing ratio black carbon   aitken  soluble
idt_mbcas  = ibcas           ! mass mixing ratio black carbon   accum.  soluble
idt_mbccs  = ibccs           ! mass mixing ratio black carbon   coarse  soluble

idt_mocki  = iocki           ! mass mixing ratio organic carbon aitken  insoluble
idt_mocks  = iocks           ! mass mixing ratio organic carbon aitken  soluble
idt_mocas  = iocas           ! mass mixing ratio organic carbon accum.  soluble
idt_moccs  = ioccs           ! mass mixing ratio organic carbon coarse  soluble

idt_mssas  = issas           ! mass mixing ratio seasalt        accum.  soluble
idt_msscs  = isscs           ! mass mixing ratio seasalt        coarse  soluble

idt_mduai  = iduai           ! mass mixing ratio dust           accum.  insoluble
idt_mduas  = iduas           ! mass mixing ratio dust           accum.  soluble
idt_mduci  = iduci           ! mass mixing ratio dust           coarse  insoluble
idt_mducs  = iducs           ! mass mixing ratio dust           coarse  soluble

!-- aerosol numbers in various modes (in kg-1)

idt_nns    = naermod + inucs ! number mixing ratio              nuclea. soluble
idt_nki    = naermod + iaiti ! number mixing ratio              aitken  insoluble
idt_nks    = naermod + iaits ! number mixing ratio              aitken  soluble
idt_nai    = naermod + iacci ! number mixing ratio              accum.  insoluble
idt_nas    = naermod + iaccs ! number mixing ratio              accum.  soluble
idt_nci    = naermod + icoai ! number mixing ratio              coarse  insoluble
idt_ncs    = naermod + icoas ! number mixing ratio              coarse  soluble

!-- relevant gases

idt_dms    = naermod + nmod + 1
idt_so2    = naermod + nmod + 2
idt_so4    = naermod + nmod + 3

!-- water vapour within the hydrophilic modes

idt_mwans  = naermod + nmod + ngas + 1
idt_mwaks  = naermod + nmod + ngas + 2
idt_mwaas  = naermod + nmod + ngas + 3
idt_mwacs  = naermod + nmod + ngas + 4

!--- 3.4) Defines quantities for the various constituents considered for M7

rdens(:)=-999._JPRB
rosm(:) =-999._JPRB
rion(:) =-999._JPRB
rmowg(:)=-999._JPRB
lwetd(:)=.false.
lsedi(:)=.false.
ndryd(:)=-999
nsolu(:)=-999
nmode(:)=-999
rhenr(:)=-999._JPRB
rdryr(:)=-999._JPRB
ctrac(:)='   '
cphas(:)='   '

!-- AEROSOL MASSES

!-- sulphate
jnd=idt_ms4ns
ctrac(jnd)='SO4'
rdens(jnd) = 1841._JPRB
rosm(jnd)  = 1._JPRB
rion(jnd)  = 2._JPRB
rmowg(jnd) = 95.952_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.false.
nsolu(jnd) = 1
nmode(jnd) = 1
cphas(jnd)='AMS'

jnd=idt_ms4ks
ctrac(jnd)='SO4'
rdens(jnd) = 1841._JPRB
rosm(jnd)  = 1._JPRB
rion(jnd)  = 2._JPRB
rmowg(jnd) = 95.952_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.false.
nsolu(jnd) = 1
nmode(jnd) = 2
cphas(jnd)='AMS'

jnd=idt_ms4as
ctrac(jnd)='SO4'
rdens(jnd) = 1841._JPRB
rosm(jnd)  = 1._JPRB
rion(jnd)  = 2._JPRB
rmowg(jnd) = 95.952_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.false.
nsolu(jnd) = 1
nmode(jnd) = 3
cphas(jnd)='AMS'

jnd=idt_ms4cs
ctrac(jnd)='SO4'
rdens(jnd) = 1841._JPRB
rosm(jnd)  = 1._JPRB
rion(jnd)  = 2._JPRB
rmowg(jnd) = 95.952_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.false.
nsolu(jnd) = 1
nmode(jnd) = 4
cphas(jnd)='AMS'


!-- black carbon
jnd=idt_mbcks
ctrac(jnd)='BC '
rdens(jnd) = 2000._JPRB
rosm(jnd)  = 0._JPRB
rion(jnd)  = 0._JPRB
rmowg(jnd) = 999.999_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.false.
nsolu(jnd) = 1
nmode(jnd) = 2
cphas(jnd)='AMS'

jnd=idt_mbcas
ctrac(jnd)='BC '
rdens(jnd) = 2000._JPRB
rosm(jnd)  = 0._JPRB
rion(jnd)  = 0._JPRB
rmowg(jnd) = 999.999_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 1
nmode(jnd) = 3
cphas(jnd)='AMS'

jnd=idt_mbccs
ctrac(jnd)='BC '
rdens(jnd) = 2000._JPRB
rosm(jnd)  = 0._JPRB
rion(jnd)  = 0._JPRB
rmowg(jnd) = 999.999_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 1
nmode(jnd) = 4
cphas(jnd)='AMS'

jnd=idt_mbcki
ctrac(jnd)='BC '
rdens(jnd) = 2000._JPRB
rosm(jnd)  = 0._JPRB
rion(jnd)  = 0._JPRB
rmowg(jnd) = 999.999_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.false.
nsolu(jnd) = 0
nmode(jnd) = 5
cphas(jnd)='AMS'


!-- organic carbon
jnd=idt_mocks
ctrac(jnd)='OC '
rdens(jnd) = 2000._JPRB
rosm(jnd)  = 0._JPRB
rion(jnd)  = 0._JPRB
rmowg(jnd) = 999.999_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.false.
nsolu(jnd) = 1
nmode(jnd) = 2
cphas(jnd)='AMS'

jnd=idt_mocas
ctrac(jnd)='OC '
rdens(jnd) = 2000._JPRB
rosm(jnd)  = 0._JPRB
rion(jnd)  = 0._JPRB
rmowg(jnd) = 999.999_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 1
nmode(jnd) = 3
cphas(jnd)='AMS'

jnd=idt_moccs
ctrac(jnd)='OC '
rdens(jnd) = 2000._JPRB
rosm(jnd)  = 0._JPRB
rion(jnd)  = 0._JPRB
rmowg(jnd) = 999.999_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 1
nmode(jnd) = 4
cphas(jnd)='AMS'

jnd=idt_mocki
ctrac(jnd)='OC '
rdens(jnd) = 2000._JPRB
rosm(jnd)  = 0._JPRB
rion(jnd)  = 0._JPRB
rmowg(jnd) = 999.999_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.false.
nsolu(jnd) = 0
nmode(jnd) = 5
cphas(jnd)='AMS'


!-- sea salt
jnd=idt_mssas
ctrac(jnd)='SS '
rdens(jnd) = 2165._JPRB
rosm(jnd)  = 1._JPRB
rion(jnd)  = 2._JPRB
rmowg(jnd) = 58.44_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 1
nmode(jnd) = 3
cphas(jnd)='AMS'

jnd=idt_msscs
ctrac(jnd)='SS '
rdens(jnd) = 2165._JPRB
rosm(jnd)  = 1._JPRB
rion(jnd)  = 2._JPRB
rmowg(jnd) = 58.44_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 1
nmode(jnd) = 4
cphas(jnd)='AMS'


!-- dust
jnd=idt_mduas
ctrac(jnd)='DU '
rdens(jnd) = 2650._JPRB
rosm(jnd)  = 0._JPRB
rion(jnd)  = 0._JPRB
rmowg(jnd) = -999.999_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 1
nmode(jnd) = 3
cphas(jnd)='AMS'

jnd=idt_mducs
ctrac(jnd)='DU '
rdens(jnd) = 2650._JPRB
rosm(jnd)  = 0._JPRB
rion(jnd)  = 0._JPRB
rmowg(jnd) = -999.999_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 0
nmode(jnd) = 4
cphas(jnd)='AMS'

jnd=idt_mduai
ctrac(jnd)='DU '
rdens(jnd) = 2650._JPRB
rosm(jnd)  = 0._JPRB
rion(jnd)  = 0._JPRB
rmowg(jnd) = -999.999_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 1
nmode(jnd) = 6
cphas(jnd)='AMS'

jnd=idt_mduci
ctrac(jnd)='DU '
rdens(jnd) = 2650._JPRB
rosm(jnd)  = 0._JPRB
rion(jnd)  = 0._JPRB
rmowg(jnd) = -999.99_JPRB
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 0
nmode(jnd) = 7
cphas(jnd)='AMS'


!-- AEROSOL NUMBERS

jnd=idt_nns
ctrac(jnd)='NUM'
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.false.
nsolu(jnd) = 1
nmode(jnd) = 1
cphas(jnd)='ANU'

jnd=idt_nks
ctrac(jnd)='NUM'
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.false.
nsolu(jnd) = 1
nmode(jnd) = 2
cphas(jnd)='ANU'

jnd=idt_nas
ctrac(jnd)='NUM'
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 1
nmode(jnd) = 3
cphas(jnd)='ANU'

jnd=idt_ncs
ctrac(jnd)='NUM'
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 1
nmode(jnd) = 4
cphas(jnd)='ANU'

jnd=idt_nki
ctrac(jnd)='NUM'
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.false.
nsolu(jnd) = 0
nmode(jnd) = 5
cphas(jnd)='ANU'

jnd=idt_nai
ctrac(jnd)='NUM'
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 0
nmode(jnd) = 6
cphas(jnd)='ANU'

jnd=idt_nns
ctrac(jnd)='NUM'
ndryd(jnd) = 2
lwetd(jnd) =.true.
lsedi(jnd) =.true.
nsolu(jnd) = 0
nmode(jnd) = 7
cphas(jnd)='ANU'


!-- GASES

jnd=idt_dms
ctrac(jnd)='DMS'
ndryd(jnd) = 0
lwetd(jnd) =.false.
rmowg(jnd) = 62.019_JPRB 
rhenr(jnd) = 0.56_JPRB
rdryr(jnd) = 0._JPRB
cphas(jnd)='GAS'

jnd=idt_so2
ctrac(jnd)='SO2'
ndryd(jnd) = 2
lwetd(jnd) =.true.
rmowg(jnd) = 63.962_JPRB 
rhenr(jnd) = 1.23_JPRB
rdryr(jnd) = 0._JPRB
cphas(jnd)='GAS'

jnd=idt_so4
ctrac(jnd)='SO4'
ndryd(jnd) = 2
lwetd(jnd) =.true.
rmowg(jnd) = 95.952_JPRB 
rdryr(jnd) = 0._JPRB
cphas(jnd)='GAS'




!--- 4) Definition of the modes of M7: ------------------------------------------------------

!--- 4.1) Threshold radii between the different modes [cm]:
!         Used for the repartititioning in m7_dconc.
!         crdiv(jmod) is the lower bound and crdiv(jmod+1) is 
!         the upper bound of the respective geometric mode
!         Default value for nucleation mode is modified by the 
!         choice of the nuclation scheme.

crdiv(1:4)=(/ 0.0005E-4_JPRB, 0.005E-4_JPRB, 0.05E-4_JPRB, 0.5E-4_JPRB /)    
!                    |              |             |      
!                    |              |             |
!             nucleation --     aitken  --      accum --  coarse mode

!--- 4.2) Standard deviation for the modes:

sigma(1:7)=(/ 1.59_JPRB, 1.59_JPRB, 1.59_JPRB, 2.00_JPRB, 1.59_JPRB, 1.59_JPRB, 2.00_JPRB /)

!--- Natural logarithm of the standard deviation of each mode:

! sigmaln(nmod)	 (see below 5. and 5.2)


!--- 5) Conversion factors for lognormal particle size distributions: -------------
!       Calculated in m7_initialize. 

! cmr2ras(nmod) ! Conversion factor: count median radius to radius of average surface
! cmr2mmr(nmod) ! Conversion factor: count median radius to mass mean radius
! cmedr2mmedr(nmod) ! Conversion factor: count median radius to mass median radius
! cmr2ram(nmod) ! Conversion factor: count median radius to radius of average mass
! ram2cmr(nmod) ! Conversion factor: radius of average mass to count median radius

DO jmod=1, nmod

!--- 5.1) Calculate conversion factors for lognormal distributions:----
!       Radius of average mass (ram) to count median radius (cmr) and 
!       vice versa. Count median radius to radius of average 
!       mass (ram).
!       These factors depend on the standard deviation (sigma)
!       of the lognormal distribution.
!       (Based on the Hatch-Choate Conversins Equations;
!        see Hinds, Chapter 4.5, 4.6 for more details.
!        In particular equation 4.53.)

!--- Count Median Radius to Mass Median Radius:

  cmedr2mmedr(jmod) = EXP(3.0_JPRB*(LOG(sigma(jmod)))**2)

!--- Count Median Radius to Mass Mean Radius:

  cmr2mmr(jmod) = EXP(3.5_JPRB*(LOG(sigma(jmod)))**2)

!--- Count Median Radius to Radius of Average Mass:

  cmr2ram(jmod) = EXP(1.5_JPRB*(LOG(sigma(jmod)))**2)

!--- Radius of Average Mass to Count Median Radius:

  ram2cmr(jmod) = 1._JPRB / cmr2ram(jmod)

!--- Count Median Radius to Radius of Average Surface:

  cmr2ras(jmod) = EXP(1.0_JPRB*(LOG(sigma(jmod)))**2)


!--- 5.2) Calculate the natural logarithm of the standard deviation:

  sigmaln(jmod) = LOG(sigma(jmod))

ENDDO


!--- 6) Assumed thresholds for occurence of specific quantities: -------------
!@@@    To be done!
  
cmin_aerml     = 1.E-15_JPRB ! Aerosol mass
cmin_aernl     = 1.E-10_JPRB ! Aerosol number                     

  
!--- 7) Chemical constants: ----------------------------------------------------
!
!--- Accommodation coefficient of H2SO4 on aerosols:
!    (reduced for insoluble modes)

caccso4(1:7) = (/ 1.0_JPRB, 1.0_JPRB, 1.0_JPRB, 1.0_JPRB, 0.3_JPRB, 0.3_JPRB, 0.3_JPRB /)

!--- Critical relative humidity:

crh    = 0.45_JPRB  ! Assumed relative humidity for the 
                    ! Na2SO4 / NaCl system below which 
                    ! crystalization occurs.
                    ! (estimated from Tang, I.N.; JGR 102, D2 1883-1893)


!--- 8) Physical constants: ----------------------------------------------------
!
!--- 8.1) General physical constants: 

bk      = 1.38e-16_JPRB    ! Bolzman constant []
avo     = 6.02217E+23_JPRB ! Avogadro number [mol-1]
rerg    = 8.314E+7_JPRB    ! Ideal gas constant [erg.K-1.mole-1]
r_kcal  = 1.986E-3_JPRB    ! Ideal gas constant [kcal K-1.mole-1]
  
!--- 8.2) Type specific physical constants:
!
dh2so4  = 1.841_JPRB       ! Density          H2SO4  [g cm-3]
ddust   = 2.650_JPRB       ! Density          du     [g cm-3]
dbc     = 2._JPRB          ! Density          bc     [g cm-3]
doc     = 2._JPRB          ! Density          oc     [g cm-3]
dnacl   = 2.165_JPRB       ! Density          NaCl   [g cm-3]
dna2so4 = 2.68_JPRB        ! Density          Na2SO4 [g cm-3]
dnahso4 = 2.435_JPRB       ! Density          NaHSO4 [g cm-3]
dh2o    = 1.0_JPRB         ! Density          H2O    [g cm-3]
wh2so4  = 98.0734_JPRB     ! Molecular weight H2SO4  [g mol-1]
wh2o    = 18.0_JPRB        ! Molecular weight H2O    [g mol-1]
wso4    = 96.0576_JPRB     ! Molecular weight SO4    [g mol-1]
wso2    = 64.0_JPRB        ! Molecular weight SO2    [g mol-1]
wna     = 22.99_JPRB       ! Atomic    weight Na     [g mol-1]
wcl     = 35.453_JPRB      ! Atomic    weight Cl     [g mol-1]
wnacl   = 58.443_JPRB      ! Molecular weight NaCl   [g mol-1]
wna2so4 = 142.0376_JPRB    ! Molecular weight Na2SO4 [g mol-1]
wnahso4 = 120.0555_JPRB    ! Molecular weight NaHSO4 [g mol-1]


!--- 9) Assumed parameters: ------------------------------------------------------

critn=100._JPRB            ! Assumed mass of an nucleated sulfate 
!                          ! particle for the Kulmala scheme [molecules]
fmax=0.95_JPRB             ! Factor that limits the condensation 
!                          ! of sulfate to fmax times the available
!                          ! sulfate in the gas phase [1].
!                          ! (m7_dgas)
cLayerThickness = 1.0_JPRB ! Assumed required layer thickness of
!                          ! sulfate to transfer an insoluble 
!                          ! particle to a soluble mode. It is 
!                          ! given in units of layers of 
!                          ! monomolecular sulfate. Determines the
!                          ! transfer rate from insoluble to 
!                          ! soluble modes. 


!--- 10) Computational constants: ------------------------------------------------
! NONE , it would seem!


!--- 11) Data used for the calculation of the aerosol properties -----------------
!       under ambient conditions:
!       (Included the conversion from Pa to hPa in the first parameter.)

wvb(1:17)= &
  & (/  95.80188_JPRB,     -28.5257_JPRB,     -1.082153_JPRB,     0.1466501_JPRB, &
  &    -20627.51_JPRB,    0.0461242_JPRB,     -0.003935_JPRB,      -3.36115_JPRB, &
  &  -0.00024137_JPRB,  0.067938345_JPRB, 0.00000649899_JPRB,   8616124.373_JPRB, &
  &  1.168155578_JPRB, -0.021317481_JPRB,   0.000270358_JPRB, -1353332314.0_JPRB, &
  & -0.002403805_JPRB                                                            /)

gmb(1:9)= &
  & (/ 1.036391467_JPRB,  0.00728531_JPRB,-0.011013887_JPRB, -0.068887407_JPRB, &
  &    0.001047842_JPRB, 0.001049607_JPRB, 0.000740534_JPRB, -1.081202685_JPRB, &
  &  -0.0000029113_JPRB                                                        /)

!--- 12) Logical mask for coagulation kernel: -------------------------------------
!       (The coagulation kernel mask is symmetric and not all 
!        values are used for physical considerations. As its 
!        calculation is very expensive, a mask is used to 
!        calculate only the necessary elements.)

!DATA locoagmask(1:7, 1) / .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.  /
!DATA locoagmask(1:7, 2) / .FALSE., .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.  /
!DATA locoagmask(1:7, 3) / .FALSE., .FALSE., .TRUE.,  .FALSE., .TRUE.,  .FALSE., .FALSE. /
!DATA locoagmask(1:7, 4) / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
!DATA locoagmask(1:7, 5) / .FALSE., .FALSE., .FALSE., .FALSE., .TRUE.,  .FALSE., .FALSE. /
!DATA locoagmask(1:7, 6) / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /
!DATA locoagmask(1:7, 7) / .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /

locoagmask(1:7, 1) = (/ .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.  /)
locoagmask(1:7, 2) = (/ .FALSE., .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.,  .TRUE.  /)
locoagmask(1:7, 3) = (/ .FALSE., .FALSE., .TRUE.,  .FALSE., .TRUE.,  .FALSE., .FALSE. /)
locoagmask(1:7, 4) = (/ .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /)
locoagmask(1:7, 5) = (/ .FALSE., .FALSE., .FALSE., .FALSE., .TRUE.,  .FALSE., .FALSE. /)
locoagmask(1:7, 6) = (/ .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /)
locoagmask(1:7, 7) = (/ .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE., .FALSE. /)


!--- 13) -- Mean mass scavenging coefficients normalized by rain-rate [kg m-2]:
!     JJMorcrette, 20100222 (taken from M7's "xt_wetdep"

!    Rain: Seinfeld & Pandis, Fig 20.15:
					   
rbcr(1:7) = (/ 5.0E-4_JPRB, 1.0E-4_JPRB, 1.0E-3_JPRB, 1.0E-1_JPRB, 1.0E-4_JPRB, 1.0E-3_JPRB, 1.0E-1_JPRB /)

!    Snow: Little available, graphs in Prupbacher show similar order of magnitude in 
!          collection efficiency as rain,therefore assume typical mean value as above:

rbcs(1:7) = (/ 5.0E-3_JPRB, 5.0E-3_JPRB, 5.0E-3_JPRB, 5.0E-3_JPRB, 5.0E-3_JPRB, 5.0E-3_JPRB, 5.0E-3_JPRB /)

!--- Assumed updraft velocity in convective clouds [m s-1]:

rwu=2.0_JPRB


!--- Prescribed scavenging ratios in stratiform and convective clouds

!--- stratifrom cloud water in water and mixed clouds (T>238.5K):
csr_strat_wat(1:7) = (/0.10_JPRB, 0.25_JPRB, 0.85_JPRB, 0.99_JPRB, 0.20_JPRB, 0.40_JPRB, 0.40_JPRB/)

!--- stratifrom cloud ice in mixed clouds (T>238.5K):
csr_strat_mix(1:7) = (/0.10_JPRB, 0.40_JPRB, 0.75_JPRB, 0.75_JPRB, 0.10_JPRB, 0.40_JPRB, 0.40_JPRB/)

!--- stratifrom cloud ice in ice clouds (T<238.5K):
csr_strat_ice(1:7) = (/0.10_JPRB, 0.10_JPRB, 0.10_JPRB, 0.10_JPRB, 0.10_JPRB, 0.10_JPRB, 0.10_JPRB/)

!--- convective clouds:
csr_conv(1:7)      = (/0.20_JPRB, 0.60_JPRB, 0.99_JPRB, 0.99_JPRB, 0.20_JPRB, 0.40_JPRB, 0.40_JPRB/)


!-----------------------------------------------------------------------

!*       2.       READ NAMELIST FOR M7 CONFIGURATION
!                

IF(NAERO > 15) THEN
 CALL POSNAM(NULNAM,'NAEAEM7')
 READ (NULNAM,NAEAEM7)
ENDIF

!--- 2.1) Set the lower mode boundary for the nucleation mode:
!         (Depends on the choice of the nucleation scheme.)

SELECT CASE (nnucl) 
CASE(1)
  crdiv(1)=0.0005E-4_JPRB

CASE(2)
  crdiv(1)=( critn * wh2so4/avo/dh2so4*0.75_JPRB/rpi )**(1._JPRB/3._JPRB)
END SELECT


!--- 2.2) Calculate the radii of average surface for modes 5-7:

! pm6rp_lon_lev(nmod)    ! Ambient radii for current
!                        ! longitude and level [cm]
! pcrtcst(nmod)          ! Critical constant, i.e. number of
!                        ! sulfate to cover an average particle
!                        ! of the mode with a layer of the 
!                        ! thickness determined by cLayerThickness.
! pras(nmod)             ! Radius of average surface 
!                        ! for a single particle [cm]
! pas(nmod)              ! Average surface 
!                        ! for single particle [cm+2]
        
zsurf_molec = 2.39E-15_JPRB ! Average cross-section 
!                           ! of a single H2SO4 molecule [cm+2]

pras(5) = pm6rp_lon_lev(5) * cmr2ras(5)
pras(6) = pm6rp_lon_lev(6) * cmr2ras(6)
pras(7) = pm6rp_lon_lev(7) * cmr2ras(7)

DO jmod=5, 7
           
!--- 2.3) Calculate the average surface of an particle for modes 5-7:

   pas(jmod)    = 4._JPRB * pras(jmod)**2 * RPI

!--- 2.4) Determine the number of sulfate molecules needed to form
!       a cLayerThickness thick layer of sulfate on the particles
!       in modes 5-7:
         
   pcrtcst(jmod) = (pas(jmod) / zsurf_molec) * cLayerThickness

ENDDO


!-- taken from mo_aero

!    zm2n_bcki_ff=3._dp/(4._dp*api*flag('density',idt_mbcki)*(cmr_ff*cmr2ram(iaiti))**3)
!    zm2n_bcki_bb=3._dp/(4._dp*api*flag('density',idt_mbcki)*(cmr_bb*cmr2ram(iaiti))**3)
!
!    zm2n_bcks_bb=3._dp/(4._dp*api*flag('density',idt_mbcks)*(cmr_bb*cmr2ram(iaits))**3)
!
!    zm2n_ocki_ff=3._dp/(4._dp*api*flag('density',idt_mocki)*(cmr_ff*cmr2ram(iaiti))**3)
!    zm2n_ocki_bb=3._dp/(4._dp*api*flag('density',idt_mocki)*(cmr_bb*cmr2ram(iaiti))**3)
!    zm2n_ocki_bg=3._dp/(4._dp*api*flag('density',idt_mocki)*(cmr_bg*cmr2ram(iaiti))**3)
!
!    zm2n_ocks_bb=3._dp/(4._dp*api*flag('density',idt_mocks)*(cmr_bb*cmr2ram(iaits))**3)
!    zm2n_ocks_bg=3._dp/(4._dp*api*flag('density',idt_mocks)*(cmr_bg*cmr2ram(iaits))**3)
!    
!    !??????????????
!    zm2n_s4ks_sk=3._dp/(4._dp*api*flag('density',idt_ms4ks)*(cmr_sk*cmr2ram(iaits))**3)
!    zm2n_s4as_sa=3._dp/(4._dp*api*flag('density',idt_ms4as)*(cmr_sa*cmr2ram(iaccs))**3)
!    zm2n_s4cs_sc=3._dp/(4._dp*api*flag('density',idt_ms4cs)*(cmr_sc*cmr2ram(icoas))**3)
!    !????????????

!-- Emissions
!         Calculate factors to convert mass flux in number flux for
!         given number median radii (cmr) and standard deviation 
!         (implicitly by the conversion factor cmr2ram) of the modes
!
!    N = M/m = M/(4/3 * pi * dens * R(averageMass)**3)
!            = M * (3/(4*pi*dens*R(averageMass)))
!            !
!            = M * zm2n_xx

zd_mbcki=2000._JPRB
zd_mbcks=2000._JPRB
zd_mocki=2000._JPRB
zd_mocks=2000._JPRB
zd_ms4ks=1841._JPRB
zd_ms4as=1841._JPRB
zd_ms4cs=1841._JPRB

rm2n_bcki_ff=3._JPRB/(4._JPRB*RPI*zd_mbcki*(rcmr_ff*cmr2ram(iaiti))**3)
rm2n_bcki_bb=3._JPRB/(4._JPRB*RPI*zd_mbcki*(rcmr_bb*cmr2ram(iaiti))**3)

rm2n_bcks_bb=3._JPRB/(4._JPRB*RPI*zd_mbcks*(rcmr_bb*cmr2ram(iaits))**3)

rm2n_ocki_ff=3._JPRB/(4._JPRB*RPI*zd_mocki*(rcmr_ff*cmr2ram(iaiti))**3)
rm2n_ocki_bb=3._JPRB/(4._JPRB*RPI*zd_mocki*(rcmr_bb*cmr2ram(iaiti))**3)
rm2n_ocki_bg=3._JPRB/(4._JPRB*RPI*zd_mocki*(rcmr_bg*cmr2ram(iaiti))**3)

rm2n_ocks_bb=3._JPRB/(4._JPRB*RPI*zd_mocks*(rcmr_bb*cmr2ram(iaits))**3)
rm2n_ocks_bg=3._JPRB/(4._JPRB*RPI*zd_mocks*(rcmr_bg*cmr2ram(iaits))**3)
    
!?????????????? watch out: might be different for SO4
rm2n_s4ks_sk=3._JPRB/(4._JPRB*RPI*zd_ms4ks*(rcmr_sk*cmr2ram(iaits))**3)
rm2n_s4as_sa=3._JPRB/(4._JPRB*RPI*zd_ms4as*(rcmr_sa*cmr2ram(iaccs))**3)
rm2n_s4cs_sc=3._JPRB/(4._JPRB*RPI*zd_ms4cs*(rcmr_sc*cmr2ram(icoas))**3)
!????????????

!-----------------------------------------------------------------------

!*       3.       COMPUTATION OF VARIOUS PARAMETERS USED IN M7
!
!* added JJMorcrette 20100123

!*       3.1      PARAMETERS FOR SEA-SALT EMISSION after MONAHAN et al. 1986 
!                 using SSAM and SSCM from GADS at 80% r.h.

zr1=0.416_JPRB
zr2=3.49_JPRB                
zb1=0.58_JPRB-1.54_JPRB*LOG10(zr1)
zb2=0.58_JPRB-1.54_JPRB*LOG10(zr2)
zx1=10._JPRB**(1.19_JPRB*EXP(-zb1*zb1))
zx2=10._JPRB**(1.19_JPRB*EXP(-zb2*zb2))
zdr1=0.5_JPRB
zdr2=4.5_JPRB
zfact=1.373_JPRB*4._JPRB/3._JPRB*RPI*1.15E+03_JPRB
RMonSS1=zfact*(1._JPRB+0.057_JPRB*zr1**1.05_JPRB)*zx1*zdr1*1.E-18_JPRB
RMonSS2=zfact*(1._JPRB+0.057_JPRB*zr2**1.05_JPRB)*zx2*zdr2*1.E-18_JPRB

!*       3.2      PRECALCULATED QUANTITIES FOR THE LSCE SEA-SALT EMISSION 
!                 Monahan 1986 and Smith and Harrison 1998 

!--- Precalculated mass fluxes per wind class [kg m-2 s-1]:

rmass1(0:40) = (/                           &
  & 0.000E+00_JPRB, 2.483E-15_JPRB, 2.591E-14_JPRB, 1.022E-13_JPRB, 2.707E-13_JPRB, 5.761E-13_JPRB, &
  & 1.068E-12_JPRB, 1.800E-12_JPRB, 2.829E-12_JPRB, 4.215E-12_JPRB, 6.023E-12_JPRB, 8.317E-12_JPRB, &
  & 1.117E-11_JPRB, 1.464E-11_JPRB, 1.882E-11_JPRB, 2.378E-11_JPRB, 2.959E-11_JPRB, 3.633E-11_JPRB, &
  & 4.409E-11_JPRB, 5.296E-11_JPRB, 6.301E-11_JPRB, 7.433E-11_JPRB, 8.693E-11_JPRB, 1.012E-10_JPRB, &
  & 1.168E-10_JPRB, 1.342E-10_JPRB, 1.532E-10_JPRB, 1.741E-10_JPRB, 1.970E-10_JPRB, 2.219E-10_JPRB, &
  & 2.489E-10_JPRB, 2.781E-10_JPRB, 3.097E-10_JPRB, 3.437E-10_JPRB, 3.803E-10_JPRB, 4.195E-10_JPRB, &
  & 4.616E-10_JPRB, 5.065E-10_JPRB, 5.544E-10_JPRB, 6.054E-10_JPRB, 6.711E-10_JPRB             /)

rmass2(0:40) = (/                               &
  & 0.000E+00_JPRB, 2.319E-13_JPRB, 2.411E-12_JPRB, 9.481E-12_JPRB, 2.505E-11_JPRB, 5.321E-11_JPRB, &
  & 9.850E-11_JPRB, 1.658E-10_JPRB, 2.602E-10_JPRB, 3.874E-10_JPRB, 5.529E-10_JPRB, 7.628E-10_JPRB, &
  & 1.023E-09_JPRB, 1.341E-09_JPRB, 1.722E-09_JPRB, 2.175E-09_JPRB, 2.704E-09_JPRB, 3.319E-09_JPRB, &
  & 4.026E-09_JPRB, 4.832E-09_JPRB, 5.746E-09_JPRB, 6.776E-09_JPRB, 7.925E-09_JPRB, 9.214E-09_JPRB, &
  & 1.064E-08_JPRB, 1.221E-08_JPRB, 1.394E-08_JPRB, 1.584E-08_JPRB, 1.791E-08_JPRB, 2.016E-08_JPRB, &
  & 2.261E-08_JPRB, 2.526E-08_JPRB, 2.812E-08_JPRB, 3.120E-08_JPRB, 3.451E-08_JPRB, 3.806E-08_JPRB, &
  & 4.186E-08_JPRB, 4.592E-08_JPRB, 5.025E-08_JPRB, 5.486E-08_JPRB, 6.014E-08_JPRB             /)

!--- Precalculated number fluxes per wind class [m-2 s-1]:

rnumb1(0:40) = (/                               &
  & 0.000E+00_JPRB, 3.004E+01_JPRB, 3.245E+02_JPRB, 1.306E+03_JPRB, 3.505E+03_JPRB, 7.542E+03_JPRB, &
  & 1.410E+04_JPRB, 2.394E+04_JPRB, 3.787E+04_JPRB, 5.674E+04_JPRB, 8.147E+04_JPRB, 1.130E+05_JPRB, &
  & 1.523E+05_JPRB, 2.005E+05_JPRB, 2.586E+05_JPRB, 3.278E+05_JPRB, 4.091E+05_JPRB, 5.037E+05_JPRB, &
  & 6.129E+05_JPRB, 7.379E+05_JPRB, 8.800E+05_JPRB, 1.041E+06_JPRB, 1.220E+06_JPRB, 1.422E+06_JPRB, &
  & 1.646E+06_JPRB, 1.893E+06_JPRB, 2.166E+06_JPRB, 2.466E+06_JPRB, 2.794E+06_JPRB, 3.152E+06_JPRB, &
  & 3.541E+06_JPRB, 3.962E+06_JPRB, 4.419E+06_JPRB, 4.911E+06_JPRB, 5.441E+06_JPRB, 6.011E+06_JPRB, &
  & 6.621E+06_JPRB, 7.274E+06_JPRB, 7.972E+06_JPRB, 8.716E+06_JPRB, 8.801E+06_JPRB             /)

rnumb2(0:40) = (/                               &
  & 0.000E+00_JPRB, 1.934E+01_JPRB, 2.068E+02_JPRB, 8.271E+02_JPRB, 2.211E+03_JPRB, 4.741E+03_JPRB, &
  & 8.841E+03_JPRB, 1.497E+04_JPRB, 2.363E+04_JPRB, 3.534E+04_JPRB, 5.066E+04_JPRB, 7.017E+04_JPRB, &
  & 9.447E+04_JPRB, 1.242E+05_JPRB, 1.600E+05_JPRB, 2.025E+05_JPRB, 2.525E+05_JPRB, 3.106E+05_JPRB, &
  & 3.776E+05_JPRB, 4.542E+05_JPRB, 5.413E+05_JPRB, 6.395E+05_JPRB, 7.501E+05_JPRB, 8.726E+05_JPRB, &
  & 1.009E+06_JPRB, 1.160E+06_JPRB, 1.327E+06_JPRB, 1.509E+06_JPRB, 1.709E+06_JPRB, 1.927E+06_JPRB, &
  & 2.163E+06_JPRB, 2.420E+06_JPRB, 2.697E+06_JPRB, 2.996E+06_JPRB, 3.318E+06_JPRB, 3.664E+06_JPRB, &
  & 4.034E+06_JPRB, 4.430E+06_JPRB, 4.852E+06_JPRB, 5.303E+06_JPRB, 5.740E+06_JPRB             /)

!--- Precalculated mass flux gradient for each wind class for interpolation [kg m-3]:
!    (dm/dv(i) where m = m(i) + dm/dv(i) * dv(i) )

rdmas1(0:40) = (/                              &
  & 2.483E-15_JPRB, 2.343E-14_JPRB, 7.630E-14_JPRB, 1.684E-13_JPRB, 3.054E-13_JPRB, 4.919E-13_JPRB, &
  & 7.319E-13_JPRB, 1.029E-12_JPRB, 1.386E-12_JPRB, 1.807E-12_JPRB, 2.294E-12_JPRB, 2.850E-12_JPRB, &
  & 3.477E-12_JPRB, 4.174E-12_JPRB, 4.960E-12_JPRB, 5.810E-12_JPRB, 6.745E-12_JPRB, 7.762E-12_JPRB, &
  & 8.863E-12_JPRB, 1.005E-11_JPRB, 1.132E-11_JPRB, 1.260E-11_JPRB, 1.423E-11_JPRB, 1.569E-11_JPRB, &
  & 1.733E-11_JPRB, 1.907E-11_JPRB, 2.090E-11_JPRB, 2.284E-11_JPRB, 2.487E-11_JPRB, 2.700E-11_JPRB, &
  & 2.924E-11_JPRB, 3.158E-11_JPRB, 3.403E-11_JPRB, 3.659E-11_JPRB, 3.925E-11_JPRB, 4.202E-11_JPRB, &
  & 4.490E-11_JPRB, 4.790E-11_JPRB, 5.100E-11_JPRB, 6.578E-11_JPRB, 6.578E-11_JPRB             /)

rdmas2(0:40) = (/                              &
  & 2.319E-13_JPRB, 2.179E-12_JPRB, 7.070E-12_JPRB, 1.557E-11_JPRB, 2.817E-11_JPRB, 4.528E-11_JPRB, &
  & 6.727E-11_JPRB, 9.446E-11_JPRB, 1.271E-10_JPRB, 1.655E-10_JPRB, 2.100E-10_JPRB, 2.606E-10_JPRB, &
  & 3.177E-10_JPRB, 3.812E-10_JPRB, 4.522E-10_JPRB, 5.297E-10_JPRB, 6.145E-10_JPRB, 7.068E-10_JPRB, &
  & 8.066E-10_JPRB, 9.142E-10_JPRB, 1.030E-09_JPRB, 1.149E-09_JPRB, 1.289E-09_JPRB, 1.425E-09_JPRB, &
  & 1.573E-09_JPRB, 1.730E-09_JPRB, 1.896E-09_JPRB, 2.070E-09_JPRB, 2.254E-09_JPRB, 2.447E-09_JPRB, &
  & 2.649E-09_JPRB, 2.860E-09_JPRB, 3.080E-09_JPRB, 3.311E-09_JPRB, 3.550E-09_JPRB, 3.800E-09_JPRB, &
  & 4.060E-09_JPRB, 4.329E-09_JPRB, 4.609E-09_JPRB, 5.279E-09_JPRB, 5.279E-09_JPRB             /)

!--- Precalculated number flux gradient for each wind class for interpolation [m-3]:
!    (dn/dv(i) where n = n(i) + dn/dv(i) * dv(i) )

rdnum1(0:40) = (/                              &
  & 3.004E+01_JPRB, 2.945E+02_JPRB, 9.811E+02_JPRB, 2.200E+03_JPRB, 4.036E+03_JPRB, 6.562E+03_JPRB, &
  & 9.839E+03_JPRB, 1.393E+04_JPRB, 1.887E+04_JPRB, 2.473E+04_JPRB, 3.153E+04_JPRB, 3.935E+04_JPRB, &
  & 4.818E+04_JPRB, 5.808E+04_JPRB, 6.914E+04_JPRB, 8.130E+04_JPRB, 9.465E+04_JPRB, 1.092E+05_JPRB, &
  & 1.250E+05_JPRB, 1.421E+05_JPRB, 1.605E+05_JPRB, 1.798E+05_JPRB, 2.017E+05_JPRB, 2.237E+05_JPRB, &
  & 2.476E+05_JPRB, 2.729E+05_JPRB, 2.997E+05_JPRB, 3.280E+05_JPRB, 3.577E+05_JPRB, 3.890E+05_JPRB, &
  & 4.219E+05_JPRB, 4.564E+05_JPRB, 4.923E+05_JPRB, 5.301E+05_JPRB, 5.695E+05_JPRB, 6.105E+05_JPRB, &
  & 6.531E+05_JPRB, 6.976E+05_JPRB, 7.437E+05_JPRB, 8.550E+04_JPRB, 8.550E+04_JPRB             /)

rdnum2(0:40) = (/                              &
  & 1.934E+01_JPRB, 1.875E+02_JPRB, 6.203E+02_JPRB, 1.384E+03_JPRB, 2.530E+03_JPRB, 4.100E+03_JPRB, &
  & 6.132E+03_JPRB, 8.659E+03_JPRB, 1.171E+04_JPRB, 1.532E+04_JPRB, 1.951E+04_JPRB, 2.430E+04_JPRB, &
  & 2.972E+04_JPRB, 3.582E+04_JPRB, 4.251E+04_JPRB, 4.997E+04_JPRB, 5.812E+04_JPRB, 6.700E+04_JPRB, &
  & 7.663E+04_JPRB, 8.702E+04_JPRB, 9.820E+04_JPRB, 1.106E+05_JPRB, 1.225E+05_JPRB, 1.366E+05_JPRB, &
  & 1.511E+05_JPRB, 1.664E+05_JPRB, 1.826E+05_JPRB, 1.997E+05_JPRB, 2.177E+05_JPRB, 2.366E+05_JPRB, &
  & 2.565E+05_JPRB, 2.773E+05_JPRB, 2.990E+05_JPRB, 3.218E+05_JPRB, 3.455E+05_JPRB, 3.702E+05_JPRB, &
  & 3.959E+05_JPRB, 4.226E+05_JPRB, 4.504E+05_JPRB, 4.376E+05_JPRB, 4.376E+05_JPRB             /)

!-- originally in *carbon_emissions*

rcarbon_nh(1:12) = (/ 1.146_JPRB, 1.139_JPRB, 1.081_JPRB, 0.995_JPRB, 0.916_JPRB, 0.920_JPRB, &
  &                   0.910_JPRB, 0.907_JPRB, 0.934_JPRB, 0.962_JPRB, 1.019_JPRB, 1.072_JPRB /)  
rcarbon_sh = 1.0_JPRB

!-- originally in *bgc_dust_calc_emis*

RMMR_AI = 0.35E-06_JPRB   ! mode radius accumulation mode
RMMR_CI = 1.75E-06        ! mode radius coarse mode
ZSIG_AI = 1.59_JPRB       ! standard dev. around accum. mode
ZSIG_CI = 2.00_JPRB       ! standard dev. around coarse mode
zdensdust=rdens(idt_mduai)! dust particle density [kg m-3]    = 2650._JPRB

rfcon_ai= 3._JPRB/(4._JPRB*RPI*zdensdust*rmmr_ai**3)*exp(4.5_JPRB*LOG(zsig_ai)**2)
rfcon_ci= 3._JPRB/(4._JPRB*RPI*zdensdust*rmmr_ci**3)*exp(4.5_JPRB*LOG(zsig_ci)**2)

!     ------------------------------------------------------------------
IF (LHOOK) CALL DR_HOOK('SU_AERM7',1,ZHOOK_HANDLE)
END SUBROUTINE SU_AERM7
