C (c) CROWN COPYRIGHT 1995, METEOROLOGICAL OFFICE, All Rights Reserved.            RAD_ALL.15044 
C                                                                                  RAD_ALL.15045 
C Use, duplication or disclosure of this code is subject to the                    RAD_ALL.15046 
C restrictions as set forth in the contract.                                       RAD_ALL.15047 
C                                                                                  RAD_ALL.15048 
C                Meteorological Office                                             RAD_ALL.15049 
C                London Road                                                       RAD_ALL.15050 
C                BRACKNELL                                                         RAD_ALL.15051 
C                Berkshire UK                                                      RAD_ALL.15052 
C                RG12 2SZ                                                          RAD_ALL.15053 
C                                                                                  RAD_ALL.15054 
C If no contract has been raised with this copy of the code, the use,              RAD_ALL.15055 
C duplication or disclosure of it is strictly prohibited.  Permission              RAD_ALL.15056 
C to do so must first be obtained in writing from the Head of Numerical            RAD_ALL.15057 
C Modelling at the above address.                                                  RAD_ALL.15058 
C ******************************COPYRIGHT******************************            RAD_ALL.15059 
C                                                                                  RAD_ALL.15060 
!+ Subroutine to calculate the fluxes within the band using CFESFT.                RAD_ALL.15061 
!                                                                                  RAD_ALL.15062 
! Method:                                                                          RAD_ALL.15063 
!       The fluxes in the band including the grey processes and the                RAD_ALL.15064 
!       major gas are calculated. Effective transmissions are found                RAD_ALL.15065 
!       for the minor gases from clear-sky calculations. These effective           RAD_ALL.15066 
!       transmissions are used to scale the fluxes found initially.                RAD_ALL.15067 
!       This treatment of the overlaps is not appropriate in the solar             RAD_ALL.15068 
!       region.                                                                    RAD_ALL.15069 
!                                                                                  RAD_ALL.15070 
! Current Owner of Code: J. M. Edwards                                             RAD_ALL.15071 
!                                                                                  RAD_ALL.15072 
! History:                                                                         RAD_ALL.15073 
!       Version         Date                    Comment                            RAD_ALL.15074 
!       4.0             27-07-95                Original Code                      RAD_ALL.15075 
!                                               (J. M. Edwards)                    RAD_ALL.15076 
!       4.2             08-08-96                Code for vertically                RAD_ALL.15077 
!                                               coherent convective                RAD_ALL.15078 
!                                               cloud added.                       RAD_ALL.15079 
!                                               (J. M. Edwards)                    RAD_ALL.15080 
!                                                                                  RAD_ALL.15081 
! Description of Code:                                                             RAD_ALL.15082 
!   FORTRAN 77  with extensions listed in documentation.                           RAD_ALL.15083 
!                                                                                  RAD_ALL.15084 
!- ---------------------------------------------------------------------           RAD_ALL.15085 
      SUBROUTINE SOLVE_BAND_CLR_FESFT(IERR                                         RAD_ALL.15086 
!                       Atmospheric Column                                         RAD_ALL.15087 
     &   , N_PROFILE, N_LAYER, L_LAYER, I_TOP, P, T, D_MASS                        RAD_ALL.15088 
!                       Angular Integration                                        RAD_ALL.15089 
     &   , I_ANGULAR_INTEGRATION, I_2STREAM, L_2_STREAM_CORRECT                    RAD_ALL.15090 
     &   , L_RESCALE, N_ORDER_GAUSS                                                RAD_ALL.15091 
!                       Treatment of Scattering                                    RAD_ALL.15092 
     &   , I_SCATTER_METHOD_BAND                                                   RAD_ALL.15093 
!                       Options for Solver                                         RAD_ALL.15094 
     &   , I_SOLVER, L_NET, I_EXTRAPOLATE_MIX_NET, N_AUGMENT                       RAD_ALL.15095 
!                       Gaseous Properties                                         RAD_ALL.15096 
     &   , I_BAND, N_GAS                                                           RAD_ALL.15097 
     &   , INDEX_ABSORB, I_BAND_ESFT, I_SCALE_ESFT, I_SCALE_FNC                    RAD_ALL.15098 
     &   , K_ESFT, W_ESFT, SCALE_VECTOR                                            RAD_ALL.15099 
     &   , P_REFERENCE, T_REFERENCE                                                RAD_ALL.15100 
     &   , GAS_MIX_RATIO, GAS_FRAC_RESCALED                                        RAD_ALL.15101 
     &   , L_DOPPLER, DOPPLER_CORRECTION                                           RAD_ALL.15102 
!                       Spectral region                                            RAD_ALL.15103 
     &   , ISOLIR                                                                  RAD_ALL.15104 
!                       Solar Properties                                           RAD_ALL.15105 
     &   , SEC_0, SOLAR_FLUX                                                       RAD_ALL.15106 
!                       Infra-red Properties                                       RAD_ALL.15107 
     &   , PLANCK_SOURCE_BAND                                                      RAD_ALL.15108 
     &   , DIFF_PLANCK_BAND                                                        RAD_ALL.15109 
     &   , L_IR_SOURCE_QUAD, DIFF_PLANCK_BAND_2                                    RAD_ALL.15110 
!                       Surface Properties                                         RAD_ALL.15111 
     &   , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR, THERMAL_GROUND_BAND            RAD_ALL.15112 
!                       Clear-sky Optical Propeties                                RAD_ALL.15113 
     &   , K_GREY_TOT_FREE, K_EXT_SCAT_FREE, ASYMMETRY_FREE                        RAD_ALL.15114 
     &   , FORWARD_SCATTER_FREE                                                    RAD_ALL.15115 
!                       Cloudy Properties                                          RAD_ALL.15116 
     &   , L_CLOUD, I_CLOUD                                                        RAD_ALL.15117 
!                       Cloud Geometry                                             RAD_ALL.15118 
     &   , N_CLOUD_TOP                                                             RAD_ALL.15119 
     &   , N_CLOUD_TYPE, FRAC_CLOUD                                                RAD_ALL.15120 
     &   , I_REGION_CLOUD, FRAC_REGION                                             RAD_ALL.15121 
     &   , W_FREE, N_FREE_PROFILE, I_FREE_PROFILE                                  RAD_ALL.15122 
     &   , W_CLOUD, N_CLOUD_PROFILE, I_CLOUD_PROFILE                               RAD_ALL.15123 
     &   , CLOUD_OVERLAP                                                           RAD_ALL.15124 
     &   , N_COLUMN, L_COLUMN, AREA_COLUMN                                         RAD_ALL.15125 
!                       Cloudy Optical Properties                                  RAD_ALL.15126 
     &   , K_GREY_TOT_CLOUD, K_EXT_SCAT_CLOUD                                      RAD_ALL.15127 
     &   , ASYMMETRY_CLOUD                                                         RAD_ALL.15128 
     &   , FORWARD_SCATTER_CLOUD                                                   RAD_ALL.15129 
!                       Fluxes Calculated                                          RAD_ALL.15130 
     &   , FLUX_DIRECT_BAND, FLUX_DIFFUSE_BAND                                     RAD_ALL.15131 
!                       Flags for Clear-sky Calculations                           RAD_ALL.15132 
     &   , L_CLEAR, I_SOLVER_CLEAR                                                 RAD_ALL.15133 
!                       Clear-sky Fluxes Calculated                                RAD_ALL.15134 
     &   , FLUX_DIRECT_CLEAR_BAND, FLUX_DIFFUSE_CLEAR_BAND                         RAD_ALL.15135 
     &   , NPD_PROFILE, NPD_LAYER, NPD_COLUMN                                      RAD_ALL.15136 
     &   , NPD_BAND, NPD_SPECIES                                                   RAD_ALL.15137 
     &   , NPD_ESFT_TERM, NPD_SCALE_VARIABLE, NPD_SCALE_FNC                        RAD_ALL.15138 
     &   )                                                                         RAD_ALL.15139 
!                                                                                  RAD_ALL.15140 
!                                                                                  RAD_ALL.15141 
!                                                                                  RAD_ALL.15142 
      IMPLICIT NONE                                                                RAD_ALL.15143 
!                                                                                  RAD_ALL.15144 
!                                                                                  RAD_ALL.15145 
!     SIZES OF DUMMY ARRAYS.                                                       RAD_ALL.15146 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15147 
     &     NPD_PROFILE                                                             RAD_ALL.15148 
!             MAXIMUM NUMBER OF PROFILES                                           RAD_ALL.15149 
     &   , NPD_LAYER                                                               RAD_ALL.15150 
!             MAXIMUM NUMBER OF LAYERS                                             RAD_ALL.15151 
     &   , NPD_BAND                                                                RAD_ALL.15152 
!             MAXIMUM NUMBER OF SPECTRAL BANDS                                     RAD_ALL.15153 
     &   , NPD_SPECIES                                                             RAD_ALL.15154 
!             MAXIMUM NUMBER OF SPECIES                                            RAD_ALL.15155 
     &   , NPD_ESFT_TERM                                                           RAD_ALL.15156 
!             MAXIMUM NUMBER OF ESFT TERMS                                         RAD_ALL.15157 
     &   , NPD_SCALE_VARIABLE                                                      RAD_ALL.15158 
!             MAXIMUM NUMBER OF SCALE VARIABLES                                    RAD_ALL.15159 
     &   , NPD_SCALE_FNC                                                           RAD_ALL.15160 
!             MAXIMUM NUMBER OF SCALING FUNCTIONS                                  RAD_ALL.15161 
     &   , NPD_COLUMN                                                              RAD_ALL.15162 
!             NUMBER OF COLUMNS PER POINT                                          RAD_ALL.15163 
!                                                                                  RAD_ALL.15164 
!     INCLUDE COMDECKS.                                                            RAD_ALL.15165 
!     ------------------------------------------------------------------           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    
!     ------------------------------------------------------------------           STDIO3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       STDIO3A.3     
!                                                                                  STDIO3A.4     
!     MODULE TO SET UNIT NUMBERS FOR STANDARD I/O.                                 STDIO3A.5     
!                                                                                  STDIO3A.6     
      INTEGER                                                                      STDIO3A.7     
     &     IU_STDIN                                                                STDIO3A.8     
!             UNIT NUMBER FOR STANDARD INPUT                                       STDIO3A.9     
     &   , IU_STDOUT                                                               STDIO3A.10    
!             UNIT NUMBER FOR STANDARD OUTPUT                                      STDIO3A.11    
     *   , IU_ERR                                                                  STDIO3A.12    
!             UNIT NUMBER FOR ERROR MESSAGES                                       STDIO3A.13    
!                                                                                  STDIO3A.14    
      PARAMETER(                                                                   STDIO3A.15    
     &     IU_STDIN=5                                                              STDIO3A.16    
     &   , IU_STDOUT=6                                                             STDIO3A.17    
     *   , IU_ERR=6                                                                STDIO3A.18    
     &   )                                                                         STDIO3A.19    
!                                                                                  STDIO3A.20    
!     ------------------------------------------------------------------           STDIO3A.21    
!     ------------------------------------------------------------------           ESFTSC3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       ESFTSC3A.3     
!                                                                                  ESFTSC3A.4     
!     MODULE SETTING TYPES OF ESFT SCALING                                         ESFTSC3A.5     
!                                                                                  ESFTSC3A.6     
      INTEGER                                                                      ESFTSC3A.7     
     &     IP_SCALE_NULL                                                           ESFTSC3A.8     
!             NO SCALING AT ALL                                                    ESFTSC3A.9     
     &   , IP_SCALE_BAND                                                           ESFTSC3A.10    
!             SAME SCALING THROUGHOUT BAND                                         ESFTSC3A.11    
     &   , IP_SCALE_TERM                                                           ESFTSC3A.12    
!             DIFFERENT SCALING FOR EACH ESFT                                      ESFTSC3A.13    
!                                                                                  ESFTSC3A.14    
      PARAMETER(                                                                   ESFTSC3A.15    
     &     IP_SCALE_NULL=0                                                         ESFTSC3A.16    
     &   , IP_SCALE_BAND=1                                                         ESFTSC3A.17    
     &   , IP_SCALE_TERM=2                                                         ESFTSC3A.18    
     &   )                                                                         ESFTSC3A.19    
!                                                                                  ESFTSC3A.20    
!     ------------------------------------------------------------------           ESFTSC3A.21    
!     ------------------------------------------------------------------           PRMCH3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       PRMCH3A.3     
!                                                                                  PRMCH3A.4     
!     MODULE FOR SETTING MACHINE PRECISION.                                        PRMCH3A.5     
!                                                                                  PRMCH3A.6     
      REAL                                                                         PRMCH3A.7     
     &     TOL_MACHINE                                                             PRMCH3A.8     
!             MACHINE TOLERANCE                                                    PRMCH3A.9     
     &   , SQRT_TOL_MACHINE                                                        PRMCH3A.10    
!             SQRT OF MACHINE TOLERANCE                                            PRMCH3A.11    
!                                                                                  PRMCH3A.12    
!                                                                                  PRMCH3A.13    
!     THE PRECISION SHOULD BE ABOUT 2/2^(SIZE OF SIGNIFICAND)                      PRMCH3A.14    
!                                                                                  PRMCH3A.15    
!     THE IEEE-FORMAT USES 53 BITS FOR THE SIGNIFICAND                             PRMCH3A.16    
!     IN DOUBLE PRECISION                                                          PRMCH3A.17    
!                                                                                  PRMCH3A.18    
!     THE CRAY FORMAT USES 47 BITS IN SINGLE PRECISION.                            PRMCH3A.19    
!                                                                                  PRMCH3A.20    
      PARAMETER(                                                                   PRMCH3A.21    
     &     TOL_MACHINE=1.42E-14                                                    PRMCH3A.22    
     &   , SQRT_TOL_MACHINE=1.19E-7                                                PRMCH3A.23    
     &   )                                                                         PRMCH3A.24    
!                                                                                  PRMCH3A.25    
!     ------------------------------------------------------------------           PRMCH3A.26    
!     ------------------------------------------------------------------           PRECSN3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       PRECSN3A.3     
!                                                                                  PRECSN3A.4     
!     MODULE FOR SETTING MACHINE-DEPENDENT TOLERANCES.                             PRECSN3A.5     
!     (THE COMDECK PRMCH3A MUST ALWAYS BE INCLUDED BEFORE THIS COMDECK.)           PRECSN3A.6     
!                                                                                  PRECSN3A.7     
      REAL                                                                         PRECSN3A.8     
     &     TOL_DIV                                                                 PRECSN3A.9     
!             TOLERANCE FOR DIVISION                                               PRECSN3A.10    
     &   , TOL_TEST                                                                PRECSN3A.11    
!             TOLERANCE FOR TESTING EQUALITY                                       PRECSN3A.12    
!                                                                                  PRECSN3A.13    
      PARAMETER(                                                                   PRECSN3A.14    
     &     TOL_DIV=3.2E+01*TOL_MACHINE                                             PRECSN3A.15    
     &   , TOL_TEST=1.6E+01*TOL_MACHINE                                            PRECSN3A.16    
     &   )                                                                         PRECSN3A.17    
!                                                                                  PRECSN3A.18    
!     ------------------------------------------------------------------           PRECSN3A.19    
!     ------------------------------------------------------------------           DIFFKE3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       DIFFKE3A.3     
!                                                                                  DIFFKE3A.4     
!     MODULE TO SET THE DIFFUSIVITY FACTOR FOR USE WITH                            DIFFKE3A.5     
!     EQUIVALENT EXTINCTION                                                        DIFFKE3A.6     
!                                                                                  DIFFKE3A.7     
      REAL                                                                         DIFFKE3A.8     
     &     DIFFUSIVITY_FACTOR_MINOR                                                DIFFKE3A.9     
!             MINOR DIFFUSIVITY FACTOR                                             DIFFKE3A.10    
!                                                                                  DIFFKE3A.11    
      PARAMETER(                                                                   DIFFKE3A.12    
     &     DIFFUSIVITY_FACTOR_MINOR=1.66E+00                                       DIFFKE3A.13    
     &   )                                                                         DIFFKE3A.14    
!                                                                                  DIFFKE3A.15    
!     ------------------------------------------------------------------           DIFFKE3A.16    
!     ------------------------------------------------------------------           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    
!     ------------------------------------------------------------------           ERROR3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       ERROR3A.3     
!                                                                                  ERROR3A.4     
!     MODULE TO SET ERROR FLAGS IN THE RADIATION CODE.                             ERROR3A.5     
!                                                                                  ERROR3A.6     
      INTEGER                                                                      ERROR3A.7     
     &     I_NORMAL                                                                ERROR3A.8     
!             ERROR FREE CONDITION                                                 ERROR3A.9     
     &   , I_ERR_FATAL                                                             ERROR3A.10    
!             FATAL ERROR: IMMEDIATE RETURN                                        ERROR3A.11    
     &   , I_ABORT_CALCULATION                                                     ERROR3A.12    
!             CALCULATION ABORTED                                                  ERROR3A.13    
     &   , I_MISSING_DATA                                                          ERROR3A.14    
!             MISSING DATA ERROR: CONDITIONAL                                      ERROR3A.15    
     &   , I_ERR_IO                                                                ERROR3A.16    
!             I/O ERROR                                                            ERROR3A.17    
     &   , I_ERR_RANGE                                                             ERROR3A.18    
!             INTERPOLATION RANGE ERROR                                            ERROR3A.19    
     &   , I_ERR_EXIST                                                             ERROR3A.20    
!             EXISTENCE ERROR                                                      ERROR3A.21    
!                                                                                  ERROR3A.22    
      PARAMETER(                                                                   ERROR3A.23    
     &     I_NORMAL=0                                                              ERROR3A.24    
     &   , I_ERR_FATAL=1                                                           ERROR3A.25    
     &   , I_ABORT_CALCULATION=2                                                   ERROR3A.26    
     &   , I_MISSING_DATA=3                                                        ERROR3A.27    
     &   , I_ERR_IO=4                                                              ERROR3A.28    
     &   , I_ERR_RANGE=5                                                           ERROR3A.29    
     &   , I_ERR_EXIST=6                                                           ERROR3A.30    
     &   )                                                                         ERROR3A.31    
!                                                                                  ERROR3A.32    
!     ------------------------------------------------------------------           ERROR3A.33    
!                                                                                  RAD_ALL.15174 
!                                                                                  RAD_ALL.15175 
!                                                                                  RAD_ALL.15176 
!     DUMMY ARGUMENTS.                                                             RAD_ALL.15177 
      INTEGER   !, INTENT(OUT)                                                     RAD_ALL.15178 
     &     IERR                                                                    RAD_ALL.15179 
!             ERROR FLAG                                                           RAD_ALL.15180 
!                                                                                  RAD_ALL.15181 
!                       Atmospheric Column                                         RAD_ALL.15182 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15183 
     &     N_PROFILE                                                               RAD_ALL.15184 
!             NUMBER OF PROFILES                                                   RAD_ALL.15185 
     &   , N_LAYER                                                                 RAD_ALL.15186 
!             NUMBER OF LAYERS                                                     RAD_ALL.15187 
     &   , I_TOP                                                                   RAD_ALL.15188 
!             TOP OF VERTICAL GRID                                                 RAD_ALL.15189 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15190 
     &     L_LAYER                                                                 RAD_ALL.15191 
!             PROPERTIES GIVEN IN LAYERS                                           RAD_ALL.15192 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15193 
     &     D_MASS(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.15194 
!             MASS THICKNESS OF EACH LAYER                                         RAD_ALL.15195 
     &   , P(NPD_PROFILE, 0: NPD_LAYER)                                            RAD_ALL.15196 
!             PRESSURE                                                             RAD_ALL.15197 
     &   , T(NPD_PROFILE, 0: NPD_LAYER)                                            RAD_ALL.15198 
!             TEMPERATURE                                                          RAD_ALL.15199 
!                                                                                  RAD_ALL.15200 
!                       Angular Integration                                        RAD_ALL.15201 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15202 
     &     I_ANGULAR_INTEGRATION                                                   RAD_ALL.15203 
!             ANGULAR INTEGRATION SCHEME                                           RAD_ALL.15204 
     &   , I_2STREAM                                                               RAD_ALL.15205 
!             TWO-STREAM SCHEME                                                    RAD_ALL.15206 
     &   , N_ORDER_GAUSS                                                           RAD_ALL.15207 
!             ORDER OF GAUSSIAN INTEGRATION                                        RAD_ALL.15208 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15209 
     &     L_2_STREAM_CORRECT                                                      RAD_ALL.15210 
!             USE AN EDGE CORRECTION                                               RAD_ALL.15211 
     &   , L_RESCALE                                                               RAD_ALL.15212 
!             RESCALE OPTICAL PROPERTIES                                           RAD_ALL.15213 
!                                                                                  RAD_ALL.15214 
!                       Treatment of Scattering                                    RAD_ALL.15215 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15216 
     &     I_SCATTER_METHOD_BAND                                                   RAD_ALL.15217 
!             METHOD OF TREATING SCATTERING                                        RAD_ALL.15218 
!                                                                                  RAD_ALL.15219 
!                       Options for Solver                                         RAD_ALL.15220 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15221 
     &     I_SOLVER                                                                RAD_ALL.15222 
!             SOLVER USED                                                          RAD_ALL.15223 
     &   , I_EXTRAPOLATE_MIX_NET                                                   RAD_ALL.15224 
!             METHOD FOR EXTRAPOLATING WITH A MIXED SOLVER                         RAD_ALL.15225 
     &   , N_AUGMENT                                                               RAD_ALL.15226 
!             LENGTH OF LONG FLUX VECTOR                                           RAD_ALL.15227 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15228 
     &     L_NET                                                                   RAD_ALL.15229 
!             CALCULATE NET FLUXES                                                 RAD_ALL.15230 
!                                                                                  RAD_ALL.15231 
!                       Gaseous Properties                                         RAD_ALL.15232 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15233 
     &     I_BAND                                                                  RAD_ALL.15234 
!             BAND BEING CONSIDERED                                                RAD_ALL.15235 
     &   , N_GAS                                                                   RAD_ALL.15236 
!             NUMBER OF GASES IN BAND                                              RAD_ALL.15237 
     &   , INDEX_ABSORB(NPD_SPECIES, NPD_BAND)                                     RAD_ALL.15238 
!             LIST OF ABSORBERS IN BANDS                                           RAD_ALL.15239 
     &   , I_BAND_ESFT(NPD_BAND, NPD_SPECIES)                                      RAD_ALL.15240 
!             NUMBER OF TERMS IN BAND                                              RAD_ALL.15241 
     &   , I_SCALE_ESFT(NPD_BAND, NPD_SPECIES)                                     RAD_ALL.15242 
!             TYPE OF ESFT SCALING                                                 RAD_ALL.15243 
     &   , I_SCALE_FNC(NPD_BAND, NPD_SPECIES)                                      RAD_ALL.15244 
!             TYPE OF SCALING FUNCTION                                             RAD_ALL.15245 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15246 
     &     L_DOPPLER(NPD_SPECIES)                                                  RAD_ALL.15247 
!             DOPPLER BROADENING INCLUDED                                          RAD_ALL.15248 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15249 
     &     K_ESFT(NPD_ESFT_TERM, NPD_BAND, NPD_SPECIES)                            RAD_ALL.15250 
!             EXPONENTIAL ESFT TERMS                                               RAD_ALL.15251 
     &   , W_ESFT(NPD_ESFT_TERM, NPD_BAND, NPD_SPECIES)                            RAD_ALL.15252 
!             WEIGHTS FOR ESFT                                                     RAD_ALL.15253 
     &   , SCALE_VECTOR(NPD_SCALE_VARIABLE, NPD_ESFT_TERM, NPD_BAND                RAD_ALL.15254 
     &        , NPD_SPECIES)                                                       RAD_ALL.15255 
!             ABSORBER SCALING PARAMETERS                                          RAD_ALL.15256 
     &   , P_REFERENCE(NPD_SPECIES, NPD_BAND)                                      RAD_ALL.15257 
!             REFERENCE SCALING PRESSURE                                           RAD_ALL.15258 
     &   , T_REFERENCE(NPD_SPECIES, NPD_BAND)                                      RAD_ALL.15259 
!             REFERENCE SCALING TEMPERATURE                                        RAD_ALL.15260 
     &   , GAS_MIX_RATIO(NPD_PROFILE, 0: NPD_LAYER, NPD_SPECIES)                   RAD_ALL.15261 
!             GAS MASS MIXING RATIOS                                               RAD_ALL.15262 
     &   , GAS_FRAC_RESCALED(NPD_PROFILE, 0: NPD_LAYER, NPD_SPECIES)               RAD_ALL.15263 
!             RESCALED GAS MASS FRACTIONS                                          RAD_ALL.15264 
     &   , DOPPLER_CORRECTION(NPD_SPECIES)                                         RAD_ALL.15265 
!             DOPPLER BROADENING TERMS                                             RAD_ALL.15266 
!                                                                                  RAD_ALL.15267 
!                       Spectral Region                                            RAD_ALL.15268 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15269 
     &     ISOLIR                                                                  RAD_ALL.15270 
!             VISIBLE OR IR                                                        RAD_ALL.15271 
!                                                                                  RAD_ALL.15272 
!                       Solar Properties                                           RAD_ALL.15273 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15274 
     &     SEC_0(NPD_PROFILE)                                                      RAD_ALL.15275 
!             SECANT OF SOLAR ZENITH ANGLE                                         RAD_ALL.15276 
     &   , SOLAR_FLUX(NPD_PROFILE)                                                 RAD_ALL.15277 
!             INCIDENT SOLAR FLUX IN BAND                                          RAD_ALL.15278 
!                                                                                  RAD_ALL.15279 
!                       Infra-red Properties                                       RAD_ALL.15280 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15281 
     &     L_IR_SOURCE_QUAD                                                        RAD_ALL.15282 
!             USE A QUADRATIC SOURCE FUNCTION                                      RAD_ALL.15283 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15284 
     &     PLANCK_SOURCE_BAND(NPD_PROFILE, 0: NPD_LAYER)                           RAD_ALL.15285 
!             PLANCKIAN SOURCE IN BAND                                             RAD_ALL.15286 
     &   , DIFF_PLANCK_BAND(NPD_PROFILE, NPD_LAYER)                                RAD_ALL.15287 
!             THERMAL SOURCE FUNCTION                                              RAD_ALL.15288 
     &   , DIFF_PLANCK_BAND_2(NPD_PROFILE, NPD_LAYER)                              RAD_ALL.15289 
!             2x2ND DIFFERENCE OF PLANCKIAN IN BAND                                RAD_ALL.15290 
!                                                                                  RAD_ALL.15291 
!                       Surface Properties                                         RAD_ALL.15292 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15293 
     &     ALBEDO_SURFACE_DIFF(NPD_PROFILE)                                        RAD_ALL.15294 
!             DIFFUSE SURFACE ALBEDO                                               RAD_ALL.15295 
     &   , ALBEDO_SURFACE_DIR(NPD_PROFILE)                                         RAD_ALL.15296 
!             DIRECT SURFACE ALBEDO                                                RAD_ALL.15297 
     &   , THERMAL_GROUND_BAND(NPD_PROFILE)                                        RAD_ALL.15298 
!             THERMAL SOURCE FUNCTION AT GROUND                                    RAD_ALL.15299 
!                                                                                  RAD_ALL.15300 
!                       Clear-sky Optical Properties                               RAD_ALL.15301 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15302 
     &     K_GREY_TOT_FREE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.15303 
!             FREE ABSORPTIVE EXTINCTION                                           RAD_ALL.15304 
     &   , K_EXT_SCAT_FREE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.15305 
!             FREE SCATTERING EXTINCTION                                           RAD_ALL.15306 
     &   , ASYMMETRY_FREE(NPD_PROFILE, NPD_LAYER)                                  RAD_ALL.15307 
!             CLEAR-SKY ASYMMETRY                                                  RAD_ALL.15308 
     &   , FORWARD_SCATTER_FREE(NPD_PROFILE, NPD_LAYER)                            RAD_ALL.15309 
!             FREE FORWARD SCATTERING                                              RAD_ALL.15310 
!                                                                                  RAD_ALL.15311 
!                                                                                  RAD_ALL.15312 
!                       Cloudy Properties                                          RAD_ALL.15313 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15314 
     &     L_CLOUD                                                                 RAD_ALL.15315 
!             CLOUDS REQUIRED                                                      RAD_ALL.15316 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15317 
     &     I_CLOUD                                                                 RAD_ALL.15318 
!             CLOUD SCHEME USED                                                    RAD_ALL.15319 
!                                                                                  RAD_ALL.15320 
!                       Cloud Geometry                                             RAD_ALL.15321 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15322 
     &     N_CLOUD_TOP                                                             RAD_ALL.15323 
!             TOP CLOUDY LAYER                                                     RAD_ALL.15324 
     &   , N_CLOUD_TYPE                                                            RAD_ALL.15325 
!             NUMBER OF TYPES OF CLOUDS                                            RAD_ALL.15326 
     &   , N_FREE_PROFILE(NPD_LAYER)                                               RAD_ALL.15327 
!             NUMBER OF FREE PROFILES                                              RAD_ALL.15328 
     &   , I_FREE_PROFILE(NPD_PROFILE, NPD_LAYER)                                  RAD_ALL.15329 
!             INDICES OF FREE PROFILES                                             RAD_ALL.15330 
     &   , N_CLOUD_PROFILE(NPD_LAYER)                                              RAD_ALL.15331 
!             NUMBER OF CLOUDY PROFILES                                            RAD_ALL.15332 
     &   , I_CLOUD_PROFILE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.15333 
!             INDICES OF CLOUDY PROFILES                                           RAD_ALL.15334 
     &   , N_COLUMN(NPD_PROFILE)                                                   RAD_ALL.15335 
!             NUMBER OF COLUMNS REQUIRED                                           RAD_ALL.15336 
     &   , I_REGION_CLOUD(NPD_CLOUD_TYPE)                                          RAD_ALL.15337 
!             REGIONS IN WHICH TYPES OF CLOUDS FALL                                RAD_ALL.15338 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15339 
     &     L_COLUMN(NPD_PROFILE, NPD_LAYER, NPD_COLUMN)                            RAD_ALL.15340 
!             COLUMN FLAGS FOR COLUMNS                                             RAD_ALL.15341 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15342 
     &     W_CLOUD(NPD_PROFILE, NPD_LAYER)                                         RAD_ALL.15343 
!             CLOUDY FRACTION                                                      RAD_ALL.15344 
     &   , FRAC_CLOUD(NPD_PROFILE, NPD_LAYER)                                      RAD_ALL.15345 
!             FRACTIONS OF DIFFERENT TYPES OF CLOUD                                RAD_ALL.15346 
     &   , W_FREE(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.15347 
!             CLEAR-SKY FRACTION                                                   RAD_ALL.15348 
     &   , CLOUD_OVERLAP(NPD_PROFILE, 0: NPD_LAYER, NPD_OVERLAP_COEFF)             RAD_ALL.15349 
!             COEFFICIENTS FOR TRANSFER FOR ENERGY AT INTERFACES                   RAD_ALL.15350 
     &   , AREA_COLUMN(NPD_PROFILE, NPD_COLUMN)                                    RAD_ALL.15351 
!             AREAS OF COLUMNS                                                     RAD_ALL.15352 
     &   , FRAC_REGION(NPD_PROFILE, NPD_LAYER, NPD_REGION)                         RAD_ALL.15353 
!             FRACTIONS OF TOTAL CLOUD OCCUPIED BY EACH REGION                     RAD_ALL.15354 
!                                                                                  RAD_ALL.15355 
!                       Cloudy Optical Properties                                  RAD_ALL.15356 
      REAL                                                                         RAD_ALL.15357 
     &     K_GREY_TOT_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                RAD_ALL.15358 
!             CLOUDY ABSORPTIVE EXTINCTION                                         RAD_ALL.15359 
     &   , K_EXT_SCAT_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                RAD_ALL.15360 
!             CLOUDY SCATTERING EXTINCTION                                         RAD_ALL.15361 
     &   , ASYMMETRY_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                 RAD_ALL.15362 
!             CLOUDY ASYMMETRY                                                     RAD_ALL.15363 
     &   , FORWARD_SCATTER_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)           RAD_ALL.15364 
!             CLOUDY FORWARD SCATTERING                                            RAD_ALL.15365 
!                                                                                  RAD_ALL.15366 
!                       Fluxes Calculated                                          RAD_ALL.15367 
      REAL  !, INTENT(OUT)                                                         RAD_ALL.15368 
     &     FLUX_DIRECT_BAND(NPD_PROFILE, 0: NPD_LAYER)                             RAD_ALL.15369 
!             DIRECT FLUX IN BAND                                                  RAD_ALL.15370 
     &   , FLUX_DIFFUSE_BAND(NPD_PROFILE, 2*NPD_LAYER+2)                           RAD_ALL.15371 
!             DIFFUSE FLUX IN BAND                                                 RAD_ALL.15372 
!                                                                                  RAD_ALL.15373 
!                       Flags for Clear-sky Fluxes                                 RAD_ALL.15374 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15375 
     &     L_CLEAR                                                                 RAD_ALL.15376 
!             CALCULATE CLEAR-SKY PROPERTIES                                       RAD_ALL.15377 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15378 
     &     I_SOLVER_CLEAR                                                          RAD_ALL.15379 
!             CLEAR SOLVER USED                                                    RAD_ALL.15380 
!                                                                                  RAD_ALL.15381 
!                       Clear-sky Fluxes Calculated                                RAD_ALL.15382 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15383 
     &     FLUX_DIRECT_CLEAR_BAND(NPD_PROFILE, 0: NPD_LAYER)                       RAD_ALL.15384 
!             CLEAR-SKY DIRECT FLUX IN BAND                                        RAD_ALL.15385 
     &   , FLUX_DIFFUSE_CLEAR_BAND(NPD_PROFILE, 2*NPD_LAYER+2)                     RAD_ALL.15386 
!             CLEAR-SKY DIFFUSE FLUX IN BAND                                       RAD_ALL.15387 
!                                                                                  RAD_ALL.15388 
!                                                                                  RAD_ALL.15389 
!                                                                                  RAD_ALL.15390 
!     LOCAL VARIABLES.                                                             RAD_ALL.15391 
      INTEGER                                                                      RAD_ALL.15392 
     &     I                                                                       RAD_ALL.15393 
!             LOOP VARIABLE                                                        RAD_ALL.15394 
     &   , J                                                                       RAD_ALL.15395 
!             LOOP VARIABLE                                                        RAD_ALL.15396 
     &   , L                                                                       RAD_ALL.15397 
!             LOOP VARIABLE                                                        RAD_ALL.15398 
      INTEGER                                                                      RAD_ALL.15399 
     &     I_GAS_BAND                                                              RAD_ALL.15400 
!             INDEX OF ACTIVE GAS                                                  RAD_ALL.15401 
     &   , IEX                                                                     RAD_ALL.15402 
!             INDEX OF ESFT TERM                                                   RAD_ALL.15403 
      REAL                                                                         RAD_ALL.15404 
     &     SOURCE_GROUND(NPD_PROFILE)                                              RAD_ALL.15405 
!             GROUND SOURCE FUNCTION                                               RAD_ALL.15406 
     &   , FLUX_INC_DIRECT(NPD_PROFILE)                                            RAD_ALL.15407 
!             INCIDENT DIRECT FLUX                                                 RAD_ALL.15408 
     &   , FLUX_INC_DOWN(NPD_PROFILE)                                              RAD_ALL.15409 
!             INCIDENT DOWNWARD FLUX                                               RAD_ALL.15410 
     &   , ESFT_WEIGHT                                                             RAD_ALL.15411 
!             ESFT WEIGHT FOR CURRENT CALCULATION                                  RAD_ALL.15412 
     &   , TAU_GAS(NPD_PROFILE, NPD_LAYER)                                         RAD_ALL.15413 
!             OPTICAL DEPTH OF GAS                                                 RAD_ALL.15414 
      REAL                                                                         RAD_ALL.15415 
     &     FLUX_DIRECT_PART(NPD_PROFILE, 0: NPD_LAYER)                             RAD_ALL.15416 
!             PARTIAL DIRECT FLUX                                                  RAD_ALL.15417 
     &   , FLUX_DIFFUSE_PART(NPD_PROFILE, 2*NPD_LAYER+2)                           RAD_ALL.15418 
!             PARTIAL DIFFUSE FLUX                                                 RAD_ALL.15419 
     &   , FLUX_GAS_DIRECT(NPD_PROFILE, 0: NPD_LAYER)                              RAD_ALL.15420 
!             DIRECT GASEOUS FLUX                                                  RAD_ALL.15421 
     &   , FLUX_GAS_DIFFUSE(NPD_PROFILE, 2*NPD_LAYER+2)                            RAD_ALL.15422 
!             DIFFUSE GASEOUS FLUX                                                 RAD_ALL.15423 
     &   , FLUX_RATIO_DIRECT(NPD_PROFILE, 0: NPD_LAYER)                            RAD_ALL.15424 
!             RATIO OF DIRECT FLUXES                                               RAD_ALL.15425 
     &   , FLUX_RATIO_DIFFUSE(NPD_PROFILE, 2*NPD_LAYER+2)                          RAD_ALL.15426 
!             RATIO OF DIFFUSE FLUXES                                              RAD_ALL.15427 
     &   , DUMMY_ARRAY(NPD_PROFILE, 2*NPD_LAYER+2)                                 RAD_ALL.15428 
!             DUMMY ARRAY FOR ARGUMENT LISTS                                       RAD_ALL.15429 
!                                                                                  RAD_ALL.15430 
!     SUBROUTINES CALLED:                                                          RAD_ALL.15431 
      EXTERNAL                                                                     RAD_ALL.15432 
     &     SOLVE_BAND_ONE_GAS, INITIALIZE_FLUX, SCALE_ABSORB                       RAD_ALL.15433 
     &   , MONOCHROMATIC_GAS_FLUX, AUGMENT_FLUX                                    RAD_ALL.15434 
!                                                                                  RAD_ALL.15435 
!                                                                                  RAD_ALL.15436 
!                                                                                  RAD_ALL.15437 
!     MODIFIED FAST EXPONENTIAL OVERLAP, SUPERPOSING ONE GAS AT A TIME             RAD_ALL.15438 
!     ON THE MAJOR GAS.                                                            RAD_ALL.15439 
!                                                                                  RAD_ALL.15440 
!     INITIAL SOLUTION FOR THE FLUXES WITH THE MAJOR GAS.                          RAD_ALL.15441 
      CALL SOLVE_BAND_ONE_GAS(IERR                                                 RAD_ALL.15442 
!                       Atmospheric Properties                                     RAD_ALL.15443 
     &   , N_PROFILE, N_LAYER, L_LAYER, I_TOP, P, T, D_MASS                        RAD_ALL.15444 
!                       Angular Integration                                        RAD_ALL.15445 
     &   , I_ANGULAR_INTEGRATION, I_2STREAM, L_2_STREAM_CORRECT                    RAD_ALL.15446 
     &   , L_RESCALE, N_ORDER_GAUSS                                                RAD_ALL.15447 
!                       Treatment of Scattering                                    RAD_ALL.15448 
     &   , I_SCATTER_METHOD_BAND                                                   RAD_ALL.15449 
!                       Options for Solver                                         RAD_ALL.15450 
     &   , I_SOLVER, L_NET, I_EXTRAPOLATE_MIX_NET, N_AUGMENT                       RAD_ALL.15451 
!                       Gaseous Properties                                         RAD_ALL.15452 
     &   , I_BAND, INDEX_ABSORB(1, I_BAND)                                         RAD_ALL.15453 
     &   , I_BAND_ESFT, I_SCALE_ESFT, I_SCALE_FNC                                  RAD_ALL.15454 
     &   , K_ESFT, W_ESFT, SCALE_VECTOR                                            RAD_ALL.15455 
     &   , P_REFERENCE, T_REFERENCE                                                RAD_ALL.15456 
     &   , GAS_MIX_RATIO, GAS_FRAC_RESCALED                                        RAD_ALL.15457 
     &   , L_DOPPLER, DOPPLER_CORRECTION                                           RAD_ALL.15458 
!                       Spectral Region                                            RAD_ALL.15459 
     &   , ISOLIR                                                                  RAD_ALL.15460 
!                       Solar Properties                                           RAD_ALL.15461 
     &   , SEC_0, SOLAR_FLUX                                                       RAD_ALL.15462 
!                       Infra-red Propeties                                        RAD_ALL.15463 
     &   , PLANCK_SOURCE_BAND(1, 0)                                                RAD_ALL.15464 
     &   , PLANCK_SOURCE_BAND(1, N_LAYER)                                          RAD_ALL.15465 
     &   , DIFF_PLANCK_BAND                                                        RAD_ALL.15466 
     &   , L_IR_SOURCE_QUAD, DIFF_PLANCK_BAND_2                                    RAD_ALL.15467 
!                       Surface Properties                                         RAD_ALL.15468 
     &   , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR, THERMAL_GROUND_BAND            RAD_ALL.15469 
!                       Clear-sky Optical Properties                               RAD_ALL.15470 
     &   , K_GREY_TOT_FREE, K_EXT_SCAT_FREE, ASYMMETRY_FREE                        RAD_ALL.15471 
     &   , FORWARD_SCATTER_FREE                                                    RAD_ALL.15472 
!                       Cloudy Properties                                          RAD_ALL.15473 
     &   , L_CLOUD, I_CLOUD                                                        RAD_ALL.15474 
!                       Cloud Geometry                                             RAD_ALL.15475 
     &   , N_CLOUD_TOP                                                             RAD_ALL.15476 
     &   , N_CLOUD_TYPE, FRAC_CLOUD                                                RAD_ALL.15477 
     &   , I_REGION_CLOUD, FRAC_REGION                                             RAD_ALL.15478 
     &   , W_FREE, N_FREE_PROFILE, I_FREE_PROFILE                                  RAD_ALL.15479 
     &   , W_CLOUD, N_CLOUD_PROFILE, I_CLOUD_PROFILE                               RAD_ALL.15480 
     &   , CLOUD_OVERLAP                                                           RAD_ALL.15481 
     &   , N_COLUMN, L_COLUMN, AREA_COLUMN                                         RAD_ALL.15482 
!                       Cloudy Optical Properties                                  RAD_ALL.15483 
     &   , K_GREY_TOT_CLOUD, K_EXT_SCAT_CLOUD                                      RAD_ALL.15484 
     &   , ASYMMETRY_CLOUD                                                         RAD_ALL.15485 
     &   , FORWARD_SCATTER_CLOUD                                                   RAD_ALL.15486 
!                       Fluxes Calculated                                          RAD_ALL.15487 
     &   , FLUX_DIRECT_BAND, FLUX_DIFFUSE_BAND                                     RAD_ALL.15488 
!                       Flags for Clear-sky Fluxes                                 RAD_ALL.15489 
     &   , L_CLEAR, I_SOLVER_CLEAR                                                 RAD_ALL.15490 
!                       Clear-sky Flues Calculated                                 RAD_ALL.15491 
     &   , FLUX_DIRECT_CLEAR_BAND, FLUX_DIFFUSE_CLEAR_BAND                         RAD_ALL.15492 
!                       Planckian Function                                         RAD_ALL.15493 
     &   , PLANCK_SOURCE_BAND                                                      RAD_ALL.15494 
!                       Dimensions of Arrays                                       RAD_ALL.15495 
     &   , NPD_PROFILE, NPD_LAYER, NPD_COLUMN                                      RAD_ALL.15496 
     &   , NPD_BAND, NPD_SPECIES                                                   RAD_ALL.15497 
     &   , NPD_ESFT_TERM, NPD_SCALE_VARIABLE, NPD_SCALE_FNC                        RAD_ALL.15498 
     &   )                                                                         RAD_ALL.15499 
      IF (IERR.NE.I_NORMAL) RETURN                                                 RAD_ALL.15500 
!                                                                                  RAD_ALL.15501 
!                                                                                  RAD_ALL.15502 
!                                                                                  RAD_ALL.15503 
!                                                                                  RAD_ALL.15504 
!     THE FLUX RATIOS ARE THE RATIOS OF THE FLUXES WITH JUST ONE GAS TO            RAD_ALL.15505 
!     THE FLUXES WITH NO EXTINCTION. THE PRODUCT OVER ALL MINOR GASES IS           RAD_ALL.15506 
!     USED TO CALCULATE THE OVERALL FLUX. THERE IS NO NEED TO USE THE              RAD_ALL.15507 
!     CLEAR RATIOS.                                                                RAD_ALL.15508 
!                                                                                  RAD_ALL.15509 
      CALL INITIALIZE_FLUX(N_PROFILE, N_LAYER, N_AUGMENT                           RAD_ALL.15510 
     &   , ISOLIR                                                                  RAD_ALL.15511 
     &   , FLUX_RATIO_DIRECT, FLUX_RATIO_DIFFUSE                                   RAD_ALL.15512 
     &   , .FALSE.                                                                 RAD_ALL.15513 
     &   , DUMMY_ARRAY, DUMMY_ARRAY                                                RAD_ALL.15514 
     &   , 1.0E+00                                                                 RAD_ALL.15515 
     &   , NPD_PROFILE, NPD_LAYER                                                  RAD_ALL.15516 
     &   , L_NET                                                                   RAD_ALL.15517 
     &   )                                                                         RAD_ALL.15518 
!                                                                                  RAD_ALL.15519 
      DO J=2, N_GAS                                                                RAD_ALL.15520 
!                                                                                  RAD_ALL.15521 
!        INITIALIZE THE FLUX IN THE BAND TO ZERO. IN THIS                          RAD_ALL.15522 
!        LOOP FLUX_GAS_... IS USED AS A TEMPORARY VARIABLE                         RAD_ALL.15523 
!        TO HOLD THE FLUXES FOR ONE GAS.                                           RAD_ALL.15524 
         CALL INITIALIZE_FLUX(N_PROFILE, N_LAYER, N_AUGMENT                        RAD_ALL.15525 
     &      , ISOLIR                                                               RAD_ALL.15526 
     &      , FLUX_GAS_DIRECT, FLUX_GAS_DIFFUSE                                    RAD_ALL.15527 
     &      , .FALSE.                                                              RAD_ALL.15528 
     &      , DUMMY_ARRAY, DUMMY_ARRAY                                             RAD_ALL.15529 
     &      , 0.0E+00                                                              RAD_ALL.15530 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.15531 
     &      , L_NET                                                                RAD_ALL.15532 
     &      )                                                                      RAD_ALL.15533 
!                                                                                  RAD_ALL.15534 
         I_GAS_BAND=INDEX_ABSORB(J, I_BAND)                                        RAD_ALL.15535 
         DO IEX=1, I_BAND_ESFT(I_BAND, I_GAS_BAND)                                 RAD_ALL.15536 
!                                                                                  RAD_ALL.15537 
!           STORE THE ESFT WEIGHT FOR FUTURE USE.                                  RAD_ALL.15538 
            ESFT_WEIGHT=W_ESFT(IEX, I_BAND,  I_GAS_BAND)                           RAD_ALL.15539 
!                                                                                  RAD_ALL.15540 
!           RESCALE THE AMOUNT OF GAS FOR THIS ABSORBER IF REQUIRED.               RAD_ALL.15541 
            IF (I_SCALE_ESFT(I_BAND, I_GAS_BAND).EQ.IP_SCALE_TERM) THEN            RAD_ALL.15542 
               CALL SCALE_ABSORB(IERR, N_PROFILE, N_LAYER                          RAD_ALL.15543 
     &            , GAS_MIX_RATIO(1, 0, I_GAS_BAND), P, T                          RAD_ALL.15544 
     &            , L_LAYER, I_TOP                                                 RAD_ALL.15545 
     &            , GAS_FRAC_RESCALED(1, 0, I_GAS_BAND)                            RAD_ALL.15546 
     &            , I_SCALE_FNC(I_BAND, I_GAS_BAND)                                RAD_ALL.15547 
     &            , P_REFERENCE(I_GAS_BAND, I_BAND)                                RAD_ALL.15548 
     &            , T_REFERENCE(I_GAS_BAND, I_BAND)                                RAD_ALL.15549 
     &            , SCALE_VECTOR(1, IEX, I_BAND, I_GAS_BAND)                       RAD_ALL.15550 
     &            , L_DOPPLER(I_GAS_BAND)                                          RAD_ALL.15551 
     &            , DOPPLER_CORRECTION(I_GAS_BAND)                                 RAD_ALL.15552 
     &            , NPD_PROFILE, NPD_LAYER, NPD_SCALE_FNC                          RAD_ALL.15553 
     &            , NPD_SCALE_VARIABLE                                             RAD_ALL.15554 
     &            )                                                                RAD_ALL.15555 
               IF (IERR.NE.I_NORMAL) RETURN                                        RAD_ALL.15556 
            ENDIF                                                                  RAD_ALL.15557 
!                                                                                  RAD_ALL.15558 
!           SET THE APPROPRIATE BOUNDARY TERMS FOR THE TWO-STREAM                  RAD_ALL.15559 
!           TOTAL UPWARD AND DOWNWARD FLUXES AT THE BOUNDARIES.                    RAD_ALL.15560 
!                                                                                  RAD_ALL.15561 
            IF (ISOLIR.EQ.IP_SOLAR) THEN                                           RAD_ALL.15562 
!              THIS TREATMENT OF THE OVERLAPS DOES NOT APPLY TO                    RAD_ALL.15563 
!              THE SOLAR REGION.                                                   RAD_ALL.15564 
               WRITE(IU_ERR, '(/A)')                                               RAD_ALL.15565 
     &            '*** ERROR: CLEAR-SKY FESFT IS NOT APPROPRIATE '                 RAD_ALL.15566 
     &            //'IN THE SOLAR REGION.'                                         RAD_ALL.15567 
               IERR=I_ERR_FATAL                                                    RAD_ALL.15568 
               RETURN                                                              RAD_ALL.15569 
            ELSE IF (ISOLIR.EQ.IP_INFRA_RED) THEN                                  RAD_ALL.15570 
!              INFRA-RED REGION.                                                   RAD_ALL.15571 
               DO L=1, N_PROFILE                                                   RAD_ALL.15572 
                  FLUX_INC_DIRECT(L)=0.0E+00                                       RAD_ALL.15573 
                  FLUX_INC_DOWN(L)=-PLANCK_SOURCE_BAND(L, 0)                       RAD_ALL.15574 
                  SOURCE_GROUND(L)=THERMAL_GROUND_BAND(L)                          RAD_ALL.15575 
     &               -(1.0E+00-ALBEDO_SURFACE_DIFF(L))                             RAD_ALL.15576 
     &               *PLANCK_SOURCE_BAND(L, N_LAYER)                               RAD_ALL.15577 
               ENDDO                                                               RAD_ALL.15578 
            ENDIF                                                                  RAD_ALL.15579 
!                                                                                  RAD_ALL.15580 
!           SET THE OPTICAL DEPTHS OF EACH LAYER.                                  RAD_ALL.15581 
            DO I=1, N_LAYER                                                        RAD_ALL.15582 
               DO L=1, N_PROFILE                                                   RAD_ALL.15583 
                  TAU_GAS(L, I)=K_ESFT(IEX, I_BAND, I_GAS_BAND)                    RAD_ALL.15584 
     &               *GAS_FRAC_RESCALED(L, I, I_GAS_BAND)                          RAD_ALL.15585 
     &               *D_MASS(L, I)                                                 RAD_ALL.15586 
               ENDDO                                                               RAD_ALL.15587 
            ENDDO                                                                  RAD_ALL.15588 
!                                                                                  RAD_ALL.15589 
!                                                                                  RAD_ALL.15590 
!           CALCULATE THE FLUXES WITH JUST THIS GAS.                               RAD_ALL.15591 
            CALL MONOCHROMATIC_GAS_FLUX(N_PROFILE, N_LAYER                         RAD_ALL.15592 
     &         , L_NET                                                             RAD_ALL.15593 
     &         , TAU_GAS                                                           RAD_ALL.15594 
     &         , ISOLIR, SEC_0, FLUX_INC_DIRECT, FLUX_INC_DOWN                     RAD_ALL.15595 
     &         , DIFF_PLANCK_BAND, SOURCE_GROUND                                   RAD_ALL.15596 
     &         , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR                           RAD_ALL.15597 
     &         , DIFFUSIVITY_FACTOR_MINOR                                          RAD_ALL.15598 
     &         , FLUX_DIRECT_PART, FLUX_DIFFUSE_PART                               RAD_ALL.15599 
     &         , NPD_PROFILE, NPD_LAYER                                            RAD_ALL.15600 
     &         )                                                                   RAD_ALL.15601 
!                                                                                  RAD_ALL.15602 
!           INCREMENT THE FLUXES WITHIN THE BAND. THERE IS NO NEED TO              RAD_ALL.15603 
!           INCREMENT THE CLEAR FLUXES HERE SINCE THE WHOLE CALCULATION            RAD_ALL.15604 
!           IS WITHOUT CLOUDS.                                                     RAD_ALL.15605 
            CALL AUGMENT_FLUX(N_PROFILE, N_LAYER, N_AUGMENT                        RAD_ALL.15606 
     &         , ISOLIR, .FALSE.                                                   RAD_ALL.15607 
     &         , ESFT_WEIGHT                                                       RAD_ALL.15608 
     &         , FLUX_GAS_DIRECT, FLUX_GAS_DIFFUSE                                 RAD_ALL.15609 
     &         , FLUX_DIRECT_PART, FLUX_DIFFUSE_PART                               RAD_ALL.15610 
     &         , DUMMY_ARRAY, DUMMY_ARRAY                                          RAD_ALL.15611 
     &         , DUMMY_ARRAY, DUMMY_ARRAY                                          RAD_ALL.15612 
     &         , NPD_PROFILE, NPD_LAYER                                            RAD_ALL.15613 
     &         )                                                                   RAD_ALL.15614 
!                                                                                  RAD_ALL.15615 
         ENDDO                                                                     RAD_ALL.15616 
!                                                                                  RAD_ALL.15617 
!        CALCULATE THE FLUX RATIO.                                                 RAD_ALL.15618 
         IF (ISOLIR.EQ.IP_INFRA_RED) THEN                                          RAD_ALL.15619 
            IF (L_NET) THEN                                                        RAD_ALL.15620 
               DO I=1, N_AUGMENT                                                   RAD_ALL.15621 
                  DO L=1, N_PROFILE                                                RAD_ALL.15622 
                     FLUX_RATIO_DIFFUSE(L, I)=FLUX_RATIO_DIFFUSE(L, I)             RAD_ALL.15623 
     &                  *FLUX_GAS_DIFFUSE(L, I)                                    RAD_ALL.15624 
     &                  /(-THERMAL_GROUND_BAND(L))                                 RAD_ALL.15625 
                  ENDDO                                                            RAD_ALL.15626 
               ENDDO                                                               RAD_ALL.15627 
            ELSE                                                                   RAD_ALL.15628 
!              THIS METHOD WILL FAIL IF USED FOR THE DIFFUSE FLUXES                RAD_ALL.15629 
!              IF THERE ARE INVERSIONS IN THE PROFILE. AT THE GROUND               RAD_ALL.15630 
!              THE UPWARD DIFFUSE FLUX WILL BE 0, EVEN WITHOUT                     RAD_ALL.15631 
!              AN INVERSION, SO TOL_DIV IS USED TO RESTORE CONDITIONING.           RAD_ALL.15632 
               DO I=0, N_LAYER                                                     RAD_ALL.15633 
                  DO L=1, N_PROFILE                                                RAD_ALL.15634 
                     FLUX_RATIO_DIFFUSE(L, 2*I+1)                                  RAD_ALL.15635 
     &                  =FLUX_RATIO_DIFFUSE(L, 2*I+1)                              RAD_ALL.15636 
     &                  *FLUX_GAS_DIFFUSE(L, 2*I+1)                                RAD_ALL.15637 
     &                  /(THERMAL_GROUND_BAND(L)*(1.0E+00+TOL_DIV)                 RAD_ALL.15638 
     &                  -PLANCK_SOURCE_BAND(L, I))                                 RAD_ALL.15639 
                     FLUX_RATIO_DIFFUSE(L, 2*I+2)                                  RAD_ALL.15640 
     &                  =FLUX_RATIO_DIFFUSE(L, 2*I+2)                              RAD_ALL.15641 
     &                  *FLUX_GAS_DIFFUSE(L, 2*I+2)                                RAD_ALL.15642 
     &                  /(-PLANCK_SOURCE_BAND(L, I))                               RAD_ALL.15643 
                  ENDDO                                                            RAD_ALL.15644 
               ENDDO                                                               RAD_ALL.15645 
            ENDIF                                                                  RAD_ALL.15646 
         ENDIF                                                                     RAD_ALL.15647 
!                                                                                  RAD_ALL.15648 
      ENDDO                                                                        RAD_ALL.15649 
!                                                                                  RAD_ALL.15650 
!     LIMIT THE RATIO OF DIFFUSE FLUXES.                                           RAD_ALL.15651 
      DO I=1, N_AUGMENT                                                            RAD_ALL.15652 
         DO L=1, N_PROFILE                                                         RAD_ALL.15653 
            FLUX_RATIO_DIFFUSE(L, I)=MAX(0.0E+00                                   RAD_ALL.15654 
     &         , FLUX_RATIO_DIFFUSE(L, I))                                         RAD_ALL.15655 
            FLUX_RATIO_DIFFUSE(L, I)=MIN(1.0E+00                                   RAD_ALL.15656 
     &         , FLUX_RATIO_DIFFUSE(L, I))                                         RAD_ALL.15657 
         ENDDO                                                                     RAD_ALL.15658 
      ENDDO                                                                        RAD_ALL.15659 
!                                                                                  RAD_ALL.15660 
!     THE OVERALL FLUX IN THE BAND IS CALCULATED FROM THE                          RAD_ALL.15661 
!     FLUX FOR THE MAJOR GAS AND THE FLUX RATIOS. THE SAME RATIOS CAN BE           RAD_ALL.15662 
!     USED FOR THE CLEAR FLUXES IN THIS CASE.                                      RAD_ALL.15663 
      DO I=1, N_AUGMENT                                                            RAD_ALL.15664 
         DO L=1, N_PROFILE                                                         RAD_ALL.15665 
            FLUX_DIFFUSE_BAND(L, I)=FLUX_RATIO_DIFFUSE(L, I)                       RAD_ALL.15666 
     &         *FLUX_DIFFUSE_BAND(L, I)                                            RAD_ALL.15667 
         ENDDO                                                                     RAD_ALL.15668 
      ENDDO                                                                        RAD_ALL.15669 
      IF (L_CLEAR) THEN                                                            RAD_ALL.15670 
         DO I=1, N_AUGMENT                                                         RAD_ALL.15671 
            DO L=1, N_PROFILE                                                      RAD_ALL.15672 
               FLUX_DIFFUSE_CLEAR_BAND(L, I)                                       RAD_ALL.15673 
     &            =FLUX_RATIO_DIFFUSE(L, I)                                        RAD_ALL.15674 
     &            *FLUX_DIFFUSE_CLEAR_BAND(L, I)                                   RAD_ALL.15675 
            ENDDO                                                                  RAD_ALL.15676 
         ENDDO                                                                     RAD_ALL.15677 
      ENDIF                                                                        RAD_ALL.15678 
!                                                                                  RAD_ALL.15679 
!                                                                                  RAD_ALL.15680 
!                                                                                  RAD_ALL.15681 
      RETURN                                                                       RAD_ALL.15682 
      END    
