Changeset 3779 for trunk/LMDZ.COMMON/libf
- Timestamp:
- May 26, 2025, 4:21:44 PM (4 weeks ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/LMDZ.COMMON/libf/evolution/changelog.txt ¶
r3778 r3779 670 670 - 'deposits' is renamed as 'layerings_map' 671 671 - Few cleanings 672 673 == 26/05/2025 == JBC 674 Information about checking of CO2 mass balance. -
TabularUnified trunk/LMDZ.COMMON/libf/evolution/pem.F90 ¶
r3778 r3779 88 88 use planete_h, only: aphelie, periheli, year_day, peri_day, obliquit, iniorbit 89 89 use surfini_mod, only: surfini 90 use comconst_mod, only: pi, rad, g, cpp, kappa91 90 use comcstfi_h, only: mugaz 92 91 #else … … 97 96 use aerosol_mod, only: iniaerosol 98 97 use planete_mod, only: apoastr, periastr, year_day, peri_day, obliquit 99 use comcstfi_mod, only: pi, rad, g, mugaz, r98 use comcstfi_mod, only: pi, rad, g, r, cpp, rcp, mugaz 100 99 #endif 101 100 102 101 #ifndef CPP_1D 103 use comconst_mod, only: r102 use comconst_mod, only: pi, rad, g, r, cpp, rcp => kappa 104 103 use iniphysiq_mod, only: iniphysiq 105 104 use control_mod, only: iphysiq, day_step, nsplit_phys 106 105 #else 107 use comcstfi_h, only: r106 use comcstfi_h, only: pi, rad, g, r, cpp, rcp 108 107 use time_phylmdz_mod, only: iphysiq, steps_per_sol 109 108 use regular_lonlat_mod, only: init_regular_lonlat … … 194 193 real, dimension(:,:), allocatable :: vmr_co2_PEM_phys ! Grid points x Times co2 volume mixing ratio used in the PEM 195 194 real, dimension(:,:), allocatable :: q_co2_PEM_phys ! Grid points x Times co2 mass mixing ratio in the first layer computed in the PEM, first value comes from PCM [kg/kg] 195 real(kind = 16) :: totmass_co2ice, totmass_atmco2 ! Current total CO2 masses 196 real(kind = 16) :: totmass_co2ice_ini, totmass_atmco2_ini ! Initial total CO2 masses 196 197 197 198 ! Variables for the evolution of layered layerings_map … … 207 208 208 209 ! Variables for surface and soil 209 real, dimension(:,:), allocatable :: tsurf_avg ! Grid points x Slope field: Average surface temperature [K]210 real, dimension(:,:), allocatable :: tsurf_dev ! Grid points x Slope field: Surface temperature deviation [K]211 real, dimension(:,:), allocatable :: tsurf_avg_yr1 ! Grid points x Slope field: Average surface temperature of first call of the PCM [K]212 real, dimension(:,:,:), allocatable :: tsoil_avg ! Grid points x Soil x Slope field: Average Soil Temperature [K]213 real, dimension(:,:), allocatable :: tsoil_avg_old ! Grid points x Soil field: Average Soil Temperature at the previous time step [K]214 real, dimension(:,:,:), allocatable :: tsoil_dev ! Grid points x Soil x Slope field: Soil temperature deviation [K]215 real, dimension(:,:,:,:), allocatable :: tsoil_timeseries ! Grid points x Soil x Slope x Times field: Soil temperature timeseries [K]216 real, dimension(:,:,:,:), allocatable :: tsoil_PEM_timeseries ! Grid points x Soil x Slope x Times field: Soil temperature timeseries for PEM [K]217 real, dimension(:,:,:,:), allocatable :: tsoil_PEM_timeseries_old ! Grid points x Soil x Slope x Times field: Soil temperature timeseries for PEM at the previous time step [K]218 real, dimension(:,:,:,:), allocatable :: watersoil_density_timeseries ! Grid points x Soil x Slope x Times Water soil density timeseries [kg /m^3]219 real, dimension(:,:), allocatable :: watersurf_density_avg ! Grid points x Slope: Average water surface density [kg/m^3]220 real, dimension(:,:,:,:), allocatable :: watersoil_density_PEM_timeseries ! Grid points x Soil x Slope x Times: Water soil density timeseries for PEM [kg/m^3]221 real, dimension(:,:,:), allocatable :: watersoil_density_PEM_avg ! Grid points x Soil x Slopes: Average water soil density [kg/m^3]222 real, dimension(:), allocatable :: delta_co2_adsorbed ! Physics: quantity of CO2 that is exchanged because of adsorption / desorption [kg/m^2]223 real, dimension(:), allocatable :: delta_h2o_adsorbed ! Physics: quantity of H2O that is exchanged because of adsorption / desorption [kg/m^2]224 real :: totmassco2_adsorbed! Total mass of CO2 that is exchanged because of adsorption / desoprtion over the planets [kg]225 real :: totmass h2o_adsorbed! Total mass of H2O that is exchanged because of adsorption / desoprtion over the planets [kg]226 logical, dimension(:,:), allocatable :: co2ice_disappeared ! logical to check if a co2 ice reservoir already disappeared at a previous timestep227 real, dimension(:,:), allocatable :: icetable_thickness_old ! ngrid x nslope: Thickness of the ice table at the previous iteration [m]228 real, dimension(:,:,:), allocatable :: ice_porefilling_old ! ngrid x nslope: Ice pore filling at the previous iteration [m]229 real, dimension(:), allocatable :: delta_h2o_icetablesublim ! ngrid x Total mass of the H2O that has sublimated / condenses from the ice table [kg]230 real, dimension(:), allocatable :: porefill ! Pore filling (output) to compute the dynamic ice table231 real :: ssi_depth ! Ice table depth (output) to compute the dynamic ice table232 real, dimension(:,:), allocatable :: zshift_surf ! Elevation shift for the surface [m]233 real, dimension(:,:), allocatable :: zlag ! Newly built lag thickness [m]234 real, dimension(:,:), allocatable :: icetable_depth_old ! Old depth of the ice table210 real, dimension(:,:), allocatable :: tsurf_avg ! Grid points x Slope field: Average surface temperature [K] 211 real, dimension(:,:), allocatable :: tsurf_dev ! Grid points x Slope field: Surface temperature deviation [K] 212 real, dimension(:,:), allocatable :: tsurf_avg_yr1 ! Grid points x Slope field: Average surface temperature of first call of the PCM [K] 213 real, dimension(:,:,:), allocatable :: tsoil_avg ! Grid points x Soil x Slope field: Average Soil Temperature [K] 214 real, dimension(:,:), allocatable :: tsoil_avg_old ! Grid points x Soil field: Average Soil Temperature at the previous time step [K] 215 real, dimension(:,:,:), allocatable :: tsoil_dev ! Grid points x Soil x Slope field: Soil temperature deviation [K] 216 real, dimension(:,:,:,:), allocatable :: tsoil_timeseries ! Grid points x Soil x Slope x Times field: Soil temperature timeseries [K] 217 real, dimension(:,:,:,:), allocatable :: tsoil_PEM_timeseries ! Grid points x Soil x Slope x Times field: Soil temperature timeseries for PEM [K] 218 real, dimension(:,:,:,:), allocatable :: tsoil_PEM_timeseries_old ! Grid points x Soil x Slope x Times field: Soil temperature timeseries for PEM at the previous time step [K] 219 real, dimension(:,:,:,:), allocatable :: watersoil_density_timeseries ! Grid points x Soil x Slope x Times Water soil density timeseries [kg /m^3] 220 real, dimension(:,:), allocatable :: watersurf_density_avg ! Grid points x Slope: Average water surface density [kg/m^3] 221 real, dimension(:,:,:,:), allocatable :: watersoil_density_PEM_timeseries ! Grid points x Soil x Slope x Times: Water soil density timeseries for PEM [kg/m^3] 222 real, dimension(:,:,:), allocatable :: watersoil_density_PEM_avg ! Grid points x Soil x Slopes: Average water soil density [kg/m^3] 223 real, dimension(:), allocatable :: delta_co2_adsorbed ! Physics: quantity of CO2 that is exchanged because of adsorption / desorption [kg/m^2] 224 real, dimension(:), allocatable :: delta_h2o_adsorbed ! Physics: quantity of H2O that is exchanged because of adsorption / desorption [kg/m^2] 225 real(kind = 16) :: totmass_adsco2, totmass_adsco2_ini ! Total mass of CO2 that is exchanged because of adsorption / desoprtion over the planets [kg] 226 real :: totmass_adsh2o ! Total mass of H2O that is exchanged because of adsorption / desoprtion over the planets [kg] 227 logical, dimension(:,:), allocatable :: co2ice_disappeared ! logical to check if a co2 ice reservoir already disappeared at a previous timestep 228 real, dimension(:,:), allocatable :: icetable_thickness_old ! ngrid x nslope: Thickness of the ice table at the previous iteration [m] 229 real, dimension(:,:,:), allocatable :: ice_porefilling_old ! ngrid x nslope: Ice pore filling at the previous iteration [m] 230 real, dimension(:), allocatable :: delta_h2o_icetablesublim ! ngrid x Total mass of the H2O that has sublimated / condenses from the ice table [kg] 231 real, dimension(:), allocatable :: porefill ! Pore filling (output) to compute the dynamic ice table 232 real :: ssi_depth ! Ice table depth (output) to compute the dynamic ice table 233 real, dimension(:,:), allocatable :: zshift_surf ! Elevation shift for the surface [m] 234 real, dimension(:,:), allocatable :: zlag ! Newly built lag thickness [m] 235 real, dimension(:,:), allocatable :: icetable_depth_old ! Old depth of the ice table 235 236 236 237 ! Some variables for the PEM run … … 664 665 is_co2ice_ini = .false. 665 666 co2ice_disappeared = .false. 667 totmass_co2ice_ini = 0. 668 totmass_atmco2_ini = 0. 666 669 if (layering_algo) then 667 670 do ig = 1,ngrid … … 673 676 endif 674 677 do i = 1,ngrid 678 totmass_atmco2_ini = totmass_atmco2_ini + cell_area(i)*ps_avg(i)/g 675 679 do islope = 1,nslope 680 totmass_co2ice_ini = totmass_co2ice_ini + co2_ice(i,islope)*cell_area(i)*subslope_dist(i,islope)/cos(pi*def_slope_mean(islope)/180.) 676 681 if (co2_ice(i,islope) > 0.) is_co2ice_ini(i,islope) = .true. 677 682 if (d_co2ice(i,islope) < 0. .and. co2_ice(i,islope) > 0.) then … … 693 698 end where 694 699 700 totmass_adsco2_ini = 0. 701 totmass_adsh2o = 0. 695 702 if (adsorption_pem) then 696 totmassco2_adsorbed = 0.697 totmassh2o_adsorbed = 0.698 703 do ig = 1,ngrid 699 704 do islope = 1,nslope 700 705 do l = 1,nsoilmx_PEM - 1 701 706 if (l == 1) then 702 totmass co2_adsorbed = totmassco2_adsorbed+ co2_adsorbed_phys(ig,l,islope)*(layer_PEM(l))* &707 totmass_adsco2_ini = totmass_adsco2_ini + co2_adsorbed_phys(ig,l,islope)*(layer_PEM(l))* & 703 708 subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)*cell_area(ig) 704 totmass h2o_adsorbed = totmassh2o_adsorbed+ h2o_adsorbed_phys(ig,l,islope)*(layer_PEM(l))* &709 totmass_adsh2o = totmass_adsh2o + h2o_adsorbed_phys(ig,l,islope)*(layer_PEM(l))* & 705 710 subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)*cell_area(ig) 706 711 else 707 totmass co2_adsorbed = totmassco2_adsorbed+ co2_adsorbed_phys(ig,l,islope)*(layer_PEM(l) - layer_PEM(l-1))* &712 totmass_adsco2_ini = totmass_adsco2_ini + co2_adsorbed_phys(ig,l,islope)*(layer_PEM(l) - layer_PEM(l-1))* & 708 713 subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)*cell_area(ig) 709 totmass h2o_adsorbed = totmassh2o_adsorbed+ h2o_adsorbed_phys(ig,l,islope)*(layer_PEM(l) - layer_PEM(l-1))* &714 totmass_adsh2o = totmass_adsh2o + h2o_adsorbed_phys(ig,l,islope)*(layer_PEM(l) - layer_PEM(l-1))* & 710 715 subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)*cell_area(ig) 711 716 endif … … 713 718 enddo 714 719 enddo 715 write(*,*) "Tot mass of CO2 in the regolith =", totmassco2_adsorbed 716 write(*,*) "Tot mass of H2O in the regolith =", totmassh2o_adsorbed 720 totmass_adsco2 = totmass_adsco2_ini 721 write(*,*) "Tot mass of CO2 in the regolith =", totmass_adsco2 722 write(*,*) "Tot mass of H2O in the regolith =", totmass_adsh2o 717 723 endif ! adsorption 718 724 … … 967 973 968 974 ! II_d.6 Update the mass of the regolith adsorbed 975 totmass_adsco2 = 0. 976 totmass_adsh2o = 0. 969 977 if (adsorption_pem) then 970 978 call regolith_adsorption(ngrid,nslope,nsoilmx_PEM,timelen,d_h2oice,d_co2ice,h2o_ice,co2_ice, & 971 979 tsoil_PEM,TI_PEM,ps_timeseries,q_co2_PEM_phys,q_h2o_PEM_phys, & 972 980 h2o_adsorbed_phys,delta_h2o_adsorbed,co2_adsorbed_phys,delta_co2_adsorbed) 973 974 totmassco2_adsorbed = 0.975 totmassh2o_adsorbed = 0.976 981 do ig = 1,ngrid 977 982 do islope = 1,nslope 978 983 do l = 1,nsoilmx_PEM 979 984 if (l == 1) then 980 totmass co2_adsorbed = totmassco2_adsorbed+ co2_adsorbed_phys(ig,l,islope)*(layer_PEM(l))* &985 totmass_adsco2 = totmass_adsco2 + co2_adsorbed_phys(ig,l,islope)*(layer_PEM(l))* & 981 986 subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)*cell_area(ig) 982 totmass h2o_adsorbed = totmassh2o_adsorbed+ h2o_adsorbed_phys(ig,l,islope)*(layer_PEM(l))* &987 totmass_adsh2o = totmass_adsh2o + h2o_adsorbed_phys(ig,l,islope)*(layer_PEM(l))* & 983 988 subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)*cell_area(ig) 984 989 else 985 totmass co2_adsorbed = totmassco2_adsorbed+ co2_adsorbed_phys(ig,l,islope)*(layer_PEM(l) - layer_PEM(l - 1))* &990 totmass_adsco2 = totmass_adsco2 + co2_adsorbed_phys(ig,l,islope)*(layer_PEM(l) - layer_PEM(l - 1))* & 986 991 subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)*cell_area(ig) 987 totmass h2o_adsorbed = totmassh2o_adsorbed+ h2o_adsorbed_phys(ig,l,islope)*(layer_PEM(l) - layer_PEM(l - 1))* &992 totmass_adsh2o = totmass_adsh2o + h2o_adsorbed_phys(ig,l,islope)*(layer_PEM(l) - layer_PEM(l - 1))* & 988 993 subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)*cell_area(ig) 989 994 endif … … 991 996 enddo 992 997 enddo 993 write(*,*) "Total mass of CO2 in the regolith =", totmass co2_adsorbed994 write(*,*) "Total mass of H2O in the regolith =", totmass h2o_adsorbed998 write(*,*) "Total mass of CO2 in the regolith =", totmass_adsco2 999 write(*,*) "Total mass of H2O in the regolith =", totmass_adsh2o 995 1000 endif 996 1001 endif !soil_pem … … 1029 1034 enddo 1030 1035 deallocate(flag_co2flow,flag_h2oflow) 1036 1037 ! Checking mass balance for CO2 1038 totmass_co2ice = 0. 1039 totmass_atmco2 = 0. 1040 do ig = 1,ngrid 1041 totmass_atmco2 = totmass_atmco2 + cell_area(ig)*ps_avg(ig)/g 1042 do islope = 1,nslope 1043 totmass_co2ice = totmass_co2ice + co2_ice(ig,islope)*cell_area(ig)*subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.) 1044 enddo 1045 enddo 1046 write(*,'(a,f8.3,a)') " > Relative total CO2 mass balance = ", 100.*(totmass_atmco2 + totmass_co2ice + totmass_adsco2 - totmass_atmco2_ini - totmass_co2ice_ini - totmass_adsco2_ini)/(totmass_atmco2_ini + totmass_co2ice_ini + totmass_adsco2_ini), ' %' 1047 if ((totmass_atmco2 + totmass_co2ice + totmass_adsco2 - totmass_atmco2_ini - totmass_co2ice_ini - totmass_adsco2_ini)/(totmass_atmco2_ini + totmass_co2ice_ini + totmass_adsco2_ini) > 0.01) then 1048 write(*,*) ' /!\ Warning: mass balance is not conseved!' 1049 write(*,'(a,f8.3,a)') ' Atmospheric CO2 mass balance = ', 100.*(totmass_atmco2 - totmass_atmco2_ini)/totmass_atmco2_ini, ' %' 1050 write(*,'(a,f8.3,a)') ' CO2 ice mass balance = ', 100.*(totmass_co2ice - totmass_co2ice_ini)/totmass_co2ice_ini, ' %' 1051 write(*,'(a,f8.3,a)') ' Adsorbed CO2 mass balance = ', 100.*(totmass_adsco2 - totmass_adsco2_ini)/totmass_adsco2_ini, ' %' 1052 endif 1031 1053 1032 1054 !------------------------ … … 1267 1289 call gr_fi_dyn(1,ngrid,iip1,jjp1,ps_start0/ps_start,pdyn) 1268 1290 do i = 1,ip1jmp1 1269 teta(i,:) = teta(i,:)*pdyn(i)** kappa1291 teta(i,:) = teta(i,:)*pdyn(i)**rcp 1270 1292 enddo 1271 1293 ! Correction on atmospheric pressure
Note: See TracChangeset
for help on using the changeset viewer.