C (c) CROWN COPYRIGHT 1995, METEOROLOGICAL OFFICE, All Rights Reserved.            RAD_ALL.10617 
C                                                                                  RAD_ALL.10618 
C Use, duplication or disclosure of this code is subject to the                    RAD_ALL.10619 
C restrictions as set forth in the contract.                                       RAD_ALL.10620 
C                                                                                  RAD_ALL.10621 
C                Meteorological Office                                             RAD_ALL.10622 
C                London Road                                                       RAD_ALL.10623 
C                BRACKNELL                                                         RAD_ALL.10624 
C                Berkshire UK                                                      RAD_ALL.10625 
C                RG12 2SZ                                                          RAD_ALL.10626 
C                                                                                  RAD_ALL.10627 
C If no contract has been raised with this copy of the code, the use,              RAD_ALL.10628 
C duplication or disclosure of it is strictly prohibited.  Permission              RAD_ALL.10629 
C to do so must first be obtained in writing from the Head of Numerical            RAD_ALL.10630 
C Modelling at the above address.                                                  RAD_ALL.10631 
C ******************************COPYRIGHT******************************            RAD_ALL.10632 
C                                                                                  RAD_ALL.10633 
!+ Subroutine to solve the two-stream equations in a mixed column.                 RAD_ALL.10634 
!                                                                                  RAD_ALL.10635 
! Method:                                                                          RAD_ALL.10636 
!       The two-stream coefficients are calculated in clear regions                RAD_ALL.10637 
!       and in stratiform and convective clouds. From these                        RAD_ALL.10638 
!       coefficients transmission and reflection coefficients are                  RAD_ALL.10639 
!       determined. The coefficients for convective and stratiform                 RAD_ALL.10640 
!       clouds are appropriately mixed to form single cloudy values                RAD_ALL.10641 
!       and an appropriate solver is called.                                       RAD_ALL.10642 
!                                                                                  RAD_ALL.10643 
! Current Owner of Code: J. M. Edwards                                             RAD_ALL.10644 
!                                                                                  RAD_ALL.10645 
! History:                                                                         RAD_ALL.10646 
!       Version         Date                    Comment                            RAD_ALL.10647 
!       4.0             27-07-95                Original Code                      RAD_ALL.10648 
!                                               (J. M. Edwards)                    RAD_ALL.10649 
!       4.1             10-04-96                New solver added.                  RAD_ALL.10650 
!                                               (J. M. Edwards)                    RAD_ALL.10651 
!                                                                                  RAD_ALL.10652 
! Description of Code:                                                             RAD_ALL.10653 
!   FORTRAN 77  with extensions listed in documentation.                           RAD_ALL.10654 
!                                                                                  RAD_ALL.10655 
!- ---------------------------------------------------------------------           RAD_ALL.10656 
      SUBROUTINE MIX_COLUMN(IERR                                                   RAD_ALL.10657 
!                       Atmospheric Properties                                     RAD_ALL.10658 
     &   , N_PROFILE, N_LAYER                                                      RAD_ALL.10659 
!                       Two-stream Scheme                                          RAD_ALL.10660 
     &   , I_2STREAM                                                               RAD_ALL.10661 
!                       Corrections to Two-stream Equations                        RAD_ALL.10662 
     &   , L_2_STREAM_CORRECT, PLANCK_SOURCE, GROUND_EMISSION                      RAD_ALL.10663 
!                       Options for Solver                                         RAD_ALL.10664 
     &   , I_SOLVER, I_EXTRAPOLATE_MIX_NET, L_NET                                  RAD_ALL.10665 
!                       Options for Equivalent Extinction                          RAD_ALL.10666 
     &   , L_SCALE_SOLAR, ADJUST_SOLAR_KE                                          RAD_ALL.10667 
!                       Spectral Region                                            RAD_ALL.10668 
     &   , ISOLIR                                                                  RAD_ALL.10669 
!                       Infra-red Properties                                       RAD_ALL.10670 
     &   , DIFF_PLANCK                                                             RAD_ALL.10671 
     &   , L_IR_SOURCE_QUAD, DIFF_PLANCK_2                                         RAD_ALL.10672 
!                       Conditions at TOA                                          RAD_ALL.10673 
     &   , FLUX_INC_DOWN, FLUX_INC_DIRECT, SEC_0                                   RAD_ALL.10674 
!                       Conditions at Surface                                      RAD_ALL.10675 
     &   , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR, SOURCE_GROUND                  RAD_ALL.10676 
!                       Clear-sky Single Scattering Properties                     RAD_ALL.10677 
     &   , TAU_FREE, OMEGA_FREE, ASYMMETRY_FREE                                    RAD_ALL.10678 
!                       Cloud Geometry                                             RAD_ALL.10679 
     &   , N_CLOUD_TOP                                                             RAD_ALL.10680 
     &   , N_CLOUD_TYPE, FRAC_CLOUD                                                RAD_ALL.10681 
     &   , W_FREE, N_FREE_PROFILE, I_FREE_PROFILE                                  RAD_ALL.10682 
     &   , W_CLOUD, N_CLOUD_PROFILE, I_CLOUD_PROFILE                               RAD_ALL.10683 
     &   , CLOUD_OVERLAP                                                           RAD_ALL.10684 
!                       Cloudy Optical Properties                                  RAD_ALL.10685 
     &   , TAU_CLOUD, OMEGA_CLOUD, ASYMMETRY_CLOUD                                 RAD_ALL.10686 
!                       Fluxes Calculated                                          RAD_ALL.10687 
     &   , FLUX_DIRECT, FLUX_TOTAL                                                 RAD_ALL.10688 
!                       Flags for Clear-sky Calculations                           RAD_ALL.10689 
     &   , L_CLEAR, I_SOLVER_CLEAR                                                 RAD_ALL.10690 
!                       Clear-sky Fluxes Calculated                                RAD_ALL.10691 
     &   , FLUX_DIRECT_CLEAR, FLUX_TOTAL_CLEAR                                     RAD_ALL.10692 
!                       Dimensions of Arrays                                       RAD_ALL.10693 
     &   , NPD_PROFILE, NPD_LAYER                                                  RAD_ALL.10694 
     &   )                                                                         RAD_ALL.10695 
!                                                                                  RAD_ALL.10696 
!                                                                                  RAD_ALL.10697 
!                                                                                  RAD_ALL.10698 
      IMPLICIT NONE                                                                RAD_ALL.10699 
!                                                                                  RAD_ALL.10700 
!                                                                                  RAD_ALL.10701 
!     SIZES OF DUMMY ARRAYS.                                                       RAD_ALL.10702 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.10703 
     &     NPD_PROFILE                                                             RAD_ALL.10704 
!             MAXIMUM NUMBER OF PROFILES                                           RAD_ALL.10705 
     &   , NPD_LAYER                                                               RAD_ALL.10706 
!             MAXIMUM NUMBER OF LAYERS                                             RAD_ALL.10707 
!                                                                                  RAD_ALL.10708 
!     INCLUDE COMDECKS.                                                            RAD_ALL.10709 
!     ------------------------------------------------------------------           STDIO3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       STDIO3A.3     
!                                                                                  STDIO3A.4     
!     MODULE TO SET UNIT NUMBERS FOR STANDARD I/O.                                 STDIO3A.5     
!                                                                                  STDIO3A.6     
      INTEGER                                                                      STDIO3A.7     
     &     IU_STDIN                                                                STDIO3A.8     
!             UNIT NUMBER FOR STANDARD INPUT                                       STDIO3A.9     
     &   , IU_STDOUT                                                               STDIO3A.10    
!             UNIT NUMBER FOR STANDARD OUTPUT                                      STDIO3A.11    
     *   , IU_ERR                                                                  STDIO3A.12    
!             UNIT NUMBER FOR ERROR MESSAGES                                       STDIO3A.13    
!                                                                                  STDIO3A.14    
      PARAMETER(                                                                   STDIO3A.15    
     &     IU_STDIN=5                                                              STDIO3A.16    
     &   , IU_STDOUT=6                                                             STDIO3A.17    
     *   , IU_ERR=6                                                                STDIO3A.18    
     &   )                                                                         STDIO3A.19    
!                                                                                  STDIO3A.20    
!     ------------------------------------------------------------------           STDIO3A.21    
!     ------------------------------------------------------------------           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    
!     ------------------------------------------------------------------           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    
!     ------------------------------------------------------------------           PRMCH3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       PRMCH3A.3     
!                                                                                  PRMCH3A.4     
!     MODULE FOR SETTING MACHINE PRECISION.                                        PRMCH3A.5     
!                                                                                  PRMCH3A.6     
      REAL                                                                         PRMCH3A.7     
     &     TOL_MACHINE                                                             PRMCH3A.8     
!             MACHINE TOLERANCE                                                    PRMCH3A.9     
     &   , SQRT_TOL_MACHINE                                                        PRMCH3A.10    
!             SQRT OF MACHINE TOLERANCE                                            PRMCH3A.11    
!                                                                                  PRMCH3A.12    
!                                                                                  PRMCH3A.13    
!     THE PRECISION SHOULD BE ABOUT 2/2^(SIZE OF SIGNIFICAND)                      PRMCH3A.14    
!                                                                                  PRMCH3A.15    
!     THE IEEE-FORMAT USES 53 BITS FOR THE SIGNIFICAND                             PRMCH3A.16    
!     IN DOUBLE PRECISION                                                          PRMCH3A.17    
!                                                                                  PRMCH3A.18    
!     THE CRAY FORMAT USES 47 BITS IN SINGLE PRECISION.                            PRMCH3A.19    
!                                                                                  PRMCH3A.20    
      PARAMETER(                                                                   PRMCH3A.21    
     &     TOL_MACHINE=1.42E-14                                                    PRMCH3A.22    
     &   , SQRT_TOL_MACHINE=1.19E-7                                                PRMCH3A.23    
     &   )                                                                         PRMCH3A.24    
!                                                                                  PRMCH3A.25    
!     ------------------------------------------------------------------           PRMCH3A.26    
!     ------------------------------------------------------------------           PRECSN3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       PRECSN3A.3     
!                                                                                  PRECSN3A.4     
!     MODULE FOR SETTING MACHINE-DEPENDENT TOLERANCES.                             PRECSN3A.5     
!     (THE COMDECK PRMCH3A MUST ALWAYS BE INCLUDED BEFORE THIS COMDECK.)           PRECSN3A.6     
!                                                                                  PRECSN3A.7     
      REAL                                                                         PRECSN3A.8     
     &     TOL_DIV                                                                 PRECSN3A.9     
!             TOLERANCE FOR DIVISION                                               PRECSN3A.10    
     &   , TOL_TEST                                                                PRECSN3A.11    
!             TOLERANCE FOR TESTING EQUALITY                                       PRECSN3A.12    
!                                                                                  PRECSN3A.13    
      PARAMETER(                                                                   PRECSN3A.14    
     &     TOL_DIV=3.2E+01*TOL_MACHINE                                             PRECSN3A.15    
     &   , TOL_TEST=1.6E+01*TOL_MACHINE                                            PRECSN3A.16    
     &   )                                                                         PRECSN3A.17    
!                                                                                  PRECSN3A.18    
!     ------------------------------------------------------------------           PRECSN3A.19    
!     ------------------------------------------------------------------           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    
!     ------------------------------------------------------------------           SOLVER3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       SOLVER3A.3     
!                                                                                  SOLVER3A.4     
!     MODULE TO DEFINE REFERENCE NUMBERS FOR SOLVERS.                              SOLVER3A.5     
!                                                                                  SOLVER3A.6     
      INTEGER                                                                      SOLVER3A.7     
     &     IP_SOLVER_PENTADIAGONAL                                                 SOLVER3A.8     
!             PENTADIAGONAL SCHEME                                                 SOLVER3A.9     
     &   , IP_SOLVER_TRIDIAG_FULL                                                  SOLVER3A.10    
!             TRIDIAGONAL SOLVER FOR FLUXES                                        SOLVER3A.11    
     &   , IP_SOLVER_TRIDIAG_PRECOND                                               SOLVER3A.12    
!             TRIDIAGONAL SOLVER FOR FLUXES                                        SOLVER3A.13    
!             WITH PRECONDITIONING OF MATRIX                                       SOLVER3A.14    
     &   , IP_SOLVER_TRIDIAG_NET                                                   SOLVER3A.15    
!             TRIDIAGONAL SOLVER FOR NET FLUX                                      SOLVER3A.16    
     &   , IP_SOLVER_SCHMETZ                                                       SOLVER3A.17    
!             SCHMETZ'S SCHEME                                                     SOLVER3A.18    
     &   , IP_SOLVER_MIX_11                                                        SOLVER3A.19    
!             MIXED COLUMN SCHEME USING FULL ENDEKADIAGONAL MATRIX                 SOLVER3A.20    
     &   , IP_SOLVER_MIX_FULL                                                      SOLVER3A.21    
!             MIXED COLUMN SCHEME FOR FULL FLUXES                                  SOLVER3A.22    
     &   , IP_SOLVER_MIX_NET                                                       SOLVER3A.23    
!             MIXED COLUMN SCHEME FOR NET FLUX                                     SOLVER3A.24    
     &   , IP_SOLVER_MIX_APP_SCAT                                                  SOLVER3A.25    
!             MIXED COLUMN SCHEME WITH APPROXIMATE SCATTERING                      SOLVER3A.26    
     &   , IP_SOLVER_MIX_NET_APP_SCAT                                              SOLVER3A.27    
!             MIXED COLUMN SCHEME FOR NET FLUXES                                   SOLVER3A.28    
!             WITH APPROXIMATE SCATTERING                                          SOLVER3A.29    
     &   , IP_SOLVER_MIX_DIRECT                                                    SOLVER3A.30    
!             DIRECT MIXED COLUMN SCHEME FOR FULL FLUXES                           SOLVER3A.31    
     &   , IP_SOLVER_MIX_DIRECT_NET                                                SOLVER3A.32    
!             DIRECT MIXED COLUMN SCHEME FOR NET FLUXES                            SOLVER3A.33    
     &   , IP_SOLVER_HOMOGEN_DIRECT                                                SOLVER3A.34    
!             DIRECT SOLVER FOR A HOMOGENEOUS COLUMN                               SOLVER3A.35    
     &   , IP_SOLVER_TRIPLE                                                        SOLVER3A.36    
!             DIRECT SOLVER FOR TRIPLE COLUMN                                      SOLVER3A.37    
     &   , IP_SOLVER_TRIPLE_APP_SCAT                                               SOLVER3A.38    
!             DIRECT SOLVER FOR TRIPLE COLUMN APPROXIMATING SCATTERING             SOLVER3A.39    
!                                                                                  SOLVER3A.40    
      PARAMETER(                                                                   SOLVER3A.41    
     &     IP_SOLVER_PENTADIAGONAL=1                                               SOLVER3A.42    
     &   , IP_SOLVER_TRIDIAG_FULL=2                                                SOLVER3A.43    
     &   , IP_SOLVER_TRIDIAG_PRECOND=3                                             SOLVER3A.44    
     &   , IP_SOLVER_TRIDIAG_NET=4                                                 SOLVER3A.45    
     &   , IP_SOLVER_SCHMETZ=5                                                     SOLVER3A.46    
     &   , IP_SOLVER_MIX_11=6                                                      SOLVER3A.47    
     &   , IP_SOLVER_MIX_FULL=7                                                    SOLVER3A.48    
     &   , IP_SOLVER_MIX_NET=8                                                     SOLVER3A.49    
     &   , IP_SOLVER_MIX_APP_SCAT=9                                                SOLVER3A.50    
     &   , IP_SOLVER_MIX_NET_APP_SCAT=10                                           SOLVER3A.51    
     &   , IP_SOLVER_MIX_DIRECT=11                                                 SOLVER3A.52    
     &   , IP_SOLVER_MIX_DIRECT_NET=12                                             SOLVER3A.53    
     &   , IP_SOLVER_HOMOGEN_DIRECT=13                                             SOLVER3A.54    
     &   , IP_SOLVER_TRIPLE=14                                                     SOLVER3A.55    
     &   , IP_SOLVER_TRIPLE_APP_SCAT=15                                            SOLVER3A.56    
     &   )                                                                         SOLVER3A.57    
!                                                                                  SOLVER3A.58    
!     ------------------------------------------------------------------           SOLVER3A.59    
!     ------------------------------------------------------------------           CLCFPT3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       CLCFPT3A.3     
!                                                                                  CLCFPT3A.4     
!     MODULE TO SET POINTERS IN CLOUD_OVERLAP.                                     CLCFPT3A.5     
!                                                                                  CLCFPT3A.6     
!     NOTE THAT SEVERAL POINTERS ARE IDENTICAL SINCE ONLY CERTAIN                  CLCFPT3A.7     
!     GROUPS OF COEFFICIENTS ARE RELEVANT TO A PARTICULAR SCHEME.                  CLCFPT3A.8     
!                                                                                  CLCFPT3A.9     
      INTEGER                                                                      CLCFPT3A.10    
     &     IP_CLOVLP_GFF                                                           CLCFPT3A.11    
!             POINTER TO GAMMA-FREE-FREE                                           CLCFPT3A.12    
     &   , IP_CLOVLP_GFC                                                           CLCFPT3A.13    
!             POINTER TO GAMMA-FREE-CLOUD                                          CLCFPT3A.14    
     &   , IP_CLOVLP_GCF                                                           CLCFPT3A.15    
!             POINTER TO GAMMA-CLOUD-FREE                                          CLCFPT3A.16    
     &   , IP_CLOVLP_GCC                                                           CLCFPT3A.17    
!             POINTER TO GAMMA-CLOUD-CLOUD                                         CLCFPT3A.18    
     &   , IP_CLOVLP_BFF                                                           CLCFPT3A.19    
!             POINTER TO BETA-FREE-FREE                                            CLCFPT3A.20    
     &   , IP_CLOVLP_BFC                                                           CLCFPT3A.21    
!             POINTER TO BETA-FREE-CLOUD                                           CLCFPT3A.22    
     &   , IP_CLOVLP_BCF                                                           CLCFPT3A.23    
!             POINTER TO BETA-CLOUD-FREE                                           CLCFPT3A.24    
     &   , IP_CLOVLP_BCC                                                           CLCFPT3A.25    
!             POINTER TO BETA-CLOUD-CLOUD                                          CLCFPT3A.26    
     &   , IP_CLOVLP_GFM                                                           CLCFPT3A.27    
!             POINTER TO GAMMA_F-                                                  CLCFPT3A.28    
     &   , IP_CLOVLP_GFP                                                           CLCFPT3A.29    
!             POINTER TO GAMMA_F+                                                  CLCFPT3A.30    
     &   , IP_CLOVLP_BFM                                                           CLCFPT3A.31    
!             POINTER TO BETA_F-                                                   CLCFPT3A.32    
     &   , IP_CLOVLP_BFP                                                           CLCFPT3A.33    
!             POINTER TO BETA_F+                                                   CLCFPT3A.34    
     &   , IP_CLOVLP_GM                                                            CLCFPT3A.35    
!             POINTER TO GAMMA_-                                                   CLCFPT3A.36    
     &   , IP_CLOVLP_GP                                                            CLCFPT3A.37    
!             POINTER TO GAMMA_+                                                   CLCFPT3A.38    
     &   , IP_CLOVLP_BM                                                            CLCFPT3A.39    
!             POINTER TO BETA_-                                                    CLCFPT3A.40    
     &   , IP_CLOVLP_BP                                                            CLCFPT3A.41    
!             POINTER TO BETA_+                                                    CLCFPT3A.42    
!                                                                                  CLCFPT3A.43    
!     POINTERS FOR TRIPLE OVERLAPS:                                                CLCFPT3A.44    
      INTEGER                                                                      CLCFPT3A.45    
     &     IP_CLOVLP_V11                                                           CLCFPT3A.46    
     &   , IP_CLOVLP_V12                                                           CLCFPT3A.47    
     &   , IP_CLOVLP_V13                                                           CLCFPT3A.48    
     &   , IP_CLOVLP_V21                                                           CLCFPT3A.49    
     &   , IP_CLOVLP_V22                                                           CLCFPT3A.50    
     &   , IP_CLOVLP_V23                                                           CLCFPT3A.51    
     &   , IP_CLOVLP_V31                                                           CLCFPT3A.52    
     &   , IP_CLOVLP_V32                                                           CLCFPT3A.53    
     &   , IP_CLOVLP_V33                                                           CLCFPT3A.54    
     &   , IP_CLOVLP_U11                                                           CLCFPT3A.55    
     &   , IP_CLOVLP_U12                                                           CLCFPT3A.56    
     &   , IP_CLOVLP_U13                                                           CLCFPT3A.57    
     &   , IP_CLOVLP_U21                                                           CLCFPT3A.58    
     &   , IP_CLOVLP_U22                                                           CLCFPT3A.59    
     &   , IP_CLOVLP_U23                                                           CLCFPT3A.60    
     &   , IP_CLOVLP_U31                                                           CLCFPT3A.61    
     &   , IP_CLOVLP_U32                                                           CLCFPT3A.62    
     &   , IP_CLOVLP_U33                                                           CLCFPT3A.63    
!                                                                                  CLCFPT3A.64    
      PARAMETER(                                                                   CLCFPT3A.65    
     &     IP_CLOVLP_GFF=1                                                         CLCFPT3A.66    
     &   , IP_CLOVLP_GFC=2                                                         CLCFPT3A.67    
     &   , IP_CLOVLP_GCF=3                                                         CLCFPT3A.68    
     &   , IP_CLOVLP_GCC=4                                                         CLCFPT3A.69    
     &   , IP_CLOVLP_BFF=5                                                         CLCFPT3A.70    
     &   , IP_CLOVLP_BFC=6                                                         CLCFPT3A.71    
     &   , IP_CLOVLP_BCF=7                                                         CLCFPT3A.72    
     &   , IP_CLOVLP_BCC=8                                                         CLCFPT3A.73    
     &   , IP_CLOVLP_GFM=5                                                         CLCFPT3A.74    
     &   , IP_CLOVLP_GFP=6                                                         CLCFPT3A.75    
     &   , IP_CLOVLP_BFM=7                                                         CLCFPT3A.76    
     &   , IP_CLOVLP_BFP=8                                                         CLCFPT3A.77    
     &   , IP_CLOVLP_GM=5                                                          CLCFPT3A.78    
     &   , IP_CLOVLP_GP=6                                                          CLCFPT3A.79    
     &   , IP_CLOVLP_BM=7                                                          CLCFPT3A.80    
     &   , IP_CLOVLP_BP=8                                                          CLCFPT3A.81    
     &   )                                                                         CLCFPT3A.82    
!                                                                                  CLCFPT3A.83    
      PARAMETER(                                                                   CLCFPT3A.84    
     &     IP_CLOVLP_V11=1                                                         CLCFPT3A.85    
     &   , IP_CLOVLP_V12=2                                                         CLCFPT3A.86    
     &   , IP_CLOVLP_V13=3                                                         CLCFPT3A.87    
     &   , IP_CLOVLP_V21=4                                                         CLCFPT3A.88    
     &   , IP_CLOVLP_V22=5                                                         CLCFPT3A.89    
     &   , IP_CLOVLP_V23=6                                                         CLCFPT3A.90    
     &   , IP_CLOVLP_V31=7                                                         CLCFPT3A.91    
     &   , IP_CLOVLP_V32=8                                                         CLCFPT3A.92    
     &   , IP_CLOVLP_V33=9                                                         CLCFPT3A.93    
     &   , IP_CLOVLP_U11=10                                                        CLCFPT3A.94    
     &   , IP_CLOVLP_U12=11                                                        CLCFPT3A.95    
     &   , IP_CLOVLP_U13=12                                                        CLCFPT3A.96    
     &   , IP_CLOVLP_U21=13                                                        CLCFPT3A.97    
     &   , IP_CLOVLP_U22=14                                                        CLCFPT3A.98    
     &   , IP_CLOVLP_U23=15                                                        CLCFPT3A.99    
     &   , IP_CLOVLP_U31=16                                                        CLCFPT3A.100   
     &   , IP_CLOVLP_U32=17                                                        CLCFPT3A.101   
     &   , IP_CLOVLP_U33=18                                                        CLCFPT3A.102   
     &   )                                                                         CLCFPT3A.103   
!                                                                                  CLCFPT3A.104   
!     ------------------------------------------------------------------           CLCFPT3A.105   
!                                                                                  RAD_ALL.10718 
!     DUMMY VARIABLES.                                                             RAD_ALL.10719 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.10720 
     &     N_PROFILE                                                               RAD_ALL.10721 
!             NUMBER OF PROFILES                                                   RAD_ALL.10722 
     &   , N_LAYER                                                                 RAD_ALL.10723 
!             NUMBER OF LAYERS                                                     RAD_ALL.10724 
     &   , N_CLOUD_TOP                                                             RAD_ALL.10725 
!             TOP CLOUDY LAYER                                                     RAD_ALL.10726 
     &   , N_CLOUD_TYPE                                                            RAD_ALL.10727 
!             NUMBER OF TYPES OF CLOUDS                                            RAD_ALL.10728 
     &   , N_FREE_PROFILE(NPD_LAYER)                                               RAD_ALL.10729 
!             NUMBER OF FREE PROFILES                                              RAD_ALL.10730 
     &   , I_FREE_PROFILE(NPD_PROFILE, NPD_LAYER)                                  RAD_ALL.10731 
!             INDICES OF FREE PROFILES                                             RAD_ALL.10732 
     &   , N_CLOUD_PROFILE(NPD_LAYER)                                              RAD_ALL.10733 
!             NUMBER OF CLOUDY PROFILES                                            RAD_ALL.10734 
     &   , I_CLOUD_PROFILE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.10735 
!             INDICES OF CLOUDY PROFILES                                           RAD_ALL.10736 
     &   , ISOLIR                                                                  RAD_ALL.10737 
!             SPECTRAL REGION                                                      RAD_ALL.10738 
     &   , I_2STREAM                                                               RAD_ALL.10739 
!             TWO-STREAM SCHEME                                                    RAD_ALL.10740 
     &   , I_SOLVER                                                                RAD_ALL.10741 
!             SOLVER USED                                                          RAD_ALL.10742 
     &   , I_EXTRAPOLATE_MIX_NET                                                   RAD_ALL.10743 
!             METHOD FOR EXTRAPOLATING WITH A MIXED SOLVER                         RAD_ALL.10744 
     &   , I_SOLVER_CLEAR                                                          RAD_ALL.10745 
!             SOLVER FOR CLEAR-SKY FLUXES                                          RAD_ALL.10746 
      INTEGER   !, INTENT(OUT)                                                     RAD_ALL.10747 
     &     IERR                                                                    RAD_ALL.10748 
!             ERROR FLAG                                                           RAD_ALL.10749 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.10750 
     &     L_NET                                                                   RAD_ALL.10751 
!             CALCULATE NET FLUXES                                                 RAD_ALL.10752 
     &   , L_CLEAR                                                                 RAD_ALL.10753 
!             CALCULATE CLEAR-SKY FLUXES                                           RAD_ALL.10754 
     &   , L_SCALE_SOLAR                                                           RAD_ALL.10755 
!             FLAG TO SCALE SOLAR                                                  RAD_ALL.10756 
     &   , L_IR_SOURCE_QUAD                                                        RAD_ALL.10757 
!             USE QUADRATIC SOURCE TERM                                            RAD_ALL.10758 
     &   , L_2_STREAM_CORRECT                                                      RAD_ALL.10759 
!             EDGE CORRECTION TO 2-STREAM                                          RAD_ALL.10760 
!                                                                                  RAD_ALL.10761 
!     OPTICAL PROPERTIES:                                                          RAD_ALL.10762 
      REAL      !, INTENT(IN)                                                      RAD_ALL.10763 
     &     TAU_FREE(NPD_PROFILE, NPD_LAYER)                                        RAD_ALL.10764 
!             FREE OPTICAL DEPTH                                                   RAD_ALL.10765 
     &   , OMEGA_FREE(NPD_PROFILE, NPD_LAYER)                                      RAD_ALL.10766 
!             FREE ALBEDO OF SINGLE SCATTERING                                     RAD_ALL.10767 
     &   , ASYMMETRY_FREE(NPD_PROFILE, NPD_LAYER)                                  RAD_ALL.10768 
!             CLEAR-SKY ASYMMETRY                                                  RAD_ALL.10769 
     &   , TAU_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                       RAD_ALL.10770 
!             CLOUDY OPTICAL DEPTH                                                 RAD_ALL.10771 
     &   , OMEGA_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                     RAD_ALL.10772 
!             CLOUDY ALBEDO OF SINGLE SCATTERING                                   RAD_ALL.10773 
     &   , ASYMMETRY_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                 RAD_ALL.10774 
!             CLOUDY ASYMMETRY                                                     RAD_ALL.10775 
!                                                                                  RAD_ALL.10776 
!     CLOUD GEOMETRY:                                                              RAD_ALL.10777 
      REAL      !, INTENT(IN)                                                      RAD_ALL.10778 
     &     W_CLOUD(NPD_PROFILE, NPD_LAYER)                                         RAD_ALL.10779 
!             CLOUDY FRACTIONS IN EACH LAYER                                       RAD_ALL.10780 
     &   , W_FREE(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.10781 
!             CLEAR SKY FRACTIONS IN EACH LAYER                                    RAD_ALL.10782 
     &   , FRAC_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                      RAD_ALL.10783 
!             FRACTIONS OF DIFFERENT TYPES OF CLOUD                                RAD_ALL.10784 
     &   , CLOUD_OVERLAP(NPD_PROFILE, 0: NPD_LAYER, NPD_OVERLAP_COEFF)             RAD_ALL.10785 
!             ENERGY TRANSFER COEFFICIENTS                                         RAD_ALL.10786 
      REAL      !, INTENT(IN)                                                      RAD_ALL.10787 
     &     SEC_0(NPD_PROFILE)                                                      RAD_ALL.10788 
!             SECANT OF SOLAR ZENITH ANGLE                                         RAD_ALL.10789 
     &   , ALBEDO_SURFACE_DIFF(NPD_PROFILE)                                        RAD_ALL.10790 
!             DIFFUSE ALBEDO                                                       RAD_ALL.10791 
     &   , ALBEDO_SURFACE_DIR(NPD_PROFILE)                                         RAD_ALL.10792 
!             DIRECT ALBEDO                                                        RAD_ALL.10793 
     &   , FLUX_INC_DOWN(NPD_PROFILE)                                              RAD_ALL.10794 
!             INCIDENT TOTAL FLUX                                                  RAD_ALL.10795 
     &   , FLUX_INC_DIRECT(NPD_PROFILE)                                            RAD_ALL.10796 
!             INCIDENT DIRECT FLUX                                                 RAD_ALL.10797 
     &   , DIFF_PLANCK(NPD_PROFILE, NPD_LAYER)                                     RAD_ALL.10798 
!             CHANGE IN PLANCK FUNCTION                                            RAD_ALL.10799 
     &   , SOURCE_GROUND(NPD_PROFILE)                                              RAD_ALL.10800 
!             FLUX FROM SURFACE                                                    RAD_ALL.10801 
     &   , ADJUST_SOLAR_KE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.10802 
!             ADJUSTMENT OF SOLAR BEAM WITH EQUIVALENT EXTINCTION                  RAD_ALL.10803 
     &   , DIFF_PLANCK_2(NPD_PROFILE, NPD_LAYER)                                   RAD_ALL.10804 
!             2x2ND DIFFERENCE OF PLANCKIAN                                        RAD_ALL.10805 
     &   , PLANCK_SOURCE(NPD_PROFILE, 0: NPD_LAYER)                                RAD_ALL.10806 
!             PLANCKIAN SOURCE FUNCTION                                            RAD_ALL.10807 
     &   , GROUND_EMISSION(NPD_PROFILE)                                            RAD_ALL.10808 
!             TOTAL FLUX EMITTED FROM GROUND                                       RAD_ALL.10809 
!                                                                                  RAD_ALL.10810 
!     FLUXES CALCULATED                                                            RAD_ALL.10811 
      REAL      !, INTENT(OUT)                                                     RAD_ALL.10812 
     &     FLUX_DIRECT(NPD_PROFILE, 0: NPD_LAYER)                                  RAD_ALL.10813 
!             DIRECT FLUX                                                          RAD_ALL.10814 
     &   , FLUX_TOTAL(NPD_PROFILE, 2*NPD_LAYER+2)                                  RAD_ALL.10815 
!             LONG FLUX VECTOR                                                     RAD_ALL.10816 
     &   , FLUX_DIRECT_CLEAR(NPD_PROFILE, 0: NPD_LAYER)                            RAD_ALL.10817 
!             CLEAR DIRECT FLUX                                                    RAD_ALL.10818 
     &   , FLUX_TOTAL_CLEAR(NPD_PROFILE, 2*NPD_LAYER+2)                            RAD_ALL.10819 
!             CLEAR TOTAL FLUX                                                     RAD_ALL.10820 
!                                                                                  RAD_ALL.10821 
!                                                                                  RAD_ALL.10822 
!                                                                                  RAD_ALL.10823 
!     LOCAL VARIABALES.                                                            RAD_ALL.10824 
      INTEGER                                                                      RAD_ALL.10825 
     &     N_SOURCE_COEFF                                                          RAD_ALL.10826 
!             NUMBER OF SOURCE COEFFICIENTS                                        RAD_ALL.10827 
     &   , N_EQUATION                                                              RAD_ALL.10828 
!             NUMBER OF EQUATIONS                                                  RAD_ALL.10829 
     &   , I                                                                       RAD_ALL.10830 
!             LOOP VARIABLE                                                        RAD_ALL.10831 
     &   , L                                                                       RAD_ALL.10832 
!             LOOP VARIABLE                                                        RAD_ALL.10833 
!                                                                                  RAD_ALL.10834 
!                                                                                  RAD_ALL.10835 
!     CLEAR-SKY COEFFICIENTS:                                                      RAD_ALL.10836 
      REAL                                                                         RAD_ALL.10837 
     &     TRANS_FREE(NPD_PROFILE, NPD_LAYER)                                      RAD_ALL.10838 
!             FREE TRANSMISSION OF LAYER                                           RAD_ALL.10839 
     &   , REFLECT_FREE(NPD_PROFILE, NPD_LAYER)                                    RAD_ALL.10840 
!             FREE REFLECTANCE OF LAYER                                            RAD_ALL.10841 
     &   , TRANS_0_FREE(NPD_PROFILE, NPD_LAYER)                                    RAD_ALL.10842 
!             FREE DIRECT TRANSMISSION OF LAYER                                    RAD_ALL.10843 
     &   , SOURCE_COEFF_FREE(NPD_PROFILE, NPD_LAYER, NPD_SOURCE_COEFF)             RAD_ALL.10844 
!             FREE SOURCE COEFFICIENTS                                             RAD_ALL.10845 
     &   , S_DOWN_FREE(NPD_PROFILE, NPD_LAYER)                                     RAD_ALL.10846 
!             FREE DOWNWARD SOURCE                                                 RAD_ALL.10847 
     &   , S_UP_FREE(NPD_PROFILE, NPD_LAYER)                                       RAD_ALL.10848 
!             FREE UPWARD SOURCE                                                   RAD_ALL.10849 
     &   , S_DOWN_CLEAR(NPD_PROFILE, NPD_LAYER)                                    RAD_ALL.10850 
!             CLEAR DOWNWARD SOURCE                                                RAD_ALL.10851 
     &   , S_UP_CLEAR(NPD_PROFILE, NPD_LAYER)                                      RAD_ALL.10852 
!             CLEAR UPWARD SOURCE                                                  RAD_ALL.10853 
!                                                                                  RAD_ALL.10854 
!     CLOUDY COEFFICIENTS:                                                         RAD_ALL.10855 
      REAL                                                                         RAD_ALL.10856 
     &     TRANS_CLOUD(NPD_PROFILE, NPD_LAYER)                                     RAD_ALL.10857 
!             CLOUDY TRANSMISSION OF LAYER                                         RAD_ALL.10858 
     &   , REFLECT_CLOUD(NPD_PROFILE, NPD_LAYER)                                   RAD_ALL.10859 
!             CLOUDY REFLECTANCE OF LAYER                                          RAD_ALL.10860 
     &   , TRANS_0_CLOUD(NPD_PROFILE, NPD_LAYER)                                   RAD_ALL.10861 
!             CLOUDY DIRECT TRANSMISSION OF LAYER                                  RAD_ALL.10862 
     &   , SOURCE_COEFF_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_SOURCE_COEFF)            RAD_ALL.10863 
!             CLOUDY SOURCE COEFFICIENTS                                           RAD_ALL.10864 
     &   , S_DOWN_CLOUD(NPD_PROFILE, NPD_LAYER)                                    RAD_ALL.10865 
!             CLOUDY DOWNWARD SOURCE                                               RAD_ALL.10866 
     &   , S_UP_CLOUD(NPD_PROFILE, NPD_LAYER)                                      RAD_ALL.10867 
!             CLOUDY UPWARD SOURCE                                                 RAD_ALL.10868 
!                                                                                  RAD_ALL.10869 
!     SOURCE FUNCTIONS AT THE CROUND                                               RAD_ALL.10870 
      REAL                                                                         RAD_ALL.10871 
     &     SOURCE_GROUND_FREE(NPD_PROFILE)                                         RAD_ALL.10872 
!             SOURCE FROM GROUND UNDER CLEAR SKIES                                 RAD_ALL.10873 
     &   , SOURCE_GROUND_CLOUD(NPD_PROFILE)                                        RAD_ALL.10874 
!             SOURCE FROM GROUND UNDER CLOUDY SKIES                                RAD_ALL.10875 
     &   , FLUX_DIRECT_GROUND_CLOUD(NPD_PROFILE)                                   RAD_ALL.10876 
!             DIRECT FLUX AT GROUND UNDER CLOUDY SKIES                             RAD_ALL.10877 
!                                                                                  RAD_ALL.10878 
!     VARIABLES FOR DEALING WITH ILL-CONDITIONING:                                 RAD_ALL.10879 
      LOGICAL                                                                      RAD_ALL.10880 
     &     L_SET_MIX_EXTRAPOLATE                                                   RAD_ALL.10881 
!             FUNCTION FOR CHOOSING METHOD OF EXTRAPOLATION                        RAD_ALL.10882 
      REAL                                                                         RAD_ALL.10883 
     &     TOL_CLOUD                                                               RAD_ALL.10884 
!             TOLERANCE FOR RESTORING CONDITIONING                                 RAD_ALL.10885 
     &   , FLUX_TOTAL_2(NPD_PROFILE, 2*NPD_LAYER+2)                                RAD_ALL.10886 
!             SECOND TOTAL FLUX ARRAY                                              RAD_ALL.10887 
!                                                                                  RAD_ALL.10888 
!                                                                                  RAD_ALL.10889 
!     NUMERICAL ARRAYS:                                                            RAD_ALL.10890 
      REAL                                                                         RAD_ALL.10891 
     &     A5(NPD_PROFILE, 5, 2*NPD_LAYER+2)                                       RAD_ALL.10892 
!             PENTADIAGONAL MATRIX                                                 RAD_ALL.10893 
     &   , B(NPD_PROFILE, 2*NPD_LAYER+2)                                           RAD_ALL.10894 
!             RHS OF MATRIX EQUATION                                               RAD_ALL.10895 
     &   , WORK(NPD_PROFILE)                                                       RAD_ALL.10896 
!             WORKING ARRAY FOR SOLVER                                             RAD_ALL.10897 
!                                                                                  RAD_ALL.10898 
!     FUNCTIONS CALLED:                                                            RAD_ALL.10899 
      INTEGER                                                                      RAD_ALL.10900 
     &     SET_N_SOURCE_COEFF                                                      RAD_ALL.10901 
!             FUNCTION TO SET NUMBER OF SOURCE COEFFICIENTS                        RAD_ALL.10902 
!                                                                                  RAD_ALL.10903 
!     SUBROUTINES CALLED:                                                          RAD_ALL.10904 
      EXTERNAL                                                                     RAD_ALL.10905 
     &     TWO_COEFF, TWO_COEFF_CLOUD, IR_SOURCE, MIXED_SOLAR_SOURCE               RAD_ALL.10906 
     &   , L_SET_MIX_EXTRAPOLATE, MIX_NET_MATRIX, BAND_SOLVER                      RAD_ALL.10907 
     &   , MIX_SUM_MATRIX, MIX_COLUMN_FULL, MIX_APP_SCAT                           RAD_ALL.10908 
     &   , CLEAR_SUPPLEMENT                                                        RAD_ALL.10909 
!                                                                                  RAD_ALL.10910 
!                                                                                  RAD_ALL.10911 
!                                                                                  RAD_ALL.10912 
!     CALCULATE THE TRANSMISSION AND REFLECTION COEFFICIENTS AND                   RAD_ALL.10913 
!     SOURCE TERMS FOR THE CLEAR AND CLOUDY PARTS OF THE COLUMN                    RAD_ALL.10914 
!                                                                                  RAD_ALL.10915 
!     SET THE NUMBER OF SOURCE COEFFICIENTS FOR THE APPROXIMATION                  RAD_ALL.10916 
      N_SOURCE_COEFF=SET_N_SOURCE_COEFF(ISOLIR, L_IR_SOURCE_QUAD)                  RAD_ALL.10917 
!                                                                                  RAD_ALL.10918 
      CALL TWO_COEFF(IERR                                                          RAD_ALL.10919 
     &   , N_PROFILE, 1, N_LAYER                                                   RAD_ALL.10920 
     &   , I_2STREAM, L_IR_SOURCE_QUAD                                             RAD_ALL.10921 
     &   , ASYMMETRY_FREE, OMEGA_FREE, TAU_FREE                                    RAD_ALL.10922 
     &   , ISOLIR, SEC_0                                                           RAD_ALL.10923 
     &   , TRANS_FREE, REFLECT_FREE, TRANS_0_FREE                                  RAD_ALL.10924 
     &   , SOURCE_COEFF_FREE                                                       RAD_ALL.10925 
     &   , NPD_PROFILE, NPD_LAYER                                                  RAD_ALL.10926 
     &   )                                                                         RAD_ALL.10927 
      IF (IERR.NE.I_NORMAL) RETURN                                                 RAD_ALL.10928 
!                                                                                  RAD_ALL.10929 
!                                                                                  RAD_ALL.10930 
!     INFRA-RED SOURCE TERMS DEPEND ONLY ON THE LAYER AND MAY BE                   RAD_ALL.10931 
!     CALCULATED NOW. SOLAR TERMS DEPEND ON CONDITIONS IN CLOUD                    RAD_ALL.10932 
!     IN OVERLYING LAYERS AND MUST BE CALCULATED LATER.                            RAD_ALL.10933 
!                                                                                  RAD_ALL.10934 
      IF (ISOLIR.EQ.IP_INFRA_RED) THEN                                             RAD_ALL.10935 
!                                                                                  RAD_ALL.10936 
         CALL IR_SOURCE(N_PROFILE, 1, N_LAYER                                      RAD_ALL.10937 
     &      , SOURCE_COEFF_FREE, DIFF_PLANCK                                       RAD_ALL.10938 
     &      , L_IR_SOURCE_QUAD, DIFF_PLANCK_2                                      RAD_ALL.10939 
     &      , L_2_STREAM_CORRECT, PLANCK_SOURCE                                    RAD_ALL.10940 
     &      , GROUND_EMISSION, N_LAYER                                             RAD_ALL.10941 
     &      , TAU_FREE, TRANS_FREE                                                 RAD_ALL.10942 
     &      , S_DOWN_FREE, S_UP_FREE                                               RAD_ALL.10943 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.10944 
     &      )                                                                      RAD_ALL.10945 
!                                                                                  RAD_ALL.10946 
!        IF A CLEAR-SKY CALCULATION IS REQUIRED THESE SOURCE TERMS MUST            RAD_ALL.10947 
!        BE STORED.                                                                RAD_ALL.10948 
         IF (L_CLEAR) THEN                                                         RAD_ALL.10949 
            DO I=1, N_LAYER                                                        RAD_ALL.10950 
               DO L=1, N_PROFILE                                                   RAD_ALL.10951 
                  S_DOWN_CLEAR(L, I)=S_DOWN_FREE(L, I)                             RAD_ALL.10952 
                  S_UP_CLEAR(L, I)=S_UP_FREE(L, I)                                 RAD_ALL.10953 
               ENDDO                                                               RAD_ALL.10954 
            ENDDO                                                                  RAD_ALL.10955 
         ENDIF                                                                     RAD_ALL.10956 
!                                                                                  RAD_ALL.10957 
!        SCALE THE SOURCES BY THE CLEAR-SKY FRACTIONS IN THE CLOUDY                RAD_ALL.10958 
!        LAYERS. IN HIGHER LAYERS THE CLEAR-SKY FRACTION IS 1.                     RAD_ALL.10959 
         DO I=N_CLOUD_TOP, N_LAYER                                                 RAD_ALL.10960 
            DO L=1, N_PROFILE                                                      RAD_ALL.10961 
               S_DOWN_FREE(L, I)=W_FREE(L, I)*S_DOWN_FREE(L, I)                    RAD_ALL.10962 
               S_UP_FREE(L, I)=W_FREE(L, I)*S_UP_FREE(L, I)                        RAD_ALL.10963 
            ENDDO                                                                  RAD_ALL.10964 
         ENDDO                                                                     RAD_ALL.10965 
!                                                                                  RAD_ALL.10966 
      ENDIF                                                                        RAD_ALL.10967 
!                                                                                  RAD_ALL.10968 
!                                                                                  RAD_ALL.10969 
!                                                                                  RAD_ALL.10970 
!     REPEAT THE CALCULATION FOR CLOUDY REGIONS.                                   RAD_ALL.10971 
!                                                                                  RAD_ALL.10972 
!                                                                                  RAD_ALL.10973 
      CALL TWO_COEFF_CLOUD(IERR                                                    RAD_ALL.10974 
     &   , N_PROFILE, N_CLOUD_TOP, N_LAYER                                         RAD_ALL.10975 
     &   , I_2STREAM, L_IR_SOURCE_QUAD, N_SOURCE_COEFF                             RAD_ALL.10976 
     &   , N_CLOUD_TYPE, FRAC_CLOUD                                                RAD_ALL.10977 
     &   , ASYMMETRY_CLOUD, OMEGA_CLOUD, TAU_CLOUD                                 RAD_ALL.10978 
     &   , ISOLIR, SEC_0                                                           RAD_ALL.10979 
     &   , TRANS_CLOUD, REFLECT_CLOUD, TRANS_0_CLOUD                               RAD_ALL.10980 
     &   , SOURCE_COEFF_CLOUD                                                      RAD_ALL.10981 
     &   , NPD_PROFILE, NPD_LAYER                                                  RAD_ALL.10982 
     &   )                                                                         RAD_ALL.10983 
      IF (IERR.NE.I_NORMAL) RETURN                                                 RAD_ALL.10984 
!                                                                                  RAD_ALL.10985 
!                                                                                  RAD_ALL.10986 
      IF (ISOLIR.EQ.IP_INFRA_RED) THEN                                             RAD_ALL.10987 
!                                                                                  RAD_ALL.10988 
!        EDGE CORRECTIONS FOR THE TWO-STREAM EQUATIONS DO NOT                      RAD_ALL.10989 
!        REALLY FIT WITH THIS METHOD OF TREATING CLOUDS. OPTICAL                   RAD_ALL.10990 
!        DEPTHS AND TRANSMISSIONS MUST BE PASSED TO THE SUBROUTINE                 RAD_ALL.10991 
!        TO FILL THE ARGUMENT LIST, BUT IT IS NOT INTENDED THAT                    RAD_ALL.10992 
!        THESE ARRAYS WILL BE USED.                                                RAD_ALL.10993 
!                                                                                  RAD_ALL.10994 
         CALL IR_SOURCE(N_PROFILE, N_CLOUD_TOP, N_LAYER                            RAD_ALL.10995 
     &      , SOURCE_COEFF_CLOUD, DIFF_PLANCK                                      RAD_ALL.10996 
     &      , L_IR_SOURCE_QUAD, DIFF_PLANCK_2                                      RAD_ALL.10997 
     &      , L_2_STREAM_CORRECT, PLANCK_SOURCE                                    RAD_ALL.10998 
     &      , GROUND_EMISSION, N_LAYER                                             RAD_ALL.10999 
     &      , TAU_CLOUD, TRANS_CLOUD                                               RAD_ALL.11000 
     &      , S_DOWN_CLOUD, S_UP_CLOUD                                             RAD_ALL.11001 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.11002 
     &      )                                                                      RAD_ALL.11003 
!                                                                                  RAD_ALL.11004 
!                                                                                  RAD_ALL.11005 
         DO I=N_CLOUD_TOP, N_LAYER                                                 RAD_ALL.11006 
            DO L=1, N_PROFILE                                                      RAD_ALL.11007 
               S_DOWN_CLOUD(L, I)=W_CLOUD(L, I)*S_DOWN_CLOUD(L, I)                 RAD_ALL.11008 
               S_UP_CLOUD(L, I)=W_CLOUD(L, I)*S_UP_CLOUD(L, I)                     RAD_ALL.11009 
            ENDDO                                                                  RAD_ALL.11010 
         ENDDO                                                                     RAD_ALL.11011 
!                                                                                  RAD_ALL.11012 
      ENDIF                                                                        RAD_ALL.11013 
!                                                                                  RAD_ALL.11014 
!                                                                                  RAD_ALL.11015 
!     CALCULATE THE APPROPRIATE SOURCE TERMS FOR THE SOLAR: CLOUDY                 RAD_ALL.11016 
!     AND CLEAR PROPERTIES ARE BOTH NEEDED HERE.                                   RAD_ALL.11017 
!                                                                                  RAD_ALL.11018 
      IF (ISOLIR.EQ.IP_SOLAR) THEN                                                 RAD_ALL.11019 
!                                                                                  RAD_ALL.11020 
         CALL MIXED_SOLAR_SOURCE(N_PROFILE, N_LAYER, N_CLOUD_TOP                   RAD_ALL.11021 
     &      , FLUX_INC_DIRECT                                                      RAD_ALL.11022 
     &      , L_SCALE_SOLAR, ADJUST_SOLAR_KE                                       RAD_ALL.11023 
     &      , TRANS_0_FREE, SOURCE_COEFF_FREE                                      RAD_ALL.11024 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GFF)                                   RAD_ALL.11025 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GFC)                                   RAD_ALL.11026 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GCF)                                   RAD_ALL.11027 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GCC)                                   RAD_ALL.11028 
     &      , TRANS_0_CLOUD, SOURCE_COEFF_CLOUD                                    RAD_ALL.11029 
     &      , FLUX_DIRECT                                                          RAD_ALL.11030 
     &      , FLUX_DIRECT_GROUND_CLOUD                                             RAD_ALL.11031 
     &      , S_UP_FREE, S_DOWN_FREE                                               RAD_ALL.11032 
     &      , S_UP_CLOUD, S_DOWN_CLOUD                                             RAD_ALL.11033 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.11034 
     &   )                                                                         RAD_ALL.11035 
      ENDIF                                                                        RAD_ALL.11036 
!                                                                                  RAD_ALL.11037 
!                                                                                  RAD_ALL.11038 
!                                                                                  RAD_ALL.11039 
!     FORMULATE THE MATRIX EQUATION FOR THE FLUXES.                                RAD_ALL.11040 
!                                                                                  RAD_ALL.11041 
      IF (I_SOLVER.EQ.IP_SOLVER_MIX_NET) THEN                                      RAD_ALL.11042 
!                                                                                  RAD_ALL.11043 
!        TO AVOID NUMERICAL INSTABILITY WHEN SOLVING FOR NET FLUXES                RAD_ALL.11044 
!        ALONE A SMALL AMOUNT OF ABSORPTION MUST BE INTRODUCED. THIS               RAD_ALL.11045 
!        IS THE ROLE OF TOL_CLOUD: IT IS DEFINED FROM THE TOLERANCE                RAD_ALL.11046 
!        AVAILABLE ON THE MACHINE. FOR SOME APPLICATIONS THIS                      RAD_ALL.11047 
!        ABSORPTION MAY BE TOO LARGE AND AN EXTRAPOLATION IS USED TO               RAD_ALL.11048 
!        INFER THE LIMITING VALUE.                                                 RAD_ALL.11049 
!                                                                                  RAD_ALL.11050 
         TOL_CLOUD=4.0E+01*SQRT_TOL_MACHINE                                        RAD_ALL.11051 
!                                                                                  RAD_ALL.11052 
         CALL MIX_NET_MATRIX(N_PROFILE, N_LAYER, N_CLOUD_TOP                       RAD_ALL.11053 
     &      , TRANS_FREE, REFLECT_FREE                                             RAD_ALL.11054 
     &      , TRANS_CLOUD, REFLECT_CLOUD                                           RAD_ALL.11055 
     &      , S_UP_FREE, S_DOWN_FREE, S_UP_CLOUD, S_DOWN_CLOUD                     RAD_ALL.11056 
     &      , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR, SOURCE_GROUND               RAD_ALL.11057 
     &      , FLUX_DIRECT(1, N_LAYER)                                              RAD_ALL.11058 
     &      , FLUX_INC_DOWN                                                        RAD_ALL.11059 
     &      , N_FREE_PROFILE, I_FREE_PROFILE                                       RAD_ALL.11060 
     &      , N_CLOUD_PROFILE, I_CLOUD_PROFILE                                     RAD_ALL.11061 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GM)                                    RAD_ALL.11062 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GP)                                    RAD_ALL.11063 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BM)                                    RAD_ALL.11064 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BP)                                    RAD_ALL.11065 
     &      , TOL_CLOUD                                                            RAD_ALL.11066 
     &      , A5, B                                                                RAD_ALL.11067 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.11068 
     &      )                                                                      RAD_ALL.11069 
!                                                                                  RAD_ALL.11070 
         N_EQUATION=N_LAYER+1                                                      RAD_ALL.11071 
!                                                                                  RAD_ALL.11072 
!        SOLVE THE SET OF EQUATIONS PRODUCED.                                      RAD_ALL.11073 
         CALL BAND_SOLVER(N_PROFILE, N_EQUATION                                    RAD_ALL.11074 
     &      , 2, 2                                                                 RAD_ALL.11075 
     &      , A5, B                                                                RAD_ALL.11076 
     &      , FLUX_TOTAL                                                           RAD_ALL.11077 
     &      , NPD_PROFILE, 2*NPD_LAYER+2                                           RAD_ALL.11078 
     &      , WORK                                                                 RAD_ALL.11079 
     &      )                                                                      RAD_ALL.11080 
!                                                                                  RAD_ALL.11081 
         IF (L_SET_MIX_EXTRAPOLATE(I_EXTRAPOLATE_MIX_NET)) THEN                    RAD_ALL.11082 
!                                                                                  RAD_ALL.11083 
!           RECALCULATE THE FLUXES WITH THE PERTURBATION DOUBLED.                  RAD_ALL.11084 
            TOL_CLOUD=2.0E+00*TOL_CLOUD                                            RAD_ALL.11085 
!                                                                                  RAD_ALL.11086 
            CALL MIX_NET_MATRIX(N_PROFILE, N_LAYER, N_CLOUD_TOP                    RAD_ALL.11087 
     &         , TRANS_FREE, REFLECT_FREE                                          RAD_ALL.11088 
     &         , TRANS_CLOUD, REFLECT_CLOUD                                        RAD_ALL.11089 
     &         , S_UP_FREE, S_DOWN_FREE, S_UP_CLOUD, S_DOWN_CLOUD                  RAD_ALL.11090 
     &         , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR, SOURCE_GROUND            RAD_ALL.11091 
     &         , FLUX_DIRECT(1, N_LAYER)                                           RAD_ALL.11092 
     &         , FLUX_INC_DOWN                                                     RAD_ALL.11093 
     &         , N_FREE_PROFILE, I_FREE_PROFILE                                    RAD_ALL.11094 
     &         , N_CLOUD_PROFILE, I_CLOUD_PROFILE                                  RAD_ALL.11095 
     &         , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GM)                                 RAD_ALL.11096 
     &         , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GP)                                 RAD_ALL.11097 
     &         , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BM)                                 RAD_ALL.11098 
     &         , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BP)                                 RAD_ALL.11099 
     &         , TOL_CLOUD                                                         RAD_ALL.11100 
     &         , A5, B                                                             RAD_ALL.11101 
     &         , NPD_PROFILE, NPD_LAYER                                            RAD_ALL.11102 
     &         )                                                                   RAD_ALL.11103 
!                                                                                  RAD_ALL.11104 
            N_EQUATION=N_LAYER+1                                                   RAD_ALL.11105 
!                                                                                  RAD_ALL.11106 
!           SOLVE THE SET OF EQUATIONS PRODUCED.                                   RAD_ALL.11107 
            CALL BAND_SOLVER(N_PROFILE, N_EQUATION                                 RAD_ALL.11108 
     &         , 2, 2                                                              RAD_ALL.11109 
     &         , A5, B                                                             RAD_ALL.11110 
     &         , FLUX_TOTAL_2                                                      RAD_ALL.11111 
     &         , NPD_PROFILE, 2*NPD_LAYER+2                                        RAD_ALL.11112 
     &         , WORK                                                              RAD_ALL.11113 
     &         )                                                                   RAD_ALL.11114 
!                                                                                  RAD_ALL.11115 
!           EXTRAPOLATE TO THE LIMITING VALUE.                                     RAD_ALL.11116 
            DO I=1, N_LAYER+1                                                      RAD_ALL.11117 
               DO L=1, N_PROFILE                                                   RAD_ALL.11118 
                  FLUX_TOTAL(L, I)=2.0E+00*FLUX_TOTAL(L, I)                        RAD_ALL.11119 
     &               -FLUX_TOTAL_2(L, I)                                           RAD_ALL.11120 
               ENDDO                                                               RAD_ALL.11121 
            ENDDO                                                                  RAD_ALL.11122 
!                                                                                  RAD_ALL.11123 
         ENDIF                                                                     RAD_ALL.11124 
!                                                                                  RAD_ALL.11125 
      ELSE IF ( (I_SOLVER.EQ.IP_SOLVER_MIX_APP_SCAT).OR.                           RAD_ALL.11126 
     &          (I_SOLVER.EQ.IP_SOLVER_MIX_NET_APP_SCAT) ) THEN                    RAD_ALL.11127 
!                                                                                  RAD_ALL.11128 
         CALL MIX_APP_SCAT(N_PROFILE, N_LAYER, N_CLOUD_TOP                         RAD_ALL.11129 
     &      , TRANS_FREE, REFLECT_FREE, S_DOWN_FREE, S_UP_FREE                     RAD_ALL.11130 
     &      , TRANS_CLOUD, REFLECT_CLOUD                                           RAD_ALL.11131 
     &      , S_DOWN_CLOUD, S_UP_CLOUD                                             RAD_ALL.11132 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GFF)                                   RAD_ALL.11133 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GFC)                                   RAD_ALL.11134 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GCF)                                   RAD_ALL.11135 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GCC)                                   RAD_ALL.11136 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BFF)                                   RAD_ALL.11137 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BFC)                                   RAD_ALL.11138 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BCF)                                   RAD_ALL.11139 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BCC)                                   RAD_ALL.11140 
     &      , L_NET                                                                RAD_ALL.11141 
     &      , FLUX_INC_DOWN                                                        RAD_ALL.11142 
     &      , SOURCE_GROUND, ALBEDO_SURFACE_DIFF                                   RAD_ALL.11143 
     &      , FLUX_TOTAL                                                           RAD_ALL.11144 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.11145 
     &      )                                                                      RAD_ALL.11146 
!                                                                                  RAD_ALL.11147 
      ELSE IF ( (I_SOLVER.EQ.IP_SOLVER_MIX_DIRECT).OR.                             RAD_ALL.11148 
     &          (I_SOLVER.EQ.IP_SOLVER_MIX_DIRECT_NET) ) THEN                      RAD_ALL.11149 
!                                                                                  RAD_ALL.11150 
!        SET THE PARTITIONED SOURCE FUNCTIONS AT THE GROUND.                       RAD_ALL.11151 
         IF (ISOLIR.EQ.IP_SOLAR) THEN                                              RAD_ALL.11152 
            DO L=1, N_PROFILE                                                      RAD_ALL.11153 
               SOURCE_GROUND_FREE(L)=(ALBEDO_SURFACE_DIR(L)                        RAD_ALL.11154 
     &            -ALBEDO_SURFACE_DIFF(L))                                         RAD_ALL.11155 
     &            *(FLUX_DIRECT(L, N_LAYER)                                        RAD_ALL.11156 
     &            -FLUX_DIRECT_GROUND_CLOUD(L))                                    RAD_ALL.11157 
               SOURCE_GROUND_CLOUD(L)=(ALBEDO_SURFACE_DIR(L)                       RAD_ALL.11158 
     &            -ALBEDO_SURFACE_DIFF(L))                                         RAD_ALL.11159 
     &            *FLUX_DIRECT_GROUND_CLOUD(L)                                     RAD_ALL.11160 
            ENDDO                                                                  RAD_ALL.11161 
         ELSE                                                                      RAD_ALL.11162 
            DO L=1, N_PROFILE                                                      RAD_ALL.11163 
               SOURCE_GROUND_FREE(L)                                               RAD_ALL.11164 
     &            =CLOUD_OVERLAP(L, N_LAYER, IP_CLOVLP_BFF)                        RAD_ALL.11165 
     &            *SOURCE_GROUND(L)                                                RAD_ALL.11166 
               SOURCE_GROUND_CLOUD(L)                                              RAD_ALL.11167 
     &            =CLOUD_OVERLAP(L, N_LAYER, IP_CLOVLP_BCF)                        RAD_ALL.11168 
     &            *SOURCE_GROUND(L)                                                RAD_ALL.11169 
            ENDDO                                                                  RAD_ALL.11170 
         ENDIF                                                                     RAD_ALL.11171 
!                                                                                  RAD_ALL.11172 
         CALL SOLVER_MIX_DIRECT(N_PROFILE, N_LAYER, N_CLOUD_TOP                    RAD_ALL.11173 
     &      , TRANS_FREE, REFLECT_FREE, S_DOWN_FREE, S_UP_FREE                     RAD_ALL.11174 
     &      , TRANS_CLOUD, REFLECT_CLOUD                                           RAD_ALL.11175 
     &      , S_DOWN_CLOUD, S_UP_CLOUD                                             RAD_ALL.11176 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GFF)                                   RAD_ALL.11177 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GFC)                                   RAD_ALL.11178 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GCF)                                   RAD_ALL.11179 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GCC)                                   RAD_ALL.11180 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BFF)                                   RAD_ALL.11181 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BFC)                                   RAD_ALL.11182 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BCF)                                   RAD_ALL.11183 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BCC)                                   RAD_ALL.11184 
     &      , L_NET                                                                RAD_ALL.11185 
     &      , FLUX_INC_DOWN                                                        RAD_ALL.11186 
     &      , SOURCE_GROUND_FREE, SOURCE_GROUND_CLOUD                              RAD_ALL.11187 
     &      , ALBEDO_SURFACE_DIFF                                                  RAD_ALL.11188 
     &      , FLUX_TOTAL                                                           RAD_ALL.11189 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.11190 
     &      )                                                                      RAD_ALL.11191 
!                                                                                  RAD_ALL.11192 
      ELSE IF (I_SOLVER.EQ.IP_SOLVER_MIX_FULL) THEN                                RAD_ALL.11193 
!                                                                                  RAD_ALL.11194 
         CALL MIX_SUM_MATRIX(N_PROFILE, N_LAYER, N_CLOUD_TOP                       RAD_ALL.11195 
     &      , TRANS_FREE, REFLECT_FREE                                             RAD_ALL.11196 
     &      , TRANS_CLOUD, REFLECT_CLOUD                                           RAD_ALL.11197 
     &      , S_UP_FREE, S_DOWN_FREE, S_UP_CLOUD, S_DOWN_CLOUD                     RAD_ALL.11198 
     &      , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR, SOURCE_GROUND               RAD_ALL.11199 
     &      , FLUX_DIRECT(1, N_LAYER)                                              RAD_ALL.11200 
     &      , FLUX_INC_DOWN                                                        RAD_ALL.11201 
     &      , N_FREE_PROFILE, I_FREE_PROFILE                                       RAD_ALL.11202 
     &      , N_CLOUD_PROFILE, I_CLOUD_PROFILE                                     RAD_ALL.11203 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GFM)                                   RAD_ALL.11204 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GFP)                                   RAD_ALL.11205 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BFM)                                   RAD_ALL.11206 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BFP)                                   RAD_ALL.11207 
     &      , A5, B                                                                RAD_ALL.11208 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.11209 
     &      )                                                                      RAD_ALL.11210 
!                                                                                  RAD_ALL.11211 
         N_EQUATION=2*N_LAYER+2                                                    RAD_ALL.11212 
!                                                                                  RAD_ALL.11213 
         CALL BAND_SOLVER(N_PROFILE, N_EQUATION                                    RAD_ALL.11214 
     &      , 2, 2                                                                 RAD_ALL.11215 
     &      , A5, B                                                                RAD_ALL.11216 
     &      , FLUX_TOTAL                                                           RAD_ALL.11217 
     &      , NPD_PROFILE, 2*NPD_LAYER+2                                           RAD_ALL.11218 
     &      , WORK                                                                 RAD_ALL.11219 
     &      )                                                                      RAD_ALL.11220 
!                                                                                  RAD_ALL.11221 
      ELSE IF (I_SOLVER.EQ.IP_SOLVER_MIX_11) THEN                                  RAD_ALL.11222 
!                                                                                  RAD_ALL.11223 
         CALL MIX_COLUMN_FULL(N_PROFILE, N_LAYER, N_CLOUD_TOP                      RAD_ALL.11224 
     &      , TRANS_FREE, REFLECT_FREE, S_DOWN_FREE, S_UP_FREE                     RAD_ALL.11225 
     &      , TRANS_CLOUD, REFLECT_CLOUD                                           RAD_ALL.11226 
     &      , S_DOWN_CLOUD, S_UP_CLOUD                                             RAD_ALL.11227 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GM)                                    RAD_ALL.11228 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_GP)                                    RAD_ALL.11229 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BM)                                    RAD_ALL.11230 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_BP)                                    RAD_ALL.11231 
     &      , FLUX_INC_DOWN                                                        RAD_ALL.11232 
     &      , SOURCE_GROUND, ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR               RAD_ALL.11233 
     &      , FLUX_DIRECT(1, N_LAYER)                                              RAD_ALL.11234 
     &      , FLUX_TOTAL                                                           RAD_ALL.11235 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.11236 
     &      )                                                                      RAD_ALL.11237 
!                                                                                  RAD_ALL.11238 
      ELSE                                                                         RAD_ALL.11239 
!                                                                                  RAD_ALL.11240 
         WRITE(IU_ERR, '(/A)')                                                     RAD_ALL.11241 
     &      '***ERROR: THE SOLVER SPECIFIED IS NOT VALID HERE.'                    RAD_ALL.11242 
         IERR=I_ERR_FATAL                                                          RAD_ALL.11243 
         RETURN                                                                    RAD_ALL.11244 
!                                                                                  RAD_ALL.11245 
      ENDIF                                                                        RAD_ALL.11246 
!                                                                                  RAD_ALL.11247 
!                                                                                  RAD_ALL.11248 
!                                                                                  RAD_ALL.11249 
      IF (L_CLEAR) THEN                                                            RAD_ALL.11250 
!                                                                                  RAD_ALL.11251 
         CALL CLEAR_SUPPLEMENT(IERR, N_PROFILE, N_LAYER, I_SOLVER_CLEAR            RAD_ALL.11252 
     &      , TRANS_FREE, REFLECT_FREE, TRANS_0_FREE, SOURCE_COEFF_FREE            RAD_ALL.11253 
     &      , ISOLIR, FLUX_INC_DIRECT, FLUX_INC_DOWN                               RAD_ALL.11254 
     &      , S_DOWN_CLEAR, S_UP_CLEAR                                             RAD_ALL.11255 
     &      , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR                              RAD_ALL.11256 
     &      , SOURCE_GROUND                                                        RAD_ALL.11257 
     &      , L_SCALE_SOLAR, ADJUST_SOLAR_KE                                       RAD_ALL.11258 
     &      , FLUX_DIRECT_CLEAR, FLUX_TOTAL_CLEAR                                  RAD_ALL.11259 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.11260 
     &      )                                                                      RAD_ALL.11261 
      ENDIF                                                                        RAD_ALL.11262 
!                                                                                  RAD_ALL.11263 
!                                                                                  RAD_ALL.11264 
!                                                                                  RAD_ALL.11265 
      RETURN                                                                       RAD_ALL.11266 
      END 
