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

Last change on this file since 2156 was 1974, checked in by mvals, 6 years ago

Mars GCM:
Integration of the detached dust layer parametrizations (rocket dust storm, slope wind lifting, CW, and dust injection scheme, DB).
Still experimental, default behaviour (rdstorm=.false., dustinjection=0) identical to previous revision.
NB: Updated newstart requires an updated "surface.nc" containing the "hmons" field.
EM+MV

File size: 5.8 KB
RevLine 
[1036]1module tracer_mod
2
3 implicit none
4 
5      ! number of tracers:
[1224]6      integer,save :: nqmx ! initialized in conf_phys
[1617]7   
[1974]8      character*30,allocatable,save ::  noms(:)  ! name of the tracer
[1036]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)
[1617]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.
[1974]25     
[1036]26      real,save :: ccn_factor  ! ratio of nuclei for water ice particles
27
[1224]28      INTEGER,ALLOCATABLE,SAVE :: nqdust(:) ! to store the indexes of dust tracers (cf aeropacity)
[1617]29      real,allocatable,save :: dryness(:)!"Dryness coefficient" for grnd water ice sublimation
[1224]30
[1617]31
[1036]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
[1974]44      integer,save :: igcm_stormdust_mass   !  storm dust mass mixing ratio
45      integer,save :: igcm_stormdust_number !  storm dust number mixing ratio
46   
[1617]47      integer,save :: igcm_ccnco2_mass   ! CCN (dust and/or water ice) for CO2 mass mixing ratio
48      integer,save :: igcm_ccnco2_number ! CCN (dust and/or water ice) for CO2 number mixing ratio
49
[1036]50      ! water
51      integer,save :: igcm_h2o_vap ! water vapour
52      integer,save :: igcm_h2o_ice ! water ice
[1617]53      integer,save :: igcm_co2_ice ! co2 ice
54
[1036]55      ! chemistry:
56      integer,save :: igcm_co2
57      integer,save :: igcm_co
58      integer,save :: igcm_o
59      integer,save :: igcm_o1d
60      integer,save :: igcm_o2
61      integer,save :: igcm_o3
62      integer,save :: igcm_h
63      integer,save :: igcm_h2
64      integer,save :: igcm_oh
65      integer,save :: igcm_ho2
66      integer,save :: igcm_h2o2
67      integer,save :: igcm_n2
68      integer,save :: igcm_ar
69      integer,save :: igcm_n
70      integer,save :: igcm_no
71      integer,save :: igcm_no2
72      integer,save :: igcm_n2d
[1660]73      integer,save :: igcm_he
[1036]74      integer,save :: igcm_ch4
75      ! Ions
76      integer,save :: igcm_co2plus
77      integer,save :: igcm_oplus
78      integer,save :: igcm_o2plus
79      integer,save :: igcm_coplus
80      integer,save :: igcm_cplus
81      integer,save :: igcm_nplus
82      integer,save :: igcm_noplus
83      integer,save :: igcm_n2plus
84      integer,save :: igcm_hplus
85      integer,save :: igcm_hco2plus
86      integer,save :: igcm_elec
87      ! other tracers
88      integer,save :: igcm_ar_n2 ! for simulations using co2 +neutral gas
89
90
91!-----------------------------------------------------------------------
92
[1621]93  contains
94 
95    subroutine ini_tracer_mod(nq,tname)
96      implicit none
97     
98      integer,intent(in) :: nq ! number of tracers
99      character(len=*),intent(in) :: tname(nq) ! tracer names
100     
101      integer :: iq, count
102      character(len=20) :: txt ! to store some text
103     
104      ! set dimension and tracer names
105      nqmx=nq
106      allocate(noms(nq))
107      do iq=1,nq
108        noms(iq)=tname(iq)
109        write(*,*) "tracer_mod names : ", trim(noms(iq))
110      enddo
[1633]111     
112#ifndef MESOSCALE
[1621]113      ! check if tracers have 'old' names
114      count=0
115      do iq=1,nq
116        txt=" "
117        write(txt,'(a1,i2.2)') 'q',iq
118        if (txt.eq.tname(iq)) then
119          count=count+1
120        endif
121      enddo ! of do iq=1,nq
122     
[1941]123      if ((count.eq.nq).and.(nq.ne.0)) then
[1621]124        write(*,*) "ini_tracer_mod: tracers seem to follow old naming ", &
125                   "convention (q01,q02,...)"
126        write(*,*) "you should run newstart to rename them"
[1941]127        call abort_physic("ini_tracer_mod","tracer name issue",1)
[1621]128      endif
129#endif
130           
131      ! allocate module arrays:
[1770]132      ! -- not domain-dependent
[1621]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
[1770]143    subroutine end_tracer_mod
144
145    implicit none
146
147      if (allocated(noms)) deallocate(noms)
148      if (allocated(mmol)) deallocate(mmol)
149      if (allocated(radius)) deallocate(radius)
150      if (allocated(rho_q)) deallocate(rho_q)
151      if (allocated(alpha_lift)) deallocate(alpha_lift)
152      if (allocated(alpha_devil)) deallocate(alpha_devil)
153      if (allocated(igcm_dustbin)) deallocate(igcm_dustbin)
154      if (allocated(nqdust)) deallocate(nqdust)
155
156    end subroutine end_tracer_mod
157
[1036]158end module tracer_mod
Note: See TracBrowser for help on using the repository browser.