*IF DEF,SCMA                                                               S_LYRTHK.2      
C *****************************COPYRIGHT******************************     S_LYRTHK.3      
C (c) CROWN COPYRIGHT 1998, METEOROLOGICAL OFFICE, All Rights Reserved.    S_LYRTHK.4      
C                                                                          S_LYRTHK.5      
C Use, duplication or disclosure of this code is subject to the            S_LYRTHK.6      
C restrictions as set forth in the contract.                               S_LYRTHK.7      
C                                                                          S_LYRTHK.8      
C                Meteorological Office                                     S_LYRTHK.9      
C                London Road                                               S_LYRTHK.10     
C                BRACKNELL                                                 S_LYRTHK.11     
C                Berkshire UK                                              S_LYRTHK.12     
C                RG12 2SZ                                                  S_LYRTHK.13     
C                                                                          S_LYRTHK.14     
C If no contract has been raised with this copy of the code, the use,      S_LYRTHK.15     
C duplication or disclosure of it is strictly prohibited.  Permission      S_LYRTHK.16     
C to do so must first be obtained in writing from the Head of Numerical    S_LYRTHK.17     
C Modelling at the above address.                                          S_LYRTHK.18     
C ******************************COPYRIGHT******************************    S_LYRTHK.19     
C                                                                          S_LYRTHK.20     
C     SUBROUTINE LAYER_THICK------------------------------------------     S_LYRTHK.21     
C                                                                          S_LYRTHK.22     
C     Purpose: Called by SCMMAIN (Single Column Model main routine) to     S_LYRTHK.23     
C              calculate the actual soil layer thicknesses for             S_LYRTHK.24     
C              Multilayer code.                                            S_LYRTHK.25     
C                                                                          S_LYRTHK.26     
C     Code Description:                                                    S_LYRTHK.27     
C     Language - FORTRAN 77                                                S_LYRTHK.28     
C                                                                          S_LYRTHK.29     
C     Author: C. Bunton                                                    S_LYRTHK.30     
C                                                                          S_LYRTHK.31     
C     Modification History:                                                S_LYRTHK.32     
C     Date         Change                                                  S_LYRTHK.33     
C                                                                          S_LYRTHK.34     
C                                                                          S_LYRTHK.35     
C     Documentation: Single Column Model Guide - J. Lean                   S_LYRTHK.36     
C---------------------------------------------------------------------     S_LYRTHK.37     
!                                                                          S_LYRTHK.38     
! Subroutine Interface:                                                    S_LYRTHK.39     

      Subroutine LAYER_THICK(npnts,nshyd,layerd,hcap,hcon,dzl)             S_LYRTHK.40     
                                                                           S_LYRTHK.41     
      Implicit none                                                        S_LYRTHK.42     
!                                                                          S_LYRTHK.43     
! Description:                                                             S_LYRTHK.44     
!    Calculates the soil layer thicknesses in metres.                      S_LYRTHK.45     
!                                                          (Cox, 6/95)     S_LYRTHK.46     
!                                                                          S_LYRTHK.47     
! Documentation : UM Documentation Paper 25                                S_LYRTHK.48     
!                                                                          S_LYRTHK.49     
! Current Code Owner : David Gregory                                       S_LYRTHK.50     
!                                                                          S_LYRTHK.51     
! History:                                                                 S_LYRTHK.52     
! Version   Date     Comment                                               S_LYRTHK.53     
! -------   ----     -------                                               S_LYRTHK.54     
!  4.5     07/98     SCM integrated as a standard UM configuration         S_LYRTHK.55     
!                    JC Thil.                                              S_LYRTHK.56     
!                                                                          S_LYRTHK.57     
! Code Description:                                                        S_LYRTHK.58     
!   Language: FORTRAN 77 + common extensions.                              S_LYRTHK.59     
!                                                                          S_LYRTHK.60     
! System component covered: P25                                            S_LYRTHK.61     
! System Task: P25                                                         S_LYRTHK.62     
!                                                                          S_LYRTHK.63     
                                                                           S_LYRTHK.64     
                                                                           S_LYRTHK.65     
! Global variables:                                                        S_LYRTHK.66     
*CALL C_SOILH                                                              S_LYRTHK.67     
                                                                           S_LYRTHK.68     
! Subroutine arguments:                                                    S_LYRTHK.69     
!   Scalar arguments with intent(IN) :                                     S_LYRTHK.70     
      Integer                                                              S_LYRTHK.71     
     &  npnts                   ! IN Number of gridpoints                  S_LYRTHK.72     
     &  ,nshyd                  ! IN Number of soil layers.                S_LYRTHK.73     
                                                                           S_LYRTHK.74     
!   Array arguments with intent(IN) :                                      S_LYRTHK.75     
      Real                                                                 S_LYRTHK.76     
     &  hcap(npnts)             ! IN Soil heat capacity (J K^-1 m^-3).     S_LYRTHK.77     
     &  ,hcon(npnts)            ! IN Soil thermal conductivity             S_LYRTHK.78     
                                !    (W m^-1 K^1).                         S_LYRTHK.79     
     &  ,layerd(nshyd)          ! IN Thickness of soil layers as a         S_LYRTHK.80     
                                !    multiple of the top soil layer        S_LYRTHK.81     
                                !    thickness.                            S_LYRTHK.82     
                                                                           S_LYRTHK.83     
!   Array arguments with intent(OUT) :                                     S_LYRTHK.84     
     &  ,dzl(npnts,nshyd)       ! OUT Thickness of soil layers (m).        S_LYRTHK.85     
                                                                           S_LYRTHK.86     
                                                                           S_LYRTHK.87     
! Local scalars:                                                           S_LYRTHK.88     
      Integer                                                              S_LYRTHK.89     
     &  i,n                     ! WORK Loop counters.                      S_LYRTHK.90     
C                                                                          S_LYRTHK.91     
      do n = 1, nshyd                                                      S_LYRTHK.92     
        do i = 1, npnts                                                    S_LYRTHK.93     
          dzl(i,n) = layerd(n)*sqrt(2*hcon(i)/(omega1*hcap(i)))            S_LYRTHK.94     
        enddo                                                              S_LYRTHK.95     
      enddo                                                                S_LYRTHK.96     
                                                                           S_LYRTHK.97     
      Return                                                               S_LYRTHK.98     
      End                                                                  S_LYRTHK.99     
*ENDIF                                                                     S_LYRTHK.100