Ignore:
Timestamp:
May 28, 2025, 1:48:58 PM (3 weeks ago)
Author:
jbclement
Message:

PEM:

  • Correction to identify sublimating ice (surface vs subsurface) at initialization
  • Gathering the processes of "ice condensation" and "dust sedimentation" in the same framework of the layering algorithm
  • Reordering the workflow to manage the different situations of the layering algorithm

JBC

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

Legend:

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

    r3779 r3782  
    673673== 26/05/2025 == JBC
    674674Information about checking of CO2 mass balance.
     675
     676== 28/05/2025 == JBC
     677- Correction to identify sublimating ice (surface vs subsurface) at initialization
     678- Gathering the processes of "ice condensation" and "dust sedimentation" in the same framework of the layering algorithm
     679- Reordering the workflow to manage the different situations of the layering algorithm
  • trunk/LMDZ.COMMON/libf/evolution/layering_mod.F90

    r3778 r3782  
    2929real, parameter :: h_patchy_dust         = 0.05    ! Height under which a dust statum is considered patchy [m]
    3030
    31 ! Lag layer parameters -> see Levrard et al. 2007
    32 real, parameter :: hmin_lag  = 0.5 ! Minimal height of the lag deposit to reduce the sublimation rate
     31! Parameters for CO2 flux correction (inspired by Levrard et al. 2007)
     32real, parameter :: hmin_lag  = 0.5 ! Minimal height of the lag deposit to reduce the sublimation rate [m]
    3333real, parameter :: fred_subl = 0.1 ! Reduction factor of sublimation rate
    3434
     
    6666!     > add_stratum
    6767!     > insert_stratum
    68 !     > rm_stratum
     68!     > del_stratum
    6969!     > get_stratum
    7070!     > ini_layering
     
    206206!=======================================================================
    207207! To remove a stratum in a layering
    208 SUBROUTINE rm_stratum(this,str)
     208SUBROUTINE del_stratum(this,str)
    209209
    210210implicit none
     
    218218
    219219!---- Code
    220 ! Protect the sub-surface strata from removing
     220! Protect the sub-surface strata from deletion
    221221if (str%top_elevation <= 0.) return
    222222
     
    237237str => new_str
    238238
    239 END SUBROUTINE rm_stratum
     239END SUBROUTINE del_stratum
    240240
    241241!=======================================================================
     
    626626
    627627!---- Local variables
    628 real                   :: dh_co2ice, dh_h2oice, dh_dust
    629 real                   :: h_co2ice_old, h_h2oice_old, h_dust_old
    630 real                   :: h2subl_co2ice, h2subl_h2oice, h2subl_co2ice_tot, h2subl_h2oice_tot
    631 real                   :: h2lift, h2lift_tot, h_pore, h_tot, h_toplag
    632 type(stratum), pointer :: currentloc
     628real    :: dh_co2ice, dh_h2oice, dh_dust
     629real    :: h_co2ice_old, h_h2oice_old, h_dust_old
     630real    :: h2subl_co2ice, h2subl_h2oice, h2subl_co2ice_tot, h2subl_h2oice_tot
     631real    :: h2lift, h2lift_tot, h_pore, h_tot
     632logical :: unexpected
    633633
    634634!---- Code
     
    638638zshift_surf = this%top%top_elevation
    639639zlag = 0.
    640 
     640unexpected = .false.
     641
     642!-----------------------------------------------------------------------
    641643! NOTHING HAPPENS
    642644if (abs(dh_co2ice) < tol .and. abs(dh_h2oice) < tol .and. abs(dh_dust) < tol) then
    643645    ! So we do nothing
    644646!-----------------------------------------------------------------------
    645 ! DUST SEDIMENTATION with possibly ice condensation
    646 else if (dh_dust > dh_co2ice .and. dh_dust > dh_h2oice .and. dh_co2ice >= 0. .and. dh_h2oice >= 0.) then
    647     write(*,*) '> Layering: dust sedimentation'
    648     h_pore = dh_dust*dry_regolith_porosity/(1. - dry_regolith_porosity)
    649     h_tot = dh_co2ice + dh_h2oice + dh_dust + h_pore
    650     ! New stratum at the top of the layering
    651     if (new_str) then
    652         call add_stratum(this,this%top%top_elevation + h_tot,dh_co2ice,dh_h2oice,dh_dust,h_pore,0.)
    653         new_str = .false.
     647! BUILDING A STRATUM (ice condensation and/or dust desimentation)
     648else if (dh_co2ice >= 0. .and. dh_h2oice >= 0. .and. dh_dust >= 0.) then
     649    ! Which porosity is considered?
     650    if (dh_co2ice > dh_h2oice .and. dh_co2ice > dh_dust) then ! CO2 ice is dominant
     651        h_pore = dh_co2ice*co2ice_porosity/(1. - co2ice_porosity)
     652    else if (dh_h2oice > dh_co2ice .and. dh_h2oice > dh_dust) then ! H2O ice is dominant
     653        h_pore = dh_h2oice*h2oice_porosity/(1. - h2oice_porosity)
     654    else if (dh_dust > dh_co2ice .and. dh_dust > dh_h2oice) then ! Dust is dominant
     655        h_pore = dh_dust*dry_regolith_porosity/(1. - dry_regolith_porosity)
    654656    else
    655         this%top%top_elevation = this%top%top_elevation + h_tot
    656         this%top%h_co2ice      = this%top%h_co2ice      + dh_co2ice
    657         this%top%h_h2oice      = this%top%h_h2oice      + dh_h2oice
    658         this%top%h_dust        = this%top%h_dust        + dh_dust
    659         this%top%h_pore        = this%top%h_pore        + h_pore
    660     endif
    661 !-----------------------------------------------------------------------
    662 ! DUST LIFTING with possibly ice sublimation
    663 !else if (dh_dust < dh_co2ice .and. dh_dust < dh_h2oice .and. dh_co2ice <= 0. .and. dh_h2oice <= 0.) then
    664 else if (dh_dust < 0. .and. abs(dh_co2ice) < eps .and. abs(dh_h2oice) < eps) then
    665     write(*,*) '> Layering: dust lifting'
    666     h2lift_tot = abs(dh_dust)
    667     do while (h2lift_tot > 0. .and. associated(current))
    668         ! Is the considered stratum a dust lag?
    669         !if ((current%h_co2ice > eps .and. abs(dh_co2ice) < tol) .or. (current%h_h2oice > eps .and. abs(dh_h2oice) < tol)) then ! No, there is ice cementing the dust
    670         if (current%h_co2ice > 0. .or. current%h_h2oice > 0. .or. current%poreice_volfrac > 0.) then ! No, there is ice cementing the dust
    671             dh_dust = 0. ! The tendency is set to 0
    672             exit
    673         else ! Yes, we can lift dust
    674             h2lift = min(h2lift_tot,current%h_dust) ! How much dust can be lifted?
    675             h2lift_tot = h2lift_tot - h2lift
    676             call lift_dust_lag(this,current,h2lift)
    677             if (h2lift_tot > 0.) current => current%down ! Still dust to be lifted so we move to the underlying stratum
    678         endif
    679     enddo
    680     if (h2lift_tot > 0.) dh_dust = 0. ! No dust available anymore so the tendency is set to 0
    681 !-----------------------------------------------------------------------
    682 ! ICE CONDENSATION
    683 else if ((dh_co2ice > dh_dust .or. dh_h2oice > dh_dust) .and. dh_dust >= 0.) then
    684     write(*,*) '> Layering: ice condensation'
    685     ! Which porosity is considered?
    686     if (dh_co2ice > dh_h2oice) then ! CO2 ice is dominant
    687         h_pore = dh_co2ice*co2ice_porosity/(1. - co2ice_porosity)
    688     else ! H2O ice is dominant
    689         h_pore = dh_h2oice*h2oice_porosity/(1. - h2oice_porosity)
     657        unexpected = .true.
    690658    endif
    691659    h_tot = dh_co2ice + dh_h2oice + dh_dust + h_pore
     
    702670    endif
    703671!-----------------------------------------------------------------------
    704 ! ICE SUBLIMATION
    705 else if (dh_co2ice <= 0. .and. dh_h2oice <= 0. .and. abs(dh_dust) < tol) then
    706     write(*,*) '> Layering: ice sublimation'
    707     h2subl_co2ice_tot = abs(dh_co2ice)
    708     h2subl_h2oice_tot = abs(dh_h2oice)
    709     do while (h2subl_co2ice_tot > 0. .and. h2subl_h2oice_tot > 0. .and. associated(current))
    710         h_co2ice_old = current%h_co2ice
    711         h_h2oice_old = current%h_h2oice
    712         h_dust_old = current%h_dust
    713 
    714 !~         ! How much is CO2 ice sublimation inhibited by the top dust lag?
    715 !~         h_toplag = 0.
    716 !~         if (associated(current%up)) then ! If there is an upper stratum
    717 !~             currentloc => current%up
    718 !~             ! Is the considered stratum a dust lag?
    719 !~             do while (.not. (current%h_co2ice > 0. .or. current%h_h2oice > 0. .or. current%poreice_volfrac > 0.) .and. associated(currentloc%up))
    720 !~                 h_toplag = h_toplag + thickness(currentloc)
    721 !~                 currentloc => currentloc%up
    722 !~             enddo
    723 !~         endif
    724 !~         h2subl_co2ice_tot = h2subl_co2ice_tot*fred_subl**(h_toplag/hmin_lag)
    725 
    726         ! Is there CO2 ice to sublimate?
    727         h2subl_co2ice = 0.
    728         if (h_co2ice_old > 0. .and. h2subl_co2ice_tot > 0.) then
    729             h2subl_co2ice = min(h2subl_co2ice_tot,h_co2ice_old)
    730             h2subl_co2ice_tot = h2subl_co2ice_tot - h2subl_co2ice
    731         endif
    732         ! Is there H2O ice to sublimate?
    733         h2subl_h2oice = 0.
    734         if (h_h2oice_old > 0. .and. h2subl_h2oice_tot > 0.) then
    735             h2subl_h2oice = min(h2subl_h2oice_tot,h_h2oice_old)
    736             h2subl_h2oice_tot = h2subl_h2oice_tot - h2subl_h2oice
    737         endif
    738         ! Sublimation
    739         if (h2subl_co2ice > 0. .or. h2subl_h2oice >0.) call subl_ice_str(this,current,h2subl_co2ice,h2subl_h2oice,zlag,new_lag)
    740         ! Still ice to be sublimated and no more ice in the current stratum so we move to the underlying stratum
    741         if ((h2subl_co2ice_tot > 0. .or. h2subl_h2oice_tot > 0.) .and. current%h_co2ice < tol .and. current%h_h2oice < tol) then
    742             current => current%down
    743             new_lag = .true.
    744         else
    745             exit
    746         endif
    747     enddo
    748     if (h2subl_co2ice_tot > 0.) dh_co2ice = 0. ! No CO2 ice available anymore so the tendency is set to 0
    749     if (h2subl_h2oice_tot > 0.) dh_h2oice = 0. ! No H2O ice available anymore so the tendency is set to 0
     672else if (dh_co2ice <= 0. .and. dh_h2oice <= 0. .and. dh_dust <= 0.) then ! A stratum is retreating
     673    ! DUST LIFTING
     674    if (abs(dh_co2ice) < tol .and. abs(dh_co2ice) < tol) then
     675        write(*,*) '> Layering: dust lifting'
     676        h2lift_tot = abs(dh_dust)
     677        do while (h2lift_tot > 0. .and. associated(current))
     678            ! Is the considered stratum a dust lag?
     679            if (current%h_co2ice > 0. .or. current%h_h2oice > 0. .or. current%poreice_volfrac > 0.) then ! No, there is ice cementing the dust
     680                dh_dust = 0. ! The tendency is set to 0
     681                exit
     682            else ! Yes, we can lift dust
     683                h2lift = min(h2lift_tot,current%h_dust) ! How much dust can be lifted?
     684                h2lift_tot = h2lift_tot - h2lift
     685                call lift_dust_lag(this,current,h2lift)
     686                if (h2lift_tot > 0.) current => current%down ! Still dust to be lifted so we move to the underlying stratum
     687            endif
     688        enddo
     689        if (h2lift_tot > 0.) dh_dust = 0. ! No dust available anymore so the tendency is set to 0
    750690!-----------------------------------------------------------------------
    751 !~ ! CO2 ICE SUBLIMATION + H2O ICE CONDENSATION
    752 !~ else if (dh_co2ice < 0. .and. dh_h2oice > 0. .and. (abs(dh_dust) < abs(dh_co2ice) .or. abs(dh_dust) < abs(dh_h2oice))) then
    753 
    754 ! TO DO????
    755 
     691    ! ICE SUBLIMATION
     692    else if (abs(dh_dust) < tol) then
     693        write(*,*) '> Layering: ice sublimation'
     694        h2subl_co2ice_tot = abs(dh_co2ice)
     695        h2subl_h2oice_tot = abs(dh_h2oice)
     696        do while (h2subl_co2ice_tot > 0. .and. h2subl_h2oice_tot > 0. .and. associated(current))
     697            h_co2ice_old = current%h_co2ice
     698            h_h2oice_old = current%h_h2oice
     699   
     700            ! Is there CO2 ice to sublimate?
     701            h2subl_co2ice = 0.
     702            if (h_co2ice_old > 0. .and. h2subl_co2ice_tot > 0.) then
     703                h2subl_co2ice = min(h2subl_co2ice_tot,h_co2ice_old)
     704                h2subl_co2ice_tot = h2subl_co2ice_tot - h2subl_co2ice
     705            endif
     706            ! Is there H2O ice to sublimate?
     707            h2subl_h2oice = 0.
     708            if (h_h2oice_old > 0. .and. h2subl_h2oice_tot > 0.) then
     709                h2subl_h2oice = min(h2subl_h2oice_tot,h_h2oice_old)
     710                h2subl_h2oice_tot = h2subl_h2oice_tot - h2subl_h2oice
     711            endif
     712            ! Sublimation
     713            if (h2subl_co2ice > 0. .or. h2subl_h2oice > 0.) call subl_ice_str(this,current,h2subl_co2ice,h2subl_h2oice,zlag,new_lag)
     714            ! Still ice to be sublimated and no more ice in the current stratum so we move to the underlying stratum
     715            if ((h2subl_co2ice_tot > 0. .or. h2subl_h2oice_tot > 0.) .and. current%h_co2ice < tol .and. current%h_h2oice < tol) then
     716                current => current%down
     717                new_lag = .true.
     718            else
     719                exit
     720            endif
     721        enddo
     722        if (h2subl_co2ice_tot > 0.) dh_co2ice = 0. ! No CO2 ice available anymore so the tendency is set to 0
     723        if (h2subl_h2oice_tot > 0.) dh_h2oice = 0. ! No H2O ice available anymore so the tendency is set to 0
     724    else
     725        unexpected = .true.
     726    endif
    756727!-----------------------------------------------------------------------
    757 ! UNUSUAL (WEIRD) SITUATION
     728! CO2 ICE SUBLIMATION + H2O ICE CONDENSATION
     729else if (dh_co2ice < 0. .and. dh_h2oice > 0.) then
     730!~     if (abs(dh_co2ice) > dh_h2oice .and. dh_co2ice < dh_dust .and. dh_dust <= 0.) then
     731!~         h2subl_co2ice_tot = abs(dh_co2ice)
     732!~         do while (h2subl_co2ice_tot > 0. associated(current))
     733!~             h_co2ice_old = current%h_co2ice
     734!~             h_h2oice_old = current%h_h2oice
     735   
     736!~             ! Is there CO2 ice to sublimate?
     737!~             h2subl_co2ice = 0.
     738!~             if (h_co2ice_old > 0. .and. h2subl_co2ice_tot > 0.) then
     739!~                 h2subl_co2ice = min(h2subl_co2ice_tot,h_co2ice_old)
     740!~                 h2subl_co2ice_tot = h2subl_co2ice_tot - h2subl_co2ice
     741!~             endif
     742!~             ! Sublimation
     743!~             if (h2subl_co2ice > 0.) call subl_ice_str(this,current,h2subl_co2ice,0.,zlag,new_lag)
     744!~             ! Still ice to be sublimated and no more ice in the current stratum so we move to the underlying stratum
     745!~             if (h2subl_co2ice_tot > 0. .and. current%h_co2ice < tol .and. current%h_h2oice < tol) then
     746!~                 current => current%down
     747!~                 new_lag = .true.
     748!~             else
     749!~                 exit
     750!~             endif
     751!~         enddo
     752!~         if (h2subl_co2ice_tot > 0.) dh_co2ice = 0. ! No CO2 ice available anymore so the tendency is set to 0
     753!~     else if (dh_h2oice > abs(dh_co2ice) .and. 0 <= dh_dust .and. dh_dust < dh_h2oice) then
     754
     755!~     else
     756        unexpected = .true.
     757!~     endif
     758!-----------------------------------------------------------------------
     759! NOT EXPECTED SITUATION
    758760else
     761    unexpected = .true.
     762endif
     763
     764if (unexpected) then
    759765    write(*,'(a)') 'Error: situation for the layering construction not managed!'
    760766    write(*,'(a,es12.3)') '    > dh_co2ice [m/y] = ', dh_co2ice
    761767    write(*,'(a,es12.3)') '    > dh_h2oice [m/y] = ', dh_h2oice
    762768    write(*,'(a,es12.3)') '    > dh_dust   [m/y] = ', dh_dust, tol
    763 !~     error stop
     769    error stop
    764770endif
    765771
     
    786792
    787793! Remove the eroding dust lag if there is no dust anymore
    788 if (str%h_dust < tol) call rm_stratum(this,str)
     794if (str%h_dust < tol) call del_stratum(this,str)
    789795
    790796END SUBROUTINE lift_dust_lag
     
    829835
    830836! Remove the sublimating stratum if there is no ice anymore
    831 if (str%h_co2ice < tol .and. str%h_h2oice < tol) call rm_stratum(this,str)
     837if (str%h_co2ice < tol .and. str%h_h2oice < tol) call del_stratum(this,str)
    832838
    833839! New stratum above the current stratum as a dust lag
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r3779 r3782  
    674674        enddo
    675675    enddo
     676    ! We put the sublimating tendency coming from subsurface ice into the overall tendency
     677    where (zdqsdif_ssi_tot < 0.)
     678        d_h2oice = zdqsdif_ssi_tot
     679    end where
    676680endif
    677681do i = 1,ngrid
     
    684688            co2ice_sublim_surf_ini = co2ice_sublim_surf_ini + cell_area(i)*subslope_dist(i,islope)
    685689        endif
    686         if (d_h2oice(i,islope) < 0. .and. h2o_ice(i,islope) > 0.) then
    687             is_h2oice_sublim_ini(i,islope) = .true.
    688             h2oice_ini_surf = h2oice_ini_surf + cell_area(i)*subslope_dist(i,islope)
     690        if (d_h2oice(i,islope) < 0.) then
     691            if (h2o_ice(i,islope) > 0.) then
     692                is_h2oice_sublim_ini(i,islope) = .true.
     693                h2oice_ini_surf = h2oice_ini_surf + cell_area(i)*subslope_dist(i,islope)
     694            else if (h2o_ice_depth(i,islope) > 0.) then
     695                is_h2oice_sublim_ini(i,islope) = .true.
     696            endif
    689697        endif
    690698    enddo
     
    692700write(*,*) "Total initial surface of CO2 ice sublimating =", co2ice_sublim_surf_ini
    693701write(*,*) "Total initial surface of H2O ice sublimating =", h2oice_ini_surf
    694 
    695 ! We put the sublimating tendency coming from subsurface ice
    696 where (zdqsdif_ssi_tot > 0.)
    697     d_h2oice = -zdqsdif_ssi_tot
    698 end where
    699702
    700703totmass_adsco2_ini = 0.
Note: See TracChangeset for help on using the changeset viewer.