Changeset 2895


Ignore:
Timestamp:
Feb 10, 2023, 8:35:22 PM (22 months ago)
Author:
llange
Message:

PEM
Soil temperature initialisation has been updated
Conf_PEM improved by adding some options to the users (thermal regolith depend on the pressure, depth of the subsurface layers, etc.)
Minor edits then (+ svn update with RV had some issues, so there are some "artefact changes" ...)
LL

Location:
trunk
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/adsorption_mod.F90

    r2888 r2895  
    8989
    9090#ifndef CPP_STD
    91       use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,n_1km
     91      use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,index_breccia,index_bedrock
    9292      USE comcstfi_h, only:  pi
    9393      use comslope_mod, only : subslope_dist,def_slope_mean
     
    117117 REAL :: mu = 0.48                ! Jackosky et al. 1997
    118118 real :: m_theta = 2.84e-7        ! Mass of h2o per m^2 absorbed Jackosky et al. 1997
    119  real :: as = 18.9e3              ! Specific area, Buhler & Piqueux 2021
     119! real :: as = 18.9e3             ! Specific area, Buhler & Piqueux 2021
     120 real :: as = 9.48e4              ! Specific area, Zent
     121 real :: as_breccia = 1.7e4       ! Specific area of basalt, Zent
    120122 real ::  inertie_thresold = 800. ! TI > 800 means cementation
    121123 real :: m_h2o = 18.01528E-3      ! Molecular weight of h2o (kg/mol)
    122124 real :: m_co2 = 44.01E-3         ! Molecular weight of co2 (kg/mol)
    123125 real :: m_noco2 = 33.37E-3       ! Molecular weight of non co2 (kg/mol)
    124  real ::  rho_regolith = 1500.    ! density of the regolith (2000 for buhler & piqueux 2021)
     126 real ::  rho_regolith = 2000.    ! density of the regolith (Zent 1995, Buhler & piqueux 2021)
    125127 real :: alpha_clapeyron = -6143.7! eq. (2) in Murphy & Koop 2005
    126128 real :: beta_clapeyron = 28.9074 ! eq. (2) in Murphy & Koop 2005
    127129! local variables
    128130#ifndef CPP_STD
    129  REAL :: deltam_reg_complete(ngrid,n_1km,nslope)         ! Difference in the mass per slope and soil layer (kg/m^3)
     131 REAL :: deltam_reg_complete(ngrid,index_breccia,nslope)         ! Difference in the mass per slope and soil layer (kg/m^3)
    130132#endif
    131133 real :: K                        ! Used to compute theta
     
    195197 do ig = 1,ngrid
    196198  do islope = 1,nslope
    197     do iloop = 1,n_1km
     199    do iloop = 1,index_breccia
    198200      K = Ko*exp(e/tsoil_PEM(ig,iloop,islope))
    199201      if(TI_PEM(ig,iloop,islope).lt.inertie_thresold)  then
     
    203205        theta_h2o_adsorbded(ig,iloop,islope) = (K*p_sat/(1+K*p_sat))**mu
    204206      endif
    205       dm_h2o_regolith_slope(ig,iloop,islope) = as*theta_h2o_adsorbded(ig,iloop,islope)*m_theta*rho_regolith
     207        dm_h2o_regolith_slope(ig,iloop,islope) = as*theta_h2o_adsorbded(ig,iloop,islope)*m_theta*rho_regolith
    206208   enddo
    207209  enddo
     
    214216   do islope = 1,nslope
    215217    deltam_reg_slope(ig,islope) = 0.
    216     do iloop = 1,n_1km
     218    do iloop = 1,index_breccia
    217219       if((TI_PEM(ig,iloop,islope).lt.inertie_thresold).and.(ispermanent_h2oglaciers(ig,islope).eq.0).and.(ispermanent_co2glaciers(ig,islope).eq.0)) then
    218220             deltam_reg_complete(ig,iloop,islope) = (dm_h2o_regolith_slope(ig,iloop,islope) - m_h2o_completesoil(ig,iloop,islope)) &
     
    245247                                   tsoil_PEM,TI_PEM,m_co2_completesoil,delta_mreg)
    246248#ifndef CPP_STD
    247       use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,n_1km
     249      use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,index_breccia,index_bedrock,index_breccia
    248250      USE comcstfi_h, only: pi
    249251      use comslope_mod, only : subslope_dist,def_slope_mean
     
    271273 REAL :: beta =  -1541.5  ! Zent & Quinn 1995
    272274 REAL ::  inertie_thresold = 800. ! TI > 800 means cementation
    273  REAL ::  rho_regolith = 1500. ! density of the reoglith, buhler & piqueux 2021
     275 REAL ::  rho_regolith = 2000. ! density of the regolith, buhler & piqueux 2021
    274276 real :: m_co2 = 44.01E-3      ! Molecular weight of co2 (kg/mol)
    275277 real :: m_noco2 = 33.37E-3    ! Molecular weight of h2o (kg/mol)
    276278 real :: m_theta = 4.27e-7     ! Mass of co2 per m^2 absorbed
    277  real :: as = 18.9e3              ! Specific area, Buhler & Piqueux 2021
    278 
     279! real :: as = 18.9e3              ! Specific area, Buhler & Piqueux 2021
     280 real :: as = 9.48e4           ! same as previous but from zent
     281 real :: as_breccia = 1.7e4       ! Specific area of basalt, Zent 1997
    279282! Local         
    280283 real :: A,B                                             ! Used to compute the mean mass above the surface
     
    284287 INTEGER :: ispermanent_h2oglaciers(ngrid,nslope)        ! Check if the h2o glacier is permanent
    285288#ifndef CPP_STD
    286  REAL :: deltam_reg_complete(ngrid,n_1km,nslope)         ! Difference in the mass per slope and soil layer (kg/m^3)
     289 REAL :: deltam_reg_complete(ngrid,index_breccia,nslope)         ! Difference in the mass per slope and soil layer (kg/m^3)
    287290#endif
    288291 REAL :: deltam_reg_slope(ngrid,nslope)                  ! Difference in the mass per slope  (kg/m^3)
     
    362365 do ig = 1,ngrid
    363366  do islope = 1,nslope
    364     do iloop = 1,n_1km
     367    do iloop = 1,index_breccia
    365368     if((TI_PEM(ig,iloop,islope).lt.inertie_thresold).and.(ispermanent_h2oglaciers(ig,islope).eq.0).and.(ispermanent_co2glaciers(ig,islope).eq.0)) then
    366369     dm_co2_regolith_slope(ig,iloop,islope) = as*rho_regolith*m_theta*(1-theta_h2o_adsorbed(ig,iloop,islope))*alpha*pco2_avg(ig)/ &
     
    374377        endif
    375378     endif
    376   enddo
     379    enddo
    377380 enddo
    378381enddo
     
    384387   do islope = 1,nslope
    385388    deltam_reg_slope(ig,islope) = 0.
    386     do iloop = 1,n_1km
     389    do iloop = 1,index_breccia
    387390       if((TI_PEM(ig,iloop,islope).lt.inertie_thresold).and.(ispermanent_h2oglaciers(ig,islope).eq.0).and.(ispermanent_co2glaciers(ig,islope).eq.0)) then
    388391             deltam_reg_complete(ig,iloop,islope) = (dm_co2_regolith_slope(ig,iloop,islope) - m_co2_completesoil(ig,iloop,islope)) &
  • trunk/LMDZ.COMMON/libf/evolution/comsoil_h_PEM.F90

    r2893 r2895  
    1919  real,save :: mu_PEM                           ! mu coefficient [SI]
    2020  real,save :: fluxgeo                               ! Geothermal flux [W/m^2]
     21  real,save :: depth_breccia                         ! Depth at which we have breccia [m]
     22  real,save :: depth_bedrock                         ! Depth at which we have bedrock [m]
     23  integer,save :: index_breccia                         ! last index of the depth grid before having breccia
     24  integer,save :: index_bedrock                         ! last index of the depth grid before having bedrock
    2125  LOGICAL soil_pem  ! True by default, to run with the subsurface physic. Read in pem.def
    2226  real,save,allocatable,dimension(:) :: water_reservoir      ! Large reserve of water   [kg/m^2]
    2327  real,save :: water_reservoir_nom
     28  logical, save :: reg_thprop_dependp ! thermal properites of the regolith vary with the surface pressure
     29
    2430contains
    2531
     
    6167    if (allocated(inertiedat_PEM)) deallocate(inertiedat_PEM)
    6268    if (allocated(water_reservoir)) deallocate(water_reservoir)
    63     if (allocated(water_reservoir)) deallocate(water_reservoir)
    6469  end subroutine end_comsoil_h_PEM
    6570
  • trunk/LMDZ.COMMON/libf/evolution/conf_pem.F90

    r2894 r2895  
    1515 
    1616  USE temps_mod_evol, ONLY: year_bp_ini, dt_pem, water_ice_criterion, co2_ice_criterion, ps_criterion, &
    17                 Max_iter_pem, evol_orbit_pem,var_obl, var_ex, var_lsp
    18   USE comsoil_h_pem, only: soil_pem,fluxgeo,water_reservoir_nom
     17                Max_iter_pem, evol_orbit_pem, var_obl, var_ex, var_lsp
     18  USE comsoil_h_pem, only: soil_pem,fluxgeo,water_reservoir_nom,depth_breccia,depth_bedrock,reg_thprop_dependp
    1919  USE adsorption_mod,only: adsorption_pem
    2020  CHARACTER(len=20),parameter :: modname ='conf_pem'
     
    5555  var_obl = .true.
    5656  CALL getin('var_obl',var_obl)
     57  print*,'Does obliquity vary ?',var_obl
    5758
    5859  var_ex = .true.
    5960  CALL getin('var_ex',var_ex)
     61  print*,'Does excentricity vary ?',var_ex
    6062
    6163  var_lsp = .true.
    6264  CALL getin('var_lsp',var_lsp)
     65  print*,'Does Ls peri vary ?',var_lsp
     66   
     67  depth_breccia   = 10.
     68  CALL getin('depth_breccia',depth_breccia)
     69  print*,'Depth of breccia is set to',depth_breccia
     70
     71  depth_bedrock   = 1000.
     72  CALL getin('depth_bedrock',depth_bedrock)
     73  print*,'Depth of bedrock is set to',depth_bedrock
     74
     75  reg_thprop_dependp = .false.
     76  CALL getin('reg_thprop_dependp',reg_thprop_dependp)
     77  print*, 'Thermal properties of the regolith vary with pressure ?', reg_thprop_dependp
     78
    6379
    6480  if ((not(soil_pem)).and.adsorption_pem) then
     
    6985  if ((not(soil_pem)).and.fluxgeo.gt.0.) then
    7086       print*,'Soil is not activated but Flux Geo > 0.'
    71        call abort_physic(modname,"Soil is not activated but Flux Geo > 0.'",1)
     87       call abort_physic(modname,"Soil is not activated but Flux Geo > 0.",1)
     88  endif
     89 
     90  if ((not(soil_pem)).and.reg_thprop_dependp) then
     91     print*,'Regolith properties vary with Ps only when soil is set to true'
     92     call abort_physic(modname,'Regolith properties vary with Ps only when soil is set to true',1)
    7293  endif
    7394
    7495  if (evol_orbit_pem.and.year_bp_ini.eq.0.) then
    75        print*,'You want to follow the file ob_ex_lsp.asc for changing orb parameters,'
    76        print*,'but you did not specify from which year to start.'
    77        call abort_physic(modname,"evol_orbit_pem=.true. but year_bp_ini=0",1)
    78   endif
    79  
    80    water_reservoir_nom = 1e4
     96     print*,'You want to follow the file ob_ex_lsp.asc for changing orb parameters,'
     97     print*,'but you did not specify from which year to start.'
     98     call abort_physic(modname,"evol_orbit_pem=.true. but year_bp_ini=0",1)
     99  endif 
     100
     101  water_reservoir_nom = 1e4
    81102  CALL getin('water_reservoir_nom',water_reservoir_nom)
     103
    82104  END SUBROUTINE conf_pem
    83105
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r2893 r2895  
    7878                           co2iceflow, beta_slope, capcal_slope,&
    7979                           albedo_slope,emiss_slope,qsurf_slope,&
    80                            iflat,major_slope,ini_comslope_h
     80                           iflat,major_slope,ini_comslope_h,fluxgeo_slope
    8181      use time_phylmdz_mod, only: daysec,dtphys
    8282      USE comconst_mod, ONLY: rad,g,r,cpp,pi
     
    8989!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! SOIL
    9090      use comsoil_h_PEM, only: soil_pem,ini_comsoil_h_PEM,end_comsoil_h_PEM,nsoilmx_PEM, &
    91                               TI_PEM,inertiedat_PEM,         & ! soil thermal inertia         
    92                               tsoil_PEM, mlayer_PEM,layer_PEM,                  & !number of subsurface layers, soil mid layer depths
    93                               fluxgeo,water_reservoir                             ! geothermal flux
     91                              TI_PEM,inertiedat_PEM,         &                        ! soil thermal inertia         
     92                              tsoil_PEM, mlayer_PEM,layer_PEM,                  &     ! Soil temp, number of subsurface layers, soil mid layer depths
     93                              fluxgeo, &                             ! geothermal flux for the PEM and GCM
     94                              water_reservoir                                         ! Water ressources
    9495      use adsorption_mod, only : regolith_adsorption,adsorption_pem, &   ! bool to check if adsorption, main subroutine
    9596                                 ini_adsorption_h_PEM, end_adsorption_h_PEM, & ! allocate arrays                               
     
    159160
    160161! Variable for h2o_ice evolution
    161       REAL :: ini_surf_h2o                                         ! Initial surface of sublimating water ice
     162      REAL :: ini_surf_h2o
    162163      REAL :: ini_surf_co2                                         ! Initial surface of sublimating co2 ice
    163164
     
    258259     REAL :: beta_clap_h2o = 28.9074                                     ! coefficient to compute psat, from Murphie et Kood 2005 [1]
    259260     LOGICAL :: bool_sublim                                              ! logical to check if there is sublimation or not
     261     
    260262
    261263!! Some parameters for the PEM run
     
    265267    REAL :: timestep                     ! timestep [s]
    266268    REAL :: watercap_sum                 ! total mass of water cap [kg/m^2]
    267 
    268     REAL WC_sum
    269269
    270270#ifdef CPP_STD
     
    482482     allocate(flag_co2flow_mesh(ngrid))
    483483
    484      flag_co2flow(:,:) = 0.     
    485      flag_co2flow_mesh(:) = 0.
     484       flag_co2flow(:,:) = 0.     
     485       flag_co2flow_mesh(:) = 0.
    486486
    487487
     
    499499
    500500     call nb_time_step_GCM("data_GCM_Y1.nc",timelen)
     501
    501502
    502503     allocate(vmr_co2_gcm(iim+1,jjm+1,timelen))
     
    530531     allocate(watersoil_density_phys_PEM_timeseries(ngrid,nsoilmx_PEM,nslope,timelen))
    531532     allocate(watersoil_density_phys_PEM_ave(ngrid,nsoilmx_PEM,nslope))
     533
    532534     print *, "Downloading data Y1..."
    533535
    534      call read_data_GCM("data_GCM_Y1.nc",timelen, iim,jjm,vmr_co2_gcm,ps_GCM_yr1,min_co2_ice_slope_1,min_h2o_ice_slope_1,&   
     536     call read_data_GCM("data_GCM_Y1.nc",timelen, iim,jjm,vmr_co2_gcm,ps_GCM_yr1,min_co2_ice_slope_1,min_h2o_ice_slope_1,&      
    535537                       nslope,tsurf_ave_yr1,tsoil_ave_yr1, tsurf_GCM_timeseries,tsoil_GCM_timeseries,TI_GCM,q_co2_GCM,q_h2o_GCM,co2_ice_GCM_slope, &     
    536538                       watersurf_density_timeseries,watersoil_density_timeseries)
     
    661663
    662664!----- Compute tendencies from the PCM run
     665
    663666     allocate(tendencies_co2_ice_slope(iim+1,jjm+1,nslope))
    664667     allocate(tendencies_co2_ice_phys_slope(ngrid,nslope))
     
    765768    do ig = 1,ngrid
    766769      do islope = 1,nslope
    767           qsurf_slope(ig,igcm_h2o_ice,islope)=qsurf_slope(ig,igcm_h2o_ice,islope)+watercap_slope(ig,islope)+water_reservoir(ig)*cos(pi*def_slope_mean(islope)/180.)
     770!          qsurf_slope(ig,igcm_h2o_ice,islope)=qsurf_slope(ig,igcm_h2o_ice,islope)+watercap_slope(ig,islope)+water_reservoir(ig)*cos(pi*def_slope_mean(islope)/180.)
    768771      enddo
    769772    enddo
     
    787790     write(*,*) "Tot mass of CO2 in the regolith=", totmassco2_adsorbded
    788791     write(*,*) "Tot mass of H2O in the regolith=", totmassh2o_adsorbded
     792     endif ! adsorption
    789793     deallocate(tsoil_ave_phys_yr1) 
    790     endif !soil_pem
    791794     deallocate(tsurf_ave_phys_yr1)
    792795     deallocate(ps_phys_timeseries_yr1) 
     
    837840     enddo
    838841       print *, 'Global average pressure old time step',global_ave_press_old
    839        print *, 'Global average pressure new time step',global_ave_press_new
     842
     843     call WRITEDIAGFI(ngrid,'ps_ave','Global average pressure','Pa',0,global_ave_press_new)
    840844     
    841845     if(adsorption_pem) then
    842846      do i=1,ngrid
    843847        global_ave_press_new = global_ave_press_new -g*cell_area(i)*delta_co2_adsorbded(i)/Total_surface
    844       enddo
    845       print *, 'Global average pressure old time step',global_ave_press_old
    846       print *, 'Global average pressure new time step',global_ave_press_new
     848       enddo
     849       print *, 'Global average pressure old time step',global_ave_press_old
     850       print *, 'Global average pressure new time step',global_ave_press_new
    847851     endif
    848 
    849      call WRITEDIAGFI(ngrid,'ps_ave','Global average pressure','Pa',0,global_ave_press_new)
    850852
    851853! II.a.2. Old pressure levels for the timeseries, this value is deleted when unused and recreated each time (big memory consuption)
     
    916918     call evol_h2o_ice_s_slope(qsurf_slope(:,igcm_h2o_ice,:),tendencies_h2o_ice_phys_slope,iim,jjm,ngrid,cell_area,STOPPING_1_water,nslope)
    917919
    918      DO islope=1, nslope
    919        write(str2(1:2),'(i2.2)') islope
    920        call WRITEDIAGFI(ngrid,'h2o_ice_s_slope'//str2,'H2O ice','kg.m-2',2,qsurf_slope(:,igcm_h2o_ice,islope))
    921        call WRITEDIAGFI(ngrid,'tendencies_h2o_ice_slope'//str2,'H2O ice tend','kg.m-2.year-1',2,tendencies_h2o_ice_phys_slope(:,islope))
    922      ENDDO
    923920
    924921      print *, "Evolution of co2 ice"
    925922     call evol_co2_ice_s_slope(co2ice_slope,tendencies_co2_ice_phys_slope,iim,jjm,ngrid,cell_area,STOPPING_1_co2,nslope)
     923
     924      DO islope=1, nslope
     925        write(str2(1:2),'(i2.2)') islope
     926        call WRITEDIAGFI(ngrid,'h2o_ice_s_slope'//str2,'H2O ice','kg.m-2',2,qsurf_slope(:,igcm_h2o_ice,islope))
     927        call WRITEDIAGFI(ngrid,'tendencies_h2o_ice_slope'//str2,'H2O ice tend','kg.m-2.year-1',2,tendencies_h2o_ice_phys_slope(:,islope))
     928      ENDDO
    926929
    927930!------------------------
     
    939942                         global_ave_press_GCM,global_ave_press_new,co2ice_slope,flag_co2flow,flag_co2flow_mesh)
    940943
    941      DO islope=1, nslope
    942        write(str2(1:2),'(i2.2)') islope
    943        call WRITEDIAGFI(ngrid,'co2ice_slope'//str2,'CO2 ice','kg.m-2',2,co2ice_slope(:,islope))
    944        call WRITEDIAGFI(ngrid,'tendencies_co2_ice_slope'//str2,'CO2 ice tend','kg.m-2.year-1',2,tendencies_co2_ice_phys_slope(:,islope))
    945      ENDDO
     944      DO islope=1, nslope
     945        write(str2(1:2),'(i2.2)') islope
     946        call WRITEDIAGFI(ngrid,'co2ice_slope'//str2,'CO2 ice','kg.m-2',2,co2ice_slope(:,islope))
     947        call WRITEDIAGFI(ngrid,'tendencies_co2_ice_slope'//str2,'CO2 ice tend','kg.m-2.year-1',2,tendencies_co2_ice_phys_slope(:,islope))
     948      ENDDO
    946949
    947950!------------------------
     
    10711074      print *, "Update soil propreties"
    10721075! II_d.4 Update the soil thermal properties
    1073       call update_soil(ngrid,nslope,nsoilmx,nsoilmx_PEM,tendencies_h2o_ice_phys_slope,qsurf_slope(:,igcm_h2o_ice,:),global_ave_press_new, &
     1076      call update_soil(ngrid,nslope,nsoilmx_PEM,tendencies_h2o_ice_phys_slope,qsurf_slope(:,igcm_h2o_ice,:),global_ave_press_new, &
    10741077        ice_depth,TI_PEM)
    10751078
     
    11141117                                   initial_co2_ice_sublim_slope,global_ave_press_GCM,global_ave_press_new,nslope)
    11151118
    1116       year_iter=year_iter+dt_pem
     1119      year_iter=year_iter+dt_pem     
    11171120
    11181121      print *, "Checking all the stopping criterion."
    11191122      if (STOPPING_water) then
    11201123        print *, "STOPPING because surface of water ice sublimating is too low, see message above", STOPPING_water
    1121         criterion_stop=1
    11221124        criterion_stop=1
    11231125      endif
     
    11501152      endif
    11511153
     1154
     1155
    11521156      global_ave_press_old=global_ave_press_new
    11531157
     
    11811185
    11821186! H2O ice
     1187
    11831188     DO ig=1,ngrid
    11841189       if(watercaptag(ig)) then
     
    11931198           endif
    11941199           watercap_sum=watercap_sum+(watercap_slope(ig,islope)-watercap_slope_saved)*subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)
    1195 !           watercap_slope(ig,islope)=0.
     1200           watercap_slope(ig,islope)=0.
    11961201         enddo
    11971202           water_reservoir(ig)=water_reservoir(ig)+watercap_sum
     
    12401245
    12411246   if(soil_pem) then
     1247     fluxgeo_slope(:,:) = fluxgeo
    12421248     call interpolate_TIPEM_TIGCM(ngrid,nslope,nsoilmx_PEM,nsoilmx,TI_PEM,TI_GCM_phys)
    12431249     tsoil_slope(:,:,:) = tsoil_phys_PEM_timeseries(:,:,:,timelen)
     
    12791285      ENDDO
    12801286    ENDDO
     1287
    12811288
    12821289      DO ig = 1,ngrid
     
    13461353       enddo
    13471354     enddo
    1348 
    1349      DO ig=1,ngrid
    1350        if(watercaptag(ig)) then
    1351          WC_sum=0.
    1352          DO islope=1,nslope
    1353            if(qsurf_slope(ig,igcm_h2o_ice,islope).GT. (watercap_slope(ig,islope)+water_reservoir(ig))) then
    1354              qsurf_slope(ig,igcm_h2o_ice,islope)=qsurf_slope(ig,igcm_h2o_ice,islope)-(watercap_slope(ig,islope)+water_reservoir(ig))
    1355            else
    1356              watercap_slope(ig,islope)=watercap_slope(ig,islope)+qsurf_slope(ig,igcm_h2o_ice,islope)-(watercap_slope(ig,islope)+water_reservoir(ig)/nslope)
    1357              qsurf_slope(ig,igcm_h2o_ice,islope)=0.
    1358            endif
    1359            WC_sum=WC_sum+watercap_slope(ig,islope)*subslope_dist(ig,islope)/cos(pi*def_slope_mean(islope)/180.)
    1360            watercap_slope(ig,islope)=0.
    1361          enddo 
    1362            water_reservoir(ig)=water_reservoir(ig)+WC_sum
    1363        endif
    1364      enddo
    1365 
    1366 ! H2o ice
    1367       DO ig = 1,ngrid
    1368         qsurf(ig,igcm_h2o_ice) = 0.
    1369         DO islope = 1,nslope
    1370           qsurf(ig,igcm_h2o_ice) = qsurf(ig,igcm_h2o_ice) + qsurf_slope(ig,igcm_h2o_ice,islope) &
    1371                                    * subslope_dist(ig,islope) /          &
    1372                                   cos(pi*def_slope_mean(islope)/180.)
    1373         ENDDO
    1374       ENDDO ! of DO ig=1,ngrid
    1375 
    1376      DO ig=1,ngrid
    1377 !       DO islope=1,nslope
    1378          if(qsurf(ig,igcm_h2o_ice).GT.500) then
    1379             watercaptag(ig)=.true.
    1380        DO islope=1,nslope
    1381             qsurf_slope(ig,igcm_h2o_ice,islope)=qsurf_slope(ig,igcm_h2o_ice,islope)-250
    1382             water_reservoir(ig)=water_reservoir(ig)+250
    1383        ENDDO           
    1384          endif
    1385 !       enddo
    1386      enddo
    1387 
    1388      DO ig=1,ngrid
    1389 !       DO islope=1,nslope
    1390          if(water_reservoir(ig).LT. 10) then
    1391             watercaptag(ig)=.false.
    1392             qsurf(ig,igcm_h2o_ice)=qsurf(ig,igcm_h2o_ice)+water_reservoir(ig)
    1393        DO islope=1,nslope
    1394             qsurf_slope(ig,igcm_h2o_ice,islope)=qsurf_slope(ig,igcm_h2o_ice,islope)+water_reservoir(ig)
    1395        ENDDO
    1396          endif
    1397 !       enddo
    1398      enddo
    1399 
    1400       DO ig = 1,ngrid
    1401         watercap(ig) = 0.
    1402         DO islope = 1,nslope
    1403           watercap(ig) = watercap(ig) + watercap_slope(ig,islope) &
    1404                                    * subslope_dist(ig,islope) /          &
    1405                                   cos(pi*def_slope_mean(islope)/180.)
    1406         ENDDO
    1407       ENDDO ! of DO ig=1,ngrid
    1408 
    14091355     
    14101356!------------------------
  • trunk/LMDZ.COMMON/libf/evolution/pemetat0.F90

    r2893 r2895  
    55   
    66   use iostart_PEM, only:  open_startphy, close_startphy, get_field, get_var
    7    use comsoil_h_PEM, only: soil_pem,layer_PEM, mlayer_PEM,n_1km,fluxgeo,inertiedat_PEM,water_reservoir_nom
     7   use comsoil_h_PEM, only: soil_pem,layer_PEM, mlayer_PEM,n_1km,fluxgeo,inertiedat_PEM,water_reservoir_nom,depth_breccia,depth_bedrock,index_breccia,index_bedrock
    88   use comsoil_h, only:  volcapa,inertiedat
    99   use adsorption_mod, only : regolith_adsorption,adsorption_pem
     
    9191write(*,*)'Is start PEM?',startpem_file
    9292
    93 startpem_file = .true.
     93
    9494!1. Run
    9595
     
    119119
    120120      do ig = 1,ngrid
    121           if(TI_PEM(ig,nsoil_GCM,islope).lt.TI_breccia) then
     121          if(TI_PEM(ig,index_breccia,islope).lt.TI_breccia) then
    122122!!! transition
    123              delta = 50.
    124              TI_PEM(ig,nsoil_GCM+1,islope) = sqrt((layer_PEM(nsoil_GCM+1)-layer_PEM(nsoil_GCM))/ &
    125             (((delta-layer_PEM(nsoil_GCM))/(TI_PEM(ig,nsoil_GCM,islope)**2))+ &
    126                       ((layer_PEM(nsoil_GCM+1)-delta)/(TI_breccia**2))))
    127             do iloop=nsoil_GCM+2,n_1km
     123             delta = depth_breccia
     124             TI_PEM(ig,index_breccia+1,islope) = sqrt((layer_PEM(index_breccia+1)-layer_PEM(index_breccia))/ &
     125            (((delta-layer_PEM(index_breccia))/(TI_PEM(ig,index_breccia,islope)**2))+ &
     126                      ((layer_PEM(index_breccia+1)-delta)/(TI_breccia**2))))
     127            do iloop=index_breccia+2,index_bedrock
    128128              TI_PEM(ig,iloop,islope) = TI_breccia
    129129            enddo     
    130130          else ! we keep the high ti values
    131             do iloop=nsoil_GCM+1,n_1km
    132               TI_PEM(ig,iloop,islope) = TI_PEM(ig,nsoil_GCM,islope)
     131            do iloop=index_breccia+1,index_bedrock
     132              TI_PEM(ig,iloop,islope) = TI_PEM(ig,index_breccia,islope)
    133133            enddo
    134134          endif ! TI PEM and breccia comparison
    135135!! transition
    136           delta = 1000.
    137           TI_PEM(ig,n_1km+1,islope) = sqrt((layer_PEM(n_1km+1)-layer_PEM(n_1km))/ &
    138                (((delta-layer_PEM(n_1km))/(TI_PEM(ig,n_1km,islope)**2))+ &
    139                ((layer_PEM(n_1km+1)-delta)/(TI_bedrock**2))))
    140           do iloop=n_1km+2,nsoil_PEM
     136          delta = depth_bedrock
     137          TI_PEM(ig,index_bedrock+1,islope) = sqrt((layer_PEM(index_bedrock+1)-layer_PEM(index_bedrock))/ &
     138               (((delta-layer_PEM(index_bedrock))/(TI_PEM(ig,index_bedrock,islope)**2))+ &
     139               ((layer_PEM(index_bedrock+1)-delta)/(TI_bedrock**2))))
     140          do iloop=index_bedrock+2,nsoil_PEM
    141141            TI_PEM(ig,iloop,islope) = TI_bedrock
    142142          enddo   
    143143      enddo
    144    else
     144   else ! found
    145145     do iloop = nsoil_GCM+1,nsoil_PEM
    146146       TI_PEM(:,iloop,islope) = TI_startPEM(:,iloop,islope)  ! ! 1st layers can change because of the presence of ice at the surface, so we don't change it here.
     
    158158 enddo
    159159!!! zone de transition
    160 delta = 50.
     160delta = depth_breccia
    161161do ig = 1,ngrid
    162 if(inertiedat_PEM(ig,nsoil_GCM).lt.TI_breccia) then
    163 inertiedat_PEM(ig,nsoil_GCM+1) = sqrt((layer_PEM(nsoil_GCM+1)-layer_PEM(nsoil_GCM))/ &
    164             (((delta-layer_PEM(nsoil_GCM))/(inertiedat(ig,nsoil_GCM)**2))+ &
    165                       ((layer_PEM(nsoil_GCM+1)-delta)/(TI_breccia**2))))
    166 
    167  do iloop = nsoil_GCM+2,n_1km
     162if(inertiedat_PEM(ig,index_breccia).lt.TI_breccia) then
     163inertiedat_PEM(ig,index_breccia+1) = sqrt((layer_PEM(index_breccia+1)-layer_PEM(index_breccia))/ &
     164            (((delta-layer_PEM(index_breccia))/(inertiedat(ig,index_breccia)**2))+ &
     165                      ((layer_PEM(index_breccia+1)-delta)/(TI_breccia**2))))
     166
     167 do iloop = index_breccia+2,index_bedrock
    168168       inertiedat_PEM(ig,iloop) = TI_breccia
    169169  enddo
    170170
    171171else
    172    do iloop=nsoil_GCM+1,n_1km
     172   do iloop=index_breccia+1,index_bedrock
    173173      inertiedat_PEM(ig,iloop) = inertiedat_PEM(ig,nsoil_GCM)
    174174   enddo
     
    177177
    178178!!! zone de transition
    179 delta = 1000.
     179delta = depth_bedrock
    180180do ig = 1,ngrid
    181 inertiedat_PEM(ig,n_1km+1) = sqrt((layer_PEM(n_1km+1)-layer_PEM(n_1km))/ &
    182             (((delta-layer_PEM(n_1km))/(inertiedat_PEM(ig,n_1km)**2))+ &
    183                       ((layer_PEM(n_1km+1)-delta)/(TI_bedrock**2))))
     181inertiedat_PEM(ig,index_bedrock+1) = sqrt((layer_PEM(index_bedrock+1)-layer_PEM(index_bedrock))/ &
     182            (((delta-layer_PEM(index_bedrock))/(inertiedat_PEM(ig,index_bedrock)**2))+ &
     183                      ((layer_PEM(index_bedrock+1)-delta)/(TI_bedrock**2))))
    184184enddo
    185185
    186  do iloop = n_1km+2, nsoil_PEM
     186 do iloop = index_bedrock+2, nsoil_PEM
    187187   do ig = 1,ngrid
    188188      inertiedat_PEM(ig,iloop) = TI_bedrock
     
    201201      write(*,*)'PEM settings: failed loading <tsoil_PEM_slope'//num//'>'
    202202      write(*,*)'will reconstruct the values of Tsoil'
    203       do ig = 1,ngrid
    204         kcond = (TI_PEM(ig,nsoil_GCM+1,islope)*TI_PEM(ig,nsoil_GCM+1,islope))/volcapa
    205         tsoil_PEM(ig,nsoil_GCM+1,islope) = tsoil_PEM(ig,nsoil_GCM,islope) + fluxgeo/kcond*(mlayer_PEM(nsoil_GCM)-mlayer_PEM(nsoil_GCM-1))   
    206 
    207        do iloop=nsoil_GCM+2,n_1km
    208             kcond = (TI_PEM(ig,iloop,islope)*TI_PEM(ig,iloop,islope))/volcapa
    209             tsoil_PEM(ig,iloop,islope) = tsoil_PEM(ig,nsoil_GCM+1,islope) + fluxgeo/kcond*(mlayer_PEM(iloop-1)-mlayer_PEM(nsoil_GCM))
    210       enddo
    211         kcond = (TI_PEM(ig,n_1km+1,islope)*TI_PEM(ig,n_1km+1,islope))/volcapa
    212         tsoil_PEM(ig,n_1km+1,islope) = tsoil_PEM(ig,n_1km,islope) + fluxgeo/kcond*(mlayer_PEM(n_1km)-mlayer_PEM(n_1km-1)) 
    213 
    214        do iloop=n_1km+2,nsoil_PEM
    215             kcond = (TI_PEM(ig,iloop,islope)*TI_PEM(ig,iloop,islope))/volcapa
    216             tsoil_PEM(ig,iloop,islope) = tsoil_PEM(ig,n_1km+1,islope) + fluxgeo/kcond*(mlayer_PEM(iloop-1)-mlayer_PEM(n_1km))
    217       enddo
    218           do iloop = nsoil_GCM+1,nsoil_PEM
    219              tsoil_PEM(ig,iloop,islope) =  tsoil_PEM(ig,nsoil_GCM,islope)
    220           enddo
    221       enddo
    222 !     call soil_pem_routine(ngrid,nsoil_PEM,.true.,TI_PEM(:,:,islope),timestep,tsurf_ave_yr2(:,islope),tsoil_PEM(:,:,islope))
    223 !     do iloop = 1,2000000
    224 !      write(*,*) 'iloop,islope',islope,iloop
    225 !      call soil_pem_routine(ngrid,nsoil_PEM,.false.,TI_PEM(:,:,islope),timestep,tsurf_ave_yr2(:,islope),tsoil_PEM(:,:,islope))
    226 !     enddo
     203!      do ig = 1,ngrid
     204!        kcond = (TI_PEM(ig,index_breccia+1,islope)*TI_PEM(ig,index_breccia+1,islope))/volcapa
     205!        tsoil_PEM(ig,index_breccia+1,islope) = tsoil_PEM(ig,index_breccia,islope) + fluxgeo/kcond*(mlayer_PEM(index_breccia)-mlayer_PEM(index_breccia-1))   
     206!       do iloop=index_breccia+2,index_bedrock
     207!            kcond = (TI_PEM(ig,iloop,islope)*TI_PEM(ig,iloop,islope))/volcapa
     208!            tsoil_PEM(ig,iloop,islope) = tsoil_PEM(ig,index_breccia+1,islope) + fluxgeo/kcond*(mlayer_PEM(iloop-1)-mlayer_PEM(index_breccia))
     209!      enddo
     210!        kcond = (TI_PEM(ig,index_bedrock+1,islope)*TI_PEM(ig,index_bedrock+1,islope))/volcapa
     211!        tsoil_PEM(ig,index_bedrock+1,islope) = tsoil_PEM(ig,index_bedrock,islope) + fluxgeo/kcond*(mlayer_PEM(index_bedrock)-mlayer_PEM(index_bedrock-1)) 
     212!
     213!      do iloop=index_bedrock+2,nsoil_PEM
     214!            kcond = (TI_PEM(ig,iloop,islope)*TI_PEM(ig,iloop,islope))/volcapa
     215!            tsoil_PEM(ig,iloop,islope) = tsoil_PEM(ig,index_bedrock+1,islope) + fluxgeo/kcond*(mlayer_PEM(iloop-1)-mlayer_PEM(index_bedrock))
     216!      enddo
     217!      enddo
     218
     219
     220     call soil_pem_ini(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_ave_yr2(:,islope),tsoil_PEM(:,:,islope))
     221     call soil_pem_routine(ngrid,nsoil_PEM,.true.,TI_PEM(:,:,islope),timestep,tsurf_ave_yr2(:,islope),tsoil_PEM(:,:,islope))
     222
    227223   
    228224   else
     
    240236       tsoil_PEM(:,iloop,islope) = tsoil_tmp_yr2(:,iloop,islope)
    241237     enddo
    242    endif
     238   endif !found
    243239
    244240    do it = 1,timelen
     
    263259
    264260
    265 
     261  call get_field("ice_table",ice_table,found)
     262   if(.not.found) then
     263      write(*,*)'PEM settings: failed loading <ice_table>'
     264      write(*,*)'will reconstruct the values of the ice table given the current state'
    266265     call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_ave,watersoil_ave, ice_table)
    267      call update_soil(ngrid,nslope,nsoil_GCM,nsoil_PEM,tend_h2oglaciers,waterice,global_ave_pressure,ice_table,TI_PEM)
    268 
     266     call update_soil(ngrid,nslope,nsoil_PEM,tend_h2oglaciers,waterice,global_ave_pressure,ice_table,TI_PEM)
     267     do islope = 1,nslope
     268     call soil_pem_ini(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_ave_yr2(:,islope),tsoil_PEM(:,:,islope))
     269     enddo
     270   endif
    269271
    270272print *,'PEMETAT0: ICE TABLE  DONE'
     
    338340      do ig = 1,ngrid
    339341
    340           if(TI_PEM(ig,nsoil_GCM,islope).lt.TI_breccia) then
     342          if(TI_PEM(ig,index_breccia,islope).lt.TI_breccia) then
    341343!!! transition
    342              delta = 50.
    343              TI_PEM(ig,nsoil_GCM+1,islope) =sqrt((layer_PEM(nsoil_GCM+1)-layer_PEM(nsoil_GCM))/ &
    344             (((delta-layer_PEM(nsoil_GCM))/(TI_PEM(ig,nsoil_GCM,islope)**2))+ &
    345                       ((layer_PEM(nsoil_GCM+1)-delta)/(TI_breccia**2))))
    346 
    347           do iloop=nsoil_GCM+2,n_1km
     344             delta = depth_breccia
     345             TI_PEM(ig,index_breccia+1,islope) =sqrt((layer_PEM(index_breccia+1)-layer_PEM(index_breccia))/ &
     346            (((delta-layer_PEM(index_breccia))/(TI_PEM(ig,index_breccia,islope)**2))+ &
     347                      ((layer_PEM(index_breccia+1)-delta)/(TI_breccia**2))))
     348
     349          do iloop=index_breccia+2,index_bedrock
    348350            TI_PEM(ig,iloop,islope) = TI_breccia
    349351         enddo     
    350352         else ! we keep the high ti values
    351            do iloop=nsoil_GCM+1,n_1km
    352                   TI_PEM(ig,iloop,islope) = TI_PEM(ig,nsoil_GCM,islope)
     353           do iloop=index_breccia+1,index_bedrock
     354                  TI_PEM(ig,iloop,islope) = TI_PEM(ig,index_breccia,islope)
    353355           enddo
    354356         endif
    355357
    356358!! transition
    357              delta = 1000.
    358              TI_PEM(ig,n_1km+1,islope) = sqrt((layer_PEM(n_1km+1)-layer_PEM(n_1km))/ &
    359             (((delta-layer_PEM(n_1km))/(TI_PEM(ig,n_1km,islope)**2))+ &
    360                       ((layer_PEM(n_1km+1)-delta)/(TI_breccia**2))))
    361           do iloop=n_1km+2,nsoil_PEM
     359             delta = depth_bedrock
     360             TI_PEM(ig,index_bedrock+1,islope) = sqrt((layer_PEM(index_bedrock+1)-layer_PEM(index_bedrock))/ &
     361            (((delta-layer_PEM(index_bedrock))/(TI_PEM(ig,index_bedrock,islope)**2))+ &
     362                      ((layer_PEM(index_bedrock+1)-delta)/(TI_breccia**2))))
     363          do iloop=index_bedrock+2,nsoil_PEM
    362364            TI_PEM(ig,iloop,islope) = TI_bedrock
    363365         enddo   
     
    369371 enddo
    370372!!! zone de transition
    371 delta = 50.
     373delta = depth_breccia
    372374do ig = 1,ngrid
    373       if(inertiedat_PEM(ig,nsoil_GCM).lt.TI_breccia) then
    374 inertiedat_PEM(ig,nsoil_GCM+1) = sqrt((layer_PEM(nsoil_GCM+1)-layer_PEM(nsoil_GCM))/ &
    375             (((delta-layer_PEM(nsoil_GCM))/(inertiedat(ig,nsoil_GCM)**2))+ &
    376                       ((layer_PEM(nsoil_GCM+1)-delta)/(TI_breccia**2))))
    377 
    378 
    379  do iloop = nsoil_GCM+2,n_1km
     375      if(inertiedat_PEM(ig,index_breccia).lt.TI_breccia) then
     376inertiedat_PEM(ig,index_breccia+1) = sqrt((layer_PEM(index_breccia+1)-layer_PEM(index_breccia))/ &
     377            (((delta-layer_PEM(index_breccia))/(inertiedat(ig,index_breccia)**2))+ &
     378                      ((layer_PEM(index_breccia+1)-delta)/(TI_breccia**2))))
     379
     380
     381 do iloop = index_breccia+2,index_bedrock
    380382
    381383       inertiedat_PEM(ig,iloop) = TI_breccia
     
    383385 enddo
    384386else
    385    do iloop = nsoil_GCM+1,n_1km
    386        inertiedat_PEM(ig,iloop) = inertiedat_PEM(ig,nsoil_GCM)
     387   do iloop = index_breccia+1,index_bedrock
     388       inertiedat_PEM(ig,iloop) = inertiedat_PEM(ig,index_breccia)
    387389    enddo
    388390
     
    392394
    393395!!! zone de transition
    394 delta = 1000.
     396delta = depth_bedrock
    395397do ig = 1,ngrid
    396 inertiedat_PEM(ig,n_1km+1) = sqrt((layer_PEM(n_1km+1)-layer_PEM(n_1km))/ &
    397             (((delta-layer_PEM(n_1km))/(inertiedat_PEM(ig,n_1km)**2))+ &
    398                       ((layer_PEM(n_1km+1)-delta)/(TI_bedrock**2))))
     398inertiedat_PEM(ig,index_bedrock+1) = sqrt((layer_PEM(index_bedrock+1)-layer_PEM(index_bedrock))/ &
     399            (((delta-layer_PEM(index_bedrock))/(inertiedat_PEM(ig,index_bedrock)**2))+ &
     400                      ((layer_PEM(index_bedrock+1)-delta)/(TI_bedrock**2))))
    399401enddo
    400402
    401403
    402404
    403  do iloop = n_1km+2, nsoil_PEM
     405 do iloop = index_bedrock+2, nsoil_PEM
    404406   do ig = 1,ngrid
    405407      inertiedat_PEM(ig,iloop) = TI_bedrock
     
    414416!b) Soil temperature
    415417    do islope = 1,nslope
    416      do ig = 1,ngrid
    417         kcond = (TI_PEM(ig,nsoil_GCM+1,islope)*TI_PEM(ig,nsoil_GCM+1,islope))/volcapa
    418         tsoil_PEM(ig,nsoil_GCM+1,islope) = tsoil_PEM(ig,nsoil_GCM,islope) + fluxgeo/kcond*(mlayer_PEM(nsoil_GCM)-mlayer_PEM(nsoil_GCM-1))
    419 
    420        do iloop=nsoil_GCM+2,n_1km
    421             kcond = (TI_PEM(ig,iloop,islope)*TI_PEM(ig,iloop,islope))/volcapa
    422             tsoil_PEM(ig,iloop,islope) = tsoil_PEM(ig,nsoil_GCM+1,islope) + fluxgeo/kcond*(mlayer_PEM(iloop-1)-mlayer_PEM(nsoil_GCM))
    423       enddo
    424         kcond = (TI_PEM(ig,n_1km+1,islope)*TI_PEM(ig,n_1km+1,islope))/volcapa
    425         tsoil_PEM(ig,n_1km+1,islope) = tsoil_PEM(ig,n_1km,islope) + fluxgeo/kcond*(mlayer_PEM(n_1km)-mlayer_PEM(n_1km-1))
    426 
    427        do iloop=n_1km+2,nsoil_PEM
    428             kcond = (TI_PEM(ig,iloop,islope)*TI_PEM(ig,iloop,islope))/volcapa
    429             tsoil_PEM(ig,iloop,islope) = tsoil_PEM(ig,n_1km+1,islope) + fluxgeo/kcond*(mlayer_PEM(iloop-1)-mlayer_PEM(n_1km))
    430       enddo
     418!     do ig = 1,ngrid
     419!        kcond = (TI_PEM(ig,index_breccia+1,islope)*TI_PEM(ig,index_breccia+1,islope))/volcapa
     420!        tsoil_PEM(ig,index_breccia+1,islope) = tsoil_PEM(ig,index_breccia,islope) + fluxgeo/kcond*(mlayer_PEM(index_breccia)-mlayer_PEM(index_breccia-1))
     421!
     422!       do iloop=index_breccia+2,index_bedrock
     423!            kcond = (TI_PEM(ig,iloop,islope)*TI_PEM(ig,iloop,islope))/volcapa
     424!            tsoil_PEM(ig,iloop,islope) = tsoil_PEM(ig,index_breccia+1,islope) + fluxgeo/kcond*(mlayer_PEM(iloop-1)-mlayer_PEM(index_breccia))
     425!      enddo
     426!        kcond = (TI_PEM(ig,index_bedrock+1,islope)*TI_PEM(ig,index_bedrock+1,islope))/volcapa
     427!        tsoil_PEM(ig,index_bedrock+1,islope) = tsoil_PEM(ig,index_bedrock,islope) + fluxgeo/kcond*(mlayer_PEM(index_bedrock)-mlayer_PEM(index_bedrock-1))
     428
     429!       do iloop=index_bedrock+2,nsoil_PEM
     430!            kcond = (TI_PEM(ig,iloop,islope)*TI_PEM(ig,iloop,islope))/volcapa
     431!            tsoil_PEM(ig,iloop,islope) = tsoil_PEM(ig,index_bedrock+1,islope) + fluxgeo/kcond*(mlayer_PEM(iloop-1)-mlayer_PEM(index_bedrock))
     432!      enddo
    431433     
    432            do iloop = nsoil_GCM+1,nsoil_PEM
    433              tsoil_PEM(ig,iloop,islope) =  tsoil_PEM(ig,nsoil_GCM,islope)
    434           enddo
    435        enddo
    436 !     call soil_pem_routine(ngrid,nsoil_PEM,.true.,TI_PEM(:,:,islope),timestep,tsurf_ave_yr2(:,islope),tsoil_PEM(:,:,islope))
    437 !     do iloop = 1,2000000
    438 !      write(*,*) 'islope,iloop',islope,iloop
    439 !      call soil_pem_routine(ngrid,nsoil_PEM,.false.,TI_PEM(:,:,islope),timestep,tsurf_ave_yr2(:,islope),tsoil_PEM(:,:,islope))
    440 !     enddo
    441  
     434!       enddo
     435
     436      call soil_pem_ini(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_ave_yr2(:,islope),tsoil_PEM(:,:,islope))
     437      call soil_pem_routine(ngrid,nsoil_PEM,.true.,TI_PEM(:,:,islope),timestep,tsurf_ave_yr2(:,islope),tsoil_PEM(:,:,islope))
     438
    442439   
    443440    do it = 1,timelen
     
    446443        enddo
    447444     enddo
     445 
    448446      do isoil = nsoil_GCM+1,nsoil_PEM
    449447        do ig = 1,ngrid
     
    451449        enddo
    452450      enddo
    453 enddo
     451enddo !islope
    454452print *,'PEMETAT0: TSOIL DONE  '
    455453!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    456454!c) Ice table   
    457455     call computeice_table_equilibrium(ngrid,nslope,nsoil_PEM,watercaptag,watersurf_ave,watersoil_ave, ice_table)
    458      call update_soil(ngrid,nslope,nsoil_GCM,nsoil_PEM,tend_h2oglaciers,waterice,global_ave_pressure,ice_table,TI_PEM)
     456     call update_soil(ngrid,nslope,nsoil_PEM,tend_h2oglaciers,waterice,global_ave_pressure,ice_table,TI_PEM)
     457     do islope = 1,nslope
     458     call soil_pem_ini(ngrid,nsoil_PEM,TI_PEM(:,:,islope),tsurf_ave_yr2(:,islope),tsoil_PEM(:,:,islope))
     459     enddo
     460   
    459461
    460462
     
    483485endif !soil_pem
    484486
     487
     488
     489!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     490   
     491
     492
    485493!. e) water reservoir
    486494
     
    489497      do ig=1,ngrid
    490498        if(watercaptag(ig)) then
    491            water_reservoir=water_reservoir_nom
     499           water_reservoir(ig)=water_reservoir_nom
    492500        else
    493            water_reservoir=0.
     501           water_reservoir(ig)=0.
    494502        endif
    495503      enddo
     
    498506
    499507endif ! of if (startphy_file)
    500 
    501 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    502508
    503509if(soil_pem) then
  • trunk/LMDZ.COMMON/libf/evolution/pemredem.F90

    r2888 r2895  
    119119  call put_field('water_reservoir','water_reservoir', &
    120120           water_reservoir,year_tot)
    121   call put_field("water_reservoir","water_reservoir", &
    122                  water_reservoir,year_tot)
    123 
    124121    if(soil_pem) then
    125122 
  • trunk/LMDZ.COMMON/libf/evolution/read_data_GCM.F90

    r2893 r2895  
    7777
    7878      allocate(h2o_ice_s_slope(iim+1,jjm+1,nslope,timelen))
    79       allocate(watercap_slope(iim_input+1,jjm_input+1,nslope,timelen))
    8079
    8180  print *, "Opening ", fichnom, "..."
     
    123122DO islope=1,nslope
    124123       write(num,fmt='(i2.2)') islope
    125        call get_var3("watercap_slope"//num,watercap_slope(:,:,islope,:))   
     124!       call get_var3("watercap_slope"//num,watercap_slope(:,:,islope,:))
     125        watercap_slope(:,:,:,:)= 0.
    126126ENDDO           
    127127     print *, "Downloading data for watercap_slope done"
     
    187187! Compute the minimum over the year for each point
    188188  print *, "Computing the min of h2o_ice_slope"
    189   min_h2o_ice_slope(:,:,:)=minval(h2o_ice_s_slope+watercap_slope,4)
     189!  min_h2o_ice_slope(:,:,:)=minval(h2o_ice_s_slope+watercap_slope,4)
     190  min_h2o_ice_slope(:,:,:)=minval(h2o_ice_s_slope,4)
    190191  print *, "Computing the min of co2_ice_slope"
    191192  min_co2_ice_slope(:,:,:)=minval(co2_ice_slope,4)
     
    210211            min_co2_ice_slope(i,j,islope)  = 0.
    211212          endif
    212 !          if (min_h2o_ice_slope(i,j,islope).LT.0) then
    213 !            min_h2o_ice_slope(i,j,islope)  = 0.
    214 !          endif
     213          if (min_h2o_ice_slope(i,j,islope).LT.0) then
     214            min_h2o_ice_slope(i,j,islope)  = 0.
     215          endif
    215216       ENDDO
    216217    ENDDO
  • trunk/LMDZ.COMMON/libf/evolution/soil_pem.F90

    r2888 r2895  
    1515!  Note: depths of layers and mid-layers, soil thermal inertia and
    1616!        heat capacity are commons in comsoil_PEM.h
    17 !        A convergence loop is added until equilibrium
    1817!-----------------------------------------------------------------------
    1918
  • trunk/LMDZ.COMMON/libf/evolution/soil_settings_PEM.F

    r2855 r2895  
    44
    55!      use netcdf
    6       use comsoil_h_PEM, only: layer_PEM, mlayer_PEM
    7       use comsoil_h, only: inertiedat,layer,mlayer, volcapa
     6      use comsoil_h_PEM, only: layer_PEM, mlayer_PEM,
     7     &   depth_breccia,depth_bedrock,index_breccia,index_bedrock 
     8      use comsoil_h, only: inertiedat,layer,mlayer, volcapa                       
     9
     10
    811      use iostart, only: inquire_field_ndims, get_var, get_field,
    912     &                   inquire_field, inquire_dimension_length
     
    8689      enddo
    8790
     91
     92! 3. Index for subsurface layering
     93! ------------------
     94       write(*,*) 'depth=',depth_breccia,depth_bedrock
     95      index_breccia= 1
     96      do iloop = 1,nsoil_PEM-1
     97        if (depth_breccia.ge.layer_PEM(iloop)) then
     98          index_breccia=iloop
     99        else
     100         exit
     101        endif
     102      enddo
     103
     104      index_bedrock= 1
     105      do iloop = 1,nsoil_PEM-1
     106        if (depth_bedrock.ge.layer_PEM(iloop)) then
     107          index_bedrock=iloop
     108        else
     109         exit
     110        endif
     111      enddo
     112
     113
    88114      end subroutine soil_settings_PEM
  • trunk/LMDZ.COMMON/libf/evolution/update_soil.F90

    r2888 r2895  
    1    SUBROUTINE update_soil(ngrid,nslope,nsoil_GCM,nsoil_PEM,tendencies_waterice,waterice,p_avg_new,ice_depth,TI_PEM)
     1   SUBROUTINE update_soil(ngrid,nslope,nsoil_PEM,tendencies_waterice,waterice,p_avg_new,ice_depth,TI_PEM)
    22#ifndef CPP_STD
    33 USE comsoil_h, only:  inertiedat, volcapa
    4  USE comsoil_h_PEM, only: layer_PEM,n_1km,inertiedat_PEM
     4 USE comsoil_h_PEM, only: layer_PEM,n_1km,inertiedat_PEM,depth_breccia,depth_bedrock,index_breccia,index_bedrock,reg_thprop_dependp
    55 USE vertical_layers_mod, ONLY: ap,bp
    66 USE comsoil_h_PEM, only: n_1km
    77 implicit none
    88! Input:
    9  INTEGER,INTENT(IN) ::  ngrid, nslope,nsoil_GCM, nsoil_PEM
     9 INTEGER,INTENT(IN) ::  ngrid, nslope, nsoil_PEM
    1010 REAL,INTENT(IN) :: p_avg_new
    1111 REAL,INTENT(IN) :: tendencies_waterice(ngrid,nslope)
     
    4141
    4242
    43 
    4443 do islope = 1,nslope
    4544   regolith_inertia(:,islope) = inertiedat_PEM(:,1)
    4645   do ig = 1,ngrid
    47 
    4846      if((tendencies_waterice(ig,islope).lt.-1e-5).and.(waterice(ig,islope).eq.0)) then
    4947              regolith_inertia(ig,islope) = inertie_averaged
    5048       endif
    51         write(*,*) 'ig,islope',ig,islope,inertie_thresold,TI_PEM(ig,1,islope)
    52        if(TI_PEM(ig,1,islope).lt.inertie_thresold) then
    53 !          regolith_inertia(ig,islope) = regolith_inertia(ig,islope)*(p_avg_new/P610)**0.3
    54        endif
    55        TI_breccia_new = TI_breccia !*(p_avg_new/P610)**0.3
     49      if(reg_thprop_dependp) then
     50          if(TI_PEM(ig,1,islope).lt.inertie_thresold) then
     51            regolith_inertia(ig,islope) = regolith_inertia(ig,islope)*(p_avg_new/P610)**0.3
     52          endif
     53         TI_breccia_new = TI_breccia*(p_avg_new/P610)**0.3
     54      else
     55         TI_breccia_new = TI_breccia
     56      endif
    5657   enddo
    5758 enddo
     
    6263do  islope=1,nslope
    6364   do ig = 1,ngrid
    64      do iloop = 1,nsoil_GCM
     65     do iloop = 1,index_breccia
    6566         TI_PEM(ig,iloop,islope) = regolith_inertia(ig,islope)
    6667     enddo
    6768     if(regolith_inertia(ig,islope).lt.TI_breccia_new) then
    6869!!! transition
    69              delta = 50.
    70              TI_PEM(ig,nsoil_GCM+1,islope) = sqrt((layer_PEM(nsoil_GCM+1)-layer_PEM(nsoil_GCM))/ &
    71             (((delta-layer_PEM(nsoil_GCM))/(TI_PEM(ig,nsoil_GCM,islope)**2))+ &
    72                       ((layer_PEM(nsoil_GCM+1)-delta)/(TI_breccia_new**2))))
    73             do iloop=nsoil_GCM+2,n_1km
     70             delta = depth_breccia
     71             TI_PEM(ig,index_breccia+1,islope) = sqrt((layer_PEM(index_breccia+1)-layer_PEM(index_breccia))/ &
     72            (((delta-layer_PEM(index_breccia))/(TI_PEM(ig,index_breccia,islope)**2))+ &
     73                      ((layer_PEM(index_breccia+1)-delta)/(TI_breccia_new**2))))
     74            do iloop=index_breccia+2,index_bedrock
    7475              TI_PEM(ig,iloop,islope) = TI_breccia_new
    7576            enddo     
    7677      else ! we keep the high ti values
    77             do iloop=nsoil_GCM+1,n_1km
    78               TI_PEM(ig,iloop,islope) = TI_PEM(ig,nsoil_GCM,islope)
     78            do iloop=index_breccia+1,index_bedrock
     79              TI_PEM(ig,iloop,islope) = TI_PEM(ig,index_breccia,islope)
    7980            enddo
    8081       endif ! TI PEM and breccia comparison
    8182!! transition
    82        delta = 1000.
    83        TI_PEM(ig,n_1km+1,islope) = sqrt((layer_PEM(n_1km+1)-layer_PEM(n_1km))/ &
    84             (((delta-layer_PEM(n_1km))/(TI_PEM(ig,n_1km,islope)**2))+ &
    85             ((layer_PEM(n_1km+1)-delta)/(TI_bedrock**2))))
    86        do iloop=n_1km+2,nsoil_PEM
     83       delta = depth_bedrock
     84       TI_PEM(ig,index_bedrock+1,islope) = sqrt((layer_PEM(index_bedrock+1)-layer_PEM(index_bedrock))/ &
     85            (((delta-layer_PEM(index_bedrock))/(TI_PEM(ig,index_bedrock,islope)**2))+ &
     86            ((layer_PEM(index_bedrock+1)-delta)/(TI_bedrock**2))))
     87       do iloop=index_bedrock+2,nsoil_PEM
    8788            TI_PEM(ig,iloop,islope) = TI_bedrock
    8889       enddo   
     
    9495  do ig=1,ngrid
    9596    do islope=1,nslope
    96       do iloop = 1,n_1km
    97        TI_PEM(ig,iloop,islope) = TI_PEM(ig,1,islope)
    98       enddo
     97!      do iloop = 1,index_bedrock
     98!       TI_PEM(ig,iloop,islope) = TI_PEM(ig,1,islope)
     99!      enddo
    99100  if (ice_depth(ig,islope).gt. -1.e-10) then
    100101! 3.0 FIrst if permanent ice
    101102   if (ice_depth(ig,islope).lt. 1e-10) then
    102103      do iloop = 1,nsoil_PEM
    103        TI_PEM(ig,iloop,islope)=max(ice_inertia,inertiedat_PEM(ig,iloop))
     104       TI_PEM(ig,iloop,islope)=ice_inertia
    104105      enddo
    105106     else
  • trunk/LMDZ.MARS/README

    r2894 r2895  
    38743874If false, it is set to constant (to the value of the tab_cntrl in the start)
    38753875
     3876== 10/02/2023 == LL
     3877PEM
     3878Soil temperature initialisation has been updated
     3879Conf_PEM improved by adding some options to the users (thermal regolith depend on the pressure, depth of the subsurface layers, etc.)
     3880Minor edits then (+ svn update with RV had some issues, so there are some "artefact changes" ...)
     3881
Note: See TracChangeset for help on using the changeset viewer.