Ignore:
Timestamp:
Apr 10, 2026, 7:17:55 PM (6 hours ago)
Author:
jbclement
Message:

PEM:

  • Rework layering-related logic, especially clarify interactions between surface and subsurface water tendencies and disable CO2 lag resistance (inconsistent without updating pressure and mass balance + PCM).
  • Prevent simultaneous activation of layering and ice flows.
  • Add warning when flux_geo /= 0 while soil is disabled.
  • Add new utility function "is_lvl_enabled" for displaying.
  • Replace deprecated 'minieps' with 'eps'/'tol'.

JBC

File:
1 edited

Legend:

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

    r4170 r4180  
    1818! DEPENDENCIES
    1919! ------------
    20 use numerics, only: dp, di, k4, minieps, tol
     20use numerics, only: dp, di, k4, eps
    2121
    2222! DECLARATION
     
    6262
    6363! If the difference is too small, then there is no evolution
    64 where (abs(d_ice) < minieps) d_ice = 0._dp
     64where (abs(d_ice) < eps) d_ice = 0._dp
    6565
    6666! If the tendency is negative but there is no ice reservoir for the PEM
    67 where (d_ice(:,:) < 0._dp .and. abs(perice(:,:)) < minieps) d_ice(:,:) = 0._dp
     67where (d_ice(:,:) < 0._dp .and. abs(perice(:,:)) < eps) d_ice(:,:) = 0._dp
    6868
    6969END SUBROUTINE compute_tendice
     
    170170! ARGUMENTS
    171171! ---------
    172 real(dp), dimension(:,:),     intent(in) :: h2oice_depth_old ! Old H2O ice depth
    173 real(dp), dimension(:,:),     intent(in) :: h2oice_depth_new ! New H2O ice depth
    174 real(dp), dimension(:,:),     intent(in) :: tsurf            ! Surface temperature
    175 real(dp), dimension(:,:,:,:), intent(in) :: tsoil_ts_old     ! Old soil temperature time series
    176 real(dp), dimension(:,:,:,:), intent(in) :: tsoil_ts_new     ! New soil temperature time series
    177 real(dp), dimension(:,:),     intent(inout) :: flux_ssice_avg       ! Tendency of sub-surface ice
     172real(dp), dimension(:,:),     intent(in)    :: h2oice_depth_old ! Old H2O ice depth
     173real(dp), dimension(:,:),     intent(in)    :: h2oice_depth_new ! New H2O ice depth
     174real(dp), dimension(:,:),     intent(in)    :: tsurf            ! Surface temperature
     175real(dp), dimension(:,:,:,:), intent(in)    :: tsoil_ts_old     ! Old soil temperature time series
     176real(dp), dimension(:,:,:,:), intent(in)    :: tsoil_ts_new     ! New soil temperature time series
     177real(dp), dimension(:,:),     intent(inout) :: flux_ssice_avg   ! Tendency of sub-surface ice
    178178
    179179! LOCAL VARIABLES
     
    190190    do islope = 1,nslope
    191191        ! Higher resistance due to growing lag layer (higher depth)
    192         Rz_old = h2oice_depth_old(i,islope)*zcdv/coef_ssdif_PCM(i,islope) ! Old resistance from PCM
    193         Rz_new = h2oice_depth_new(i,islope)*zcdv/coef_ssdif_PCM(i,islope) ! New resistance based on new depth
    194         R_dec = Rz_old/Rz_new ! Decrease because of resistance
     192        Rz_old = h2oice_depth_old(i,islope)*zcdv/max(abs(coef_ssdif_PCM(i,islope)),eps) ! Old resistance from PCM
     193        Rz_new = h2oice_depth_new(i,islope)*zcdv/max(abs(coef_ssdif_PCM(i,islope)),eps) ! New resistance based on new depth
     194        R_dec = Rz_old/max(Rz_new,eps) ! Decrease because of resistance
    195195
    196196        ! The maxmimum of the daily averages over one year for the saturation vapor pressure at the ice table location
     
    203203
    204204        ! Lower humidity due to growing lag layer (higher depth)
    205         if (abs(psv_max_old) < tol) then
     205        if (abs(psv_max_old) < eps) then
    206206            hum_dec = 1._dp
    207207        else
Note: See TracChangeset for help on using the changeset viewer.