*IF DEF,A09_2B                                                             GCLD_2B.2      
C ******************************COPYRIGHT******************************    GCLD_2B.3      
C (c) CROWN COPYRIGHT 1998, METEOROLOGICAL OFFICE, All Rights Reserved.    GCLD_2B.4      
C                                                                          GCLD_2B.5      
C Use, duplication or disclosure of this code is subject to the            GCLD_2B.6      
C restrictions as set forth in the contract.                               GCLD_2B.7      
C                                                                          GCLD_2B.8      
C                Meteorological Office                                     GCLD_2B.9      
C                London Road                                               GCLD_2B.10     
C                BRACKNELL                                                 GCLD_2B.11     
C                Berkshire UK                                              GCLD_2B.12     
C                RG12 2SZ                                                  GCLD_2B.13     
C                                                                          GCLD_2B.14     
C If no contract has been raised with this copy of the code, the use,      GCLD_2B.15     
C duplication or disclosure of it is strictly prohibited.  Permission      GCLD_2B.16     
C to do so must first be obtained in writing from the Head of Numerical    GCLD_2B.17     
C Modelling at the above address.                                          GCLD_2B.18     
C ******************************COPYRIGHT******************************    GCLD_2B.19     
C                                                                          GCLD_2B.20     
!   SUBROUTINE GLUE_CLD-------------------------------------------------   GCLD_2B.21     
!                                                                          GCLD_2B.22     
!   Level 3 control routine                                                GCLD_2B.23     
!                                                                          GCLD_2B.24     
!   Purpose: Calls LS_CLD to calculate large-scale cloud cover and         GCLD_2B.25     
!            cloud water contents, from liquid water temperature and       GCLD_2B.26     
!            total water content, which are updated to temperature and     GCLD_2B.27     
!            specific humidity respectively.                               GCLD_2B.28     
!            Compatible only with versions 3A onwards of Section 4.        GCLD_2B.29     
!                                                                          GCLD_2B.30     
!                                                                          GCLD_2B.31     
!   Called by : SETCONA1                                                   GCLD_2B.32     
!               SETLSCL1                                                   GCLD_2B.33     
!               CLDCTL1                                                    GCLD_2B.34     
!               BL_CTL1                                                    GCLD_2B.35     
!               ATMDYN1                                                    GCLD_2B.36     
!               VISBTY1A      (not at vn4.5 onwards)                       GCLD_2B.37     
!               AC_CTL1                                                    GCLD_2B.38     
!               THL2TH1                                                    GCLD_2B.39     
!               VANMOPS_MIXED_PHASE                                        GCLD_2B.40     
!                                                                          GCLD_2B.41     
!   Code description: Language FORTRAN 77 + extensions.                    GCLD_2B.42     
!                                                                          GCLD_2B.43     
!   Programming standard: Unified Model Documentation Paper No 3,          GCLD_2B.44     
!                         Version 6.                                       GCLD_2B.45     
!                                                                          GCLD_2B.46     
!   Author: Stephen Cusack     Reviewer: Andy Bushell                      GCLD_2B.47     
!                                                                          GCLD_2B.48     
! History:                                                                 GCLD_2B.49     
! Version   Date     Comment                                               GCLD_2B.50     
!  4.5    14-05-98   Original Code     S. Cusack                           GCLD_2B.51     
!                                                                          GCLD_2B.52     
!   System components covered :                                            GCLD_2B.53     
!                                                                          GCLD_2B.54     
!   System task :                                                          GCLD_2B.55     
!                                                                          GCLD_2B.56     
!   Documentation: UMDP No.                                                GCLD_2B.57     
!                                                                          GCLD_2B.58     
!  END -----------------------------------------------------------------   GCLD_2B.59     
!                                                                          GCLD_2B.60     

      SUBROUTINE GLUE_CLD(                                                  15,2GCLD_2B.61     
     & AK,BK,PSTAR,RHCRIT,LEVELS,RHCPT,                                    GCLD_2B.62     
     & POINTS,PFIELD,                                                      GCLD_2B.63     
     & T,CF,Q,QCF,QCL,PDF_QC_OR_CF_LIQ,PDF_BS_OR_CF_ICE,ERROR              GCLD_2B.64     
     & )                                                                   GCLD_2B.65     
!                                                                          GCLD_2B.66     
      IMPLICIT NONE                                                        GCLD_2B.67     
!-----------------------------------------------------------------------   GCLD_2B.68     
! All variables are used in this LS_CLD version                            GCLD_2B.69     
!-----------------------------------------------------------------------   GCLD_2B.70     
! IN variables                                                             GCLD_2B.71     
!-----------------------------------------------------------------------   GCLD_2B.72     
      INTEGER LEVELS           ! No. of levels being processed.            GCLD_2B.73     
!                                                                          GCLD_2B.74     
      INTEGER POINTS           ! No. of gridpoints being processed.        GCLD_2B.75     
!                                                                          GCLD_2B.76     
      INTEGER PFIELD           ! No. of points in global field (at one     GCLD_2B.77     
!                                vertical level).                          GCLD_2B.78     
!                                                                          GCLD_2B.79     
      REAL PSTAR(PFIELD)       ! Surface pressure (Pa).                    GCLD_2B.80     
!                                                                          GCLD_2B.81     
      REAL RHCRIT(LEVELS)      ! Critical relative humidity.  See the      GCLD_2B.82     
!                                the paragraph incorporating eqs P292.11   GCLD_2B.83     
!                                to P292.14; the values need to be tuned   GCLD_2B.84     
!                                for the given set of levels.              GCLD_2B.85     
      REAL QCF(PFIELD,LEVELS)  ! Cloud ice content at processed levels     GCLD_2B.86     
!                                (kg per kg air).                          GCLD_2B.87     
      REAL RHCPT(PFIELD,LEVELS)! Critical relative humidity at all         GCLD_2B.88     
!                                points.                                   GCLD_2B.89     
      REAL AK(LEVELS)          ! Hybrid "A" co-ordinate.                   GCLD_2B.90     
      REAL BK(LEVELS)          ! Hybrid "B" co-ordinate.                   GCLD_2B.91     
!-----------------------------------------------------------------------   GCLD_2B.92     
! INOUT variables                                                          GCLD_2B.93     
!-----------------------------------------------------------------------   GCLD_2B.94     
      REAL Q(PFIELD,LEVELS)    ! On input:  Total water content (QW)       GCLD_2B.95     
!                                           (kg per kg air).               GCLD_2B.96     
!                                On output: Specific humidity at process   GCLD_2B.97     
!                                           levels (kg water per kg air)   GCLD_2B.98     
      REAL T(PFIELD,LEVELS)    ! On input:  Liquid/frozen water            GCLD_2B.99     
!                                           temperature (TL) (K).          GCLD_2B.100    
!                                On output: Temperature at processed       GCLD_2B.101    
!                                           levels (K).                    GCLD_2B.102    
!-----------------------------------------------------------------------   GCLD_2B.103    
! OUT variables                                                            GCLD_2B.104    
!-----------------------------------------------------------------------   GCLD_2B.105    
      REAL CF(PFIELD,LEVELS)     ! Cloud fraction at processed levels      GCLD_2B.106    
!                                  (decimal fraction).                     GCLD_2B.107    
      REAL QCL(PFIELD,LEVELS)    ! Cloud liquid water content at           GCLD_2B.108    
!                                  processed levels (kg per kg air).       GCLD_2B.109    
      REAL PDF_QC_OR_CF_LIQ(PFIELD,LEVELS)                                 GCLD_2B.110    
! 1A: Grid-box mean cloud condensate at processed levels (kg/ kg air).     GCLD_2B.111    
! 2A: Liquid cloud fraction on model levels.                               GCLD_2B.112    
      REAL PDF_BS_OR_CF_ICE(PFIELD,LEVELS)                                 GCLD_2B.113    
! 1A: Maximum moisture fluctuation /6*sigma on levels (kg per kg air).     GCLD_2B.114    
! 2A: Frozen cloud fraction on model levels.                               GCLD_2B.115    
      INTEGER ERROR              ! 0 if OK; 1 if bad arguments.            GCLD_2B.116    
!                                                                          GCLD_2B.117    
!    External subroutine called ----------------------------------------   GCLD_2B.118    
      EXTERNAL  LS_CLD                                                     GCLD_2B.119    
!----------------------------------------------------------------------    GCLD_2B.120    
!                                                                          GCLD_2B.121    
      CALL LS_CLD(                                                         GCLD_2B.122    
     &    AK, BK, PSTAR,                                                   GCLD_2B.123    
     &    LEVELS, RHCPT,                                                   GCLD_2B.124    
     &    POINTS, PFIELD, T,                                               GCLD_2B.125    
     &    CF, Q, QCF, QCL,                                                 GCLD_2B.126    
     &    PDF_QC_OR_CF_LIQ, PDF_BS_OR_CF_ICE, ERROR                        GCLD_2B.127    
     & )                                                                   GCLD_2B.128    
!                                                                          GCLD_2B.129    
      RETURN                                                               GCLD_2B.130    
      END                                                                  GCLD_2B.131    
*ENDIF                                                                     GCLD_2B.132