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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.