source: trunk/LMDZ.GENERIC/libf/phystd/comsoil_h.F90 @ 2733

Last change on this file since 2733 was 1538, checked in by emillour, 9 years ago

Generic GCM:

  • Made nsoilmx be no longer a "parameter" and thus added the possibility to define the number of subsurface layers nsoilmx, along with first layer thickness "lay1_soil" and companion coefficient "alpha_soil", in callphys.def at run time. As before (when these were hard-coded), these are such that the depth of soil mid-layers are: mlayer(k)=lay1_soil*alpha_soil(k-1/2), for k=0,nsoil-1

EM

File size: 1.6 KB
Line 
1module comsoil_h
2
3implicit none
4! nsoilmx : number of subterranean layers
5!integer, parameter :: nsoilmx = 18 ! for z1=0.0002 m, depth = 18 m => mars case
6!integer, parameter :: nsoilmx = 13 ! for z1=0.03 m, depth = 104.8 m => earth case
7  integer,save :: nsoilmx = 18 ! default, but may be set in callphys.def
8! Full soil layer depths are set as: layer(k)=lay1_soil*alpha_soil**(k-1) , k=1,nsoil
9! Mid soil layer depths are set as: mlayer(k)=lay1_soil*alpha_soil**(k-1/2) , k=0,nsoil-1
10  real,save :: lay1_soil=2.e-4 ! depth (m) of first full soil layer (may be set in callphys.def)
11  real,save :: alpha_soil=2 ! coefficient for soil layer thickness (may be set in callphys.def)
12!$OMP THREADPRIVATE(nsoilmx,lay1_soil,alpha_soil)
13
14  real,save,allocatable,dimension(:) :: layer      ! soil layer depths
15  real,save,allocatable,dimension(:) :: mlayer     ! soil mid-layer depths
16  real,save,allocatable,dimension(:,:) :: inertiedat ! soil thermal inertia
17  real,save :: volcapa    ! soil volumetric heat capacity
18       ! NB: volcapa is read fromn control(35) from physicq start file
19       !     in physdem (or set via tabfi, or initialized in
20       !                 soil_settings.F)
21!$OMP THREADPRIVATE(layer,mlayer,inertiedat,volcapa)
22
23contains
24
25  subroutine ini_comsoil_h(ngrid)
26 
27  implicit none
28  integer,intent(in) :: ngrid ! number of atmospheric columns
29 
30    if (.not.allocated(layer)) allocate(layer(nsoilmx)) !soil layer depths
31    if (.not.allocated(mlayer)) allocate(mlayer(0:nsoilmx-1)) ! soil mid-layer depths
32    if (.not.allocated(inertiedat)) allocate(inertiedat(ngrid,nsoilmx)) ! soil thermal inertia
33 
34  end subroutine ini_comsoil_h
35
36end module comsoil_h
37
Note: See TracBrowser for help on using the repository browser.