Ignore:
Timestamp:
Mar 18, 2026, 1:56:02 PM (2 weeks ago)
Author:
jbclement
Message:

PEM:
Fix to avoid building large temporary arrays in the arguments evaluation of "compute_tendice" which caused memory to stall.
JBC

File:
1 edited

Legend:

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

    r4135 r4140  
    2828
    2929!=======================================================================
    30 SUBROUTINE compute_tendice(min_ice,is_perice,d_ice)
     30SUBROUTINE compute_tendice(min_perice,min_frost,perice,d_ice)
    3131!-----------------------------------------------------------------------
    3232! NAME
     
    5151! ARGUMENTS
    5252! ---------
    53 real(dp),    dimension(:,:,:), intent(in)  :: min_ice
    54 logical(k4), dimension(:,:),   intent(in)  :: is_perice
    55 real(dp),    dimension(:,:),   intent(out) :: d_ice
     53real(dp), dimension(:,:,:), intent(in)  :: min_perice
     54real(dp), dimension(:,:,:), intent(in)  :: min_frost
     55real(dp), dimension(:,:),   intent(in)  :: perice
     56real(dp), dimension(:,:),   intent(out) :: d_ice
    5657
    5758! CODE
    5859! ----
    5960! We compute the difference to get the tendency
    60 d_ice(:,:) = min_ice(:,:,2) - min_ice(:,:,1)
     61d_ice(:,:) = min_perice(:,:,2) + min_frost(:,:,2) - (min_perice(:,:,1) + min_frost(:,:,1))
    6162
    6263! If the difference is too small, then there is no evolution
     
    6465
    6566! If the tendency is negative but there is no ice reservoir for the PEM
    66 where (abs(d_ice) < 0._dp .and. .not. is_perice) d_ice = 0._dp
     67where (d_ice < 0._dp .and. abs(perice) < minieps) d_ice = 0._dp
    6768
    6869END SUBROUTINE compute_tendice
Note: See TracChangeset for help on using the changeset viewer.