source: trunk/LMDZ.COMMON/libf/evolution/update_soil.F90 @ 2889

Last change on this file since 2889 was 2888, checked in by llange, 2 years ago

PEM

  • Following r-2886-5, debugging some issues ( conservation of H2O, water_reservoir not initialized, info_pem which was not working)
  • Cleaning of some redundant routines (e.g., stopping criterion of the PEM) and variables renamed (e.g., alpha_criterion now transofrmed in ice_criterion)
  • Ice table subroutine is now in a module and recalled "compute_ice_table_equilibrium" (v.s. dynamic ice table, efforts ongoing)
  • Abort_pem introduced to avoid just stopping the pem with raw "stop" in the codes
  • conf_pem has been improved so that values are not hard coded (e.g., geothermal flux, mass of water_reservoir)
  • Regolith thermal properties updated in a cleaner way

(Not atomic commit, sorry)
LL & RV

File size: 5.0 KB
Line 
1   SUBROUTINE update_soil(ngrid,nslope,nsoil_GCM,nsoil_PEM,tendencies_waterice,waterice,p_avg_new,ice_depth,TI_PEM)
2#ifndef CPP_STD
3 USE comsoil_h, only:  inertiedat, volcapa
4 USE comsoil_h_PEM, only: layer_PEM,n_1km,inertiedat_PEM
5 USE vertical_layers_mod, ONLY: ap,bp
6 USE comsoil_h_PEM, only: n_1km
7 implicit none
8! Input:
9 INTEGER,INTENT(IN) ::  ngrid, nslope,nsoil_GCM, nsoil_PEM
10 REAL,INTENT(IN) :: p_avg_new
11 REAL,INTENT(IN) :: tendencies_waterice(ngrid,nslope)
12 REAL,INTENT(IN) :: waterice(ngrid,nslope)
13 REAL,INTENT(in) :: ice_depth(ngrid,nslope)
14! Outputs:
15
16 REAL,INTENT(INOUT) :: TI_PEM(ngrid,nsoil_PEM,nslope)
17 
18! Constants:
19
20 REAL ::  inertie_thresold = 800. ! look for ice
21 REAL ::  inertie_averaged = 250 ! Mellon et al. 2000
22 REAL ::  ice_inertia = 1200  ! Inertia of ice
23 REAL ::  P610 = 610.0       ! current average pressure on Mars [Pa]
24 REAL :: TI_breccia = 750.   ! THermal inertia of Breccia following Wood 2009 [SI]
25 REAL :: TI_bedrock = 2300.  ! Thermal inertia of Bedrock following Wood 2009 [SI]
26
27! Local variables:
28
29 INTEGER :: ig,islope,iloop,iref,k
30 REAL :: regolith_inertia(ngrid,nslope) ! TI of the regolith
31 REAL :: delta
32 REAL :: TI_breccia_new
33!  1.Ice TI feedback
34
35!    do islope = 1,nslope
36!     call soil_TIfeedback_PEM(ngrid,nsoil_PEM,waterice(:,islope),   TI_PEM(:,:,islope))
37!    enddo
38
39! 2. Modification of the regolith thermal inertia.
40
41
42
43
44 do islope = 1,nslope
45   regolith_inertia(:,islope) = inertiedat_PEM(:,1)
46   do ig = 1,ngrid
47
48      if((tendencies_waterice(ig,islope).lt.-1e-5).and.(waterice(ig,islope).eq.0)) then
49              regolith_inertia(ig,islope) = inertie_averaged
50       endif
51        write(*,*) 'ig,islope',ig,islope,inertie_thresold,TI_PEM(ig,1,islope)
52       if(TI_PEM(ig,1,islope).lt.inertie_thresold) then
53!          regolith_inertia(ig,islope) = regolith_inertia(ig,islope)*(p_avg_new/P610)**0.3
54       endif
55       TI_breccia_new = TI_breccia !*(p_avg_new/P610)**0.3
56   enddo
57 enddo
58
59
60! 3. Build new Thermal Inertia
61
62do  islope=1,nslope
63   do ig = 1,ngrid
64     do iloop = 1,nsoil_GCM
65         TI_PEM(ig,iloop,islope) = regolith_inertia(ig,islope)
66     enddo
67     if(regolith_inertia(ig,islope).lt.TI_breccia_new) then
68!!! transition
69             delta = 50.
70             TI_PEM(ig,nsoil_GCM+1,islope) = sqrt((layer_PEM(nsoil_GCM+1)-layer_PEM(nsoil_GCM))/ &
71            (((delta-layer_PEM(nsoil_GCM))/(TI_PEM(ig,nsoil_GCM,islope)**2))+ &
72                      ((layer_PEM(nsoil_GCM+1)-delta)/(TI_breccia_new**2))))
73            do iloop=nsoil_GCM+2,n_1km
74              TI_PEM(ig,iloop,islope) = TI_breccia_new
75            enddo     
76      else ! we keep the high ti values
77            do iloop=nsoil_GCM+1,n_1km
78              TI_PEM(ig,iloop,islope) = TI_PEM(ig,nsoil_GCM,islope)
79            enddo
80       endif ! TI PEM and breccia comparison
81!! transition
82       delta = 1000.
83       TI_PEM(ig,n_1km+1,islope) = sqrt((layer_PEM(n_1km+1)-layer_PEM(n_1km))/ &
84            (((delta-layer_PEM(n_1km))/(TI_PEM(ig,n_1km,islope)**2))+ &
85            ((layer_PEM(n_1km+1)-delta)/(TI_bedrock**2))))
86       do iloop=n_1km+2,nsoil_PEM
87            TI_PEM(ig,iloop,islope) = TI_bedrock
88       enddo   
89      enddo ! ig
90ENDDO ! islope
91
92!  4. Build new TI in case of ice table
93! a) For the regolith
94  do ig=1,ngrid
95    do islope=1,nslope
96      do iloop = 1,n_1km
97       TI_PEM(ig,iloop,islope) = TI_PEM(ig,1,islope)
98      enddo
99  if (ice_depth(ig,islope).gt. -1.e-10) then
100! 3.0 FIrst if permanent ice
101   if (ice_depth(ig,islope).lt. 1e-10) then
102      do iloop = 1,nsoil_PEM
103       TI_PEM(ig,iloop,islope)=max(ice_inertia,inertiedat_PEM(ig,iloop))
104      enddo
105     else
106      ! 4.1 find the index of the mixed layer
107      iref=0 ! initialize iref
108      do k=1,nsoil_PEM ! loop on layers
109        if (ice_depth(ig,islope).ge.layer_PEM(k)) then
110          iref=k ! pure regolith layer up to here
111        else
112         ! correct iref was obtained in previous cycle
113         exit
114        endif
115      enddo
116
117      ! 4.2 Build the new ti
118      do iloop=1,iref
119         TI_PEM(ig,iloop,islope) =TI_PEM(ig,1,islope)
120      enddo
121      if (iref.lt.nsoil_PEM) then
122        if (iref.ne.0) then
123          ! mixed layer
124           TI_PEM(ig,iref+1,islope)=sqrt((layer_PEM(iref+1)-layer_PEM(iref))/ &
125            (((ice_depth(ig,islope)-layer_PEM(iref))/(TI_PEM(ig,iref,islope)**2))+ &
126                      ((layer_PEM(iref+1)-ice_depth(ig,islope))/(ice_inertia**2))))
127        else ! first layer is already a mixed layer
128          ! (ie: take layer(iref=0)=0)
129          TI_PEM(ig,1,islope)=sqrt((layer_PEM(1))/ &
130                          (((ice_depth(ig,islope))/(TI_PEM(ig,1,islope)**2))+ &
131                           ((layer_PEM(1)-ice_depth(ig,islope))/(ice_inertia**2))))
132        endif ! of if (iref.ne.0)       
133        ! lower layers of pure ice
134        do iloop=iref+2,nsoil_PEM
135          TI_PEM(ig,iloop,islope)=ice_inertia
136        enddo
137      endif ! of if (iref.lt.(nsoilmx))
138      endif ! permanent glaciers
139      endif ! depth > 0
140     enddo !islope
141    enddo !ig
142
143!=======================================================================
144      RETURN
145#endif
146      END
Note: See TracBrowser for help on using the repository browser.