C *****************************COPYRIGHT******************************             RAD_ALL.25614 
C (c) CROWN COPYRIGHT 1996, METEOROLOGICAL OFFICE, All Rights Reserved.            RAD_ALL.25615 
C                                                                                  RAD_ALL.25616 
C Use, duplication or disclosure of this code is subject to the                    RAD_ALL.25617 
C restrictions as set forth in the contract.                                       RAD_ALL.25618 
C                                                                                  RAD_ALL.25619 
C                Meteorological Office                                             RAD_ALL.25620 
C                London Road                                                       RAD_ALL.25621 
C                BRACKNELL                                                         RAD_ALL.25622 
C                Berkshire UK                                                      RAD_ALL.25623 
C                RG12 2SZ                                                          RAD_ALL.25624 
C                                                                                  RAD_ALL.25625 
C If no contract has been raised with this copy of the code, the use,              RAD_ALL.25626 
C duplication or disclosure of it is strictly prohibited.  Permission              RAD_ALL.25627 
C to do so must first be obtained in writing from the Head of Numerical            RAD_ALL.25628 
C Modelling at the above address.                                                  RAD_ALL.25629 
C ******************************COPYRIGHT******************************            RAD_ALL.25630 
C                                                                                  RAD_ALL.25631 
!+ Subroutine to solve the two-stream equations in a triple column.                RAD_ALL.25632 
!                                                                                  RAD_ALL.25633 
! Method:                                                                          RAD_ALL.25634 
!       The atmospheric column is divided into three regions                       RAD_ALL.25635 
!       in each layer and the two-stream coefficients are determined               RAD_ALL.25636 
!       for each region. The equations are then solved using                       RAD_ALL.25637 
!       appropriate coupling of the fluxes at the boundaries                       RAD_ALL.25638 
!       of layers.                                                                 RAD_ALL.25639 
!                                                                                  RAD_ALL.25640 
! Current Owner of Code: J. M. Edwards                                             RAD_ALL.25641 
!                                                                                  RAD_ALL.25642 
! History:                                                                         RAD_ALL.25643 
!       Version         Date                    Comment                            RAD_ALL.25644 
!       4.2             15-05-96                Original Code                      RAD_ALL.25645 
!                                               (J. M. Edwards)                    RAD_ALL.25646 
!                                                                                  RAD_ALL.25647 
! Description of Code:                                                             RAD_ALL.25648 
!   FORTRAN 77  with extensions listed in documentation.                           RAD_ALL.25649 
!                                                                                  RAD_ALL.25650 
!- ---------------------------------------------------------------------           RAD_ALL.25651 
      SUBROUTINE TRIPLE_COLUMN(IERR                                                RAD_ALL.25652 
!                       Atmospheric Properties                                     RAD_ALL.25653 
     &   , N_PROFILE, N_LAYER                                                      RAD_ALL.25654 
!                       Two-stream Scheme                                          RAD_ALL.25655 
     &   , I_2STREAM                                                               RAD_ALL.25656 
!                       Corrections to Two-stream Equations                        RAD_ALL.25657 
     &   , L_2_STREAM_CORRECT, PLANCK_SOURCE, GROUND_EMISSION                      RAD_ALL.25658 
!                       Options for Solver                                         RAD_ALL.25659 
     &   , I_SOLVER, I_EXTRAPOLATE_MIX_NET, L_NET                                  RAD_ALL.25660 
!                       Options for Equivalent Extinction                          RAD_ALL.25661 
     &   , L_SCALE_SOLAR, ADJUST_SOLAR_KE                                          RAD_ALL.25662 
!                       Spectral Region                                            RAD_ALL.25663 
     &   , ISOLIR                                                                  RAD_ALL.25664 
!                       Infra-red Properties                                       RAD_ALL.25665 
     &   , DIFF_PLANCK                                                             RAD_ALL.25666 
     &   , L_IR_SOURCE_QUAD, DIFF_PLANCK_2                                         RAD_ALL.25667 
!                       Conditions at TOA                                          RAD_ALL.25668 
     &   , FLUX_INC_DOWN, FLUX_INC_DIRECT, SEC_0                                   RAD_ALL.25669 
!                       Conditions at Surface                                      RAD_ALL.25670 
     &   , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR, SOURCE_GROUND                  RAD_ALL.25671 
!                       Clear-sky Single Scattering Properties                     RAD_ALL.25672 
     &   , TAU_FREE, OMEGA_FREE, ASYMMETRY_FREE                                    RAD_ALL.25673 
!                       Cloud Geometry                                             RAD_ALL.25674 
     &   , N_CLOUD_TOP                                                             RAD_ALL.25675 
     &   , N_CLOUD_TYPE, FRAC_CLOUD                                                RAD_ALL.25676 
     &   , I_REGION_CLOUD, FRAC_REGION                                             RAD_ALL.25677 
     &   , W_FREE, N_FREE_PROFILE, I_FREE_PROFILE                                  RAD_ALL.25678 
     &   , W_CLOUD, N_CLOUD_PROFILE, I_CLOUD_PROFILE                               RAD_ALL.25679 
     &   , CLOUD_OVERLAP                                                           RAD_ALL.25680 
!                       Cloudy Optical Properties                                  RAD_ALL.25681 
     &   , TAU_CLOUD, OMEGA_CLOUD, ASYMMETRY_CLOUD                                 RAD_ALL.25682 
!                       Fluxes Calculated                                          RAD_ALL.25683 
     &   , FLUX_DIRECT, FLUX_TOTAL                                                 RAD_ALL.25684 
!                       Flags for Clear-sky Calculations                           RAD_ALL.25685 
     &   , L_CLEAR, I_SOLVER_CLEAR                                                 RAD_ALL.25686 
!                       Clear-sky Fluxes Calculated                                RAD_ALL.25687 
     &   , FLUX_DIRECT_CLEAR, FLUX_TOTAL_CLEAR                                     RAD_ALL.25688 
!                       Dimensions of Arrays                                       RAD_ALL.25689 
     &   , NPD_PROFILE, NPD_LAYER                                                  RAD_ALL.25690 
     &   )                                                                         RAD_ALL.25691 
!                                                                                  RAD_ALL.25692 
!                                                                                  RAD_ALL.25693 
!                                                                                  RAD_ALL.25694 
      IMPLICIT NONE                                                                RAD_ALL.25695 
!                                                                                  RAD_ALL.25696 
!                                                                                  RAD_ALL.25697 
!     SIZES OF DUMMY ARRAYS.                                                       RAD_ALL.25698 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.25699 
     &     NPD_PROFILE                                                             RAD_ALL.25700 
!             MAXIMUM NUMBER OF PROFILES                                           RAD_ALL.25701 
     &   , NPD_LAYER                                                               RAD_ALL.25702 
!             MAXIMUM NUMBER OF LAYERS                                             RAD_ALL.25703 
!                                                                                  RAD_ALL.25704 
!     INCLUDE COMDECKS.                                                            RAD_ALL.25705 
!     ------------------------------------------------------------------           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   
!     ------------------------------------------------------------------           CLDREG3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       CLDREG3A.3     
!                                                                                  CLDREG3A.4     
!     MODULE TO DEFINE REFERENCE NUMBERS FOR REGIONS OF CLOUDS.                    CLDREG3A.5     
!                                                                                  CLDREG3A.6     
      INTEGER                                                                      CLDREG3A.7     
     &     IP_REGION_CLEAR                                                         CLDREG3A.8     
!             REFERENCE NUMBER FOR CLEAR-SKY REGION                                CLDREG3A.9     
     &   , IP_REGION_STRAT                                                         CLDREG3A.10    
!             REFERENCE NUMBER FOR STRATIFORM CLOUDY REGION                        CLDREG3A.11    
     &   , IP_REGION_CONV                                                          CLDREG3A.12    
!             REFERENCE NUMBER FOR CONVECTIVE CLOUDY REGION                        CLDREG3A.13    
!                                                                                  CLDREG3A.14    
      PARAMETER(                                                                   CLDREG3A.15    
     &     IP_REGION_CLEAR=1                                                       CLDREG3A.16    
     &   , IP_REGION_STRAT=2                                                       CLDREG3A.17    
     &   , IP_REGION_CONV=3                                                        CLDREG3A.18    
     &   )                                                                         CLDREG3A.19    
!                                                                                  CLDREG3A.20    
!     ------------------------------------------------------------------           CLDREG3A.21    
!                                                                                  RAD_ALL.25715 
!     DUMMY VARIABLES.                                                             RAD_ALL.25716 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.25717 
     &     N_PROFILE                                                               RAD_ALL.25718 
!             NUMBER OF PROFILES                                                   RAD_ALL.25719 
     &   , N_LAYER                                                                 RAD_ALL.25720 
!             NUMBER OF LAYERS                                                     RAD_ALL.25721 
     &   , N_CLOUD_TOP                                                             RAD_ALL.25722 
!             TOP CLOUDY LAYER                                                     RAD_ALL.25723 
     &   , N_CLOUD_TYPE                                                            RAD_ALL.25724 
!             NUMBER OF TYPES OF CLOUDS                                            RAD_ALL.25725 
     &   , N_FREE_PROFILE(NPD_LAYER)                                               RAD_ALL.25726 
!             NUMBER OF FREE PROFILES                                              RAD_ALL.25727 
     &   , I_FREE_PROFILE(NPD_PROFILE, NPD_LAYER)                                  RAD_ALL.25728 
!             INDICES OF FREE PROFILES                                             RAD_ALL.25729 
     &   , N_CLOUD_PROFILE(NPD_LAYER)                                              RAD_ALL.25730 
!             NUMBER OF CLOUDY PROFILES                                            RAD_ALL.25731 
     &   , I_CLOUD_PROFILE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.25732 
!             INDICES OF CLOUDY PROFILES                                           RAD_ALL.25733 
     &   , ISOLIR                                                                  RAD_ALL.25734 
!             SPECTRAL REGION                                                      RAD_ALL.25735 
     &   , I_2STREAM                                                               RAD_ALL.25736 
!             TWO-STREAM SCHEME                                                    RAD_ALL.25737 
     &   , I_SOLVER                                                                RAD_ALL.25738 
!             SOLVER USED                                                          RAD_ALL.25739 
     &   , I_EXTRAPOLATE_MIX_NET                                                   RAD_ALL.25740 
!             METHOD FOR EXTRAPOLATING WITH A MIXED SOLVER                         RAD_ALL.25741 
     &   , I_SOLVER_CLEAR                                                          RAD_ALL.25742 
!             SOLVER FOR CLEAR-SKY FLUXES                                          RAD_ALL.25743 
      INTEGER   !, INTENT(OUT)                                                     RAD_ALL.25744 
     &     IERR                                                                    RAD_ALL.25745 
!             ERROR FLAG                                                           RAD_ALL.25746 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.25747 
     &     L_NET                                                                   RAD_ALL.25748 
!             CALCULATE NET FLUXES                                                 RAD_ALL.25749 
     &   , L_CLEAR                                                                 RAD_ALL.25750 
!             CALCULATE CLEAR-SKY FLUXES                                           RAD_ALL.25751 
     &   , L_SCALE_SOLAR                                                           RAD_ALL.25752 
!             FLAG TO SCALE SOLAR                                                  RAD_ALL.25753 
     &   , L_IR_SOURCE_QUAD                                                        RAD_ALL.25754 
!             USE QUADRATIC SOURCE TERM                                            RAD_ALL.25755 
     &   , L_2_STREAM_CORRECT                                                      RAD_ALL.25756 
!             EDGE CORRECTION TO 2-STREAM                                          RAD_ALL.25757 
!                                                                                  RAD_ALL.25758 
!     OPTICAL PROPERTIES:                                                          RAD_ALL.25759 
      REAL      !, INTENT(IN)                                                      RAD_ALL.25760 
     &     TAU_FREE(NPD_PROFILE, NPD_LAYER)                                        RAD_ALL.25761 
!             FREE OPTICAL DEPTH                                                   RAD_ALL.25762 
     &   , OMEGA_FREE(NPD_PROFILE, NPD_LAYER)                                      RAD_ALL.25763 
!             FREE ALBEDO OF SINGLE SCATTERING                                     RAD_ALL.25764 
     &   , ASYMMETRY_FREE(NPD_PROFILE, NPD_LAYER)                                  RAD_ALL.25765 
!             CLEAR-SKY ASYMMETRY                                                  RAD_ALL.25766 
     &   , TAU_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                       RAD_ALL.25767 
!             CLOUDY OPTICAL DEPTH                                                 RAD_ALL.25768 
     &   , OMEGA_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                     RAD_ALL.25769 
!             CLOUDY ALBEDO OF SINGLE SCATTERING                                   RAD_ALL.25770 
     &   , ASYMMETRY_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                 RAD_ALL.25771 
!             CLOUDY ASYMMETRY                                                     RAD_ALL.25772 
!                                                                                  RAD_ALL.25773 
!     CLOUD GEOMETRY:                                                              RAD_ALL.25774 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.25775 
     &     I_REGION_CLOUD(NPD_CLOUD_TYPE)                                          RAD_ALL.25776 
!             REGIONS IN WHICH TYPES OF CLOUDS FALL                                RAD_ALL.25777 
      REAL      !, INTENT(IN)                                                      RAD_ALL.25778 
     &     W_CLOUD(NPD_PROFILE, NPD_LAYER)                                         RAD_ALL.25779 
!             CLOUDY FRACTIONS IN EACH LAYER                                       RAD_ALL.25780 
     &   , W_FREE(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.25781 
!             CLEAR SKY FRACTIONS IN EACH LAYER                                    RAD_ALL.25782 
     &   , FRAC_CLOUD(NPD_PROFILE, NPD_LAYER, NPD_CLOUD_TYPE)                      RAD_ALL.25783 
!             FRACTIONS OF DIFFERENT TYPES OF CLOUD                                RAD_ALL.25784 
     &   , CLOUD_OVERLAP(NPD_PROFILE, 0: NPD_LAYER, NPD_OVERLAP_COEFF)             RAD_ALL.25785 
!             ENERGY TRANSFER COEFFICIENTS                                         RAD_ALL.25786 
     &   , FRAC_REGION(NPD_PROFILE, NPD_LAYER, NPD_REGION)                         RAD_ALL.25787 
!             FRACTIONS OF TOTAL CLOUD OCCUPIED BY EACH REGION                     RAD_ALL.25788 
      REAL      !, INTENT(IN)                                                      RAD_ALL.25789 
     &     SEC_0(NPD_PROFILE)                                                      RAD_ALL.25790 
!             SECANT OF SOLAR ZENITH ANGLE                                         RAD_ALL.25791 
     &   , ALBEDO_SURFACE_DIFF(NPD_PROFILE)                                        RAD_ALL.25792 
!             DIFFUSE ALBEDO                                                       RAD_ALL.25793 
     &   , ALBEDO_SURFACE_DIR(NPD_PROFILE)                                         RAD_ALL.25794 
!             DIRECT ALBEDO                                                        RAD_ALL.25795 
     &   , FLUX_INC_DOWN(NPD_PROFILE)                                              RAD_ALL.25796 
!             INCIDENT TOTAL FLUX                                                  RAD_ALL.25797 
     &   , FLUX_INC_DIRECT(NPD_PROFILE)                                            RAD_ALL.25798 
!             INCIDENT DIRECT FLUX                                                 RAD_ALL.25799 
     &   , DIFF_PLANCK(NPD_PROFILE, NPD_LAYER)                                     RAD_ALL.25800 
!             CHANGE IN PLANCK FUNCTION                                            RAD_ALL.25801 
     &   , SOURCE_GROUND(NPD_PROFILE)                                              RAD_ALL.25802 
!             FLUX FROM SURFACE                                                    RAD_ALL.25803 
     &   , ADJUST_SOLAR_KE(NPD_PROFILE, NPD_LAYER)                                 RAD_ALL.25804 
!             ADJUSTMENT OF SOLAR BEAM WITH EQUIVALENT EXTINCTION                  RAD_ALL.25805 
     &   , DIFF_PLANCK_2(NPD_PROFILE, NPD_LAYER)                                   RAD_ALL.25806 
!             2x2ND DIFFERENCE OF PLANCKIAN                                        RAD_ALL.25807 
     &   , PLANCK_SOURCE(NPD_PROFILE, 0: NPD_LAYER)                                RAD_ALL.25808 
!             PLANCKIAN SOURCE FUNCTION                                            RAD_ALL.25809 
     &   , GROUND_EMISSION(NPD_PROFILE)                                            RAD_ALL.25810 
!             TOTAL FLUX EMITTED FROM GROUND                                       RAD_ALL.25811 
!                                                                                  RAD_ALL.25812 
!     FLUXES CALCULATED                                                            RAD_ALL.25813 
      REAL      !, INTENT(OUT)                                                     RAD_ALL.25814 
     &     FLUX_DIRECT(NPD_PROFILE, 0: NPD_LAYER)                                  RAD_ALL.25815 
!             DIRECT FLUX                                                          RAD_ALL.25816 
     &   , FLUX_TOTAL(NPD_PROFILE, 2*NPD_LAYER+2)                                  RAD_ALL.25817 
!             LONG FLUX VECTOR                                                     RAD_ALL.25818 
     &   , FLUX_DIRECT_CLEAR(NPD_PROFILE, 0: NPD_LAYER)                            RAD_ALL.25819 
!             CLEAR DIRECT FLUX                                                    RAD_ALL.25820 
     &   , FLUX_TOTAL_CLEAR(NPD_PROFILE, 2*NPD_LAYER+2)                            RAD_ALL.25821 
!             CLEAR TOTAL FLUX                                                     RAD_ALL.25822 
!                                                                                  RAD_ALL.25823 
!                                                                                  RAD_ALL.25824 
!                                                                                  RAD_ALL.25825 
!     LOCAL VARIABALES.                                                            RAD_ALL.25826 
      INTEGER                                                                      RAD_ALL.25827 
     &     N_SOURCE_COEFF                                                          RAD_ALL.25828 
!             NUMBER OF SOURCE COEFFICIENTS                                        RAD_ALL.25829 
     &   , N_REGION                                                                RAD_ALL.25830 
!             NUMBER OF REGIONS                                                    RAD_ALL.25831 
     &   , I                                                                       RAD_ALL.25832 
!             LOOP VARIABLE                                                        RAD_ALL.25833 
     &   , L                                                                       RAD_ALL.25834 
!             LOOP VARIABLE                                                        RAD_ALL.25835 
     &   , K                                                                       RAD_ALL.25836 
!             LOOP VARIABLE                                                        RAD_ALL.25837 
     &   , N_TOP                                                                   RAD_ALL.25838 
!             TOP-MOST LAYER FOR CALCULATION                                       RAD_ALL.25839 
!                                                                                  RAD_ALL.25840 
!                                                                                  RAD_ALL.25841 
!     CLEAR-SKY COEFFICIENTS:                                                      RAD_ALL.25842 
      REAL                                                                         RAD_ALL.25843 
     &     TRANS(NPD_PROFILE, NPD_LAYER, NPD_REGION)                               RAD_ALL.25844 
!             TRANSMISSION COEFFICIENTS                                            RAD_ALL.25845 
     &   , REFLECT(NPD_PROFILE, NPD_LAYER, NPD_REGION)                             RAD_ALL.25846 
!             REFLECTION COEFFICIENTS                                              RAD_ALL.25847 
     &   , TRANS_0(NPD_PROFILE, NPD_LAYER, NPD_REGION)                             RAD_ALL.25848 
!             DIRECT TRANSMISSION COEFFICIENTS                                     RAD_ALL.25849 
     &   , SOURCE_COEFF(NPD_PROFILE, NPD_LAYER                                     RAD_ALL.25850 
     &      , NPD_SOURCE_COEFF, NPD_REGION)                                        RAD_ALL.25851 
!             SOURCE COEFFICIENTS                                                  RAD_ALL.25852 
     &   , S_DOWN(NPD_PROFILE, NPD_LAYER, NPD_REGION)                              RAD_ALL.25853 
!             FREE DOWNWARD SOURCE                                                 RAD_ALL.25854 
     &   , S_UP(NPD_PROFILE, NPD_LAYER, NPD_REGION)                                RAD_ALL.25855 
!             FREE UPWARD SOURCE                                                   RAD_ALL.25856 
     &   , S_DOWN_CLEAR(NPD_PROFILE, NPD_LAYER)                                    RAD_ALL.25857 
!             CLEAR DOWNWARD SOURCE                                                RAD_ALL.25858 
     &   , S_UP_CLEAR(NPD_PROFILE, NPD_LAYER)                                      RAD_ALL.25859 
!             CLEAR UPWARD SOURCE                                                  RAD_ALL.25860 
!                                                                                  RAD_ALL.25861 
!     SOURCE FUNCTIONS AT THE CROUND                                               RAD_ALL.25862 
      REAL                                                                         RAD_ALL.25863 
     &     SOURCE_FLUX_GROUND(NPD_PROFILE, NPD_REGION)                             RAD_ALL.25864 
!             SOURCE OF FLUX FROM GROUND                                           RAD_ALL.25865 
     &   , FLUX_DIRECT_GROUND(NPD_PROFILE, NPD_REGION)                             RAD_ALL.25866 
!             DIRECT FLUX AT GROUND IN EACH REGION                                 RAD_ALL.25867 
!                                                                                  RAD_ALL.25868 
!                                                                                  RAD_ALL.25869 
!     FUNCTIONS CALLED:                                                            RAD_ALL.25870 
      INTEGER                                                                      RAD_ALL.25871 
     &     SET_N_SOURCE_COEFF                                                      RAD_ALL.25872 
!             FUNCTION TO SET NUMBER OF SOURCE COEFFICIENTS                        RAD_ALL.25873 
!                                                                                  RAD_ALL.25874 
!     SUBROUTINES CALLED:                                                          RAD_ALL.25875 
      EXTERNAL                                                                     RAD_ALL.25876 
     &     TWO_COEFF, TWO_COEFF_CLOUD, IR_SOURCE, MIXED_SOLAR_SOURCE               RAD_ALL.25877 
     &                          , MIX_NET_MATRIX, BAND_SOLVER                      RAD_ALL.25878 
     &   , MIX_SUM_MATRIX, MIX_COLUMN_FULL, MIX_APP_SCAT                           RAD_ALL.25879 
     &   , CLEAR_SUPPLEMENT                                                        RAD_ALL.25880 
!                                                                                  RAD_ALL.25881 
!                                                                                  RAD_ALL.25882 
!     SET THE NUMBER OF REGIONS FOR POSSIBLE FUTURE EXPANSION.                     RAD_ALL.25883 
      N_REGION=3                                                                   RAD_ALL.25884 
!                                                                                  RAD_ALL.25885 
!                                                                                  RAD_ALL.25886 
!     SET THE NUMBER OF SOURCE COEFFICIENTS FOR THE APPROXIMATION                  RAD_ALL.25887 
      N_SOURCE_COEFF=SET_N_SOURCE_COEFF(ISOLIR, L_IR_SOURCE_QUAD)                  RAD_ALL.25888 
!                                                                                  RAD_ALL.25889 
!                                                                                  RAD_ALL.25890 
      CALL TWO_COEFF_REGION(IERR                                                   RAD_ALL.25891 
     &   , N_PROFILE, N_LAYER, N_CLOUD_TOP                                         RAD_ALL.25892 
     &   , I_2STREAM, L_IR_SOURCE_QUAD, N_SOURCE_COEFF                             RAD_ALL.25893 
     &   , N_CLOUD_TYPE, FRAC_CLOUD                                                RAD_ALL.25894 
     &   , I_REGION_CLOUD, FRAC_REGION                                             RAD_ALL.25895 
     &   , ASYMMETRY_FREE, OMEGA_FREE, TAU_FREE                                    RAD_ALL.25896 
     &   , ASYMMETRY_CLOUD, OMEGA_CLOUD, TAU_CLOUD                                 RAD_ALL.25897 
     &   , ISOLIR, SEC_0                                                           RAD_ALL.25898 
     &   , TRANS, REFLECT, TRANS_0, SOURCE_COEFF                                   RAD_ALL.25899 
     &   , NPD_PROFILE, NPD_LAYER                                                  RAD_ALL.25900 
     &   )                                                                         RAD_ALL.25901 
      IF (IERR.NE.I_NORMAL) RETURN                                                 RAD_ALL.25902 
!                                                                                  RAD_ALL.25903 
!                                                                                  RAD_ALL.25904 
      IF (ISOLIR.EQ.IP_INFRA_RED) THEN                                             RAD_ALL.25905 
!                                                                                  RAD_ALL.25906 
!        EDGE CORRECTIONS FOR THE TWO-STREAM EQUATIONS DO NOT                      RAD_ALL.25907 
!        REALLY FIT WITH THIS METHOD OF TREATING CLOUDS. OPTICAL                   RAD_ALL.25908 
!        DEPTHS AND TRANSMISSIONS MUST BE PASSED TO THE SUBROUTINE                 RAD_ALL.25909 
!        TO FILL THE ARGUMENT LIST, BUT IT IS NOT INTENDED THAT                    RAD_ALL.25910 
!        THESE ARRAYS WILL BE USED.                                                RAD_ALL.25911 
!                                                                                  RAD_ALL.25912 
         DO K=1, N_REGION                                                          RAD_ALL.25913 
            IF (K.EQ.IP_REGION_CLEAR) THEN                                         RAD_ALL.25914 
               N_TOP=1                                                             RAD_ALL.25915 
            ELSE                                                                   RAD_ALL.25916 
               N_TOP=N_CLOUD_TOP                                                   RAD_ALL.25917 
            ENDIF                                                                  RAD_ALL.25918 
!                                                                                  RAD_ALL.25919 
            CALL IR_SOURCE(N_PROFILE, N_TOP, N_LAYER                               RAD_ALL.25920 
     &         , SOURCE_COEFF(1, 1, 1, K), DIFF_PLANCK                             RAD_ALL.25921 
     &         , L_IR_SOURCE_QUAD, DIFF_PLANCK_2                                   RAD_ALL.25922 
     &         , L_2_STREAM_CORRECT, PLANCK_SOURCE                                 RAD_ALL.25923 
     &         , GROUND_EMISSION, N_LAYER                                          RAD_ALL.25924 
     &         , TAU_FREE, TRANS                                                   RAD_ALL.25925 
     &         , S_DOWN(1, 1, K), S_UP(1, 1, K)                                    RAD_ALL.25926 
     &         , NPD_PROFILE, NPD_LAYER                                            RAD_ALL.25927 
     &         )                                                                   RAD_ALL.25928 
         ENDDO                                                                     RAD_ALL.25929 
!                                                                                  RAD_ALL.25930 
!                                                                                  RAD_ALL.25931 
!        WEIGHT THE SOURCE FUNCTIONS BY THE AREA FRACTIONS, BUT                    RAD_ALL.25932 
!        SAVE THE CLEAR-SKY FRACTIONS FOR DIAGNOSTIC USE IF                        RAD_ALL.25933 
!        REQUIRED.                                                                 RAD_ALL.25934 
         IF (L_CLEAR) THEN                                                         RAD_ALL.25935 
            DO I=1, N_LAYER                                                        RAD_ALL.25936 
               DO L=1, N_PROFILE                                                   RAD_ALL.25937 
                  S_DOWN_CLEAR(L, I)=S_DOWN(L, I, IP_REGION_CLEAR)                 RAD_ALL.25938 
                  S_UP_CLEAR(L, I)=S_UP(L, I, IP_REGION_CLEAR)                     RAD_ALL.25939 
               ENDDO                                                               RAD_ALL.25940 
            ENDDO                                                                  RAD_ALL.25941 
         ENDIF                                                                     RAD_ALL.25942 
         DO I=N_CLOUD_TOP, N_LAYER                                                 RAD_ALL.25943 
            DO L=1, N_PROFILE                                                      RAD_ALL.25944 
               S_DOWN(L, I, IP_REGION_CLEAR)                                       RAD_ALL.25945 
     &            =W_FREE(L, I)*S_DOWN(L, I, IP_REGION_CLEAR)                      RAD_ALL.25946 
               S_UP(L, I, IP_REGION_CLEAR)                                         RAD_ALL.25947 
     &            =W_FREE(L, I)*S_UP(L, I, IP_REGION_CLEAR)                        RAD_ALL.25948 
               S_DOWN(L, I, IP_REGION_STRAT)                                       RAD_ALL.25949 
     &            =W_CLOUD(L, I)                                                   RAD_ALL.25950 
     &            *FRAC_REGION(L, I, IP_REGION_STRAT)                              RAD_ALL.25951 
     &            *S_DOWN(L, I, IP_REGION_STRAT)                                   RAD_ALL.25952 
               S_UP(L, I, IP_REGION_STRAT)                                         RAD_ALL.25953 
     &            =W_CLOUD(L, I)                                                   RAD_ALL.25954 
     &            *FRAC_REGION(L, I, IP_REGION_STRAT)                              RAD_ALL.25955 
     &            *S_UP(L, I, IP_REGION_STRAT)                                     RAD_ALL.25956 
               S_DOWN(L, I, IP_REGION_CONV)                                        RAD_ALL.25957 
     &            =W_CLOUD(L, I)                                                   RAD_ALL.25958 
     &            *FRAC_REGION(L, I, IP_REGION_CONV)                               RAD_ALL.25959 
     &            *S_DOWN(L, I, IP_REGION_CONV)                                    RAD_ALL.25960 
               S_UP(L, I, IP_REGION_CONV)                                          RAD_ALL.25961 
     &            =W_CLOUD(L, I)                                                   RAD_ALL.25962 
     &            *FRAC_REGION(L, I, IP_REGION_CONV)                               RAD_ALL.25963 
     &            *S_UP(L, I, IP_REGION_CONV)                                      RAD_ALL.25964 
            ENDDO                                                                  RAD_ALL.25965 
         ENDDO                                                                     RAD_ALL.25966 
!                                                                                  RAD_ALL.25967 
      ENDIF                                                                        RAD_ALL.25968 
!                                                                                  RAD_ALL.25969 
!                                                                                  RAD_ALL.25970 
!     CALCULATE THE APPROPRIATE SOURCE TERMS FOR THE SOLAR: CLOUDY                 RAD_ALL.25971 
!     AND CLEAR PROPERTIES ARE BOTH NEEDED HERE.                                   RAD_ALL.25972 
!                                                                                  RAD_ALL.25973 
      IF (ISOLIR.EQ.IP_SOLAR) THEN                                                 RAD_ALL.25974 
!                                                                                  RAD_ALL.25975 
         CALL TRIPLE_SOLAR_SOURCE(N_PROFILE, N_LAYER, N_CLOUD_TOP                  RAD_ALL.25976 
     &      , FLUX_INC_DIRECT                                                      RAD_ALL.25977 
     &      , L_SCALE_SOLAR, ADJUST_SOLAR_KE                                       RAD_ALL.25978 
     &      , TRANS_0, SOURCE_COEFF                                                RAD_ALL.25979 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V11)                                   RAD_ALL.25980 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V12)                                   RAD_ALL.25981 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V13)                                   RAD_ALL.25982 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V21)                                   RAD_ALL.25983 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V22)                                   RAD_ALL.25984 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V23)                                   RAD_ALL.25985 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V31)                                   RAD_ALL.25986 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V32)                                   RAD_ALL.25987 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V33)                                   RAD_ALL.25988 
     &      , FLUX_DIRECT, FLUX_DIRECT_GROUND                                      RAD_ALL.25989 
     &      , S_UP, S_DOWN                                                         RAD_ALL.25990 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.25991 
     &   )                                                                         RAD_ALL.25992 
      ENDIF                                                                        RAD_ALL.25993 
!                                                                                  RAD_ALL.25994 
!        SET THE PARTITIONED SOURCE FUNCTIONS AT THE GROUND.                       RAD_ALL.25995 
         IF (ISOLIR.EQ.IP_SOLAR) THEN                                              RAD_ALL.25996 
            DO L=1, N_PROFILE                                                      RAD_ALL.25997 
               SOURCE_FLUX_GROUND(L, IP_REGION_CLEAR)                              RAD_ALL.25998 
     &            =(ALBEDO_SURFACE_DIR(L)-ALBEDO_SURFACE_DIFF(L))                  RAD_ALL.25999 
     &            *FLUX_DIRECT_GROUND(L, IP_REGION_CLEAR)                          RAD_ALL.26000 
               SOURCE_FLUX_GROUND(L, IP_REGION_STRAT)                              RAD_ALL.26001 
     &            =(ALBEDO_SURFACE_DIR(L)-ALBEDO_SURFACE_DIFF(L))                  RAD_ALL.26002 
     &            *FLUX_DIRECT_GROUND(L, IP_REGION_STRAT)                          RAD_ALL.26003 
               SOURCE_FLUX_GROUND(L, IP_REGION_CONV)                               RAD_ALL.26004 
     &            =(ALBEDO_SURFACE_DIR(L)-ALBEDO_SURFACE_DIFF(L))                  RAD_ALL.26005 
     &            *FLUX_DIRECT_GROUND(L, IP_REGION_CONV)                           RAD_ALL.26006 
            ENDDO                                                                  RAD_ALL.26007 
         ELSE                                                                      RAD_ALL.26008 
            DO L=1, N_PROFILE                                                      RAD_ALL.26009 
               SOURCE_FLUX_GROUND(L, IP_REGION_CLEAR)                              RAD_ALL.26010 
     &            =CLOUD_OVERLAP(L, N_LAYER, IP_CLOVLP_U11)                        RAD_ALL.26011 
     &            *SOURCE_GROUND(L)                                                RAD_ALL.26012 
               SOURCE_FLUX_GROUND(L, IP_REGION_STRAT)                              RAD_ALL.26013 
     &            =CLOUD_OVERLAP(L, N_LAYER, IP_CLOVLP_U21)                        RAD_ALL.26014 
     &            *SOURCE_GROUND(L)                                                RAD_ALL.26015 
               SOURCE_FLUX_GROUND(L, IP_REGION_CONV)                               RAD_ALL.26016 
     &            =CLOUD_OVERLAP(L, N_LAYER, IP_CLOVLP_U31)                        RAD_ALL.26017 
     &            *SOURCE_GROUND(L)                                                RAD_ALL.26018 
            ENDDO                                                                  RAD_ALL.26019 
         ENDIF                                                                     RAD_ALL.26020 
!                                                                                  RAD_ALL.26021 
!                                                                                  RAD_ALL.26022 
!                                                                                  RAD_ALL.26023 
      IF (I_SOLVER.EQ.IP_SOLVER_TRIPLE) THEN                                       RAD_ALL.26024 
!                                                                                  RAD_ALL.26025 
         CALL SOLVER_TRIPLE(N_PROFILE, N_LAYER, N_CLOUD_TOP                        RAD_ALL.26026 
     &      , TRANS(1, 1, IP_REGION_CLEAR)                                         RAD_ALL.26027 
     &      , REFLECT(1, 1, IP_REGION_CLEAR)                                       RAD_ALL.26028 
     &      , S_DOWN(1, 1, IP_REGION_CLEAR)                                        RAD_ALL.26029 
     &      , S_UP(1, 1, IP_REGION_CLEAR)                                          RAD_ALL.26030 
     &      , TRANS(1, 1, IP_REGION_STRAT)                                         RAD_ALL.26031 
     &      , REFLECT(1, 1, IP_REGION_STRAT)                                       RAD_ALL.26032 
     &      , S_DOWN(1, 1, IP_REGION_STRAT)                                        RAD_ALL.26033 
     &      , S_UP(1, 1, IP_REGION_STRAT)                                          RAD_ALL.26034 
     &      , TRANS(1, 1, IP_REGION_CONV)                                          RAD_ALL.26035 
     &      , REFLECT(1, 1, IP_REGION_CONV)                                        RAD_ALL.26036 
     &      , S_DOWN(1, 1, IP_REGION_CONV)                                         RAD_ALL.26037 
     &      , S_UP(1, 1, IP_REGION_CONV)                                           RAD_ALL.26038 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V11)                                   RAD_ALL.26039 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V12)                                   RAD_ALL.26040 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V13)                                   RAD_ALL.26041 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V21)                                   RAD_ALL.26042 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V22)                                   RAD_ALL.26043 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V23)                                   RAD_ALL.26044 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V31)                                   RAD_ALL.26045 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V32)                                   RAD_ALL.26046 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V33)                                   RAD_ALL.26047 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U11)                                   RAD_ALL.26048 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U12)                                   RAD_ALL.26049 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U13)                                   RAD_ALL.26050 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U21)                                   RAD_ALL.26051 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U22)                                   RAD_ALL.26052 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U23)                                   RAD_ALL.26053 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U31)                                   RAD_ALL.26054 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U32)                                   RAD_ALL.26055 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U33)                                   RAD_ALL.26056 
     &      , L_NET                                                                RAD_ALL.26057 
     &      , FLUX_INC_DOWN                                                        RAD_ALL.26058 
     &      , SOURCE_FLUX_GROUND(1, IP_REGION_CLEAR)                               RAD_ALL.26059 
     &      , SOURCE_FLUX_GROUND(1, IP_REGION_STRAT)                               RAD_ALL.26060 
     &      , SOURCE_FLUX_GROUND(1, IP_REGION_CONV)                                RAD_ALL.26061 
     &      , ALBEDO_SURFACE_DIFF                                                  RAD_ALL.26062 
     &      , FLUX_TOTAL                                                           RAD_ALL.26063 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.26064 
     &      )                                                                      RAD_ALL.26065 
!                                                                                  RAD_ALL.26066 
      ELSE IF (I_SOLVER.EQ.IP_SOLVER_TRIPLE_APP_SCAT) THEN                         RAD_ALL.26067 
!                                                                                  RAD_ALL.26068 
         CALL SOLVER_TRIPLE_APP_SCAT(N_PROFILE, N_LAYER, N_CLOUD_TOP               RAD_ALL.26069 
     &      , TRANS(1, 1, IP_REGION_CLEAR)                                         RAD_ALL.26070 
     &      , REFLECT(1, 1, IP_REGION_CLEAR)                                       RAD_ALL.26071 
     &      , S_DOWN(1, 1, IP_REGION_CLEAR)                                        RAD_ALL.26072 
     &      , S_UP(1, 1, IP_REGION_CLEAR)                                          RAD_ALL.26073 
     &      , TRANS(1, 1, IP_REGION_STRAT)                                         RAD_ALL.26074 
     &      , REFLECT(1, 1, IP_REGION_STRAT)                                       RAD_ALL.26075 
     &      , S_DOWN(1, 1, IP_REGION_STRAT)                                        RAD_ALL.26076 
     &      , S_UP(1, 1, IP_REGION_STRAT)                                          RAD_ALL.26077 
     &      , TRANS(1, 1, IP_REGION_CONV)                                          RAD_ALL.26078 
     &      , REFLECT(1, 1, IP_REGION_CONV)                                        RAD_ALL.26079 
     &      , S_DOWN(1, 1, IP_REGION_CONV)                                         RAD_ALL.26080 
     &      , S_UP(1, 1, IP_REGION_CONV)                                           RAD_ALL.26081 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V11)                                   RAD_ALL.26082 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V12)                                   RAD_ALL.26083 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V13)                                   RAD_ALL.26084 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V21)                                   RAD_ALL.26085 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V22)                                   RAD_ALL.26086 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V23)                                   RAD_ALL.26087 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V31)                                   RAD_ALL.26088 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V32)                                   RAD_ALL.26089 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_V33)                                   RAD_ALL.26090 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U11)                                   RAD_ALL.26091 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U12)                                   RAD_ALL.26092 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U13)                                   RAD_ALL.26093 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U21)                                   RAD_ALL.26094 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U22)                                   RAD_ALL.26095 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U23)                                   RAD_ALL.26096 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U31)                                   RAD_ALL.26097 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U32)                                   RAD_ALL.26098 
     &      , CLOUD_OVERLAP(1, 0, IP_CLOVLP_U33)                                   RAD_ALL.26099 
     &      , L_NET                                                                RAD_ALL.26100 
     &      , FLUX_INC_DOWN                                                        RAD_ALL.26101 
     &      , SOURCE_FLUX_GROUND(1, IP_REGION_CLEAR)                               RAD_ALL.26102 
     &      , SOURCE_FLUX_GROUND(1, IP_REGION_STRAT)                               RAD_ALL.26103 
     &      , SOURCE_FLUX_GROUND(1, IP_REGION_CONV)                                RAD_ALL.26104 
     &      , ALBEDO_SURFACE_DIFF                                                  RAD_ALL.26105 
     &      , FLUX_TOTAL                                                           RAD_ALL.26106 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.26107 
     &      )                                                                      RAD_ALL.26108 
!                                                                                  RAD_ALL.26109 
      ELSE                                                                         RAD_ALL.26110 
!                                                                                  RAD_ALL.26111 
         WRITE(IU_ERR, '(/A)')                                                     RAD_ALL.26112 
     &      '***ERROR: THE SOLVER SPECIFIED IS NOT VALID HERE.'                    RAD_ALL.26113 
         IERR=I_ERR_FATAL                                                          RAD_ALL.26114 
         RETURN                                                                    RAD_ALL.26115 
!                                                                                  RAD_ALL.26116 
      ENDIF                                                                        RAD_ALL.26117 
!                                                                                  RAD_ALL.26118 
!                                                                                  RAD_ALL.26119 
!                                                                                  RAD_ALL.26120 
      IF (L_CLEAR) THEN                                                            RAD_ALL.26121 
!                                                                                  RAD_ALL.26122 
         CALL CLEAR_SUPPLEMENT(IERR, N_PROFILE, N_LAYER, I_SOLVER_CLEAR            RAD_ALL.26123 
     &      , TRANS(1, 1, IP_REGION_CLEAR)                                         RAD_ALL.26124 
     &      , REFLECT(1, 1, IP_REGION_CLEAR)                                       RAD_ALL.26125 
     &      , TRANS_0(1, 1, IP_REGION_CLEAR)                                       RAD_ALL.26126 
     &      , SOURCE_COEFF(1, 1, 1, IP_REGION_CLEAR)                               RAD_ALL.26127 
     &      , ISOLIR, FLUX_INC_DIRECT, FLUX_INC_DOWN                               RAD_ALL.26128 
     &      , S_DOWN_CLEAR, S_UP_CLEAR                                             RAD_ALL.26129 
     &      , ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR                              RAD_ALL.26130 
     &      , SOURCE_GROUND                                                        RAD_ALL.26131 
     &      , L_SCALE_SOLAR, ADJUST_SOLAR_KE                                       RAD_ALL.26132 
     &      , FLUX_DIRECT_CLEAR, FLUX_TOTAL_CLEAR                                  RAD_ALL.26133 
     &      , NPD_PROFILE, NPD_LAYER                                               RAD_ALL.26134 
     &      )                                                                      RAD_ALL.26135 
      ENDIF                                                                        RAD_ALL.26136 
!                                                                                  RAD_ALL.26137 
!                                                                                  RAD_ALL.26138 
!                                                                                  RAD_ALL.26139 
      RETURN                                                                       RAD_ALL.26140 
      END
