1 | MODULE comsoil_h_PEM |
---|
2 | |
---|
3 | implicit none |
---|
4 | |
---|
5 | integer, parameter :: nsoilmx_PEM = 68 ! number of layers in the PEM |
---|
6 | real, allocatable, dimension(:) :: layer_PEM ! soil layer depths [m] |
---|
7 | real, allocatable, dimension(:) :: mlayer_PEM ! soil mid-layer depths [m] |
---|
8 | real, allocatable, dimension(:,:,:) :: TI_PEM ! soil thermal inertia [SI] |
---|
9 | real, allocatable, dimension(:,:) :: inertiedat_PEM ! soil thermal inertia saved as reference for current climate [SI] |
---|
10 | ! Variables (FC: built in firstcall in soil.F) |
---|
11 | real, allocatable, dimension(:,:,:) :: tsoil_PEM ! sub-surface temperatures [K] |
---|
12 | real, allocatable, dimension(:,:) :: mthermdiff_PEM ! (FC) mid-layer thermal diffusivity [SI] |
---|
13 | real, allocatable, dimension(:,:) :: thermdiff_PEM ! (FC) inter-layer thermal diffusivity [SI] |
---|
14 | real, allocatable, dimension(:) :: coefq_PEM ! (FC) q_{k+1/2} coefficients [SI] |
---|
15 | real, allocatable, dimension(:,:) :: coefd_PEM ! (FC) d_k coefficients [SI] |
---|
16 | real, allocatable, dimension(:,:) :: alph_PEM ! (FC) alpha_k coefficients [SI] |
---|
17 | real, allocatable, dimension(:,:) :: beta_PEM ! beta_k coefficients [SI] |
---|
18 | real :: mu_PEM ! mu coefficient [SI] |
---|
19 | real :: fluxgeo ! Geothermal flux [W/m^2] |
---|
20 | real :: depth_breccia ! Depth at which we have breccia [m] |
---|
21 | real :: depth_bedrock ! Depth at which we have bedrock [m] |
---|
22 | integer :: index_breccia ! last index of the depth grid before having breccia |
---|
23 | integer :: index_bedrock ! last index of the depth grid before having bedrock |
---|
24 | logical :: soil_pem ! True by default, to run with the subsurface physic. Read in pem.def |
---|
25 | real :: ini_huge_h2oice ! Initial value for huge reservoirs of H2O ice [kg/m^2] |
---|
26 | logical :: reg_thprop_dependp ! thermal properites of the regolith vary with the surface pressure |
---|
27 | |
---|
28 | !======================================================================= |
---|
29 | contains |
---|
30 | !======================================================================= |
---|
31 | |
---|
32 | SUBROUTINE ini_comsoil_h_PEM(ngrid,nslope) |
---|
33 | |
---|
34 | implicit none |
---|
35 | |
---|
36 | integer, intent(in) :: ngrid ! number of atmospheric columns |
---|
37 | integer, intent(in) :: nslope ! number of slope within a mesh |
---|
38 | |
---|
39 | allocate(layer_PEM(nsoilmx_PEM)) |
---|
40 | allocate(mlayer_PEM(0:nsoilmx_PEM - 1)) |
---|
41 | allocate(TI_PEM(ngrid,nsoilmx_PEM,nslope)) |
---|
42 | allocate(tsoil_PEM(ngrid,nsoilmx_PEM,nslope)) |
---|
43 | allocate(mthermdiff_PEM(ngrid,0:nsoilmx_PEM - 1)) |
---|
44 | allocate(thermdiff_PEM(ngrid,nsoilmx_PEM - 1)) |
---|
45 | allocate(coefq_PEM(0:nsoilmx_PEM - 1)) |
---|
46 | allocate(coefd_PEM(ngrid,nsoilmx_PEM - 1)) |
---|
47 | allocate(alph_PEM(ngrid,nsoilmx_PEM - 1)) |
---|
48 | allocate(beta_PEM(ngrid,nsoilmx_PEM - 1)) |
---|
49 | allocate(inertiedat_PEM(ngrid,nsoilmx_PEM)) |
---|
50 | |
---|
51 | END SUBROUTINE ini_comsoil_h_PEM |
---|
52 | |
---|
53 | !======================================================================= |
---|
54 | |
---|
55 | SUBROUTINE end_comsoil_h_PEM |
---|
56 | |
---|
57 | implicit none |
---|
58 | |
---|
59 | if (allocated(layer_PEM)) deallocate(layer_PEM) |
---|
60 | if (allocated(mlayer_PEM)) deallocate(mlayer_PEM) |
---|
61 | if (allocated(TI_PEM)) deallocate(TI_PEM) |
---|
62 | if (allocated(tsoil_PEM)) deallocate(tsoil_PEM) |
---|
63 | if (allocated(mthermdiff_PEM)) deallocate(mthermdiff_PEM) |
---|
64 | if (allocated(thermdiff_PEM)) deallocate(thermdiff_PEM) |
---|
65 | if (allocated(coefq_PEM)) deallocate(coefq_PEM) |
---|
66 | if (allocated(coefd_PEM)) deallocate(coefd_PEM) |
---|
67 | if (allocated(alph_PEM)) deallocate(alph_PEM) |
---|
68 | if (allocated(beta_PEM)) deallocate(beta_PEM) |
---|
69 | if (allocated(inertiedat_PEM)) deallocate(inertiedat_PEM) |
---|
70 | |
---|
71 | END SUBROUTINE end_comsoil_h_PEM |
---|
72 | |
---|
73 | END MODULE comsoil_h_PEM |
---|