Ignore:
Timestamp:
Feb 16, 2026, 10:28:56 AM (12 days ago)
Author:
jbclement
Message:

PEM:

  • Making the computation of ice tendencies more reliable by doing it after 'read_startpem' to know exactly where perennial ice is (no matter if there is a "startpem.nc" or not). Moreover, when there is no "startpem.nc", location of perennial ice depends now on 'watercaptag' and on huge amount of frost. This prevents negative ice tendency while there is no ice which can happen with weird PCM inputs (i.e. 'watercaptag' = F & 'watercap' /= 0 & no "stratpem.nc").
  • Few small safeguards throughout the code.

JBC

File:
1 edited

Legend:

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

    r4068 r4071  
    121121! DEPENDENCIES
    122122! ------------
    123 use geometry,   only: nlayer, nslope
     123use geometry,   only: nlayer
    124124use atmosphere, only: set_ap, set_bp, set_ps_PCM, set_teta_PCM, set_u_PCM, set_v_PCM, compute_alt_coord, set_ap, set_bp
    125125use tracers,    only: nq, set_q_PCM
     
    134134! LOCAL VARIABLES
    135135! ---------------
    136 integer(di)                     :: i, j, k, ierr, funit
     136integer(di)                     :: i, k, ierr, funit
    137137character(30)                   :: header
    138138real(dp), dimension(1,1)        :: tmp
     
    326326use planet,             only: TI_breccia, TI_bedrock, alpha_clap_h2o, beta_clap_h2o
    327327use frost,              only: h2ofrost_PCM, h2o_frost4PCM, co2frost_PCM, co2_frost4PCM
    328 use surf_ice,           only: is_h2o_perice_PCM, h2oice_huge_ini, co2_perice_PCM
     328use surf_ice,           only: is_h2o_perice_PCM, h2oice_huge_ini, co2_perice_PCM, threshold_h2oice_cap
    329329use soil,               only: do_soil, TI, depth_breccia, depth_bedrock, index_breccia, index_bedrock, inertiedat, layer, inertiedat_PCM
    330330use soil_temp,          only: ini_tsoil_pem, compute_tsoil
     
    335335use layered_deposits,   only: layering, do_layering, array2map, ini_layering, add_stratum
    336336use surf_ice,           only: rho_co2ice, rho_h2oice
     337use slopes,             only: subslope_dist, def_slope_mean
     338use maths,              only: pi
    337339use display,            only: print_msg
    338340use utility,            only: int2str
     
    344346! ARGUMENTS
    345347! ---------
    346 real(dp), dimension(:,:),       intent(in)    :: tsurf_avg_yr1, tsurf_avg_yr2 ! Surface temperature at the last but one PCM run and at the last PCM run
    347 real(dp),                       intent(in)    :: ps_avg_glob                  ! Mean average pressure on the planet
    348 real(dp), dimension(:,:),       intent(in)    :: ps_ts                        ! Surface pressure timeseries
    349 real(dp), dimension(:,:),       intent(in)    :: q_co2_ts, q_h2o_ts           ! MMR of CO2 and H2O
    350 real(dp), dimension(:,:),       intent(in)    :: h2o_surfdensity_avg          ! Average of surface water density
    351 real(dp), dimension(:,:),       intent(in)    :: d_h2oice, d_co2ice           ! Tendencies on ice
    352 real(dp), dimension(:,:),       intent(inout) :: h2o_ice, co2_ice             ! Surface ice
    353 real(dp), dimension(:,:,:),    intent(inout) :: tsoil_avg                    ! Soil temperature
    354 real(dp), dimension(:,:,:),    intent(inout) :: h2o_soildensity_avg          ! Average of soil water soil density
    355 real(dp), dimension(:,:),       intent(inout) :: icetable_depth               ! Ice table depth
    356 real(dp), dimension(:,:),       intent(inout) :: icetable_thickness           ! Ice table thickness
    357 real(dp), dimension(:,:,:),    intent(inout) :: ice_porefilling              ! Subsurface ice pore filling
    358 real(dp), dimension(:,:,:),    intent(inout) :: h2o_ads_reg, co2_ads_reg     ! Mass of H2O and CO2 adsorbed
    359 type(layering), dimension(:,:), intent(inout) :: layerings_map                ! Layerings
    360 real(dp), dimension(:),         intent(inout) :: delta_h2o_ads, delta_co2_ads ! Mass of H2O and CO2 exchanged due to adsorption/desorption
     348real(dp),       dimension(:,:),   intent(in)    :: tsurf_avg_yr1, tsurf_avg_yr2 ! Surface temperature at the last but one PCM run and at the last PCM run
     349real(dp),                         intent(in)    :: ps_avg_glob                  ! Mean average pressure on the planet
     350real(dp),       dimension(:,:),   intent(in)    :: ps_ts                        ! Surface pressure timeseries
     351real(dp),       dimension(:,:),   intent(in)    :: q_co2_ts, q_h2o_ts           ! MMR of CO2 and H2O
     352real(dp),       dimension(:,:),   intent(in)    :: h2o_surfdensity_avg          ! Average of surface water density
     353real(dp),       dimension(:,:),   intent(in)    :: d_h2oice, d_co2ice           ! Tendencies on ice
     354real(dp),       dimension(:,:),   intent(inout) :: h2o_ice, co2_ice             ! Surface ice
     355real(dp),       dimension(:,:,:), intent(inout) :: tsoil_avg                    ! Soil temperature
     356real(dp),       dimension(:,:,:), intent(inout) :: h2o_soildensity_avg          ! Average of soil water soil density
     357real(dp),       dimension(:,:),   intent(inout) :: icetable_depth               ! Ice table depth
     358real(dp),       dimension(:,:),   intent(inout) :: icetable_thickness           ! Ice table thickness
     359real(dp),       dimension(:,:,:), intent(inout) :: ice_porefilling              ! Subsurface ice pore filling
     360real(dp),       dimension(:,:,:), intent(inout) :: h2o_ads_reg, co2_ads_reg     ! Mass of H2O and CO2 adsorbed
     361type(layering), dimension(:,:),   intent(inout) :: layerings_map                ! Layerings
     362real(dp),       dimension(:),     intent(inout) :: delta_h2o_ads, delta_co2_ads ! Mass of H2O and CO2 exchanged due to adsorption/desorption
    361363
    362364! LOCAL VARIABLES
     
    381383
    382384    ! H2O ice
    383     call print_msg("'h2o_ice' is initialized with default value 'h2oice_huge_ini' where 'watercaptag' is true.")
     385    call print_msg("'h2o_ice' is initialized with default value 'h2oice_huge_ini' where 'watercaptag' is true and where yearly minimum of frost can be considered as a huge reservoir ('threshold_h2oice_cap').")
    384386    h2o_ice(:,:) = 0._dp
    385387    do i = 1,ngrid
    386         if (is_h2o_perice_PCM(i)) h2o_ice(i,:) = h2oice_huge_ini + h2ofrost_PCM(i,:) - h2o_frost4PCM(i,:)
     388        if (is_h2o_perice_PCM(i)) then
     389            h2o_ice(i,:) = h2oice_huge_ini
     390        else if (sum((h2ofrost_PCM(i,:) - h2o_frost4PCM(i,:))*subslope_dist(i,:)/cos(pi*def_slope_mean(:)/180._dp)) > threshold_h2oice_cap) then
     391            h2o_ice(i,:) = h2oice_huge_ini
     392        end if
    387393    end do
    388394
    389395    ! CO2 ice
    390     call print_msg("'co2_ice' is initialized with 'perennial_co2ice' found in the PCM.")
     396    call print_msg("'co2_ice' is initialized with 'perennial_co2ice' and yearly minimum of frost found in the PCM.")
    391397    co2_ice(:,:) = co2_perice_PCM(:,:) + co2frost_PCM(:,:) - co2_frost4PCM(:,:)
    392398
Note: See TracChangeset for help on using the changeset viewer.