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

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

corrected bugs from rev 1651 that prevented the mesoscale model from compiling. getin does not take double precision arguments. removed meteoriticflux_mod and included the variables in tracer_mod.

File size: 5.2 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      real,save :: meteo_flux_mass   ! meteoritic flux of dust - mmr
29      real,save :: meteo_flux_number ! meteoritic flux of dust - nd
30      integer,save :: meteo_alt
31
32      INTEGER,ALLOCATABLE,SAVE :: nqdust(:) ! to store the indexes of dust tracers (cf aeropacity)
33      real,allocatable,save :: dryness(:)!"Dryness coefficient" for grnd water ice sublimation
34
35
36! tracer indexes: these are initialized in initracer and should be 0 if the
37!                 corresponding tracer does not exist
38      ! dust
39      integer,allocatable,save :: igcm_dustbin(:) ! for dustbin 'dust' tracers
40      ! dust, special doubleq case
41      integer,save :: igcm_dust_mass   ! dust mass mixing ratio
42                                  !   (for transported dust)
43      integer,save :: igcm_dust_number ! dust number mixing ratio
44                                  !   (transported dust)
45      integer,save :: igcm_ccn_mass   ! CCN mass mixing ratio
46      integer,save :: igcm_ccn_number ! CCN number mixing ratio
47      integer,save :: igcm_dust_submicron ! submicron dust mixing ratio
48   
49      integer,save :: igcm_ccnco2_mass   ! CCN (dust and/or water ice) for CO2 mass mixing ratio
50      integer,save :: igcm_ccnco2_number ! CCN (dust and/or water ice) for CO2 number mixing ratio
51
52      ! water
53      integer,save :: igcm_h2o_vap ! water vapour
54      integer,save :: igcm_h2o_ice ! water ice
55      integer,save :: igcm_co2_ice ! co2 ice
56
57      ! chemistry:
58      integer,save :: igcm_co2
59      integer,save :: igcm_co
60      integer,save :: igcm_o
61      integer,save :: igcm_o1d
62      integer,save :: igcm_o2
63      integer,save :: igcm_o3
64      integer,save :: igcm_h
65      integer,save :: igcm_h2
66      integer,save :: igcm_oh
67      integer,save :: igcm_ho2
68      integer,save :: igcm_h2o2
69      integer,save :: igcm_n2
70      integer,save :: igcm_ar
71      integer,save :: igcm_n
72      integer,save :: igcm_no
73      integer,save :: igcm_no2
74      integer,save :: igcm_n2d
75      integer,save :: igcm_ch4
76      ! Ions
77      integer,save :: igcm_co2plus
78      integer,save :: igcm_oplus
79      integer,save :: igcm_o2plus
80      integer,save :: igcm_coplus
81      integer,save :: igcm_cplus
82      integer,save :: igcm_nplus
83      integer,save :: igcm_noplus
84      integer,save :: igcm_n2plus
85      integer,save :: igcm_hplus
86      integer,save :: igcm_hco2plus
87      integer,save :: igcm_elec
88      ! other tracers
89      integer,save :: igcm_ar_n2 ! for simulations using co2 +neutral gas
90
91
92!-----------------------------------------------------------------------
93
94  contains
95 
96    subroutine ini_tracer_mod(nq,tname)
97      implicit none
98     
99      integer,intent(in) :: nq ! number of tracers
100      character(len=*),intent(in) :: tname(nq) ! tracer names
101     
102      integer :: iq, count
103      character(len=20) :: txt ! to store some text
104     
105      ! set dimension and tracer names
106      nqmx=nq
107      allocate(noms(nq))
108      do iq=1,nq
109        noms(iq)=tname(iq)
110        write(*,*) "tracer_mod names : ", trim(noms(iq))
111      enddo
112     
113#ifndef MESOSCALE
114      ! check if tracers have 'old' names
115      count=0
116      do iq=1,nq
117        txt=" "
118        write(txt,'(a1,i2.2)') 'q',iq
119        if (txt.eq.tname(iq)) then
120          count=count+1
121        endif
122      enddo ! of do iq=1,nq
123     
124      if (count.eq.nq) then
125        write(*,*) "ini_tracer_mod: tracers seem to follow old naming ", &
126                   "convention (q01,q02,...)"
127        write(*,*) "you should run newstart to rename them"
128        stop
129      endif
130#endif
131           
132      ! allocate module arrays:
133      allocate(mmol(nq))
134      allocate(radius(nq))
135      allocate(rho_q(nq))
136      allocate(alpha_lift(nq))
137      allocate(alpha_devil(nq))
138      allocate(igcm_dustbin(nq))
139      allocate(nqdust(nq))
140     
141    end subroutine ini_tracer_mod
142
143end module tracer_mod
Note: See TracBrowser for help on using the repository browser.