source: trunk/LMDZ.COMMON/libf/evolution/soil_settings_PEM.F @ 2850

Last change on this file since 2850 was 2835, checked in by romain.vande, 3 years ago

Mars PEM:
Introduction of the possibility to follow an orbital forcing.
Introduction of new control parameters.
Cleaning of the PEM (removing unused files, add comments and new files)

A file named run_PEM.def can be added to the run.def. It contains the following variables:

_ evol_orbit_pem: Boolean. Do you want to follow an orbital forcing predefined (read in ob_ex_lsp.asc for example)? (default=false)
_ year_bp_ini: Integer. Number of year before present to start the pem run if evol_orbit_pem=.true. , default=0
_ Max_iter_pem: Integer. Maximal number of iteration if none of the stopping criterion is reached and if evol_orbit_pem=.false., default=99999999
_ dt_pem: Integer. Time step of the PEM in year, default=1
_ alpha_criterion: Real. Acceptance rate of sublimating ice surface change, default=0.2
_ soil_pem: Boolean. Do you want to run with subsurface physical processes in the PEM? default=.true.

RV

File size: 3.5 KB
Line 
1      subroutine soil_settings_PEM(ngrid,nslope,nsoil_PEM,nsoil_GCM,
2     &   TI_GCM,TI_PEM)
3
4
5!      use netcdf
6      use comsoil_h_PEM, only: layer_PEM, mlayer_PEM
7      use comsoil_h, only: inertiedat,layer,mlayer, volcapa
8      use iostart, only: inquire_field_ndims, get_var, get_field,
9     &                   inquire_field, inquire_dimension_length
10
11      implicit none
12
13!======================================================================
14!  Author: Ehouarn Millour (07/2006)
15!
16!  Purpose: Read and/or initialise soil depths and properties
17!
18! Modifications: Aug.2010 EM : use NetCDF90 to load variables (enables using
19!                      r4 or r8 restarts independently of having compiled
20!                      the GCM in r4 or r8)
21!                June 2013 TN : Possibility to read files with a time axis
22!
23!
24!  This subroutine reads from a NetCDF file (opened by the caller)
25!  of "startfi.nc" format.
26!  The various actions and variable read/initialized are:
27!  1. Check out the number of soil layers (in datafile); if it isn't equal
28!     to nsoil, then some interpolation will be required
29!     Also check if data in file "startfi.nc" is in older format (ie:
30!     thermal inertia was depth-independent; and there was no "depth"
31!     coordinate.
32!     Read/build layer (and midlayer) depths
33!  2. Read volumetric specific heat (or initialise it to default value)
34!  3. Read Thermal inertia
35!  4. Read soil temperatures
36!  5. Interpolate thermal inertia and temperature on the new grid, if
37!     necessary
38!======================================================================
39
40!======================================================================
41!  arguments
42!  ---------
43!  inputs:
44      integer,intent(in) :: ngrid       ! # of horizontal grid points
45      integer,intent(in) :: nslope      ! # of subslope wihtin the mesh
46      integer,intent(in) :: nsoil_PEM   ! # of soil layers in the PEM
47      integer,intent(in) :: nsoil_GCM   ! # of soil layers in the GCM
48      real,intent(in) :: TI_GCM(ngrid,nsoil_GCM,nslope) ! # of soil layers in the GCM
49      real,intent(inout) :: TI_PEM(ngrid,nsoil_PEM,nslope)      ! # of soil layers in the PEM
50
51!======================================================================
52! local variables:
53      integer ig,iloop,islope   ! loop counters
54      logical found
55
56      real alpha,lay1 ! coefficients for building layers
57      real xmin,xmax ! to display min and max of a field
58     
59!======================================================================
60
61! 1. Depth coordinate
62! -------------------
63
64! 1.4 Build mlayer(), if necessary
65      ! default mlayer distribution, following a power law:
66      !  mlayer(k)=lay1*alpha**(k-1/2)
67        lay1=2.e-4
68        alpha=2
69        do iloop=0,nsoil_PEM-1
70          mlayer_PEM(iloop)=lay1*(alpha**(iloop-0.5))
71        enddo
72
73! 1.5 Build layer(); following the same law as mlayer()
74      ! Assuming layer distribution follows mid-layer law:
75      ! layer(k)=lay1*alpha**(k-1)
76      lay1=sqrt(mlayer_PEM(0)*mlayer_PEM(1))
77      alpha=mlayer_PEM(1)/mlayer_PEM(0)
78      do iloop=1,nsoil_PEM
79        layer_PEM(iloop)=lay1*(alpha**(iloop-1))
80      enddo
81
82! 2. Thermal inertia (note: it is declared in comsoil_h)
83! ------------------
84
85      do ig = 1,ngrid
86        do islope = 1,nslope
87          do iloop = 1,nsoil_GCM
88            TI_PEM(ig,iloop,islope) = TI_GCM(ig,iloop,islope)
89          enddo
90          if(nsoil_PEM.gt.nsoil_GCM) then
91           do iloop = nsoil_GCM+1,nsoil_PEM
92             TI_PEM(ig,iloop,islope) = TI_GCM(ig,nsoil_GCM,islope)
93           enddo
94          endif
95        enddo
96      enddo
97
98      end subroutine soil_settings_PEM
Note: See TracBrowser for help on using the repository browser.