Changeset 3330 for trunk/LMDZ.COMMON/libf/evolution
- Timestamp:
- May 16, 2024, 11:38:21 AM (7 months ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3328 r3330 313 313 - Cleaning the previous cleaning commit. 314 314 315 == 16/05/2024 == JBC 316 Improvement of a flag-like variable (more robust as a logical) to know where co2 ice was at the beginning. -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3328 r3330 7 7 ! I_e Initialization of the PEM variable and soil 8 8 ! I_f Compute tendencies 9 ! I_g Save initial PCM situation10 ! I_h Read the "startpem.nc"9 ! I_g Read the "startpem.nc" 10 ! I_h Save the initial situation 11 11 ! I_i Compute orbit criterion 12 12 … … 45 45 use evol_ice_mod, only: evol_co2_ice, evol_h2o_ice 46 46 use comsoil_h_PEM, only: soil_pem, ini_comsoil_h_PEM, end_comsoil_h_PEM, nsoilmx_PEM, & 47 TI_PEM, 48 tsoil_PEM, layer_PEM, & 49 fluxgeo 47 TI_PEM, & ! soil thermal inertia 48 tsoil_PEM, layer_PEM, & ! Soil temp, number of subsurface layers, soil mid layer depths 49 fluxgeo ! Geothermal flux for the PEM and PCM 50 50 use adsorption_mod, only: regolith_adsorption, adsorption_pem, & ! Bool to check if adsorption, main subroutine 51 51 ini_adsorption_h_PEM, end_adsorption_h_PEM, & ! Allocate arrays … … 178 178 179 179 ! Variables for co2_ice evolution 180 real, dimension(:,:),allocatable :: co2_ice ! co2 ice in the PEM181 real, dimension(:,:), allocatable :: co2_ice_ini ! Initial amount of co2 ice in the PEM 180 real, dimension(:,:), allocatable :: co2_ice ! co2 ice in the PEM 181 logical, dimension(:,:), allocatable :: is_co2ice_ini ! Was there co2 ice initially in the PEM? 182 182 real, dimension(:,:,:), allocatable :: min_co2_ice ! Minimum of co2 ice at each point for the first year [kg/m^2] 183 183 real :: co2ice_ini_surf ! Initial surface of sublimating co2 ice 184 184 logical, dimension(:,:), allocatable :: ini_co2ice_sublim ! Logical array to know if co2 ice is sublimating 185 real, dimension(:,:),allocatable :: vmr_co2_PCM ! Physics x Times co2 volume mixing ratio retrieve from the PCM [m^3/m^3]186 real, dimension(:,:),allocatable :: vmr_co2_PEM_phys ! Physics x Times co2 volume mixing ratio used in the PEM187 real, dimension(:,:),allocatable :: q_co2_PEM_phys ! Physics x Times co2 mass mixing ratio in the first layer computed in the PEM, first value comes from PCM [kg/kg]185 real, dimension(:,:), allocatable :: vmr_co2_PCM ! Physics x Times co2 volume mixing ratio retrieve from the PCM [m^3/m^3] 186 real, dimension(:,:), allocatable :: vmr_co2_PEM_phys ! Physics x Times co2 volume mixing ratio used in the PEM 187 real, dimension(:,:), allocatable :: q_co2_PEM_phys ! Physics x Times co2 mass mixing ratio in the first layer computed in the PEM, first value comes from PCM [kg/kg] 188 188 189 189 ! Variables for stratification (layering) evolution … … 223 223 real :: totmassh2o_adsorbded ! Total mass of H2O that is exchanged because of adsorption / desoprtion over the planets [kg] 224 224 logical :: bool_sublim ! logical to check if there is sublimation or not 225 logical, dimension(:,:), allocatable :: co2ice_ has_disappeared ! logical to check if a co2ice reservoir hasalready disappeared at a previous timestep225 logical, dimension(:,:), allocatable :: co2ice_disappeared ! logical to check if a co2 ice reservoir already disappeared at a previous timestep 226 226 real, dimension(:,:), allocatable :: porefillingice_thickness_prev_iter ! ngrid x nslope: Thickness of the ice table at the previous iteration [m] 227 227 real, dimension(:), allocatable :: delta_h2o_icetablesublim ! ngrid x Total mass of the H2O that has sublimated / condenses from the ice table [kg] … … 497 497 allocate(watersoil_density_PEM_timeseries(ngrid,nsoilmx_PEM,nslope,timelen)) 498 498 allocate(delta_co2_adsorbded(ngrid)) 499 allocate(co2ice_ has_disappeared(ngrid,nslope))499 allocate(co2ice_disappeared(ngrid,nslope)) 500 500 allocate(porefillingice_thickness_prev_iter(ngrid,nslope)) 501 501 allocate(delta_h2o_icetablesublim(ngrid)) … … 556 556 !------------------------ 557 557 ! I Initialization 558 ! I_g Save initial PCM situation 559 !------------------------ 560 ! We save the places where h2o ice is sublimating 561 ! We compute the surface of h2o ice sublimating 562 allocate(ini_co2ice_sublim(ngrid,nslope),ini_h2oice_sublim(ngrid,nslope)) 563 co2ice_ini_surf = 0. 564 h2oice_ini_surf = 0. 565 Total_surface = 0. 566 ini_co2ice_sublim = .false. 567 ini_h2oice_sublim = .false. 568 co2ice_has_disappeared(:,:) = .false. 569 do i = 1,ngrid 570 Total_surface = Total_surface + cell_area(i) 571 do islope = 1,nslope 572 if (tend_co2_ice(i,islope) < 0.) then 573 ini_co2ice_sublim(i,islope) = .true. 574 co2ice_ini_surf = co2ice_ini_surf + cell_area(i)*subslope_dist(i,islope) 575 endif 576 if (tend_h2o_ice(i,islope) < 0.) then 577 ini_h2oice_sublim(i,islope) = .true. 578 h2oice_ini_surf = h2oice_ini_surf + cell_area(i)*subslope_dist(i,islope) 579 endif 580 enddo 581 enddo 582 583 write(*,*) "Total initial surface of co2 ice sublimating (slope) =", co2ice_ini_surf 584 write(*,*) "Total initial surface of h2o ice sublimating (slope) =", h2oice_ini_surf 585 write(*,*) "Total surface of the planet =", Total_surface 586 allocate(zplev_PCM(ngrid,nlayer + 1)) 587 588 do ig = 1,ngrid 589 zplev_PCM(ig,:) = ap + bp*ps_start_PCM(ig) 590 enddo 591 592 global_avg_press_old = sum(cell_area*ps_start_PCM)/Total_surface 593 global_avg_press_PCM = global_avg_press_old 594 global_avg_press_new = global_avg_press_old 595 write(*,*) "Initial global average pressure =", global_avg_press_PCM 596 597 !------------------------ 598 ! I Initialization 599 ! I_h Read the "startpem.nc" 558 ! I_g Read the "startpem.nc" 600 559 !------------------------ 601 560 allocate(co2_ice(ngrid,nslope),h2o_ice(ngrid,nslope)) … … 616 575 watersurf_density_ave,watersoil_density_PEM_ave,co2_adsorbded_phys,delta_co2_adsorbded, & 617 576 h2o_adsorbded_phys,delta_h2o_adsorbded,stratif) 618 619 allocate(co2_ice_ini(ngrid,nslope))620 co2_ice_ini = co2_ice621 577 622 578 delta_h2o_icetablesublim = 0. … … 649 605 !------------------------ 650 606 ! I Initialization 607 ! I_h Save the initial situation 608 !------------------------ 609 ! We save the places where h2o ice is sublimating 610 ! We compute the surface of h2o ice sublimating 611 allocate(ini_co2ice_sublim(ngrid,nslope),ini_h2oice_sublim(ngrid,nslope),is_co2ice_ini(ngrid,nslope)) 612 co2ice_ini_surf = 0. 613 h2oice_ini_surf = 0. 614 Total_surface = 0. 615 ini_co2ice_sublim = .false. 616 ini_h2oice_sublim = .false. 617 is_co2ice_ini = .false. 618 co2ice_disappeared = .false. 619 do i = 1,ngrid 620 Total_surface = Total_surface + cell_area(i) 621 do islope = 1,nslope 622 if (co2_ice(i,islope) > 0.) is_co2ice_ini(i,islope) = .true. 623 if (tend_co2_ice(i,islope) < 0.) then 624 ini_co2ice_sublim(i,islope) = .true. 625 co2ice_ini_surf = co2ice_ini_surf + cell_area(i)*subslope_dist(i,islope) 626 endif 627 if (tend_h2o_ice(i,islope) < 0.) then 628 ini_h2oice_sublim(i,islope) = .true. 629 h2oice_ini_surf = h2oice_ini_surf + cell_area(i)*subslope_dist(i,islope) 630 endif 631 enddo 632 enddo 633 634 write(*,*) "Total initial surface of co2 ice sublimating (slope) =", co2ice_ini_surf 635 write(*,*) "Total initial surface of h2o ice sublimating (slope) =", h2oice_ini_surf 636 write(*,*) "Total surface of the planet =", Total_surface 637 allocate(zplev_PCM(ngrid,nlayer + 1)) 638 639 do ig = 1,ngrid 640 zplev_PCM(ig,:) = ap + bp*ps_start_PCM(ig) 641 enddo 642 643 global_avg_press_old = sum(cell_area*ps_start_PCM)/Total_surface 644 global_avg_press_PCM = global_avg_press_old 645 global_avg_press_new = global_avg_press_old 646 write(*,*) "Initial global average pressure =", global_avg_press_PCM 647 648 !------------------------ 649 ! I Initialization 651 650 ! I_i Compute orbit criterion 652 651 !------------------------ … … 792 791 do ig = 1,ngrid 793 792 do islope = 1,nslope 794 if ( co2_ice_ini(ig,islope) > 0. .and. co2_ice(ig,islope) < 1.e-10 .and. (.not.(co2ice_has_disappeared(ig,islope)))) then ! co2 ice disappeared, look for closest point without co2ice795 co2ice_ has_disappeared(ig,islope)= .true.793 if (is_co2ice_ini(ig,islope) .and. co2_ice(ig,islope) < 1.e-10 .and. .not. co2ice_disappeared(ig,islope)) then ! co2 ice disappeared, look for closest point without co2ice 794 co2ice_disappeared = .true. 796 795 if (latitude_deg(ig) > 0) then 797 796 do ig_loop = ig,ngrid 798 797 do islope_loop = islope,iflat,-1 799 if ( co2_ice_ini(ig_loop,islope_loop) < 1.e-10.and. co2_ice(ig_loop,islope_loop) < 1.e-10) then798 if (.not. is_co2ice_ini(ig_loop,islope_loop) .and. co2_ice(ig_loop,islope_loop) < 1.e-10) then 800 799 tsurf_ave(ig,islope) = tsurf_ave(ig_loop,islope_loop) 801 800 bool_sublim = .true. … … 808 807 do ig_loop = ig,1,-1 809 808 do islope_loop = islope,iflat 810 if ( co2_ice_ini(ig_loop,islope_loop) < 1.e-10.and. co2_ice(ig_loop,islope_loop) < 1.e-10) then809 if (.not. is_co2ice_ini(ig_loop,islope_loop) .and. co2_ice(ig_loop,islope_loop) < 1.e-10) then 811 810 tsurf_ave(ig,islope) = tsurf_ave(ig_loop,islope_loop) 812 811 bool_sublim = .true. … … 817 816 enddo 818 817 endif 818 is_co2ice_ini(ig,islope) = .false. 819 819 if ((co2_ice(ig,islope) < 1.e-10) .and. (h2o_ice(ig,islope) > frost_albedo_threshold)) then 820 820 albedo(ig,1,islope) = albedo_h2o_frost … … 1159 1159 deallocate(tsoil_phys_PEM_timeseries,watersoil_density_PEM_timeseries,watersoil_density_PEM_ave) 1160 1160 deallocate(delta_co2_adsorbded,delta_h2o_adsorbded,vmr_co2_PEM_phys,delta_h2o_icetablesublim,porefillingice_thickness_prev_iter) 1161 deallocate( co2_ice_ini,ini_co2ice_sublim,ini_h2oice_sublim,stratif)1161 deallocate(is_co2ice_ini,co2ice_disappeared,ini_co2ice_sublim,ini_h2oice_sublim,stratif) 1162 1162 !----------------------------- END OUTPUT ------------------------------ 1163 1163
Note: See TracChangeset
for help on using the changeset viewer.