Changeset 4135 for trunk/LMDZ.COMMON/libf/evolution
- Timestamp:
- Mar 16, 2026, 6:09:43 PM (4 weeks ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 13 edited
-
backup.F90 (modified) (4 diffs)
-
changelog.txt (modified) (1 diff)
-
clim_state_init.F90 (modified) (1 diff)
-
glaciers.F90 (modified) (1 diff)
-
ice_table.F90 (modified) (2 diffs)
-
layered_deposits.F90 (modified) (3 diffs)
-
physics.F90 (modified) (1 diff)
-
planet.F90 (modified) (2 diffs)
-
soil.F90 (modified) (1 diff)
-
soil_temp.F90 (modified) (1 diff)
-
soil_therm_inertia.F90 (modified) (4 diffs)
-
sorption.F90 (modified) (6 diffs)
-
tendencies.F90 (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/backup.F90
r4134 r4135 114 114 ! LOCAL VARIABLES 115 115 ! --------------- 116 real(dp), dimension(:,:), allocatable :: h2o_ice4PCM, co2_ice4PCM, tsurf4PCM, flux_geo4PCM, albedo4PCM, emissivity4PCM 117 real(dp), dimension(:,:), allocatable :: teta4PCM, air_mass4PCM 118 real(dp), dimension(:,:,:), allocatable :: tsoil4PCM, inertiesoil4PCM, q4PCM 119 real(dp), dimension(:), allocatable :: ps4PCM 120 real(dp) :: pa4PCM, preff4PCM 121 logical(k4), dimension(:), allocatable :: is_h2o_perice 116 real(dp), dimension(ngrid,nslope) :: h2o_ice4PCM, co2_ice4PCM, tsurf4PCM, flux_geo4PCM, albedo4PCM, emissivity4PCM 117 real(dp), dimension(ngrid,nlayer) :: teta4PCM, air_mass4PCM 118 real(dp), dimension(ngrid,nsoil_PCM,nslope) :: tsoil4PCM, inertiesoil4PCM 119 real(dp), dimension(ngrid,nlayer,nq) :: q4PCM 120 real(dp), dimension(ngrid) :: ps4PCM 121 logical(k4), dimension(ngrid) :: is_h2o_perice 122 real(dp) :: pa4PCM, preff4PCM 122 123 123 124 ! CODE 124 125 ! ---- 125 126 ! Build ice for the PCM 126 allocate(h2o_ice4PCM(ngrid,nslope),co2_ice4PCM(ngrid,nslope),is_h2o_perice(ngrid))127 127 call build4PCM_perice(h2o_ice,co2_ice,is_h2o_perice,h2o_ice4PCM,co2_ice4PCM) 128 128 129 129 ! Build surface temperature for the PCM 130 allocate(tsurf4PCM(ngrid,nslope))131 130 call build4PCM_tsurf(tsurf_avg,tsurf_dev,tsurf4PCM) 132 131 133 132 ! Build soil for the PCM 134 if (do_soil) then 135 allocate(tsoil4PCM(ngrid,nsoil_PCM,nslope),inertiesoil4PCM(ngrid,nsoil_PCM,nslope),flux_geo4PCM(ngrid,nslope)) 136 call build4PCM_soil(tsoil_avg,tsoil_dev,inertiesoil4PCM,tsoil4PCM,flux_geo4PCM) 137 end if 133 if (do_soil) call build4PCM_soil(tsoil_avg,tsoil_dev,inertiesoil4PCM,tsoil4PCM,flux_geo4PCM) 138 134 139 135 ! Build atmosphere for the PCM 140 allocate(ps4PCM(ngrid),teta4PCM(ngrid,nlayer),air_mass4PCM(ngrid,nlayer))141 136 call build4PCM_atmosphere(ps_avg,ps_dev,ps_avg_glob,ps_avg_glob_ini,ps4PCM,pa4PCM,preff4PCM,teta4PCM,air_mass4PCM) 142 137 143 138 ! Build tracers for the PCM 144 allocate(q4PCM(ngrid,nlayer,nq))145 139 call build4PCM_tracers(ps4PCM,q4PCM) 146 140 147 141 ! Build surface radiative properties state for the PCM 148 allocate(albedo4PCM(ngrid,nslope),emissivity4PCM(ngrid,nslope))149 142 call build4PCM_surf_rad_prop(h2o_ice,co2_ice,albedo4PCM,emissivity4PCM) 150 143 … … 158 151 end if 159 152 160 ! Deallocation161 if (allocated(emissivity4PCM)) deallocate(emissivity4PCM)162 if (allocated(albedo4PCM)) deallocate(albedo4PCM)163 if (allocated(q4PCM)) deallocate(q4PCM)164 if (allocated(ps4PCM)) deallocate(ps4PCM)165 if (allocated(teta4PCM)) deallocate(teta4PCM)166 if (allocated(air_mass4PCM)) deallocate(air_mass4PCM)167 if (allocated(tsoil4PCM)) deallocate(tsoil4PCM)168 if (allocated(inertiesoil4PCM)) deallocate(inertiesoil4PCM)169 if (allocated(flux_geo4PCM)) deallocate(flux_geo4PCM)170 if (allocated(tsurf4PCM)) deallocate(tsurf4PCM)171 if (allocated(co2_ice4PCM)) deallocate(co2_ice4PCM)172 if (allocated(h2o_ice4PCM)) deallocate(h2o_ice4PCM)173 if (allocated(is_h2o_perice)) deallocate(is_h2o_perice)174 175 153 END SUBROUTINE save_clim_state 176 154 !======================================================================= 177 155 178 156 !======================================================================= 179 SUBROUTINE backup_restarts( idt)157 SUBROUTINE backup_restarts(backup_idt) 180 158 !----------------------------------------------------------------------- 181 159 ! NAME … … 205 183 ! ARGUMENTS 206 184 ! --------- 207 integer(di), intent(in) :: idt185 integer(di), intent(in) :: backup_idt 208 186 209 187 ! LOCAL VARIABLES … … 213 191 ! CODE 214 192 ! ---- 215 suffix = '_ts'//int2str( idt)216 217 call print_msg('> Backup at dt = '//int2str(idt),LVL_NFO)193 suffix = '_ts'//int2str(backup_idt) 194 195 call print_msg('> Backup of "restart" files at dt = '//int2str(backup_idt),LVL_NFO) 218 196 call copy_restart_if_present('re'//startevo_name,suffix2filename(startevo_name,suffix)) 219 197 call copy_restart_if_present('re'//startfi_name,suffix2filename(startfi_name,suffix)) -
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r4134 r4135 911 911 - Add a periodic backup based on a single wrapper which builds PCM-compatible climate state and writes "restart" files. 912 912 - Remove condition "if (.not. allocated(*))" for more strict safeguard. 913 914 == 16/03/2026 == JBC 915 Relocate Mars-specific parameters out of "planet" module and into the modules that own their physics domain. -
trunk/LMDZ.COMMON/libf/evolution/clim_state_init.F90
r4134 r4135 319 319 use geometry, only: ngrid, nslope, nsoil, nsoil_PCM 320 320 use evolution, only: dt 321 use physics, only: mugaz, r 322 use planet, only: TI_breccia, TI_bedrock, alpha_clap_h2o, beta_clap_h2o 321 use physics, only: mugaz, r, alpha_clap_h2o, beta_clap_h2o 323 322 use frost, only: h2ofrost_PCM, h2o_frost4PCM, co2frost_PCM, co2_frost4PCM 324 323 use surf_ice, only: is_h2o_perice_PCM, h2oice_huge_ini, co2_perice_PCM, threshold_h2oice_cap 325 324 use soil, only: do_soil, TI, depth_breccia, depth_bedrock, index_breccia, index_bedrock, inertiedat, layer, inertiedat_PCM 326 325 use soil_temp, only: ini_tsoil_pem, compute_tsoil 327 use soil_therm_inertia, only: update_soil_TI 326 use soil_therm_inertia, only: update_soil_TI, TI_breccia, TI_bedrock 328 327 use ice_table, only: icetable_equilibrium, icetable_dynamic, computeice_table_equilibrium 329 328 use sorption, only: do_sorption, evolve_regolith_adsorption -
trunk/LMDZ.COMMON/libf/evolution/glaciers.F90
r4110 r4135 339 339 ! DEPENDENCIES 340 340 ! ------------ 341 use geometry, only: ngrid, nday342 use p lanet,only: alpha_clap_co2, beta_clap_co2341 use geometry, only: ngrid, nday 342 use physics, only: alpha_clap_co2, beta_clap_co2 343 343 344 344 ! DECLARATION -
trunk/LMDZ.COMMON/libf/evolution/ice_table.F90
r4110 r4135 276 276 ! ------------ 277 277 use geometry, only: ngrid, nslope, nsoil 278 use soil, only: mlayer 278 use soil, only: mlayer, regolith_porosity 279 279 use slopes, only: subslope_dist, def_slope_mean 280 use planet, only: porosity281 280 use maths, only: pi 282 281 … … 306 305 do islope = 1,nslope 307 306 call compute_Tice(tsoil(ig,:,islope),tsurf(ig,islope),icetable_depth(ig,islope),Tice) 308 delta_icetable(ig) = delta_icetable(ig) + porosity*rho_ice(Tice,'H2O')*(icetable_thickness(ig,islope) - icetable_thickness_old(ig,islope)) & ! convention > 0. <=> it condenses307 delta_icetable(ig) = delta_icetable(ig) + regolith_porosity*rho_ice(Tice,'H2O')*(icetable_thickness(ig,islope) - icetable_thickness_old(ig,islope)) & ! convention > 0. <=> it condenses 309 308 *subslope_dist(ig,islope)/cos(def_slope_mean(islope)*pi/180._dp) 310 309 end do -
trunk/LMDZ.COMMON/libf/evolution/layered_deposits.F90
r4110 r4135 36 36 real(dp), parameter, private :: dry_lag_porosity = 0.2_dp ! Porosity of dust lag 37 37 real(dp), parameter, private :: wet_lag_porosity = 0.15_dp ! Porosity of water ice lag 38 real(dp), parameter, private :: regolith_porosity = 0.4_dp ! Porosity of regolith39 real(dp), parameter, private :: breccia_porosity = 0.1_dp ! Porosity of breccia40 38 real(dp), parameter, private :: co2ice_porosity = 0.05_dp ! Porosity of CO2 ice 41 39 real(dp), parameter, private :: h2oice_porosity = 0.1_dp ! Porosity of H2O ice 42 40 real(dp), parameter, private :: rho_dust = 2500._dp ! Density of dust [kg.m-3] 43 real(dp), parameter, private :: rho_rock = 3200._dp ! Density of rock [kg.m-3]44 41 real(dp), parameter, private :: h_patchy_dust = 5.e-4_dp ! Height under which a dust lag is considered patchy [m] 45 42 real(dp), parameter, private :: h_patchy_ice = 5.e-4_dp ! Height under which a H2O ice lag is considered patchy [m] … … 426 423 ! DEPENDENCIES 427 424 ! ------------ 428 use soil, only: do_soil, layer, index_breccia, index_bedrock 425 use soil, only: do_soil, layer, index_breccia, index_bedrock, regolith_porosity, breccia_porosity 429 426 use geometry, only: nsoil 430 427 … … 1250 1247 use utility, only: real2str 1251 1248 use display, only: print_msg, LVL_ERR 1249 use soil, only: regolith_porosity 1252 1250 1253 1251 ! DECLARATION -
trunk/LMDZ.COMMON/libf/evolution/physics.F90
r4065 r4135 24 24 ! PARAMETERS 25 25 ! ---------- 26 real(dp), parameter :: sigmaB = 5.678e-8_dp ! Stefan-Boltzmann constant [W/m^2/K^4] 27 real(dp), parameter :: m_co2 = 44.01e-3_dp ! CO2 molecular mass [kg/mol], Franz et al. 2017 28 real(dp), parameter :: m_noco2 = 33.37e-3_dp ! Non-condensible molecular mass [kg/mol], Franz et al. 2017 29 real(dp), parameter :: m_h2o = 18.01528e-3_dp ! H2O molecular mass [kg/mol], Franz et al. 2017 30 real(dp), parameter :: A = 1._dp/m_co2 - 1._dp/m_noco2 ! MMR/VMR conversion factor 31 real(dp), parameter :: B = 1._dp/m_noco2 ! MMR/VMR conversion factor 32 33 ! H2O coefficients for Clausius-Clapeyron law for psat (psat = exp(beta/Th2o + alpha)), following Murphy and Koop 2005 34 real(dp), parameter :: alpha_clap_h2o = 28.9074_dp 35 real(dp), parameter :: beta_clap_h2o = -6143.7_dp ! [K] 36 ! CO2 coefficients for Clausius-Clapeyron law for CO2 condensation temperature (Tco2 = beta/(alpha-log(vmr)),following James et al. 1992 37 real(dp), parameter :: alpha_clap_co2 = 23.3494_dp 38 real(dp), parameter :: beta_clap_co2 = 3182.48_dp ! [K] 39 40 real(dp), parameter :: Lco2 = 5.71e5_dp ! CO2 latent heat [J/kg], Pilorget and Forget 2016 41 26 42 real(dp), protected :: g ! Gravity [m/s2] 27 43 real(dp), protected :: r ! Reduced gas constant,r = 8.314511/[mugaz/1000.0] -
trunk/LMDZ.COMMON/libf/evolution/planet.F90
r4074 r4135 5 5 ! 6 6 ! DESCRIPTION 7 ! Mars-specific constants kept hard-coded for the PEM.7 ! Legacy compatibility module for planet-specific definitions. 8 8 ! 9 9 ! AUTHORS & DATE … … 15 15 !----------------------------------------------------------------------- 16 16 17 ! DEPENDENCIES18 ! ------------19 use numerics, only: dp20 21 17 ! DECLARATION 22 18 ! ----------- 23 19 implicit none 24 20 25 ! PARAMETERS 26 ! ---------- 27 ! Molecular masses for CO2, H2O and non condensible gaz, following Franz et al. 2017 28 real(dp), parameter :: m_co2 = 44.01e-3_dp ! CO2 molecular mass [kg/mol] 29 real(dp), parameter :: m_noco2 = 33.37e-3_dp ! Non condensible mol mass [kg/mol] 30 real(dp), parameter :: m_h2o = 18.01528e-3_dp ! Molecular weight of H2O [kg/mol] 31 real(dp), parameter :: A = (1._dp/m_co2 - 1._dp/m_noco2) ! Intermediate parameter for computation 32 real(dp), parameter :: B = 1._dp/m_noco2 ! Intermediate parameter for computation 33 34 ! Thermal inertia for breccia and bedrock following Mellon et al. 2000; Wood et al. 2008 35 real(dp), parameter :: TI_breccia = 750._dp ! Thermal inertia of Breccia following Wood 2009 [SI] 36 real(dp), parameter :: TI_bedrock = 2300._dp ! Thermal inertia of Bedrock following Wood 2009 [SI] 37 38 ! Coefficient for Clapeyron law for psat (psat = exp(beta/Th2o + alpha)), following Murphy and Koop 2005 39 real(dp), parameter :: alpha_clap_h2o = 28.9074_dp ! Uniteless, Murphy and Koop 2005 40 real(dp), parameter :: beta_clap_h2o = -6143.7_dp ! Kelvin, Murphy and Koop 2005 41 42 ! Coefficient for Clapeyron law for CO2 condensation temperature (Tco2 = beta/(alpha-log(vmr)),following James et al. 1992 43 real(dp), parameter :: alpha_clap_co2 = 23.3494_dp ! Unitless, James et al. 1992 44 real(dp), parameter :: beta_clap_co2 = 3182.48_dp ! Kelvin, James et al. 1992 45 46 ! Density of the regolith (Zent et al., 1995; Buhler and Piqueux 2021) 47 real(dp), parameter :: rho_regolith = 2000._dp ! kg/m^3 48 49 ! Average thermal inertia of the surface, breccia, bedrock, following Mellon et al., 2000., Wood et al., 2008 50 real(dp), parameter :: TI_regolith_avg = 250._dp ! Averaged of the observed thermal inertia for regolith following Mellon et al., 2000[SI] 51 52 ! Porosity of the soil 53 real(dp), parameter :: porosity = 0.4_dp ! porosity of the martian soil, correspond to the value for a random loose packing of monodiperse sphere (Scott, 1960) 54 55 ! Stefan Boltzmann constant 56 real(dp), parameter :: sigmaB = 5.678e-8_dp 57 58 ! Latent heat of CO2 59 real(dp), parameter :: Lco2 = 5.71e5_dp ! Pilorget and Forget 2016 60 61 ! Current average pressure [Pa] 62 real(dp), parameter :: P610 = 610._dp 21 ! NOTE 22 ! ---- 63 23 64 24 contains -
trunk/LMDZ.COMMON/libf/evolution/soil.F90
r4134 r4135 25 25 ! PARAMETERS 26 26 ! ---------- 27 ! Density and porosity of regolith and breccia 28 real(dp), parameter :: rho_regolith = 2000._dp ! [kg/m^3], Zent et al. 1995; Buhler and Piqueux 2021 29 real(dp), parameter :: regolith_porosity = 0.4_dp ! Porosity of the martian regolith for a random loose packing of monodisperse sphere, Scott 1960 30 real(dp), parameter :: breccia_porosity = 0.1_dp ! Porosity of breccia 31 27 32 logical(k4), protected :: do_soil ! To run with subsurface physics 28 33 logical(k4), protected :: reg_thprop_dependp ! Regolith thermal properties depend on surface pressure -
trunk/LMDZ.COMMON/libf/evolution/soil_temp.F90
r4134 r4135 569 569 ! DEPENDENCIES 570 570 ! ------------ 571 use geometry, only: ngrid, nsoil, nslope, nday 572 use planet, only: alpha_clap_h2o, beta_clap_h2o 573 use tracers, only: mmol, iPCM_qh2o 574 use physics, only: mugaz, r 575 use evolution, only: dt 576 use soil, only: TI 577 use stoppage, only: stop_clean 578 use display, only: print_msg, LVL_NFO 571 use geometry, only: ngrid, nsoil, nslope, nday 572 use tracers, only: mmol, iPCM_qh2o 573 use physics, only: mugaz, r, alpha_clap_h2o, beta_clap_h2o 574 use evolution, only: dt 575 use soil, only: TI 576 use stoppage, only: stop_clean 577 use display, only: print_msg, LVL_NFO 579 578 580 579 ! DECLARATION -
trunk/LMDZ.COMMON/libf/evolution/soil_therm_inertia.F90
r4117 r4135 26 26 ! PARAMETERS 27 27 ! ---------- 28 real(dp), parameter :: TI_regolith_avg = 250._dp ! Average of observed thermal inertia for regolith [SI], Mellon et al. 2000 29 real(dp), parameter :: TI_breccia = 750._dp ! Thermal inertia for breccia [SI], Mellon et al. 2000; Wood et al. 2008 30 real(dp), parameter :: TI_bedrock = 2300._dp ! Thermal inertia for bedrock [SI], Mellon et al. 2000; Wood et al. 2008 31 real(dp), parameter, private :: P610 = 610._dp ! Reference mean surface pressure [Pa] 28 32 real(dp), parameter, private :: reg_inertie_thresold = 370._dp ! Above this thermal inertia, the regolith has too much cementation to be dependant on the pressure [J/m^2/K/s^1/2] 29 33 real(dp), parameter, private :: reg_inertie_minvalue = 50._dp ! Minimum value of the Thermal Inertia at low pressure (Piqueux & Christensen 2009) [J/m^2/K/s^1/2] … … 56 60 ! DEPENDENCIES 57 61 ! ------------ 58 use planet, only:porosity62 use soil, only: regolith_porosity 59 63 60 64 ! DECLARATION … … 78 82 ice_thermalinertia = inertie_purewaterice 79 83 else 80 ice_thermalinertia = sqrt(surf_thermalinertia**2 + porosity*pore_filling*inertie_purewaterice**2) ! Siegler et al., 201284 ice_thermalinertia = sqrt(surf_thermalinertia**2 + regolith_porosity*pore_filling*inertie_purewaterice**2) ! Siegler et al., 2012 81 85 end if 82 86 … … 106 110 use geometry, only: ngrid, nslope, nsoil 107 111 use soil, only: volcapa, layer, inertiedat, depth_breccia, depth_bedrock, index_breccia, index_bedrock, reg_thprop_dependp 108 use planet, only: TI_breccia, TI_bedrock, TI_regolith_avg, P610109 112 use display, only: print_msg, LVL_NFO 110 113 -
trunk/LMDZ.COMMON/libf/evolution/sorption.F90
r4117 r4135 139 139 ! ------------ 140 140 use geometry, only: ngrid, nslope, nsoil, nday 141 use soil, only: layer, index_breccia 141 use soil, only: layer, index_breccia, rho_regolith 142 142 use slopes, only: subslope_dist, def_slope_mean 143 143 use atmosphere, only: ap, bp 144 use p lanet, only: alpha_clap_h2o, beta_clap_h2o, m_h2o, m_co2,m_noco2, rho_regolith144 use physics, only: alpha_clap_h2o, beta_clap_h2o, m_h2o, m_co2, A, B 145 145 use maths, only: pi 146 146 … … 177 177 real(dp), dimension(ngrid,nslope) :: deltam_reg_slope ! Difference density of H2O adsorbed per slope [kg/m^3] 178 178 real(dp), dimension(ngrid,nsoil,nslope) :: dm_h2o_regolith_slope ! Elementary H2O mass adsorded per mesh per slope 179 real(dp) :: A, B ! Used to compute the mean mass above the surface180 179 real(dp) :: p_sat ! Saturated vapor pressure of ice 181 180 real(dp), dimension(:,:), allocatable :: mass_mean ! Mean mass above the surface … … 188 187 ! 0. Some initializations 189 188 allocate(mass_mean(ngrid,nday),zplev_mean(ngrid,nday),pvapor(ngrid,nday),pvapor_avg(ngrid)) 190 A = 1._dp/m_co2 - 1._dp/m_noco2191 B = 1._dp/m_noco2192 189 theta_h2o_ads = 0._dp 193 190 dm_h2o_regolith_slope = 0._dp … … 273 270 ! ------------ 274 271 use geometry, only: ngrid, nslope, nsoil, nday 275 use soil, only: layer, index_breccia 272 use soil, only: layer, index_breccia, rho_regolith 276 273 use slopes, only: subslope_dist, def_slope_mean 277 274 use atmosphere, only: ap, bp 278 use p lanet, only: m_co2, m_noco2, rho_regolith275 use physics, only: m_co2, A, B 279 276 use maths, only: pi 280 277 … … 303 300 ! real(dp) :: as = 18.9e3_dp ! Specific area, Buhler & Piqueux 2021 304 301 real(dp) :: as = 9.48e4_dp ! Same as previous but from zent 305 real(dp) :: A, B ! Used to compute the mean mass above the surface306 302 integer(di) :: ig, islope, iloop, it ! For loops 307 303 real(dp), dimension(ngrid,nsoil,nslope) :: dm_co2_regolith_slope ! Elementary mass adsorded per mesh per slope … … 322 318 allocate(mass_mean(ngrid,nday),zplev_mean(ngrid,nday),pco2(ngrid,nday),pco2_avg(ngrid)) 323 319 m_h2o_adsorbed = 0._dp 324 A = 1._dp/m_co2 - 1._dp/m_noco2325 B = 1._dp/m_noco2326 320 dm_co2_regolith_slope = 0._dp 327 321 delta_co2_ads = 0._dp -
trunk/LMDZ.COMMON/libf/evolution/tendencies.F90
r4134 r4135 88 88 ! DEPENDENCIES 89 89 ! ------------ 90 use geometry, only: ngrid, nslope, nday91 use p lanet, only: alpha_clap_co2, beta_clap_co2, sigmaB, Lco2, m_co2, A, B92 use orbit, only: yr_len_sol, sol_len_s93 use display, only: print_msg, LVL_NFO94 use utility, only: real2str90 use geometry, only: ngrid, nslope, nday 91 use physics, only: sigmaB, alpha_clap_co2, beta_clap_co2, Lco2, m_co2, A, B 92 use orbit, only: yr_len_sol, sol_len_s 93 use display, only: print_msg, LVL_NFO 94 use utility, only: real2str 95 95 96 96 ! DECLARATION
Note: See TracChangeset
for help on using the changeset viewer.
