1 | module adsorption_mod |
---|
2 | |
---|
3 | implicit none |
---|
4 | |
---|
5 | LOGICAL adsorption_pem ! True by default, to compute adsorption/desorption. Read in pem.def |
---|
6 | real, save, allocatable :: co2_adsorbded_phys(:,:,:) ! co2 that is in the regolith [kg/m^2] |
---|
7 | real, save, allocatable :: h2o_adsorbded_phys(:,:,:) ! h2o that is in the regolith [kg/m^2] |
---|
8 | |
---|
9 | contains |
---|
10 | |
---|
11 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
12 | !!! |
---|
13 | !!! Purpose: Compute CO2 and H2O adsorption, following the methods from Zent & Quinn 1995, Jackosky et al., 1997 |
---|
14 | !!! |
---|
15 | !!! Author: LL, 01/2023 |
---|
16 | !!! |
---|
17 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
18 | subroutine ini_adsorption_h_PEM(ngrid,nslope,nsoilmx_PEM) |
---|
19 | |
---|
20 | implicit none |
---|
21 | integer,intent(in) :: ngrid ! number of atmospheric columns |
---|
22 | integer,intent(in) :: nslope ! number of slope within a mesh |
---|
23 | integer,intent(in) :: nsoilmx_PEM ! number of soil layer in the PEM |
---|
24 | allocate(co2_adsorbded_phys(ngrid,nsoilmx_PEM,nslope)) |
---|
25 | allocate(h2o_adsorbded_phys(ngrid,nsoilmx_PEM,nslope)) |
---|
26 | end subroutine ini_adsorption_h_PEM |
---|
27 | |
---|
28 | !!! ----------------------------------------------- |
---|
29 | |
---|
30 | subroutine end_adsorption_h_PEM |
---|
31 | |
---|
32 | implicit none |
---|
33 | if (allocated(co2_adsorbded_phys)) deallocate(co2_adsorbded_phys) |
---|
34 | if (allocated(h2o_adsorbded_phys)) deallocate(h2o_adsorbded_phys) |
---|
35 | end subroutine end_adsorption_h_PEM |
---|
36 | |
---|
37 | !!! ----------------------------------------------- |
---|
38 | |
---|
39 | subroutine regolith_adsorption(ngrid,nslope,nsoil_PEM,timelen,tend_h2oglaciers,tend_co2glaciers,waterice,co2ice,tsoil_PEM,TI_PEM,ps,q_co2,q_h2o, & |
---|
40 | m_h2o_completesoil,delta_mh2oreg, m_co2_completesoil,delta_mco2reg) |
---|
41 | |
---|
42 | ! inputs |
---|
43 | INTEGER,INTENT(IN) :: ngrid, nslope, nsoil_PEM,timelen ! size dimension: physics x subslope x soil x timeseries |
---|
44 | REAL,INTENT(IN) :: tend_h2oglaciers(ngrid,nslope),tend_co2glaciers(ngrid,nslope) !tendancies on the glaciers [1] |
---|
45 | REAL,INTENT(IN) :: waterice(ngrid,nslope) ! water ice at the surface [kg/m^2] |
---|
46 | REAL,INTENT(IN) :: co2ice(ngrid,nslope) ! co2 ice at the surface [kg/m^2] |
---|
47 | REAL,INTENT(IN) :: TI_PEM(ngrid,nsoil_PEM,nslope) ! Soil Thermal inertia (J/K/^2/s^1/2) |
---|
48 | REAL,INTENT(IN) :: tsoil_PEM(ngrid,nsoil_PEM,nslope) ! Soil temperature (K) |
---|
49 | REAL,INTENT(IN) :: ps(ngrid,timelen) ! Average surface pressure [Pa] |
---|
50 | REAL,INTENT(IN) :: q_co2(ngrid,timelen) ! Mass mixing ratio of co2 in the first layer (kg/kg) |
---|
51 | REAL,INTENT(IN) :: q_h2o(ngrid,timelen) ! Mass mixing ratio of H2o in the first layer (kg/kg) |
---|
52 | |
---|
53 | ! outputs |
---|
54 | REAL,INTENT(INOUT) :: m_h2o_completesoil(ngrid,nsoil_PEM,nslope) ! Density of h2o adsorbed (kg/m^3)(ngrid,nsoil_PEM,nslope) |
---|
55 | REAL,INTENT(OUT) :: delta_mh2oreg(ngrid) ! Difference density of h2o adsorbed (kg/m^3) |
---|
56 | |
---|
57 | REAL,INTENT(INOUT) :: m_co2_completesoil(ngrid,nsoil_PEM,nslope) ! Density of co2 adsorbed (kg/m^3) |
---|
58 | REAL,INTENT(OUT) :: delta_mco2reg(ngrid) ! Difference density of co2 adsorbed (kg/m^3) |
---|
59 | |
---|
60 | ! local variables |
---|
61 | REAL :: theta_h2o_adsorbded(ngrid,nsoil_PEM,nslope) ! Fraction of the pores occupied by H2O molecules |
---|
62 | ! ------------- |
---|
63 | |
---|
64 | |
---|
65 | ! Compute H2O adsorption, then CO2 adsorption |
---|
66 | |
---|
67 | call regolith_h2oadsorption(ngrid,nslope,nsoil_PEM,timelen,tend_h2oglaciers,tend_co2glaciers,waterice,co2ice,ps,q_co2,q_h2o,tsoil_PEM,TI_PEM, & |
---|
68 | theta_h2o_adsorbded,m_h2o_completesoil,delta_mh2oreg) |
---|
69 | |
---|
70 | |
---|
71 | call regolith_co2adsorption(ngrid,nslope,nsoil_PEM,timelen,tend_h2oglaciers,tend_co2glaciers,waterice,co2ice,ps,q_co2,q_h2o, & |
---|
72 | tsoil_PEM,TI_PEM,m_co2_completesoil,delta_mco2reg) |
---|
73 | |
---|
74 | RETURN |
---|
75 | end subroutine |
---|
76 | |
---|
77 | !------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
---|
78 | |
---|
79 | subroutine regolith_h2oadsorption(ngrid,nslope,nsoil_PEM,timelen,tend_h2oglaciers,tend_co2glaciers,waterice,co2ice,ps,q_co2,q_h2o,tsoil_PEM,TI_PEM, & |
---|
80 | theta_h2o_adsorbded,m_h2o_completesoil,delta_mreg) |
---|
81 | |
---|
82 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
83 | !!! |
---|
84 | !!! Purpose: Compute H2O adsorption, following the methods from Jackosky et al., 1997 |
---|
85 | !!! |
---|
86 | !!! Author: LL, 01/2023 |
---|
87 | !!! |
---|
88 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
89 | |
---|
90 | use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,index_breccia,index_bedrock |
---|
91 | use comslope_mod, only : subslope_dist,def_slope_mean |
---|
92 | use vertical_layers_mod, ONLY: ap,bp |
---|
93 | use constants_marspem_mod,only: alpha_clap_h2o,beta_clap_h2o, & |
---|
94 | m_h2o,m_co2,m_noco2, & |
---|
95 | rho_regolith |
---|
96 | #ifndef CPP_STD |
---|
97 | use comcstfi_h, only: pi |
---|
98 | #else |
---|
99 | use comcstfi_mod, only: pi |
---|
100 | #endif |
---|
101 | |
---|
102 | implicit none |
---|
103 | ! inputs |
---|
104 | INTEGER,INTENT(IN) :: ngrid, nslope, nsoil_PEM,timelen ! size dimension |
---|
105 | REAL,INTENT(IN) :: tend_h2oglaciers(ngrid,nslope),tend_co2glaciers(ngrid,nslope) !tendancies on the glaciers () |
---|
106 | REAL,INTENT(IN) :: waterice(ngrid,nslope) ! water ice at the surface [kg/m^2] |
---|
107 | REAL,INTENT(IN) :: co2ice(ngrid,nslope) ! co2 ice at the surface [kg/m^2] |
---|
108 | REAL,INTENT(IN) :: ps(ngrid,timelen) ! surface pressure (Pa) |
---|
109 | REAL,INTENT(IN) :: q_co2(ngrid,timelen) ! Mass mixing ratio of co2 in the first layer (kg/kg) |
---|
110 | REAL,INTENT(IN) :: q_h2o(ngrid,timelen) ! Mass mixing ratio of H2o in the first layer (kg/kg) |
---|
111 | REAL,INTENT(IN) :: TI_PEM(ngrid,nsoil_PEM,nslope) ! Soil Thermal inertia (J/K/^2/s^1/2) |
---|
112 | REAL,INTENT(IN) :: tsoil_PEM(ngrid,nsoil_PEM,nslope) ! Soil temperature (K) |
---|
113 | |
---|
114 | ! outputs |
---|
115 | REAL,INTENT(INOUT) :: m_h2o_completesoil(ngrid,nsoil_PEM,nslope) ! Density of h2o adsorbed (kg/m^3)(ngrid,nsoil_PEM,nslope) |
---|
116 | REAL,INTENT(OUT) :: theta_h2o_adsorbded(ngrid,nsoil_PEM,nslope) ! Fraction of the pores occupied by H2O molecules |
---|
117 | REAL,INTENT(OUT) :: delta_mreg(ngrid) ! Difference density of h2o adsorbed (kg/m^3) |
---|
118 | |
---|
119 | ! constants |
---|
120 | REAL :: Ko = 1.57e-8 ! Jackosky et al. 1997 |
---|
121 | REAL :: e = 2573.9 ! Jackosky et al. 1997 |
---|
122 | REAL :: mu = 0.48 ! Jackosky et al. 1997 |
---|
123 | real :: m_theta = 2.84e-7 ! Mass of h2o per m^2 absorbed Jackosky et al. 1997 |
---|
124 | ! real :: as = 18.9e3 ! Specific area, Buhler & Piqueux 2021 |
---|
125 | real :: as = 9.48e4 ! Specific area, Zent |
---|
126 | real :: as_breccia = 1.7e4 ! Specific area of basalt, Zent |
---|
127 | real :: inertie_thresold = 800. ! TI > 800 means cementation |
---|
128 | |
---|
129 | ! local variables |
---|
130 | REAL :: deltam_reg_complete(ngrid,index_breccia,nslope) ! Difference in the mass per slope and soil layer (kg/m^3) |
---|
131 | real :: K ! Used to compute theta |
---|
132 | integer ig,iloop, islope,isoil,it ! for loops |
---|
133 | INTEGER :: ispermanent_co2glaciers(ngrid,nslope) ! Check if the co2 glacier is permanent |
---|
134 | INTEGER :: ispermanent_h2oglaciers(ngrid,nslope) ! Check if the h2o glacier is permanent |
---|
135 | REAL :: deltam_reg_slope(ngrid,nslope) ! Difference density of h2o adsorbed per slope (kg/m^3) |
---|
136 | REAL :: dm_h2o_regolith_slope(ngrid,nsoil_PEM,nslope) ! elementary h2o mass adsorded per mesh per slope |
---|
137 | real :: A,B ! Used to compute the mean mass above the surface |
---|
138 | real :: p_sat ! saturated vapor pressure of ice |
---|
139 | real,allocatable :: mass_mean(:,:) ! mean mass above the surface |
---|
140 | real,allocatable :: zplev_mean(:,:) ! pressure above the surface |
---|
141 | real,allocatable :: pvapor(:,:) ! partial pressure above the surface |
---|
142 | real, allocatable :: pvapor_avg(:) ! yearly |
---|
143 | |
---|
144 | ! 0. Some initializations |
---|
145 | |
---|
146 | |
---|
147 | allocate(mass_mean(ngrid,timelen)) |
---|
148 | allocate(zplev_mean(ngrid,timelen)) |
---|
149 | allocate(pvapor(ngrid,timelen)) |
---|
150 | allocate(pvapor_avg(ngrid)) |
---|
151 | A =(1/m_co2 - 1/m_noco2) |
---|
152 | B=1/m_noco2 |
---|
153 | theta_h2o_adsorbded(:,:,:) = 0. |
---|
154 | dm_h2o_regolith_slope(:,:,:) = 0. |
---|
155 | |
---|
156 | #ifndef CPP_STD |
---|
157 | |
---|
158 | !0.1 Look at perenial ice |
---|
159 | do ig = 1,ngrid |
---|
160 | do islope = 1,nslope |
---|
161 | if((abs(tend_h2oglaciers(ig,islope)).gt.1e-5).and.(abs(waterice(ig,islope)).gt.0)) then |
---|
162 | ispermanent_h2oglaciers(ig,islope) = 1 |
---|
163 | else |
---|
164 | ispermanent_h2oglaciers(ig,islope) = 0 |
---|
165 | endif |
---|
166 | |
---|
167 | if((abs(tend_co2glaciers(ig,islope)).gt.1e-5).and.(abs(co2ice(ig,islope)).gt.0)) then |
---|
168 | ispermanent_co2glaciers(ig,islope) = 1 |
---|
169 | else |
---|
170 | ispermanent_co2glaciers(ig,islope) = 0 |
---|
171 | endif |
---|
172 | enddo |
---|
173 | enddo |
---|
174 | |
---|
175 | ! 0.2 Compute the partial pressure of vapor |
---|
176 | !a. the molecular mass into the column |
---|
177 | do ig = 1,ngrid |
---|
178 | mass_mean(ig,:) = 1/(A*q_co2(ig,:) +B) |
---|
179 | enddo |
---|
180 | |
---|
181 | |
---|
182 | ! b. pressure level |
---|
183 | do it = 1,timelen |
---|
184 | do ig = 1,ngrid |
---|
185 | zplev_mean(ig,it) = ap(1) + bp(1)*ps(ig,it) |
---|
186 | enddo |
---|
187 | enddo |
---|
188 | ! c. Vapor pressure |
---|
189 | pvapor(:,:) = mass_mean(:,:)/m_h2o*q_h2o(:,:)*zplev_mean(:,:) |
---|
190 | pvapor_avg(:) = sum(pvapor(:,:),2)/timelen |
---|
191 | #endif |
---|
192 | deallocate(pvapor) |
---|
193 | deallocate(zplev_mean) |
---|
194 | deallocate(mass_mean) |
---|
195 | #ifndef CPP_STD |
---|
196 | |
---|
197 | ! 1. we compute the mass of H2O adsorded in each layer of the meshes |
---|
198 | |
---|
199 | do ig = 1,ngrid |
---|
200 | do islope = 1,nslope |
---|
201 | do iloop = 1,index_breccia |
---|
202 | K = Ko*exp(e/tsoil_PEM(ig,iloop,islope)) |
---|
203 | if(TI_PEM(ig,iloop,islope).lt.inertie_thresold) then |
---|
204 | theta_h2o_adsorbded(ig,iloop,islope) = (K*pvapor_avg(ig)/(1+K*pvapor_avg(ig)))**mu |
---|
205 | else |
---|
206 | p_sat =exp(beta_clap_h2o/tsoil_PEM(ig,iloop,islope) +alpha_clap_h2o) ! we assume fixed temperature in the ice ... not really good but ... |
---|
207 | theta_h2o_adsorbded(ig,iloop,islope) = (K*p_sat/(1+K*p_sat))**mu |
---|
208 | endif |
---|
209 | dm_h2o_regolith_slope(ig,iloop,islope) = as*theta_h2o_adsorbded(ig,iloop,islope)*m_theta*rho_regolith |
---|
210 | enddo |
---|
211 | enddo |
---|
212 | enddo |
---|
213 | |
---|
214 | ! 2. Check the exchange between the atmosphere and the regolith |
---|
215 | |
---|
216 | do ig = 1,ngrid |
---|
217 | delta_mreg(ig) = 0. |
---|
218 | do islope = 1,nslope |
---|
219 | deltam_reg_slope(ig,islope) = 0. |
---|
220 | do iloop = 1,index_breccia |
---|
221 | if((TI_PEM(ig,iloop,islope).lt.inertie_thresold).and.(ispermanent_h2oglaciers(ig,islope).eq.0).and.(ispermanent_co2glaciers(ig,islope).eq.0)) then |
---|
222 | deltam_reg_complete(ig,iloop,islope) = (dm_h2o_regolith_slope(ig,iloop,islope) - m_h2o_completesoil(ig,iloop,islope)) & |
---|
223 | *(layer_PEM(iloop+1) - layer_PEM(iloop)) |
---|
224 | else ! NO EXCHANGE AS ICE BLOCK THE DYNAMIC! |
---|
225 | deltam_reg_complete(ig,iloop,islope) = 0. |
---|
226 | endif |
---|
227 | deltam_reg_slope(ig,islope) = deltam_reg_slope(ig,islope) + deltam_reg_complete(ig,iloop,islope) |
---|
228 | enddo |
---|
229 | delta_mreg(ig) = delta_mreg(ig) + deltam_reg_slope(ig,islope)*subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.) |
---|
230 | enddo |
---|
231 | enddo |
---|
232 | m_h2o_completesoil(:,:,:) = dm_h2o_regolith_slope(:,:,:) |
---|
233 | |
---|
234 | RETURN |
---|
235 | #endif |
---|
236 | end subroutine |
---|
237 | |
---|
238 | !------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
---|
239 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
240 | !!! |
---|
241 | !!! Purpose: Compute CO2 following the methods from Zent & Quinn 1995 |
---|
242 | !!! |
---|
243 | !!! Author: LL, 01/2023 |
---|
244 | !!! |
---|
245 | !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
---|
246 | |
---|
247 | SUBROUTINE regolith_co2adsorption(ngrid,nslope,nsoil_PEM,timelen,tend_h2oglaciers,tend_co2glaciers,waterice,co2ice,ps,q_co2,q_h2o,& |
---|
248 | tsoil_PEM,TI_PEM,m_co2_completesoil,delta_mreg) |
---|
249 | |
---|
250 | use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,index_breccia,index_bedrock,index_breccia |
---|
251 | use comslope_mod, only : subslope_dist,def_slope_mean |
---|
252 | use vertical_layers_mod, ONLY: ap,bp |
---|
253 | use constants_marspem_mod, only: m_co2, m_noco2,rho_regolith |
---|
254 | #ifndef CPP_STD |
---|
255 | use comcstfi_h, only: pi |
---|
256 | #else |
---|
257 | use comcstfi_mod, only: pi |
---|
258 | #endif |
---|
259 | |
---|
260 | IMPLICIT NONE |
---|
261 | ! Inputs: |
---|
262 | INTEGER,INTENT(IN) :: ngrid, nslope, nsoil_PEM,timelen ! size dimension |
---|
263 | REAL,INTENT(IN) :: ps(ngrid,timelen) ! Average surface pressure [Pa] |
---|
264 | REAL,INTENT(IN) :: tsoil_PEM(ngrid,nsoil_PEM,nslope) ! Mean Soil Temperature [K] |
---|
265 | REAL,INTENT(IN) :: TI_PEM(ngrid,nsoil_PEM,nslope) ! Mean Thermal Inertia [USI] |
---|
266 | REAL,INTENT(IN) :: tend_h2oglaciers(ngrid,nslope),tend_co2glaciers(ngrid,nslope) !tendancies on the glaciers () |
---|
267 | REAL,INTENT(IN) :: q_co2(ngrid,timelen),q_h2o(ngrid,timelen) ! Mass mixing ratio of co2 and h2o in the first layer (kg/kg) |
---|
268 | REAL,INTENT(IN) :: waterice(ngrid,nslope) ! water ice at the surface [kg/m^2] |
---|
269 | REAL,INTENT(IN) :: co2ice(ngrid,nslope) ! co2 ice at the surface [kg/m^2] |
---|
270 | |
---|
271 | ! Outputs: |
---|
272 | REAL,INTENT(INOUT) :: m_co2_completesoil(ngrid,nsoil_PEM,nslope) ! Density of co2 adsorbed (kg/m^3) |
---|
273 | REAL,INTENT(OUT) :: delta_mreg(ngrid) ! Difference density of co2 adsorbed (kg/m^3) |
---|
274 | |
---|
275 | ! Constants: |
---|
276 | |
---|
277 | REAL :: alpha = 7.512e-6 ! Zent & Quinn 1995 |
---|
278 | REAL :: beta = -1541.5 ! Zent & Quinn 1995 |
---|
279 | REAL :: inertie_thresold = 800. ! TI > 800 means cementation |
---|
280 | real :: m_theta = 4.27e-7 ! Mass of co2 per m^2 absorbed |
---|
281 | ! real :: as = 18.9e3 ! Specific area, Buhler & Piqueux 2021 |
---|
282 | real :: as = 9.48e4 ! same as previous but from zent |
---|
283 | real :: as_breccia = 1.7e4 ! Specific area of basalt, Zent 1997 |
---|
284 | ! Local |
---|
285 | real :: A,B ! Used to compute the mean mass above the surface |
---|
286 | INTEGER :: ig,islope,iloop,it ! for loops |
---|
287 | REAL :: dm_co2_regolith_slope(ngrid,nsoil_PEM,nslope) ! elementary mass adsorded per mesh per slope |
---|
288 | INTEGER :: ispermanent_co2glaciers(ngrid,nslope) ! Check if the co2 glacier is permanent |
---|
289 | INTEGER :: ispermanent_h2oglaciers(ngrid,nslope) ! Check if the h2o glacier is permanent |
---|
290 | REAL :: deltam_reg_complete(ngrid,index_breccia,nslope) ! Difference in the mass per slope and soil layer (kg/m^3) |
---|
291 | REAL :: deltam_reg_slope(ngrid,nslope) ! Difference in the mass per slope (kg/m^3) |
---|
292 | REAL :: m_h2o_adsorbed(ngrid,nsoil_PEM,nslope) ! Density of CO2 adsorbed (kg/m^3) |
---|
293 | REAL :: theta_h2o_adsorbed(ngrid,nsoil_PEM,nslope) ! Fraction of the pores occupied by H2O molecules |
---|
294 | REAL :: delta_mh2o(ngrid) ! Difference density of h2o adsorbed (kg/m^3) |
---|
295 | !timelen array are allocated because heavy ... |
---|
296 | real,allocatable :: mass_mean(:,:) ! mean mass above the surface |
---|
297 | real,allocatable :: zplev_mean(:,:) ! pressure above the surface |
---|
298 | real,allocatable :: pco2(:,:) ! partial pressure above the surface |
---|
299 | real, allocatable :: pco2_avg(:) ! yearly averaged |
---|
300 | |
---|
301 | ! 0. Some initializations |
---|
302 | |
---|
303 | allocate(mass_mean(ngrid,timelen)) |
---|
304 | allocate(zplev_mean(ngrid,timelen)) |
---|
305 | allocate(pco2(ngrid,timelen)) |
---|
306 | allocate(pco2_avg(ngrid)) |
---|
307 | |
---|
308 | |
---|
309 | |
---|
310 | m_h2o_adsorbed(:,:,:) = 0. |
---|
311 | A =(1/m_co2 - 1/m_noco2) |
---|
312 | B=1/m_noco2 |
---|
313 | |
---|
314 | dm_co2_regolith_slope(:,:,:) = 0 |
---|
315 | delta_mreg(:) = 0. |
---|
316 | |
---|
317 | #ifndef CPP_STD |
---|
318 | |
---|
319 | !0.1 Look at perenial ice |
---|
320 | do ig = 1,ngrid |
---|
321 | do islope = 1,nslope |
---|
322 | if((abs(tend_h2oglaciers(ig,islope)).gt.1e-5).and.(abs(waterice(ig,islope)).gt.0)) then |
---|
323 | ispermanent_h2oglaciers(ig,islope) = 1 |
---|
324 | else |
---|
325 | ispermanent_h2oglaciers(ig,islope) = 0 |
---|
326 | endif |
---|
327 | |
---|
328 | if((abs(tend_co2glaciers(ig,islope)).gt.1e-5).and.(abs(co2ice(ig,islope)).gt.0)) then |
---|
329 | ispermanent_co2glaciers(ig,islope) = 1 |
---|
330 | else |
---|
331 | ispermanent_co2glaciers(ig,islope) = 0 |
---|
332 | endif |
---|
333 | enddo |
---|
334 | enddo |
---|
335 | |
---|
336 | ! 0.2 Compute the partial pressure of CO2 |
---|
337 | !a. the molecular mass into the column |
---|
338 | do ig = 1,ngrid |
---|
339 | mass_mean(ig,:) = 1./(A*q_co2(ig,:) +B) |
---|
340 | enddo |
---|
341 | |
---|
342 | ! b. pressure level |
---|
343 | do it = 1,timelen |
---|
344 | do ig = 1,ngrid |
---|
345 | zplev_mean(ig,it) = ap(1) + bp(1)*ps(ig,it) |
---|
346 | enddo |
---|
347 | enddo |
---|
348 | |
---|
349 | ! c. Vapor pressure |
---|
350 | pco2(:,:) = mass_mean(:,:)/m_co2*q_co2(:,:)*zplev_mean(:,:) |
---|
351 | pco2_avg(:) = sum(pco2(:,:),2)/timelen |
---|
352 | |
---|
353 | deallocate(zplev_mean) |
---|
354 | deallocate(mass_mean) |
---|
355 | deallocate(pco2) |
---|
356 | |
---|
357 | |
---|
358 | ! 1. Compute the fraction of the pores occupied by H2O |
---|
359 | |
---|
360 | call regolith_h2oadsorption(ngrid,nslope,nsoil_PEM,timelen,tend_h2oglaciers,tend_co2glaciers,waterice,co2ice,ps,q_co2,q_h2o,tsoil_PEM,TI_PEM, & |
---|
361 | theta_h2o_adsorbed, m_h2o_adsorbed,delta_mh2o) |
---|
362 | |
---|
363 | ! 2. we compute the mass of co2 adsorded in each layer of the meshes |
---|
364 | |
---|
365 | do ig = 1,ngrid |
---|
366 | do islope = 1,nslope |
---|
367 | do iloop = 1,index_breccia |
---|
368 | if((TI_PEM(ig,iloop,islope).lt.inertie_thresold).and.(ispermanent_h2oglaciers(ig,islope).eq.0).and.(ispermanent_co2glaciers(ig,islope).eq.0)) then |
---|
369 | dm_co2_regolith_slope(ig,iloop,islope) = as*rho_regolith*m_theta*(1-theta_h2o_adsorbed(ig,iloop,islope))*alpha*pco2_avg(ig)/ & |
---|
370 | (alpha*pco2_avg(ig)+sqrt(tsoil_PEM(ig,iloop,islope))*exp(beta/tsoil_PEM(ig,iloop,islope))) |
---|
371 | else |
---|
372 | if(abs(m_co2_completesoil(ig,iloop,islope)).lt.(1e-10)) then !!! we are at first call |
---|
373 | dm_co2_regolith_slope(ig,iloop,islope) = as*rho_regolith*m_theta*(1-theta_h2o_adsorbed(ig,iloop,islope))*alpha*pco2_avg(ig) & |
---|
374 | /(alpha*pco2_avg(ig)+sqrt(tsoil_PEM(ig,iloop,islope))*exp(beta/tsoil_PEM(ig,iloop,islope))) |
---|
375 | else ! no change: permanent ice stick the atoms of CO2 |
---|
376 | dm_co2_regolith_slope(ig,iloop,islope) = m_co2_completesoil(ig,iloop,islope) |
---|
377 | endif |
---|
378 | endif |
---|
379 | enddo |
---|
380 | enddo |
---|
381 | enddo |
---|
382 | |
---|
383 | ! 3. Check the exchange between the atmosphere and the regolith |
---|
384 | |
---|
385 | do ig = 1,ngrid |
---|
386 | delta_mreg(ig) = 0. |
---|
387 | do islope = 1,nslope |
---|
388 | deltam_reg_slope(ig,islope) = 0. |
---|
389 | do iloop = 1,index_breccia |
---|
390 | if((TI_PEM(ig,iloop,islope).lt.inertie_thresold).and.(ispermanent_h2oglaciers(ig,islope).eq.0).and.(ispermanent_co2glaciers(ig,islope).eq.0)) then |
---|
391 | deltam_reg_complete(ig,iloop,islope) = (dm_co2_regolith_slope(ig,iloop,islope) - m_co2_completesoil(ig,iloop,islope)) & |
---|
392 | *(layer_PEM(iloop+1) - layer_PEM(iloop)) |
---|
393 | else ! NO EXCHANGE AS ICE BLOCK THE DYNAMIC! |
---|
394 | deltam_reg_complete(ig,iloop,islope) = 0. |
---|
395 | endif |
---|
396 | deltam_reg_slope(ig,islope) = deltam_reg_slope(ig,islope) + deltam_reg_complete(ig,iloop,islope) |
---|
397 | enddo |
---|
398 | delta_mreg(ig) = delta_mreg(ig) + deltam_reg_slope(ig,islope)*subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.) |
---|
399 | enddo |
---|
400 | enddo |
---|
401 | m_co2_completesoil(:,:,:) = dm_co2_regolith_slope(:,:,:) |
---|
402 | |
---|
403 | !======================================================================= |
---|
404 | RETURN |
---|
405 | #endif |
---|
406 | END |
---|
407 | |
---|
408 | |
---|
409 | end module |
---|