source: trunk/LMDZ.MARS/libf/phymars/tracer_mod.F90 @ 1633

Last change on this file since 1633 was 1633, checked in by aslmd, 8 years ago

changed MESOSCALE precompiling flag to use tracer initialization

File size: 5.0 KB
Line 
1module tracer_mod
2
3 implicit none
4 
5      ! number of tracers:
6      integer,save :: nqmx ! initialized in conf_phys
7   
8      character*20,allocatable,save ::  noms(:)  ! name of the tracer
9      real,allocatable,save :: mmol(:)           ! mole mass of tracer (g/mol-1)
10      real,allocatable,save :: radius(:)   ! dust and ice particle radius (m)
11      real,allocatable,save :: rho_q(:)    ! tracer densities (kg.m-3)
12      real,allocatable,save :: alpha_lift(:) ! saltation vertical flux/horiz flux ratio (m-1)
13      real,allocatable,save :: alpha_devil(:) ! lifting coeeficient by dust devil
14
15      real,save :: varian      ! Characteristic variance of log-normal distribution
16      real,save :: r3n_q     ! used to compute r0 from number and mass mixing ratio
17      real,save :: rho_dust     ! Mars dust density (kg.m-3)
18      real,save :: rho_ice     ! Water ice density (kg.m-3)
19      real,save :: nuice_ref   ! Effective variance of the water ice dist.
20      real,save :: nuice_sed   ! Sedimentation effective variance of the water ice dist.
21      real,save :: ref_r0        ! for computing reff=ref_r0*r0 (in log.n. distribution)
22      real,save :: rho_ice_co2     ! co2 ice density (kg.m-3)
23      real,save :: nuiceco2_sed   ! Sedimentation effective variance of the co2 ice dist.
24      real,save :: nuiceco2_ref   ! Effective variance of the co2 ice dist.
25
26      real,save :: ccn_factor  ! ratio of nuclei for water ice particles
27
28      INTEGER,ALLOCATABLE,SAVE :: nqdust(:) ! to store the indexes of dust tracers (cf aeropacity)
29      real,allocatable,save :: dryness(:)!"Dryness coefficient" for grnd water ice sublimation
30
31
32! tracer indexes: these are initialized in initracer and should be 0 if the
33!                 corresponding tracer does not exist
34      ! dust
35      integer,allocatable,save :: igcm_dustbin(:) ! for dustbin 'dust' tracers
36      ! dust, special doubleq case
37      integer,save :: igcm_dust_mass   ! dust mass mixing ratio
38                                  !   (for transported dust)
39      integer,save :: igcm_dust_number ! dust number mixing ratio
40                                  !   (transported dust)
41      integer,save :: igcm_ccn_mass   ! CCN mass mixing ratio
42      integer,save :: igcm_ccn_number ! CCN number mixing ratio
43      integer,save :: igcm_dust_submicron ! submicron dust mixing ratio
44   
45      integer,save :: igcm_ccnco2_mass   ! CCN (dust and/or water ice) for CO2 mass mixing ratio
46      integer,save :: igcm_ccnco2_number ! CCN (dust and/or water ice) for CO2 number mixing ratio
47
48      ! water
49      integer,save :: igcm_h2o_vap ! water vapour
50      integer,save :: igcm_h2o_ice ! water ice
51      integer,save :: igcm_co2_ice ! co2 ice
52
53      ! chemistry:
54      integer,save :: igcm_co2
55      integer,save :: igcm_co
56      integer,save :: igcm_o
57      integer,save :: igcm_o1d
58      integer,save :: igcm_o2
59      integer,save :: igcm_o3
60      integer,save :: igcm_h
61      integer,save :: igcm_h2
62      integer,save :: igcm_oh
63      integer,save :: igcm_ho2
64      integer,save :: igcm_h2o2
65      integer,save :: igcm_n2
66      integer,save :: igcm_ar
67      integer,save :: igcm_n
68      integer,save :: igcm_no
69      integer,save :: igcm_no2
70      integer,save :: igcm_n2d
71      integer,save :: igcm_ch4
72      ! Ions
73      integer,save :: igcm_co2plus
74      integer,save :: igcm_oplus
75      integer,save :: igcm_o2plus
76      integer,save :: igcm_coplus
77      integer,save :: igcm_cplus
78      integer,save :: igcm_nplus
79      integer,save :: igcm_noplus
80      integer,save :: igcm_n2plus
81      integer,save :: igcm_hplus
82      integer,save :: igcm_hco2plus
83      integer,save :: igcm_elec
84      ! other tracers
85      integer,save :: igcm_ar_n2 ! for simulations using co2 +neutral gas
86
87
88!-----------------------------------------------------------------------
89
90  contains
91 
92    subroutine ini_tracer_mod(nq,tname)
93      implicit none
94     
95      integer,intent(in) :: nq ! number of tracers
96      character(len=*),intent(in) :: tname(nq) ! tracer names
97     
98      integer :: iq, count
99      character(len=20) :: txt ! to store some text
100     
101      ! set dimension and tracer names
102      nqmx=nq
103      allocate(noms(nq))
104      do iq=1,nq
105        noms(iq)=tname(iq)
106        write(*,*) "tracer_mod names : ", trim(noms(iq))
107      enddo
108     
109#ifndef MESOSCALE
110      ! check if tracers have 'old' names
111      count=0
112      do iq=1,nq
113        txt=" "
114        write(txt,'(a1,i2.2)') 'q',iq
115        if (txt.eq.tname(iq)) then
116          count=count+1
117        endif
118      enddo ! of do iq=1,nq
119     
120      if (count.eq.nq) then
121        write(*,*) "ini_tracer_mod: tracers seem to follow old naming ", &
122                   "convention (q01,q02,...)"
123        write(*,*) "you should run newstart to rename them"
124        stop
125      endif
126#endif
127           
128      ! allocate module arrays:
129      allocate(mmol(nq))
130      allocate(radius(nq))
131      allocate(rho_q(nq))
132      allocate(alpha_lift(nq))
133      allocate(alpha_devil(nq))
134      allocate(igcm_dustbin(nq))
135      allocate(nqdust(nq))
136     
137    end subroutine ini_tracer_mod
138
139end module tracer_mod
Note: See TracBrowser for help on using the repository browser.