Ignore:
Timestamp:
Feb 17, 2026, 2:45:53 PM (13 days ago)
Author:
jbclement
Message:

PEM:

  • Correct management of H2O ice tendency in 1D when there is not enough ice anymore.
  • Clean initialization of allocatable module arrays (especially needed when no slope)
  • One more renaming for consistency + few small updates thoughout the code.

JBC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/sorption.F90

    r4065 r4074  
    102102real(dp), dimension(:,:,:), intent(in)    :: tsoil              ! Soil temperature [K]
    103103real(dp), dimension(:,:),   intent(in)    :: ps                 ! Average surface pressure [Pa]
    104 real(dp), dimension(:,:),   intent(in)    :: q_co2_ts           ! Mass mixing ratio of co2 in the first layer [kg/kg]
    105 real(dp), dimension(:,:),   intent(in)    :: q_h2o_ts           ! Mass mixing ratio of H2o in the first layer [kg/kg]
    106 real(dp), dimension(:),     intent(out)   :: delta_h2o_ads      ! Difference density of h2o adsorbed [kg/m^3]
    107 real(dp), dimension(:),     intent(out)   :: delta_co2_ads      ! Difference density of co2 adsorbed [kg/m^3]
     104real(dp), dimension(:,:),   intent(in)    :: q_co2_ts           ! Mass mixing ratio of CO2 in the first layer [kg/kg]
     105real(dp), dimension(:,:),   intent(in)    :: q_h2o_ts           ! Mass mixing ratio of H2O in the first layer [kg/kg]
     106real(dp), dimension(:),     intent(out)   :: delta_h2o_ads      ! Difference density of H2O adsorbed [kg/m^3]
     107real(dp), dimension(:),     intent(out)   :: delta_co2_ads      ! Difference density of CO2 adsorbed [kg/m^3]
    108108real(dp), dimension(:,:,:), intent(inout) :: h2o_ads_reg, co2_ads_reg
    109109
     
    156156real(dp), dimension(:,:),   intent(in)    :: co2ice             ! CO2 ice at the surface [kg/m^2]
    157157real(dp), dimension(:,:),   intent(in)    :: ps                 ! Surface pressure [Pa]
    158 real(dp), dimension(:,:),   intent(in)    :: q_co2_ts           ! Mass mixing ratio of co2 in the first layer [kg/kg]
    159 real(dp), dimension(:,:),   intent(in)    :: q_h2o_ts           ! Mass mixing ratio of H2o in the first layer [kg/kg]
     158real(dp), dimension(:,:),   intent(in)    :: q_co2_ts           ! Mass mixing ratio of CO2 in the first layer [kg/kg]
     159real(dp), dimension(:,:),   intent(in)    :: q_h2o_ts           ! Mass mixing ratio of H2O in the first layer [kg/kg]
    160160real(dp), dimension(:,:,:), intent(in)    :: TI                 ! Soil Thermal inertia [J/K/^2/s^1/2]
    161161real(dp), dimension(:,:,:), intent(in)    :: tsoil              ! Soil temperature [K]
    162 real(dp), dimension(:,:,:), intent(inout) :: h2o_ads_reg        ! Density of h2o adsorbed [kg/m^3]
     162real(dp), dimension(:,:,:), intent(inout) :: h2o_ads_reg        ! Density of H2O adsorbed [kg/m^3]
    163163real(dp), dimension(:,:,:), intent(out)   :: theta_h2o_ads      ! Fraction of the pores occupied by H2O molecules
    164 real(dp), dimension(:),     intent(out)   :: delta_h2o_ads      ! Difference density of h2o adsorbed [kg/m^3]
     164real(dp), dimension(:),     intent(out)   :: delta_h2o_ads      ! Difference density of H2O adsorbed [kg/m^3]
    165165
    166166! LOCAL VARIABLES
     
    170170real(dp) :: e = 2573.9_dp               ! Jackosky et al. 1997
    171171real(dp) :: mu = 0.48_dp                ! Jackosky et al. 1997
    172 real(dp) :: m_theta = 2.84e-7_dp        ! Mass of h2o per m^2 absorbed Jackosky et al. 1997
     172real(dp) :: m_theta = 2.84e-7_dp        ! Mass of H2O per m^2 absorbed Jackosky et al. 1997
    173173! real(dp) :: as = 18.9e3_dp              ! Specific area, Buhler & Piqueux 2021
    174174real(dp) :: as = 9.48e4_dp              ! Specific area, Zent
     
    177177real(dp)                                        :: K                       ! Used to compute theta
    178178integer(di)                                     :: ig, iloop, islope, it   ! For loops
    179 logical(k4),  dimension(ngrid,nslope)               :: ispermanent_co2glaciers ! Check if the co2 glacier is permanent
    180 logical(k4),  dimension(ngrid,nslope)               :: ispermanent_h2oglaciers ! Check if the h2o glacier is permanent
    181 real(dp), dimension(ngrid,nslope)               :: deltam_reg_slope        ! Difference density of h2o adsorbed per slope [kg/m^3]
    182 real(dp), dimension(ngrid,nsoil,nslope)         :: dm_h2o_regolith_slope   ! Elementary h2o mass adsorded per mesh per slope
     179logical(k4),  dimension(ngrid,nslope)               :: ispermanent_co2glaciers ! Check if the CO2 glacier is permanent
     180logical(k4),  dimension(ngrid,nslope)               :: ispermanent_h2oglaciers ! Check if the H2O glacier is permanent
     181real(dp), dimension(ngrid,nslope)               :: deltam_reg_slope        ! Difference density of H2O adsorbed per slope [kg/m^3]
     182real(dp), dimension(ngrid,nsoil,nslope)         :: dm_h2o_regolith_slope   ! Elementary H2O mass adsorded per mesh per slope
    183183real(dp)                                        :: A, B                    ! Used to compute the mean mass above the surface
    184184real(dp)                                        :: p_sat                   ! Saturated vapor pressure of ice
     
    299299real(dp), dimension(:,:,:), intent(in)    :: TI                 ! Mean Thermal Inertia [USI]
    300300real(dp), dimension(:,:),   intent(in)    :: d_h2oice, d_co2ice ! Tendencies on the glaciers ()
    301 real(dp), dimension(:,:),   intent(in)    :: q_co2_ts, q_h2o_ts ! Mass mixing ratio of co2 and h2o in the first layer [kg/kg]
     301real(dp), dimension(:,:),   intent(in)    :: q_co2_ts, q_h2o_ts ! Mass mixing ratio of CO2 and H2O in the first layer [kg/kg]
    302302real(dp), dimension(:,:),   intent(in)    :: h2oice             ! Water ice at the surface [kg/m^2]
    303303real(dp), dimension(:,:),   intent(in)    :: co2ice             ! CO2 ice at the surface [kg/m^2]
    304 real(dp), dimension(:,:,:), intent(inout) :: co2_ads_reg        ! Density of co2 adsorbed [kg/m^3]
    305 real(dp), dimension(:),     intent(out)   :: delta_co2_ads      ! Difference density of co2 adsorbed [kg/m^3]
     304real(dp), dimension(:,:,:), intent(inout) :: co2_ads_reg        ! Density of CO2 adsorbed [kg/m^3]
     305real(dp), dimension(:),     intent(out)   :: delta_co2_ads      ! Difference density of CO2 adsorbed [kg/m^3]
    306306
    307307! LOCAL VARIABLES
     
    311311real(dp) :: beta = -1541.5_dp          ! Zent & Quinn 1995
    312312real(dp) :: inertie_thresold = 800._dp ! TI > 800 means cementation
    313 real(dp) :: m_theta = 4.27e-7_dp       ! Mass of co2 per m^2 absorbed
     313real(dp) :: m_theta = 4.27e-7_dp       ! Mass of CO2 per m^2 absorbed
    314314! real(dp) :: as = 18.9e3_dp           ! Specific area, Buhler & Piqueux 2021
    315315real(dp) :: as = 9.48e4_dp             ! Same as previous but from zent
     
    317317integer(di)                                        :: ig, islope, iloop, it   ! For loops
    318318real(dp),    dimension(ngrid,nsoil,nslope)         :: dm_co2_regolith_slope   ! Elementary mass adsorded per mesh per slope
    319 logical(k4), dimension(ngrid,nslope)               :: ispermanent_co2glaciers ! Check if the co2 glacier is permanent
    320 logical(k4), dimension(ngrid,nslope)               :: ispermanent_h2oglaciers ! Check if the h2o glacier is permanent
     319logical(k4), dimension(ngrid,nslope)               :: ispermanent_co2glaciers ! Check if the CO2 glacier is permanent
     320logical(k4), dimension(ngrid,nslope)               :: ispermanent_h2oglaciers ! Check if the H2O glacier is permanent
    321321real(dp),    dimension(ngrid,index_breccia,nslope) :: deltam_reg_complete     ! Difference in the mass per slope and soil layer [kg/m^3]
    322322real(dp),    dimension(ngrid,nslope)               :: deltam_reg_slope        ! Difference in the mass per slope  [kg/m^3]
    323323real(dp),    dimension(ngrid,nsoil,nslope)         :: m_h2o_adsorbed          ! Density of CO2 adsorbed [kg/m^3]
    324324real(dp),    dimension(ngrid,nsoil,nslope)         :: theta_h2o_ads           ! Fraction of the pores occupied by H2O molecules
    325 real(dp),    dimension(ngrid)                      :: delta_mh2o              ! Difference density of h2o adsorbed [kg/m^3]
     325real(dp),    dimension(ngrid)                      :: delta_mh2o              ! Difference density of H2O adsorbed [kg/m^3]
    326326! nday array are allocated because heavy...
    327327real(dp),    dimension(:,:), allocatable           :: mass_mean               ! Mean mass above the surface
     
    368368call evolve_h2o_ads(d_h2oice,d_co2ice,h2oice,co2ice,ps,q_co2_ts,q_h2o_ts,tsoil,TI,theta_h2o_ads,m_h2o_adsorbed,delta_mh2o)
    369369
    370 ! 2. we compute the mass of co2 adsorded in each layer of the meshes
     370! 2. we compute the mass of CO2 adsorded in each layer of the meshes
    371371do ig = 1,ngrid
    372372    do islope = 1,nslope
Note: See TracChangeset for help on using the changeset viewer.