C (c) CROWN COPYRIGHT 1995, METEOROLOGICAL OFFICE, All Rights Reserved.            RAD_ALL.20847 
C                                                                                  RAD_ALL.20848 
C Use, duplication or disclosure of this code is subject to the                    RAD_ALL.20849 
C restrictions as set forth in the contract.                                       RAD_ALL.20850 
C                                                                                  RAD_ALL.20851 
C                Meteorological Office                                             RAD_ALL.20852 
C                London Road                                                       RAD_ALL.20853 
C                BRACKNELL                                                         RAD_ALL.20854 
C                Berkshire UK                                                      RAD_ALL.20855 
C                RG12 2SZ                                                          RAD_ALL.20856 
C                                                                                  RAD_ALL.20857 
C If no contract has been raised with this copy of the code, the use,              RAD_ALL.20858 
C duplication or disclosure of it is strictly prohibited.  Permission              RAD_ALL.20859 
C to do so must first be obtained in writing from the Head of Numerical            RAD_ALL.20860 
C Modelling at the above address.                                                  RAD_ALL.20861 
C ******************************COPYRIGHT******************************            RAD_ALL.20862 
C                                                                                  RAD_ALL.20863 
!+ Subroutine to calculate the basic coefficients for the solar beam.              RAD_ALL.20864 
!                                                                                  RAD_ALL.20865 
! Method:                                                                          RAD_ALL.20866 
!       Straightforward.                                                           RAD_ALL.20867 
!                                                                                  RAD_ALL.20868 
! Current Owner of Code: J. M. Edwards                                             RAD_ALL.20869 
!                                                                                  RAD_ALL.20870 
! History:                                                                         RAD_ALL.20871 
!       Version         Date                    Comment                            RAD_ALL.20872 
!       4.0             27-07-95                Original Code                      RAD_ALL.20873 
!                                               (J. M. Edwards)                    RAD_ALL.20874 
!       4.2             Nov. 96   T3E migration: CALL WHENFLT replaced             RAD_ALL.20875 
!                                  by portable fortran code.                       RAD_ALL.20876 
!                                                S.J.Swarbrick                     RAD_ALL.20877 
!       4.2             08-08-96                Extra two-stream option            RAD_ALL.20878 
!                                               added.                             RAD_ALL.20879 
!                                               (J. M. Edwards)                    RAD_ALL.20880 
!                                                                                  RAD_ALL.20881 
! Description of Code:                                                             RAD_ALL.20882 
!   FORTRAN 77  with extensions listed in documentation.                           RAD_ALL.20883 
!                                                                                  RAD_ALL.20884 
!- ---------------------------------------------------------------------           RAD_ALL.20885 
      SUBROUTINE SOLAR_COEFFICIENT_BASIC(IERR                                      RAD_ALL.20886 
     &   , N_PROFILE, I_LAYER_FIRST, I_LAYER_LAST                                  RAD_ALL.20887 
     &   , OMEGA, ASYMMETRY, SEC_0                                                 RAD_ALL.20888 
     &   , I_2STREAM                                                               RAD_ALL.20889 
     &   , SUM, DIFF, LAMBDA                                                       RAD_ALL.20890 
     &   , GAMMA_UP, GAMMA_DOWN                                                    RAD_ALL.20891 
     &   , NPD_PROFILE, NPD_LAYER                                                  RAD_ALL.20892 
     &   )                                                                         RAD_ALL.20893 
!                                                                                  RAD_ALL.20894 
!                                                                                  RAD_ALL.20895 
!                                                                                  RAD_ALL.20896 
      IMPLICIT NONE                                                                RAD_ALL.20897 
!                                                                                  RAD_ALL.20898 
!                                                                                  RAD_ALL.20899 
!     SIZES OF DUMMY ARRAYS.                                                       RAD_ALL.20900 
      INTEGER                                                                      RAD_ALL.20901 
     &     NPD_PROFILE                                                             RAD_ALL.20902 
!             MAXIMUM NUMBER OF PROFILES                                           RAD_ALL.20903 
     &   , NPD_LAYER                                                               RAD_ALL.20904 
!             MAXIMUM NUMBER OF LAYERS                                             RAD_ALL.20905 
!                                                                                  RAD_ALL.20906 
!     INCLUDE COMDECKS.                                                            RAD_ALL.20907 
!     ------------------------------------------------------------------           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    
!     ------------------------------------------------------------------           TWOSTR3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       TWOSTR3A.3     
!                                                                                  TWOSTR3A.4     
!     MODULE TO SET THE DEFINING NUMBERS FOR THE TWO-STREAM                        TWOSTR3A.5     
!     SCHEMES.                                                                     TWOSTR3A.6     
!                                                                                  TWOSTR3A.7     
      INTEGER                                                                      TWOSTR3A.8     
     &     IP_EDDINGTON                                                            TWOSTR3A.9     
!             EDDINGTON APPROXIMATION                                              TWOSTR3A.10    
     &   , IP_DISCRETE_ORD                                                         TWOSTR3A.11    
!             DISCRETE ORDINATE METHOD                                             TWOSTR3A.12    
     &   , IP_IFM                                                                  TWOSTR3A.13    
!             IMPROVED FLUX METHOD                                                 TWOSTR3A.14    
     &   , IP_PIFM85                                                               TWOSTR3A.15    
!             PRACTICAL IMPROVED FLUX METHOD                                       TWOSTR3A.16    
!             (VERSION OF ZDUNKOWSKI ET AL. 1985)                                  TWOSTR3A.17    
     &   , IP_ZDK_FLUX                                                             TWOSTR3A.18    
!             ZDUNKOWSKI'S FLUX METHOD                                             TWOSTR3A.19    
     &   , IP_KRSCHG_FLUX                                                          TWOSTR3A.20    
!             KERSCHGEN'S FLUX METHOD                                              TWOSTR3A.21    
     &   , IP_COAKLEY_CHYLEK_1                                                     TWOSTR3A.22    
!             COAKLEY & CHYLEK'S 1ST METHOD                                        TWOSTR3A.23    
     &   , IP_COAKLEY_CHYLEK_2                                                     TWOSTR3A.24    
!             COAKLEY & CHYLEK'S 2ND METHOD                                        TWOSTR3A.25    
     &   , IP_MEADOR_WEAVER                                                        TWOSTR3A.26    
!             MEADOR & WEAVER'S METHOD                                             TWOSTR3A.27    
     &   , IP_ELSASSER                                                             TWOSTR3A.28    
!             ELSASSER'S DIFFUSIVITY SCHEME                                        TWOSTR3A.29    
     &   , IP_2S_TEST                                                              TWOSTR3A.30    
!             USER'S DEFINED TEST APPROXIMATION.                                   TWOSTR3A.31    
     &   , IP_HEMI_MEAN                                                            TWOSTR3A.32    
!             HEMISPHERIC MEAN APPROXIMATION.                                      TWOSTR3A.33    
     &   , IP_PIFM80                                                               TWOSTR3A.34    
!             PRACTICAL IMPROVED FLUX METHOD                                       TWOSTR3A.35    
!             (VERSION OF ZDUNKOWSKI ET AL. 1980)                                  TWOSTR3A.36    
!                                                                                  TWOSTR3A.37    
      PARAMETER(                                                                   TWOSTR3A.38    
     &     IP_EDDINGTON=2                                                          TWOSTR3A.39    
     &   , IP_DISCRETE_ORD=4                                                       TWOSTR3A.40    
     &   , IP_IFM=5                                                                TWOSTR3A.41    
     &   , IP_PIFM85=6                                                             TWOSTR3A.42    
     &   , IP_ZDK_FLUX=7                                                           TWOSTR3A.43    
     &   , IP_KRSCHG_FLUX=8                                                        TWOSTR3A.44    
     &   , IP_COAKLEY_CHYLEK_1=9                                                   TWOSTR3A.45    
     &   , IP_COAKLEY_CHYLEK_2=10                                                  TWOSTR3A.46    
     &   , IP_MEADOR_WEAVER=11                                                     TWOSTR3A.47    
     &   , IP_ELSASSER=12                                                          TWOSTR3A.48    
     &   , IP_2S_TEST=14                                                           TWOSTR3A.49    
     &   , IP_HEMI_MEAN=15                                                         TWOSTR3A.50    
     &   , IP_PIFM80=16                                                            TWOSTR3A.51    
     &   )                                                                         TWOSTR3A.52    
!                                                                                  TWOSTR3A.53    
!     ------------------------------------------------------------------           TWOSTR3A.54    
!     ------------------------------------------------------------------           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    
!     ------------------------------------------------------------------           ERROR3A.2     
!     COMDECK FOR TWO-STREAM RADIATION CODE.                                       ERROR3A.3     
!                                                                                  ERROR3A.4     
!     MODULE TO SET ERROR FLAGS IN THE RADIATION CODE.                             ERROR3A.5     
!                                                                                  ERROR3A.6     
      INTEGER                                                                      ERROR3A.7     
     &     I_NORMAL                                                                ERROR3A.8     
!             ERROR FREE CONDITION                                                 ERROR3A.9     
     &   , I_ERR_FATAL                                                             ERROR3A.10    
!             FATAL ERROR: IMMEDIATE RETURN                                        ERROR3A.11    
     &   , I_ABORT_CALCULATION                                                     ERROR3A.12    
!             CALCULATION ABORTED                                                  ERROR3A.13    
     &   , I_MISSING_DATA                                                          ERROR3A.14    
!             MISSING DATA ERROR: CONDITIONAL                                      ERROR3A.15    
     &   , I_ERR_IO                                                                ERROR3A.16    
!             I/O ERROR                                                            ERROR3A.17    
     &   , I_ERR_RANGE                                                             ERROR3A.18    
!             INTERPOLATION RANGE ERROR                                            ERROR3A.19    
     &   , I_ERR_EXIST                                                             ERROR3A.20    
!             EXISTENCE ERROR                                                      ERROR3A.21    
!                                                                                  ERROR3A.22    
      PARAMETER(                                                                   ERROR3A.23    
     &     I_NORMAL=0                                                              ERROR3A.24    
     &   , I_ERR_FATAL=1                                                           ERROR3A.25    
     &   , I_ABORT_CALCULATION=2                                                   ERROR3A.26    
     &   , I_MISSING_DATA=3                                                        ERROR3A.27    
     &   , I_ERR_IO=4                                                              ERROR3A.28    
     &   , I_ERR_RANGE=5                                                           ERROR3A.29    
     &   , I_ERR_EXIST=6                                                           ERROR3A.30    
     &   )                                                                         ERROR3A.31    
!                                                                                  ERROR3A.32    
!     ------------------------------------------------------------------           ERROR3A.33    
!                                                                                  RAD_ALL.20913 
!                                                                                  RAD_ALL.20914 
!     DUMMY VARIABLES.                                                             RAD_ALL.20915 
      INTEGER   !, INTENT(OUT)                                                     RAD_ALL.20916 
     &     IERR                                                                    RAD_ALL.20917 
!             ERROR FLAG                                                           RAD_ALL.20918 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.20919 
     &     N_PROFILE                                                               RAD_ALL.20920 
!             NUMBER OF PROFILES                                                   RAD_ALL.20921 
     &   , I_LAYER_FIRST                                                           RAD_ALL.20922 
!             FIRST LAYER TO CONSIDER                                              RAD_ALL.20923 
     &   , I_LAYER_LAST                                                            RAD_ALL.20924 
!             FIRST LAYER TO CONSIDER                                              RAD_ALL.20925 
     &   , I_2STREAM                                                               RAD_ALL.20926 
!             TWO-STREAM SCHEME                                                    RAD_ALL.20927 
!                                                                                  RAD_ALL.20928 
      REAL      !, INTENT(IN)                                                      RAD_ALL.20929 
     &     OMEGA(NPD_PROFILE, NPD_LAYER)                                           RAD_ALL.20930 
!             ALBEDO OF SINGLE SCATTERING                                          RAD_ALL.20931 
     &   , ASYMMETRY(NPD_PROFILE, NPD_LAYER)                                       RAD_ALL.20932 
!             ASYMMETRY                                                            RAD_ALL.20933 
     &   , SEC_0(NPD_PROFILE)                                                      RAD_ALL.20934 
!             SECANT OF SOLAR ZENITH ANGLE                                         RAD_ALL.20935 
     &   , SUM(NPD_PROFILE, NPD_LAYER)                                             RAD_ALL.20936 
!             SUM OF TWO-STREAM COEFFICIENTS                                       RAD_ALL.20937 
     &   , DIFF(NPD_PROFILE, NPD_LAYER)                                            RAD_ALL.20938 
!             DIFFERENCE OF TWO-STREAM COEFFICIENTS                                RAD_ALL.20939 
     &   , LAMBDA(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.20940 
!             LAMBDA                                                               RAD_ALL.20941 
!                                                                                  RAD_ALL.20942 
!     BASIC TWO-STREAM COEFFICIENTS:                                               RAD_ALL.20943 
      REAL      !, INTENT(OUT)                                                     RAD_ALL.20944 
     &     GAMMA_UP(NPD_PROFILE, NPD_LAYER)                                        RAD_ALL.20945 
!             COEFFICIENT FOR UPWARD RADIATION                                     RAD_ALL.20946 
     &   , GAMMA_DOWN(NPD_PROFILE, NPD_LAYER)                                      RAD_ALL.20947 
!             COEFFICIENT FOR DOWNWAD RADIATION                                    RAD_ALL.20948 
!                                                                                  RAD_ALL.20949 
!                                                                                  RAD_ALL.20950 
!     LOCAL VARIABLES.                                                             RAD_ALL.20951 
      INTEGER                                                                      RAD_ALL.20952 
     &     I                                                                       RAD_ALL.20953 
!             LOOP VARIABLE                                                        RAD_ALL.20954 
     &   , L                                                                       RAD_ALL.20955 
!             LOOP VARIABLE                                                        RAD_ALL.20956 
     &   , K                                                                       RAD_ALL.20957 
!             LOOP VARIABLE                                                        RAD_ALL.20958 
     &   , KK                                                                      RAD_ALL.20959 
!             TEMPORARY VARIABLE                                                   RAD_ALL.20960 
     &   , N_INDEX                                                                 RAD_ALL.20961 
!             NUMBER OF INDICES SATISFYING TEST                                    RAD_ALL.20962 
     &   , INDEX(NPD_PROFILE)                                                      RAD_ALL.20963 
!             INDICES OF TESTED POINTS                                             RAD_ALL.20964 
      REAL                                                                         RAD_ALL.20965 
     &     KSI_0(NPD_PROFILE, NPD_LAYER)                                           RAD_ALL.20966 
!             DIFFERENCE IN SOLAR SCATTERING FRACTIONS                             RAD_ALL.20967 
     &   , TEST_ARRAY(NPD_PROFILE)                                                 RAD_ALL.20968 
!             ARRAY TO TEST                                                        RAD_ALL.20969 
     &   , FACTOR                                                                  RAD_ALL.20970 
!             TEMPORARY VARIABLE                                                   RAD_ALL.20971 
      REAL                                                                         RAD_ALL.20972 
     &     ROOT_3                                                                  RAD_ALL.20973 
!             SQUARE ROOT OF 3                                                     RAD_ALL.20974 
      PARAMETER(                                                                   RAD_ALL.20975 
     &     ROOT_3=1.7320508075688772E+00                                           RAD_ALL.20976 
     &   )                                                                         RAD_ALL.20977 
!                                                                                  RAD_ALL.20978 
!     SUBROUTINES CALLED:                                                          RAD_ALL.20979 
!                                                                                  RAD_ALL.20980 
!     CRAY DIRECTIVES FOR THE WHOLE ROUTINE:                                       RAD_ALL.20981 
!     POINTS ARE NOT REPEATED IN THE INDEXING ARRAY, SO IT IS SAFE                 RAD_ALL.20982 
!     TO VECTORIZE OVER INDIRECTLY ADDRESSED ARRAYS.                               RAD_ALL.20983 
Cfpp$ NODEPCHK R                                                                   RAD_ALL.20984 
!                                                                                  RAD_ALL.20985 
!                                                                                  RAD_ALL.20986 
!                                                                                  RAD_ALL.20987 
!     IF LAMBDA IS TOO CLOSE TO SEC_0 IT MUST BE PERTURBED                         RAD_ALL.20988 
      DO I=I_LAYER_FIRST, I_LAYER_LAST                                             RAD_ALL.20989 
         DO L=1, N_PROFILE                                                         RAD_ALL.20990 
            TEST_ARRAY(L)=ABS(LAMBDA(L, I)-SEC_0(L))                               RAD_ALL.20991 
         ENDDO                                                                     RAD_ALL.20992 
!                                                                                  RAD_ALL.20993 
         N_INDEX=0                                                                 RAD_ALL.20994 
         DO L   =1,N_PROFILE                                                       RAD_ALL.20995 
           IF (TEST_ARRAY(L).LT.TOL_DIV) THEN                                      RAD_ALL.20996 
             N_INDEX =N_INDEX+1                                                    RAD_ALL.20997 
             INDEX(N_INDEX)=L                                                      RAD_ALL.20998 
           END IF                                                                  RAD_ALL.20999 
         END DO                                                                    RAD_ALL.21000 
!                                                                                  RAD_ALL.21001 
CDIR$ IVDEP                                                                        RAD_ALL.21002 
         DO K=1, N_INDEX                                                           RAD_ALL.21003 
            KK=INDEX(K)                                                            RAD_ALL.21004 
            SUM(KK, I)=(1.0E+00+TOL_DIV)*SUM(KK, I)                                RAD_ALL.21005 
            DIFF(KK, I)=(1.0E+00+TOL_DIV)*DIFF(KK, I)                              RAD_ALL.21006 
            LAMBDA(KK, I)=(1.0E+00+TOL_DIV)*LAMBDA(KK, I)                          RAD_ALL.21007 
         ENDDO                                                                     RAD_ALL.21008 
      ENDDO                                                                        RAD_ALL.21009 
!                                                                                  RAD_ALL.21010 
      IF ( (I_2STREAM.EQ.IP_EDDINGTON).OR.                                         RAD_ALL.21011 
     &     (I_2STREAM.EQ.IP_ELSASSER).OR.                                          RAD_ALL.21012 
     &     (I_2STREAM.EQ.IP_PIFM85).OR.                                            RAD_ALL.21013 
     &     (I_2STREAM.EQ.IP_2S_TEST).OR.                                           RAD_ALL.21014 
     &     (I_2STREAM.EQ.IP_HEMI_MEAN).OR.                                         RAD_ALL.21015 
     &     (I_2STREAM.EQ.IP_PIFM80) ) THEN                                         RAD_ALL.21016 
!                                                                                  RAD_ALL.21017 
          DO I=I_LAYER_FIRST, I_LAYER_LAST                                         RAD_ALL.21018 
             DO L=1, N_PROFILE                                                     RAD_ALL.21019 
                KSI_0(L, I)=1.5E+00*ASYMMETRY(L, I)/SEC_0(L)                       RAD_ALL.21020 
             ENDDO                                                                 RAD_ALL.21021 
          ENDDO                                                                    RAD_ALL.21022 
!                                                                                  RAD_ALL.21023 
       ELSE IF (I_2STREAM.EQ.IP_DISCRETE_ORD) THEN                                 RAD_ALL.21024 
!                                                                                  RAD_ALL.21025 
          DO I=I_LAYER_FIRST, I_LAYER_LAST                                         RAD_ALL.21026 
             DO L=1, N_PROFILE                                                     RAD_ALL.21027 
                KSI_0(L, I)=ROOT_3*ASYMMETRY(L, I)/SEC_0(L)                        RAD_ALL.21028 
             ENDDO                                                                 RAD_ALL.21029 
          ENDDO                                                                    RAD_ALL.21030 
!                                                                                  RAD_ALL.21031 
       ELSE                                                                        RAD_ALL.21032 
!                                                                                  RAD_ALL.21033 
         WRITE(IU_ERR, '(/A)')                                                     RAD_ALL.21034 
     &      '*** ERROR: AN ILLEGAL SOLAR TWO-STREAM SCHEME HAS '                   RAD_ALL.21035 
     &      //'BEEN SELECTED.'                                                     RAD_ALL.21036 
         IERR=I_ERR_FATAL                                                          RAD_ALL.21037 
         RETURN                                                                    RAD_ALL.21038 
!                                                                                  RAD_ALL.21039 
      ENDIF                                                                        RAD_ALL.21040 
!                                                                                  RAD_ALL.21041 
!                                                                                  RAD_ALL.21042 
!     DETERMINE THE BASIC SOLAR COEFFICIENTS FOR THE                               RAD_ALL.21043 
!     TWO-STREAM EQUATIONS.                                                        RAD_ALL.21044 
!                                                                                  RAD_ALL.21045 
      DO I=I_LAYER_FIRST, I_LAYER_LAST                                             RAD_ALL.21046 
         DO L=1, N_PROFILE                                                         RAD_ALL.21047 
            FACTOR=0.5E+00*OMEGA(L, I)*SEC_0(L)                                    RAD_ALL.21048 
     &         /((LAMBDA(L, I)-SEC_0(L))*(LAMBDA(L, I)+SEC_0(L)))                  RAD_ALL.21049 
            GAMMA_UP(L, I)=FACTOR*(SUM(L, I)-SEC_0(L)                              RAD_ALL.21050 
     &         -KSI_0(L, I)*(DIFF(L, I)-SEC_0(L)))                                 RAD_ALL.21051 
            GAMMA_DOWN(L, I)=FACTOR*(SUM(L, I)+SEC_0(L)                            RAD_ALL.21052 
     &         +KSI_0(L, I)*(DIFF(L, I)+SEC_0(L)))                                 RAD_ALL.21053 
         ENDDO                                                                     RAD_ALL.21054 
      ENDDO                                                                        RAD_ALL.21055 
!                                                                                  RAD_ALL.21056 
!                                                                                  RAD_ALL.21057 
!                                                                                  RAD_ALL.21058 
      RETURN                                                                       RAD_ALL.21059 
      END  
