source: trunk/LMDZ.COMMON/libf/evolution/comsoil_h_PEM.F90 @ 3495

Last change on this file since 3495 was 3161, checked in by jbclement, 11 months ago

PEM:

  • Addition of flags defined in the "run_PEM.def" to decide to do or not CO2 & H2O ice metamorphism: 'metam_co2ice' and 'metam_h2oice' (default is false).
  • The variations of infinite reservoirs ('watercap') during the PCM years are now taken into account to update H2O ice at the PEM initialization.
  • 'ini_h2o_bigreservoir' is renamed into 'ini_huge_h2oice'.
  • Some cleanings, in particular for the main program "pem.F90".

JBC

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