Index: trunk/LMDZ.MARS/libf/aeronomars/calchim_mod.F90
===================================================================
--- trunk/LMDZ.MARS/libf/aeronomars/calchim_mod.F90	(revision 3443)
+++ trunk/LMDZ.MARS/libf/aeronomars/calchim_mod.F90	(revision 3461)
@@ -32,5 +32,5 @@
       use comcstfi_h, only: pi
       use chemistrydata_mod, only: read_phototable
-      use photolysis_mod, only: init_photolysis !, nphot
+      use photolysis_mod, only: init_photolysis, nphot
       use iono_h, only: temp_elect
       use wstats_mod, only: wstats
@@ -168,19 +168,12 @@
       integer :: ig_vl1
 
-      integer, save :: nb_reaction_3_max     ! number of quadratic reactions
-      integer, save :: nb_reaction_4_max     ! number of bimolecular reactions
-      integer, parameter :: nb_reaction_3_max0 = 6    ! number of quadratic reactions
-      integer, parameter :: nb_reaction_4_max0 = 31   ! number of bimolecular reactions
-      integer, parameter :: nquench =  9            ! number of quenching + heterogeneous reactions
-      integer, save :: nphotion            ! number of photoionizations
-      integer, parameter :: nphotion0 = 0            ! number of photoionizations
-      integer, save :: nphot                       ! number of photolysis 
-      integer, parameter :: nphot0 = 13           ! number of photolysis 
-                                                  ! is incremented by +2 in calchim if deuterium chemisty)
-      integer, parameter :: nb_reaction_4_ion = 64     ! quadratic reactions for ionosphere
-      integer, parameter :: nb_reaction_4_deut = 35    ! quadratic reactions for deuterium chem
-      integer, save :: nb_phot_max           ! total number of photolysis+photoionizations+quenching reactions
-      integer, parameter :: nb_phot_max0 = 0 ! total number of photolysis+photoionizations+quenching reactions
-!$OMP THREADPRIVATE(nb_reaction_3_max,nb_reaction_4_max,nphotion,nphot,nb_phot_max) 
+      integer :: nb_reaction_3_max     ! number of quadratic reactions
+      integer :: nb_reaction_4_max     ! number of bimolecular reactions
+      integer :: nquench               ! number of quenching + heterogeneous reactions
+      integer :: nphotion              ! number of photoionizations
+      integer :: nb_reaction_4_ion     ! quadratic reactions for ionosphere
+      integer :: nb_reaction_4_deut    ! quadratic reactions for deuterium chem
+      integer :: nb_phot_max           ! total number of photolysis+photoionizations+quenching reactions
+
 
       real    :: latvl1, lonvl1
@@ -764,11 +757,10 @@
          write(*,*) 'calchim: tracer indices=',niq(:)
 
-         nphot = nphot0         ! number of photolysis 
-                                ! is incremented by +2 in calchim if deuterium chemisty)
+
          if (photochem) then
             if (jonline) then
                print*,'calchim: Read UV absorption cross-sections'
                !Add two photodissociations in deuterium chemistry included
-               if(deutchem) nphot = nphot0 + 2
+               if(deutchem) nphot = nphot + 2
                call init_photolysis     ! on-line photolysis
             else
@@ -851,20 +843,17 @@
          if (photochem) then
             ! set number of reactions, depending on ion chemistry or not
-           ! nb_reaction_4_ion  = 64
-           ! nb_reaction_4_deut = 35
+            nb_reaction_4_ion  = 64
+            nb_reaction_4_deut = 35
 
             !Default numbers if no ion and no deuterium chemistry included
 
-           ! nb_reaction_4_max = 31     ! set number of bimolecular reactions
-           ! nb_reaction_3_max = 6      ! set number of quadratic reactions
-           ! nquench           = 9      ! set number of quenching + heterogeneous
-           ! nphotion          = 0      ! set number of photoionizations
-            nb_reaction_4_max = nb_reaction_4_max0     ! set number of bimolecular reactions
-            nb_reaction_3_max = nb_reaction_3_max0      ! set number of quadratic reactions
-            nphotion          = nphotion0      ! set number of photoionizations
-            nb_phot_max = nb_phot_max0
+            nb_reaction_4_max = 31     ! set number of bimolecular reactions
+            nb_reaction_3_max = 6      ! set number of quadratic reactions
+            nquench           = 9      ! set number of quenching + heterogeneous
+            nphotion          = 0      ! set number of photoionizations
+
             if (ionchem) then
-               nb_reaction_4_max = nb_reaction_4_max0 + nb_reaction_4_ion  
-               nphotion          = nphotion0 + 18   ! set number of photoionizations
+               nb_reaction_4_max = nb_reaction_4_max + nb_reaction_4_ion  
+               nphotion          = 18   ! set number of photoionizations
             endif
             if(deutchem) then
@@ -875,8 +864,6 @@
 !        numerically as a photolysis:
 
-            nb_phot_max = nb_phot_max0 + nphot + nphotion + nquench
-!          print*, 'nb_phot_max = ', nb_phot_max
-!	  print*, 'nb_reaction_4_max=', nb_reaction_4_max 
-!          print*, 'nb_reaction_3_max=', nb_reaction_3_max 
+            nb_phot_max = nphot + nphotion + nquench
+
 !        call main photochemistry routine
 
