Changeset 3123 for trunk/LMDZ.COMMON
- Timestamp:
- Nov 11, 2023, 5:34:53 PM (13 months ago)
- Location:
- trunk/LMDZ.COMMON/libf/evolution
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/changelog.txt
r3122 r3123 133 133 == 10/11/2023 == JBC 134 134 Correction of the reading of the PCM data (it did not work if no slope was used) + some minor related cleanings. 135 136 == 11/11/2023 == LL 137 Adapting the PEM soil grid to the one of the PCM 138 Minor corrections when reading/initializing soil temperature, subsurface water ice -
trunk/LMDZ.COMMON/libf/evolution/comsoil_h_PEM.F90
r2980 r3123 2 2 3 3 implicit none 4 integer, parameter :: nsoilmx_PEM = 27! number of layers in the PEM4 integer, parameter :: nsoilmx_PEM = 68 ! number of layers in the PEM 5 5 real,save,allocatable,dimension(:) :: layer_PEM ! soil layer depths [m] 6 6 real,save,allocatable,dimension(:) :: mlayer_PEM ! soil mid-layer depths [m] -
trunk/LMDZ.COMMON/libf/evolution/pem.F90
r3122 r3123 1137 1137 co2_adsorbded_phys,h2o_adsorbded_phys,water_reservoir) 1138 1138 write(*,*) "restartpem.nc has been written" 1139 1140 1139 call info_PEM(year_iter,criterion_stop,i_myear,n_myear) 1141 1140 -
trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90
r3082 r3123 262 262 write(*,*)'PEM settings: failed loading <ice_table>' 263 263 write(*,*)'will reconstruct the values of the ice table given the current state' 264 ice_table(:,:) = -1 ! by default, no ice table 265 ice_table_thickness(:,:) = -1 ! by default, no ice table 264 266 call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_ave,watersoil_ave, TI_PEM(:,1,:),ice_table,ice_table_thickness) 265 267 call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,tend_h2oglaciers,waterice,global_ave_pressure,ice_table,ice_table_thickness,TI_PEM) … … 427 429 call soil_pem_ini(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_ave_yr2(:,islope),tsoil_PEM(:,:,islope)) 428 430 call soil_pem_compute(ngrid,nsoil_PEM,.true.,TI_PEM(:,:,islope),timestep,tsurf_ave_yr2(:,islope),tsoil_PEM(:,:,islope)) 429 430 431 do it = 1,timelen431 432 ! First raw initialization 433 do it = 1,timelen 432 434 do isoil = nsoil_GCM+1,nsoil_PEM 433 call soil_pem_ini(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_ave_yr2(:,islope),tsoil_inst(:,:,islope,it))435 tsoil_inst(:,isoil,islope,it) = tsoil_PEM(:,isoil,islope) 434 436 enddo 435 enddo 436 437 enddo 438 439 do it = 1,timelen 437 440 do isoil = nsoil_GCM+1,nsoil_PEM 438 do ig = 1,ngrid 439 watersoil_ave(ig,isoil,islope) = exp(beta_clap_h2o/tsoil_PEM(ig,isoil,islope) + alpha_clap_h2o)/tsoil_PEM(ig,isoil,islope)*mmol(igcm_h2o_vap)/(mugaz*r) 440 enddo 441 call soil_pem_ini(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_ave_yr2(:,islope),tsoil_inst(:,:,islope,it)) 441 442 enddo 443 enddo 444 445 do isoil = nsoil_GCM+1,nsoil_PEM 446 do ig = 1,ngrid 447 watersoil_ave(ig,isoil,islope) = exp(beta_clap_h2o/tsoil_PEM(ig,isoil,islope) + alpha_clap_h2o)/tsoil_PEM(ig,isoil,islope)*mmol(igcm_h2o_vap)/(mugaz*r) 448 enddo 449 enddo 442 450 enddo !islope 443 451 write(*,*) 'PEMETAT0: TSOIL done' … … 445 453 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 446 454 !c) Ice table 455 ice_table(:,:) = -1. ! by default, no ice table 456 ice_table_thickness(:,:) = -1. 447 457 call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_ave,watersoil_ave,TI_PEM(:,1,:),ice_table,ice_table_thickness) 448 458 call update_soil_thermalproperties(ngrid,nslope,nsoil_PEM,tend_h2oglaciers,waterice,global_ave_pressure,ice_table,ice_table_thickness,TI_PEM) -
trunk/LMDZ.COMMON/libf/evolution/read_data_PCM_mod.F90
r3122 r3123 64 64 integer :: islope ! loop for variables 65 65 character(2) :: num ! for reading sloped variables 66 real, dimension(iim_input + 1,jjm_input + 1,nslope,timelen) :: h2o_ice_s_dyn ! h2o ice per slope of the concatenated file [kg/m^2]66 real, dimension(iim_input + 1,jjm_input + 1,nslope,timelen) :: h2o_ice_s_dyn ! h2o ice per slope of the concatenated file [kg/m^2] 67 67 real, dimension(iim_input + 1,jjm_input + 1,nslope,timelen) :: watercap 68 real, dimension(iim_input + 1,jjm_input + 1,timelen) :: vmr_co2_gcm ! CO2 volume mixing ratio in the first layer [mol/m^3]69 real, dimension(iim_input + 1,jjm_input + 1,timelen) :: ps_GCM ! Surface Pressure [Pa]68 real, dimension(iim_input + 1,jjm_input + 1,timelen) :: vmr_co2_gcm ! CO2 volume mixing ratio in the first layer [mol/m^3] 69 real, dimension(iim_input + 1,jjm_input + 1,timelen) :: ps_GCM ! Surface Pressure [Pa] 70 70 real, dimension(iim_input + 1,jjm_input + 1,nslope) :: min_co2_ice_dyn 71 71 real, dimension(iim_input + 1,jjm_input + 1,nslope) :: min_h2o_ice_dyn 72 real, dimension(iim_input + 1,jjm_input + 1,nslope) :: tsurf_ave_dyn ! Average surface temperature of the concatenated file [K] 73 real, dimension(iim_input + 1,jjm_input + 1,nsoilmx,nslope) :: tsoil_ave_dyn ! Average soil temperature of the concatenated file [K] 74 real, dimension(iim_input + 1,jjm_input + 1,nslope,timelen) :: tsurf_gcm_dyn ! Surface temperature of the concatenated file, time series [K] 75 real, dimension(iim_input + 1,jjm_input + 1,nsoilmx,nslope,timelen) :: tsoil_gcm_dyn ! Soil temperature of the concatenated file, time series [K] 76 real, dimension(iim_input + 1,jjm_input + 1,timelen) :: q_co2_dyn ! CO2 mass mixing ratio in the first layer [kg/m^3] 77 real, dimension(iim_input + 1,jjm_input + 1,timelen) :: q_h2o_dyn ! H2O mass mixing ratio in the first layer [kg/m^3] 78 real, dimension(iim_input + 1,jjm_input + 1,nslope,timelen) :: co2_ice_slope_dyn ! co2 ice amount per slope of the year [kg/m^2] 79 real, dimension(iim_input + 1,jjm_input + 1,nslope,timelen) :: watersurf_density_dyn ! Water density at the surface, time series [kg/m^3] 80 real, dimension(iim_input + 1,jjm_input + 1,nsoilmx,nslope,timelen) :: watersoil_density_dyn ! Water density in the soil layer, time series [kg/m^3] 81 real, dimension(ngrid,nslope,timelen) :: watersurf_density ! Water density at the surface, time series [kg/m^3] 72 real, dimension(iim_input + 1,jjm_input + 1,nslope) :: tsurf_ave_dyn ! Average surface temperature of the concatenated file [K] 73 real, dimension(iim_input + 1,jjm_input + 1,nsoilmx,nslope) :: tsoil_ave_dyn ! Average soil temperature of the concatenated file [K] 74 real, dimension(iim_input + 1,jjm_input + 1,nslope,timelen) :: tsurf_gcm_dyn ! Surface temperature of the concatenated file, time series [K] 75 real, dimension(iim_input + 1,jjm_input + 1,nsoilmx,nslope,timelen) :: tsoil_gcm_dyn ! Soil temperature of the concatenated file, time series [K] 76 real, dimension(iim_input + 1,jjm_input + 1,timelen) :: q_co2_dyn ! CO2 mass mixing ratio in the first layer [kg/m^3] 77 real, dimension(iim_input + 1,jjm_input + 1,timelen) :: q_h2o_dyn ! H2O mass mixing ratio in the first layer [kg/m^3] 78 real, dimension(iim_input + 1,jjm_input + 1,nslope,timelen) :: co2_ice_slope_dyn ! co2 ice amount per slope of the year [kg/m^2] 79 real, dimension(iim_input + 1,jjm_input + 1,nslope,timelen) :: watersurf_density_dyn ! Water density at the surface, time series [kg/m^3] 80 real, dimension(iim_input + 1,jjm_input + 1,nslope) :: watersurf_density_dyn_ave ! Water density at the surface, dynamic grid, yearly averaged [kg/m^3] 81 real, dimension(iim_input + 1,jjm_input + 1,nsoilmx,nslope,timelen) :: watersoil_density_dyn ! Water density in the soil layer, time series [kg/m^3] 82 real, dimension(ngrid,nslope,timelen) :: watersurf_density ! Water density at the surface, physical grid, time series [kg/m^3] 82 83 !----------------------------------------------------------------------- 83 84 ! Open the NetCDF file … … 115 116 write(*,*) "Data for soiltemp downloaded!" 116 117 117 call get_var4(" waterdensity_soil",watersoil_density_dyn(:,:,:,1,:))118 call get_var4("Waterdensity_soil",watersoil_density_dyn(:,:,:,1,:)) 118 119 write(*,*) "Data for waterdensity_soil downloaded!" 119 120 120 call get_var3(" waterdensity_surface",watersurf_density_dyn(:,:,islope,:))121 call get_var3("Waterdensity_surface",watersurf_density_dyn(:,:,1,:)) 121 122 write(*,*) "Data for waterdensity_surface downloaded!" 122 123 endif !soil_pem … … 184 185 tsurf_ave_dyn(:,:,:) = sum(tsurf_gcm_dyn(:,:,:,:),4)/timelen 185 186 186 #ifndef CPP_1D187 do islope = 1,nslope188 do t = 1,timelen189 call gr_dyn_fi(1,iim_input + 1,jjm_input + 1,ngrid,watersurf_density_dyn(:,:,islope,t),watersurf_density(:,islope,t))190 enddo191 enddo192 #endif193 194 187 if (soil_pem) then 195 188 write(*,*) "Computing average of tsoil..." 196 189 tsoil_ave_dyn(:,:,:,:) = sum(tsoil_gcm_dyn(:,:,:,:,:),5)/timelen 197 190 write(*,*) "Computing average of waterdensity_surface..." 198 watersurf_density_ ave(:,:) = sum(watersurf_density(:,:,:),3)/timelen191 watersurf_density_dyn_ave(:,:,:) = sum(watersurf_density_dyn(:,:,:,:),4)/timelen 199 192 endif 200 193 … … 238 231 enddo 239 232 enddo 233 call gr_dyn_fi(1,iim_input + 1,jjm_input + 1,ngrid,watersurf_density_dyn_ave(:,:,islope),watersurf_density_ave(:,islope)) 240 234 endif ! soil_pem 241 235 do t = 1,timelen … … 257 251 tsoil_gcm(1,:,:,:) = tsoil_gcm_dyn(1,1,:,:,:) 258 252 watersoil_density(1,:,:,:) = watersoil_density_dyn(1,1,:,:,:) 253 watersurf_density_ave(1,:) = watersurf_density_dyn_ave(1,1,:) 259 254 endif ! soil_pem 260 255 tsurf_GCM(1,:,:) = tsurf_GCM_dyn(1,1,:,:) -
trunk/LMDZ.COMMON/libf/evolution/soil_settings_PEM_mod.F90
r3076 r3123 49 49 real :: alpha,lay1 ! coefficients for building layers 50 50 real :: xmin, xmax ! to display min and max of a field 51 real :: index_powerlaw ! coefficient to match the power low grid with the exponential one 51 52 !======================================================================= 52 53 ! 1. Depth coordinate 53 54 ! ------------------- 54 ! 1.4 Build mlayer(), if necessary 55 ! default mlayer distribution, following a power law: 56 ! mlayer(k)=lay1*alpha**(k-1/2) 55 ! mlayer_PEM distribution: For the grid in common with the PCM: lay1*(1+k^(2.9)*(1-exp(-k/20)) 56 ! Then we use a power low : lay1*alpha**(k-1/2) 57 57 lay1 = 2.e-4 58 58 alpha = 2 59 do iloop = 0,nsoil_ PEM - 160 mlayer_PEM(iloop) = lay1*( alpha**(iloop - 0.5))59 do iloop = 0,nsoil_GCM - 1 60 mlayer_PEM(iloop) = lay1*(1+iloop**2.9*(1-exp(-real(iloop)/20.))) 61 61 enddo 62 62 63 ! 1.5 Build layer(); following the same law as mlayer() 64 ! Assuming layer distribution follows mid-layer law: 65 ! layer(k)=lay1*alpha**(k-1) 66 lay1 = sqrt(mlayer_PEM(0)*mlayer_PEM(1)) 67 alpha = mlayer_PEM(1)/mlayer_PEM(0) 68 do iloop = 1,nsoil_PEM 69 layer_PEM(iloop) = lay1*(alpha**(iloop - 1)) 63 do iloop = 0, nsoil_PEM-1 64 if(lay1*(alpha**(iloop-0.5)) > mlayer_PEM(nsoil_GCM-1)) then 65 index_powerlaw = iloop 66 exit 67 endif 70 68 enddo 69 70 do iloop = nsoil_GCM, nsoil_PEM-1 71 mlayer_PEM(iloop) = lay1*(alpha**(index_powerlaw + (iloop-nsoil_GCM)-0.5)) 72 enddo 73 74 ! Build layer_PEM() 75 do iloop=1,nsoil_PEM-1 76 layer_PEM(iloop)=(mlayer_PEM(iloop)+mlayer_PEM(iloop-1))/2. 77 enddo 78 layer_PEM(nsoil_PEM)=2*mlayer_PEM(nsoil_PEM-1) - mlayer_PEM(nsoil_PEM-2) 79 71 80 72 81 ! 2. Thermal inertia (note: it is declared in comsoil_h)
Note: See TracChangeset
for help on using the changeset viewer.