source: trunk/LMDZ.MARS/libf/phymars/soil_tifeedback.F @ 1266

Last change on this file since 1266 was 1266, checked in by aslmd, 11 years ago

LMDZ.MARS
IMPORTANT CHANGE

  • Remove all reference/use of nlayermx and dimphys.h
  • Made use of automatic arrays whenever arrays are needed with dimension nlayer
  • Remove lots of obsolete reference to dimensions.h
  • Converted iono.h and param_v4.h into corresponding modules

(with embedded subroutine to allocate arrays)
(no arrays allocated if thermosphere not used)

  • Deleted param.h and put contents into module param_v4_h
  • Adapted testphys1d, newstart, etc...
  • Made DATA arrays in param_read to be initialized by subroutine

fill_data_thermos in module param_v4_h

  • Optimized computations in paramfoto_compact (twice less dlog10 calculations)
  • Checked consistency before/after modification in debug mode
  • Checked performance is not impacted (same as before)
  • Property svn:executable set to *
File size: 3.5 KB
RevLine 
[834]1      SUBROUTINE soil_tifeedback(ngrid,nsoil,icecover,newtherm_i)
[1036]2
3      use tracer_mod, only: nqmx, igcm_h2o_ice, rho_ice
[1047]4      use comsoil_h, only: layer, inertiedat
5      use surfdat_h, only: watercaptag, inert_h2o_ice
[834]6      IMPLICIT NONE
7
8c=======================================================================
9c   Description :
10c       Surface water ice / Thermal inertia feedback.
11c
12c   When surface water-ice is thick enough, this routine creates a new
13c   soil thermal inertia with three different layers :
14c   - One layer of surface water ice (the thickness is given
15c     by the variable icecover (in kg of ice per m2) and the thermal
[1224]16c     inertia is prescribed by inert_h2o_ice (see surfdat_h));
[834]17c   - A transitional layer of mixed thermal inertia;
18c   - A last layer of regolith below the ice cover whose thermal inertia
19c     is equal to inertiedat.
20c
21c   To use the model :
22c       SET THE tifeedback LOGICAL TO ".true." in callphys.def.
23c
24c   Author: J.-B. Madeleine Mars 2008 - Updated November 2012
25c=======================================================================
26
27#include "dimensions.h"
28
29c Local variables
30c ---------------
31
32      INTEGER :: ig                     ! Grid point (ngrid)
33      INTEGER :: ik                     ! Grid point (nsoil)
34      INTEGER :: iref                   ! Ice/Regolith boundary index
35      INTEGER :: ngrid                  ! Number of horizontal grid points
36      INTEGER :: nsoil                  ! Number of soil layers
37      REAL :: icedepth                  ! Ice cover thickness (m)
38
39c Inputs
40c ------
41
42      REAL icecover(ngrid,nqmx)         ! tracer on the surface (kg.m-2)
[1036]43                                        ! (iq=igcm_h2o_ice) is surface
[834]44                                        ! water ice
45c Outputs
46c -------
47
48      REAL newtherm_i(ngrid,nsoil)    ! New soil thermal inertia
49
50c Initialization
51c --------------
52
53      newtherm_i(1:ngrid,1:nsoil) = 0
54
55c Creating the new soil thermal inertia table
56c -------------------------------------------
57      DO ig=1,ngrid
58c       Calculating the ice cover thickness
59        icedepth=icecover(ig,igcm_h2o_ice)/rho_ice
[857]60c       If the ice cover is too thick or watercaptag=true,
61c         the entire column is changed :
62        IF ((icedepth.ge.layer(nsoil)).or.(watercaptag(ig))) THEN
[834]63          DO ik=1,nsoil
64               newtherm_i(ig,ik)=inert_h2o_ice
65          ENDDO
66c       We neglect the effect of a very thin ice cover :
67        ELSE IF (icedepth.lt.layer(1)) THEN
68          DO ik=1,nsoil
69               newtherm_i(ig,ik)=inertiedat(ig,ik)
70          ENDDO
71        ELSE
72c         Ice/regolith boundary index :
73          iref=1
74c         Otherwise, we find the ice/regolith boundary:
75          DO ik=1,nsoil-1
76              IF ((icedepth.ge.layer(ik)).and.
77     &        (icedepth.lt.layer(ik+1))) THEN
78                  iref=ik+1
79                  EXIT
80              ENDIF
81          ENDDO
82c         And we change the thermal inertia:
83          DO ik=1,iref-1
84            newtherm_i(ig,ik)=inert_h2o_ice
85          ENDDO
86c         Transition (based on the equations of thermal conduction):
87          newtherm_i(ig,iref)=sqrt( (layer(iref)-layer(iref-1)) /
88     &        ( ((icedepth-layer(iref-1))/inert_h2o_ice**2) +
89     &        ((layer(iref)-icedepth)/inertiedat(ig,ik)**2) ) )
90c         Underlying regolith:
91          DO ik=iref+1,nsoil
92              newtherm_i(ig,ik)=inertiedat(ig,ik)
93          ENDDO
94        ENDIF ! icedepth
95      ENDDO ! ig
96
97c=======================================================================
98      RETURN
99      END
Note: See TracBrowser for help on using the repository browser.