1 | MODULE strataer_emiss_mod |
---|
2 | ! This module contains information about strato microphysic model emission parameters |
---|
3 | |
---|
4 | CONTAINS |
---|
5 | |
---|
6 | SUBROUTINE strataer_emiss_init() |
---|
7 | |
---|
8 | USE strataer_local_var_mod |
---|
9 | USE ioipsl_getin_p_mod, ONLY : getin_p |
---|
10 | USE print_control_mod, ONLY : lunout |
---|
11 | USE mod_phys_lmdz_para, ONLY : is_master |
---|
12 | |
---|
13 | ! Local variables |
---|
14 | INTEGER :: ispec |
---|
15 | |
---|
16 | WRITE(lunout,*) 'IN STRATAER_EMISS INIT WELCOME!' |
---|
17 | |
---|
18 | IF (flag_emit.EQ.1 .OR. flag_emit.EQ.4) THEN ! Volcano |
---|
19 | CALL getin_p('nErupt',nErupt) !eruption nb |
---|
20 | CALL getin_p('injdur',injdur) !injection duration |
---|
21 | |
---|
22 | IF (flag_emit==1) THEN |
---|
23 | CALL getin_p('nAerErupt', nAerErupt) !sulfur aer nb |
---|
24 | ELSEIF (flag_emit==4) THEN |
---|
25 | CALL getin_p('nSpeciesErupt', nSpeciesErupt) !chimical species nb |
---|
26 | ENDIF |
---|
27 | |
---|
28 | IF (nErupt.GT.0) THEN |
---|
29 | ALLOCATE(year_emit_vol(nErupt),mth_emit_vol(nErupt),day_emit_vol(nErupt)) |
---|
30 | year_emit_vol=0 ; mth_emit_vol=0 ; day_emit_vol=0 |
---|
31 | ALLOCATE(altemiss_vol(nErupt),sigma_alt_vol(nErupt)) |
---|
32 | ALLOCATE(xlat_min_vol(nErupt),xlon_min_vol(nErupt)) |
---|
33 | ALLOCATE(xlat_max_vol(nErupt),xlon_max_vol(nErupt)) |
---|
34 | altemiss_vol=0. ; sigma_alt_vol=0. |
---|
35 | xlon_min_vol=0. ; xlon_max_vol=0. |
---|
36 | xlat_min_vol=0. ; xlat_max_vol=0. |
---|
37 | ! injection params (dates, loc, injections params) |
---|
38 | CALL getin_p('year_emit_vol',year_emit_vol) |
---|
39 | CALL getin_p('mth_emit_vol',mth_emit_vol) |
---|
40 | CALL getin_p('day_emit_vol',day_emit_vol) |
---|
41 | CALL getin_p('altemiss_vol',altemiss_vol) |
---|
42 | CALL getin_p('sigma_alt_vol',sigma_alt_vol) |
---|
43 | CALL getin_p('xlon_min_vol',xlon_min_vol) |
---|
44 | CALL getin_p('xlon_max_vol',xlon_max_vol) |
---|
45 | CALL getin_p('xlat_min_vol',xlat_min_vol) |
---|
46 | CALL getin_p('xlat_max_vol',xlat_max_vol) |
---|
47 | IF (flag_emit==1) THEN |
---|
48 | ALLOCATE(m_sulf_emiss_vol(nErupt)) |
---|
49 | ALLOCATE(m_aer_emiss_vol(nErupt,nAerErupt)) |
---|
50 | m_aer_emiss_vol=0. ; m_sulf_emiss_vol=0. |
---|
51 | IF (ok_qemiss) then |
---|
52 | ALLOCATE(m_H2O_emiss_vol(nErupt)) |
---|
53 | ALLOCATE(m_H2O_emiss_vol_daily(nErupt)) |
---|
54 | ! ALLOCATE(d_q_emiss(klon,klev)) |
---|
55 | ALLOCATE(budg_emi(klon,nAerErupt+1)) |
---|
56 | m_H2O_emiss_vol(:)=0. |
---|
57 | m_H2O_emiss_vol_daily(:)=0. |
---|
58 | ! d_q_emiss(:,:)=0. |
---|
59 | ELSE |
---|
60 | ALLOCATE(budg_emi(klon,nAerErupt)) |
---|
61 | ENDIF |
---|
62 | budg_emi(:,:)=0. |
---|
63 | ELSEIF (flag_emit==4) THEN |
---|
64 | ALLOCATE(m_Chlore_emiss_vol(nErupt)) |
---|
65 | ALLOCATE(id_HCl) |
---|
66 | ALLOCATE(m_Brome_emiss_vol(nErupt)) |
---|
67 | ALLOCATE(id_HBr) |
---|
68 | ALLOCATE(id_species(nSpeciesErupt)) |
---|
69 | id_species = 0 |
---|
70 | ALLOCATE(m_species_emiss_vol(nErupt,nSpeciesErupt)) |
---|
71 | m_species_emiss_vol=0. |
---|
72 | ALLOCATE(m_NOx_emiss_vol(nErupt)) |
---|
73 | ALLOCATE(m_H2O_emiss_vol(nErupt)) |
---|
74 | m_Chlore_emiss_vol=0. ; m_Brome_emiss_vol=0. |
---|
75 | m_NOx_emiss_vol=0. ; m_H2O_emiss_vol=0. |
---|
76 | ALLOCATE(id_NOx) |
---|
77 | ALLOCATE(id_H2O) |
---|
78 | ALLOCATE(budg_emi(klon,nSpeciesErupt)) |
---|
79 | budg_emi(:,:)=0. |
---|
80 | ENDIF |
---|
81 | ELSE |
---|
82 | WRITE(lunout,*) 'ERROR : Using flag_emit=1 or 4 (ie Volcanic eruption) but nErupt (',nErupt,') <=0 !' |
---|
83 | CALL abort_physic('strataer_emiss_mod', & |
---|
84 | 'No eruption define in physiq_def (nErupt=0). Add at one eruption or use background condition.',1) |
---|
85 | ENDIF ! fin if nerupt |
---|
86 | |
---|
87 | IF (flag_emit==1) THEN |
---|
88 | CALL getin_p('m_sulf_emiss_vol',m_sulf_emiss_vol) |
---|
89 | if (ok_qemiss) then |
---|
90 | CALL getin_p('m_H2O_emiss_vol',m_H2O_emiss_vol) |
---|
91 | endif |
---|
92 | ELSEIF (flag_emit==4) THEN |
---|
93 | CALL getin_p('id_species',id_species) |
---|
94 | CALL getin_p('m_Chlore_emiss_vol',m_Chlore_emiss_vol) |
---|
95 | CALL getin_p('id_HCl',id_HCl) |
---|
96 | CALL getin_p('m_Brome_emiss_vol',m_Brome_emiss_vol) |
---|
97 | CALL getin_p('id_HBr',id_HBr) |
---|
98 | CALL getin_p('m_NOx_emiss_vol',m_NOx_emiss_vol) |
---|
99 | CALL getin_p('id_NOx',id_NOx) |
---|
100 | CALL getin_p('m_H2O_emiss_vol',m_H2O_emiss_vol) |
---|
101 | CALL getin_p('id_H2O',id_H2O) |
---|
102 | ENDIF |
---|
103 | |
---|
104 | ELSEIF (flag_emit == 2) THEN ! SAI |
---|
105 | CALL getin_p('m_aer_emiss_sai',m_aer_emiss_sai) |
---|
106 | CALL getin_p('altemiss_sai',altemiss_sai) |
---|
107 | CALL getin_p('sigma_alt_sai',sigma_alt_sai) |
---|
108 | CALL getin_p('xlat_sai',xlat_sai) |
---|
109 | CALL getin_p('xlon_sai',xlon_sai) |
---|
110 | CALL getin_p('year_emit_sai_start',year_emit_sai_start) |
---|
111 | CALL getin_p('year_emit_sai_end',year_emit_sai_end) |
---|
112 | CALL getin_p('mth_emit_sai_start',mth_emit_sai_start) |
---|
113 | CALL getin_p('mth_emit_sai_end',mth_emit_sai_end) |
---|
114 | CALL getin_p('day_emit_sai_start',day_emit_sai_start) |
---|
115 | CALL getin_p('day_emit_sai_end',day_emit_sai_end) |
---|
116 | |
---|
117 | ELSEIF (flag_emit == 3) THEN ! SAI between latitudes |
---|
118 | CALL getin_p('m_aer_emiss_sai',m_aer_emiss_sai) |
---|
119 | CALL getin_p('altemiss_sai',altemiss_sai) |
---|
120 | CALL getin_p('sigma_alt_sai',sigma_alt_sai) |
---|
121 | CALL getin_p('xlon_sai',xlon_sai) |
---|
122 | CALL getin_p('xlat_max_sai',xlat_max_sai) |
---|
123 | CALL getin_p('xlat_min_sai',xlat_min_sai) |
---|
124 | ENDIF |
---|
125 | |
---|
126 | IF (flag_emit == 1) THEN |
---|
127 | DO ispec=1,nAerErupt |
---|
128 | m_aer_emiss_vol(:,ispec) = m_sulf_emiss_vol(:) |
---|
129 | ENDDO |
---|
130 | ELSEIF (flag_emit== 4) THEN |
---|
131 | DO ispec=1,nSpeciesErupt |
---|
132 | IF(id_species(ispec) == id_HCl) THEN |
---|
133 | m_species_emiss_vol(:,ispec) = m_Chlore_emiss_vol(:) |
---|
134 | ENDIF |
---|
135 | IF (id_species(ispec) == id_HBr) THEN |
---|
136 | m_species_emiss_vol(:,ispec) = m_Brome_emiss_vol(:) |
---|
137 | ENDIF |
---|
138 | IF (id_species(ispec) == id_NOx) THEN |
---|
139 | m_species_emiss_vol(:,ispec) = m_NOx_emiss_vol(:) |
---|
140 | ENDIF |
---|
141 | IF (id_species(ispec) == id_H2O) THEN |
---|
142 | m_species_emiss_vol(:,ispec) = m_H2O_emiss_vol(:) |
---|
143 | ENDIF |
---|
144 | ENDDO |
---|
145 | ENDIF |
---|
146 | |
---|
147 | !============= Injection ponderation ============= |
---|
148 | IF (flag_emit > 0) THEN |
---|
149 | CALL strataer_ponde_init |
---|
150 | WRITE(lunout,*) 'IN STRATAER INIT : ponde_lonlat_vol',ponde_lonlat_vol |
---|
151 | ENDIF |
---|
152 | |
---|
153 | !============= Print params ============= |
---|
154 | IF (is_master) THEN |
---|
155 | IF (nErupt > 0) then |
---|
156 | if (flag_emit == 1 .OR. flag_emit == 4) THEN |
---|
157 | WRITE(lunout,*) 'IN STRATAER nErupt: ',nErupt |
---|
158 | WRITE(lunout,*) 'IN STRATAER injdur: ',injdur |
---|
159 | WRITE(lunout,*) 'IN STRATAER nAerErupt: ',nAerErupt |
---|
160 | |
---|
161 | WRITE(lunout,*) 'IN STRATAER : year_emit_vol',year_emit_vol |
---|
162 | WRITE(lunout,*) 'IN STRATAER : mth_emit_vol',mth_emit_vol |
---|
163 | WRITE(lunout,*) 'IN STRATAER : day_emit_vol',day_emit_vol |
---|
164 | WRITE(lunout,*) 'IN STRATAER : altemiss_vol',altemiss_vol |
---|
165 | WRITE(lunout,*) 'IN STRATAER : sigma_alt_vol',sigma_alt_vol |
---|
166 | WRITE(lunout,*) 'IN STRATAER : xlat_min_vol',xlat_min_vol |
---|
167 | WRITE(lunout,*) 'IN STRATAER : xlat_max_vol',xlat_max_vol |
---|
168 | WRITE(lunout,*) 'IN STRATAER : xlon_min_vol',xlon_min_vol |
---|
169 | WRITE(lunout,*) 'IN STRATAER : xlon_max_vol',xlon_max_vol |
---|
170 | IF (flag_emit==1) THEN |
---|
171 | WRITE(lunout,*) 'IN STRATAEREMISS : m_sulf_emiss_vol',m_sulf_emiss_vol |
---|
172 | WRITE(lunout,*) 'IN STRATAER : m_aer_emiss_vol',m_aer_emiss_vol |
---|
173 | IF (ok_qemiss) then |
---|
174 | WRITE(lunout,*) 'IN STRATAEREMISS : m_H2O_emiss_vol',m_H2O_emiss_vol |
---|
175 | ENDIF |
---|
176 | ENDIF |
---|
177 | ELSEIF (flag_emit == 2) THEN |
---|
178 | WRITE(lunout,*) 'IN STRATAER : m_aer_emiss_sai',m_aer_emiss_sai |
---|
179 | WRITE(lunout,*) 'IN STRATAER : altemiss_sai',altemiss_sai |
---|
180 | WRITE(lunout,*) 'IN STRATAER : sigma_alt_sai',sigma_alt_sai |
---|
181 | WRITE(lunout,*) 'IN STRATAER : xlat_sai',xlat_sai |
---|
182 | WRITE(lunout,*) 'IN STRATAER : xlon_sai',xlon_sai |
---|
183 | ELSEIF (flag_emit == 3) THEN |
---|
184 | WRITE(lunout,*) 'IN STRATAER : m_aer_emiss_sai',m_aer_emiss_sai |
---|
185 | WRITE(lunout,*) 'IN STRATAER : altemiss_sai',altemiss_sai |
---|
186 | WRITE(lunout,*) 'IN STRATAER : sigma_alt_sai',sigma_alt_sai |
---|
187 | WRITE(lunout,*) 'IN STRATAER : year_emit_sai start/end',year_emit_sai_start,year_emit_sai_end |
---|
188 | WRITE(lunout,*) 'IN STRATAER : mth_emit_sai start/end',mth_emit_sai_start,mth_emit_sai_end |
---|
189 | WRITE(lunout,*) 'IN STRATAER : day_emit_sai start/end',day_emit_sai_start,day_emit_sai_end |
---|
190 | WRITE(lunout,*) 'IN STRATAER : xlat_min_sai',xlat_min_sai |
---|
191 | WRITE(lunout,*) 'IN STRATAER : xlat_max_sai',xlat_max_sai |
---|
192 | WRITE(lunout,*) 'IN STRATAER : xlon_sai',xlon_sai |
---|
193 | ENDIF |
---|
194 | IF(flag_emit == 4) THEN |
---|
195 | WRITE(lunout,*) 'IN STRATAER : nSpeciesErupt: ',nSpeciesErupt |
---|
196 | WRITE(lunout,*) 'IN STRATAER : id_species = ',id_species |
---|
197 | WRITE(lunout,*) 'IN STRATAER : id_HCl = ',id_HCl |
---|
198 | WRITE(lunout,*) 'IN STRATAER : id_HBr = ',id_HBr |
---|
199 | WRITE(lunout,*) 'IN STRATAER : id_NOx = ',id_NOx |
---|
200 | WRITE(lunout,*) 'IN STRATAER : id_H2O = ',id_H2O |
---|
201 | WRITE(lunout,*) 'IN STRATAER : m_Chlore_emiss_vol = ',m_Chlore_emiss_vol |
---|
202 | WRITE(lunout,*) 'IN STRATAER : m_Brome_emiss_vol = ',m_Brome_emiss_vol |
---|
203 | WRITE(lunout,*) 'IN STRATAER : m_NOx_emiss_vol = ',m_NOx_emiss_vol |
---|
204 | WRITE(lunout,*) 'IN STRATAER : m_H2O_emiss_vol = ',m_H2O_emiss_vol |
---|
205 | ENDIF |
---|
206 | endif |
---|
207 | ENDIF ! if master |
---|
208 | |
---|
209 | WRITE(lunout,*) 'IN STRATAER_EMISS END' |
---|
210 | END SUBROUTINE strataer_emiss_init |
---|
211 | |
---|
212 | ! Compute the ponderation to applicate in each grid point for all eruptions and init |
---|
213 | ! dlat & dlon variables |
---|
214 | SUBROUTINE strataer_ponde_init() |
---|
215 | |
---|
216 | USE yomcst_mod_h |
---|
217 | USE regular_lonlat_mod, ONLY: lon_reg, lat_reg |
---|
218 | USE dimphy, ONLY: klon |
---|
219 | USE mod_grid_phy_lmdz, ONLY: nbp_lat, nbp_lon |
---|
220 | USE print_control_mod, ONLY : lunout |
---|
221 | USE strataer_local_var_mod |
---|
222 | |
---|
223 | !--RPI |
---|
224 | |
---|
225 | ! local var |
---|
226 | REAL :: lat_reg_deg,lon_reg_deg ! lat and lon of grid points in degree |
---|
227 | INTEGER :: ieru, i, j |
---|
228 | |
---|
229 | ALLOCATE(ponde_lonlat_vol(nErupt)) |
---|
230 | |
---|
231 | !Compute lon/lat ponderation for injection |
---|
232 | dlat=180./2./FLOAT(nbp_lat) ! d latitude in degree |
---|
233 | dlon=360./2./FLOAT(nbp_lon) ! d longitude in degree |
---|
234 | WRITE(lunout,*) 'IN STRATAER_INIT dlat=',dlat,'dlon=',dlon |
---|
235 | WRITE(lunout,*) 'IN STRATAER_INIT nErupt=',nErupt |
---|
236 | WRITE(lunout,*) 'IN STRATAER_INIT xlat_min=',xlat_min_vol,'xlat_max=',xlat_max_vol |
---|
237 | WRITE(lunout,*) 'IN STRATAER_INIT xlon_min=',xlon_min_vol,'xlon_max=',xlon_max_vol |
---|
238 | |
---|
239 | DO ieru=1, nErupt |
---|
240 | ponde_lonlat_vol(ieru) = 0 |
---|
241 | DO i=1,nbp_lon |
---|
242 | lon_reg_deg = lon_reg(i)*180./RPI |
---|
243 | DO j=1,nbp_lat |
---|
244 | lat_reg_deg = lat_reg(j)*180./RPI |
---|
245 | IF ( lat_reg_deg.GE.xlat_min_vol(ieru)-dlat .AND. lat_reg_deg.LT.xlat_max_vol(ieru)+dlat .AND. & |
---|
246 | lon_reg_deg.GE.xlon_min_vol(ieru)-dlon .AND. lon_reg_deg.LT.xlon_max_vol(ieru)+dlon ) THEN |
---|
247 | ponde_lonlat_vol(ieru) = ponde_lonlat_vol(ieru) + 1 |
---|
248 | ENDIF |
---|
249 | ENDDO |
---|
250 | ENDDO |
---|
251 | IF(ponde_lonlat_vol(ieru) == 0) THEN |
---|
252 | WRITE(lunout,*) 'STRATAER_INIT ERROR: no grid point found for eruption ieru=',ieru |
---|
253 | ENDIF |
---|
254 | ENDDO !ieru |
---|
255 | |
---|
256 | WRITE(lunout,*) 'IN STRATAER_PONDE_INIT ponde_lonlat: ', ponde_lonlat_vol |
---|
257 | |
---|
258 | END SUBROUTINE strataer_ponde_init |
---|
259 | |
---|
260 | END MODULE strataer_emiss_mod |
---|