Changeset 3983 for trunk/LMDZ.COMMON
- Timestamp:
- Dec 8, 2025, 11:27:43 AM (6 days ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 9 edited
-
changelog.txt (modified) (1 diff)
-
conf_pem.F90 (modified) (2 diffs)
-
deftank/run_PEM.def (modified) (1 diff)
-
glaciers_mod.F90 (modified) (2 diffs)
-
iostart_PEM.F90 (modified) (1 diff)
-
pem.F90 (modified) (9 diffs)
-
pemetat0.F90 (modified) (9 diffs)
-
pemredem.F90 (modified) (1 diff)
-
read_XIOS_data.F90 (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3981 r3983 812 812 - Removing the counting method where PCM years are taken into account. 813 813 - CO2 ice is now a PEM reservoir such as H2O ice. 814 815 == 08/12/2025 == JBC 816 - Removing completely the ice metamorphism computed by a threshold at the end of the PCM (which was commented). 817 - Addition of a module "metamorphism" to compute the PCM frost at the PEM beginning and give it back to the PCM at the PEM end. The frost is considered as the ice given by the PCM "startfi.nc" which is above the yearly minimum. Thereby, metamorphism is performed through this operation. 818 - Ice reservoirs representation in the PEM is modernized. -
trunk/LMDZ.COMMON/libf/evolution/conf_pem.F90
r3980 r3983 27 27 use comsoil_h_pem, only: soil_pem, fluxgeo, ini_huge_h2oice, depth_breccia, depth_bedrock, reg_thprop_dependp 28 28 use adsorption_mod, only: adsorption_pem 29 use glaciers_mod, only: h2oice_flow, co2ice_flow, inf_h2oice_threshold , metam_co2ice_threshold, metam_h2oice_threshold, metam_h2oice, metam_co2ice29 use glaciers_mod, only: h2oice_flow, co2ice_flow, inf_h2oice_threshold 30 30 use ice_table_mod, only: icetable_equilibrium, icetable_dynamic 31 31 use layering_mod, only: layering_algo, d_dust, impose_dust_ratio, dust2ice_ratio … … 166 166 call getin('inf_h2oice_threshold',inf_h2oice_threshold) 167 167 168 metam_h2oice = .false.169 call getin('metam_h2oice',metam_h2oice)170 171 metam_h2oice_threshold = 460. ! kg.m-2 (= 0.5 m)172 call getin('metam_h2oice_threshold',metam_h2oice_threshold)173 174 168 h2oice_flow = .true. 175 169 call getin('h2oice_flow',h2oice_flow) 176 177 metam_co2ice = .false.178 call getin('metam_co2ice',metam_co2ice)179 180 metam_co2ice_threshold = 16500. ! kg.m-2 (= 10 m)181 call getin('metam_co2ice_threshold',metam_co2ice_threshold)182 170 183 171 co2ice_flow = .true. -
trunk/LMDZ.COMMON/libf/evolution/deftank/run_PEM.def
r3926 r3983 83 83 # inf_h2oice_threshold=460. 84 84 85 # Do you want H2O frost to transform into perennial H2O ice? Default = .false.86 # metam_h2oice=.false.87 88 # Threshold to consider frost is becoming perennial H2O ice. Default = 460. kg.m-2 (= 0.5 m)89 # metam_h2oice_threshold=460.90 91 85 # Do you want the H2O ice to flow along subslope inside a cell? Default = .true. 92 86 # h2oice_flow=.true. 93 94 # Do you want CO2 frost to transform into perennial CO2 ice? Default = .false.95 # metam_co2ice=.false.96 97 # Threshold to consider frost is becoming perennial CO2 ice. Default = 16500. kg.m-2 (= 10 m)98 # metam_co2ice_threshold=16500.99 87 100 88 # Do you want the CO2 ice to flow along subslope inside a cell? Default = .true. -
trunk/LMDZ.COMMON/libf/evolution/glaciers_mod.F90
r3961 r3983 3 3 implicit none 4 4 5 ! Flags for ice management 5 ! Different types of ice 6 type :: ice 7 real :: h2o 8 real :: co2 9 end type ice 10 11 ! Perennial ice manage by the PEM 12 type(ice), dimension(:,:), allocatable :: perice 13 14 ! Flags for ice flow 6 15 logical :: h2oice_flow ! True by default, to compute H2O ice flow. Read in "run_PEM.def" 7 16 logical :: co2ice_flow ! True by default, to compute CO2 ice flow. Read in "run_PEM.def" 8 logical :: metam_h2oice ! False by default, to compute H2O ice metamorphism. Read in "run_PEM.def" 9 logical :: metam_co2ice ! False by default, to compute CO2 ice metamorphism. Read in "run_PEM.def" 10 11 ! Thresholds for ice management 17 18 ! Threshold to consider H2O ice as watercap 12 19 real :: inf_h2oice_threshold ! To consider the amount of H2O ice as an infinite reservoir [kg.m-2] 13 real :: metam_h2oice_threshold ! To consider frost is becoming perennial H2O ice [kg.m-2] 14 real :: metam_co2ice_threshold ! To consider frost is becoming perennial CO2 ice [kg.m-2] 15 20 21 ! Ice properties 16 22 real, parameter :: rho_co2ice = 1650. ! Density of CO2 ice [kg.m-3] 17 23 real, parameter :: rho_h2oice = 920. ! Density of H2O ice [kg.m-3] … … 19 25 !======================================================================= 20 26 contains 27 !======================================================================= 28 29 SUBROUTINE set_perice4PCM(ngrid,nslope,PCMfrost,is_perh2oice,PCMh2oice,PCMco2ice) 30 31 use metamorphism, only: iPCM_h2ofrost 32 use comslope_mod, only: subslope_dist, def_slope_mean 33 #ifndef CPP_1D 34 use comconst_mod, only: pi 35 #else 36 use comcstfi_h, only: pi 37 #endif 38 39 implicit none 40 41 ! Arguments 42 !---------- 43 integer, intent(in) :: ngrid, nslope 44 real, dimension(:,:,:), intent(inout) :: PCMfrost 45 logical, dimension(ngrid), intent(out) :: is_perh2oice 46 real, dimension(ngrid,nslope), intent(out) :: PCMco2ice, PCMh2oice 47 48 ! Local variables 49 !---------------- 50 integer :: i 51 52 ! Code 53 !----- 54 write(*,*) '> Reconstructing perennial ic for the PCM' 55 PCMco2ice(:,:) = perice(:,:)%co2 56 PCMh2oice(:,:) = 0. ! Because in the Mars PCM, only the variation of perennial H2O ice is monitored, not the absolute quantity 57 do i = 1,ngrid 58 ! Is H2O ice still considered as an infinite reservoir for the PCM? 59 if (sum(perice(i,:)%h2o*subslope_dist(i,:)/cos(pi*def_slope_mean(:)/180.)) > inf_h2oice_threshold) then 60 ! There is enough ice to be considered as an infinite reservoir 61 is_perh2oice(i) = .true. 62 else 63 ! Too little ice to be considered as an infinite reservoir so ice is transferred to the frost 64 is_perh2oice(i) = .false. 65 PCMfrost(i,iPCM_h2ofrost,:) = PCMfrost(i,iPCM_h2ofrost,:) + perice(i,:)%h2o 66 perice(i,:)%h2o = 0. 67 endif 68 enddo 69 70 END SUBROUTINE set_perice4PCM 71 !======================================================================= 72 73 SUBROUTINE ini_ice(ngrid,nslope) 74 75 implicit none 76 77 ! Arguments 78 !---------- 79 integer, intent(in) :: ngrid, nslope 80 81 ! Local variables 82 !---------------- 83 84 ! Code 85 !----- 86 if (.not. allocated(perice)) allocate(perice(ngrid,nslope)) 87 88 END SUBROUTINE ini_ice 89 !======================================================================= 90 91 SUBROUTINE end_ice() 92 93 implicit none 94 95 ! Arguments 96 !---------- 97 98 ! Local variables 99 !---------------- 100 101 ! Code 102 !----- 103 if (allocated(perice)) deallocate(perice) 104 105 END SUBROUTINE end_ice 106 21 107 !======================================================================= 22 108 -
trunk/LMDZ.COMMON/libf/evolution/iostart_PEM.F90
r3961 r3983 667 667 USE comsoil_h_PEM, only: nsoilmx_PEM 668 668 USE comslope_mod, ONLY: nslope 669 use layering_mod, only: nb_str_max670 669 USE mod_grid_phy_lmdz 671 670 USE mod_phys_lmdz_para -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3979 r3983 38 38 use conf_pem_mod, only: conf_pem 39 39 use pemredem, only: pemdem0, pemdem1 40 use glaciers_mod, only: flow_co2glaciers, flow_h2oglaciers, co2ice_flow, h2oice_flow, inf_h2oice_threshold, & 41 metam_h2oice_threshold, metam_co2ice_threshold, metam_h2oice, metam_co2ice, computeTcondCO2 40 use glaciers_mod, only: flow_co2glaciers, flow_h2oglaciers, co2ice_flow, h2oice_flow, inf_h2oice_threshold, computeTcondCO2, set_perice4PCM 42 41 use stopping_crit_mod, only: stopping_crit_h2o_ice, stopping_crit_co2, stopping_crit_h2o, stopFlags 43 42 use constants_marspem_mod, only: alpha_clap_co2, beta_clap_co2, alpha_clap_h2o, beta_clap_h2o, m_co2, m_noco2 … … 83 82 use dimradmars_mod, only: totcloudfrac, albedo 84 83 use dust_param_mod, only: tauscaling 85 use tracer_mod, only: noms, igcm_h2o_ice, igcm_co2,mmol, igcm_h2o_vap ! Tracer names and molar masses84 use tracer_mod, only: noms, mmol, igcm_h2o_vap ! Tracer names and molar masses 86 85 use mod_phys_lmdz_para, only: is_parallel, is_sequential, is_mpi_root, is_omp_root, is_master 87 86 use planete_h, only: year_day 88 87 use surfini_mod, only: surfini 89 88 use comcstfi_h, only: mugaz 89 use metamorphism, only: ini_frost_id, set_frost4PCM, iPCM_h2ofrost, iPCM_co2frost 90 90 91 91 #ifndef CPP_1D … … 161 161 real :: ps_avg_global_old ! constant: Global average pressure of previous time step 162 162 real :: ps_avg_global_new ! constant: Global average pressure of current time step 163 real, dimension(:,:),allocatable :: zplev_new ! Grid points x Atmospheric field: mass of the atmospheric layers in the pem at current time step [kg/m^2]164 real, dimension(:,:),allocatable :: zplev_start0 ! Grid points x Atmospheric field: mass of the atmospheric layers in the start [kg/m^2]165 real, dimension(:,:,:),allocatable :: zplev_timeseries_new ! Grid points x Atmospheric x Time: same as zplev_new, but in times series [kg/m ^2]166 real, dimension(:,:,:),allocatable :: zplev_timeseries_old ! same but with the time series, for previous time step163 real, dimension(:,:), allocatable :: zplev_new ! Grid points x Atmospheric field: mass of the atmospheric layers in the pem at current time step [kg/m^2] 164 real, dimension(:,:), allocatable :: zplev_start0 ! Grid points x Atmospheric field: mass of the atmospheric layers in the start [kg/m^2] 165 real, dimension(:,:,:), allocatable :: zplev_timeseries_new ! Grid points x Atmospheric x Time: same as zplev_new, but in times series [kg/m ^2] 166 real, dimension(:,:,:), allocatable :: zplev_timeseries_old ! same but with the time series, for previous time step 167 167 type(stopFlags) :: stopCrit ! Stopping criteria 168 168 real :: A, B, mmean ! Molar mass: intermediate A, B for computations of the mean molar mass of the layer [mol/kg] 169 real, dimension(:,:),allocatable :: q_h2o_PEM_phys ! Grid points x Times: h2o mass mixing ratio computed in the PEM, first value comes from PCM [kg/kg]169 real, dimension(:,:), allocatable :: q_h2o_PEM_phys ! Grid points x Times: h2o mass mixing ratio computed in the PEM, first value comes from PCM [kg/kg] 170 170 integer :: timelen ! # time samples 171 171 real :: extra_mass ! Intermediate variables Extra mass of a tracer if it is greater than 1 172 real, dimension(:,:), allocatable :: d_h2oice_new ! Adjusted tendencies to keep balance between donor and recipient 172 real, dimension(:,:), allocatable :: d_h2oice_new ! Adjusted tendencies to keep balance between donor and recipient 173 real, dimension(:,:), allocatable :: min_h2oice ! Yearly minimum of H2O ice for the last year of the PCM 173 174 real :: S_atm_2_h2o, S_h2o_2_atm, S_atm_2_h2oice, S_h2oice_2_atm ! Variables to balance H2O 174 175 … … 183 184 real, dimension(:,:), allocatable :: vmr_co2_PEM_phys ! Grid points x Times co2 volume mixing ratio used in the PEM 184 185 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] 186 real, dimension(:,:), allocatable :: min_co2ice ! Yearly minimum of CO2 ice for the last year of the PCM 185 187 real(kind = 16) :: totmass_co2ice, totmass_atmco2 ! Current total CO2 masses 186 188 real(kind = 16) :: totmass_co2ice_ini, totmass_atmco2_ini ! Initial total CO2 masses … … 413 415 414 416 call surfini(ngrid,nslope,qsurf) 415 416 do nnq = 1,nqtot ! Why not using ini_tracer? 417 if (noms(nnq) == "h2o_ice") igcm_h2o_ice = nnq 417 call ini_frost_id(nqtot,noms) 418 do nnq = 1,nqtot 418 419 if (noms(nnq) == "h2o_vap") then 419 420 igcm_h2o_vap = nnq 420 421 mmol(igcm_h2o_vap) = 18. 421 422 endif 422 if (noms(nnq) == "co2") igcm_co2 = nnq423 423 enddo 424 424 … … 448 448 allocate(watersurf_density_avg(ngrid,nslope),watersoil_density_timeseries(ngrid,nsoilmx,nslope,timelen)) 449 449 allocate(d_co2ice(ngrid,nslope),d_h2oice(ngrid,nslope),d_co2ice_ini(ngrid,nslope)) 450 451 call read_PCM_data(ngrid,nslope,nsoilmx,timelen,ps_avg,tsurf_avg,tsurf_avg_yr1,tsoil_avg,tsoil_timeseries,watersurf_density_avg,d_h2oice,d_co2ice,ps_timeseries,q_h2o_PEM_phys,q_co2_PEM_phys,watersoil_density_timeseries) 450 allocate(min_co2ice(ngrid,nslope),min_h2oice(ngrid,nslope)) 451 452 call read_PCM_data(ngrid,nslope,nsoilmx,timelen,qsurf(:,iPCM_h2ofrost,:),qsurf(:,iPCM_co2frost,:),ps_avg,tsurf_avg,tsurf_avg_yr1,tsoil_avg,tsoil_timeseries,watersurf_density_avg, & 453 d_h2oice,d_co2ice,ps_timeseries,q_h2o_PEM_phys,q_co2_PEM_phys,watersoil_density_timeseries,min_h2oice,min_co2ice) 454 452 455 vmr_co2_PCM = q_co2_PEM_phys/(A*q_co2_PEM_phys + B)/m_co2 453 456 d_co2ice_ini = d_co2ice … … 947 950 write(*,*) '********* PEM finalization *********' 948 951 ! III_a.1 Ice update for start file 949 write(*,*) '> Reconstructing perennial ice and frost for the PCM' 950 watercap = 0. 951 perennial_co2ice = co2_ice 952 do ig = 1,ngrid 953 ! H2O ice metamorphism 954 !if (metam_h2oice .and. sum(qsurf(ig,igcm_h2o_ice,:)*subslope_dist(ig,:)/cos(pi*def_slope_mean(:)/180.)) > metam_h2oice_threshold) then 955 ! h2o_ice(ig,:) = h2o_ice(ig,:) + qsurf(ig,igcm_h2o_ice,:) - metam_h2oice_threshold 956 ! qsurf(ig,igcm_h2o_ice,:) = metam_h2oice_threshold 957 !endif 958 959 ! Is H2O ice still considered as an infinite reservoir for the PCM? 960 if (sum(h2o_ice(ig,:)*subslope_dist(ig,:)/cos(pi*def_slope_mean(:)/180.)) > inf_h2oice_threshold) then 961 ! There is enough ice to be considered as an infinite reservoir 962 watercaptag(ig) = .true. 963 else 964 ! Too little ice to be considered as an infinite reservoir so ice is transferred to the frost 965 watercaptag(ig) = .false. 966 qsurf(ig,igcm_h2o_ice,:) = qsurf(ig,igcm_h2o_ice,:) + h2o_ice(ig,:) 967 h2o_ice(ig,:) = 0. 968 endif 969 970 ! CO2 ice metamorphism 971 !if (metam_co2ice .and. sum(qsurf(ig,igcm_co2,:)*subslope_dist(ig,:)/cos(pi*def_slope_mean(:)/180.)) > metam_co2ice_threshold) then 972 ! perennial_co2ice(ig,:) = perennial_co2ice(ig,:) + qsurf(ig,igcm_co2,:) - metam_co2ice_threshold 973 ! qsurf(ig,igcm_co2,:) = metam_co2ice_threshold 974 !endif 975 enddo 952 call set_frost4PCM(qsurf) 953 call set_perice4PCM(ngrid,nslope,qsurf,watercaptag,watercap,perennial_co2ice) 976 954 977 955 ! III.a.3. Tsurf update for start file … … 1069 1047 endif 1070 1048 ! H2O frost 1071 if (qsurf(ig,i gcm_h2o_ice,islope) > 0.) then1049 if (qsurf(ig,iPCM_h2ofrost,islope) > 0.) then 1072 1050 albedo(ig,:,islope) = albedo_h2o_frost 1073 1051 emis(ig,islope) = 1. 1074 1052 endif 1075 1053 ! CO2 frost 1076 if (qsurf(ig,i gcm_co2,islope) > 0.) then1054 if (qsurf(ig,iPCM_co2frost,islope) > 0.) then 1077 1055 albedo(ig,:,islope) = albedice(icap) 1078 1056 emis(ig,islope) = emisice(icap) … … 1134 1112 call pemdem0("restartpem.nc",longitude,latitude,cell_area,ngrid,nslope,def_slope,subslope_dist) 1135 1113 call pemdem1("restartpem.nc",i_myear,nsoilmx_PEM,ngrid,nslope,tsoil_PEM,TI_PEM,icetable_depth,icetable_thickness,ice_porefilling, & 1136 co2_adsorbed_phys,h2o_adsorbed_phys,h2o_ice, layerings_map)1114 co2_adsorbed_phys,h2o_adsorbed_phys,h2o_ice,co2_ice,layerings_map) 1137 1115 1138 1116 call info_PEM(i_myear_leg,stopCrit%stop_code(),i_myear,n_myear) -
trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90
r3981 r3983 25 25 use glaciers_mod, only: rho_co2ice, rho_h2oice 26 26 use comcstfi_h, only: r, mugaz, pi 27 use surfdat_h, only: watercaptag, perennial_co2ice 27 use surfdat_h, only: watercaptag, perennial_co2ice, qsurf 28 use metamorphism, only: frost4PCM, iPCM_h2ofrost, iPCM_co2frost 28 29 29 30 implicit none … … 80 81 !!! 4. Mass of CO2 & H2O adsorbed 81 82 !!! 82 !!! /!\ This order must be respected !83 !!! /!\ This order must be respected! 83 84 !!! Author: LL 84 85 !!! … … 102 103 103 104 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 104 ! h2oice105 h2o_ice = 0.105 ! H2O ice 106 h2o_ice(:,:) = 0. 106 107 call get_field("h2o_ice",h2o_ice,found) 107 108 if (.not. found) then … … 110 111 write(*,*)'with default value ''ini_huge_h2oice''' 111 112 do ig = 1,ngrid 112 if (watercaptag(ig)) h2o_ice(ig,:) = ini_huge_h2oice 113 if (watercaptag(ig)) h2o_ice(ig,:) = ini_huge_h2oice + qsurf(ig,iPCM_h2ofrost,:) - frost4PCM(ig,:)%h2o 113 114 enddo 114 115 endif 115 116 116 ! co2 ice117 co2_ice = 0.117 ! CO2 ice 118 co2_ice(:,:) = 0. 118 119 call get_field("co2_ice",co2_ice,found) 119 120 if (.not. found) then 120 121 write(*,*)'Pemetat0: failed loading <co2_ice>' 121 122 write(*,*)'will reconstruct the values from perennial_co2ice' 122 co2_ice = perennial_co2ice123 co2_ice(:,:) = perennial_co2ice(:,:) + qsurf(:,iPCM_co2frost,:) - frost4PCM(:,:)%co2 123 124 endif 124 125 … … 208 209 delta = depth_breccia 209 210 TI_PEM(ig,index_breccia + 1,islope) = sqrt((layer_PEM(index_breccia + 1) - layer_PEM(index_breccia))/ & 210 (((delta - layer_PEM(index_breccia))/(TI_PEM(ig,index_breccia,islope)**2)) + &211 ((layer_PEM(index_breccia + 1) - delta)/(TI_breccia**2))))212 do iloop =index_breccia + 2,index_bedrock211 (((delta - layer_PEM(index_breccia))/(TI_PEM(ig,index_breccia,islope)**2)) + & 212 ((layer_PEM(index_breccia + 1) - delta)/(TI_breccia**2)))) 213 do iloop = index_breccia + 2,index_bedrock 213 214 TI_PEM(ig,iloop,islope) = TI_breccia 214 215 enddo … … 246 247 do ig = 1,ngrid 247 248 if (inertiedat_PEM(ig,index_breccia) < TI_breccia) then 248 inertiedat_PEM(ig,index_breccia + 1) = sqrt((layer_PEM(index_breccia +1)-layer_PEM(index_breccia))/ &249 (((delta-layer_PEM(index_breccia))/(inertiedat(ig,index_breccia)**2)) + &250 ((layer_PEM(index_breccia+1)-delta)/(TI_breccia**2))))249 inertiedat_PEM(ig,index_breccia + 1) = sqrt((layer_PEM(index_breccia + 1) - layer_PEM(index_breccia))/ & 250 (((delta - layer_PEM(index_breccia))/(inertiedat(ig,index_breccia)**2)) + & 251 ((layer_PEM(index_breccia + 1) - delta)/(TI_breccia**2)))) 251 252 252 253 do iloop = index_breccia + 2,index_bedrock … … 254 255 enddo 255 256 else 256 do iloop =index_breccia + 1,index_bedrock257 do iloop = index_breccia + 1,index_bedrock 257 258 inertiedat_PEM(ig,iloop) = inertiedat_PEM(ig,nsoil_PCM) 258 259 enddo … … 263 264 delta = depth_bedrock 264 265 do ig = 1,ngrid 265 inertiedat_PEM(ig,index_bedrock + 1) = sqrt((layer_PEM(index_bedrock +1)-layer_PEM(index_bedrock))/ &266 (((delta-layer_PEM(index_bedrock))/(inertiedat_PEM(ig,index_bedrock)**2))+ &267 ((layer_PEM(index_bedrock+1)-delta)/(TI_bedrock**2))))268 enddo 269 270 do iloop = index_bedrock + 2, nsoil_PEM266 inertiedat_PEM(ig,index_bedrock + 1) = sqrt((layer_PEM(index_bedrock + 1) - layer_PEM(index_bedrock))/ & 267 (((delta - layer_PEM(index_bedrock))/(inertiedat_PEM(ig,index_bedrock)**2))+ & 268 ((layer_PEM(index_bedrock + 1) - delta)/(TI_bedrock**2)))) 269 enddo 270 271 do iloop = index_bedrock + 2,nsoil_PEM 271 272 do ig = 1,ngrid 272 273 inertiedat_PEM(ig,iloop) = TI_bedrock … … 365 366 366 367 ! h2o ice 367 h2o_ice = 0.368 h2o_ice(:,:) = 0. 368 369 write(*,*)'So ''h2o_ice'' is initialized with default value ''ini_huge_h2oice'' where ''watercaptag'' is true.' 369 370 do ig = 1,ngrid 370 if (watercaptag(ig)) h2o_ice(ig,:) = ini_huge_h2oice 371 if (watercaptag(ig)) h2o_ice(ig,:) = ini_huge_h2oice + qsurf(ig,iPCM_h2ofrost,:) - frost4PCM(ig,:)%h2o 371 372 enddo 372 373 373 374 ! co2 ice 374 375 write(*,*)'So ''co2_ice'' is initialized with ''perennial_co2ice'' found in the PCM.' 375 co2_ice = perennial_co2ice376 co2_ice(:,:) = perennial_co2ice(:,:) + qsurf(:,iPCM_co2frost,:) - frost4PCM(:,:)%co2 376 377 377 378 ! Layerings -
trunk/LMDZ.COMMON/libf/evolution/pemredem.F90
r3981 r3983 58 58 59 59 SUBROUTINE pemdem1(filename,i_myear,nsoil_PEM,ngrid,nslope,tsoil_slope_PEM,inertiesoil_slope_PEM, & 60 icetable_depth,icetable_thickness,ice_porefilling,m_co2_regolith,m_h2o_regolith,h2o_ice, layerings_map)60 icetable_depth,icetable_thickness,ice_porefilling,m_co2_regolith,m_h2o_regolith,h2o_ice,co2_ice,layerings_map) 61 61 62 62 ! write time-dependent variable to restart file -
trunk/LMDZ.COMMON/libf/evolution/read_XIOS_data.F90
r3977 r3983 19 19 contains 20 20 !======================================================================= 21 SUBROUTINE read_PCM_data(ngrid,nslope,nsoil_PCM,nsol,ps_avg,tsurf_avg,tsurf_avg_y1,tsoil_avg,tsoil_ts,watersurf_density_avg,d_h2oice,d_co2ice, & 22 ps_ts,q_h2o_ts,q_co2_ts,watersoil_density_ts) 23 24 use compute_tend_mod, only: compute_tend 21 SUBROUTINE read_PCM_data(ngrid,nslope,nsoil_PCM,nsol,h2ofrost_PCM,co2frost_PCM,ps_avg,tsurf_avg,tsurf_avg_y1,tsoil_avg,tsoil_ts,watersurf_density_avg,d_h2oice,d_co2ice, & 22 ps_ts,q_h2o_ts,q_co2_ts,watersoil_density_ts,min_h2oice,min_co2ice) 23 25 24 use grid_conversion, only: lonlat2vect 26 25 use comsoil_h_PEM, only: soil_pem 26 use compute_tend_mod, only: compute_tend 27 use metamorphism, only: compute_frost 27 28 28 29 implicit none … … 30 31 ! Arguments 31 32 !---------- 32 integer, intent(in) :: ngrid, nslope, nsoil_PCM, nsol 33 integer, intent(in) :: ngrid, nslope, nsoil_PCM, nsol 34 real, dimension(ngrid,nslope), intent(in) :: h2ofrost_PCM, co2frost_PCM 33 35 real, dimension(ngrid), intent(out) :: ps_avg 34 real, dimension(ngrid,nslope), intent(out) :: tsurf_avg, tsurf_avg_y1, watersurf_density_avg, d_h2oice, d_co2ice 36 real, dimension(ngrid,nslope), intent(out) :: tsurf_avg, tsurf_avg_y1, watersurf_density_avg, d_h2oice, d_co2ice, min_h2oice, min_co2ice 35 37 real, dimension(ngrid,nsoil_PCM,nslope), intent(out) :: tsoil_avg 36 38 real, dimension(ngrid,nsol), intent(out) :: ps_ts, q_h2o_ts, q_co2_ts … … 44 46 real, dimension(:,:,:,:), allocatable :: var_read_4d 45 47 character(:), allocatable :: num ! For reading slope variables 46 real, dimension(ngrid,nslope,2) :: min_h2o ice, min_co2ice, min_h2ofrost, min_co2frost48 real, dimension(ngrid,nslope,2) :: min_h2operice, min_co2perice, min_h2ofrost, min_co2frost 47 49 48 50 ! Code 49 51 !----- 50 52 ! Initialization 51 min_h2o ice = 0.52 min_co2 ice = 0.53 min_h2operice = 0. 54 min_co2perice = 0. 53 55 min_h2ofrost = 0. 54 56 min_co2frost = 0. … … 80 82 call get_var('co2ice'//num,var_read_2d) ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_co2frost(:,islope,1)) 81 83 call get_var('h2o_ice_s'//num,var_read_2d) ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_h2ofrost(:,islope,1)) 82 call get_var('watercap'//num,var_read_2d) ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_h2o ice(:,islope,1))83 call get_var('perennial_co2ice'//num,var_read_2d); call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_co2 ice(:,islope,1))84 call get_var('watercap'//num,var_read_2d) ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_h2operice(:,islope,1)) 85 call get_var('perennial_co2ice'//num,var_read_2d); call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_co2perice(:,islope,1)) 84 86 call get_var('tsurf'//num,var_read_2d) ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,tsurf_avg_y1(:,islope)) 85 87 enddo … … 95 97 96 98 ! Allocate and read the variables 97 call get_var('ps',var_read_2d) ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,ps_avg)99 call get_var('ps',var_read_2d); call lonlat2vect(nlon,nlat,ngrid,var_read_2d,ps_avg) 98 100 do islope = 1,nslope 99 101 if (nslope /= 1) then … … 105 107 call get_var('co2ice'//num,var_read_2d) ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_co2frost(:,islope,2)) 106 108 call get_var('h2o_ice_s'//num,var_read_2d) ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_h2ofrost(:,islope,2)) 107 call get_var('watercap'//num,var_read_2d) ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_h2o ice(:,islope,2))108 call get_var('perennial_co2ice'//num,var_read_2d); call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_co2 ice(:,islope,2))109 call get_var('watercap'//num,var_read_2d) ; call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_h2operice(:,islope,2)) 110 call get_var('perennial_co2ice'//num,var_read_2d); call lonlat2vect(nlon,nlat,ngrid,var_read_2d,min_co2perice(:,islope,2)) 109 111 if (soil_pem) then 110 112 call get_var('soiltemp'//num,var_read_3d) … … 167 169 168 170 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 171 ! Compute frost from yearly minima 172 call compute_frost(ngrid,nslope,h2ofrost_PCM,min_h2ofrost,co2frost_PCM,min_co2frost) 173 174 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 169 175 ! Compute ice tendencies from yearly minima 170 176 write(*,*) '> Computing surface ice tendencies' 171 call compute_tend(ngrid,nslope,min_h2o frost + min_h2oice,d_h2oice)177 call compute_tend(ngrid,nslope,min_h2operice + min_h2ofrost,d_h2oice) 172 178 write(*,*) 'H2O ice tendencies (min/max):', minval(d_h2oice), maxval(d_h2oice) 173 call compute_tend(ngrid,nslope,min_co2 frost + min_co2ice,d_co2ice)179 call compute_tend(ngrid,nslope,min_co2perice + min_co2frost,d_co2ice) 174 180 write(*,*) 'CO2 ice tendencies (min/max):', minval(d_co2ice), maxval(d_co2ice) 175 181
Note: See TracChangeset
for help on using the changeset viewer.
