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

Last change on this file since 3151 was 3149, checked in by jbclement, 2 years ago

PEM:

  • Simplification of the algorithm managing the stopping criteria;
  • Complete rework of the ice management in the PEM (H2O & CO2);

    Subroutines to evolve the H2O and CO2 ice are now in the same module "evol_ice_mod.F90".
    Tendencies are computed from the variation of "ice + frost" between the 2 PCM runs.
    Evolving ice in the PEM is now called 'h2o_ice' or 'co2_ice' (not anymore in 'qsurf' and free of 'water_reservoir').
    Default value 'ini_h2o_bigreservoir' (= 10 m) initializes the H2O ice of the first PEM run where there is 'watercap'. For the next PEM runs, initialization is done with the value kept in "startpem.nc". CO2 ice is taken from 'perennial_co2ice' of the PCM (paleoclimate flag must be true).
    Simplification of the condition to compute the surface ice cover needed for the stopping criteria.
    Frost ('qsurf') is not evolved by the PEM and given back to the PCM.
    New default threshold value 'inf_h2oice_threshold' (= 2 m) to decide at the end of the PEM run if the H2O ice should be 'watercap' or not for the next PCM runs. If H2O ice cannot be 'watercap', then the remaining H2O ice is transferred to the frost ('qsurf').

  • Renaming of variables/subroutines for clarity;
  • Some cleanings throughout the code;
  • Small updates in files of the deftank.

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_h2o_bigreservoir ! Initial value for the large reservoir of water [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.