1 | module comsoil_h_PEM |
---|
2 | |
---|
3 | implicit none |
---|
4 | ! nsoilmx : number of subterranean layers |
---|
5 | !EM: old soil routine: integer, parameter :: nsoilmx = 10 |
---|
6 | integer, parameter :: nsoilmx_PEM = 27 |
---|
7 | integer, parameter :: n_1km = 23 |
---|
8 | |
---|
9 | real,save,allocatable,dimension(:) :: layer_PEM ! soil layer depths |
---|
10 | real,save,allocatable,dimension(:) :: mlayer_PEM ! soil mid-layer depths |
---|
11 | real,save,allocatable,dimension(:,:,:) :: TI_PEM ! soil thermal inertia |
---|
12 | real,save,allocatable,dimension(:,:) :: inertiedat_PEM ! soil thermal inertia |
---|
13 | ! variables (FC: built in firstcall in soil.F) |
---|
14 | REAL,SAVE,ALLOCATABLE :: tsoil_PEM(:,:,:) ! sub-surface temperatures (K) |
---|
15 | real,save,allocatable :: mthermdiff_PEM(:,:) ! (FC) mid-layer thermal diffusivity |
---|
16 | real,save,allocatable :: thermdiff_PEM(:,:) ! (FC) inter-layer thermal diffusivity |
---|
17 | real,save,allocatable :: coefq_PEM(:) ! (FC) q_{k+1/2} coefficients |
---|
18 | real,save,allocatable :: coefd_PEM(:,:) ! (FC) d_k coefficients |
---|
19 | real,save,allocatable :: alph_PEM(:,:,:) ! (FC) alpha_k coefficients |
---|
20 | real,save,allocatable :: beta_PEM(:,:,:) ! beta_k coefficients |
---|
21 | real,save :: mu_PEM |
---|
22 | real,parameter :: fluxgeo = 30e-3 !W/m^2 |
---|
23 | real, save, allocatable :: co2_adsorbded_phys(:,:,:) ! co2 that is in the regolith (kg/m^2) |
---|
24 | |
---|
25 | contains |
---|
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)) !soil layer depths |
---|
34 | allocate(mlayer_PEM(0:nsoilmx_PEM-1)) ! soil mid-layer depths |
---|
35 | allocate(TI_PEM(ngrid,nsoilmx_PEM,nslope)) ! soil thermal inertia |
---|
36 | allocate(tsoil_PEM(ngrid,nsoilmx_PEM,nslope)) ! soil temperatures |
---|
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)) ! soil thermal inertia |
---|
44 | allocate(co2_adsorbded_phys(ngrid,nsoilmx_PEM,nslope)) |
---|
45 | end subroutine ini_comsoil_h_PEM |
---|
46 | |
---|
47 | |
---|
48 | subroutine end_comsoil_h_PEM |
---|
49 | |
---|
50 | implicit none |
---|
51 | |
---|
52 | if (allocated(layer_PEM)) deallocate(layer_PEM) |
---|
53 | if (allocated(mlayer_PEM)) deallocate(mlayer_PEM) |
---|
54 | if (allocated(TI_PEM)) deallocate(TI_PEM) |
---|
55 | if (allocated(tsoil_PEM)) deallocate(tsoil_PEM) |
---|
56 | if (allocated(mthermdiff_PEM)) deallocate(mthermdiff_PEM) |
---|
57 | if (allocated(thermdiff_PEM)) deallocate(thermdiff_PEM) |
---|
58 | if (allocated(coefq_PEM)) deallocate(coefq_PEM) |
---|
59 | if (allocated(coefd_PEM)) deallocate(coefd_PEM) |
---|
60 | if (allocated(alph_PEM)) deallocate(alph_PEM) |
---|
61 | if (allocated(beta_PEM)) deallocate(beta_PEM) |
---|
62 | if (allocated(inertiedat_PEM)) deallocate(inertiedat_PEM) |
---|
63 | if (allocated(co2_adsorbded_phys)) deallocate(co2_adsorbded_phys) |
---|
64 | end subroutine end_comsoil_h_PEM |
---|
65 | |
---|
66 | end module comsoil_h_PEM |
---|