Ignore:
Timestamp:
Jun 3, 2025, 5:19:45 PM (2 weeks ago)
Author:
jbclement
Message:

PEM:
Few corrections for the layering algorithm, in particular when a dust lag layer is created.
JBC

Location:
trunk/LMDZ.COMMON/libf/evolution
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/changelog.txt

    r3786 r3789  
    692692== 02/06/2025 == JBC
    693693Optimization (computing time is devided by 2.2) of the program "reshape_XIOS_output" to convert XIOS output onto the PCM grid.
     694
     695== 03/06/2025 == JBC
     696Few corrections for the layering algorithm, in particular when a dust lag layer is created.
  • trunk/LMDZ.COMMON/libf/evolution/layering_mod.F90

    r3785 r3789  
    2828real, parameter :: rho_dust          = 2500.   ! Density of dust [kg.m-3]
    2929real, parameter :: rho_rock          = 3200.   ! Density of rock [kg.m-3]
    30 real, parameter :: h_patchy_dust     = 0.05    ! Height under which a dust lag is considered patchy [m]
    31 real, parameter :: h_patchy_ice      = 0.05    ! Height under which a H2O ice lag is considered patchy [m]
     30real, parameter :: h_patchy_dust     = 5.e-4   ! Height under which a dust lag is considered patchy [m]
     31real, parameter :: h_patchy_ice      = 5.e-4   ! Height under which a H2O ice lag is considered patchy [m]
    3232
    3333! Parameters for CO2 flux correction (inspired by Levrard et al. 2007)
     
    550550!=======================================================================
    551551! To get data about possible subsurface ice in a layering
    552 SUBROUTINE subsurface_ice_layering(this,is_subsurface_ice,h_toplag,h2o_ice)
     552SUBROUTINE subsurface_ice_layering(this,h_toplag,h2o_ice)
    553553
    554554implicit none
     
    556556!---- Arguments
    557557type(layering), intent(in) :: this
    558 logical, intent(out) :: is_subsurface_ice
    559558real,    intent(out) :: h2o_ice, h_toplag
    560559
     
    565564h_toplag = 0.
    566565h2o_ice = 0.
    567 is_subsurface_ice = .false.
    568566current => this%top
    569567! Is the considered stratum a dust lag?
     
    574572enddo
    575573! Is the stratum below the dust lag made of ice?
    576 if (is_h2oice_str(current)) then
    577     if (h_toplag >= h_patchy_dust) then
    578         is_subsurface_ice = .true.
    579     else
    580         h_toplag = 0.
    581         h2o_ice = current%h_h2oice
    582     endif
     574if (.not. is_h2oice_str(current) .or. h_toplag < h_patchy_dust) then
     575    h_toplag = 0.
     576    h2o_ice = current%h_h2oice
    583577endif
    584578
     
    622616
    623617!---- Local variables
    624 real                   :: h_ice, h2subl, h_pore, h_tot
     618real                   :: h2subl, h_ice, h_pore, h_pore_new, h_tot
    625619real                   :: hlag_dust, hlag_h2oice
    626620type(stratum), pointer :: current
     
    628622!---- Code
    629623h_ice = str%h_co2ice + str%h_h2oice
     624h_pore = str%h_pore
    630625h2subl = h2subl_co2ice + h2subl_h2oice
    631626
     
    654649! Which porosity is considered?
    655650if (hlag_dust >= hlag_h2oice) then
    656     h_pore = hlag_dust*dry_lag_porosity/(1. - dry_lag_porosity)
     651    h_pore_new = hlag_dust*dry_lag_porosity/(1. - dry_lag_porosity)
    657652else
    658     h_pore = hlag_h2oice*wet_lag_porosity/(1. - wet_lag_porosity)
    659 endif
    660 h_tot = hlag_dust + hlag_h2oice + h_pore
     653    h_pore_new = hlag_h2oice*wet_lag_porosity/(1. - wet_lag_porosity)
     654endif
     655h_tot = hlag_dust + hlag_h2oice + h_pore_new
    661656
    662657! New stratum above the current stratum as a lag layer
    663658if (new_lag) then
    664     call insert_stratum(this,str,str%top_elevation + h_tot,0.,hlag_h2oice,hlag_dust,h_pore,0.)
     659    call insert_stratum(this,str,str%top_elevation + h_tot,0.,hlag_h2oice,hlag_dust,h_pore_new,0.)
    665660    new_lag = .false.
    666661else
     
    668663    str%up%h_h2oice      = str%up%h_h2oice      + hlag_h2oice
    669664    str%up%h_dust        = str%up%h_dust        + hlag_dust
    670     str%up%h_pore        = str%up%h_pore        + h_pore
     665    str%up%h_pore        = str%up%h_pore        + h_pore_new
    671666endif
    672667
     
    702697dh_co2ice = d_co2ice/rho_co2ice
    703698dh_h2oice = d_h2oice/rho_h2oice
    704 dh_dust = d_dust/rho_dust
     699! To disable dust sedimenation when there is ice sublimation (because dust tendency is fixed)
     700if (dh_co2ice > 0. .or. dh_h2oice > 0.) then
     701    dh_dust = d_dust/rho_dust
     702else
     703    dh_dust = 0.
     704endif
    705705zshift_surf = this%top%top_elevation
    706706zlag = 0.
     
    742742        h2subl_h2oice_tot = abs(dh_h2oice)
    743743        h2lift_tot = abs(dh_dust)
    744         do while (h2subl_co2ice_tot > 0. .and. h2subl_h2oice_tot > 0. .and. h2lift_tot > 0. .and. associated(current))
     744        do while ((h2subl_co2ice_tot > 0. .or. h2subl_h2oice_tot > 0. .or. h2lift_tot > 0.) .and. associated(current))
    745745            h_co2ice_old = current%h_co2ice
    746746            h_h2oice_old = current%h_h2oice
     
    755755                    currentloc => currentloc%up
    756756                enddo
    757                 if (currentloc%h_h2oice > h_patchy_ice) then
     757                if (currentloc%h_h2oice >= h_patchy_ice) then
    758758                    R_subl = 0.
    759                 else if (0. < currentloc%h_h2oice .and. currentloc%h_h2oice <= h_patchy_ice) then
     759                else if (0. < currentloc%h_h2oice .and. currentloc%h_h2oice < h_patchy_ice) then
    760760                    h_toplag = h_toplag + thickness(currentloc)
    761761                    R_subl = fred_subl**(h_toplag/hmin_lag)
     
    828828    write(*,'(a,es12.3)') '    > dh_co2ice [m/y] = ', dh_co2ice
    829829    write(*,'(a,es12.3)') '    > dh_h2oice [m/y] = ', dh_h2oice
    830     write(*,'(a,es12.3)') '    > dh_dust   [m/y] = ', dh_dust, tol
     830    write(*,'(a,es12.3)') '    > dh_dust   [m/y] = ', dh_dust
    831831    error stop
    832832endif
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r3786 r3789  
    6969use writediagpem_mod,           only: writediagpem, writediagsoilpem
    7070use co2condens_mod,             only: CO2cond_ps
    71 use layering_mod,               only: layering, del_layering, make_layering, layering_algo, subsurface_ice_layering, &
    72                                       ptrarray, stratum, get_nb_str_max, nb_str_max, is_dust_lag, is_co2ice_str, is_h2oice_str
     71use layering_mod,               only: layering, del_layering, make_layering, layering_algo, subsurface_ice_layering,            &
     72                                      ptrarray, stratum, get_nb_str_max, nb_str_max, is_dust_lag, is_co2ice_str, is_h2oice_str, &
     73                                      print_layering
    7374use dyn_ss_ice_m_mod,           only: dyn_ss_ice_m
    7475use version_info_mod,           only: print_version_info
     
    200201logical,        dimension(:,:), allocatable :: new_str, new_lag  ! Flags for the layering algorithm
    201202real,           dimension(:,:), allocatable :: h2o_ice_depth_old ! Old depth of subsurface ice layer
    202 logical                                     :: is_subsurface_ice ! Boolean to know if there is subsurface ice
    203203
    204204! Variables for slopes
     
    846846                    h2o_ice(ig,islope) = layerings_map(ig,islope)%top%h_h2oice
    847847                else
    848                     call subsurface_ice_layering(layerings_map(ig,islope),is_subsurface_ice,h2o_ice_depth(ig,islope),h2o_ice(ig,islope))
     848                    call subsurface_ice_layering(layerings_map(ig,islope),h2o_ice_depth(ig,islope),h2o_ice(ig,islope))
    849849                endif
    850850            enddo
    851851        enddo
     852        call print_layering(layerings_map(1,1))
    852853    else
    853854        zlag = 0.
     
    10651066        do ig = 1,ngrid
    10661067            do islope = 1,nslope
    1067                 if (is_h2oice_sublim_ini(ig,islope)) call recomp_tend_h2o(h2o_ice_depth_old(ig,islope),h2o_ice_depth(ig,islope),tsurf_avg(ig,islope),tsoil_PEM_timeseries_old(ig,:,islope,:),tsoil_PEM_timeseries(ig,:,islope,:),d_h2oice(ig,islope))
     1068                if (is_h2oice_sublim_ini(ig,islope) .and. h2o_ice_depth(ig,islope) > 0.) call recomp_tend_h2o(h2o_ice_depth_old(ig,islope),h2o_ice_depth(ig,islope),tsurf_avg(ig,islope),tsoil_PEM_timeseries_old(ig,:,islope,:),tsoil_PEM_timeseries(ig,:,islope,:),d_h2oice(ig,islope))
    10681069            enddo
    10691070        enddo
  • trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90

    r3778 r3789  
    171171                exit
    172172            endif
    173             call get_field('stratif_slope'//num//'_icepore_volfrac',stratif_array(:,islope,:,6),found)
    174             if (.not. found) then
    175                 write(*,*) 'Pemetat0: failed loading <stratif_slope'//num//'_icepore_volfrac>!'
     173            call get_field('stratif_slope'//num//'_poreice_volfrac',stratif_array(:,islope,:,6),found)
     174            if (.not. found) then
     175                write(*,*) 'Pemetat0: failed loading <stratif_slope'//num//'_poreice_volfrac>!'
    176176                exit
    177177            endif
  • trunk/LMDZ.COMMON/libf/evolution/pemredem.F90

    r3778 r3789  
    104104        call put_field('stratif_slope'//num//'_h_dust','Layering dust height',stratif_array(:,islope,:,4),Year)
    105105        call put_field('stratif_slope'//num//'_h_pore','Layering pore height',stratif_array(:,islope,:,5),Year)
    106         call put_field('stratif_slope'//num//'_icepore_volfrac','Layering ice pore volume fraction',stratif_array(:,islope,:,6),Year)
     106        call put_field('stratif_slope'//num//'_poreice_volfrac','Layering ice pore volume fraction',stratif_array(:,islope,:,6),Year)
    107107    enddo
    108108    deallocate(stratif_array)
  • trunk/LMDZ.COMMON/libf/evolution/recomp_tend_mod.F90

    r3784 r3789  
    6161!=======================================================================
    6262
    63 SUBROUTINE recomp_tend_h2o(icetable_depth_old,icetable_depth_new,tsurf,tsoil_PEM_timeseries_old,tsoil_PEM_timeseries_new,d_h2oice)
     63SUBROUTINE recomp_tend_h2o(h2oice_depth_old,h2oice_depth_new,tsurf,tsoil_PEM_timeseries_old,tsoil_PEM_timeseries_new,d_h2oice)
    6464
    6565use compute_soiltemp_mod, only: itp_tsoil
     
    7676! Inputs
    7777! ------
    78 real,                 intent(in) :: icetable_depth_old, icetable_depth_new, tsurf
     78real,                 intent(in) :: h2oice_depth_old, h2oice_depth_new, tsurf
    7979real, dimension(:,:), intent(in) :: tsoil_PEM_timeseries_old, tsoil_PEM_timeseries_new
    8080! Outputs
     
    9090
    9191! Higher resistance due to growing lag layer (higher depth)
    92 Rz_old = icetable_depth_old*zcdv/coef_diff ! Old resistance from PCM
    93 Rz_new = icetable_depth_new*zcdv/coef_diff ! New resistance based on new depth
     92Rz_old = h2oice_depth_old*zcdv/coef_diff ! Old resistance from PCM
     93Rz_new = h2oice_depth_new*zcdv/coef_diff ! New resistance based on new depth
    9494R_dec = 1.
    9595if (Rz_new >= Rz_old) R_dec = Rz_new/Rz_old ! Decrease because of resistance
     
    9999psv_max_new = 0.
    100100do t = 1,size(tsoil_PEM_timeseries_old,2)
    101     psv_max_old = max(psv_max_old,psv(itp_tsoil(tsoil_PEM_timeseries_old(:,t),tsurf,icetable_depth_old)))
    102     psv_max_new = max(psv_max_new,psv(itp_tsoil(tsoil_PEM_timeseries_new(:,t),tsurf,icetable_depth_new)))
     101    psv_max_old = max(psv_max_old,psv(itp_tsoil(tsoil_PEM_timeseries_old(:,t),tsurf,h2oice_depth_old)))
     102    psv_max_new = max(psv_max_new,psv(itp_tsoil(tsoil_PEM_timeseries_new(:,t),tsurf,h2oice_depth_new)))
    103103enddo
    104104
Note: See TracChangeset for help on using the changeset viewer.