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

Last change on this file since 4211 was 4103, checked in by jbclement, 2 months ago

Mars PCM:
Deletion of unused and redundant declaration of coefficient 'dryness' in "tracer_mod.F90".
JBC

File size: 9.3 KB
Line 
1module tracer_mod
2
3 implicit none
4 
5      ! number of tracers:
6      integer,save :: nqmx ! initialized in conf_phys
7
8!$OMP THREADPRIVATE(nqmx) 
9   
10      character*30,allocatable,save ::  noms(:)  ! name of the tracer
11      real,allocatable,save :: mmol(:)           ! mole mass of tracer (g/mol-1)
12      real,allocatable,save :: radius(:)   ! dust and ice particle radius (m)
13      real,allocatable,save :: rho_q(:)    ! tracer densities (kg.m-3)
14      real,allocatable,save :: alpha_lift(:) ! saltation vertical flux/horiz flux ratio (m-1)
15      real,allocatable,save :: alpha_devil(:) ! lifting coeeficient by dust devil
16
17!$OMP THREADPRIVATE(noms,mmol,radius,rho_q,alpha_lift,                           &
18!$OMP                alpha_devil) 
19
20      real,save :: varian      ! Characteristic variance of log-normal distribution
21      real,save :: r3n_q     ! used to compute r0 from number and mass mixing ratio
22      real,save :: rho_dust     ! Mars dust density (kg.m-3)
23      real,save :: rho_ice     ! Water ice density (kg.m-3)
24      real,save :: nuice_ref   ! Effective variance of the water ice dist.
25      real,save :: nuice_sed   ! Sedimentation effective variance of the water ice dist.
26      real,save :: ref_r0        ! for computing reff=ref_r0*r0 (in log.n. distribution)
27      real,save :: rho_ice_co2     ! co2 ice density (kg.m-3)
28      real,save :: nuiceco2_sed   ! Sedimentation effective variance of the co2 ice dist.
29      real,save :: nuiceco2_ref   ! Effective variance of the co2 ice dist.
30
31!$OMP THREADPRIVATE(varian,r3n_q,rho_dust,rho_ice,nuice_ref,                     &
32!$OMP                nuice_sed,ref_r0,rho_ice_co2,nuiceco2_sed,nuiceco2_ref) 
33     
34      real,save :: ccn_factor  ! ratio of nuclei for water ice particles
35
36!$OMP THREADPRIVATE(ccn_factor) 
37
38      INTEGER,ALLOCATABLE,SAVE :: nqdust(:) ! to store the indexes of dust tracers (cf aeropacity)
39
40!$OMP THREADPRIVATE(nqdust) 
41
42
43! tracer indexes: these are initialized in initracer and should be 0 if the
44!                 corresponding tracer does not exist
45      ! dust
46      integer,allocatable,save :: igcm_dustbin(:) ! for dustbin 'dust' tracers
47      ! dust, special doubleq case
48      integer,save :: igcm_dust_mass   ! dust mass mixing ratio
49                                  !   (for transported dust)
50      integer,save :: igcm_dust_number ! dust number mixing ratio
51                                  !   (transported dust)
52      integer,save :: igcm_ccn_mass   ! CCN mass mixing ratio
53      integer,save :: igcm_ccn_number ! CCN number mixing ratio
54      integer,save :: igcm_dust_submicron ! submicron dust mixing ratio
55      integer,save :: igcm_stormdust_mass   !  storm dust mass mixing ratio
56      integer,save :: igcm_stormdust_number !  storm dust number mixing ratio
57      integer,save :: igcm_topdust_mass   !  topdust mass mixing ratio
58      integer,save :: igcm_topdust_number !  topdust number mixing ratio
59
60!$OMP THREADPRIVATE(igcm_dustbin,igcm_dust_mass,igcm_dust_number,igcm_ccn_mass,  &
61!$OMP                igcm_ccn_number,igcm_dust_submicron,igcm_stormdust_mass,    &
62!$OMP                igcm_stormdust_number,igcm_topdust_mass,igcm_topdust_number) 
63
64      integer,save :: igcm_ccnco2_mass   ! CCN (dust and/or water ice) for CO2 mass mixing ratio
65      integer,save :: igcm_ccnco2_number ! CCN (dust and/or water ice) for CO2 number mixing ratio
66      integer,save :: igcm_ccnco2_meteor_mass   ! CCN (dust and/or water ice) for CO2 mass mixing ratio
67      integer,save :: igcm_ccnco2_meteor_number ! CCN (dust and/or water ice) for CO2 number mixing ratio
68      integer,save :: igcm_ccnco2_h2o_mass_ice   ! CCN (dust and/or water ice) for CO2 mass mixing ratio
69      integer,save :: igcm_ccnco2_h2o_mass_ccn   ! CCN (dust and/or water ice) for CO2 mass mixing ratio
70      integer,save :: igcm_ccnco2_h2o_number ! CCN (dust and/or water ice) for CO2 number mixing ratio
71
72!$OMP THREADPRIVATE(igcm_ccnco2_mass,igcm_ccnco2_number,                         &
73!$OMP                igcm_ccnco2_h2o_mass_ice,igcm_ccnco2_h2o_mass_ccn,          &
74!$OMP                igcm_ccnco2_h2o_number) 
75
76      ! water
77      integer,save :: igcm_h2o_vap ! water vapour
78      integer,save :: igcm_h2o_ice ! water ice
79      integer,save :: igcm_hdo_vap ! hdo vapour
80      integer,save :: igcm_hdo_ice ! hdo ice
81      integer,save :: igcm_co2_ice ! co2 ice
82
83!$OMP THREADPRIVATE(igcm_h2o_vap, igcm_h2o_ice, igcm_hdo_vap, igcm_hdo_ice,      &
84!$OMP                igcm_co2_ice) 
85
86      ! chemistry:
87      integer,save :: igcm_co2
88      integer,save :: igcm_co
89      integer,save :: igcm_o
90      integer,save :: igcm_o1d
91      integer,save :: igcm_o2
92      integer,save :: igcm_o3
93      integer,save :: igcm_h
94      integer,save :: igcm_h2
95      integer,save :: igcm_oh
96      integer,save :: igcm_ho2
97      integer,save :: igcm_h2o2
98      integer,save :: igcm_n2
99      integer,save :: igcm_ar
100      integer,save :: igcm_n
101      integer,save :: igcm_no
102      integer,save :: igcm_no2
103      integer,save :: igcm_n2d
104      integer,save :: igcm_he
105      integer,save :: igcm_ch4
106
107!$OMP THREADPRIVATE(igcm_co2,igcm_co,igcm_o,igcm_o1d,igcm_o2,igcm_o3,igcm_h,   &
108!$OMP                igcm_h2,igcm_oh,igcm_ho2,igcm_h2o2,igcm_n2,igcm_ar,igcm_n,&
109!$OMP               igcm_no,igcm_no2,igcm_n2d,igcm_he,igcm_ch4)
110
111      !Deuterated species derived from HDO
112      integer,save :: igcm_od
113      integer,save :: igcm_d
114      integer,save :: igcm_hd
115      integer,save :: igcm_do2
116      integer,save :: igcm_hdo2
117
118!$OMP THREADPRIVATE(igcm_od,igcm_d,igcm_hd, igcm_do2,igcm_hdo2)
119
120      ! Ions
121      integer,save :: igcm_co2plus
122      integer,save :: igcm_oplus
123      integer,save :: igcm_o2plus
124      integer,save :: igcm_coplus
125      integer,save :: igcm_cplus
126      integer,save :: igcm_nplus
127      integer,save :: igcm_noplus
128      integer,save :: igcm_n2plus
129      integer,save :: igcm_hplus
130      integer,save :: igcm_hco2plus
131      integer,save :: igcm_hcoplus
132      integer,save :: igcm_h2oplus
133      integer,save :: igcm_h3oplus
134      integer,save :: igcm_ohplus
135      integer,save :: igcm_elec
136
137!$OMP THREADPRIVATE(igcm_co2plus,igcm_oplus,igcm_o2plus,igcm_coplus,igcm_cplus,   &
138!$OMP                igcm_nplus,igcm_noplus,igcm_n2plus,igcm_hplus,igcm_hco2plus,&
139!$OMP                igcm_hcoplus,igcm_h2oplus,igcm_h3oplus,igcm_ohplus,igcm_elec)
140
141      ! other tracers
142      integer,save :: igcm_ar_n2 ! for simulations using co2 +neutral gas
143      ! MVals: isotopes
144      integer, save                 :: nqperes ! numbers of tracers defined as "peres"
145      integer, allocatable, save    :: nqfils(:) ! numbers of sons ("fils") of the considered tracer
146
147!$OMP THREADPRIVATE(igcm_ar_n2,nqperes,nqfils) 
148
149      real, parameter               :: qperemin=1.e-16 ! threschold for the "pere" mixing ratio qpere to calculate Ratio=qfils/qpere
150      real, parameter               :: masseqmin=1.e-16 ! threschold for the "pere" transporting masse martian case as there are no gran-sons
151
152!-----------------------------------------------------------------------
153
154  contains
155 
156    subroutine ini_tracer_mod(nq,tname,dyn_nqperes,dyn_nqfils)! MVals: variables isotopes
157      implicit none
158     
159      integer,intent(in) :: nq ! number of tracers
160      character(len=*),intent(in) :: tname(nq) ! tracer names
161      !MVals: variables isotopes
162      integer,intent(in) :: dyn_nqperes
163      integer,intent(in) :: dyn_nqfils(nq)
164     
165      integer :: iq, count
166      character(len=20) :: txt ! to store some text
167
168      logical :: co2_tracer_found=.false.
169     
170      ! set dimension and tracer names
171      nqmx=nq
172      allocate(noms(nq))
173      do iq=1,nq
174        noms(iq)=tname(iq)
175        write(*,*) "tracer_mod names : ", trim(noms(iq))
176        if(noms(iq).eq."co2") then
177           co2_tracer_found=.true.
178        endif
179      enddo
180
181      if(.not.co2_tracer_found) then
182         call abort_physic("ini_tracer_mod","co2 tracer is now mandatory",1)
183      endif
184
185      !MVals: isotopes variables initialisation
186      allocate(nqfils(nq))
187      nqperes=dyn_nqperes   
188      nqfils(:)=dyn_nqfils(:)
189     
190#ifndef MESOSCALE
191      ! check if tracers have 'old' names
192      count=0
193      do iq=1,nq
194        txt=" "
195        write(txt,'(a1,i2.2)') 'q',iq
196        if (txt.eq.tname(iq)) then
197          count=count+1
198        endif
199      enddo ! of do iq=1,nq
200     
201      if ((count.eq.nq).and.(nq.ne.0)) then
202        write(*,*) "ini_tracer_mod: tracers seem to follow old naming ", &
203                   "convention (q01,q02,...)"
204        write(*,*) "you should run newstart to rename them"
205        call abort_physic("ini_tracer_mod","tracer name issue",1)
206      endif
207#endif
208           
209      ! allocate module arrays:
210      ! -- not domain-dependent
211      allocate(mmol(nq))
212      allocate(radius(nq))
213      allocate(rho_q(nq))
214      allocate(alpha_lift(nq))
215      allocate(alpha_devil(nq))
216      allocate(igcm_dustbin(nq))
217      allocate(nqdust(nq))
218     
219    end subroutine ini_tracer_mod
220
221    subroutine end_tracer_mod
222
223    implicit none
224
225      if (allocated(noms)) deallocate(noms)
226      if (allocated(mmol)) deallocate(mmol)
227      if (allocated(radius)) deallocate(radius)
228      if (allocated(rho_q)) deallocate(rho_q)
229      if (allocated(alpha_lift)) deallocate(alpha_lift)
230      if (allocated(alpha_devil)) deallocate(alpha_devil)
231      if (allocated(igcm_dustbin)) deallocate(igcm_dustbin)
232      if (allocated(nqdust)) deallocate(nqdust)
233
234    end subroutine end_tracer_mod
235
236end module tracer_mod
Note: See TracBrowser for help on using the repository browser.