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

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

LMDZ.MARS. If not major, a quite important commit.

  1. No more SAVE,ALLOCATABLE arrays outside modules.

This is important to solve the nesting conundrum in MESOSCALE.
And overall this is good for the harmony of the universe.
(Joke apart, this is good for any interfacing task. And compliant with a F90 spirit).
Note that bit-to-bit compatibility of results in debug mode was checked.

  1. inifis is split in two : phys_state_var_init + conf_phys

This makes interfacing with MESOSCALE more transparent.
This is also clearer for LMDZ.MARS.
Before, inifis has two very different tasks to do.

  1. a bit of cleaning as far as modules and saves are concerned

Point 1

  • Removed SAVE,ALLOCATABLE arrays from

physiq, aeropacity, updatereffrad, soil

and put those in

dimradmars_mod, surfdat_h, tracer_mod, comsoil_h

and changed accordingly the initialization subroutines associated to each module.
Allocating these arrays is thus done at initialization.

Point 2

  • Created a subroutine phys_state_var_init which does all the allocation / initialization work for modules. This was previously done in inifis.
  • Replaced inifis which was then (after the previous modification) just about reading callphys.def and setting a few constants by conf_phys. This mimics the new LMDZ terminology (cf. LMDZ.VENUS for instance)
  • Bye bye inifis.

Point 3

  • Removed comdiurn and put everything in comgeomfi
  • Created a turb_mod module for turbulence variables (e.g. l0 in yamada4)
  • dryness had nothing to do in tracer_h, put it in surfdat_h (like watercaptag)
  • topdust0 does not need to be SAVE in aeropacity. better use sinlat.
  • emisref does not need to be SAVE in newcondens. made it automatic array.
  • Removed useless co2ice argument in initracer.
  • Property svn:executable set to *
File size: 3.6 KB
Line 
1      SUBROUTINE soil_tifeedback(ngrid,nsoil,icecover,newtherm_i)
2
3      use tracer_mod, only: nqmx, igcm_h2o_ice, rho_ice
4      use comsoil_h, only: layer, inertiedat
5      use surfdat_h, only: watercaptag, inert_h2o_ice
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
16c     inertia is prescribed by inert_h2o_ice (see surfdat_h));
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#include "dimphys.h"
29!#include "comsoil.h"
30!#include "tracer.h"
31!#include "surfdat.h"
32
33c Local variables
34c ---------------
35
36      INTEGER :: ig                     ! Grid point (ngrid)
37      INTEGER :: ik                     ! Grid point (nsoil)
38      INTEGER :: iref                   ! Ice/Regolith boundary index
39      INTEGER :: ngrid                  ! Number of horizontal grid points
40      INTEGER :: nsoil                  ! Number of soil layers
41      REAL :: icedepth                  ! Ice cover thickness (m)
42
43c Inputs
44c ------
45
46      REAL icecover(ngrid,nqmx)         ! tracer on the surface (kg.m-2)
47                                        ! (iq=igcm_h2o_ice) is surface
48                                        ! water ice
49c Outputs
50c -------
51
52      REAL newtherm_i(ngrid,nsoil)    ! New soil thermal inertia
53
54c Initialization
55c --------------
56
57      newtherm_i(1:ngrid,1:nsoil) = 0
58
59c Creating the new soil thermal inertia table
60c -------------------------------------------
61      DO ig=1,ngrid
62c       Calculating the ice cover thickness
63        icedepth=icecover(ig,igcm_h2o_ice)/rho_ice
64c       If the ice cover is too thick or watercaptag=true,
65c         the entire column is changed :
66        IF ((icedepth.ge.layer(nsoil)).or.(watercaptag(ig))) THEN
67          DO ik=1,nsoil
68               newtherm_i(ig,ik)=inert_h2o_ice
69          ENDDO
70c       We neglect the effect of a very thin ice cover :
71        ELSE IF (icedepth.lt.layer(1)) THEN
72          DO ik=1,nsoil
73               newtherm_i(ig,ik)=inertiedat(ig,ik)
74          ENDDO
75        ELSE
76c         Ice/regolith boundary index :
77          iref=1
78c         Otherwise, we find the ice/regolith boundary:
79          DO ik=1,nsoil-1
80              IF ((icedepth.ge.layer(ik)).and.
81     &        (icedepth.lt.layer(ik+1))) THEN
82                  iref=ik+1
83                  EXIT
84              ENDIF
85          ENDDO
86c         And we change the thermal inertia:
87          DO ik=1,iref-1
88            newtherm_i(ig,ik)=inert_h2o_ice
89          ENDDO
90c         Transition (based on the equations of thermal conduction):
91          newtherm_i(ig,iref)=sqrt( (layer(iref)-layer(iref-1)) /
92     &        ( ((icedepth-layer(iref-1))/inert_h2o_ice**2) +
93     &        ((layer(iref)-icedepth)/inertiedat(ig,ik)**2) ) )
94c         Underlying regolith:
95          DO ik=iref+1,nsoil
96              newtherm_i(ig,ik)=inertiedat(ig,ik)
97          ENDDO
98        ENDIF ! icedepth
99      ENDDO ! ig
100
101c=======================================================================
102      RETURN
103      END
Note: See TracBrowser for help on using the repository browser.