Changeset 1516 for trunk/LMDZ.GENERIC


Ignore:
Timestamp:
Mar 17, 2016, 9:45:36 AM (9 years ago)
Author:
emillour
Message:

Generic model:

  • Added tests to ensure that soil model settings are adequate to resolve sub-surface diurnal and annual thermal waves.

EM

Location:
trunk/LMDZ.GENERIC
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/README

    r1514 r1516  
    11171117- Added a generic routine (in utilities directory) to extrapolate ice fields.
    11181118- Added a generic version of streamfunction (in utilities directory).
     1119
     1120== 17/03/2016 == EM
     1121- Added tests to ensure that soil model settings are adequate to resolve
     1122  sub-surface diurnal and annual thermal waves.
  • trunk/LMDZ.GENERIC/libf/phystd/comsoil_h.F90

    r1315 r1516  
    66!integer, parameter :: nsoilmx = 13 ! for z1=0.03 m, depth = 104.8 m => earth case
    77  integer, parameter :: nsoilmx = 18
     8! Full soil layer depths are set as: layer(k)=lay1*alpha**(k-1) , k=1,nsoil
     9! Mid soil layer depths are set as: mlayer(k)=lay1*alpha**(k-1/2) , k=0,nsoil-1
     10  real,parameter :: lay1=2.e-4 ! depth of first full soil layer
     11  real,parameter :: alpha=2
    812
    913  real,save,allocatable,dimension(:) :: layer      ! soil layer depths
  • trunk/LMDZ.GENERIC/libf/phystd/soil.F

    r1315 r1516  
    44     &          capcal,fluxgrd)
    55
    6       use comsoil_h, only: layer, mlayer, volcapa
     6      use comsoil_h, only: layer, mlayer, volcapa, inertiedat
     7      use comcstfi_mod, only: pi, daysec
     8      use planete_mod, only: year_day
     9      use comgeomfi_h, only: long, lati
    710
    811      implicit none
     
    4952! local variables:
    5053      integer ig,ik
    51 
     54      real :: inertia_min,inertia_max
     55      real :: diurnal_skin ! diurnal skin depth (m)
     56      real :: annual_skin ! anuual skin depth (m)
    5257
    5358! 0. Initialisations and preprocessing step
     
    118123      !write(*,*)'soil: ig=',ig,' capcal(ig)=',capcal(ig)
    119124      enddo ! of do ig=1,ngrid
    120            
     125     
     126      ! Additional checks: is the vertical discretization sufficient
     127      ! to resolve diurnal and annual waves?
     128      do ig=1,ngrid
     129        ! extreme inertia for this column
     130        inertia_min=minval(inertiedat(ig,:))
     131        inertia_max=maxval(inertiedat(ig,:))
     132        ! diurnal and annual skin depth
     133        diurnal_skin=(inertia_min/volcapa)*sqrt(daysec/pi)
     134        annual_skin=(inertia_max/volcapa)*sqrt(year_day*daysec/pi)
     135        if (0.5*diurnal_skin<layer(1)) then
     136        ! one should have the fist layer be at least half of diurnal skin depth
     137          write(*,*) "soil Error: grid point ig=",ig
     138          write(*,*) "            longitude=",long(ig)*(180./pi)
     139          write(*,*) "             latitude=",lati(ig)*(180./pi)
     140          write(*,*) "  first soil layer depth ",layer(1)
     141          write(*,*) "  not small enough for a diurnal skin depth of ",
     142     &                diurnal_skin
     143          write(*,*) " change soil layer distribution (comsoil_h.F90)"
     144          stop
     145        endif
     146        if (2.*annual_skin>layer(nsoil)) then
     147        ! one should have the full soil be at least twice the diurnal skin depth
     148          write(*,*) "soil Error: grid point ig=",ig
     149          write(*,*) "            longitude=",long(ig)*(180./pi)
     150          write(*,*) "             latitude=",lati(ig)*(180./pi)
     151          write(*,*) "  total soil layer depth ",layer(nsoil)
     152          write(*,*) "  not large enough for an annual skin depth of ",
     153     &                annual_skin
     154          write(*,*) " change soil layer distribution (comsoil_h.F90)"
     155          stop
     156        endif
     157      enddo ! of do ig=1,ngrid
     158     
    121159      else ! of if (firstcall)
    122160
  • trunk/LMDZ.GENERIC/libf/phystd/soil_settings.F

    r1350 r1516  
    22
    33!      use netcdf
    4       use comsoil_h, only: layer, mlayer, inertiedat, volcapa
     4      use comsoil_h, only: layer, mlayer, inertiedat, volcapa,
     5     &                     lay1, alpha
    56      use iostart, only: inquire_field_ndims, get_var, get_field,
    67     &                   inquire_field, inquire_dimension_length
     
    7071      real,dimension(:),allocatable :: newval
    7172
    72       real alpha,lay1 ! coefficients for building layers
     73      real malpha,mlay1 ! coefficients for building layers
    7374      real xmin,xmax ! to display min and max of a field
    7475
     
    133134      ! default mlayer distribution, following a power law:
    134135      !  mlayer(k)=lay1*alpha**(k-1/2)
    135         lay1=2.e-4
    136         alpha=2
    137136        do iloop=0,nsoil-1
    138137          mlayer(iloop)=lay1*(alpha**(iloop-0.5))
     
    142141      ! Assuming layer distribution follows mid-layer law:
    143142      ! layer(k)=lay1*alpha**(k-1)
    144       lay1=sqrt(mlayer(0)*mlayer(1))
    145       alpha=mlayer(1)/mlayer(0)
     143      mlay1=sqrt(mlayer(0)*mlayer(1))
     144      malpha=mlayer(1)/mlayer(0)
     145      ! Check that these values are the same as those prescibed for mlayers
     146      if ((abs(mlay1-lay1)/lay1).gt.1.e-6) then
     147         write(*,*) "soil_settings error: mlay1=",mlay1
     148         write(*,*) " does not match comsoil_h lay1=",lay1
     149         stop
     150      endif
     151      if ((abs(malpha-alpha)/alpha).gt.1.e-6) then
     152         write(*,*) "soil_settings error: malpha=",malpha
     153         write(*,*) " does not match comsoil_h alpha=",alpha
     154         stop
     155      endif
    146156      do iloop=1,nsoil
    147         layer(iloop)=lay1*(alpha**(iloop-1))
     157        layer(iloop)=mlay1*(malpha**(iloop-1))
    148158      enddo
     159
    149160! 2. Volumetric heat capacity (note: it is declared in comsoil_h)
    150161! ---------------------------
Note: See TracChangeset for help on using the changeset viewer.