C (c) CROWN COPYRIGHT 1995, METEOROLOGICAL OFFICE, All Rights Reserved.            RAD_ALL.18050 
C                                                                                  RAD_ALL.18051 
C Use, duplication or disclosure of this code is subject to the                    RAD_ALL.18052 
C restrictions as set forth in the contract.                                       RAD_ALL.18053 
C                                                                                  RAD_ALL.18054 
C                Meteorological Office                                             RAD_ALL.18055 
C                London Road                                                       RAD_ALL.18056 
C                BRACKNELL                                                         RAD_ALL.18057 
C                Berkshire UK                                                      RAD_ALL.18058 
C                RG12 2SZ                                                          RAD_ALL.18059 
C                                                                                  RAD_ALL.18060 
C If no contract has been raised with this copy of the code, the use,              RAD_ALL.18061 
C duplication or disclosure of it is strictly prohibited.  Permission              RAD_ALL.18062 
C to do so must first be obtained in writing from the Head of Numerical            RAD_ALL.18063 
C Modelling at the above address.                                                  RAD_ALL.18064 
C ******************************COPYRIGHT******************************            RAD_ALL.18065 
C                                                                                  RAD_ALL.18066 
!+ Subroutine to calculate the fluxes within the band with no gases.               RAD_ALL.18067 
!                                                                                  RAD_ALL.18068 
! Method:                                                                          RAD_ALL.18069 
!       Gaseous extinction is set to 0 and a monochromatic                         RAD_ALL.18070 
!       calculation is performed.                                                  RAD_ALL.18071 
!                                                                                  RAD_ALL.18072 
! Current Owner of Code: J. M. Edwards                                             RAD_ALL.18073 
!                                                                                  RAD_ALL.18074 
! History:                                                                         RAD_ALL.18075 
!       Version         Date                    Comment                            RAD_ALL.18076 
!       4.0             27-07-95                Original Code                      RAD_ALL.18077 
!                                               (J. M. Edwards)                    RAD_ALL.18078 
!       4.2             08-08-96                Code for vertically                RAD_ALL.18079 
!                                               coherent convective                RAD_ALL.18080 
!                                               cloud added.                       RAD_ALL.18081 
!                                               (J. M. Edwards)                    RAD_ALL.18082 
!                                                                                  RAD_ALL.18083 
! Description of Code:                                                             RAD_ALL.18084 
!   FORTRAN 77  with extensions listed in documentation.                           RAD_ALL.18085 
!                                                                                  RAD_ALL.18086 
!- ---------------------------------------------------------------------           RAD_ALL.18087 
      SUBROUTINE SOLVE_BAND_WITHOUT_GAS(IERR                                       RAD_ALL.18088 
!                       Atmospheric Column                                         RAD_ALL.18089 
     &   , N_PROFILE, N_LAYER, D_MASS                                              RAD_ALL.18090 
!                       Angular Integration                                        RAD_ALL.18091 
     &   , I_ANGULAR_INTEGRATION, I_2STREAM, L_2_STREAM_CORRECT                    RAD_ALL.18092 
     &   , L_RESCALE, N_ORDER_GAUSS                                                RAD_ALL.18093 
!                       Treatment of scattering                                    RAD_ALL.18094 
     &   , I_SCATTER_METHOD_BAND                                                   RAD_ALL.18095 
!                       Options for solver                                         RAD_ALL.18096 
     &   , I_SOLVER, L_NET, I_EXTRAPOLATE_MIX_NET, N_AUGMENT                       RAD_ALL.18097 
!                       Spectral region                                            RAD_ALL.18098 
     &   , ISOLIR                                                                  RAD_ALL.18099 
!                       Solar properties                                           RAD_ALL.18100 
     &   , SEC_0, SOLAR_FLUX                                                       RAD_ALL.18101 
!                       Infra-red properties                                       RAD_ALL.18102 
     &   , PLANCK_SOURCE_TOP, PLANCK_SOURCE_BOTTOM                                 RAD_ALL.18103 
     &   , DIFF_PLANCK_BAND, L_IR_SOURCE_QUAD, DIFF_PLANCK_BAND_2                  RAD_ALL.18104 
!                       Surface properties                                         RAD_ALL.18105 
     &   , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR, THERMAL_GROUND_BAND            RAD_ALL.18106 
!                       Clear-sky optical properties                               RAD_ALL.18107 
     &   , K_GREY_TOT_FREE, K_EXT_SCAT_FREE, ASYMMETRY_FREE                        RAD_ALL.18108 
     &   , FORWARD_SCATTER_FREE                                                    RAD_ALL.18109 
!                       Cloudy properties                                          RAD_ALL.18110 
     &   , L_CLOUD, I_CLOUD                                                        RAD_ALL.18111 
!                       Cloud Geometry                                             RAD_ALL.18112 
     &   , N_CLOUD_TOP                                                             RAD_ALL.18113 
     &   , N_CLOUD_TYPE, FRAC_CLOUD                                                RAD_ALL.18114 
     &   , I_REGION_CLOUD, FRAC_REGION                                             RAD_ALL.18115 
     &   , W_FREE, N_FREE_PROFILE, I_FREE_PROFILE                                  RAD_ALL.18116 
     &   , W_CLOUD, N_CLOUD_PROFILE, I_CLOUD_PROFILE                               RAD_ALL.18117 
     &   , CLOUD_OVERLAP                                                           RAD_ALL.18118 
     &   , N_COLUMN, L_COLUMN, AREA_COLUMN                                         RAD_ALL.18119 
!                       Cloudy optical properties                                  RAD_ALL.18120 
     &   , K_GREY_TOT_CLOUD, K_EXT_SCAT_CLOUD                                      RAD_ALL.18121 
     &   , ASYMMETRY_CLOUD, FORWARD_SCATTER_CLOUD                                  RAD_ALL.18122 
!                       Calculated Fluxes                                          RAD_ALL.18123 
     &   , FLUX_DIRECT_BAND, FLUX_TOTAL_BAND                                       RAD_ALL.18124 
!                       Flags For Clear-sky Fluxes                                 RAD_ALL.18125 
     &   , L_CLEAR, I_SOLVER_CLEAR                                                 RAD_ALL.18126 
!                       Calculated Clear-sky Fluxes                                RAD_ALL.18127 
     &   , FLUX_DIRECT_CLEAR_BAND, FLUX_TOTAL_CLEAR_BAND                           RAD_ALL.18128 
!                       Planckian Function                                         RAD_ALL.18129 
     &   , PLANCK_SOURCE_BAND                                                      RAD_ALL.18130 
!                       Dimensions of Arrays                                       RAD_ALL.18131 
     &   , NPD_PROFILE, NPD_LAYER, NPD_COLUMN                                      RAD_ALL.18132 
     &   )                                                                         RAD_ALL.18133 
!                                                                                  RAD_ALL.18134 
!                                                                                  RAD_ALL.18135 
!                                                                                  RAD_ALL.18136 
      IMPLICIT NONE                                                                RAD_ALL.18137 
!                                                                                  RAD_ALL.18138 
!                                                                                  RAD_ALL.18139 
!     SIZES OF DUMMY ARRAYS.                                                       RAD_ALL.18140 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.18141 
     &     NPD_PROFILE                                                             RAD_ALL.18142 
!             MAXIMUM NUMBER OF PROFILES                                           RAD_ALL.18143 
     &   , NPD_LAYER                                                               RAD_ALL.18144 
!             MAXIMUM NUMBER OF LAYERS                                             RAD_ALL.18145 
     &   , NPD_COLUMN                                                              RAD_ALL.18146 
!             NUMBER OF COLUMNS PER POINT                                          RAD_ALL.18147 
!                                                                                  RAD_ALL.18148 
!     INCLUDE COMDECKS.                                                            RAD_ALL.18149 
!     ------------------------------------------------------------------           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    
!     ------------------------------------------------------------------           SPCRG3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       SPCRG3A.3     
!                                                                                  SPCRG3A.4     
!     MODULE TO SET FLAGS FOR DIFFERENT PORTIONS                                   SPCRG3A.5     
!     OF THE SPECTRUM.                                                             SPCRG3A.6     
!                                                                                  SPCRG3A.7     
      INTEGER                                                                      SPCRG3A.8     
     &     IP_SOLAR                                                                SPCRG3A.9     
!             SOLAR REGION                                                         SPCRG3A.10    
     &   , IP_INFRA_RED                                                            SPCRG3A.11    
!             INFRA-RED REGION                                                     SPCRG3A.12    
!                                                                                  SPCRG3A.13    
      PARAMETER(                                                                   SPCRG3A.14    
     &     IP_SOLAR=1                                                              SPCRG3A.15    
     &   , IP_INFRA_RED=2                                                          SPCRG3A.16    
     &   )                                                                         SPCRG3A.17    
!                                                                                  SPCRG3A.18    
!     ------------------------------------------------------------------           SPCRG3A.19    
!                                                                                  RAD_ALL.18152 
!     DUMMY ARGUMENTS.                                                             RAD_ALL.18153 
      INTEGER   !, INTENT(OUT)                                                     RAD_ALL.18154 
     &     IERR                                                                    RAD_ALL.18155 
!             ERROR FLAG                                                           RAD_ALL.18156 
!                                                                                  RAD_ALL.18157 
!                       Atmospheric Column                                         RAD_ALL.18158 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.18159 
     &     N_PROFILE                                                               RAD_ALL.18160 
!             NUMBER OF PROFILES                                                   RAD_ALL.18161 
     &   , N_LAYER                                                                 RAD_ALL.18162 
!             NUMBER OF LAYERS                                                     RAD_ALL.18163 
      REAL  !, INTENT(IN)                                                          RAD_ALL.18164 
     &     D_MASS(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.18165 
!             MASS THICKNESS OF EACH LAYER                                         RAD_ALL.18166 
!                                                                                  RAD_ALL.18167 
!                       Angular integration                                        RAD_ALL.18168 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.18169 
     &     I_ANGULAR_INTEGRATION                                                   RAD_ALL.18170 
!             ANGULAR INTEGRATION SCHEME                                           RAD_ALL.18171 
     &   , I_2STREAM                                                               RAD_ALL.18172 
!             TWO-STREAM SCHEME                                                    RAD_ALL.18173 
     &   , N_ORDER_GAUSS                                                           RAD_ALL.18174 
!             ORDER OF GAUSSIAN INTEGRATION                                        RAD_ALL.18175 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.18176 
     &     L_2_STREAM_CORRECT                                                      RAD_ALL.18177 
!             USE AN EDGE CORRECTION                                               RAD_ALL.18178 
     &   , L_RESCALE                                                               RAD_ALL.18179 
!             RESCALE OPTICAL PROPERTIES                                           RAD_ALL.18180 
!                                                                                  RAD_ALL.18181 
!                       Treatment of Scattering                                    RAD_ALL.18182 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.18183 
     &     I_SCATTER_METHOD_BAND                                                   RAD_ALL.18184 
!             METHOD OF TREATING SCATTERING                                        RAD_ALL.18185 
!                                                                                  RAD_ALL.18186 
!                       Options for solver                                         RAD_ALL.18187 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.18188 
     &     I_SOLVER                                                                RAD_ALL.18189 
!             SOLVER USED                                                          RAD_ALL.18190 
     &   , I_EXTRAPOLATE_MIX_NET                                                   RAD_ALL.18191 
!             METHOD FOR EXTRAPOLATING WITH A MIXED SOLVER                         RAD_ALL.18192 
     &   , N_AUGMENT                                                               RAD_ALL.18193 
!             LENGTH OF LONG FLUX VECTOR                                           RAD_ALL.18194 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.18195 
     &     L_NET                                                                   RAD_ALL.18196 
!             SOLVE FOR NET FLUXES                                                 RAD_ALL.18197 
!                                                                                  RAD_ALL.18198 
!                       Spectral Region                                            RAD_ALL.18199 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.18200 
     &     ISOLIR                                                                  RAD_ALL.18201 
!             VISIBLE OR IR                                                        RAD_ALL.18202 
!                                                                                  RAD_ALL.18203 
!                       Solar Properties                                           RAD_ALL.18204 
      REAL  !, INTENT(IN)                                                          RAD_ALL.18205 
     &     SEC_0(NPD_PROFILE)                                                      RAD_ALL.18206 
!             SECANT OF SOLAR ZENITH ANGLE                                         RAD_ALL.18207 
     &   , SOLAR_FLUX(NPD_PROFILE)                                                 RAD_ALL.18208 
!             INCIDENT SOLAR FLUX                                                  RAD_ALL.18209 
!                                                                                  RAD_ALL.18210 
!                       Infra-red Properties                                       RAD_ALL.18211 
      REAL  !, INTENT(IN)                                                          RAD_ALL.18212 
     &     PLANCK_SOURCE_TOP(NPD_PROFILE)                                          RAD_ALL.18213 
!             PLANCK FUNCTION AT BOTTOM OF COLUMN                                  RAD_ALL.18214 
     &   , PLANCK_SOURCE_BOTTOM(NPD_PROFILE)                                       RAD_ALL.18215 
!             PLANCK FUNCTION AT BOTTOM OF COLUMN                                  RAD_ALL.18216 
     &   , DIFF_PLANCK_BAND(NPD_PROFILE, NPD_LAYER)                                RAD_ALL.18217 
!             CHANGE IN PLANCK FUNCTION                                            RAD_ALL.18218 
     &   , DIFF_PLANCK_BAND_2(NPD_PROFILE, NPD_LAYER)                              RAD_ALL.18219 
!             2x2ND DIFFERENCE OF PLANCKIAN IN BAND                                RAD_ALL.18220 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.18221 
     &     L_IR_SOURCE_QUAD                                                        RAD_ALL.18222 
!             USE A QUADRATIC SOURCE FUNCTION                                      RAD_ALL.18223 
!                                                                                  RAD_ALL.18224 
!                       Surface Properties                                         RAD_ALL.18225 
      REAL  !, INTENT(IN)                                                          RAD_ALL.18226 
     &     ALBEDO_SURFACE_DIFF(NPD_PROFILE)                                        RAD_ALL.18227 
!             DIFFUSE SURFACE ALBEDO                                               RAD_ALL.18228 
     &   , ALBEDO_SURFACE_DIR(NPD_PROFILE)                                         RAD_ALL.18229 
!             DIRECT SURFACE ALBEDO                                                RAD_ALL.18230 
     &   , THERMAL_GROUND_BAND(NPD_PROFILE)                                        RAD_ALL.18231 
!             THERMAL SOURCE AT SURFACE IN BAND                                    RAD_ALL.18232 
!                                                                                  RAD_ALL.18233 
!                       Clear-sky Optical Properties                               RAD_ALL.18234 
      REAL  !, INTENT(IN)                                                          RAD_ALL.18235 
     &     K_GREY_TOT_FREE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.18236 
!             FREE ABSORPTIVE EXTINCTION                                           RAD_ALL.18237 
     &   , K_EXT_SCAT_FREE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.18238 
!             FREE SCATTERING EXTINCTION                                           RAD_ALL.18239 
     &   , ASYMMETRY_FREE(NPD_PROFILE, NPD_LAYER)                                  RAD_ALL.18240 
!             CLEAR-SKY ASYMMETRY                                                  RAD_ALL.18241 
     &   , FORWARD_SCATTER_FREE(NPD_PROFILE, NPD_LAYER)                            RAD_ALL.18242 
!             FREE FORWARD SCATTERING                                              RAD_ALL.18243 
!                                                                                  RAD_ALL.18244 
!                       Cloudy Properties                                          RAD_ALL.18245 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.18246 
     &     L_CLOUD                                                                 RAD_ALL.18247 
!             CLOUDS REQUIRED                                                      RAD_ALL.18248 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.18249 
     &     I_CLOUD                                                                 RAD_ALL.18250 
!             CLOUD SCHEME USED                                                    RAD_ALL.18251 
!                                                                                  RAD_ALL.18252 
!                       Cloud Geometry                                             RAD_ALL.18253 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.18254 
     &     N_CLOUD_TOP                                                             RAD_ALL.18255 
!             TOPMOST CLOUDY LAYER                                                 RAD_ALL.18256 
     &   , N_CLOUD_TYPE                                                            RAD_ALL.18257 
!             NUMBER OF TYPES OF CLOUDS                                            RAD_ALL.18258 
     &   , N_FREE_PROFILE(NPD_LAYER)                                               RAD_ALL.18259 
!             NUMBER OF FREE PROFILES                                              RAD_ALL.18260 
     &   , I_FREE_PROFILE(NPD_PROFILE, NPD_LAYER)                                  RAD_ALL.18261 
!             INDICES OF FREE PROFILES                                             RAD_ALL.18262 
     &   , N_CLOUD_PROFILE(NPD_LAYER)                                              RAD_ALL.18263 
!             NUMBER OF CLOUDY PROFILES                                            RAD_ALL.18264 
     &   , I_CLOUD_PROFILE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.18265 
!             INDICES OF CLOUDY PROFILES                                           RAD_ALL.18266 
     &   , N_COLUMN(NPD_PROFILE)                                                   RAD_ALL.18267 
!             NUMBER OF COLUMNS REQUIRED                                           RAD_ALL.18268 
     &   , I_REGION_CLOUD(NPD_CLOUD_TYPE)                                          RAD_ALL.18269 
!             REGIONS IN WHICH TYPES OF CLOUDS FALL                                RAD_ALL.18270 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.18271 
     &     L_COLUMN(NPD_PROFILE, NPD_LAYER, NPD_COLUMN)                            RAD_ALL.18272 
!             FLAGS FOR CONTENTS OF COLUMNS                                        RAD_ALL.18273 
      REAL  !, INTENT(IN)                                                          RAD_ALL.18274 
     &     W_FREE(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.18275 
!             CLEAR-SKY FRACTION                                                   RAD_ALL.18276 
     &   , W_CLOUD(NPD_PROFILE, NPD_LAYER)                                         RAD_ALL.18277 
!             CLOUDY FRACTION                                                      RAD_ALL.18278 
     &   , FRAC_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                      RAD_ALL.18279 
!             FRACTIONS OF TYPES OF CLOUDS                                         RAD_ALL.18280 
     &   , CLOUD_OVERLAP(NPD_PROFILE, 0: NPD_LAYER, NPD_OVERLAP_COEFF)             RAD_ALL.18281 
!             COEFFICIENTS FOR TRANSFER FOR ENERGY AT INTERFACES                   RAD_ALL.18282 
     &   , AREA_COLUMN(NPD_PROFILE, NPD_COLUMN)                                    RAD_ALL.18283 
!             AREAS OF COLUMNS                                                     RAD_ALL.18284 
     &   , FRAC_REGION(NPD_PROFILE, NPD_LAYER, NPD_REGION)                         RAD_ALL.18285 
!             FRACTIONS OF TOTAL CLOUD OCCUPIED BY EACH REGION                     RAD_ALL.18286 
!                                                                                  RAD_ALL.18287 
!                       Cloudy Optical Properties                                  RAD_ALL.18288 
      REAL  !, INTENT(IN)                                                          RAD_ALL.18289 
     &     K_GREY_TOT_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                RAD_ALL.18290 
!             CLOUDY ABSORPTIVE EXTINCTION                                         RAD_ALL.18291 
     &   , K_EXT_SCAT_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                RAD_ALL.18292 
!             CLOUDY SCATTERING EXTINCTION                                         RAD_ALL.18293 
     &   , ASYMMETRY_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                 RAD_ALL.18294 
!             CLOUDY ASYMMETRY                                                     RAD_ALL.18295 
     &   , FORWARD_SCATTER_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)           RAD_ALL.18296 
!             CLOUDY FORWARD SCATTERING                                            RAD_ALL.18297 
!                                                                                  RAD_ALL.18298 
!                       Calculated Fluxes                                          RAD_ALL.18299 
      REAL  !, INTENT(OUT)                                                         RAD_ALL.18300 
     &     FLUX_DIRECT_BAND(NPD_PROFILE, 0: NPD_LAYER)                             RAD_ALL.18301 
!             DIRECT FLUX                                                          RAD_ALL.18302 
     &   , FLUX_TOTAL_BAND(NPD_PROFILE, 2*NPD_LAYER+2)                             RAD_ALL.18303 
!                                                                                  RAD_ALL.18304 
!                       Flags for Clear-sky Fluxes                                 RAD_ALL.18305 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.18306 
     &     L_CLEAR                                                                 RAD_ALL.18307 
!             CALCULATE NET CLEAR-SKY PROPERTIES                                   RAD_ALL.18308 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.18309 
     &     I_SOLVER_CLEAR                                                          RAD_ALL.18310 
!             CLEAR SOLVER USED                                                    RAD_ALL.18311 
!                                                                                  RAD_ALL.18312 
!                       Calculated Clear-sky Fluxes                                RAD_ALL.18313 
      REAL  !, INTENT(OUT)                                                         RAD_ALL.18314 
     &     FLUX_DIRECT_CLEAR_BAND(NPD_PROFILE, 0: NPD_LAYER)                       RAD_ALL.18315 
!             CLEAR-SKY DIRECT FLUX                                                RAD_ALL.18316 
     &   , FLUX_TOTAL_CLEAR_BAND(NPD_PROFILE, 2*NPD_LAYER+2)                       RAD_ALL.18317 
!             CLEAR-SKY TOTAL FLUX                                                 RAD_ALL.18318 
!                                                                                  RAD_ALL.18319 
!                       Planckian Function                                         RAD_ALL.18320 
      REAL  !, INTENT(IN)                                                          RAD_ALL.18321 
     &     PLANCK_SOURCE_BAND(NPD_PROFILE, 0: NPD_LAYER)                           RAD_ALL.18322 
!             PLANCKIAN SOURCE IN BAND                                             RAD_ALL.18323 
!                                                                                  RAD_ALL.18324 
!                                                                                  RAD_ALL.18325 
!                                                                                  RAD_ALL.18326 
!     LOCAL VARIABLES.                                                             RAD_ALL.18327 
      INTEGER                                                                      RAD_ALL.18328 
     &     I                                                                       RAD_ALL.18329 
!             LOOP VARIABLE                                                        RAD_ALL.18330 
     &   , L                                                                       RAD_ALL.18331 
!             LOOP VARIABLE                                                        RAD_ALL.18332 
      REAL                                                                         RAD_ALL.18333 
     &     FLUX_INC_DIRECT(NPD_PROFILE)                                            RAD_ALL.18334 
!             INCIDENT DIRECT FLUX                                                 RAD_ALL.18335 
     &   , FLUX_INC_DOWN(NPD_PROFILE)                                              RAD_ALL.18336 
!             INCIDENT DOWNWARD FLUX                                               RAD_ALL.18337 
     &   , SOURCE_GROUND(NPD_PROFILE)                                              RAD_ALL.18338 
!             GROUND SOURCE FUNCTION                                               RAD_ALL.18339 
     &   , K_NULL(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.18340 
!             NULL VECTOR FOR CALL TO SUBROUTINE                                   RAD_ALL.18341 
     &   , DUMMY_KE(NPD_PROFILE, NPD_LAYER)                                        RAD_ALL.18342 
!             DUMMY ARRAY (NOT USED)                                               RAD_ALL.18343 
!                                                                                  RAD_ALL.18344 
!     SUBROUTINES CALLED:                                                          RAD_ALL.18345 
      EXTERNAL                                                                     RAD_ALL.18346 
     &     MONOCHROMATIC_FLUX                                                      RAD_ALL.18347 
!                                                                                  RAD_ALL.18348 
!                                                                                  RAD_ALL.18349 
!                                                                                  RAD_ALL.18350 
!     SET THE APPROPRIATE TOTAL UPWARD AND DOWNWARD FLUXES                         RAD_ALL.18351 
!     AT THE BOUNDARIES.                                                           RAD_ALL.18352 
!                                                                                  RAD_ALL.18353 
      IF (ISOLIR.EQ.IP_SOLAR) THEN                                                 RAD_ALL.18354 
!        VISIBLE REGION.                                                           RAD_ALL.18355 
         DO L=1, N_PROFILE                                                         RAD_ALL.18356 
            SOURCE_GROUND(L)=0.0E+00                                               RAD_ALL.18357 
            FLUX_INC_DOWN(L)=SOLAR_FLUX(L)                                         RAD_ALL.18358 
            FLUX_INC_DIRECT(L)=SOLAR_FLUX(L)                                       RAD_ALL.18359 
         ENDDO                                                                     RAD_ALL.18360 
      ELSEIF (ISOLIR.EQ.IP_INFRA_RED) THEN                                         RAD_ALL.18361 
!        INFRA-RED REGION.                                                         RAD_ALL.18362 
         DO L=1, N_PROFILE                                                         RAD_ALL.18363 
            FLUX_INC_DIRECT(L)=0.0E+00                                             RAD_ALL.18364 
            FLUX_DIRECT_BAND(L, N_LAYER)=0.0E+00                                   RAD_ALL.18365 
            FLUX_INC_DOWN(L)=-PLANCK_SOURCE_TOP(L)                                 RAD_ALL.18366 
            SOURCE_GROUND(L)=THERMAL_GROUND_BAND(L)                                RAD_ALL.18367 
     &         +(ALBEDO_SURFACE_DIFF(L)-1.0E+00)                                   RAD_ALL.18368 
     &         *PLANCK_SOURCE_BOTTOM(L)                                            RAD_ALL.18369 
         ENDDO                                                                     RAD_ALL.18370 
         IF (L_CLEAR) THEN                                                         RAD_ALL.18371 
            DO L=1, N_PROFILE                                                      RAD_ALL.18372 
               FLUX_DIRECT_CLEAR_BAND(L, N_LAYER)=0.0E+00                          RAD_ALL.18373 
            ENDDO                                                                  RAD_ALL.18374 
         ENDIF                                                                     RAD_ALL.18375 
      ENDIF                                                                        RAD_ALL.18376 
!                                                                                  RAD_ALL.18377 
      DO I=1, N_LAYER                                                              RAD_ALL.18378 
         DO L=1, N_PROFILE                                                         RAD_ALL.18379 
            K_NULL(L, I)=0.0E+00                                                   RAD_ALL.18380 
         ENDDO                                                                     RAD_ALL.18381 
      ENDDO                                                                        RAD_ALL.18382 
!                                                                                  RAD_ALL.18383 
!                                                                                  RAD_ALL.18384 
      CALL MONOCHROMATIC_FLUX(IERR                                                 RAD_ALL.18385 
!                       Atmospheric Properties                                     RAD_ALL.18386 
     &   , N_PROFILE, N_LAYER, D_MASS                                              RAD_ALL.18387 
!                       Angular Integration                                        RAD_ALL.18388 
     &   , I_ANGULAR_INTEGRATION, I_2STREAM, L_2_STREAM_CORRECT                    RAD_ALL.18389 
     &   , L_RESCALE, N_ORDER_GAUSS                                                RAD_ALL.18390 
!                       Treatment of Scattering                                    RAD_ALL.18391 
     &   , I_SCATTER_METHOD_BAND                                                   RAD_ALL.18392 
!                       Options for Solver                                         RAD_ALL.18393 
     &   , I_SOLVER, L_NET, I_EXTRAPOLATE_MIX_NET, N_AUGMENT                       RAD_ALL.18394 
!                       Gaseous Propreties                                         RAD_ALL.18395 
     &   , K_NULL                                                                  RAD_ALL.18396 
!                       Options for Equivalent Extinction                          RAD_ALL.18397 
     &   , .FALSE., DUMMY_KE                                                       RAD_ALL.18398 
!                       Spectral Region                                            RAD_ALL.18399 
     &   , ISOLIR                                                                  RAD_ALL.18400 
!                       Infra-red Properties                                       RAD_ALL.18401 
     &   , DIFF_PLANCK_BAND                                                        RAD_ALL.18402 
     &   , L_IR_SOURCE_QUAD, DIFF_PLANCK_BAND_2                                    RAD_ALL.18403 
!                       Conditions at TOA                                          RAD_ALL.18404 
     &   , SEC_0, FLUX_INC_DIRECT, FLUX_INC_DOWN                                   RAD_ALL.18405 
!                       Surface Properties                                         RAD_ALL.18406 
     &   , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR, SOURCE_GROUND                  RAD_ALL.18407 
     &   , THERMAL_GROUND_BAND                                                     RAD_ALL.18408 
!                       Clear-sky Optical Properties                               RAD_ALL.18409 
     &   , K_GREY_TOT_FREE, K_EXT_SCAT_FREE                                        RAD_ALL.18410 
     &   , ASYMMETRY_FREE, FORWARD_SCATTER_FREE                                    RAD_ALL.18411 
!                       Cloudy Properties                                          RAD_ALL.18412 
     &   , L_CLOUD, I_CLOUD                                                        RAD_ALL.18413 
!                       Cloud Geometry                                             RAD_ALL.18414 
     &   , N_CLOUD_TOP                                                             RAD_ALL.18415 
     &   , N_CLOUD_TYPE, FRAC_CLOUD                                                RAD_ALL.18416 
     &   , I_REGION_CLOUD, FRAC_REGION                                             RAD_ALL.18417 
     &   , W_FREE, N_FREE_PROFILE, I_FREE_PROFILE                                  RAD_ALL.18418 
     &   , W_CLOUD, N_CLOUD_PROFILE, I_CLOUD_PROFILE                               RAD_ALL.18419 
     &   , CLOUD_OVERLAP                                                           RAD_ALL.18420 
     &   , N_COLUMN, L_COLUMN, AREA_COLUMN                                         RAD_ALL.18421 
!                       Cloudy Optical Properties                                  RAD_ALL.18422 
     &   , K_GREY_TOT_CLOUD, K_EXT_SCAT_CLOUD                                      RAD_ALL.18423 
     &   , ASYMMETRY_CLOUD, FORWARD_SCATTER_CLOUD                                  RAD_ALL.18424 
!                       Flxues Calculated                                          RAD_ALL.18425 
     &   , FLUX_DIRECT_BAND, FLUX_TOTAL_BAND                                       RAD_ALL.18426 
!                       Flags for Clear-sky Calculations                           RAD_ALL.18427 
     &   , L_CLEAR, I_SOLVER_CLEAR                                                 RAD_ALL.18428 
!                       Clear-sky Fluxes Calculated                                RAD_ALL.18429 
     &   , FLUX_DIRECT_CLEAR_BAND, FLUX_TOTAL_CLEAR_BAND                           RAD_ALL.18430 
!                       Planckian Function                                         RAD_ALL.18431 
     &   , PLANCK_SOURCE_BAND                                                      RAD_ALL.18432 
!                       Dimensions of Arrays                                       RAD_ALL.18433 
     &   , NPD_PROFILE, NPD_LAYER, NPD_COLUMN                                      RAD_ALL.18434 
     &   )                                                                         RAD_ALL.18435 
!                                                                                  RAD_ALL.18436 
!                                                                                  RAD_ALL.18437 
!                                                                                  RAD_ALL.18438 
      RETURN                                                                       RAD_ALL.18439 
      END    
