Changeset 3782 for trunk/LMDZ.COMMON/libf
- Timestamp:
- May 28, 2025, 1:48:58 PM (3 weeks ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3779 r3782 673 673 == 26/05/2025 == JBC 674 674 Information 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 29 29 real, parameter :: h_patchy_dust = 0.05 ! Height under which a dust statum is considered patchy [m] 30 30 31 ! Lag layer parameters -> see Levrard et al. 200732 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) 32 real, parameter :: hmin_lag = 0.5 ! Minimal height of the lag deposit to reduce the sublimation rate [m] 33 33 real, parameter :: fred_subl = 0.1 ! Reduction factor of sublimation rate 34 34 … … 66 66 ! > add_stratum 67 67 ! > insert_stratum 68 ! > rm_stratum68 ! > del_stratum 69 69 ! > get_stratum 70 70 ! > ini_layering … … 206 206 !======================================================================= 207 207 ! To remove a stratum in a layering 208 SUBROUTINE rm_stratum(this,str)208 SUBROUTINE del_stratum(this,str) 209 209 210 210 implicit none … … 218 218 219 219 !---- Code 220 ! Protect the sub-surface strata from removing220 ! Protect the sub-surface strata from deletion 221 221 if (str%top_elevation <= 0.) return 222 222 … … 237 237 str => new_str 238 238 239 END SUBROUTINE rm_stratum239 END SUBROUTINE del_stratum 240 240 241 241 !======================================================================= … … 626 626 627 627 !---- Local variables 628 real 629 real 630 real 631 real :: h2lift, h2lift_tot, h_pore, h_tot, h_toplag632 type(stratum), pointer :: currentloc 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 632 logical :: unexpected 633 633 634 634 !---- Code … … 638 638 zshift_surf = this%top%top_elevation 639 639 zlag = 0. 640 640 unexpected = .false. 641 642 !----------------------------------------------------------------------- 641 643 ! NOTHING HAPPENS 642 644 if (abs(dh_co2ice) < tol .and. abs(dh_h2oice) < tol .and. abs(dh_dust) < tol) then 643 645 ! So we do nothing 644 646 !----------------------------------------------------------------------- 645 ! DUST SEDIMENTATION with possibly ice condensation646 else if (dh_ dust > dh_co2ice .and. dh_dust > dh_h2oice .and. dh_co2ice >= 0. .and. dh_h2oice>= 0.) then647 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_pore650 ! New stratum at the top of the layering651 if (new_str) then652 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) 648 else 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) 654 656 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. 690 658 endif 691 659 h_tot = dh_co2ice + dh_h2oice + dh_dust + h_pore … … 702 670 endif 703 671 !----------------------------------------------------------------------- 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 672 else 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 750 690 !----------------------------------------------------------------------- 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 756 727 !----------------------------------------------------------------------- 757 ! UNUSUAL (WEIRD) SITUATION 728 ! CO2 ICE SUBLIMATION + H2O ICE CONDENSATION 729 else 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 758 760 else 761 unexpected = .true. 762 endif 763 764 if (unexpected) then 759 765 write(*,'(a)') 'Error: situation for the layering construction not managed!' 760 766 write(*,'(a,es12.3)') ' > dh_co2ice [m/y] = ', dh_co2ice 761 767 write(*,'(a,es12.3)') ' > dh_h2oice [m/y] = ', dh_h2oice 762 768 write(*,'(a,es12.3)') ' > dh_dust [m/y] = ', dh_dust, tol 763 !~error stop769 error stop 764 770 endif 765 771 … … 786 792 787 793 ! Remove the eroding dust lag if there is no dust anymore 788 if (str%h_dust < tol) call rm_stratum(this,str)794 if (str%h_dust < tol) call del_stratum(this,str) 789 795 790 796 END SUBROUTINE lift_dust_lag … … 829 835 830 836 ! 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)837 if (str%h_co2ice < tol .and. str%h_h2oice < tol) call del_stratum(this,str) 832 838 833 839 ! New stratum above the current stratum as a dust lag -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3779 r3782 674 674 enddo 675 675 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 676 680 endif 677 681 do i = 1,ngrid … … 684 688 co2ice_sublim_surf_ini = co2ice_sublim_surf_ini + cell_area(i)*subslope_dist(i,islope) 685 689 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 689 697 endif 690 698 enddo … … 692 700 write(*,*) "Total initial surface of CO2 ice sublimating =", co2ice_sublim_surf_ini 693 701 write(*,*) "Total initial surface of H2O ice sublimating =", h2oice_ini_surf 694 695 ! We put the sublimating tendency coming from subsurface ice696 where (zdqsdif_ssi_tot > 0.)697 d_h2oice = -zdqsdif_ssi_tot698 end where699 702 700 703 totmass_adsco2_ini = 0.
Note: See TracChangeset
for help on using the changeset viewer.