Changeset 3461 for trunk


Ignore:
Timestamp:
Oct 17, 2024, 5:22:35 PM (2 months ago)
Author:
flefevre
Message:

Mars PCM: back to a clean version of calchim_mod.F90

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/aeronomars/calchim_mod.F90

    r3289 r3461  
    3232      use comcstfi_h, only: pi
    3333      use chemistrydata_mod, only: read_phototable
    34       use photolysis_mod, only: init_photolysis !, nphot
     34      use photolysis_mod, only: init_photolysis, nphot
    3535      use iono_h, only: temp_elect
    3636      use wstats_mod, only: wstats
     
    168168      integer :: ig_vl1
    169169
    170       integer, save :: nb_reaction_3_max     ! number of quadratic reactions
    171       integer, save :: nb_reaction_4_max     ! number of bimolecular reactions
    172       integer, parameter :: nb_reaction_3_max0 = 6    ! number of quadratic reactions
    173       integer, parameter :: nb_reaction_4_max0 = 31   ! number of bimolecular reactions
    174       integer, parameter :: nquench =  9            ! number of quenching + heterogeneous reactions
    175       integer, save :: nphotion            ! number of photoionizations
    176       integer, parameter :: nphotion0 = 0            ! number of photoionizations
    177       integer, save :: nphot                       ! number of photolysis
    178       integer, parameter :: nphot0 = 13           ! number of photolysis
    179                                                   ! is incremented by +2 in calchim if deuterium chemisty)
    180       integer, parameter :: nb_reaction_4_ion = 64     ! quadratic reactions for ionosphere
    181       integer, parameter :: nb_reaction_4_deut = 35    ! quadratic reactions for deuterium chem
    182       integer, save :: nb_phot_max           ! total number of photolysis+photoionizations+quenching reactions
    183       integer, parameter :: nb_phot_max0 = 0 ! total number of photolysis+photoionizations+quenching reactions
    184 !$OMP THREADPRIVATE(nb_reaction_3_max,nb_reaction_4_max,nphotion,nphot,nb_phot_max)
     170      integer :: nb_reaction_3_max     ! number of quadratic reactions
     171      integer :: nb_reaction_4_max     ! number of bimolecular reactions
     172      integer :: nquench               ! number of quenching + heterogeneous reactions
     173      integer :: nphotion              ! number of photoionizations
     174      integer :: nb_reaction_4_ion     ! quadratic reactions for ionosphere
     175      integer :: nb_reaction_4_deut    ! quadratic reactions for deuterium chem
     176      integer :: nb_phot_max           ! total number of photolysis+photoionizations+quenching reactions
     177
    185178
    186179      real    :: latvl1, lonvl1
     
    764757         write(*,*) 'calchim: tracer indices=',niq(:)
    765758
    766          nphot = nphot0         ! number of photolysis
    767                                 ! is incremented by +2 in calchim if deuterium chemisty)
     759
    768760         if (photochem) then
    769761            if (jonline) then
    770762               print*,'calchim: Read UV absorption cross-sections'
    771763               !Add two photodissociations in deuterium chemistry included
    772                if(deutchem) nphot = nphot0 + 2
     764               if(deutchem) nphot = nphot + 2
    773765               call init_photolysis     ! on-line photolysis
    774766            else
     
    851843         if (photochem) then
    852844            ! set number of reactions, depending on ion chemistry or not
    853            ! nb_reaction_4_ion  = 64
    854            ! nb_reaction_4_deut = 35
     845            nb_reaction_4_ion  = 64
     846            nb_reaction_4_deut = 35
    855847
    856848            !Default numbers if no ion and no deuterium chemistry included
    857849
    858            ! nb_reaction_4_max = 31     ! set number of bimolecular reactions
    859            ! nb_reaction_3_max = 6      ! set number of quadratic reactions
    860            ! nquench           = 9      ! set number of quenching + heterogeneous
    861            ! nphotion          = 0      ! set number of photoionizations
    862             nb_reaction_4_max = nb_reaction_4_max0     ! set number of bimolecular reactions
    863             nb_reaction_3_max = nb_reaction_3_max0      ! set number of quadratic reactions
    864             nphotion          = nphotion0      ! set number of photoionizations
    865             nb_phot_max = nb_phot_max0
     850            nb_reaction_4_max = 31     ! set number of bimolecular reactions
     851            nb_reaction_3_max = 6      ! set number of quadratic reactions
     852            nquench           = 9      ! set number of quenching + heterogeneous
     853            nphotion          = 0      ! set number of photoionizations
     854
    866855            if (ionchem) then
    867                nb_reaction_4_max = nb_reaction_4_max0 + nb_reaction_4_ion 
    868                nphotion          = nphotion0 + 18   ! set number of photoionizations
     856               nb_reaction_4_max = nb_reaction_4_max + nb_reaction_4_ion 
     857               nphotion          = 18   ! set number of photoionizations
    869858            endif
    870859            if(deutchem) then
     
    875864!        numerically as a photolysis:
    876865
    877             nb_phot_max = nb_phot_max0 + nphot + nphotion + nquench
    878 !          print*, 'nb_phot_max = ', nb_phot_max
    879 !         print*, 'nb_reaction_4_max=', nb_reaction_4_max
    880 !          print*, 'nb_reaction_3_max=', nb_reaction_3_max
     866            nb_phot_max = nphot + nphotion + nquench
     867
    881868!        call main photochemistry routine
    882869
Note: See TracChangeset for help on using the changeset viewer.