1 | module comsoil_h |
---|
2 | |
---|
3 | implicit none |
---|
4 | ! nsoilmx : number of subterranean layers |
---|
5 | !EM: old soil routine: integer, parameter :: nsoilmx = 10 |
---|
6 | integer, parameter :: nsoilmx = 18 |
---|
7 | |
---|
8 | real,save,allocatable,dimension(:) :: layer ! soil layer depths |
---|
9 | real,save,allocatable,dimension(:) :: mlayer ! soil mid-layer depths |
---|
10 | real,save,allocatable,dimension(:,:) :: inertiedat ! soil thermal inertia |
---|
11 | real,save :: volcapa ! soil volumetric heat capacity |
---|
12 | ! NB: volcapa is read fromn control(35) from physicq start file |
---|
13 | ! in physdem (or set via tabfi, or initialized in |
---|
14 | ! soil_settings.F) |
---|
15 | |
---|
16 | ! variables (FC: built in firstcall in soil.F) |
---|
17 | REAL,SAVE,ALLOCATABLE :: tsoil(:,:) ! sub-surface temperatures (K) |
---|
18 | real,save,allocatable :: mthermdiff(:,:) ! (FC) mid-layer thermal diffusivity |
---|
19 | real,save,allocatable :: thermdiff(:,:) ! (FC) inter-layer thermal diffusivity |
---|
20 | real,save,allocatable :: coefq(:) ! (FC) q_{k+1/2} coefficients |
---|
21 | real,save,allocatable :: coefd(:,:) ! (FC) d_k coefficients |
---|
22 | real,save,allocatable :: alph(:,:) ! (FC) alpha_k coefficients |
---|
23 | real,save,allocatable :: beta(:,:) ! beta_k coefficients |
---|
24 | real,save :: mu |
---|
25 | |
---|
26 | contains |
---|
27 | |
---|
28 | subroutine ini_comsoil_h(ngrid) |
---|
29 | |
---|
30 | implicit none |
---|
31 | integer,intent(in) :: ngrid ! number of atmospheric columns |
---|
32 | |
---|
33 | allocate(layer(nsoilmx)) !soil layer depths |
---|
34 | allocate(mlayer(0:nsoilmx-1)) ! soil mid-layer depths |
---|
35 | allocate(inertiedat(ngrid,nsoilmx)) ! soil thermal inertia |
---|
36 | |
---|
37 | allocate(tsoil(ngrid,nsoilmx)) ! soil temperatures |
---|
38 | |
---|
39 | allocate(mthermdiff(ngrid,0:nsoilmx-1)) |
---|
40 | allocate(thermdiff(ngrid,nsoilmx-1)) |
---|
41 | allocate(coefq(0:nsoilmx-1)) |
---|
42 | allocate(coefd(ngrid,nsoilmx-1)) |
---|
43 | allocate(alph(ngrid,nsoilmx-1)) |
---|
44 | allocate(beta(ngrid,nsoilmx-1)) |
---|
45 | |
---|
46 | |
---|
47 | end subroutine ini_comsoil_h |
---|
48 | |
---|
49 | |
---|
50 | subroutine end_comsoil_h |
---|
51 | |
---|
52 | implicit none |
---|
53 | |
---|
54 | if (allocated(layer)) deallocate(layer) |
---|
55 | if (allocated(mlayer)) deallocate(mlayer) |
---|
56 | if (allocated(inertiedat)) deallocate(inertiedat) |
---|
57 | if (allocated(tsoil)) deallocate(tsoil) |
---|
58 | if (allocated(mthermdiff)) deallocate(mthermdiff) |
---|
59 | if (allocated(thermdiff)) deallocate(thermdiff) |
---|
60 | if (allocated(coefq)) deallocate(coefq) |
---|
61 | if (allocated(coefd)) deallocate(coefd) |
---|
62 | if (allocated(alph)) deallocate(alph) |
---|
63 | if (allocated(beta)) deallocate(beta) |
---|
64 | |
---|
65 | end subroutine end_comsoil_h |
---|
66 | |
---|
67 | end module comsoil_h |
---|