C (c) CROWN COPYRIGHT 1995, METEOROLOGICAL OFFICE, All Rights Reserved.            RAD_ALL.20677 
C                                                                                  RAD_ALL.20678 
C Use, duplication or disclosure of this code is subject to the                    RAD_ALL.20679 
C restrictions as set forth in the contract.                                       RAD_ALL.20680 
C                                                                                  RAD_ALL.20681 
C                Meteorological Office                                             RAD_ALL.20682 
C                London Road                                                       RAD_ALL.20683 
C                BRACKNELL                                                         RAD_ALL.20684 
C                Berkshire UK                                                      RAD_ALL.20685 
C                RG12 2SZ                                                          RAD_ALL.20686 
C                                                                                  RAD_ALL.20687 
C If no contract has been raised with this copy of the code, the use,              RAD_ALL.20688 
C duplication or disclosure of it is strictly prohibited.  Permission              RAD_ALL.20689 
C to do so must first be obtained in writing from the Head of Numerical            RAD_ALL.20690 
C Modelling at the above address.                                                  RAD_ALL.20691 
C ******************************COPYRIGHT******************************            RAD_ALL.20692 
C                                                                                  RAD_ALL.20693 
!+ Function to set number of cloudy parameters.                                    RAD_ALL.20694 
!                                                                                  RAD_ALL.20695 
! Method:                                                                          RAD_ALL.20696 
!       Straightforward                                                            RAD_ALL.20697 
!                                                                                  RAD_ALL.20698 
! Current Owner of Code: J. M. Edwards                                             RAD_ALL.20699 
!                                                                                  RAD_ALL.20700 
! History:                                                                         RAD_ALL.20701 
!       Version         Date                    Comment                            RAD_ALL.20702 
!       4.0             27-07-95                Original Code                      RAD_ALL.20703 
!                                               (J. M. Edwards)                    RAD_ALL.20704 
!                                               (J. M. Edwards)                    RAD_ALL.20705 
!                                                                                  RAD_ALL.20706 
! Description of Code:                                                             RAD_ALL.20707 
!   FORTRAN 77 with extensions listed in documentation.                            RAD_ALL.20708 
!                                                                                  RAD_ALL.20709 
!- ---------------------------------------------------------------------           RAD_ALL.20710 
      FUNCTION SET_N_CLOUD_PARAMETER(I_SCHEME, I_COMPONENT                         RAD_ALL.20711 
     &   )                                                                         RAD_ALL.20712 
!                                                                                  RAD_ALL.20713 
!                                                                                  RAD_ALL.20714 
!                                                                                  RAD_ALL.20715 
      IMPLICIT NONE                                                                RAD_ALL.20716 
!                                                                                  RAD_ALL.20717 
!                                                                                  RAD_ALL.20718 
!     INCLUDE COMDECKS                                                             RAD_ALL.20719 
!     ------------------------------------------------------------------           CLDCMP3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       CLDCMP3A.3     
!                                                                                  CLDCMP3A.4     
!     MODULE TO SET COMPONENTS OF CLOUDS.                                          CLDCMP3A.5     
!                                                                                  CLDCMP3A.6     
      INTEGER                                                                      CLDCMP3A.7     
     &     IP_CLCMP_ST_WATER                                                       CLDCMP3A.8     
!             STRATIFORM WATER DROPLETS                                            CLDCMP3A.9     
     &   , IP_CLCMP_ST_ICE                                                         CLDCMP3A.10    
!             STRATIFORM ICE CRYSTALS                                              CLDCMP3A.11    
     &   , IP_CLCMP_CNV_WATER                                                      CLDCMP3A.12    
!             CONVECTIVE WATER DROPLETS                                            CLDCMP3A.13    
     &   , IP_CLCMP_CNV_ICE                                                        CLDCMP3A.14    
!             CONVECTIVE ICE CRYSTALS                                              CLDCMP3A.15    
!                                                                                  CLDCMP3A.16    
      PARAMETER(                                                                   CLDCMP3A.17    
     &     IP_CLCMP_ST_WATER=1                                                     CLDCMP3A.18    
     &   , IP_CLCMP_ST_ICE=2                                                       CLDCMP3A.19    
     &   , IP_CLCMP_CNV_WATER=3                                                    CLDCMP3A.20    
     &   , IP_CLCMP_CNV_ICE=4                                                      CLDCMP3A.21    
     &   )                                                                         CLDCMP3A.22    
!                                                                                  CLDCMP3A.23    
!     ------------------------------------------------------------------           CLDCMP3A.24    
!     ------------------------------------------------------------------           WCLPRM3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       WCLPRM3A.3     
!                                                                                  WCLPRM3A.4     
!     MODULE TO SET NUMBERS FOR WATER CLOUD SCHEMES.                               WCLPRM3A.5     
!                                                                                  WCLPRM3A.6     
      INTEGER                                                                      WCLPRM3A.7     
     &     NPD_CLOUD_FIT                                                           WCLPRM3A.8     
!             NUMBER OF CLOUD FITTING SCHEMES                                      WCLPRM3A.9     
     &   , IP_SLINGO_SCHRECKER                                                     WCLPRM3A.10    
!             PARAMETRIZATION OF SLINGO-SCHRECKER                                  WCLPRM3A.11    
     &   , IP_ACKERMAN_STEPHENS                                                    WCLPRM3A.12    
!             PARAMETRIZATION OF ACKERMAN & STEPHENS                               WCLPRM3A.13    
     &   , IP_DROP_UNPARAMETRIZED                                                  WCLPRM3A.14    
!             UNPARAMETRIZED DROPLET DATA                                          WCLPRM3A.15    
!                                                                                  WCLPRM3A.16    
      PARAMETER(                                                                   WCLPRM3A.17    
     &     NPD_CLOUD_FIT=3                                                         WCLPRM3A.18    
     &   , IP_SLINGO_SCHRECKER=1                                                   WCLPRM3A.19    
     &   , IP_ACKERMAN_STEPHENS=2                                                  WCLPRM3A.20    
     &   , IP_DROP_UNPARAMETRIZED=3                                                WCLPRM3A.21    
     &   )                                                                         WCLPRM3A.22    
!                                                                                  WCLPRM3A.23    
!     ------------------------------------------------------------------           WCLPRM3A.24    
!     ------------------------------------------------------------------           ICLPRM3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       ICLPRM3A.3     
!                                                                                  ICLPRM3A.4     
!     MODULE TO SET NUMBERS FOR ICE CLOUD SCHEMES.                                 ICLPRM3A.5     
!                                                                                  ICLPRM3A.6     
      INTEGER                                                                      ICLPRM3A.7     
     &     NPD_ICE_CLOUD_FIT                                                       ICLPRM3A.8     
!             NUMBER OF CLOUD FITTING SCHEMES                                      ICLPRM3A.9     
     &   , IP_SLINGO_SCHRECKER_ICE                                                 ICLPRM3A.10    
!             PARAMETRIZATION OF SLINGO AND SCHRECKER.                             ICLPRM3A.11    
     &   , IP_ICE_UNPARAMETRIZED                                                   ICLPRM3A.12    
!             UNPARAMETRIZED ICE CRYSTAL DATA                                      ICLPRM3A.13    
     &   , IP_SUN_SHINE_VN2_VIS                                                    ICLPRM3A.14    
!             SUN AND SHINE'S PARAMETRIZATION IN THE VISIBLE (VERSION 2)           ICLPRM3A.15    
     &   , IP_SUN_SHINE_VN2_IR                                                     ICLPRM3A.16    
!             SUN AND SHINE'S PARAMETRIZATION IN THE IR (VERSION 2)                ICLPRM3A.17    
     &   , IP_ICE_ADT                                                              ICLPRM3A.18    
!             SCHEME BASED ON ANOMALOUS DIFFRACTION THEORY                         ICLPRM3A.19    
!             FOR ICE CRYSTALS                                                     ICLPRM3A.20    
                                                                                   ICLPRM3A.21    
!                                                                                  ICLPRM3A.22    
      PARAMETER(                                                                   ICLPRM3A.23    
     &     NPD_ICE_CLOUD_FIT=6                                                     ICLPRM3A.24    
     &   , IP_SLINGO_SCHRECKER_ICE=1                                               ICLPRM3A.25    
     &   , IP_ICE_UNPARAMETRIZED=3                                                 ICLPRM3A.26    
     &   , IP_SUN_SHINE_VN2_VIS=4                                                  ICLPRM3A.27    
     &   , IP_SUN_SHINE_VN2_IR=5                                                   ICLPRM3A.28    
     &   , IP_ICE_ADT=6                                                            ICLPRM3A.29    
     &   )                                                                         ICLPRM3A.30    
!                                                                                  ICLPRM3A.31    
!     ------------------------------------------------------------------           ICLPRM3A.32    
!                                                                                  RAD_ALL.20723 
!     DUMMY ARGUMENTS.                                                             RAD_ALL.20724 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.20725 
     &     I_SCHEME                                                                RAD_ALL.20726 
!             PARAMETRIZATION SCHEME                                               RAD_ALL.20727 
     &   , I_COMPONENT                                                             RAD_ALL.20728 
!             COMPONENT IN CLOUD                                                   RAD_ALL.20729 
!                                                                                  RAD_ALL.20730 
      INTEGER   !, INTENT(OUT)                                                     RAD_ALL.20731 
     &     SET_N_CLOUD_PARAMETER                                                   RAD_ALL.20732 
!             RETURNED NUMBER OF COEFFICIENTS IN PARAMETRIZATION                   RAD_ALL.20733 
!                                                                                  RAD_ALL.20734 
!                                                                                  RAD_ALL.20735 
!                                                                                  RAD_ALL.20736 
      IF ( (I_COMPONENT.EQ.IP_CLCMP_ST_WATER).OR.                                  RAD_ALL.20737 
     &     (I_COMPONENT.EQ.IP_CLCMP_CNV_WATER) ) THEN                              RAD_ALL.20738 
!                                                                                  RAD_ALL.20739 
         IF (I_SCHEME.EQ.IP_SLINGO_SCHRECKER) THEN                                 RAD_ALL.20740 
           SET_N_CLOUD_PARAMETER =6                                                RAD_ALL.20741 
         ELSE IF (I_SCHEME.EQ.IP_ACKERMAN_STEPHENS) THEN                           RAD_ALL.20742 
            SET_N_CLOUD_PARAMETER=9                                                RAD_ALL.20743 
         ENDIF                                                                     RAD_ALL.20744 
!                                                                                  RAD_ALL.20745 
      ELSE IF ( (I_COMPONENT.EQ.IP_CLCMP_ST_ICE).OR.                               RAD_ALL.20746 
     &          (I_COMPONENT.EQ.IP_CLCMP_CNV_ICE) ) THEN                           RAD_ALL.20747 
!                                                                                  RAD_ALL.20748 
         IF (I_SCHEME.EQ.IP_SLINGO_SCHRECKER_ICE) THEN                             RAD_ALL.20749 
            SET_N_CLOUD_PARAMETER=6                                                RAD_ALL.20750 
         ELSE IF (I_SCHEME.EQ.IP_ICE_ADT) THEN                                     RAD_ALL.20751 
            SET_N_CLOUD_PARAMETER=30                                               RAD_ALL.20752 
         ELSE IF (I_SCHEME.EQ.IP_SUN_SHINE_VN2_VIS) THEN                           RAD_ALL.20753 
            SET_N_CLOUD_PARAMETER=6                                                RAD_ALL.20754 
         ELSE IF (I_SCHEME.EQ.IP_SUN_SHINE_VN2_IR) THEN                            RAD_ALL.20755 
            SET_N_CLOUD_PARAMETER=0                                                RAD_ALL.20756 
         ENDIF                                                                     RAD_ALL.20757 
!                                                                                  RAD_ALL.20758 
      ENDIF                                                                        RAD_ALL.20759 
!                                                                                  RAD_ALL.20760 
!                                                                                  RAD_ALL.20761 
!                                                                                  RAD_ALL.20762 
      RETURN                                                                       RAD_ALL.20763 
      END    
