source: LMDZ6/trunk/libf/phylmd/StratAer/strataer_local_var_mod.F90 @ 4669

Last change on this file since 4669 was 4625, checked in by dcugnet, 16 months ago

StratAer? commit, N. Lebas

File size: 12.1 KB
Line 
1! $Id: strataer_local_var_mod.F90 2022-10-17 19:39:09Z nlebas $
2MODULE strataer_local_var_mod
3! This module contains strato microphysic model parameters & variables
4 
5  IMPLICIT NONE
6 
7  !============= GENERAL PARAMS =============
8  !flag for type emission scenario: (0) background aer ; (1) volcanic eruption with Sulfur ;
9  !(2,3) strato aer injections (SAI) ; (4) volcanic eruption chimistry; (5) rocket
10  INTEGER,SAVE :: flag_emit
11  !$OMP THREADPRIVATE(flag_emit)
12 
13  ! flag for emission altitude distribution: (0) gaussian; (1) uniform
14  INTEGER,SAVE :: flag_emit_distrib
15  !$OMP THREADPRIVATE(flag_emit_distrib)
16 
17  ! flag to choose nucleation nucleation method
18  LOGICAL,SAVE :: flag_new_nucl   ! T=new routine from A. Maattanen (LATMOS), F=older routine from H. Vehkamäki (FMI)
19  !$OMP THREADPRIVATE(flag_new_nucl)
20 
21  ! Use relative humidity from 2D model stratospheric H2O because LMDz is too dry in the stratosphere
22  ! (no CH4 oxidation)
23  LOGICAL,SAVE :: flag_H2O2d_nucleation
24  !$OMP THREADPRIVATE(flag_H2O2d_nucleation)
25 
26  ! OH reduction from SO2. OH is reduced when its reaction with SO2 competes sufficiently with its reaction
27  ! with O3 (Bekki, 1995). As a result, SO2 lifetime is extended. 2D model O3 climatologies are needed.
28  LOGICAL,SAVE :: flag_OH_reduced
29  !$OMP THREADPRIVATE(flag_OH_reduced)
30 
31  ! H2SO4 photolysis: H2SO4 is converted into SO2 by complex photolytic processes. Here simplified approach
32  ! by setting H2SO4 cross-sections = 0.3*HCl cross-sections (Rinsland et al., 1995)
33  LOGICAL,SAVE :: flag_H2SO4_photolysis
34  !$OMP THREADPRIVATE(flag_H2SO4_photolysis)
35 
36  ! flag for minimum lifetime (=1.5 pdt phys)
37  LOGICAL,SAVE :: flag_min_rreduce
38  !$OMP THREADPRIVATE(flag_min_rreduce)
39 
40  ! flag to read new climato (O3, H2O & H2SO4_LIFET)
41  LOGICAL,SAVE :: flag_newclim_file
42  !$OMP THREADPRIVATE(flag_newclim_file)
43 
44  ! Verbose mode to get more print info
45  LOGICAL, SAVE :: flag_verbose_strataer
46  !$OMP THREADPRIVATE(flag_verbose_strataer)
47 
48 
49  !============= NUCLEATION VARS =============
50  ! flag to constraint nucleation rate in a lat/pres box
51  LOGICAL,SAVE :: flag_nuc_rate_box      ! Nucleation rate limit or not to a lat/pres
52  !$OMP THREADPRIVATE(flag_nuc_rate_box)
53  REAL,SAVE    :: nuclat_min             ! min lat to activate nuc rate
54  REAL,SAVE    :: nuclat_max             ! max lat to activate nuc rate
55  REAL,SAVE    :: nucpres_min            ! min pres to activate nuc rate
56  REAL,SAVE    :: nucpres_max            ! max pres to activate nuc rate
57  !$OMP THREADPRIVATE(nuclat_min, nuclat_max, nucpres_min, nucpres_max)
58
59  LOGICAL,SAVE :: ok_qemiss
60  !$OMP THREADPRIVATE(ok_qemiss)
61  INTEGER,SAVE :: flh2o  ! ds stratemit : flh2o =0 (tr_seri), flh2o=1 (dq)
62  !$OMP THREADPRIVATE(flh2o)
63!  REAL,ALLOCATABLE,SAVE    :: d_q_emiss(:,:)
64!  !$OMP THREADPRIVATE(d_q_emiss)
65 
66  REAL,ALLOCATABLE,SAVE    :: budg_emi(:,:)            !DIMENSION(klon,n)
67  !$OMP THREADPRIVATE(budg_emi)
68 
69 
70  !============= EMISSION VARS =============
71  !--flag_emit=1 OR == 4 -- Volcanic eruption(s)
72  INTEGER,SAVE             :: nErupt                    ! number of eruptions specs
73  REAL,SAVE                :: injdur                    ! volcanic injection duration
74  !$OMP THREADPRIVATE(nErupt, injdur)
75  INTEGER,ALLOCATABLE,SAVE :: year_emit_vol(:)          ! year of emission date
76  INTEGER,ALLOCATABLE,SAVE :: mth_emit_vol(:)           ! month of emission date
77  INTEGER,ALLOCATABLE,SAVE :: day_emit_vol(:)           ! day of emission date
78  !$OMP THREADPRIVATE(year_emit_vol, mth_emit_vol, day_emit_vol)
79  REAL,ALLOCATABLE,SAVE    :: altemiss_vol(:)           ! emission altitude in m
80  REAL,ALLOCATABLE,SAVE    :: sigma_alt_vol(:)          ! standard deviation of emission altitude in m
81  !$OMP THREADPRIVATE(altemiss_vol, sigma_alt_vol)
82  INTEGER,ALLOCATABLE,SAVE :: ponde_lonlat_vol(:)       ! lon/lat ponderation factor
83  REAL,ALLOCATABLE,SAVE    :: xlat_min_vol(:)           ! min latitude of volcano in degree
84  REAL,ALLOCATABLE,SAVE    :: xlat_max_vol(:)           ! max latitude of volcano in degree
85  REAL,ALLOCATABLE,SAVE    :: xlon_min_vol(:)           ! min longitude of volcano in degree
86  REAL,ALLOCATABLE,SAVE    :: xlon_max_vol(:)           ! max longitude of volcano in degree
87  !$OMP THREADPRIVATE(ponde_lonlat_vol, xlat_min_vol, xlat_max_vol, xlon_min_vol, xlon_max_vol)
88 
89  !--flag_emit=1
90  INTEGER,SAVE             :: nAerErupt                 ! number Aerosol
91  !$OMP THREADPRIVATE(nAerErupt)
92  REAL,ALLOCATABLE,SAVE    :: m_sulf_emiss_vol(:)        ! emitted sulfur mass in kgS, e.g. 7Tg(S)=14Tg(SO2)
93  REAL,ALLOCATABLE,SAVE    :: m_aer_emiss_vol(:,:)
94  !$OMP THREADPRIVATE(m_sulf_emiss_vol,m_aer_emiss_vol)
95 
96  !--flag_emit=2 --SAI
97  REAL,SAVE    :: m_aer_emiss_sai        ! emitted sulfur mass in kgS, eg 1e9=1TgS, 1e10=10TgS
98  REAL,SAVE    :: altemiss_sai           ! emission altitude in m
99  REAL,SAVE    :: sigma_alt_sai          ! standard deviation of emission altitude in m
100  !$OMP THREADPRIVATE(m_aer_emiss_sai, altemiss_sai, sigma_alt_sai)
101  INTEGER,SAVE    :: year_emit_sai_start
102  INTEGER,SAVE    :: year_emit_sai_end
103  INTEGER,SAVE    :: mth_emit_sai_start
104  INTEGER,SAVE    :: mth_emit_sai_end
105  INTEGER,SAVE    :: day_emit_sai_start
106  INTEGER,SAVE    :: day_emit_sai_end
107  !$OMP THREADPRIVATE(year_emit_sai_start, year_emit_sai_end)
108  !$OMP THREADPRIVATE(mth_emit_sai_start, mth_emit_sai_end)
109  !$OMP THREADPRIVATE(day_emit_sai_start, day_emit_sai_end)
110  REAL,SAVE    :: xlat_sai               ! latitude of SAI in degree
111  REAL,SAVE    :: xlon_sai               ! longitude of SAI in degree
112  !$OMP THREADPRIVATE(xlat_sai, xlon_sai)
113 
114  !--flag_emit=3 -- SAI
115  REAL,SAVE    :: xlat_max_sai           ! maximum latitude of SAI in degrees
116  REAL,SAVE    :: xlat_min_sai           ! minimum latitude of SAI in degrees
117  !$OMP THREADPRIVATE(xlat_min_sai,xlat_max_sai)
118 
119  !--flag_emit=4 -- volc species
120  INTEGER,SAVE             :: nSpeciesErupt            ! number of species Repr
121  INTEGER,ALLOCATABLE,SAVE :: id_species(:)            ! indice species Repr
122  REAL,ALLOCATABLE,SAVE    :: m_species_emiss_vol(:,:) ! emitted species
123  !$OMP THREADPRIVATE(nSpeciesErupt,id_species,m_species_emiss_vol)
124  INTEGER,ALLOCATABLE,SAVE :: id_HCl
125  INTEGER,ALLOCATABLE,SAVE :: id_HBr
126  INTEGER,ALLOCATABLE,SAVE :: id_NOx
127  INTEGER,ALLOCATABLE,SAVE :: id_H2O
128  !$OMP THREADPRIVATE(id_HCl,id_HBr,id_NOx,id_H2O)
129  REAL,ALLOCATABLE,SAVE    :: m_Chlore_emiss_vol(:)   ! emitted Chlore mass
130  REAL,ALLOCATABLE,SAVE    :: m_Brome_emiss_vol(:)    ! emitted Brome mass
131  REAL,ALLOCATABLE,SAVE    :: m_NOx_emiss_vol(:)      ! emitted NOx mass
132  REAL,ALLOCATABLE,SAVE    :: m_H2O_emiss_vol(:)      ! emitted H2O mass
133  REAL,ALLOCATABLE,SAVE    :: m_H2O_emiss_vol_daily(:)
134  !$OMP THREADPRIVATE(m_Chlore_emiss_vol,m_Brome_emiss_vol,m_NOx_emiss_vol,m_H2O_emiss_vol)
135  !$OMP THREADPRIVATE(m_H2O_emiss_vol_daily)
136 
137  !--flag_emit=5 -- Rockets Emitted
138  INTEGER, SAVE            :: ifreqroc        ! frequence (=2 ex: tous les 2 mois)
139  !$OMP THREADPRIVATE(ifreqroc)
140  INTEGER,ALLOCATABLE,SAVE :: day_emit_roc(:) ! day of emission date
141  !$OMP THREADPRIVATE(day_emit_roc)
142 
143  REAL,SAVE    :: dlat, dlon             ! delta latitude and d longitude of grid in degree
144  !$OMP THREADPRIVATE(dlat, dlon)
145 
146CONTAINS
147   
148  SUBROUTINE strataer_init()
149    USE ioipsl_getin_p_mod, ONLY : getin_p
150    USE print_control_mod, ONLY : lunout
151    USE mod_phys_lmdz_para, ONLY : is_master
152    USE infotrac_phy, ONLY: id_OCS_strat,id_SO2_strat,id_H2SO4_strat,nbtr_sulgas
153   
154    WRITE(lunout,*) 'IN STRATAER_LOCAL_VAR INIT WELCOME!'
155   
156    !============= Check Sulfur aerosols ID =============
157    WRITE(lunout,*) 'STRATAER_LOCAL_VAR INIT: id_OCS_strat=',id_OCS_strat,' id_SO2_strat=',id_SO2_strat,' id_H2SO4_strat=',id_H2SO4_strat
158   
159    IF(id_OCS_strat < 0 .OR. id_OCS_strat > nbtr_sulgas) THEN
160       WRITE(lunout,*) 'ERROR : OCS index id_OCS_strat=',id_OCS_strat,' is negative or superior than the total sulfur gases !'
161       CALL abort_physic('strataer_local_var_mod','Wrong OCS index, check your tracer.def file.',1)
162    ELSEIF(id_SO2_strat < 0 .OR. id_SO2_strat > nbtr_sulgas) THEN
163       WRITE(lunout,*) 'ERROR : SO2 index id_SO2_strat=',id_SO2_strat,' is negative or superior than the total sulfur gases !'
164       CALL abort_physic('strataer_local_var_mod','Wrong SO2 index, check your tracer.def file.',1)
165    ELSEIF(id_H2SO4_strat < 0 .OR. id_H2SO4_strat > nbtr_sulgas) THEN
166       WRITE(lunout,*) 'ERROR : H2SO4 index id_H2SO4_strat=',id_H2SO4_strat,' is negative or superior than the total sulfur gases !'
167       CALL abort_physic('strataer_local_var_mod','Wrong H2SO4 index, check your tracer.def file.',1)
168    ENDIF
169   
170    !============= Init params =============
171    flag_emit = 0                   ! Background (default)
172    flag_emit_distrib = 0           ! Gaussian (default)
173    flag_new_nucl = .TRUE.          ! Define nucleation routine (default: A. Maattanen - LATMOS)
174    flag_verbose_strataer = .FALSE. ! verbose mode
175    flag_newclim_file = .TRUE.      ! Define input climato file (default: all climato)
176    flag_H2O2d_nucleation = .FALSE. ! Use H2O 2D climato (default: No)
177    flag_OH_reduced = .FALSE.       ! OH reduce (default: No)
178    flag_H2SO4_photolysis = .FALSE. ! H2SO4 photolysis (default: No)
179    flag_min_rreduce = .TRUE.       ! Minimum lifetime=1.5 pdt phys (default: Yes)
180    ok_qemiss = .FALSE.             ! H2O emission flag
181   
182    ! nuc init
183    flag_nuc_rate_box = .FALSE.
184    nuclat_min=0  ; nuclat_max=0
185    nucpres_min=0 ; nucpres_max=0
186   
187    ! emiss init
188    nErupt = 0 ! eruption number
189    injdur = 0 ! init injection duration
190    nAerErupt = 1 ; nSpeciesErupt = 1 ; id_species = 3
191    year_emit_vol=0 ; mth_emit_vol=0 ; day_emit_vol=0
192    m_species_emiss_vol=0. ; m_aer_emiss_vol=0. ; m_sulf_emiss_vol=0.
193    altemiss_vol=0. ; sigma_alt_vol=0.
194    xlon_min_vol=0. ; xlon_max_vol=0.
195    xlat_min_vol=0. ; xlat_max_vol=0.
196    m_Chlore_emiss_vol=0. ; m_Brome_emiss_vol=0.
197    m_NOx_emiss_vol=0. ; m_H2O_emiss_vol=0.
198    day_emit_roc=0 ; ifreqroc=2 ; flh2o=0
199   
200    !============= Read params =============
201    CALL getin_p('flag_emit',flag_emit)
202    CALL getin_p('flag_emit_distrib',flag_emit_distrib)
203    CALL getin_p('flag_verbose_strataer',flag_verbose_strataer)
204    CALL getin_p('flag_new_nucl',flag_new_nucl)
205    CALL getin_p('flag_newclim_file',flag_newclim_file)
206    CALL getin_p('flag_H2O2d_nucleation',flag_H2O2d_nucleation)
207    CALL getin_p('flag_OH_reduced',flag_OH_reduced)
208    CALL getin_p('flag_H2SO4_photolysis',flag_H2SO4_photolysis)
209    CALL getin_p('flag_min_rreduce',flag_min_rreduce)
210    CALL getin_p('ok_qemiss',ok_qemiss)
211   
212    !============= Test flag coherence =============
213    IF (.NOT. flag_newclim_file) THEN
214       IF (flag_H2SO4_photolysis .OR. flag_OH_reduced .OR. flag_H2O2d_nucleation) THEN
215          WRITE(lunout,*) 'ERROR : flag_newclim_file=',flag_newclim_file, &
216               ' whereas flag_H2SO4_photolysis=',flag_H2SO4_photolysis,', flag_OH_reduced=',flag_OH_reduced, &
217               ' and flag_H2O2d_nucleation=',flag_H2O2d_nucleation
218          CALL abort_physic('strataer_local_var_mod','Incompatible options in physiq_def file !',1)
219       ENDIF
220       IF(flag_min_rreduce) THEN
221          WRITE(lunout,*) 'Warning : flag_min_rreduce will be ignored with old climato file !'
222       ENDIF
223    ENDIF
224   
225    !============= Print params =============
226    IF (is_master) THEN
227       WRITE(lunout,*) 'flag_emit = ',flag_emit
228       WRITE(lunout,*) 'IN STRATAER : flag_new_nucl = ',flag_new_nucl
229       WRITE(lunout,*) 'IN STRATAER : flag_newclim_file = ',flag_newclim_file
230       WRITE(lunout,*) 'IN STRATAER : flag_emit_distrib = ',flag_emit_distrib
231       WRITE(lunout,*) 'IN STRATAER : flag_verbose_strataer = ',flag_verbose_strataer
232       IF (flag_emit == 1 .OR. flag_emit == 4) THEN
233          WRITE(lunout,*) 'IN STRATAER : flag_H2O2d_nucleation = ',flag_H2O2d_nucleation
234          WRITE(lunout,*) 'IN STRATAER : flag_OH_reduced = ',flag_OH_reduced
235          WRITE(lunout,*) 'IN STRATAER : flag_H2SO4_photolysis = ',flag_H2SO4_photolysis
236          WRITE(lunout,*) 'IN STRATAER : flag_min_rreduce = ',flag_min_rreduce
237          WRITE(lunout,*) 'IN STRATAER : ok_qemiss = ',ok_qemiss
238       ENDIF
239    ENDIF ! if master
240   
241    WRITE(lunout,*) 'IN STRATAER INIT END'
242   
243  END SUBROUTINE strataer_init
244 
245END MODULE strataer_local_var_mod
Note: See TracBrowser for help on using the repository browser.