[2794] | 1 | module comsoil_h_PEM |
---|
| 2 | |
---|
| 3 | implicit none |
---|
[2855] | 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 |
---|
[2794] | 6 | |
---|
[2855] | 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] |
---|
[2794] | 11 | ! variables (FC: built in firstcall in soil.F) |
---|
[2855] | 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] |
---|
[2888] | 17 | real,save,allocatable :: alph_PEM(:,:) ! (FC) alpha_k coefficients [SI] |
---|
| 18 | real,save,allocatable :: beta_PEM(:,:) ! beta_k coefficients [SI] |
---|
[2855] | 19 | real,save :: mu_PEM ! mu coefficient [SI] |
---|
[2888] | 20 | real,save :: fluxgeo ! Geothermal flux [W/m^2] |
---|
[2895] | 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 |
---|
[2855] | 25 | LOGICAL soil_pem ! True by default, to run with the subsurface physic. Read in pem.def |
---|
[2885] | 26 | real,save,allocatable,dimension(:) :: water_reservoir ! Large reserve of water [kg/m^2] |
---|
[2888] | 27 | real,save :: water_reservoir_nom |
---|
[2895] | 28 | logical, save :: reg_thprop_dependp ! thermal properites of the regolith vary with the surface pressure |
---|
| 29 | |
---|
[2794] | 30 | contains |
---|
| 31 | |
---|
| 32 | subroutine ini_comsoil_h_PEM(ngrid,nslope) |
---|
| 33 | |
---|
| 34 | implicit none |
---|
| 35 | integer,intent(in) :: ngrid ! number of atmospheric columns |
---|
| 36 | integer,intent(in) :: nslope ! number of slope within a mesh |
---|
| 37 | |
---|
[2863] | 38 | allocate(layer_PEM(nsoilmx_PEM)) |
---|
| 39 | allocate(mlayer_PEM(0:nsoilmx_PEM-1)) |
---|
| 40 | allocate(TI_PEM(ngrid,nsoilmx_PEM,nslope)) |
---|
| 41 | allocate(tsoil_PEM(ngrid,nsoilmx_PEM,nslope)) |
---|
[2794] | 42 | allocate(mthermdiff_PEM(ngrid,0:nsoilmx_PEM-1)) |
---|
| 43 | allocate(thermdiff_PEM(ngrid,nsoilmx_PEM-1)) |
---|
| 44 | allocate(coefq_PEM(0:nsoilmx_PEM-1)) |
---|
| 45 | allocate(coefd_PEM(ngrid,nsoilmx_PEM-1)) |
---|
[2888] | 46 | allocate(alph_PEM(ngrid,nsoilmx_PEM-1)) |
---|
| 47 | allocate(beta_PEM(ngrid,nsoilmx_PEM-1)) |
---|
[2863] | 48 | allocate(inertiedat_PEM(ngrid,nsoilmx_PEM)) |
---|
[2885] | 49 | allocate(water_reservoir(ngrid)) |
---|
[2794] | 50 | end subroutine ini_comsoil_h_PEM |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | subroutine end_comsoil_h_PEM |
---|
| 54 | |
---|
| 55 | implicit none |
---|
| 56 | |
---|
| 57 | if (allocated(layer_PEM)) deallocate(layer_PEM) |
---|
| 58 | if (allocated(mlayer_PEM)) deallocate(mlayer_PEM) |
---|
| 59 | if (allocated(TI_PEM)) deallocate(TI_PEM) |
---|
| 60 | if (allocated(tsoil_PEM)) deallocate(tsoil_PEM) |
---|
| 61 | if (allocated(mthermdiff_PEM)) deallocate(mthermdiff_PEM) |
---|
| 62 | if (allocated(thermdiff_PEM)) deallocate(thermdiff_PEM) |
---|
| 63 | if (allocated(coefq_PEM)) deallocate(coefq_PEM) |
---|
| 64 | if (allocated(coefd_PEM)) deallocate(coefd_PEM) |
---|
| 65 | if (allocated(alph_PEM)) deallocate(alph_PEM) |
---|
| 66 | if (allocated(beta_PEM)) deallocate(beta_PEM) |
---|
| 67 | if (allocated(inertiedat_PEM)) deallocate(inertiedat_PEM) |
---|
[2885] | 68 | if (allocated(water_reservoir)) deallocate(water_reservoir) |
---|
[2794] | 69 | end subroutine end_comsoil_h_PEM |
---|
| 70 | |
---|
| 71 | end module comsoil_h_PEM |
---|