C (c) CROWN COPYRIGHT 1995, METEOROLOGICAL OFFICE, All Rights Reserved.            RAD_ALL.15688 
C                                                                                  RAD_ALL.15689 
C Use, duplication or disclosure of this code is subject to the                    RAD_ALL.15690 
C restrictions as set forth in the contract.                                       RAD_ALL.15691 
C                                                                                  RAD_ALL.15692 
C                Meteorological Office                                             RAD_ALL.15693 
C                London Road                                                       RAD_ALL.15694 
C                BRACKNELL                                                         RAD_ALL.15695 
C                Berkshire UK                                                      RAD_ALL.15696 
C                RG12 2SZ                                                          RAD_ALL.15697 
C                                                                                  RAD_ALL.15698 
C If no contract has been raised with this copy of the code, the use,              RAD_ALL.15699 
C duplication or disclosure of it is strictly prohibited.  Permission              RAD_ALL.15700 
C to do so must first be obtained in writing from the Head of Numerical            RAD_ALL.15701 
C Modelling at the above address.                                                  RAD_ALL.15702 
C ******************************COPYRIGHT******************************            RAD_ALL.15703 
C                                                                                  RAD_ALL.15704 
!+ Subroutine to calculate the fluxes within the band using FESFT.                 RAD_ALL.15705 
!                                                                                  RAD_ALL.15706 
! Method:                                                                          RAD_ALL.15707 
!       The fluxes in the band including the grey processes are                    RAD_ALL.15708 
!       calculated. Effective transmissions are found for each of the              RAD_ALL.15709 
!       gases by calculating the flux including the gas dividing                   RAD_ALL.15710 
!       these by the grey fluxes. These effective transmissions                    RAD_ALL.15711 
!       are then used to scale the grey fluxes. This is as described               RAD_ALL.15712 
!       by Geleyn and Ritter (1992).                                               RAD_ALL.15713 
!                                                                                  RAD_ALL.15714 
! Current Owner of Code: J. M. Edwards                                             RAD_ALL.15715 
!                                                                                  RAD_ALL.15716 
! History:                                                                         RAD_ALL.15717 
!       Version         Date                    Comment                            RAD_ALL.15718 
!       4.0             27-07-95                Original Code                      RAD_ALL.15719 
!                                               (J. M. Edwards)                    RAD_ALL.15720 
!       4.1             10-06-96                Initialization of                  RAD_ALL.15721 
!                                               partial fluxes.                    RAD_ALL.15722 
!                                               (J. M. Edwards)                    RAD_ALL.15723 
!       4.2             08-08-96                Code for vertically                RAD_ALL.15724 
!                                               coherent convective                RAD_ALL.15725 
!                                               cloud added.                       RAD_ALL.15726 
!                                               (J. M. Edwards)                    RAD_ALL.15727 
!                                                                                  RAD_ALL.15728 
! Description of Code:                                                             RAD_ALL.15729 
!   FORTRAN 77  with extensions listed in documentation.                           RAD_ALL.15730 
!                                                                                  RAD_ALL.15731 
!- ---------------------------------------------------------------------           RAD_ALL.15732 
      SUBROUTINE SOLVE_BAND_FESFT(IERR                                             RAD_ALL.15733 
!                       Atmospheric Column                                         RAD_ALL.15734 
     &   , N_PROFILE, N_LAYER, L_LAYER, I_TOP, P, T, D_MASS                        RAD_ALL.15735 
!                       Angular Integration                                        RAD_ALL.15736 
     &   , I_ANGULAR_INTEGRATION, I_2STREAM, L_2_STREAM_CORRECT                    RAD_ALL.15737 
     &   , L_RESCALE, N_ORDER_GAUSS                                                RAD_ALL.15738 
!                       Treatment of Scattering                                    RAD_ALL.15739 
     &   , I_SCATTER_METHOD_BAND                                                   RAD_ALL.15740 
!                       Options for Solver                                         RAD_ALL.15741 
     &   , I_SOLVER, L_NET, I_EXTRAPOLATE_MIX_NET, N_AUGMENT                       RAD_ALL.15742 
!                       Gaseous Propeties                                          RAD_ALL.15743 
     &   , I_BAND, N_GAS                                                           RAD_ALL.15744 
     &   , INDEX_ABSORB, I_BAND_ESFT, I_SCALE_ESFT, I_SCALE_FNC                    RAD_ALL.15745 
     &   , K_ESFT, W_ESFT, SCALE_VECTOR                                            RAD_ALL.15746 
     &   , P_REFERENCE, T_REFERENCE                                                RAD_ALL.15747 
     &   , GAS_MIX_RATIO, GAS_FRAC_RESCALED                                        RAD_ALL.15748 
     &   , L_DOPPLER, DOPPLER_CORRECTION                                           RAD_ALL.15749 
!                       Spectral Region                                            RAD_ALL.15750 
     &   , ISOLIR                                                                  RAD_ALL.15751 
!                       Solar Properties                                           RAD_ALL.15752 
     &   , SEC_0, SOLAR_FLUX                                                       RAD_ALL.15753 
!                       Infra-red Properties                                       RAD_ALL.15754 
     &   , PLANCK_SOURCE_TOP, PLANCK_SOURCE_BOTTOM                                 RAD_ALL.15755 
     &   , DIFF_PLANCK_BAND                                                        RAD_ALL.15756 
     &   , L_IR_SOURCE_QUAD, DIFF_PLANCK_BAND_2                                    RAD_ALL.15757 
!                       Surface Properties                                         RAD_ALL.15758 
     &   , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR                                 RAD_ALL.15759 
     &   , THERMAL_GROUND_BAND                                                     RAD_ALL.15760 
!                       Clear-sky Optical Properties                               RAD_ALL.15761 
     &   , K_GREY_TOT_FREE, K_EXT_SCAT_FREE, ASYMMETRY_FREE                        RAD_ALL.15762 
     &   , FORWARD_SCATTER_FREE                                                    RAD_ALL.15763 
!                       Cloudy Properties                                          RAD_ALL.15764 
     &   , L_CLOUD, I_CLOUD                                                        RAD_ALL.15765 
!                       Cloud Geometry                                             RAD_ALL.15766 
     &   , N_CLOUD_TOP                                                             RAD_ALL.15767 
     &   , N_CLOUD_TYPE, FRAC_CLOUD                                                RAD_ALL.15768 
     &   , I_REGION_CLOUD, FRAC_REGION                                             RAD_ALL.15769 
     &   , W_FREE, N_FREE_PROFILE, I_FREE_PROFILE                                  RAD_ALL.15770 
     &   , W_CLOUD, N_CLOUD_PROFILE, I_CLOUD_PROFILE                               RAD_ALL.15771 
     &   , CLOUD_OVERLAP                                                           RAD_ALL.15772 
     &   , N_COLUMN, L_COLUMN, AREA_COLUMN                                         RAD_ALL.15773 
!                       Cloudy Optical Properties                                  RAD_ALL.15774 
     &   , K_GREY_TOT_CLOUD, K_EXT_SCAT_CLOUD                                      RAD_ALL.15775 
     &   , ASYMMETRY_CLOUD, FORWARD_SCATTER_CLOUD                                  RAD_ALL.15776 
!                       Fluxes Calculated                                          RAD_ALL.15777 
     &   , FLUX_DIRECT_BAND, FLUX_DIFFUSE_BAND                                     RAD_ALL.15778 
!                       Flags for Clear-sky Fluxes                                 RAD_ALL.15779 
     &   , L_CLEAR, I_SOLVER_CLEAR                                                 RAD_ALL.15780 
!                       Clear-sky Fluxes                                           RAD_ALL.15781 
     &   , FLUX_DIRECT_CLEAR_BAND, FLUX_DIFFUSE_CLEAR_BAND                         RAD_ALL.15782 
!                       Planckian Function                                         RAD_ALL.15783 
     &   , PLANCK_SOURCE_BAND                                                      RAD_ALL.15784 
!                       Dimensions of Arrays                                       RAD_ALL.15785 
     &   , NPD_PROFILE, NPD_LAYER, NPD_COLUMN                                      RAD_ALL.15786 
     &   , NPD_BAND, NPD_SPECIES                                                   RAD_ALL.15787 
     &   , NPD_ESFT_TERM, NPD_SCALE_VARIABLE, NPD_SCALE_FNC                        RAD_ALL.15788 
     &   )                                                                         RAD_ALL.15789 
!                                                                                  RAD_ALL.15790 
!                                                                                  RAD_ALL.15791 
!                                                                                  RAD_ALL.15792 
      IMPLICIT NONE                                                                RAD_ALL.15793 
!                                                                                  RAD_ALL.15794 
!                                                                                  RAD_ALL.15795 
!     SIZES OF DUMMY ARRAYS.                                                       RAD_ALL.15796 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15797 
     &     NPD_PROFILE                                                             RAD_ALL.15798 
!             MAXIMUM NUMBER OF PROFILES                                           RAD_ALL.15799 
     &   , NPD_LAYER                                                               RAD_ALL.15800 
!             MAXIMUM NUMBER OF LAYERS                                             RAD_ALL.15801 
     &   , NPD_BAND                                                                RAD_ALL.15802 
!             MAXIMUM NUMBER OF SPECTRAL BANDS                                     RAD_ALL.15803 
     &   , NPD_SPECIES                                                             RAD_ALL.15804 
!             MAXIMUM NUMBER OF SPECIES                                            RAD_ALL.15805 
     &   , NPD_ESFT_TERM                                                           RAD_ALL.15806 
!             MAXIMUM NUMBER OF ESFT TERMS                                         RAD_ALL.15807 
     &   , NPD_SCALE_VARIABLE                                                      RAD_ALL.15808 
!             MAXIMUM NUMBER OF SCALE VARIABLES                                    RAD_ALL.15809 
     &   , NPD_SCALE_FNC                                                           RAD_ALL.15810 
!             MAXIMUM NUMBER OF SCALING FUNCTIONS                                  RAD_ALL.15811 
     &   , NPD_COLUMN                                                              RAD_ALL.15812 
!             NUMBER OF COLUMNS PER POINT                                          RAD_ALL.15813 
!                                                                                  RAD_ALL.15814 
!     INCLUDE COMDECKS.                                                            RAD_ALL.15815 
!     ------------------------------------------------------------------           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    
!     ------------------------------------------------------------------           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    
!     ------------------------------------------------------------------           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.15820 
!                                                                                  RAD_ALL.15821 
!                                                                                  RAD_ALL.15822 
!     DUMMY ARGUMENTS.                                                             RAD_ALL.15823 
      INTEGER   !, INTENT(OUT)                                                     RAD_ALL.15824 
     &     IERR                                                                    RAD_ALL.15825 
!             ERROR FLAG                                                           RAD_ALL.15826 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15827 
     &     N_PROFILE                                                               RAD_ALL.15828 
!             NUMBER OF PROFILES                                                   RAD_ALL.15829 
     &   , N_LAYER                                                                 RAD_ALL.15830 
!             NUMBER OF LAYERS                                                     RAD_ALL.15831 
     &   , I_TOP                                                                   RAD_ALL.15832 
!             TOP OF VERTICAL GRID                                                 RAD_ALL.15833 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15834 
     &     L_LAYER                                                                 RAD_ALL.15835 
!             PROPERTIES GIVEN IN LAYERS                                           RAD_ALL.15836 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15837 
     &     D_MASS(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.15838 
!             MASS THICKNESS OF EACH LAYER                                         RAD_ALL.15839 
     &   , P(NPD_PROFILE, 0: NPD_LAYER)                                            RAD_ALL.15840 
!             PRESSURE                                                             RAD_ALL.15841 
     &   , T(NPD_PROFILE, 0: NPD_LAYER)                                            RAD_ALL.15842 
!             TEMPERATURE                                                          RAD_ALL.15843 
!                                                                                  RAD_ALL.15844 
!                       Angular Integration                                        RAD_ALL.15845 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15846 
     &     I_ANGULAR_INTEGRATION                                                   RAD_ALL.15847 
!             ANGULAR INTEGRATION SCHEME                                           RAD_ALL.15848 
     &   , I_2STREAM                                                               RAD_ALL.15849 
!             TWO-STREAM SCHEME                                                    RAD_ALL.15850 
     &   , N_ORDER_GAUSS                                                           RAD_ALL.15851 
!             ORDER OF GAUSSIAN INTEGRATION                                        RAD_ALL.15852 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15853 
     &     L_2_STREAM_CORRECT                                                      RAD_ALL.15854 
!             USE AN EDGE CORRECTION                                               RAD_ALL.15855 
     &   , L_RESCALE                                                               RAD_ALL.15856 
!             RESCALE OPTICAL PROPERTIES                                           RAD_ALL.15857 
!                                                                                  RAD_ALL.15858 
!                       Treatment of Scattering                                    RAD_ALL.15859 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15860 
     &     I_SCATTER_METHOD_BAND                                                   RAD_ALL.15861 
!             METHOD OF TREATING SCATTERING                                        RAD_ALL.15862 
!                                                                                  RAD_ALL.15863 
!                       Options for solver                                         RAD_ALL.15864 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15865 
     &     I_SOLVER                                                                RAD_ALL.15866 
!             SOLVER USED                                                          RAD_ALL.15867 
     &   , I_EXTRAPOLATE_MIX_NET                                                   RAD_ALL.15868 
!             METHOD FOR EXTRAPOLATING WITH A MIXED SOLVER                         RAD_ALL.15869 
     &   , N_AUGMENT                                                               RAD_ALL.15870 
!             LENGTH OF LONG FLUX VECTOR                                           RAD_ALL.15871 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15872 
     &     L_NET                                                                   RAD_ALL.15873 
!             CALCULATE NET FLUXES                                                 RAD_ALL.15874 
!                                                                                  RAD_ALL.15875 
!                       Gaseous Properties                                         RAD_ALL.15876 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15877 
     &     I_BAND                                                                  RAD_ALL.15878 
!             BAND BEING CONSIDERED                                                RAD_ALL.15879 
     &   , N_GAS                                                                   RAD_ALL.15880 
!             NUMBER OF GASES IN BAND                                              RAD_ALL.15881 
     &   , INDEX_ABSORB(NPD_SPECIES, NPD_BAND)                                     RAD_ALL.15882 
!             LIST OF ABSORBERS IN BANDS                                           RAD_ALL.15883 
     &   , I_BAND_ESFT(NPD_BAND, NPD_SPECIES)                                      RAD_ALL.15884 
!             NUMBER OF TERMS IN BAND                                              RAD_ALL.15885 
     &   , I_SCALE_ESFT(NPD_BAND, NPD_SPECIES)                                     RAD_ALL.15886 
!             TYPE OF ESFT SCALING                                                 RAD_ALL.15887 
     &   , I_SCALE_FNC(NPD_BAND, NPD_SPECIES)                                      RAD_ALL.15888 
!             TYPE OF SCALING FUNCTION                                             RAD_ALL.15889 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15890 
     &     L_DOPPLER(NPD_SPECIES)                                                  RAD_ALL.15891 
!             DOPPLER BROADENING INCLUDED                                          RAD_ALL.15892 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15893 
     &     K_ESFT(NPD_ESFT_TERM, NPD_BAND, NPD_SPECIES)                            RAD_ALL.15894 
!             EXPONENTIAL ESFT TERMS                                               RAD_ALL.15895 
     &   , W_ESFT(NPD_ESFT_TERM, NPD_BAND, NPD_SPECIES)                            RAD_ALL.15896 
!             WEIGHTS FOR ESFT                                                     RAD_ALL.15897 
     &   , SCALE_VECTOR(NPD_SCALE_VARIABLE, NPD_ESFT_TERM, NPD_BAND                RAD_ALL.15898 
     &        , NPD_SPECIES)                                                       RAD_ALL.15899 
!             ABSORBER SCALING PARAMETERS                                          RAD_ALL.15900 
     &   , P_REFERENCE(NPD_SPECIES, NPD_BAND)                                      RAD_ALL.15901 
!             REFERENCE SCALING PRESSURE                                           RAD_ALL.15902 
     &   , T_REFERENCE(NPD_SPECIES, NPD_BAND)                                      RAD_ALL.15903 
!             REFERENCE SCALING TEMPERATURE                                        RAD_ALL.15904 
     &   , GAS_MIX_RATIO(NPD_PROFILE, 0: NPD_LAYER, NPD_SPECIES)                   RAD_ALL.15905 
!             GAS MASS MIXING RATIOS                                               RAD_ALL.15906 
     &   , GAS_FRAC_RESCALED(NPD_PROFILE, 0: NPD_LAYER, NPD_SPECIES)               RAD_ALL.15907 
!             RESCALED GAS MASS FRACTIONS                                          RAD_ALL.15908 
     &   , DOPPLER_CORRECTION(NPD_SPECIES)                                         RAD_ALL.15909 
!             DOPPLER BROADENING TERMS                                             RAD_ALL.15910 
!                                                                                  RAD_ALL.15911 
!                       Spectral Region                                            RAD_ALL.15912 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15913 
     &     ISOLIR                                                                  RAD_ALL.15914 
!             VISIBLE OR IR                                                        RAD_ALL.15915 
!                                                                                  RAD_ALL.15916 
!                       Solar Properties                                           RAD_ALL.15917 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15918 
     &     SEC_0(NPD_PROFILE)                                                      RAD_ALL.15919 
!             SECANT OF SOLAR ZENITH ANGLE                                         RAD_ALL.15920 
     &   , SOLAR_FLUX(NPD_PROFILE)                                                 RAD_ALL.15921 
!             INCIDENT SOLAR FLUX IN BAND                                          RAD_ALL.15922 
!                                                                                  RAD_ALL.15923 
!                       Infra-red Properties                                       RAD_ALL.15924 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15925 
     &     L_IR_SOURCE_QUAD                                                        RAD_ALL.15926 
!             USE A QUADRATIC SOURCE FUNCTION                                      RAD_ALL.15927 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15928 
     &     PLANCK_SOURCE_TOP(NPD_PROFILE)                                          RAD_ALL.15929 
!             PLANCKIAN SOURCE AT TOP                                              RAD_ALL.15930 
     &   , PLANCK_SOURCE_BOTTOM(NPD_PROFILE)                                       RAD_ALL.15931 
!             PLANCKIAN SOURCE AT BOTTOM                                           RAD_ALL.15932 
     &   , DIFF_PLANCK_BAND(NPD_PROFILE, NPD_LAYER)                                RAD_ALL.15933 
!             THERMAL SOURCE FUNCTION                                              RAD_ALL.15934 
     &   , DIFF_PLANCK_BAND_2(NPD_PROFILE, NPD_LAYER)                              RAD_ALL.15935 
!             2x2ND DIFFERENCE OF PLANCKIAN IN BAND                                RAD_ALL.15936 
!                                                                                  RAD_ALL.15937 
!                       Surface Properties                                         RAD_ALL.15938 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15939 
     &     ALBEDO_SURFACE_DIFF(NPD_PROFILE)                                        RAD_ALL.15940 
!             DIFFUSE SURFACE ALBEDO                                               RAD_ALL.15941 
     &   , ALBEDO_SURFACE_DIR(NPD_PROFILE)                                         RAD_ALL.15942 
!             DIRECT SURFACE ALBEDO                                                RAD_ALL.15943 
     &   , THERMAL_GROUND_BAND(NPD_PROFILE)                                        RAD_ALL.15944 
!             THERMAL SOURCE FUNCTION AT GROUND                                    RAD_ALL.15945 
!                                                                                  RAD_ALL.15946 
!                       Clear-sky Optical Properties                               RAD_ALL.15947 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15948 
     &     K_GREY_TOT_FREE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.15949 
!             FREE ABSORPTIVE EXTINCTION                                           RAD_ALL.15950 
     &   , K_EXT_SCAT_FREE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.15951 
!             FREE SCATTERING EXTINCTION                                           RAD_ALL.15952 
     &   , ASYMMETRY_FREE(NPD_PROFILE, NPD_LAYER)                                  RAD_ALL.15953 
!             CLEAR-SKY ASYMMETRY                                                  RAD_ALL.15954 
     &   , FORWARD_SCATTER_FREE(NPD_PROFILE, NPD_LAYER)                            RAD_ALL.15955 
!             FREE FORWARD SCATTERING                                              RAD_ALL.15956 
!                                                                                  RAD_ALL.15957 
!                       Cloudy Properties                                          RAD_ALL.15958 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15959 
     &     L_CLOUD                                                                 RAD_ALL.15960 
!             CLOUDS REQUIRED                                                      RAD_ALL.15961 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15962 
     &     I_CLOUD                                                                 RAD_ALL.15963 
!             CLOUD SCHEME USED                                                    RAD_ALL.15964 
!                                                                                  RAD_ALL.15965 
!                       Cloud Geometry                                             RAD_ALL.15966 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.15967 
     &     N_CLOUD_TOP                                                             RAD_ALL.15968 
!             TOP CLOUDY LAYER                                                     RAD_ALL.15969 
     &   , N_CLOUD_TYPE                                                            RAD_ALL.15970 
!             NUMBER OF TYPES OF CLOUDS                                            RAD_ALL.15971 
     &   , N_FREE_PROFILE(NPD_LAYER)                                               RAD_ALL.15972 
!             NUMBER OF FREE PROFILES                                              RAD_ALL.15973 
     &   , I_FREE_PROFILE(NPD_PROFILE, NPD_LAYER)                                  RAD_ALL.15974 
!             INDICES OF FREE PROFILES                                             RAD_ALL.15975 
     &   , N_CLOUD_PROFILE(NPD_LAYER)                                              RAD_ALL.15976 
!             NUMBER OF CLOUDY PROFILES                                            RAD_ALL.15977 
     &   , I_CLOUD_PROFILE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.15978 
!             INDICES OF CLOUDY PROFILES                                           RAD_ALL.15979 
     &   , N_COLUMN(NPD_PROFILE)                                                   RAD_ALL.15980 
!             NUMBER OF COLUMNS REQUIRED                                           RAD_ALL.15981 
     &   , I_REGION_CLOUD(NPD_CLOUD_TYPE)                                          RAD_ALL.15982 
!             REGIONS IN WHICH TYPES OF CLOUDS FALL                                RAD_ALL.15983 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.15984 
     &     L_COLUMN(NPD_PROFILE, NPD_LAYER, NPD_COLUMN)                            RAD_ALL.15985 
!             COLUMN FLAGS FOR COLUMNS                                             RAD_ALL.15986 
      REAL  !, INTENT(IN)                                                          RAD_ALL.15987 
     &     W_CLOUD(NPD_PROFILE, NPD_LAYER)                                         RAD_ALL.15988 
!             CLOUDY FRACTION                                                      RAD_ALL.15989 
     &   , FRAC_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                      RAD_ALL.15990 
!             FRACTIONS OF TYPES OF CLOUD                                          RAD_ALL.15991 
     &   , W_FREE(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.15992 
!             CLEAR-SKY FRACTION                                                   RAD_ALL.15993 
     &   , CLOUD_OVERLAP(NPD_PROFILE, 0: NPD_LAYER, NPD_OVERLAP_COEFF)             RAD_ALL.15994 
!             COEFFICIENTS FOR TRANSFER FOR ENERGY AT INTERFACES                   RAD_ALL.15995 
     &   , AREA_COLUMN(NPD_PROFILE, NPD_COLUMN)                                    RAD_ALL.15996 
!             AREAS OF COLUMNS                                                     RAD_ALL.15997 
     &   , FRAC_REGION(NPD_PROFILE, NPD_LAYER, NPD_REGION)                         RAD_ALL.15998 
!             FRACTIONS OF TOTAL CLOUD OCCUPIED BY EACH REGION                     RAD_ALL.15999 
!                                                                                  RAD_ALL.16000 
!                       Cloudy Optical Propeties                                   RAD_ALL.16001 
      REAL  !, INTENT(IN)                                                          RAD_ALL.16002 
     &     K_GREY_TOT_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                RAD_ALL.16003 
!             CLOUDY ABSORPTIVE EXTINCTION                                         RAD_ALL.16004 
     &   , K_EXT_SCAT_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                RAD_ALL.16005 
!             CLOUDY SCATTERING EXTINCTION                                         RAD_ALL.16006 
     &   , ASYMMETRY_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                 RAD_ALL.16007 
!             CLOUDY ASYMMETRY                                                     RAD_ALL.16008 
     &   , FORWARD_SCATTER_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)           RAD_ALL.16009 
!             CLOUDY FORWARD SCATTERING                                            RAD_ALL.16010 
!                                                                                  RAD_ALL.16011 
!                       Fluxes Calculated                                          RAD_ALL.16012 
      REAL  !, INTENT(OUT)                                                         RAD_ALL.16013 
     &     FLUX_DIRECT_BAND(NPD_PROFILE, 0: NPD_LAYER)                             RAD_ALL.16014 
!             DIRECT FLUX IN BAND                                                  RAD_ALL.16015 
     &   , FLUX_DIFFUSE_BAND(NPD_PROFILE, 2*NPD_LAYER+2)                           RAD_ALL.16016 
!             DIFFUSE FLUX IN BAND                                                 RAD_ALL.16017 
!                                                                                  RAD_ALL.16018 
!                       Flags for Clear-sky Calculations                           RAD_ALL.16019 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.16020 
     &     L_CLEAR                                                                 RAD_ALL.16021 
!             CALCULATE CLEAR-SKY FLUXES                                           RAD_ALL.16022 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.16023 
     &     I_SOLVER_CLEAR                                                          RAD_ALL.16024 
!             CLEAR SOLVER USED                                                    RAD_ALL.16025 
!                                                                                  RAD_ALL.16026 
!                       Clear-sky Fluxes Calculated                                RAD_ALL.16027 
      REAL  !, INTENT(OUT)                                                         RAD_ALL.16028 
     &     FLUX_DIRECT_CLEAR_BAND(NPD_PROFILE, 0: NPD_LAYER)                       RAD_ALL.16029 
!             CLEAR-SKY DIRECT FLUX IN BAND                                        RAD_ALL.16030 
     &   , FLUX_DIFFUSE_CLEAR_BAND(NPD_PROFILE, 2*NPD_LAYER+2)                     RAD_ALL.16031 
!             CLEAR-SKY DIFFUSE FLUX IN BAND                                       RAD_ALL.16032 
!                                                                                  RAD_ALL.16033 
!                       Planckian Source Function                                  RAD_ALL.16034 
      REAL  !, INTENT(IN)                                                          RAD_ALL.16035 
     &     PLANCK_SOURCE_BAND(NPD_PROFILE, 0: NPD_LAYER)                           RAD_ALL.16036 
!             PLANCKIAN SOURCE IN BAND                                             RAD_ALL.16037 
!                                                                                  RAD_ALL.16038 
!                                                                                  RAD_ALL.16039 
!                                                                                  RAD_ALL.16040 
!     LOCAL VARIABLES.                                                             RAD_ALL.16041 
      INTEGER                                                                      RAD_ALL.16042 
     &     I                                                                       RAD_ALL.16043 
!             LOOP VARIABLE                                                        RAD_ALL.16044 
     &   , J                                                                       RAD_ALL.16045 
!             LOOP VARIABLE                                                        RAD_ALL.16046 
     &   , L                                                                       RAD_ALL.16047 
!             LOOP VARIABLE                                                        RAD_ALL.16048 
      INTEGER                                                                      RAD_ALL.16049 
     &     I_GAS_BAND                                                              RAD_ALL.16050 
!             INDEX OF ACTIVE GAS                                                  RAD_ALL.16051 
     &   , I_GAS_POINTER(NPD_SPECIES)                                              RAD_ALL.16052 
!             POINTER ARRAY FOR MONOCHROMATIC ESFTs                                RAD_ALL.16053 
     &   , IEX                                                                     RAD_ALL.16054 
!             INDEX OF ESFT TERM                                                   RAD_ALL.16055 
      REAL                                                                         RAD_ALL.16056 
     &     K_ESFT_MONO(NPD_SPECIES)                                                RAD_ALL.16057 
!             ESFT MONOCHROMATIC EXPONENTS                                         RAD_ALL.16058 
     &   , K_GAS_ABS(NPD_PROFILE, NPD_LAYER)                                       RAD_ALL.16059 
!             GASEOUS ABSORPTION                                                   RAD_ALL.16060 
     &   , SOURCE_GROUND(NPD_PROFILE)                                              RAD_ALL.16061 
!             GROUND SOURCE FUNCTION                                               RAD_ALL.16062 
     &   , FLUX_INC_DIRECT(NPD_PROFILE)                                            RAD_ALL.16063 
!             INCIDENT DIRECT FLUX                                                 RAD_ALL.16064 
     &   , FLUX_INC_DOWN(NPD_PROFILE)                                              RAD_ALL.16065 
!             INCIDENT DOWNWARD FLUX                                               RAD_ALL.16066 
     &   , ESFT_WEIGHT                                                             RAD_ALL.16067 
!             ESFT WEIGHT FOR CURRENT CALCULATION                                  RAD_ALL.16068 
     &   , DUMMY_KE(NPD_PROFILE, NPD_LAYER)                                        RAD_ALL.16069 
!             DUMMY ARRAY (NOT USED)                                               RAD_ALL.16070 
      REAL                                                                         RAD_ALL.16071 
     &     FLUX_DIRECT_PART(NPD_PROFILE, 0: NPD_LAYER)                             RAD_ALL.16072 
!             PARTIAL DIRECT FLUX                                                  RAD_ALL.16073 
     &   , FLUX_DIFFUSE_PART(NPD_PROFILE, 2*NPD_LAYER+2)                           RAD_ALL.16074 
!             PARTIAL DIFFUSE FLUX                                                 RAD_ALL.16075 
     &   , FLUX_DIRECT_CLEAR_PART(NPD_PROFILE, 0: NPD_LAYER)                       RAD_ALL.16076 
!             PARTIAL CLEAR-SKY DIRECT FLUX                                        RAD_ALL.16077 
     &   , FLUX_DIFFUSE_CLEAR_PART(NPD_PROFILE, 2*NPD_LAYER+2)                     RAD_ALL.16078 
!             PARTIAL CLEAR-SKY DIFFUSE FLUX                                       RAD_ALL.16079 
     &   , FLUX_DIRECT_GREY(NPD_PROFILE, 0: NPD_LAYER)                             RAD_ALL.16080 
!             GREY DIRECT FLUX                                                     RAD_ALL.16081 
     &   , FLUX_DIFFUSE_GREY(NPD_PROFILE, 2*NPD_LAYER+2)                           RAD_ALL.16082 
!             GREY DIFFUSE FLUX                                                    RAD_ALL.16083 
     &   , FLUX_DIRECT_CLEAR_GREY(NPD_PROFILE, 0: NPD_LAYER)                       RAD_ALL.16084 
!             GREY CLEAR-SKY DIRECT FLUX                                           RAD_ALL.16085 
     &   , FLUX_DIFFUSE_CLEAR_GREY(NPD_PROFILE, 2*NPD_LAYER+2)                     RAD_ALL.16086 
!             GREY CLEAR-SKY DIFFUSE FLUX                                          RAD_ALL.16087 
     &   , FLUX_RATIO_DIRECT(NPD_PROFILE, 0: NPD_LAYER)                            RAD_ALL.16088 
!             RATIO OF DIRECT FLUXES                                               RAD_ALL.16089 
     &   , FLUX_RATIO_DIFFUSE(NPD_PROFILE, 2*NPD_LAYER+2)                          RAD_ALL.16090 
!             RATIO OF DIFFUSE FLUXES                                              RAD_ALL.16091 
     &   , FLUX_RATIO_DIRECT_CLEAR(NPD_PROFILE, 0: NPD_LAYER)                      RAD_ALL.16092 
!             RATIO OF CLEAR-SKY DIRECT FLUXES                                     RAD_ALL.16093 
     &   , FLUX_RATIO_DIFFUSE_CLEAR(NPD_PROFILE, 2*NPD_LAYER+2)                    RAD_ALL.16094 
!             RATIO OF CLEAR-SKY DIFFUSE FLUXES                                    RAD_ALL.16095 
!                                                                                  RAD_ALL.16096 
!     SUBROUTINES CALLED:                                                          RAD_ALL.16097 
      EXTERNAL                                                                     RAD_ALL.16098 
     &     INITIALIZE_FLUX, SCALE_ABSORB, GAS_OPTICAL_PROPERTIES                   RAD_ALL.16099 
     &   , MONOCHROMATIC_FLUX, AUGMENT_FLUX                                        RAD_ALL.16100 
!                                                                                  RAD_ALL.16101 
!                                                                                  RAD_ALL.16102 
!                                                                                  RAD_ALL.16103 
!     FAST EXPONENTIAL OVERLAP, SUPERPOSING ONE GAS AT A TIME.                     RAD_ALL.16104 
!                                                                                  RAD_ALL.16105 
!     INITIAL SOLUTION FOR GREY FLUXES.                                            RAD_ALL.16106 
!     SET THE APPROPRIATE BOUNDARY CONDITIONS FOR THE TOTAL                        RAD_ALL.16107 
!     UPWARD AND DOWNWARD FLUXES.                                                  RAD_ALL.16108 
!                                                                                  RAD_ALL.16109 
      IF (ISOLIR.EQ.IP_SOLAR) THEN                                                 RAD_ALL.16110 
!        VISIBLE REGION.                                                           RAD_ALL.16111 
         DO L=1, N_PROFILE                                                         RAD_ALL.16112 
            SOURCE_GROUND(L)=0.0E+00                                               RAD_ALL.16113 
            FLUX_INC_DIRECT(L)=SOLAR_FLUX(L)                                       RAD_ALL.16114 
            FLUX_INC_DOWN(L)=SOLAR_FLUX(L)                                         RAD_ALL.16115 
         ENDDO                                                                     RAD_ALL.16116 
      ELSEIF (ISOLIR.EQ.IP_INFRA_RED) THEN                                         RAD_ALL.16117 
!        INFRA-RED REGION.                                                         RAD_ALL.16118 
         DO L=1, N_PROFILE                                                         RAD_ALL.16119 
            FLUX_INC_DIRECT(L)=0.0E+00                                             RAD_ALL.16120 
            FLUX_DIRECT_GREY(L, N_LAYER)=0.0E+00                                   RAD_ALL.16121 
            FLUX_INC_DOWN(L)=-PLANCK_SOURCE_TOP(L)                                 RAD_ALL.16122 
            SOURCE_GROUND(L)=THERMAL_GROUND_BAND(L)                                RAD_ALL.16123 
     &         -(1.0E+00-ALBEDO_SURFACE_DIFF(L))                                   RAD_ALL.16124 
     &         *PLANCK_SOURCE_BOTTOM(L)                                            RAD_ALL.16125 
         ENDDO                                                                     RAD_ALL.16126 
         IF (L_CLEAR) THEN                                                         RAD_ALL.16127 
            DO L=1, N_PROFILE                                                      RAD_ALL.16128 
               FLUX_DIRECT_CLEAR_GREY(L, N_LAYER)=0.0E+00                          RAD_ALL.16129 
            ENDDO                                                                  RAD_ALL.16130 
         ENDIF                                                                     RAD_ALL.16131 
      ENDIF                                                                        RAD_ALL.16132 
!                                                                                  RAD_ALL.16133 
!     THIS CALL CONTAINS NO GASEOUS ABSORPTION SO K_GAS_ABS MUST                   RAD_ALL.16134 
!     BE ZEROED.                                                                   RAD_ALL.16135 
      DO I=1, N_LAYER                                                              RAD_ALL.16136 
         DO L=1, N_PROFILE                                                         RAD_ALL.16137 
            K_GAS_ABS(L, I)=0.0E+00                                                RAD_ALL.16138 
         ENDDO                                                                     RAD_ALL.16139 
      ENDDO                                                                        RAD_ALL.16140 
!                                                                                  RAD_ALL.16141 
!                                                                                  RAD_ALL.16142 
      CALL MONOCHROMATIC_FLUX(IERR                                                 RAD_ALL.16143 
!                       Atmospheric Properties                                     RAD_ALL.16144 
     &   , N_PROFILE, N_LAYER, D_MASS                                              RAD_ALL.16145 
!                       Angular Integration                                        RAD_ALL.16146 
     &   , I_ANGULAR_INTEGRATION, I_2STREAM, L_2_STREAM_CORRECT                    RAD_ALL.16147 
     &   , L_RESCALE, N_ORDER_GAUSS                                                RAD_ALL.16148 
!                       Treatment of Scattering                                    RAD_ALL.16149 
     &   , I_SCATTER_METHOD_BAND                                                   RAD_ALL.16150 
!                       Options for Solver                                         RAD_ALL.16151 
     &   , I_SOLVER, L_NET, I_EXTRAPOLATE_MIX_NET, N_AUGMENT                       RAD_ALL.16152 
!                       Gaseous Properties                                         RAD_ALL.16153 
     &   , K_GAS_ABS                                                               RAD_ALL.16154 
!                       Options for Equivalent Extinction                          RAD_ALL.16155 
     &   , .FALSE., DUMMY_KE                                                       RAD_ALL.16156 
!                       Spectral Region                                            RAD_ALL.16157 
     &   , ISOLIR                                                                  RAD_ALL.16158 
!                       Infra-red Properties                                       RAD_ALL.16159 
     &   , DIFF_PLANCK_BAND                                                        RAD_ALL.16160 
     &   , L_IR_SOURCE_QUAD, DIFF_PLANCK_BAND_2                                    RAD_ALL.16161 
!                       Conditions at TOA                                          RAD_ALL.16162 
     &   , SEC_0, SOLAR_FLUX, FLUX_INC_DOWN                                        RAD_ALL.16163 
!                       Surface Properties                                         RAD_ALL.16164 
     &   , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR                                 RAD_ALL.16165 
     &   , SOURCE_GROUND, THERMAL_GROUND_BAND                                      RAD_ALL.16166 
!                       Clear-sky Optical Properties                               RAD_ALL.16167 
     &   , K_GREY_TOT_FREE, K_EXT_SCAT_FREE, ASYMMETRY_FREE                        RAD_ALL.16168 
     &   , FORWARD_SCATTER_FREE                                                    RAD_ALL.16169 
!                       Cloudy Properties                                          RAD_ALL.16170 
     &   , L_CLOUD, I_CLOUD                                                        RAD_ALL.16171 
!                       Cloud Geometry                                             RAD_ALL.16172 
     &   , N_CLOUD_TOP                                                             RAD_ALL.16173 
     &   , N_CLOUD_TYPE, FRAC_CLOUD                                                RAD_ALL.16174 
     &   , I_REGION_CLOUD, FRAC_REGION                                             RAD_ALL.16175 
     &   , W_FREE, N_FREE_PROFILE, I_FREE_PROFILE                                  RAD_ALL.16176 
     &   , W_CLOUD, N_CLOUD_PROFILE, I_CLOUD_PROFILE                               RAD_ALL.16177 
     &   , CLOUD_OVERLAP                                                           RAD_ALL.16178 
     &   , N_COLUMN, L_COLUMN, AREA_COLUMN                                         RAD_ALL.16179 
!                       Cloudy Optical Properties                                  RAD_ALL.16180 
     &   , K_GREY_TOT_CLOUD, K_EXT_SCAT_CLOUD                                      RAD_ALL.16181 
     &   , ASYMMETRY_CLOUD, FORWARD_SCATTER_CLOUD                                  RAD_ALL.16182 
!                       Fluxes Calculated                                          RAD_ALL.16183 
     &   , FLUX_DIRECT_GREY, FLUX_DIFFUSE_GREY                                     RAD_ALL.16184 
!                       Flags for Clear-sky Calculations                           RAD_ALL.16185 
     &   , L_CLEAR, I_SOLVER_CLEAR                                                 RAD_ALL.16186 
!                       Clear-sky Fluxes Calculated                                RAD_ALL.16187 
     &   , FLUX_DIRECT_CLEAR_GREY, FLUX_DIFFUSE_CLEAR_GREY                         RAD_ALL.16188 
!                       Planckian Function                                         RAD_ALL.16189 
     &   , PLANCK_SOURCE_BAND                                                      RAD_ALL.16190 
!                       Dimensions of Arrays                                       RAD_ALL.16191 
     &   , NPD_PROFILE, NPD_LAYER, NPD_COLUMN                                      RAD_ALL.16192 
     &   )                                                                         RAD_ALL.16193 
      IF (IERR.NE.I_NORMAL) RETURN                                                 RAD_ALL.16194 
!                                                                                  RAD_ALL.16195 
!     FESFT IS BASED ON THE DIFFUSE FLUXES, WHEREAS TOTAL FLUXES                   RAD_ALL.16196 
!     ARE USED HERE IN THE SOLAR: CONVERSION BACK TO DIFFUSE                       RAD_ALL.16197 
!     FLUXES IS REQUIRED.                                                          RAD_ALL.16198 
      IF (ISOLIR.EQ.IP_SOLAR) THEN                                                 RAD_ALL.16199 
         IF (L_NET) THEN                                                           RAD_ALL.16200 
            DO I=1, N_AUGMENT                                                      RAD_ALL.16201 
               DO L=1, N_PROFILE                                                   RAD_ALL.16202 
                  FLUX_DIFFUSE_GREY(L, I)=FLUX_DIFFUSE_GREY(L, I)                  RAD_ALL.16203 
     &               -FLUX_DIRECT_GREY(L, I-1)                                     RAD_ALL.16204 
               ENDDO                                                               RAD_ALL.16205 
            ENDDO                                                                  RAD_ALL.16206 
         ELSE                                                                      RAD_ALL.16207 
            DO I=1, N_AUGMENT                                                      RAD_ALL.16208 
               DO L=1, N_PROFILE                                                   RAD_ALL.16209 
                  FLUX_DIFFUSE_GREY(L, 2*I)=FLUX_DIFFUSE_GREY(L, 2*I)              RAD_ALL.16210 
     &               -FLUX_DIRECT_GREY(L, I-1)                                     RAD_ALL.16211 
               ENDDO                                                               RAD_ALL.16212 
            ENDDO                                                                  RAD_ALL.16213 
         ENDIF                                                                     RAD_ALL.16214 
         IF (L_CLEAR) THEN                                                         RAD_ALL.16215 
            IF (L_NET) THEN                                                        RAD_ALL.16216 
               DO I=1, N_AUGMENT                                                   RAD_ALL.16217 
                  DO L=1, N_PROFILE                                                RAD_ALL.16218 
                     FLUX_DIFFUSE_CLEAR_GREY(L, I)                                 RAD_ALL.16219 
     &                  =FLUX_DIFFUSE_CLEAR_GREY(L, I)                             RAD_ALL.16220 
     &                  -FLUX_DIRECT_CLEAR_GREY(L, I-1)                            RAD_ALL.16221 
                  ENDDO                                                            RAD_ALL.16222 
               ENDDO                                                               RAD_ALL.16223 
            ELSE                                                                   RAD_ALL.16224 
               DO I=1, N_AUGMENT                                                   RAD_ALL.16225 
                  DO L=1, N_PROFILE                                                RAD_ALL.16226 
                     FLUX_DIFFUSE_CLEAR_GREY(L, 2*I)                               RAD_ALL.16227 
     &                  =FLUX_DIFFUSE_CLEAR_GREY(L, 2*I)                           RAD_ALL.16228 
     &                  -FLUX_DIRECT_CLEAR_GREY(L, I-1)                            RAD_ALL.16229 
                  ENDDO                                                            RAD_ALL.16230 
               ENDDO                                                               RAD_ALL.16231 
            ENDIF                                                                  RAD_ALL.16232 
         ENDIF                                                                     RAD_ALL.16233 
      ENDIF                                                                        RAD_ALL.16234 
!                                                                                  RAD_ALL.16235 
!                                                                                  RAD_ALL.16236 
!                                                                                  RAD_ALL.16237 
!                                                                                  RAD_ALL.16238 
!     THE FLUX RATIOS ARE THE RATIOS OF THE GASEOUS FLUXES TO                      RAD_ALL.16239 
!     THE GREY FLUXES. THE PRODUCT OVER ALL GASES IS USED TO                       RAD_ALL.16240 
!     CALCULATE THE OVERALL FLUX.                                                  RAD_ALL.16241 
      CALL INITIALIZE_FLUX(N_PROFILE, N_LAYER, N_AUGMENT                           RAD_ALL.16242 
     &   , ISOLIR                                                                  RAD_ALL.16243 
     &   , FLUX_RATIO_DIRECT, FLUX_RATIO_DIFFUSE                                   RAD_ALL.16244 
     &   , L_CLEAR                                                                 RAD_ALL.16245 
     &   , FLUX_RATIO_DIRECT_CLEAR, FLUX_RATIO_DIFFUSE_CLEAR                       RAD_ALL.16246 
     &   , 1.0E+00                                                                 RAD_ALL.16247 
     &   , NPD_PROFILE, NPD_LAYER                                                  RAD_ALL.16248 
     &   , L_NET                                                                   RAD_ALL.16249 
     &   )                                                                         RAD_ALL.16250 
!                                                                                  RAD_ALL.16251 
      DO J=1, N_GAS                                                                RAD_ALL.16252 
!                                                                                  RAD_ALL.16253 
!        INITIALIZE THE FLUX IN THE BAND TO ZERO. IN THIS                          RAD_ALL.16254 
!        LOOP FLUX_..._BAND IS USED AS A TEMPORARY VARIABLE                        RAD_ALL.16255 
!        TO HOLD THE FLUXES FOR ONE GAS.                                           RAD_ALL.16256 
         CALL INITIALIZE_FLUX(N_PROFILE, N_LAYER, N_AUGMENT                        RAD_ALL.16257 
     &      , ISOLIR                                                               RAD_ALL.16258 
     &      , FLUX_DIRECT_BAND, FLUX_DIFFUSE_BAND                                  RAD_ALL.16259 
     &      , L_CLEAR                                                              RAD_ALL.16260 
     &      , FLUX_DIRECT_CLEAR_BAND, FLUX_DIFFUSE_CLEAR_BAND                      RAD_ALL.16261 
     &      , 0.0E+00                                                              RAD_ALL.16262 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.16263 
     &      , L_NET                                                                RAD_ALL.16264 
     &      )                                                                      RAD_ALL.16265 
!                                                                                  RAD_ALL.16266 
         I_GAS_BAND=INDEX_ABSORB(J, I_BAND)                                        RAD_ALL.16267 
         I_GAS_POINTER(1)=I_GAS_BAND                                               RAD_ALL.16268 
         DO IEX=1, I_BAND_ESFT(I_BAND, I_GAS_BAND)                                 RAD_ALL.16269 
!                                                                                  RAD_ALL.16270 
!           STORE THE ESFT WEIGHT FOR FUTURE USE.                                  RAD_ALL.16271 
            ESFT_WEIGHT=W_ESFT(IEX, I_BAND,  I_GAS_BAND)                           RAD_ALL.16272 
!                                                                                  RAD_ALL.16273 
!           RESCALE THE AMOUNT OF GAS FOR THIS ABSORBER IF REQUIRED.               RAD_ALL.16274 
            IF (I_SCALE_ESFT(I_BAND, I_GAS_BAND).EQ.IP_SCALE_TERM) THEN            RAD_ALL.16275 
               CALL SCALE_ABSORB(IERR, N_PROFILE, N_LAYER                          RAD_ALL.16276 
     &            , GAS_MIX_RATIO(1, 0, I_GAS_BAND), P, T                          RAD_ALL.16277 
     &            , L_LAYER, I_TOP                                                 RAD_ALL.16278 
     &            , GAS_FRAC_RESCALED(1, 0, I_GAS_BAND)                            RAD_ALL.16279 
     &            , I_SCALE_FNC(I_BAND, I_GAS_BAND)                                RAD_ALL.16280 
     &            , P_REFERENCE(I_GAS_BAND, I_BAND)                                RAD_ALL.16281 
     &            , T_REFERENCE(I_GAS_BAND, I_BAND)                                RAD_ALL.16282 
     &            , SCALE_VECTOR(1, IEX, I_BAND, I_GAS_BAND)                       RAD_ALL.16283 
     &            , L_DOPPLER(I_GAS_BAND)                                          RAD_ALL.16284 
     &            , DOPPLER_CORRECTION(I_GAS_BAND)                                 RAD_ALL.16285 
     &            , NPD_PROFILE, NPD_LAYER, NPD_SCALE_FNC                          RAD_ALL.16286 
     &            , NPD_SCALE_VARIABLE                                             RAD_ALL.16287 
     &            )                                                                RAD_ALL.16288 
               IF (IERR.NE.I_NORMAL) RETURN                                        RAD_ALL.16289 
            ENDIF                                                                  RAD_ALL.16290 
!                                                                                  RAD_ALL.16291 
!           SET THE APPROPRIATE SOURCE TERMS FOR THE TWO-STREAM                    RAD_ALL.16292 
!           EQUATIONS.                                                             RAD_ALL.16293 
!           SET THE GROUND SOURCE FUNCTION                                         RAD_ALL.16294 
            IF (ISOLIR.EQ.IP_SOLAR) THEN                                           RAD_ALL.16295 
!              VISIBLE REGION.                                                     RAD_ALL.16296 
               DO L=1, N_PROFILE                                                   RAD_ALL.16297 
                  SOURCE_GROUND(L)=0.0E+00                                         RAD_ALL.16298 
                  FLUX_INC_DOWN(L)=SOLAR_FLUX(L)                                   RAD_ALL.16299 
                  FLUX_INC_DIRECT(L)=SOLAR_FLUX(L)                                 RAD_ALL.16300 
               ENDDO                                                               RAD_ALL.16301 
            ELSEIF (ISOLIR.EQ.IP_INFRA_RED) THEN                                   RAD_ALL.16302 
!              INFRA-RED REGION.                                                   RAD_ALL.16303 
               DO L=1, N_PROFILE                                                   RAD_ALL.16304 
                  FLUX_INC_DIRECT(L)=0.0E+00                                       RAD_ALL.16305 
                  FLUX_DIRECT_PART(L, N_LAYER)=0.0E+00                             RAD_ALL.16306 
                  FLUX_INC_DOWN(L)=-PLANCK_SOURCE_TOP(L)                           RAD_ALL.16307 
                  SOURCE_GROUND(L)=THERMAL_GROUND_BAND(L)                          RAD_ALL.16308 
     &               -(1.0E+00-ALBEDO_SURFACE_DIFF(L))                             RAD_ALL.16309 
     &               *PLANCK_SOURCE_BOTTOM(L)                                      RAD_ALL.16310 
               ENDDO                                                               RAD_ALL.16311 
               IF (L_CLEAR) THEN                                                   RAD_ALL.16312 
                  DO L=1, N_PROFILE                                                RAD_ALL.16313 
                     FLUX_DIRECT_CLEAR_PART(L, N_LAYER)=0.0E+00                    RAD_ALL.16314 
                  ENDDO                                                            RAD_ALL.16315 
               ENDIF                                                               RAD_ALL.16316 
            ENDIF                                                                  RAD_ALL.16317 
!                                                                                  RAD_ALL.16318 
!           ASSIGN THE MONOCHROMATIC ABSORPTION COEFFICIENT.                       RAD_ALL.16319 
            K_ESFT_MONO(I_GAS_BAND)=K_ESFT(IEX, I_BAND, I_GAS_BAND)                RAD_ALL.16320 
!                                                                                  RAD_ALL.16321 
            CALL GAS_OPTICAL_PROPERTIES(N_PROFILE, N_LAYER                         RAD_ALL.16322 
     &         , 1, I_GAS_POINTER, K_ESFT_MONO                                     RAD_ALL.16323 
     &         , GAS_FRAC_RESCALED                                                 RAD_ALL.16324 
     &         , K_GAS_ABS                                                         RAD_ALL.16325 
     &         , NPD_PROFILE, NPD_LAYER, NPD_SPECIES                               RAD_ALL.16326 
     &         )                                                                   RAD_ALL.16327 
!                                                                                  RAD_ALL.16328 
            CALL MONOCHROMATIC_FLUX(IERR                                           RAD_ALL.16329 
!                       Atmospheric Properties                                     RAD_ALL.16330 
     &         , N_PROFILE, N_LAYER, D_MASS                                        RAD_ALL.16331 
!                       Angular Integration                                        RAD_ALL.16332 
     &         , I_ANGULAR_INTEGRATION, I_2STREAM, L_2_STREAM_CORRECT              RAD_ALL.16333 
     &         , L_RESCALE, N_ORDER_GAUSS                                          RAD_ALL.16334 
!                       Treatment of Scattering                                    RAD_ALL.16335 
     &         , I_SCATTER_METHOD_BAND                                             RAD_ALL.16336 
!                       Options for Solver                                         RAD_ALL.16337 
     &         , I_SOLVER, L_NET, I_EXTRAPOLATE_MIX_NET, N_AUGMENT                 RAD_ALL.16338 
!                       Gaseous Propreties                                         RAD_ALL.16339 
     &         , K_GAS_ABS                                                         RAD_ALL.16340 
!                       Options for Equivalent Extinction                          RAD_ALL.16341 
     &         , .FALSE., DUMMY_KE                                                 RAD_ALL.16342 
!                       Spectral Region                                            RAD_ALL.16343 
     &         , ISOLIR                                                            RAD_ALL.16344 
!                       Infra-red Properties                                       RAD_ALL.16345 
     &         , DIFF_PLANCK_BAND                                                  RAD_ALL.16346 
     &         , L_IR_SOURCE_QUAD, DIFF_PLANCK_BAND_2                              RAD_ALL.16347 
!                       Conditions at TOA                                          RAD_ALL.16348 
     &         , SEC_0, FLUX_INC_DIRECT, FLUX_INC_DOWN                             RAD_ALL.16349 
!                       Surface Properties                                         RAD_ALL.16350 
     &         , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR, SOURCE_GROUND            RAD_ALL.16351 
     &         , THERMAL_GROUND_BAND                                               RAD_ALL.16352 
!                       Clear-sky Optical Properties                               RAD_ALL.16353 
     &         , K_GREY_TOT_FREE, K_EXT_SCAT_FREE                                  RAD_ALL.16354 
     &         , ASYMMETRY_FREE, FORWARD_SCATTER_FREE                              RAD_ALL.16355 
!                       Cloudy Properties                                          RAD_ALL.16356 
     &         , L_CLOUD, I_CLOUD                                                  RAD_ALL.16357 
!                       Cloud Geometry                                             RAD_ALL.16358 
     &         , N_CLOUD_TOP                                                       RAD_ALL.16359 
     &         , N_CLOUD_TYPE, FRAC_CLOUD                                          RAD_ALL.16360 
     &        , I_REGION_CLOUD, FRAC_REGION                                        RAD_ALL.16361 
     &         , W_FREE, N_FREE_PROFILE, I_FREE_PROFILE                            RAD_ALL.16362 
     &         , W_CLOUD, N_CLOUD_PROFILE, I_CLOUD_PROFILE                         RAD_ALL.16363 
     &         , CLOUD_OVERLAP                                                     RAD_ALL.16364 
     &         , N_COLUMN, L_COLUMN, AREA_COLUMN                                   RAD_ALL.16365 
!                       Cloudy Optical Properties                                  RAD_ALL.16366 
     &         , K_GREY_TOT_CLOUD, K_EXT_SCAT_CLOUD                                RAD_ALL.16367 
     &         , ASYMMETRY_CLOUD, FORWARD_SCATTER_CLOUD                            RAD_ALL.16368 
!                       Flxues Calculated                                          RAD_ALL.16369 
     &         , FLUX_DIRECT_PART, FLUX_DIFFUSE_PART                               RAD_ALL.16370 
!                       Flags for Clear-sky Calculations                           RAD_ALL.16371 
     &         , L_CLEAR, I_SOLVER_CLEAR                                           RAD_ALL.16372 
!                       Clear-sky Fluxes Calculated                                RAD_ALL.16373 
     &         , FLUX_DIRECT_CLEAR_PART, FLUX_DIFFUSE_CLEAR_PART                   RAD_ALL.16374 
!                       Planckian Function                                         RAD_ALL.16375 
     &         , PLANCK_SOURCE_BAND                                                RAD_ALL.16376 
!                       Dimensions of Arrays                                       RAD_ALL.16377 
     &         , NPD_PROFILE, NPD_LAYER, NPD_COLUMN                                RAD_ALL.16378 
     &         )                                                                   RAD_ALL.16379 
            IF (IERR.NE.I_NORMAL) RETURN                                           RAD_ALL.16380 
!                                                                                  RAD_ALL.16381 
!           CONVERT THE TOTAL FLUXES BACK TO DIFFUSE FLUXES.                       RAD_ALL.16382 
            IF (ISOLIR.EQ.IP_SOLAR) THEN                                           RAD_ALL.16383 
               IF (L_NET) THEN                                                     RAD_ALL.16384 
                  DO I=1, N_AUGMENT                                                RAD_ALL.16385 
                     DO L=1, N_PROFILE                                             RAD_ALL.16386 
                        FLUX_DIFFUSE_PART(L, I)                                    RAD_ALL.16387 
     &                     =FLUX_DIFFUSE_PART(L, I)                                RAD_ALL.16388 
     &                     -FLUX_DIRECT_PART(L, I-1)                               RAD_ALL.16389 
                     ENDDO                                                         RAD_ALL.16390 
                  ENDDO                                                            RAD_ALL.16391 
               ELSE                                                                RAD_ALL.16392 
                  DO I=1, N_AUGMENT                                                RAD_ALL.16393 
                     DO L=1, N_PROFILE                                             RAD_ALL.16394 
                        FLUX_DIFFUSE_PART(L, 2*I)                                  RAD_ALL.16395 
     &                     =FLUX_DIFFUSE_PART(L, 2*I)                              RAD_ALL.16396 
     &                     -FLUX_DIRECT_PART(L, I-1)                               RAD_ALL.16397 
                     ENDDO                                                         RAD_ALL.16398 
                  ENDDO                                                            RAD_ALL.16399 
               ENDIF                                                               RAD_ALL.16400 
               IF (L_CLEAR) THEN                                                   RAD_ALL.16401 
                  IF (L_NET) THEN                                                  RAD_ALL.16402 
                     DO I=1, N_AUGMENT                                             RAD_ALL.16403 
                        DO L=1, N_PROFILE                                          RAD_ALL.16404 
                           FLUX_DIFFUSE_CLEAR_PART(L, I)                           RAD_ALL.16405 
     &                        =FLUX_DIFFUSE_CLEAR_PART(L, I)                       RAD_ALL.16406 
     &                        -FLUX_DIRECT_CLEAR_PART(L, I-1)                      RAD_ALL.16407 
                        ENDDO                                                      RAD_ALL.16408 
                     ENDDO                                                         RAD_ALL.16409 
                  ELSE                                                             RAD_ALL.16410 
                     DO I=1, N_AUGMENT                                             RAD_ALL.16411 
                        DO L=1, N_PROFILE                                          RAD_ALL.16412 
                           FLUX_DIFFUSE_CLEAR_PART(L, 2*I)                         RAD_ALL.16413 
     &                        =FLUX_DIFFUSE_CLEAR_PART(L, 2*I)                     RAD_ALL.16414 
     &                        -FLUX_DIRECT_CLEAR_PART(L, I-1)                      RAD_ALL.16415 
                        ENDDO                                                      RAD_ALL.16416 
                     ENDDO                                                         RAD_ALL.16417 
                  ENDIF                                                            RAD_ALL.16418 
               ENDIF                                                               RAD_ALL.16419 
            ENDIF                                                                  RAD_ALL.16420 
!                                                                                  RAD_ALL.16421 
!           INCREMENT THE FLUXES WITHIN THE BAND.                                  RAD_ALL.16422 
            CALL AUGMENT_FLUX(N_PROFILE, N_LAYER, N_AUGMENT                        RAD_ALL.16423 
     &         , ISOLIR, L_CLEAR                                                   RAD_ALL.16424 
     &         , ESFT_WEIGHT                                                       RAD_ALL.16425 
     &         , FLUX_DIRECT_BAND, FLUX_DIFFUSE_BAND                               RAD_ALL.16426 
     &         , FLUX_DIRECT_PART, FLUX_DIFFUSE_PART                               RAD_ALL.16427 
     &         , FLUX_DIRECT_CLEAR_BAND, FLUX_DIFFUSE_CLEAR_BAND                   RAD_ALL.16428 
     &         , FLUX_DIRECT_CLEAR_PART, FLUX_DIFFUSE_CLEAR_PART                   RAD_ALL.16429 
     &         , NPD_PROFILE, NPD_LAYER                                            RAD_ALL.16430 
     &         )                                                                   RAD_ALL.16431 
!                                                                                  RAD_ALL.16432 
          ENDDO                                                                    RAD_ALL.16433 
!                                                                                  RAD_ALL.16434 
!         CALCULATE THE FLUX RATIO.                                                RAD_ALL.16435 
          IF (ISOLIR.EQ.IP_SOLAR) THEN                                             RAD_ALL.16436 
             DO I=0, N_LAYER                                                       RAD_ALL.16437 
               DO L=1, N_PROFILE                                                   RAD_ALL.16438 
                  IF (ABS(FLUX_DIRECT_GREY(L, I)).GT.0.0E+00) THEN                 RAD_ALL.16439 
                     FLUX_RATIO_DIRECT(L, I)=FLUX_RATIO_DIRECT(L, I)               RAD_ALL.16440 
     &                  *FLUX_DIRECT_BAND(L, I)/FLUX_DIRECT_GREY(L, I)             RAD_ALL.16441 
                  ELSE                                                             RAD_ALL.16442 
                     FLUX_RATIO_DIRECT(L, I)=1.0E+00                               RAD_ALL.16443 
                  ENDIF                                                            RAD_ALL.16444 
               ENDDO                                                               RAD_ALL.16445 
            ENDDO                                                                  RAD_ALL.16446 
         ENDIF                                                                     RAD_ALL.16447 
         DO I=1, N_AUGMENT                                                         RAD_ALL.16448 
            DO L=1, N_PROFILE                                                      RAD_ALL.16449 
               IF (ABS(FLUX_DIFFUSE_GREY(L, I)).GT.0.0E+00) THEN                   RAD_ALL.16450 
                  FLUX_RATIO_DIFFUSE(L, I)=FLUX_RATIO_DIFFUSE(L, I)                RAD_ALL.16451 
     &               *FLUX_DIFFUSE_BAND(L, I)/FLUX_DIFFUSE_GREY(L, I)              RAD_ALL.16452 
               ELSE                                                                RAD_ALL.16453 
                  FLUX_RATIO_DIFFUSE(L, I)=1.0E+00                                 RAD_ALL.16454 
               ENDIF                                                               RAD_ALL.16455 
            ENDDO                                                                  RAD_ALL.16456 
         ENDDO                                                                     RAD_ALL.16457 
!                                                                                  RAD_ALL.16458 
         IF (L_CLEAR) THEN                                                         RAD_ALL.16459 
!           CALCULATE THE FLUX RATIOS FOR THE CLEAR FLUXES.                        RAD_ALL.16460 
            IF (ISOLIR.EQ.IP_SOLAR) THEN                                           RAD_ALL.16461 
               DO I=0, N_LAYER                                                     RAD_ALL.16462 
                  DO L=1, N_PROFILE                                                RAD_ALL.16463 
                     IF (ABS(FLUX_DIRECT_CLEAR_GREY(L, I))                         RAD_ALL.16464 
     &                  .GT.0.0E+00) THEN                                          RAD_ALL.16465 
                        FLUX_RATIO_DIRECT_CLEAR(L, I)                              RAD_ALL.16466 
     &                     =FLUX_RATIO_DIRECT_CLEAR(L, I)                          RAD_ALL.16467 
     &                     *FLUX_DIRECT_CLEAR_BAND(L, I)                           RAD_ALL.16468 
     &                     /FLUX_DIRECT_CLEAR_GREY(L, I)                           RAD_ALL.16469 
                     ELSE                                                          RAD_ALL.16470 
                        FLUX_RATIO_DIRECT_CLEAR(L, I)=1.0E+00                      RAD_ALL.16471 
                     ENDIF                                                         RAD_ALL.16472 
                  ENDDO                                                            RAD_ALL.16473 
               ENDDO                                                               RAD_ALL.16474 
            ENDIF                                                                  RAD_ALL.16475 
!                                                                                  RAD_ALL.16476 
            DO I=1, N_AUGMENT                                                      RAD_ALL.16477 
               DO L=1, N_PROFILE                                                   RAD_ALL.16478 
                  IF (ABS(FLUX_DIFFUSE_CLEAR_GREY(L, I))                           RAD_ALL.16479 
     &               .GT.0.0E+00) THEN                                             RAD_ALL.16480 
                     FLUX_RATIO_DIFFUSE_CLEAR(L, I)                                RAD_ALL.16481 
     &                  =FLUX_RATIO_DIFFUSE_CLEAR(L, I)                            RAD_ALL.16482 
     &                  *FLUX_DIFFUSE_CLEAR_BAND(L, I)                             RAD_ALL.16483 
     &                  /FLUX_DIFFUSE_CLEAR_GREY(L, I)                             RAD_ALL.16484 
                  ELSE                                                             RAD_ALL.16485 
                     FLUX_RATIO_DIFFUSE_CLEAR(L, I)=1.0E+00                        RAD_ALL.16486 
                  ENDIF                                                            RAD_ALL.16487 
               ENDDO                                                               RAD_ALL.16488 
            ENDDO                                                                  RAD_ALL.16489 
         ENDIF                                                                     RAD_ALL.16490 
!                                                                                  RAD_ALL.16491 
      ENDDO                                                                        RAD_ALL.16492 
!                                                                                  RAD_ALL.16493 
!     THE OVERALL FLUX IN THE BAND IS CALCULATED FROM THE                          RAD_ALL.16494 
!     GREY FLUX AND THE FLUX RATIOS.                                               RAD_ALL.16495 
      IF (ISOLIR.EQ.IP_SOLAR) THEN                                                 RAD_ALL.16496 
         DO I=0, N_LAYER                                                           RAD_ALL.16497 
            DO L=1, N_PROFILE                                                      RAD_ALL.16498 
               FLUX_DIRECT_BAND(L, I)=FLUX_RATIO_DIRECT(L, I)                      RAD_ALL.16499 
     &            *FLUX_DIRECT_GREY(L, I)                                          RAD_ALL.16500 
            ENDDO                                                                  RAD_ALL.16501 
         ENDDO                                                                     RAD_ALL.16502 
      ENDIF                                                                        RAD_ALL.16503 
      DO I=1, N_AUGMENT                                                            RAD_ALL.16504 
         DO L=1, N_PROFILE                                                         RAD_ALL.16505 
            FLUX_DIFFUSE_BAND(L, I)=FLUX_RATIO_DIFFUSE(L, I)                       RAD_ALL.16506 
     &         *FLUX_DIFFUSE_GREY(L, I)                                            RAD_ALL.16507 
         ENDDO                                                                     RAD_ALL.16508 
      ENDDO                                                                        RAD_ALL.16509 
      IF (L_CLEAR) THEN                                                            RAD_ALL.16510 
         IF (ISOLIR.EQ.IP_SOLAR) THEN                                              RAD_ALL.16511 
            DO I=0, N_LAYER                                                        RAD_ALL.16512 
               DO L=1, N_PROFILE                                                   RAD_ALL.16513 
                  FLUX_DIRECT_CLEAR_BAND(L, I)                                     RAD_ALL.16514 
     &               =FLUX_RATIO_DIRECT_CLEAR(L, I)                                RAD_ALL.16515 
     &               *FLUX_DIRECT_CLEAR_GREY(L, I)                                 RAD_ALL.16516 
               ENDDO                                                               RAD_ALL.16517 
            ENDDO                                                                  RAD_ALL.16518 
         ENDIF                                                                     RAD_ALL.16519 
         DO I=1, N_AUGMENT                                                         RAD_ALL.16520 
            DO L=1, N_PROFILE                                                      RAD_ALL.16521 
               FLUX_DIFFUSE_CLEAR_BAND(L, I)                                       RAD_ALL.16522 
     &            =FLUX_RATIO_DIFFUSE_CLEAR(L, I)                                  RAD_ALL.16523 
     &            *FLUX_DIFFUSE_CLEAR_GREY(L, I)                                   RAD_ALL.16524 
            ENDDO                                                                  RAD_ALL.16525 
         ENDDO                                                                     RAD_ALL.16526 
      ENDIF                                                                        RAD_ALL.16527 
!                                                                                  RAD_ALL.16528 
!                                                                                  RAD_ALL.16529 
!     CONVERT BACK TO TOTAL FLUXES.                                                RAD_ALL.16530 
      IF (ISOLIR.EQ.IP_SOLAR) THEN                                                 RAD_ALL.16531 
         IF (L_NET) THEN                                                           RAD_ALL.16532 
            DO I=1, N_AUGMENT                                                      RAD_ALL.16533 
               DO L=1, N_PROFILE                                                   RAD_ALL.16534 
                  FLUX_DIFFUSE_BAND(L, I)=FLUX_DIFFUSE_BAND(L, I)                  RAD_ALL.16535 
     &               +FLUX_DIRECT_BAND(L, I-1)                                     RAD_ALL.16536 
               ENDDO                                                               RAD_ALL.16537 
            ENDDO                                                                  RAD_ALL.16538 
         ELSE                                                                      RAD_ALL.16539 
            DO I=1, N_AUGMENT                                                      RAD_ALL.16540 
               DO L=1, N_PROFILE                                                   RAD_ALL.16541 
                  FLUX_DIFFUSE_BAND(L, 2*I)=FLUX_DIFFUSE_BAND(L, 2*I)              RAD_ALL.16542 
     &               +FLUX_DIRECT_BAND(L, I-1)                                     RAD_ALL.16543 
               ENDDO                                                               RAD_ALL.16544 
            ENDDO                                                                  RAD_ALL.16545 
         ENDIF                                                                     RAD_ALL.16546 
         IF (L_CLEAR) THEN                                                         RAD_ALL.16547 
            IF (L_NET) THEN                                                        RAD_ALL.16548 
               DO I=1, N_AUGMENT                                                   RAD_ALL.16549 
                  DO L=1, N_PROFILE                                                RAD_ALL.16550 
                     FLUX_DIFFUSE_CLEAR_BAND(L, I)                                 RAD_ALL.16551 
     &                  =FLUX_DIFFUSE_CLEAR_BAND(L, I)                             RAD_ALL.16552 
     &                  +FLUX_DIRECT_CLEAR_BAND(L, I-1)                            RAD_ALL.16553 
                  ENDDO                                                            RAD_ALL.16554 
               ENDDO                                                               RAD_ALL.16555 
            ELSE                                                                   RAD_ALL.16556 
               DO I=1, N_AUGMENT                                                   RAD_ALL.16557 
                  DO L=1, N_PROFILE                                                RAD_ALL.16558 
                     FLUX_DIFFUSE_CLEAR_BAND(L, 2*I)                               RAD_ALL.16559 
     &                  =FLUX_DIFFUSE_CLEAR_BAND(L, 2*I)                           RAD_ALL.16560 
     &                  +FLUX_DIRECT_CLEAR_BAND(L, I-1)                            RAD_ALL.16561 
                  ENDDO                                                            RAD_ALL.16562 
               ENDDO                                                               RAD_ALL.16563 
            ENDIF                                                                  RAD_ALL.16564 
         ENDIF                                                                     RAD_ALL.16565 
      ENDIF                                                                        RAD_ALL.16566 
!                                                                                  RAD_ALL.16567 
!                                                                                  RAD_ALL.16568 
!                                                                                  RAD_ALL.16569 
      RETURN                                                                       RAD_ALL.16570 
      END   
