source: trunk/LMDZ.COMMON/libf/evolution/comsoil_h_PEM.F90 @ 2872

Last change on this file since 2872 was 2863, checked in by llange, 3 years ago

PEM
H2O adsorption is now computed. Total mass of H2o adsorbded is written in the restart_PEM.
+Minor fixes and edit
LL & RV

File size: 3.3 KB
Line 
1module comsoil_h_PEM
2
3implicit none
4  integer, parameter :: nsoilmx_PEM = 27               ! number of layers in the PEM
5  integer, parameter :: n_1km = 23                     ! index at which we have overcome 1km
6
7  real,save,allocatable,dimension(:) :: layer_PEM      ! soil layer depths   [m]
8  real,save,allocatable,dimension(:) :: mlayer_PEM     ! soil mid-layer depths [m]
9  real,save,allocatable,dimension(:,:,:) :: TI_PEM     ! soil thermal inertia [SI]
10    real,save,allocatable,dimension(:,:) :: inertiedat_PEM ! soil thermal inertia saved as reference for current climate [SI]
11  ! variables (FC: built in firstcall in soil.F)
12  REAL,SAVE,ALLOCATABLE :: tsoil_PEM(:,:,:)       ! sub-surface temperatures [K]
13  real,save,allocatable :: mthermdiff_PEM(:,:)  ! (FC) mid-layer thermal diffusivity [SI]
14  real,save,allocatable :: thermdiff_PEM(:,:)   ! (FC) inter-layer thermal diffusivity [SI]
15  real,save,allocatable :: coefq_PEM(:)         ! (FC) q_{k+1/2} coefficients [SI]
16  real,save,allocatable :: coefd_PEM(:,:)       ! (FC) d_k coefficients [SI]
17  real,save,allocatable :: alph_PEM(:,:,:)      ! (FC) alpha_k coefficients [SI]
18  real,save,allocatable :: beta_PEM(:,:,:)      ! beta_k coefficients [SI]
19  real,save :: mu_PEM                           ! mu coefficient [SI]
20  real,parameter :: fluxgeo = 30e-3             ! Geothermal flux [W/m^2]
21  real, save, allocatable :: co2_adsorbded_phys(:,:,:)  ! co2 that is in the regolith [kg/m^2]
22  real, save, allocatable :: h2o_adsorbded_phys(:,:,:)  ! h2o that is in the regolith [kg/m^2]
23  LOGICAL soil_pem  ! True by default, to run with the subsurface physic. Read in pem.def
24
25contains
26
27  subroutine ini_comsoil_h_PEM(ngrid,nslope)
28 
29  implicit none
30  integer,intent(in) :: ngrid ! number of atmospheric columns
31  integer,intent(in) :: nslope ! number of slope within a mesh
32
33    allocate(layer_PEM(nsoilmx_PEM))
34    allocate(mlayer_PEM(0:nsoilmx_PEM-1))
35    allocate(TI_PEM(ngrid,nsoilmx_PEM,nslope))
36    allocate(tsoil_PEM(ngrid,nsoilmx_PEM,nslope))
37    allocate(mthermdiff_PEM(ngrid,0:nsoilmx_PEM-1))
38    allocate(thermdiff_PEM(ngrid,nsoilmx_PEM-1))
39    allocate(coefq_PEM(0:nsoilmx_PEM-1))
40    allocate(coefd_PEM(ngrid,nsoilmx_PEM-1))
41    allocate(alph_PEM(ngrid,nsoilmx_PEM-1,nslope))
42    allocate(beta_PEM(ngrid,nsoilmx_PEM-1,nslope))
43    allocate(inertiedat_PEM(ngrid,nsoilmx_PEM))
44    allocate(co2_adsorbded_phys(ngrid,nsoilmx_PEM,nslope))
45    allocate(h2o_adsorbded_phys(ngrid,nsoilmx_PEM,nslope))
46  end subroutine ini_comsoil_h_PEM
47
48
49  subroutine end_comsoil_h_PEM
50
51  implicit none
52
53    if (allocated(layer_PEM)) deallocate(layer_PEM)
54    if (allocated(mlayer_PEM)) deallocate(mlayer_PEM)
55    if (allocated(TI_PEM)) deallocate(TI_PEM)
56    if (allocated(tsoil_PEM)) deallocate(tsoil_PEM)
57    if (allocated(mthermdiff_PEM)) deallocate(mthermdiff_PEM)
58    if (allocated(thermdiff_PEM)) deallocate(thermdiff_PEM)
59    if (allocated(coefq_PEM)) deallocate(coefq_PEM)
60    if (allocated(coefd_PEM)) deallocate(coefd_PEM)
61    if (allocated(alph_PEM)) deallocate(alph_PEM)
62    if (allocated(beta_PEM)) deallocate(beta_PEM)
63    if (allocated(inertiedat_PEM)) deallocate(inertiedat_PEM)
64    if (allocated(co2_adsorbded_phys)) deallocate(co2_adsorbded_phys)
65    if (allocated(h2o_adsorbded_phys)) deallocate(h2o_adsorbded_phys)
66  end subroutine end_comsoil_h_PEM
67
68end module comsoil_h_PEM
Note: See TracBrowser for help on using the repository browser.