Ignore:
Timestamp:
Feb 16, 2026, 10:28:56 AM (13 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/xios_data.F90

    r4065 r4071  
    2727!=======================================================================
    2828SUBROUTINE load_xios_data(ps_avg,ps_ts,tsurf_avg,tsurf_avg_yr1,tsoil_avg,tsoil_ts,h2o_surfdensity_avg,h2o_soildensity_avg, &
    29                           q_h2o_ts,q_co2_ts,d_h2oice,d_co2ice)
     29                          q_h2o_ts,q_co2_ts,minPCM_h2operice,minPCM_co2perice,minPCM_h2ofrost,minPCM_co2frost)
    3030!-----------------------------------------------------------------------
    3131! NAME
     
    4747use io_netcdf,  only: xios_day_name2, xios_yr_name1, xios_yr_name2, open_nc, close_nc, get_var_nc, get_dim_nc
    4848use soil,       only: do_soil
    49 use tendencies, only: compute_tend
    5049use frost,      only: compute_frost4PCM
    5150use stoppage,   only: stop_clean
     
    6059! ---------
    6160real(dp), dimension(:),       intent(out) :: ps_avg
    62 real(dp), dimension(:,:),     intent(out) :: tsurf_avg, tsurf_avg_yr1, h2o_surfdensity_avg, d_h2oice, d_co2ice, ps_ts, q_h2o_ts, q_co2_ts
     61real(dp), dimension(:,:),     intent(out) :: tsurf_avg, tsurf_avg_yr1, h2o_surfdensity_avg, ps_ts, q_h2o_ts, q_co2_ts
    6362real(dp), dimension(:,:,:),   intent(out) :: tsoil_avg, h2o_soildensity_avg
    6463real(dp), dimension(:,:,:,:), intent(out) :: tsoil_ts
     64real(dp), dimension(:,:,:),   intent(out) :: minPCM_h2operice, minPCM_co2perice, minPCM_h2ofrost, minPCM_co2frost
    6565
    6666! LOCAL VARIABLES
     
    7272real(dp), dimension(:,:,:,:), allocatable    :: var_read_4d
    7373character(:),                 allocatable    :: num ! To read slope variables
    74 real(dp), dimension(ngrid,nslope,2)          :: min_h2operice, min_co2perice, min_h2ofrost, min_co2frost
    7574real(dp), dimension(ngrid,nsoil,nslope,nday) :: h2o_soildensity_ts
    7675! CODE
    7776! ----
    7877! Initialization
    79 min_h2operice(:,:,:) = 0._dp
    80 min_co2perice(:,:,:) = 0._dp
    81 min_h2ofrost(:,:,:) = 0._dp
    82 min_co2frost(:,:,:) = 0._dp
     78minPCM_h2operice(:,:,:) = 0._dp
     79minPCM_co2perice(:,:,:) = 0._dp
     80minPCM_h2ofrost(:,:,:) = 0._dp
     81minPCM_co2frost(:,:,:) = 0._dp
    8382if (nslope == 1) then ! No slope
    8483    allocate(character(0) :: num)
     
    103102        num = '_slope'//num
    104103    end if
    105     call get_var_nc('co2ice'//num,var_read_2d)          ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_co2frost(:,islope,1))
    106     call get_var_nc('h2o_ice_s'//num,var_read_2d)       ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_h2ofrost(:,islope,1))
    107     call get_var_nc('watercap'//num,var_read_2d)        ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_h2operice(:,islope,1))
    108     call get_var_nc('perennial_co2ice'//num,var_read_2d); call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_co2perice(:,islope,1))
     104    call get_var_nc('co2ice'//num,var_read_2d)          ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,minPCM_co2frost(:,islope,1))
     105    call get_var_nc('h2o_ice_s'//num,var_read_2d)       ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,minPCM_h2ofrost(:,islope,1))
     106    call get_var_nc('watercap'//num,var_read_2d)        ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,minPCM_h2operice(:,islope,1))
     107    call get_var_nc('perennial_co2ice'//num,var_read_2d); call lonlat2vect(nlon,nlat,ngrid,var_read_2d,minPCM_co2perice(:,islope,1))
    109108    call get_var_nc('tsurf'//num,var_read_2d)           ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,tsurf_avg_yr1(:,islope))
    110109end do
     
    129128    end if
    130129    call get_var_nc('tsurf'//num,var_read_2d)           ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,tsurf_avg(:,islope))
    131     call get_var_nc('co2ice'//num,var_read_2d)          ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_co2frost(:,islope,2))
    132     call get_var_nc('h2o_ice_s'//num,var_read_2d)       ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_h2ofrost(:,islope,2))
    133     call get_var_nc('watercap'//num,var_read_2d)        ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_h2operice(:,islope,2))
    134     call get_var_nc('perennial_co2ice'//num,var_read_2d); call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_co2perice(:,islope,2))
     130    call get_var_nc('co2ice'//num,var_read_2d)          ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,minPCM_co2frost(:,islope,2))
     131    call get_var_nc('h2o_ice_s'//num,var_read_2d)       ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,minPCM_h2ofrost(:,islope,2))
     132    call get_var_nc('watercap'//num,var_read_2d)        ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,minPCM_h2operice(:,islope,2))
     133    call get_var_nc('perennial_co2ice'//num,var_read_2d); call lonlat2vect(nlon,nlat,ngrid,var_read_2d,minPCM_co2perice(:,islope,2))
    135134    if (do_soil) then
    136135        call get_var_nc('soiltemp'//num,var_read_3d)
     
    204203!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    205204! Compute frost from yearly minima
    206 call compute_frost4PCM(min_h2ofrost(:,:,2),min_co2frost(:,:,2))
    207 
    208 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    209 ! Compute ice tendencies from yearly minima
    210 call print_msg('> Computing surface ice tendencies')
    211 call compute_tend(min_h2operice + min_h2ofrost,d_h2oice)
    212 call print_msg('H2O ice tendencies [kg/m2/yr] (min|max): '//real2str(minval(d_h2oice))//' | '//real2str(maxval(d_h2oice)))
    213 call compute_tend(min_co2perice + min_co2frost,d_co2ice)
    214 call print_msg('CO2 ice tendencies [kg/m2/yr] (min|max): '//real2str(minval(d_co2ice))//' | '//real2str(maxval(d_co2ice)))
     205call compute_frost4PCM(minPCM_h2ofrost(:,:,2),minPCM_co2frost(:,:,2))
    215206
    216207END SUBROUTINE load_xios_data
Note: See TracChangeset for help on using the changeset viewer.