Changeset 3991 for trunk/LMDZ.COMMON/libf/evolution/sorption.F90
- Timestamp:
- Dec 16, 2025, 4:39:24 PM (4 weeks ago)
- File:
-
- 1 edited
-
trunk/LMDZ.COMMON/libf/evolution/sorption.F90 (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/sorption.F90
r3989 r3991 1 1 MODULE sorption 2 3 implicit none 4 2 !----------------------------------------------------------------------- 3 ! NAME 4 ! sorption 5 ! 6 ! DESCRIPTION 7 ! CO2 and H2O adsorption/desorption in regolith following Zent & Quinn 8 ! (1995) and Jackosky et al. (1997). 9 ! 10 ! AUTHORS & DATE 11 ! L. Lange, 2023 12 ! JB Clement, 2025 13 ! 14 ! NOTES 15 ! 16 !----------------------------------------------------------------------- 17 18 ! DECLARATION 19 ! ----------- 20 implicit none 21 22 ! MODULE VARIABLES 23 ! ---------------- 5 24 logical :: do_sorption ! Flag to compute adsorption/desorption 6 25 real, allocatable, dimension(:,:,:) :: co2_adsorbed_phys ! co2 that is in the regolith [kg/m^2] 7 26 real, allocatable, dimension(:,:,:) :: h2o_adsorbed_phys ! h2o that is in the regolith [kg/m^2] 8 27 9 !=======================================================================10 28 contains 11 !======================================================================= 12 13 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 14 !!! 15 !!! Purpose: Compute CO2 and H2O adsorption, following the methods from Zent & Quinn 1995, Jackosky et al., 1997 16 !!! 17 !!! Author: LL, 01/2023 18 !!! 19 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 29 !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 30 31 !======================================================================= 20 32 SUBROUTINE ini_adsorption_h_PEM(ngrid,nslope,nsoilmx_PEM) 21 22 implicit none 23 33 !----------------------------------------------------------------------- 34 ! NAME 35 ! ini_adsorption_h_PEM 36 ! 37 ! DESCRIPTION 38 ! Allocate CO2 and H2O adsorption arrays. 39 ! 40 ! AUTHORS & DATE 41 ! L. Lange, 2023 42 ! JB Clement, 2025 43 ! 44 ! NOTES 45 ! 46 !----------------------------------------------------------------------- 47 48 ! DECLARATION 49 ! ----------- 50 implicit none 51 52 ! ARGUMENTS 53 ! --------- 24 54 integer, intent(in) :: ngrid ! number of atmospheric columns 25 55 integer, intent(in) :: nslope ! number of slope within a mesh 26 56 integer, intent(in) :: nsoilmx_PEM ! number of soil layer in the PEM 27 57 58 ! CODE 59 ! ---- 28 60 allocate(co2_adsorbed_phys(ngrid,nsoilmx_PEM,nslope)) 29 61 allocate(h2o_adsorbed_phys(ngrid,nsoilmx_PEM,nslope)) 30 62 31 63 END SUBROUTINE ini_adsorption_h_PEM 64 !======================================================================= 32 65 33 66 !======================================================================= 34 67 SUBROUTINE end_adsorption_h_PEM 35 68 !----------------------------------------------------------------------- 69 ! NAME 70 ! end_adsorption_h_PEM 71 ! 72 ! DESCRIPTION 73 ! Deallocate adsorption arrays. 74 ! 75 ! AUTHORS & DATE 76 ! L. Lange, 2023 77 ! JB Clement, 2025 78 ! 79 ! NOTES 80 ! 81 !----------------------------------------------------------------------- 82 83 ! DECLARATION 84 ! ----------- 85 implicit none 86 87 ! CODE 88 ! ---- 36 89 if (allocated(co2_adsorbed_phys)) deallocate(co2_adsorbed_phys) 37 90 if (allocated(h2o_adsorbed_phys)) deallocate(h2o_adsorbed_phys) 38 91 39 92 END SUBROUTINE end_adsorption_h_PEM 93 !======================================================================= 40 94 41 95 !======================================================================= 42 96 SUBROUTINE regolith_adsorption(ngrid,nslope,nsoil_PEM,timelen,d_h2oglaciers,d_co2glaciers,waterice,co2ice,tsoil_PEM,TI_PEM,ps,q_co2,q_h2o, & 43 97 m_h2o_completesoil,delta_mh2oreg, m_co2_completesoil,delta_mco2reg) 44 45 implicit none 46 47 ! Inputs 48 integer, intent(in) :: ngrid, nslope, nsoil_PEM, timelen ! size dimension: physics x subslope x soil x timeseries 49 real, dimension(ngrid,nslope), intent(in) :: d_h2oglaciers, d_co2glaciers ! tendancies on the glaciers [1] 50 real, dimension(ngrid,nslope), intent(in) :: waterice ! water ice at the surface [kg/m^2] 51 real, dimension(ngrid,nslope), intent(in) :: co2ice ! co2 ice at the surface [kg/m^2] 52 real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: TI_PEM ! Soil Thermal inertia (J/K/^2/s^1/2) 53 real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: tsoil_PEM ! Soil temperature (K) 54 real, dimension(ngrid,timelen), intent(in) :: ps ! Average surface pressure [Pa] 55 real, dimension(ngrid,timelen), intent(in) :: q_co2 ! Mass mixing ratio of co2 in the first layer (kg/kg) 56 real, dimension(ngrid,timelen), intent(in) :: q_h2o ! Mass mixing ratio of H2o in the first layer (kg/kg) 57 58 ! Outputs 59 real, dimension(ngrid), intent(out) :: delta_mh2oreg ! Difference density of h2o adsorbed (kg/m^3) 60 real, dimension(ngrid), intent(out) :: delta_mco2reg ! Difference density of co2 adsorbed (kg/m^3) 61 real, dimension(ngrid,nsoil_PEM,nslope), intent(inout) :: m_co2_completesoil ! Density of co2 adsorbed (kg/m^3) 62 real, dimension(ngrid,nsoil_PEM,nslope), intent(inout) :: m_h2o_completesoil ! Density of h2o adsorbed (kg/m^3) 63 64 ! Local variables 98 !----------------------------------------------------------------------- 99 ! NAME 100 ! regolith_adsorption 101 ! 102 ! DESCRIPTION 103 ! Compute both H2O and CO2 adsorption in regolith. 104 ! 105 ! AUTHORS & DATE 106 ! L. Lange, 2023 107 ! JB Clement, 2025 108 ! 109 ! NOTES 110 ! 111 !----------------------------------------------------------------------- 112 113 ! DECLARATION 114 ! ----------- 115 implicit none 116 117 ! ARGUMENTS 118 ! --------- 119 integer, intent(in) :: ngrid, nslope, nsoil_PEM, timelen ! size dimension: physics x subslope x soil x timeseries 120 real, dimension(ngrid,nslope), intent(in) :: d_h2oglaciers, d_co2glaciers ! tendancies on the glaciers [1] 121 real, dimension(ngrid,nslope), intent(in) :: waterice ! water ice at the surface [kg/m^2] 122 real, dimension(ngrid,nslope), intent(in) :: co2ice ! co2 ice at the surface [kg/m^2] 123 real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: TI_PEM ! Soil Thermal inertia (J/K/^2/s^1/2) 124 real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: tsoil_PEM ! Soil temperature (K) 125 real, dimension(ngrid,timelen), intent(in) :: ps ! Average surface pressure [Pa] 126 real, dimension(ngrid,timelen), intent(in) :: q_co2 ! Mass mixing ratio of co2 in the first layer (kg/kg) 127 real, dimension(ngrid,timelen), intent(in) :: q_h2o ! Mass mixing ratio of H2o in the first layer (kg/kg) 128 real, dimension(ngrid), intent(out) :: delta_mh2oreg ! Difference density of h2o adsorbed (kg/m^3) 129 real, dimension(ngrid), intent(out) :: delta_mco2reg ! Difference density of co2 adsorbed (kg/m^3) 130 real, dimension(ngrid,nsoil_PEM,nslope), intent(inout) :: m_co2_completesoil ! Density of co2 adsorbed (kg/m^3) 131 real, dimension(ngrid,nsoil_PEM,nslope), intent(inout) :: m_h2o_completesoil ! Density of h2o adsorbed (kg/m^3) 132 133 ! LOCAL VARIABLES 134 ! --------------- 65 135 real, dimension(ngrid,nsoil_PEM,nslope) :: theta_h2o_adsorbed ! Fraction of the pores occupied by H2O molecules 66 ! ------------- 67 ! Compute H2O adsorption, then CO2 adsorption 136 137 ! CODE 138 ! ---- 68 139 call regolith_h2oadsorption(ngrid,nslope,nsoil_PEM,timelen,d_h2oglaciers,d_co2glaciers,waterice,co2ice,ps,q_co2,q_h2o,tsoil_PEM,TI_PEM, & 69 140 theta_h2o_adsorbed,m_h2o_completesoil,delta_mh2oreg) … … 72 143 73 144 END SUBROUTINE regolith_adsorption 145 !======================================================================= 74 146 75 147 !======================================================================= 76 148 SUBROUTINE regolith_h2oadsorption(ngrid,nslope,nsoil_PEM,timelen,d_h2oglaciers,d_co2glaciers,waterice,co2ice,ps,q_co2,q_h2o,tsoil_PEM,TI_PEM, & 77 149 theta_h2o_adsorbed,m_h2o_completesoil,delta_mreg) 78 79 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 80 !!! 81 !!! Purpose: Compute H2O adsorption, following the methods from Jackosky et al., 1997 82 !!! 83 !!! Author: LL, 01/2023 84 !!! 85 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 86 87 use soil, only: layer_PEM, index_breccia 150 !----------------------------------------------------------------------- 151 ! NAME 152 ! regolith_h2oadsorption 153 ! 154 ! DESCRIPTION 155 ! Compute H2O adsorption in regolith following Jackosky et al. (1997). 156 ! 157 ! AUTHORS & DATE 158 ! L. Lange, 2023 159 ! JB Clement, 2025 160 ! 161 ! NOTES 162 ! 163 !----------------------------------------------------------------------- 164 165 ! DEPENDENCIES 166 ! ------------ 167 use soil, only: layer_PEM, index_breccia 88 168 use comslope_mod, only: subslope_dist, def_slope_mean 89 169 use vertical_layers_mod, only: ap, bp … … 91 171 use phys_constants, only: pi 92 172 93 implicit none 94 95 ! Inputs 96 integer, intent(in) :: ngrid, nslope, nsoil_PEM,timelen ! Size dimension 97 real, dimension(ngrid,nslope), intent(in) :: d_h2oglaciers, d_co2glaciers ! Tendencies on the glaciers () 98 real, dimension(ngrid,nslope), intent(in) :: waterice ! Water ice at the surface [kg/m^2] 99 real, dimension(ngrid,nslope), intent(in) :: co2ice ! CO2 ice at the surface [kg/m^2] 100 real, dimension(ngrid,timelen), intent(in) :: ps ! Surface pressure (Pa) 101 real, dimension(ngrid,timelen), intent(in) :: q_co2 ! Mass mixing ratio of co2 in the first layer (kg/kg) 102 real, dimension(ngrid,timelen), intent(in) :: q_h2o ! Mass mixing ratio of H2o in the first layer (kg/kg) 103 real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: TI_PEM ! Soil Thermal inertia (J/K/^2/s^1/2) 104 real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: tsoil_PEM ! Soil temperature (K) 105 106 ! Outputs 107 real, dimension(ngrid,nsoil_PEM,nslope), intent(inout) :: m_h2o_completesoil ! Density of h2o adsorbed (kg/m^3)(ngrid,nsoil_PEM,nslope) 108 real, dimension(ngrid,nsoil_PEM,nslope), intent(out) :: theta_h2o_adsorbed ! Fraction of the pores occupied by H2O molecules 109 real, dimension(ngrid), intent(out) :: delta_mreg ! Difference density of h2o adsorbed (kg/m^3) 110 111 ! Constants 173 ! DECLARATION 174 ! ----------- 175 implicit none 176 177 ! ARGUMENTS 178 ! --------- 179 integer, intent(in) :: ngrid, nslope, nsoil_PEM,timelen ! Size dimension 180 real, dimension(ngrid,nslope), intent(in) :: d_h2oglaciers, d_co2glaciers ! Tendencies on the glaciers () 181 real, dimension(ngrid,nslope), intent(in) :: waterice ! Water ice at the surface [kg/m^2] 182 real, dimension(ngrid,nslope), intent(in) :: co2ice ! CO2 ice at the surface [kg/m^2] 183 real, dimension(ngrid,timelen), intent(in) :: ps ! Surface pressure (Pa) 184 real, dimension(ngrid,timelen), intent(in) :: q_co2 ! Mass mixing ratio of co2 in the first layer (kg/kg) 185 real, dimension(ngrid,timelen), intent(in) :: q_h2o ! Mass mixing ratio of H2o in the first layer (kg/kg) 186 real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: TI_PEM ! Soil Thermal inertia (J/K/^2/s^1/2) 187 real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: tsoil_PEM ! Soil temperature (K) 188 real, dimension(ngrid,nsoil_PEM,nslope), intent(inout) :: m_h2o_completesoil ! Density of h2o adsorbed (kg/m^3)(ngrid,nsoil_PEM,nslope) 189 real, dimension(ngrid,nsoil_PEM,nslope), intent(out) :: theta_h2o_adsorbed ! Fraction of the pores occupied by H2O molecules 190 real, dimension(ngrid), intent(out) :: delta_mreg ! Difference density of h2o adsorbed (kg/m^3) 191 192 ! LOCAL VARIABLES 193 ! --------------- 194 ! Constants: 112 195 real :: Ko = 1.57e-8 ! Jackosky et al. 1997 113 196 real :: e = 2573.9 ! Jackosky et al. 1997 … … 117 200 real :: as = 9.48e4 ! Specific area, Zent 118 201 real :: inertie_thresold = 800. ! TI > 800 means cementation 119 120 ! Local variables121 202 real, dimension(ngrid,index_breccia,nslope) :: deltam_reg_complete ! Difference in the mass per slope and soil layer (kg/m^3) 122 203 real :: K ! Used to compute theta … … 133 214 real, dimension(:) , allocatable :: pvapor_avg ! Yearly averaged 134 215 216 ! CODE 217 ! ---- 135 218 ! 0. Some initializations 136 219 allocate(mass_mean(ngrid,timelen),zplev_mean(ngrid,timelen),pvapor(ngrid,timelen),pvapor_avg(ngrid)) … … 207 290 208 291 END SUBROUTINE regolith_h2oadsorption 209 210 !======================================================================= 211 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 212 !!! 213 !!! Purpose: Compute CO2 following the methods from Zent & Quinn 1995 214 !!! 215 !!! Author: LL, 01/2023 216 !!! 217 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 292 !======================================================================= 293 294 !======================================================================= 218 295 SUBROUTINE regolith_co2adsorption(ngrid,nslope,nsoil_PEM,timelen,d_h2oglaciers,d_co2glaciers,waterice,co2ice,ps,q_co2,q_h2o,tsoil_PEM,TI_PEM,m_co2_completesoil,delta_mreg) 219 296 220 use soil, only: layer_PEM, index_breccia, index_breccia 297 !----------------------------------------------------------------------- 298 ! NAME 299 ! regolith_co2adsorption 300 ! 301 ! DESCRIPTION 302 ! Compute CO2 adsorption in regolith following Zent & Quinn (1995). 303 ! 304 ! AUTHORS & DATE 305 ! L. Lange, 2023 306 ! JB Clement, 2025 307 ! 308 ! NOTES 309 ! 310 !----------------------------------------------------------------------- 311 312 ! DEPENDENCIES 313 ! ------------ 314 use soil, only: layer_PEM, index_breccia 221 315 use comslope_mod, only: subslope_dist, def_slope_mean 222 316 use vertical_layers_mod, only: ap, bp … … 224 318 use phys_constants, only: pi 225 319 226 implicit none 227 228 ! Inputs: 229 integer, intent(in) :: ngrid, nslope, nsoil_PEM,timelen ! Size dimension 230 real, dimension(ngrid,timelen), intent(in) :: ps ! Average surface pressure [Pa] 231 real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: tsoil_PEM ! Mean Soil Temperature [K] 232 real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: TI_PEM ! Mean Thermal Inertia [USI] 233 real, dimension(ngrid,nslope), intent(in) :: d_h2oglaciers, d_co2glaciers ! Tendencies on the glaciers () 234 real, dimension(ngrid,timelen), intent(in) :: q_co2, q_h2o ! Mass mixing ratio of co2 and h2o in the first layer (kg/kg) 235 real, dimension(ngrid,nslope), intent(in) :: waterice ! Water ice at the surface [kg/m^2] 236 real, dimension(ngrid,nslope), intent(in) :: co2ice ! CO2 ice at the surface [kg/m^2] 237 238 ! Outputs: 239 real, dimension(ngrid,nsoil_PEM,nslope), intent(inout) :: m_co2_completesoil ! Density of co2 adsorbed (kg/m^3) 240 real, dimension(ngrid), intent(out) :: delta_mreg ! Difference density of co2 adsorbed (kg/m^3) 241 320 ! DECLARATION 321 ! ----------- 322 implicit none 323 324 ! ARGUMENTS 325 ! --------- 326 integer, intent(in) :: ngrid, nslope, nsoil_PEM,timelen ! Size dimension 327 real, dimension(ngrid,timelen), intent(in) :: ps ! Average surface pressure [Pa] 328 real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: tsoil_PEM ! Mean Soil Temperature [K] 329 real, dimension(ngrid,nsoil_PEM,nslope), intent(in) :: TI_PEM ! Mean Thermal Inertia [USI] 330 real, dimension(ngrid,nslope), intent(in) :: d_h2oglaciers, d_co2glaciers ! Tendencies on the glaciers () 331 real, dimension(ngrid,timelen), intent(in) :: q_co2, q_h2o ! Mass mixing ratio of co2 and h2o in the first layer (kg/kg) 332 real, dimension(ngrid,nslope), intent(in) :: waterice ! Water ice at the surface [kg/m^2] 333 real, dimension(ngrid,nslope), intent(in) :: co2ice ! CO2 ice at the surface [kg/m^2] 334 real, dimension(ngrid,nsoil_PEM,nslope), intent(inout) :: m_co2_completesoil ! Density of co2 adsorbed (kg/m^3) 335 real, dimension(ngrid), intent(out) :: delta_mreg ! Difference density of co2 adsorbed (kg/m^3) 336 337 ! LOCAL VARIABLES 338 ! --------------- 242 339 ! Constants: 243 340 real :: alpha = 7.512e-6 ! Zent & Quinn 1995 … … 247 344 ! real :: as = 18.9e3 ! Specific area, Buhler & Piqueux 2021 248 345 real :: as = 9.48e4 ! Same as previous but from zent 249 250 ! Local251 346 real :: A, B ! Used to compute the mean mass above the surface 252 347 integer :: ig, islope, iloop, it ! For loops … … 265 360 real, dimension(:), allocatable :: pco2_avg ! Yearly averaged 266 361 362 ! CODE 363 ! ---- 267 364 ! 0. Some initializations 268 365 allocate(mass_mean(ngrid,timelen),zplev_mean(ngrid,timelen),pco2(ngrid,timelen),pco2_avg(ngrid)) … … 348 445 349 446 END SUBROUTINE regolith_co2adsorption 447 !======================================================================= 350 448 351 449 END MODULE sorption
Note: See TracChangeset
for help on using the changeset viewer.
