C (c) CROWN COPYRIGHT 1995, METEOROLOGICAL OFFICE, All Rights Reserved.            RAD_ALL.22955 
C                                                                                  RAD_ALL.22956 
C Use, duplication or disclosure of this code is subject to the                    RAD_ALL.22957 
C restrictions as set forth in the contract.                                       RAD_ALL.22958 
C                                                                                  RAD_ALL.22959 
C                Meteorological Office                                             RAD_ALL.22960 
C                London Road                                                       RAD_ALL.22961 
C                BRACKNELL                                                         RAD_ALL.22962 
C                Berkshire UK                                                      RAD_ALL.22963 
C                RG12 2SZ                                                          RAD_ALL.22964 
C                                                                                  RAD_ALL.22965 
C If no contract has been raised with this copy of the code, the use,              RAD_ALL.22966 
C duplication or disclosure of it is strictly prohibited.  Permission              RAD_ALL.22967 
C to do so must first be obtained in writing from the Head of Numerical            RAD_ALL.22968 
C Modelling at the above address.                                                  RAD_ALL.22969 
C ******************************COPYRIGHT******************************            RAD_ALL.22970 
C                                                                                  RAD_ALL.22971 
!+ Subroutine to find single scattering propeties of all regions.                  RAD_ALL.22972 
!                                                                                  RAD_ALL.22973 
! Method:                                                                          RAD_ALL.22974 
!       Straightforward.                                                           RAD_ALL.22975 
!                                                                                  RAD_ALL.22976 
! Current Owner of Code: J. M. Edwards                                             RAD_ALL.22977 
!                                                                                  RAD_ALL.22978 
! History:                                                                         RAD_ALL.22979 
!       Version         Date                    Comment                            RAD_ALL.22980 
!       4.0             27-07-95                Original Code                      RAD_ALL.22981 
!                                               (J. M. Edwards)                    RAD_ALL.22982 
!                                                                                  RAD_ALL.22983 
! Description of Code:                                                             RAD_ALL.22984 
!   FORTRAN 77  with extensions listed in documentation.                           RAD_ALL.22985 
!                                                                                  RAD_ALL.22986 
!- ---------------------------------------------------------------------           RAD_ALL.22987 
      SUBROUTINE SINGLE_SCATTERING_ALL(I_SCATTER_METHOD_BAND                       RAD_ALL.22988 
!                       Atmospheric Propeties                                      RAD_ALL.22989 
     &   , N_PROFILE, N_LAYER, D_MASS                                              RAD_ALL.22990 
!                       Cloudy Propeties                                           RAD_ALL.22991 
     &   , L_CLOUD, N_CLOUD_TOP, N_CLOUD_TYPE                                      RAD_ALL.22992 
!                       Optical Propeties                                          RAD_ALL.22993 
     &   , K_GREY_TOT_FREE, K_EXT_SCAT_FREE                                        RAD_ALL.22994 
     &   , K_GREY_TOT_CLOUD, K_EXT_SCAT_CLOUD                                      RAD_ALL.22995 
     &   , K_GAS_ABS                                                               RAD_ALL.22996 
!                       Single Scattering Propeties                                RAD_ALL.22997 
     &   , TAU_FREE, OMEGA_FREE                                                    RAD_ALL.22998 
     &   , TAU_CLOUD, OMEGA_CLOUD                                                  RAD_ALL.22999 
!                       Dimensions of Arrays                                       RAD_ALL.23000 
     &   , NPD_PROFILE, NPD_LAYER                                                  RAD_ALL.23001 
     &   )                                                                         RAD_ALL.23002 
!                                                                                  RAD_ALL.23003 
!                                                                                  RAD_ALL.23004 
      IMPLICIT NONE                                                                RAD_ALL.23005 
!                                                                                  RAD_ALL.23006 
!                                                                                  RAD_ALL.23007 
!     SIZES OF ARRAYS.                                                             RAD_ALL.23008 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.23009 
     &     NPD_PROFILE                                                             RAD_ALL.23010 
!             MAXIMUM NUMBER OF PROFILES                                           RAD_ALL.23011 
     &   , NPD_LAYER                                                               RAD_ALL.23012 
!             MAXIMUM NUMBER OF LAYERS                                             RAD_ALL.23013 
!                                                                                  RAD_ALL.23014 
!     INCLUDE COMDECKS.                                                            RAD_ALL.23015 
!     ------------------------------------------------------------------           DIMFIX3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       DIMFIX3A.3     
!                                                                                  DIMFIX3A.4     
!     MODULE TO SET INTERNAL DIMENSIONS TIED TO ALGORITHMS,                        DIMFIX3A.5     
!     MOSTLY FOR CLOUDS.                                                           DIMFIX3A.6     
!                                                                                  DIMFIX3A.7     
      INTEGER                                                                      DIMFIX3A.8     
     &     NPD_CLOUD_COMPONENT                                                     DIMFIX3A.9     
!             NUMBER OF COMPONENTS OF CLOUDS                                       DIMFIX3A.10    
     &   , NPD_CLOUD_TYPE                                                          DIMFIX3A.11    
!             NUMBER OF PERMITTED TYPES OF CLOUDS.                                 DIMFIX3A.12    
     &   , NPD_CLOUD_REPRESENTATION                                                DIMFIX3A.13    
!             NUMBER OF PERMITTED REPRESENTATIONS OF CLOUDS.                       DIMFIX3A.14    
     &   , NPD_OVERLAP_COEFF                                                       DIMFIX3A.15    
!             NUMBER OF OVERLAP COEFFICIENTS FOR CLOUDS                            DIMFIX3A.16    
     &   , NPD_SOURCE_COEFF                                                        DIMFIX3A.17    
!             NUMBER OF COEFFICIENTS FOR TWO-STREAM SOURCES                        DIMFIX3A.18    
     &   , NPD_REGION                                                              DIMFIX3A.19    
!             NUMBER OF REGIONS IN A LAYER                                         DIMFIX3A.20    
!                                                                                  DIMFIX3A.21    
      PARAMETER(                                                                   DIMFIX3A.22    
     &     NPD_CLOUD_COMPONENT=4                                                   DIMFIX3A.23    
     &   , NPD_CLOUD_TYPE=4                                                        DIMFIX3A.24    
     &   , NPD_CLOUD_REPRESENTATION=4                                              DIMFIX3A.25    
     &   , NPD_OVERLAP_COEFF=18                                                    DIMFIX3A.26    
     &   , NPD_SOURCE_COEFF=2                                                      DIMFIX3A.27    
     &   , NPD_REGION=3                                                            DIMFIX3A.28    
     &   )                                                                         DIMFIX3A.29    
!                                                                                  DIMFIX3A.30    
!     ------------------------------------------------------------------           DIMFIX3A.31    
!                                                                                  RAD_ALL.23017 
!                                                                                  RAD_ALL.23018 
!     DUMMY VARIABLES.                                                             RAD_ALL.23019 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.23020 
     &     I_SCATTER_METHOD_BAND                                                   RAD_ALL.23021 
!             TREATMENT OF SCATTERING IN THE BAND                                  RAD_ALL.23022 
!                                                                                  RAD_ALL.23023 
!                       Atmospheric Properties                                     RAD_ALL.23024 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.23025 
     &     N_PROFILE                                                               RAD_ALL.23026 
!             NUMBER OF PROFILES                                                   RAD_ALL.23027 
     &   , N_LAYER                                                                 RAD_ALL.23028 
!             NUMBER OF LAYERS                                                     RAD_ALL.23029 
      REAL      !, INTENT(IN)                                                      RAD_ALL.23030 
     &     D_MASS(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.23031 
!             MASS THICKNESS OF EACH LAYER                                         RAD_ALL.23032 
!                                                                                  RAD_ALL.23033 
!                       Cldoudy Propeties                                          RAD_ALL.23034 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.23035 
     &     L_CLOUD                                                                 RAD_ALL.23036 
!             FLAG FOR CLOUDS                                                      RAD_ALL.23037 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.23038 
     &     N_CLOUD_TOP                                                             RAD_ALL.23039 
!             TOPMOST CLOUDY LAYER                                                 RAD_ALL.23040 
     &   , N_CLOUD_TYPE                                                            RAD_ALL.23041 
!             NUMBER OF TYPES OF CLOUDS                                            RAD_ALL.23042 
!                                                                                  RAD_ALL.23043 
!                       Optical Properties                                         RAD_ALL.23044 
      REAL      !, INTENT(IN)                                                      RAD_ALL.23045 
     &     K_GREY_TOT_FREE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.23046 
!             FREE ABSORPTIVE EXTINCTION                                           RAD_ALL.23047 
     &   , K_EXT_SCAT_FREE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.23048 
!             FREE SCATTERING EXTINCTION                                           RAD_ALL.23049 
     &   , K_GREY_TOT_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                RAD_ALL.23050 
!             STRATIFORM ABSORPTIVE EXTINCTION                                     RAD_ALL.23051 
     &   , K_EXT_SCAT_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                RAD_ALL.23052 
!             STRATIFORM SCATTERING EXTINCTION                                     RAD_ALL.23053 
     &   , K_GAS_ABS(NPD_PROFILE, NPD_LAYER)                                       RAD_ALL.23054 
!             GASEOUS EXTINCTION                                                   RAD_ALL.23055 
!                                                                                  RAD_ALL.23056 
!                       Single Scattering Properties                               RAD_ALL.23057 
      REAL      !, INTENT(OUT)                                                     RAD_ALL.23058 
     &     TAU_FREE(NPD_PROFILE, NPD_LAYER)                                        RAD_ALL.23059 
!             FREE OPTICAL DEPTH                                                   RAD_ALL.23060 
     &   , OMEGA_FREE(NPD_PROFILE, NPD_LAYER)                                      RAD_ALL.23061 
!             FREE SINGLE SCATTERING ALBEDO                                        RAD_ALL.23062 
     &   , TAU_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                       RAD_ALL.23063 
!             CLOUDY OPTICAL DEPTH                                                 RAD_ALL.23064 
     &   , OMEGA_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                     RAD_ALL.23065 
!             CLOUDY SINGLE SCATTERING ALBEDO                                      RAD_ALL.23066 
!                                                                                  RAD_ALL.23067 
!                                                                                  RAD_ALL.23068 
!     LOCAL VARIABLES.                                                             RAD_ALL.23069 
      INTEGER                                                                      RAD_ALL.23070 
     &     K                                                                       RAD_ALL.23071 
!             LOOP VARIABLE                                                        RAD_ALL.23072 
!                                                                                  RAD_ALL.23073 
!     SUBROUTINES CALLED:                                                          RAD_ALL.23074 
      EXTERNAL                                                                     RAD_ALL.23075 
     &     SINGLE_SCATTERING                                                       RAD_ALL.23076 
!                                                                                  RAD_ALL.23077 
!                                                                                  RAD_ALL.23078 
!                                                                                  RAD_ALL.23079 
!     CLEAR-SKY PROPERTIES:                                                        RAD_ALL.23080 
!                                                                                  RAD_ALL.23081 
      CALL SINGLE_SCATTERING(I_SCATTER_METHOD_BAND                                 RAD_ALL.23082 
     &   , N_PROFILE, N_LAYER, 1                                                   RAD_ALL.23083 
     &   , D_MASS                                                                  RAD_ALL.23084 
     &   , K_GREY_TOT_FREE, K_EXT_SCAT_FREE, K_GAS_ABS                             RAD_ALL.23085 
     &   , TAU_FREE, OMEGA_FREE                                                    RAD_ALL.23086 
     &   , NPD_PROFILE, NPD_LAYER                                                  RAD_ALL.23087 
     &   )                                                                         RAD_ALL.23088 
!                                                                                  RAD_ALL.23089 
      IF (L_CLOUD) THEN                                                            RAD_ALL.23090 
         DO K=1, N_CLOUD_TYPE                                                      RAD_ALL.23091 
            CALL SINGLE_SCATTERING(I_SCATTER_METHOD_BAND                           RAD_ALL.23092 
     &         , N_PROFILE, N_LAYER, N_CLOUD_TOP                                   RAD_ALL.23093 
     &         , D_MASS                                                            RAD_ALL.23094 
     &         , K_GREY_TOT_CLOUD(1, 1, K)                                         RAD_ALL.23095 
     &         , K_EXT_SCAT_CLOUD(1, 1, K)                                         RAD_ALL.23096 
     &         , K_GAS_ABS                                                         RAD_ALL.23097 
     &         , TAU_CLOUD(1, 1, K), OMEGA_CLOUD(1, 1, K)                          RAD_ALL.23098 
     &         , NPD_PROFILE, NPD_LAYER                                            RAD_ALL.23099 
     &         )                                                                   RAD_ALL.23100 
         ENDDO                                                                     RAD_ALL.23101 
      ENDIF                                                                        RAD_ALL.23102 
!                                                                                  RAD_ALL.23103 
!                                                                                  RAD_ALL.23104 
!                                                                                  RAD_ALL.23105 
      RETURN                                                                       RAD_ALL.23106 
      END     
