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

Last change on this file since 2417 was 2332, checked in by mvals, 5 years ago

Mars GCM:
Follow-up of the last commit for the transport of the isotopic ratio: simplification of the transmission of variables from the dynamics to the
physics:

  • libf/dynphy_lonlat/phymars/: iniphysiq_mod.F90: transmission of the content of 2 variables describing the isotopes instead of 4 (nqperes: number of tracers "peres", nqfils:

number of tracers "fils")

  • libf/phymars/: phys_state_var_init_mod.F90, tracer_mod.F: idem callsedim_mod.F: idem co2condens_mod.F: idem
  • libf/phymars/dyn1d: testphys1d.F: idem (the reading interface for traceur.def has been completed to fill the variables nqperes and nqfils).

MV

File size: 6.9 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*30,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      integer,save :: igcm_stormdust_mass   !  storm dust mass mixing ratio
45      integer,save :: igcm_stormdust_number !  storm dust number mixing ratio
46      integer,save :: igcm_topdust_mass   !  topdust mass mixing ratio
47      integer,save :: igcm_topdust_number !  topdust number 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_hdo_vap ! hdo vapour
56      integer,save :: igcm_hdo_ice ! hdo ice
57      integer,save :: igcm_co2_ice ! co2 ice
58
59      ! chemistry:
60      integer,save :: igcm_co2
61      integer,save :: igcm_co
62      integer,save :: igcm_o
63      integer,save :: igcm_o1d
64      integer,save :: igcm_o2
65      integer,save :: igcm_o3
66      integer,save :: igcm_h
67      integer,save :: igcm_h2
68      integer,save :: igcm_oh
69      integer,save :: igcm_ho2
70      integer,save :: igcm_h2o2
71      integer,save :: igcm_n2
72      integer,save :: igcm_ar
73      integer,save :: igcm_n
74      integer,save :: igcm_no
75      integer,save :: igcm_no2
76      integer,save :: igcm_n2d
77      integer,save :: igcm_he
78      integer,save :: igcm_ch4
79      ! Ions
80      integer,save :: igcm_co2plus
81      integer,save :: igcm_oplus
82      integer,save :: igcm_o2plus
83      integer,save :: igcm_coplus
84      integer,save :: igcm_cplus
85      integer,save :: igcm_nplus
86      integer,save :: igcm_noplus
87      integer,save :: igcm_n2plus
88      integer,save :: igcm_hplus
89      integer,save :: igcm_hco2plus
90      integer,save :: igcm_hcoplus
91      integer,save :: igcm_h2oplus
92      integer,save :: igcm_h3oplus
93      integer,save :: igcm_ohplus
94      integer,save :: igcm_elec
95      ! other tracers
96      integer,save :: igcm_ar_n2 ! for simulations using co2 +neutral gas
97      ! MVals: isotopes
98      integer, save                 :: nqperes ! numbers of tracers defined as "peres"
99      integer, allocatable, save    :: nqfils(:) ! numbers of sons ("fils") of the considered tracer
100      real, parameter               :: qperemin=1.e-16 ! threschold for the "pere" mixing ratio qpere to calculate Ratio=qfils/qpere
101      real, parameter               :: masseqmin=1.e-16 ! threschold for the "pere" transporting masse martian case as there are no gran-sons
102
103!-----------------------------------------------------------------------
104
105  contains
106 
107    subroutine ini_tracer_mod(nq,tname,dyn_nqperes,dyn_nqfils)! MVals: variables isotopes
108      implicit none
109     
110      integer,intent(in) :: nq ! number of tracers
111      character(len=*),intent(in) :: tname(nq) ! tracer names
112      !MVals: variables isotopes
113      integer,intent(in) :: dyn_nqperes
114      integer,intent(in) :: dyn_nqfils(nq)
115     
116      integer :: iq, count
117      character(len=20) :: txt ! to store some text
118     
119      ! set dimension and tracer names
120      nqmx=nq
121      allocate(noms(nq))
122      do iq=1,nq
123        noms(iq)=tname(iq)
124        write(*,*) "tracer_mod names : ", trim(noms(iq))
125      enddo
126
127      !MVals: isotopes variables initialisation
128      allocate(nqfils(nq))
129      nqperes=dyn_nqperes   
130      nqfils(:)=dyn_nqfils(:)
131     
132#ifndef MESOSCALE
133      ! check if tracers have 'old' names
134      count=0
135      do iq=1,nq
136        txt=" "
137        write(txt,'(a1,i2.2)') 'q',iq
138        if (txt.eq.tname(iq)) then
139          count=count+1
140        endif
141      enddo ! of do iq=1,nq
142     
143      if ((count.eq.nq).and.(nq.ne.0)) then
144        write(*,*) "ini_tracer_mod: tracers seem to follow old naming ", &
145                   "convention (q01,q02,...)"
146        write(*,*) "you should run newstart to rename them"
147        call abort_physic("ini_tracer_mod","tracer name issue",1)
148      endif
149#endif
150           
151      ! allocate module arrays:
152      ! -- not domain-dependent
153      allocate(mmol(nq))
154      allocate(radius(nq))
155      allocate(rho_q(nq))
156      allocate(alpha_lift(nq))
157      allocate(alpha_devil(nq))
158      allocate(igcm_dustbin(nq))
159      allocate(nqdust(nq))
160     
161    end subroutine ini_tracer_mod
162
163    subroutine end_tracer_mod
164
165    implicit none
166
167      if (allocated(noms)) deallocate(noms)
168      if (allocated(mmol)) deallocate(mmol)
169      if (allocated(radius)) deallocate(radius)
170      if (allocated(rho_q)) deallocate(rho_q)
171      if (allocated(alpha_lift)) deallocate(alpha_lift)
172      if (allocated(alpha_devil)) deallocate(alpha_devil)
173      if (allocated(igcm_dustbin)) deallocate(igcm_dustbin)
174      if (allocated(nqdust)) deallocate(nqdust)
175
176    end subroutine end_tracer_mod
177
178end module tracer_mod
Note: See TracBrowser for help on using the repository browser.