source: LMDZ6/trunk/libf/phylmd/infotrac_phy.F90 @ 4052

Last change on this file since 4052 was 4052, checked in by dcugnet, 2 years ago

Fixes for previous commit:

  • few tracers(:)%nqChilds were errouneously replaced with tarcers(:)%nqDesc
  • minor changes
File size: 7.5 KB
Line 
1
2! $Id: $
3
4MODULE infotrac_phy
5
6! Infotrac for physics; for now contains the same information as infotrac for
7! the dynamics (could be further cleaned) and is initialized using values
8! provided by the dynamics
9
10  USE readTracFiles_mod, ONLY: trac_type, maxlen, delPhase
11
12! nqtot : total number of tracers and higher order of moment, water vapor and liquid included
13  INTEGER, SAVE :: nqtot
14!$OMP THREADPRIVATE(nqtot)
15
16!CR: on ajoute le nombre de traceurs de l eau
17  INTEGER, SAVE :: nqo
18!$OMP THREADPRIVATE(nqo)
19
20! nbtr : number of tracers not including higher order of moment or water vapor or liquid
21!        number of tracers used in the physics
22  INTEGER, SAVE :: nbtr
23!$OMP THREADPRIVATE(nbtr)
24
25  INTEGER, SAVE :: nqtottr
26!$OMP THREADPRIVATE(nqtottr)
27
28! ThL : number of CO2 tracers                   ModThL
29  INTEGER, SAVE :: nqCO2
30!$OMP THREADPRIVATE(nqCO2)
31
32#ifdef CPP_StratAer
33! nbtr_bin: number of aerosol bins for StratAer model
34! nbtr_sulgas: number of sulfur gases for StratAer model
35  INTEGER, SAVE :: nbtr_bin, nbtr_sulgas
36!$OMP THREADPRIVATE(nbtr_bin,nbtr_sulgas)
37  INTEGER, SAVE :: id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat
38!$OMP THREADPRIVATE(id_OCS_strat, id_SO2_strat, id_H2SO4_strat, id_BIN01_strat)
39#endif
40
41! CRisi: nb traceurs pères= directement advectés par l'air
42  INTEGER, SAVE :: nqperes
43!$OMP THREADPRIVATE(nqperes)
44
45! Tracers parameters
46  TYPE(trac_type), TARGET, ALLOCATABLE, SAVE :: tracers(:)
47!$OMP THREADPRIVATE(tracers)
48
49! niadv : vector keeping the coorspondance between all tracers(nqtot) treated in the
50!         dynamic part of the code and the tracers (nbtr+2) used in the physics part of the code.
51  INTEGER, ALLOCATABLE, DIMENSION(:), SAVE    :: niadv ! equivalent dyn / physique
52!$OMP THREADPRIVATE(niadv)
53
54! conv_flg(it)=0 : convection desactivated for tracer number it
55  INTEGER, ALLOCATABLE, DIMENSION(:), SAVE  :: conv_flg
56!$OMP THREADPRIVATE(conv_flg)
57
58! pbl_flg(it)=0  : boundary layer diffusion desactivaded for tracer number it
59  INTEGER, ALLOCATABLE, DIMENSION(:), SAVE  :: pbl_flg
60!$OMP THREADPRIVATE(pbl_flg)
61
62  CHARACTER(len=4),SAVE :: type_trac
63!$OMP THREADPRIVATE(type_trac)
64  CHARACTER(len=8),DIMENSION(:),ALLOCATABLE, SAVE :: solsym
65!$OMP THREADPRIVATE(solsym)
66   
67    ! CRisi: cas particulier des isotopes
68    LOGICAL,SAVE :: ok_isotopes,ok_iso_verif,ok_isotrac,ok_init_iso
69!$OMP THREADPRIVATE(ok_isotopes,ok_iso_verif,ok_isotrac,ok_init_iso)
70    INTEGER :: niso_possibles   
71    PARAMETER ( niso_possibles=5)
72    real, DIMENSION (niso_possibles),SAVE :: tnat,alpha_ideal
73!$OMP THREADPRIVATE(tnat,alpha_ideal)
74    LOGICAL, DIMENSION(niso_possibles),SAVE ::  use_iso
75!$OMP THREADPRIVATE(use_iso)
76    INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE ::  iqiso ! donne indice iq en fn de (ixt,phase)
77!$OMP THREADPRIVATE(iqiso)
78    INTEGER, ALLOCATABLE, DIMENSION(:), SAVE ::  iso_indnum ! donne numéro iso entre 1 et niso effectif en fn de nqtot
79!$OMP THREADPRIVATE(iso_indnum)
80    INTEGER, DIMENSION(niso_possibles), SAVE :: indnum_fn_num ! donne indice entre entre 1 et niso en fonction du numéro d isotope entre 1 et niso_possibles
81!$OMP THREADPRIVATE(indnum_fn_num)
82    INTEGER, ALLOCATABLE, DIMENSION(:,:), SAVE ::  index_trac ! numéro ixt en fn izone, indnum entre 1 et niso
83!$OMP THREADPRIVATE(index_trac)
84    INTEGER,SAVE :: niso,ntraceurs_zone,ntraciso
85!$OMP THREADPRIVATE(niso,ntraceurs_zone,ntraciso)
86
87    INTEGER, ALLOCATABLE, DIMENSION(:), SAVE ::  itr_indice ! numéro iq entre 1 et nqtot qui correspond au traceur itr entre 1 et nqtottr
88!$OMP THREADPRIVATE(itr_indice)
89 
90CONTAINS
91
92  SUBROUTINE init_infotrac_phy(nqtot_,nqo_,nbtr_,nqtottr_,nqCO2_,tracers_,type_trac_,&
93                               niadv_,conv_flg_,pbl_flg_,solsym_,&
94                               ok_isotopes_,ok_iso_verif_,ok_isotrac_,&
95                               ok_init_iso_,niso_possibles_,tnat_,&
96                               alpha_ideal_,use_iso_,iqiso_,iso_indnum_,&
97                               indnum_fn_num_,index_trac_,&
98                               niso_,ntraceurs_zone_,ntraciso_,itr_indice_&
99#ifdef CPP_StratAer
100                               ,nbtr_bin_,nbtr_sulgas_&
101                               ,id_OCS_strat_,id_SO2_strat_,id_H2SO4_strat_,id_BIN01_strat_&
102#endif
103                               )
104
105    ! transfer information on tracers from dynamics to physics
106    USE print_control_mod, ONLY: prt_level, lunout
107    IMPLICIT NONE
108
109    INTEGER,INTENT(IN) :: nqtot_
110    INTEGER,INTENT(IN) :: nqo_
111    INTEGER,INTENT(IN) :: nbtr_
112    INTEGER,INTENT(IN) :: nqtottr_
113    INTEGER,INTENT(IN) :: nqCO2_
114#ifdef CPP_StratAer
115    INTEGER,INTENT(IN) :: nbtr_bin_
116    INTEGER,INTENT(IN) :: nbtr_sulgas_
117    INTEGER,INTENT(IN) :: id_OCS_strat_
118    INTEGER,INTENT(IN) :: id_SO2_strat_
119    INTEGER,INTENT(IN) :: id_H2SO4_strat_
120    INTEGER,INTENT(IN) :: id_BIN01_strat_
121#endif
122    TYPE(trac_type), INTENT(IN) :: tracers_(nqtot_) ! tracers descriptors
123    CHARACTER(len=*),INTENT(IN) :: type_trac_
124    INTEGER,INTENT(IN) :: niadv_ (nqtot_) ! equivalent dyn / physique
125    INTEGER,INTENT(IN) :: conv_flg_(nbtr_)
126    INTEGER,INTENT(IN) :: pbl_flg_(nbtr_)
127    CHARACTER(len=*),INTENT(IN) :: solsym_(nbtr_)
128    ! Isotopes:
129    LOGICAL,INTENT(IN) :: ok_isotopes_
130    LOGICAL,INTENT(IN) :: ok_iso_verif_
131    LOGICAL,INTENT(IN) :: ok_isotrac_
132    LOGICAL,INTENT(IN) :: ok_init_iso_
133    INTEGER,INTENT(IN) :: niso_possibles_
134    REAL,INTENT(IN) :: tnat_(niso_possibles_)
135    REAL,INTENT(IN) :: alpha_ideal_(niso_possibles_)
136    LOGICAL,INTENT(IN) :: use_iso_(niso_possibles_)
137    INTEGER,INTENT(IN) :: iqiso_(ntraciso_,nqo_)
138    INTEGER,INTENT(IN) :: iso_indnum_(nqtot_)
139    INTEGER,INTENT(IN) :: indnum_fn_num_(niso_possibles_)
140    INTEGER,INTENT(IN) :: index_trac_(ntraceurs_zone_,niso_)
141    INTEGER,INTENT(IN) :: niso_
142    INTEGER,INTENT(IN) :: ntraceurs_zone_
143    INTEGER,INTENT(IN) :: ntraciso_
144    INTEGER,INTENT(IN) :: itr_indice_(nqtottr_)
145
146    CHARACTER(LEN=30) :: modname="init_infotrac_phy"
147
148    nqtot=nqtot_
149    nqo=nqo_
150    nbtr=nbtr_
151    nqCO2=nqCO2_
152    nqtottr=nqtottr_
153    ALLOCATE(tracers(nqtot)); tracers(:) = tracers_(:)
154#ifdef CPP_StratAer
155    nbtr_bin=nbtr_bin_
156    nbtr_sulgas=nbtr_sulgas_
157    id_OCS_strat=id_OCS_strat_
158    id_SO2_strat=id_SO2_strat_
159    id_H2SO4_strat=id_H2SO4_strat_
160    id_BIN01_strat=id_BIN01_strat_
161#endif
162    type_trac = type_trac_
163    ALLOCATE(niadv(nqtot))
164    niadv(:)=niadv_(:)
165    ALLOCATE(conv_flg(nbtr))
166    conv_flg(:)=conv_flg_(:)
167    ALLOCATE(pbl_flg(nbtr))
168    pbl_flg(:)=pbl_flg_(:)
169    ALLOCATE(solsym(nbtr))
170    solsym(:)=solsym_(:)
171     
172    IF(prt_level.ge.1) THEN
173      write(lunout,*) TRIM(modname)//": nqtot,nqo,nbtr,nqCO2",nqtot,nqo,nbtr,nqCO2
174    ENDIF
175   
176    ! Isotopes:
177   
178    ! First check that the "niso_possibles" has the correct value
179    IF (niso_possibles.ne.niso_possibles_) THEN
180      CALL abort_physic(modname,&
181           "wrong value for parameter niso_possibles in infotrac_phy",1)
182    ENDIF
183   
184    ok_isotopes=ok_isotopes_
185    ok_iso_verif=ok_iso_verif_
186    ok_isotrac=ok_isotrac_
187    ok_init_iso=ok_init_iso_
188   
189    niso=niso_
190    ntraceurs_zone=ntraceurs_zone_
191    ntraciso=ntraciso_
192   
193    IF (ok_isotopes) THEN
194      tnat(:)=tnat_(:)
195      alpha_ideal(:)=alpha_ideal_(:)
196      use_iso(:)=use_iso_(:)
197   
198      ALLOCATE(iqiso(ntraciso,nqo))
199      iqiso(:,:)=iqiso_(:,:)
200      ALLOCATE(iso_indnum(nqtot))
201      iso_indnum(:)=iso_indnum_(:)
202     
203      indnum_fn_num(:)=indnum_fn_num_(:)
204     
205      ALLOCATE(index_trac(ntraceurs_zone,niso))
206      index_trac(:,:)=index_trac_(:,:)
207    ENDIF ! of IF(ok_isotopes)
208
209    ALLOCATE(itr_indice(nqtottr))
210    itr_indice(:)=itr_indice_(:)
211 
212  END SUBROUTINE init_infotrac_phy
213
214END MODULE infotrac_phy
Note: See TracBrowser for help on using the repository browser.