Changeset 3789 for trunk/LMDZ.COMMON/libf
- Timestamp:
- Jun 3, 2025, 5:19:45 PM (2 weeks ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3786 r3789 692 692 == 02/06/2025 == JBC 693 693 Optimization (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 696 Few corrections for the layering algorithm, in particular when a dust lag layer is created. -
trunk/LMDZ.COMMON/libf/evolution/layering_mod.F90
r3785 r3789 28 28 real, parameter :: rho_dust = 2500. ! Density of dust [kg.m-3] 29 29 real, 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]30 real, parameter :: h_patchy_dust = 5.e-4 ! Height under which a dust lag is considered patchy [m] 31 real, parameter :: h_patchy_ice = 5.e-4 ! Height under which a H2O ice lag is considered patchy [m] 32 32 33 33 ! Parameters for CO2 flux correction (inspired by Levrard et al. 2007) … … 550 550 !======================================================================= 551 551 ! To get data about possible subsurface ice in a layering 552 SUBROUTINE subsurface_ice_layering(this, is_subsurface_ice,h_toplag,h2o_ice)552 SUBROUTINE subsurface_ice_layering(this,h_toplag,h2o_ice) 553 553 554 554 implicit none … … 556 556 !---- Arguments 557 557 type(layering), intent(in) :: this 558 logical, intent(out) :: is_subsurface_ice559 558 real, intent(out) :: h2o_ice, h_toplag 560 559 … … 565 564 h_toplag = 0. 566 565 h2o_ice = 0. 567 is_subsurface_ice = .false.568 566 current => this%top 569 567 ! Is the considered stratum a dust lag? … … 574 572 enddo 575 573 ! 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 574 if (.not. is_h2oice_str(current) .or. h_toplag < h_patchy_dust) then 575 h_toplag = 0. 576 h2o_ice = current%h_h2oice 583 577 endif 584 578 … … 622 616 623 617 !---- Local variables 624 real :: h _ice, h2subl, h_pore, h_tot618 real :: h2subl, h_ice, h_pore, h_pore_new, h_tot 625 619 real :: hlag_dust, hlag_h2oice 626 620 type(stratum), pointer :: current … … 628 622 !---- Code 629 623 h_ice = str%h_co2ice + str%h_h2oice 624 h_pore = str%h_pore 630 625 h2subl = h2subl_co2ice + h2subl_h2oice 631 626 … … 654 649 ! Which porosity is considered? 655 650 if (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) 657 652 else 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) 654 endif 655 h_tot = hlag_dust + hlag_h2oice + h_pore_new 661 656 662 657 ! New stratum above the current stratum as a lag layer 663 658 if (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.) 665 660 new_lag = .false. 666 661 else … … 668 663 str%up%h_h2oice = str%up%h_h2oice + hlag_h2oice 669 664 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 671 666 endif 672 667 … … 702 697 dh_co2ice = d_co2ice/rho_co2ice 703 698 dh_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) 700 if (dh_co2ice > 0. .or. dh_h2oice > 0.) then 701 dh_dust = d_dust/rho_dust 702 else 703 dh_dust = 0. 704 endif 705 705 zshift_surf = this%top%top_elevation 706 706 zlag = 0. … … 742 742 h2subl_h2oice_tot = abs(dh_h2oice) 743 743 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)) 745 745 h_co2ice_old = current%h_co2ice 746 746 h_h2oice_old = current%h_h2oice … … 755 755 currentloc => currentloc%up 756 756 enddo 757 if (currentloc%h_h2oice > h_patchy_ice) then757 if (currentloc%h_h2oice >= h_patchy_ice) then 758 758 R_subl = 0. 759 else if (0. < currentloc%h_h2oice .and. currentloc%h_h2oice < =h_patchy_ice) then759 else if (0. < currentloc%h_h2oice .and. currentloc%h_h2oice < h_patchy_ice) then 760 760 h_toplag = h_toplag + thickness(currentloc) 761 761 R_subl = fred_subl**(h_toplag/hmin_lag) … … 828 828 write(*,'(a,es12.3)') ' > dh_co2ice [m/y] = ', dh_co2ice 829 829 write(*,'(a,es12.3)') ' > dh_h2oice [m/y] = ', dh_h2oice 830 write(*,'(a,es12.3)') ' > dh_dust [m/y] = ', dh_dust , tol830 write(*,'(a,es12.3)') ' > dh_dust [m/y] = ', dh_dust 831 831 error stop 832 832 endif -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3786 r3789 69 69 use writediagpem_mod, only: writediagpem, writediagsoilpem 70 70 use 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 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, & 73 print_layering 73 74 use dyn_ss_ice_m_mod, only: dyn_ss_ice_m 74 75 use version_info_mod, only: print_version_info … … 200 201 logical, dimension(:,:), allocatable :: new_str, new_lag ! Flags for the layering algorithm 201 202 real, dimension(:,:), allocatable :: h2o_ice_depth_old ! Old depth of subsurface ice layer 202 logical :: is_subsurface_ice ! Boolean to know if there is subsurface ice203 203 204 204 ! Variables for slopes … … 846 846 h2o_ice(ig,islope) = layerings_map(ig,islope)%top%h_h2oice 847 847 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)) 849 849 endif 850 850 enddo 851 851 enddo 852 call print_layering(layerings_map(1,1)) 852 853 else 853 854 zlag = 0. … … 1065 1066 do ig = 1,ngrid 1066 1067 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)) 1068 1069 enddo 1069 1070 enddo -
trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90
r3778 r3789 171 171 exit 172 172 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>!' 176 176 exit 177 177 endif -
trunk/LMDZ.COMMON/libf/evolution/pemredem.F90
r3778 r3789 104 104 call put_field('stratif_slope'//num//'_h_dust','Layering dust height',stratif_array(:,islope,:,4),Year) 105 105 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) 107 107 enddo 108 108 deallocate(stratif_array) -
trunk/LMDZ.COMMON/libf/evolution/recomp_tend_mod.F90
r3784 r3789 61 61 !======================================================================= 62 62 63 SUBROUTINE recomp_tend_h2o( icetable_depth_old,icetable_depth_new,tsurf,tsoil_PEM_timeseries_old,tsoil_PEM_timeseries_new,d_h2oice)63 SUBROUTINE recomp_tend_h2o(h2oice_depth_old,h2oice_depth_new,tsurf,tsoil_PEM_timeseries_old,tsoil_PEM_timeseries_new,d_h2oice) 64 64 65 65 use compute_soiltemp_mod, only: itp_tsoil … … 76 76 ! Inputs 77 77 ! ------ 78 real, intent(in) :: icetable_depth_old, icetable_depth_new, tsurf78 real, intent(in) :: h2oice_depth_old, h2oice_depth_new, tsurf 79 79 real, dimension(:,:), intent(in) :: tsoil_PEM_timeseries_old, tsoil_PEM_timeseries_new 80 80 ! Outputs … … 90 90 91 91 ! Higher resistance due to growing lag layer (higher depth) 92 Rz_old = icetable_depth_old*zcdv/coef_diff ! Old resistance from PCM93 Rz_new = icetable_depth_new*zcdv/coef_diff ! New resistance based on new depth92 Rz_old = h2oice_depth_old*zcdv/coef_diff ! Old resistance from PCM 93 Rz_new = h2oice_depth_new*zcdv/coef_diff ! New resistance based on new depth 94 94 R_dec = 1. 95 95 if (Rz_new >= Rz_old) R_dec = Rz_new/Rz_old ! Decrease because of resistance … … 99 99 psv_max_new = 0. 100 100 do 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))) 103 103 enddo 104 104
Note: See TracChangeset
for help on using the changeset viewer.