source: trunk/LMDZ.TITAN/libf/phytitan/comchem_h.F90 @ 1901

Last change on this file since 1901 was 1899, checked in by jvatant, 7 years ago

Fixing an incoherence - the upper chemistry fields
are in molar mixing ratio not mass mixing ratio
--JVO

File size: 3.5 KB
Line 
1MODULE comchem_h
2
3! ----------------------------------------------------------------------------
4! Purpose : Stores data relative to chemistry in the GCM and upper chemistry
5! -------
6!           Please note that upper fields ykim_up are in molar fraction !
7!
8!          NB : For newstart there is a specific comchem_newstart_h module.
9!
10! Author : Jan Vatant d'Ollone (2017-18)
11! ------
12!
13! NB : A given order is assumed for the 44 chemistry tracers :
14! --   H, H2, CH, CH2s, CH2, CH3, CH4, C2, C2H, C2H2, C2H3, C2H4, C2H5,
15!      C2H6, C3H3, C3H5, C3H6, C3H7, C4H, C4H3, C4H4, C4H2s, CH2CCH2,
16!      CH3CCH, C3H8, C4H2, C4H6, C4H10, AC6H6, C3H2, C4H5, AC6H5, N2,
17!      N4S, CN, HCN, H2CN, CHCN, CH2CN, CH3CN, C3N, HC3N, NCCN, C4N2
18       
19! ----------------------------------------------------------------------------
20
21IMPLICIT NONE 
22
23   !! Hard-coded chemical species for Titan chemistry
24   CHARACTER(len=10), DIMENSION(44), PARAMETER  :: cnames = &
25     (/"H         ", "H2        ", "CH        ", "CH2s      ", "CH2       ", "CH3       ", &
26       "CH4       ", "C2        ", "C2H       ", "C2H2      ", "C2H3      ", "C2H4      ", &
27       "C2H5      ", "C2H6      ", "C3H3      ", "C3H5      ", "C3H6      ", "C3H7      ", &
28       "C4H       ", "C4H3      ", "C4H4      ", "C4H2s     ", "CH2CCH2   ", "CH3CCH    ", &
29       "C3H8      ", "C4H2      ", "C4H6      ", "C4H10     ", "AC6H6     ", "C3H2      ", &
30       "C4H5      ", "AC6H5     ", "N2        ", "N4S       ", "CN        ", "HCN       ", &
31       "H2CN      ", "CHCN      ", "CH2CN     ", "CH3CN     ", "C3N       ", "HC3N      ", &
32       "NCCN      ", "C4N2      "/)
33   !! Hard-coded chemical species molar mass (g.mol-1), shares the same indexing than cnames.
34   REAL, DIMENSION(44), PARAMETER               :: cmmol = (/ &
35       1.01   , 2.0158, 13.02, 14.03, 14.03, 15.03, 16.04  , 24.02, 25.03, 26.04  , 27.05  , &
36       28.05  , 29.06 , 30.07, 39.06, 41.07, 42.08, 43.09  , 49.05, 51.07, 52.08  , 50.06  , &
37       40.07  , 40.07 , 44.11, 50.06, 54.09, 58.13, 78.1136, 38.05, 53.07, 77.1136, 28.0134, &
38       14.01  , 26.02 , 27.04, 28.05, 39.05, 40.04, 41.05  , 50.04, 51.05, 52.04  , 76.1   /)
39   
40   ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
41   !  Upper chemistry
42   ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
43   
44   INTEGER, SAVE :: nlaykim_up   ! Number of upper atm. layers for chemistry from GCM top to 4.5E-5 Pa (1300km)
45   INTEGER, SAVE :: nlaykim_tot  ! Number of total layers for chemistry from surface to 4.5E-5 Pa (1300km)
46!$OMP_THREADPRIVATE(nlaykim_up,nlay_kim_tot)
47
48  ! NB : For the startfile we use nlaykim_up grid (upper atm) and for outputs we use nlaykim_tot grid (all layers)
49
50   REAL,SAVE,ALLOCATABLE,DIMENSION(:) :: preskim  ! Pressure (Pa) of upper chemistry (mid)-layers
51!$OMP_THREADPRIVATE(preskim)
52
53   REAL,SAVE,ALLOCATABLE,DIMENSION(:,:) :: zlay_kim  ! Altitude (km) of all chemistry (mid)-layers
54!$OMP_THREADPRIVATE(zlay_kim)
55
56   REAL,SAVE,ALLOCATABLE,DIMENSION(:,:,:) :: ykim_up ! Upper chemistry fields (mol/mol)
57!$OMP_THREADPRIVATE(ykim_up)
58
59CONTAINS
60
61  SUBROUTINE ini_comchem_h(ngrid)
62 
63  IMPLICIT NONE
64 
65    include "dimensions.h"
66 
67    INTEGER,INTENT(IN) :: ngrid ! number of atmospheric columns
68 
69    nlaykim_tot = nlaykim_up + llm
70 
71    IF (.NOT.allocated(preskim)) ALLOCATE(preskim(nlaykim_up))
72    IF (.NOT.allocated(zlay_kim)) ALLOCATE(zlay_kim(ngrid,nlaykim_tot))
73    IF (.NOT.allocated(ykim_up)) ALLOCATE(ykim_up(44,ngrid,nlaykim_up))
74 
75  END SUBROUTINE ini_comchem_h
76
77
78END MODULE comchem_h
Note: See TracBrowser for help on using the repository browser.