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/planet.F90

    r4170 r4180  
    2121! ------------
    2222use numerics,         only: dp, qp, k4
    23 use layered_deposits, only: layering
     23use layered_deposits, only: layering, del_layering
    2424
    2525! DECLARATION
     
    231231implicit none
    232232
     233! LOCAL VARIABLES
     234! ---------------
     235integer :: i, islope
     236
    233237! CODE
    234238! ----
     
    253257delta_h2o_ads(:) = 0._dp
    254258delta_co2_ads(:) = 0._dp
     259do islope = 1,nslope
     260    do i = 1,ngrid
     261        layerings_map(i,islope)%nb_str = 0
     262        nullify(layerings_map(i,islope)%bottom,layerings_map(i,islope)%top)
     263    end do
     264end do
    255265
    256266END SUBROUTINE allocate_startevo_state
     
    386396!-----------------------------------------------------------------------
    387397
    388 ! DECLARATION
    389 ! -----------
    390 implicit none
     398! DEPENDENCIES
     399! ------------
     400use geometry, only: ngrid, nslope
     401
     402! DECLARATION
     403! -----------
     404implicit none
     405
     406! LOCAL VARIABLES
     407! ---------------
     408integer :: i, islope
    391409
    392410! CODE
     
    407425if (allocated(tsoil_ts)) deallocate(tsoil_ts)
    408426if (allocated(tsoil_ts_old)) deallocate(tsoil_ts_old)
    409 if (allocated(layerings_map)) deallocate(layerings_map)
     427if (allocated(layerings_map)) then
     428    do islope = 1,nslope
     429        do i = 1,ngrid
     430            call del_layering(layerings_map(i,islope))
     431        end do
     432    end do
     433    deallocate(layerings_map)
     434end if
    410435if (allocated(h2o_soildensity_avg)) deallocate(h2o_soildensity_avg)
    411436if (allocated(delta_co2_ads)) deallocate(delta_co2_ads)
     
    424449if (allocated(d_co2ice_ini)) deallocate(d_co2ice_ini)
    425450if (allocated(d_h2oice)) deallocate(d_h2oice)
    426 if (allocated(layerings_map)) deallocate(layerings_map)
    427451if (allocated(flux_ssice_avg)) deallocate(flux_ssice_avg)
    428452
Note: See TracChangeset for help on using the changeset viewer.