C *****************************COPYRIGHT******************************             RAD_ALL.19495 
C (c) CROWN COPYRIGHT 1996, METEOROLOGICAL OFFICE, All Rights Reserved.            RAD_ALL.19496 
C                                                                                  RAD_ALL.19497 
C Use, duplication or disclosure of this code is subject to the                    RAD_ALL.19498 
C restrictions as set forth in the contract.                                       RAD_ALL.19499 
C                                                                                  RAD_ALL.19500 
C                Meteorological Office                                             RAD_ALL.19501 
C                London Road                                                       RAD_ALL.19502 
C                BRACKNELL                                                         RAD_ALL.19503 
C                Berkshire UK                                                      RAD_ALL.19504 
C                RG12 2SZ                                                          RAD_ALL.19505 
C                                                                                  RAD_ALL.19506 
C If no contract has been raised with this copy of the code, the use,              RAD_ALL.19507 
C duplication or disclosure of it is strictly prohibited.  Permission              RAD_ALL.19508 
C to do so must first be obtained in writing from the Head of Numerical            RAD_ALL.19509 
C Modelling at the above address.                                                  RAD_ALL.19510 
C ******************************COPYRIGHT******************************            RAD_ALL.19511 
C                                                                                  RAD_ALL.19512 
!+ Subroutine to solve for triple overlaps with approximate scattering.            RAD_ALL.19513 
!                                                                                  RAD_ALL.19514 
! Method:                                                                          RAD_ALL.19515 
!       The flux is propagated downwards, ignoring reflection terms.               RAD_ALL.19516 
!       Since the routine uses differential fluxes, this effectively               RAD_ALL.19517 
!       treats the upward flux as Planckian at this point. Upward                  RAD_ALL.19518 
!       fluxes are calculated using the newly available approximate                RAD_ALL.19519 
!       downward fluxes in the reflected terms.                                    RAD_ALL.19520 
!                                                                                  RAD_ALL.19521 
! Current Owner of Code: J. M. Edwards                                             RAD_ALL.19522 
!                                                                                  RAD_ALL.19523 
! History:                                                                         RAD_ALL.19524 
!       Version         Date                    Comment                            RAD_ALL.19525 
!       4.2             10-04-96                Original Code                      RAD_ALL.19526 
!                                               (J. M. Edwards)                    RAD_ALL.19527 
!                                                                                  RAD_ALL.19528 
! Description of Code:                                                             RAD_ALL.19529 
!   FORTRAN 77  with extensions listed in documentation.                           RAD_ALL.19530 
!                                                                                  RAD_ALL.19531 
!- ---------------------------------------------------------------------           RAD_ALL.19532 
      SUBROUTINE SOLVER_TRIPLE_APP_SCAT(N_PROFILE, N_LAYER, N_CLOUD_TOP            RAD_ALL.19533 
     &   , T, R, S_DOWN, S_UP                                                      RAD_ALL.19534 
     &   , T_STRAT, R_STRAT, S_DOWN_STRAT, S_UP_STRAT                              RAD_ALL.19535 
     &   , T_CONV, R_CONV, S_DOWN_CONV, S_UP_CONV                                  RAD_ALL.19536 
     &   , V11, V12, V13, V21, V22, V23, V31, V32, V33                             RAD_ALL.19537 
     &   , U11, U12, U13, U21, U22, U23, U31, U32, U33                             RAD_ALL.19538 
     &   , L_NET                                                                   RAD_ALL.19539 
     &   , FLUX_INC_DOWN                                                           RAD_ALL.19540 
     &   , SOURCE_GROUND_FREE, SOURCE_GROUND_STRAT                                 RAD_ALL.19541 
     &   , SOURCE_GROUND_CONV, ALBEDO_SURFACE_DIFF                                 RAD_ALL.19542 
     &   , FLUX_TOTAL                                                              RAD_ALL.19543 
     &   , NPD_PROFILE, NPD_LAYER                                                  RAD_ALL.19544 
     &   )                                                                         RAD_ALL.19545 
!                                                                                  RAD_ALL.19546 
!                                                                                  RAD_ALL.19547 
      IMPLICIT NONE                                                                RAD_ALL.19548 
!                                                                                  RAD_ALL.19549 
!                                                                                  RAD_ALL.19550 
!     SIZES OF DUMMY ARRAYS.                                                       RAD_ALL.19551 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.19552 
     &     NPD_PROFILE                                                             RAD_ALL.19553 
!             MAXIMUM NUMBER OF PROFILES                                           RAD_ALL.19554 
     &   , NPD_LAYER                                                               RAD_ALL.19555 
!             MAXIMUM NUMBER OF LAYERS                                             RAD_ALL.19556 
!                                                                                  RAD_ALL.19557 
!                                                                                  RAD_ALL.19558 
!     DUMMY ARGUMENTS.                                                             RAD_ALL.19559 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.19560 
     &     N_PROFILE                                                               RAD_ALL.19561 
!             NUMBER OF PROFILES                                                   RAD_ALL.19562 
     &   , N_LAYER                                                                 RAD_ALL.19563 
!             NUMBER OF LAYERS                                                     RAD_ALL.19564 
     &   , N_CLOUD_TOP                                                             RAD_ALL.19565 
!             TOPMOST CLOUDY LAYER                                                 RAD_ALL.19566 
      LOGICAL   !, INTENT(IN)                                                      RAD_ALL.19567 
     &     L_NET                                                                   RAD_ALL.19568 
!             FLAG FOR CALCULATION OF NET FLUXES                                   RAD_ALL.19569 
      REAL      !, INTENT(IN)                                                      RAD_ALL.19570 
     &     T(NPD_PROFILE, NPD_LAYER)                                               RAD_ALL.19571 
!             CLEAR-SKY TRANSMISSION                                               RAD_ALL.19572 
     &   , R(NPD_PROFILE, NPD_LAYER)                                               RAD_ALL.19573 
!             CLEAR-SKY REFLECTION                                                 RAD_ALL.19574 
     &   , S_DOWN(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.19575 
!             CLEAR-SKY DOWNWARD SOURCE FUNCTION                                   RAD_ALL.19576 
     &   , S_UP(NPD_PROFILE, NPD_LAYER)                                            RAD_ALL.19577 
!             CLEAR-SKY UPWARD SOURCE FUNCTION                                     RAD_ALL.19578 
     &   , T_STRAT(NPD_PROFILE, NPD_LAYER)                                         RAD_ALL.19579 
!             STRATFIFORM TRANSMISSION                                             RAD_ALL.19580 
     &   , R_STRAT(NPD_PROFILE, NPD_LAYER)                                         RAD_ALL.19581 
!             STRATFIFORM REFLECTION                                               RAD_ALL.19582 
     &   , S_DOWN_STRAT(NPD_PROFILE, NPD_LAYER)                                    RAD_ALL.19583 
!             DOWNWARD STRATFIFORM SOURCE FUNCTION                                 RAD_ALL.19584 
     &   , S_UP_STRAT(NPD_PROFILE, NPD_LAYER)                                      RAD_ALL.19585 
!             UPWARD STRATFIFORM SOURCE FUNCTION                                   RAD_ALL.19586 
     &   , T_CONV(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.19587 
!             CONVECTIVE TRANSMISSION                                              RAD_ALL.19588 
     &   , R_CONV(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.19589 
!             CONVECTIVE REFLECTION                                                RAD_ALL.19590 
     &   , S_DOWN_CONV(NPD_PROFILE, NPD_LAYER)                                     RAD_ALL.19591 
!             DOWNWARD CONVECTIVE SOURCE FUNCTION                                  RAD_ALL.19592 
     &   , S_UP_CONV(NPD_PROFILE, NPD_LAYER)                                       RAD_ALL.19593 
!             UPWARD CONVECTIVE SOURCE FUNCTION                                    RAD_ALL.19594 
      REAL      !, INTENT(IN)                                                      RAD_ALL.19595 
     &     V11(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19596 
!             ENERGY TRANSFER COEFFICIENT FOR DOWNWARD RADIATION                   RAD_ALL.19597 
     &   , V12(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19598 
!             ENERGY TRANSFER COEFFICIENT FOR DOWNWARD RADIATION                   RAD_ALL.19599 
     &   , V13(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19600 
!             ENERGY TRANSFER COEFFICIENT FOR DOWNWARD RADIATION                   RAD_ALL.19601 
     &   , V21(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19602 
!             ENERGY TRANSFER COEFFICIENT FOR DOWNWARD RADIATION                   RAD_ALL.19603 
     &   , V22(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19604 
!             ENERGY TRANSFER COEFFICIENT FOR DOWNWARD RADIATION                   RAD_ALL.19605 
     &   , V23(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19606 
!             ENERGY TRANSFER COEFFICIENT FOR DOWNWARD RADIATION                   RAD_ALL.19607 
     &   , V31(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19608 
!             ENERGY TRANSFER COEFFICIENT FOR DOWNWARD RADIATION                   RAD_ALL.19609 
     &   , V32(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19610 
!             ENERGY TRANSFER COEFFICIENT FOR DOWNWARD RADIATION                   RAD_ALL.19611 
     &   , V33(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19612 
!             ENERGY TRANSFER COEFFICIENT FOR DOWNWARD RADIATION                   RAD_ALL.19613 
      REAL                                                                         RAD_ALL.19614 
     &     U11(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19615 
!             ENERGY TRANSFER COEFFICIENT FOR UPWARD RADIATION                     RAD_ALL.19616 
     &   , U12(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19617 
!             ENERGY TRANSFER COEFFICIENT FOR UPWARD RADIATION                     RAD_ALL.19618 
     &   , U13(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19619 
!             ENERGY TRANSFER COEFFICIENT FOR UPWARD RADIATION                     RAD_ALL.19620 
     &   , U21(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19621 
!             ENERGY TRANSFER COEFFICIENT FOR UPWARD RADIATION                     RAD_ALL.19622 
     &   , U22(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19623 
!             ENERGY TRANSFER COEFFICIENT FOR UPWARD RADIATION                     RAD_ALL.19624 
     &   , U23(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19625 
!             ENERGY TRANSFER COEFFICIENT FOR UPWARD RADIATION                     RAD_ALL.19626 
     &   , U31(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19627 
!             ENERGY TRANSFER COEFFICIENT FOR UPWARD RADIATION                     RAD_ALL.19628 
     &   , U32(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19629 
!             ENERGY TRANSFER COEFFICIENT FOR UPWARD RADIATION                     RAD_ALL.19630 
     &   , U33(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.19631 
!             ENERGY TRANSFER COEFFICIENT FOR UPWARD RADIATION                     RAD_ALL.19632 
      REAL      !, INTENT(IN)                                                      RAD_ALL.19633 
     &     FLUX_INC_DOWN(NPD_PROFILE)                                              RAD_ALL.19634 
!             INCIDENT FLUX                                                        RAD_ALL.19635 
     &   , SOURCE_GROUND_FREE(NPD_PROFILE)                                         RAD_ALL.19636 
!             SOURCE FROM GROUND (CLEAR SKY)                                       RAD_ALL.19637 
     &   , SOURCE_GROUND_STRAT(NPD_PROFILE)                                        RAD_ALL.19638 
!             SOURCE FROM GROUND (CLOUDY REGION)                                   RAD_ALL.19639 
     &   , SOURCE_GROUND_CONV(NPD_PROFILE)                                         RAD_ALL.19640 
!             SOURCE FROM GROUND (CLOUDY REGION)                                   RAD_ALL.19641 
     &   , ALBEDO_SURFACE_DIFF(NPD_PROFILE)                                        RAD_ALL.19642 
!             DIFFUSE ALBEDO                                                       RAD_ALL.19643 
      REAL      !, INTENT(OUT)                                                     RAD_ALL.19644 
     &     FLUX_TOTAL(NPD_PROFILE, 2*NPD_LAYER+2)                                  RAD_ALL.19645 
!             TOTAL FLUX                                                           RAD_ALL.19646 
!                                                                                  RAD_ALL.19647 
!     LOCAL VARIABLES.                                                             RAD_ALL.19648 
      INTEGER                                                                      RAD_ALL.19649 
     &     I                                                                       RAD_ALL.19650 
!             LOOP VARIABLE                                                        RAD_ALL.19651 
     &   , L                                                                       RAD_ALL.19652 
!             LOOP VARIABLE                                                        RAD_ALL.19653 
!                                                                                  RAD_ALL.19654 
!                                                                                  RAD_ALL.19655 
!     TEMPORARY FLUXES                                                             RAD_ALL.19656 
      REAL                                                                         RAD_ALL.19657 
     &     FLUX_DOWN_1(NPD_PROFILE, 0: NPD_LAYER)                                  RAD_ALL.19658 
!             DOWNWARD FLUXES OUTSIDE CLOUDS JUST BELOW I'TH LEVEL                 RAD_ALL.19659 
     &   , FLUX_DOWN_2(NPD_PROFILE, 0: NPD_LAYER)                                  RAD_ALL.19660 
!             DOWNWARD FLUXES INSIDE CLOUDS JUST BELOW I'TH LEVEL                  RAD_ALL.19661 
     &   , FLUX_DOWN_3(NPD_PROFILE, 0: NPD_LAYER)                                  RAD_ALL.19662 
!             DOWNWARD FLUXES INSIDE CLOUDS JUST BELOW I'TH LEVEL                  RAD_ALL.19663 
     &   , FLUX_UP_1(NPD_PROFILE, 0: NPD_LAYER)                                    RAD_ALL.19664 
!             UPWARD FLUXES OUTSIDE CLOUDS JUST ABOVE I'TH LEVEL                   RAD_ALL.19665 
     &   , FLUX_UP_2(NPD_PROFILE, 0: NPD_LAYER)                                    RAD_ALL.19666 
!             UPWARD FLUXES INSIDE CLOUDS JUST ABOVE I'TH LEVEL                    RAD_ALL.19667 
     &   , FLUX_UP_3(NPD_PROFILE, 0: NPD_LAYER)                                    RAD_ALL.19668 
!             UPWARD FLUXES INSIDE CLOUDS JUST ABOVE I'TH LEVEL                    RAD_ALL.19669 
     &   , FLUX_PROPAG_1(NPD_PROFILE)                                              RAD_ALL.19670 
!             TEMPORARY FLUXES FOR PROPAGATION ACROSS LAYERS                       RAD_ALL.19671 
     &   , FLUX_PROPAG_2(NPD_PROFILE)                                              RAD_ALL.19672 
!             TEMPORARY FLUXES FOR PROPAGATION ACROSS LAYERS                       RAD_ALL.19673 
     &   , FLUX_PROPAG_3(NPD_PROFILE)                                              RAD_ALL.19674 
!             TEMPORARY FLUXES FOR PROPAGATION ACROSS LAYERS                       RAD_ALL.19675 
!                                                                                  RAD_ALL.19676 
!                                                                                  RAD_ALL.19677 
!                                                                                  RAD_ALL.19678 
!                                                                                  RAD_ALL.19679 
!     THE ARRAYS FLUX_DOWN AND FLUX_UP WILL EVENTUALLY CONTAIN THE TOTAL           RAD_ALL.19680 
!     FLUXES, BUT INITIALLY THEY ARE USED FOR THE CLEAR FLUXES.                    RAD_ALL.19681 
!     NOTE THAT DOWNWARD FLUXES REFER TO VALUES JUST BELOW THE INTERFACE           RAD_ALL.19682 
!     AND UPWARD FLUXES TO VALUES JUST ABOVE IT.                                   RAD_ALL.19683 
!                                                                                  RAD_ALL.19684 
!                                                                                  RAD_ALL.19685 
!     DOWNWARD FLUX:                                                               RAD_ALL.19686 
!                                                                                  RAD_ALL.19687 
!     REGION ABOVE CLOUDS:                                                         RAD_ALL.19688 
      DO L=1, N_PROFILE                                                            RAD_ALL.19689 
         FLUX_TOTAL(L, 2)=FLUX_INC_DOWN(L)                                         RAD_ALL.19690 
      ENDDO                                                                        RAD_ALL.19691 
      DO I=1, N_CLOUD_TOP-1                                                        RAD_ALL.19692 
         DO L=1, N_PROFILE                                                         RAD_ALL.19693 
            FLUX_TOTAL(L, 2*I+2)=T(L, I)*FLUX_TOTAL(L, 2*I)                        RAD_ALL.19694 
     &         +S_DOWN(L, I)                                                       RAD_ALL.19695 
         ENDDO                                                                     RAD_ALL.19696 
      ENDDO                                                                        RAD_ALL.19697 
!                                                                                  RAD_ALL.19698 
!     PASS INTO THE CLOUDY REGION. HERE, DOWNWARD FLUXES HOLD VALUES               RAD_ALL.19699 
!     JUST BELOW THE LEVEL AND UPWARD FLUXES THE VALUES JUST ABOVE IT.             RAD_ALL.19700 
!     THUS THE FLUXES IMPINGING ON THE LAYER ARE HELD.                             RAD_ALL.19701 
      I=N_CLOUD_TOP-1                                                              RAD_ALL.19702 
      DO L=1, N_PROFILE                                                            RAD_ALL.19703 
         FLUX_DOWN_1(L, I)=V11(L, I)*FLUX_TOTAL(L, 2*I+2)                          RAD_ALL.19704 
         FLUX_DOWN_2(L, I)=V21(L, I)*FLUX_TOTAL(L, 2*I+2)                          RAD_ALL.19705 
         FLUX_DOWN_3(L, I)=V31(L, I)*FLUX_TOTAL(L, 2*I+2)                          RAD_ALL.19706 
      ENDDO                                                                        RAD_ALL.19707 
!                                                                                  RAD_ALL.19708 
      DO I=N_CLOUD_TOP, N_LAYER-1                                                  RAD_ALL.19709 
         DO L=1, N_PROFILE                                                         RAD_ALL.19710 
!                                                                                  RAD_ALL.19711 
!           PROPAGTE THE FLUX ACROSS THE LAYER.                                    RAD_ALL.19712 
            FLUX_PROPAG_1(L)=T(L, I)*FLUX_DOWN_1(L, I-1)                           RAD_ALL.19713 
     &         +S_DOWN(L, I)                                                       RAD_ALL.19714 
            FLUX_PROPAG_2(L)=T_STRAT(L, I)*FLUX_DOWN_2(L, I-1)                     RAD_ALL.19715 
     &         +S_DOWN_STRAT(L, I)                                                 RAD_ALL.19716 
            FLUX_PROPAG_3(L)=T_CONV(L, I)*FLUX_DOWN_3(L, I-1)                      RAD_ALL.19717 
     &         +S_DOWN_CONV(L, I)                                                  RAD_ALL.19718 
!                                                                                  RAD_ALL.19719 
!           TRANSFER ACROSS THE INTERFACE.                                         RAD_ALL.19720 
            FLUX_DOWN_1(L, I)=V11(L, I)*FLUX_PROPAG_1(L)                           RAD_ALL.19721 
     &         +V12(L, I)*FLUX_PROPAG_2(L)                                         RAD_ALL.19722 
     &         +V13(L, I)*FLUX_PROPAG_3(L)                                         RAD_ALL.19723 
            FLUX_DOWN_2(L, I)=V21(L, I)*FLUX_PROPAG_1(L)                           RAD_ALL.19724 
     &         +V22(L, I)*FLUX_PROPAG_2(L)                                         RAD_ALL.19725 
     &         +V23(L, I)*FLUX_PROPAG_3(L)                                         RAD_ALL.19726 
            FLUX_DOWN_3(L, I)=V31(L, I)*FLUX_PROPAG_1(L)                           RAD_ALL.19727 
     &         +V32(L, I)*FLUX_PROPAG_2(L)                                         RAD_ALL.19728 
     &         +V33(L, I)*FLUX_PROPAG_3(L)                                         RAD_ALL.19729 
!                                                                                  RAD_ALL.19730 
         ENDDO                                                                     RAD_ALL.19731 
      ENDDO                                                                        RAD_ALL.19732 
!                                                                                  RAD_ALL.19733 
!     PROPAGATE ACROSS THE BOTTOM LAYER AND FORM THE REFLECTED BEAM.               RAD_ALL.19734 
!     WE DO NOT TRANSFER FLUXES ACROSS THE BOTTOM INTERFACE, SO AS                 RAD_ALL.19735 
!     TO MAKE THE REFLECTION CONSISTENT BETWEEN REGIONS.                           RAD_ALL.19736 
      DO L=1, N_PROFILE                                                            RAD_ALL.19737 
!                                                                                  RAD_ALL.19738 
!        PROPAGTE THE FLUX THROUGH THE LAYER.                                      RAD_ALL.19739 
         FLUX_DOWN_1(L, N_LAYER)                                                   RAD_ALL.19740 
     &      =T(L, N_LAYER)*FLUX_DOWN_1(L, N_LAYER-1)                               RAD_ALL.19741 
     &      +S_DOWN(L, N_LAYER)                                                    RAD_ALL.19742 
         FLUX_DOWN_2(L, N_LAYER)                                                   RAD_ALL.19743 
     &      =T_STRAT(L, N_LAYER)*FLUX_DOWN_2(L, N_LAYER-1)                         RAD_ALL.19744 
     &      +S_DOWN_STRAT(L, N_LAYER)                                              RAD_ALL.19745 
         FLUX_DOWN_3(L, N_LAYER)                                                   RAD_ALL.19746 
     &      =T_CONV(L, N_LAYER)*FLUX_DOWN_3(L, N_LAYER-1)                          RAD_ALL.19747 
     &      +S_DOWN_CONV(L, N_LAYER)                                               RAD_ALL.19748 
!                                                                                  RAD_ALL.19749 
!        REFLECT FROM THE SURFACE.                                                 RAD_ALL.19750 
         FLUX_UP_1(L, N_LAYER)                                                     RAD_ALL.19751 
     &      =ALBEDO_SURFACE_DIFF(L)*FLUX_DOWN_1(L, N_LAYER)                        RAD_ALL.19752 
     &      +SOURCE_GROUND_FREE(L)                                                 RAD_ALL.19753 
         FLUX_UP_2(L, I)                                                           RAD_ALL.19754 
     &      =ALBEDO_SURFACE_DIFF(L)*FLUX_DOWN_2(L, N_LAYER)                        RAD_ALL.19755 
     &      +SOURCE_GROUND_STRAT(L)                                                RAD_ALL.19756 
         FLUX_UP_3(L, I)                                                           RAD_ALL.19757 
     &      =ALBEDO_SURFACE_DIFF(L)*FLUX_DOWN_3(L, N_LAYER)                        RAD_ALL.19758 
     &      +SOURCE_GROUND_CONV(L)                                                 RAD_ALL.19759 
!                                                                                  RAD_ALL.19760 
!        PROPAGATE ACROSS THE BOTTOM LAYER.                                        RAD_ALL.19761 
         FLUX_PROPAG_1(L)                                                          RAD_ALL.19762 
     &      =T(L, N_LAYER)*FLUX_UP_1(L, N_LAYER)+S_UP(L, N_LAYER)                  RAD_ALL.19763 
     &      +R(L, N_LAYER)*FLUX_DOWN_1(L, N_LAYER-1)                               RAD_ALL.19764 
         FLUX_PROPAG_2(L)                                                          RAD_ALL.19765 
     &      =T_STRAT(L, N_LAYER)*FLUX_UP_2(L, N_LAYER)                             RAD_ALL.19766 
     &      +S_UP_STRAT(L, N_LAYER)                                                RAD_ALL.19767 
     &      +R_STRAT(L, N_LAYER)*FLUX_DOWN_2(L, N_LAYER-1)                         RAD_ALL.19768 
         FLUX_PROPAG_3(L)                                                          RAD_ALL.19769 
     &      =T_CONV(L, N_LAYER)*FLUX_UP_3(L, N_LAYER)                              RAD_ALL.19770 
     &      +S_UP_CONV(L, N_LAYER)                                                 RAD_ALL.19771 
     &      +R_CONV(L, N_LAYER)*FLUX_DOWN_3(L, N_LAYER-1)                          RAD_ALL.19772 
!                                                                                  RAD_ALL.19773 
      ENDDO                                                                        RAD_ALL.19774 
!                                                                                  RAD_ALL.19775 
!                                                                                  RAD_ALL.19776 
!                                                                                  RAD_ALL.19777 
!     WORK BACK UP THROUGH THE COLUMN ASSIGNING THE UPWARD FLUXES.                 RAD_ALL.19778 
      DO I=N_LAYER-1, N_CLOUD_TOP, -1                                              RAD_ALL.19779 
         DO L=1, N_PROFILE                                                         RAD_ALL.19780 
!                                                                                  RAD_ALL.19781 
            FLUX_UP_1(L, I)=U11(L, I)*FLUX_PROPAG_1(L)                             RAD_ALL.19782 
     &         +U12(L, I)*FLUX_PROPAG_2(L)                                         RAD_ALL.19783 
     &         +U13(L, I)*FLUX_PROPAG_3(L)                                         RAD_ALL.19784 
            FLUX_UP_2(L, I)=U21(L, I)*FLUX_PROPAG_1(L)                             RAD_ALL.19785 
     &         +U22(L, I)*FLUX_PROPAG_2(L)                                         RAD_ALL.19786 
     &         +U23(L, I)*FLUX_PROPAG_3(L)                                         RAD_ALL.19787 
            FLUX_UP_3(L, I)=U31(L, I)*FLUX_PROPAG_1(L)                             RAD_ALL.19788 
     &         +U32(L, I)*FLUX_PROPAG_2(L)                                         RAD_ALL.19789 
     &         +U33(L, I)*FLUX_PROPAG_3(L)                                         RAD_ALL.19790 
!                                                                                  RAD_ALL.19791 
            FLUX_PROPAG_1(L)=T(L, I)*FLUX_UP_1(L, I)+S_UP(L, I)                    RAD_ALL.19792 
     &         +R(L, I)*FLUX_DOWN_1(L, I-1)                                        RAD_ALL.19793 
            FLUX_PROPAG_2(L)=T_STRAT(L, I)*FLUX_UP_2(L, I)                         RAD_ALL.19794 
     &         +S_UP_STRAT(L, I)+R_STRAT(L, I)*FLUX_DOWN_2(L, I-1)                 RAD_ALL.19795 
            FLUX_PROPAG_3(L)=T_CONV(L, I)*FLUX_UP_3(L, I)                          RAD_ALL.19796 
     &         +S_UP_CONV(L, I)+R_CONV(L, I)*FLUX_DOWN_3(L, I-1)                   RAD_ALL.19797 
!                                                                                  RAD_ALL.19798 
         ENDDO                                                                     RAD_ALL.19799 
      ENDDO                                                                        RAD_ALL.19800 
!                                                                                  RAD_ALL.19801 
!     PROPAGATE INTO THE CLOUD-FREE REGION.                                        RAD_ALL.19802 
      I=N_CLOUD_TOP-1                                                              RAD_ALL.19803 
      DO L=1, N_PROFILE                                                            RAD_ALL.19804 
         FLUX_TOTAL(L, 2*I+1)=FLUX_PROPAG_1(L)+FLUX_PROPAG_2(L)                    RAD_ALL.19805 
     &      +FLUX_PROPAG_3(L)                                                      RAD_ALL.19806 
      ENDDO                                                                        RAD_ALL.19807 
!                                                                                  RAD_ALL.19808 
!     CONTINUE THROUGH THE LAYERS ABOVE CLOUDS.                                    RAD_ALL.19809 
      DO I=N_CLOUD_TOP-1, 1, -1                                                    RAD_ALL.19810 
         DO L=1, N_PROFILE                                                         RAD_ALL.19811 
            FLUX_TOTAL(L, 2*I-1)=T(L, I)*FLUX_TOTAL(L, 2*I+1)                      RAD_ALL.19812 
     &         +R(L, I)*FLUX_TOTAL(L, 2*I)+S_UP(L, I)                              RAD_ALL.19813 
         ENDDO                                                                     RAD_ALL.19814 
      ENDDO                                                                        RAD_ALL.19815 
!                                                                                  RAD_ALL.19816 
!     ASSIGN THE TOTAL FLUXES ON THE INTERMEDIATE CLOUDY LAYERS.                   RAD_ALL.19817 
      DO I=N_CLOUD_TOP, N_LAYER                                                    RAD_ALL.19818 
         DO L=1, N_PROFILE                                                         RAD_ALL.19819 
            FLUX_TOTAL(L, 2*I+1)=FLUX_UP_1(L, I)+FLUX_UP_2(L, I)                   RAD_ALL.19820 
     &         +FLUX_UP_3(L, I)                                                    RAD_ALL.19821 
            FLUX_TOTAL(L, 2*I+2)=FLUX_DOWN_1(L, I)+FLUX_DOWN_2(L, I)               RAD_ALL.19822 
     &         +FLUX_DOWN_3(L, I)                                                  RAD_ALL.19823 
         ENDDO                                                                     RAD_ALL.19824 
      ENDDO                                                                        RAD_ALL.19825 
!                                                                                  RAD_ALL.19826 
!     REDUCE TO NET FLUXES IF REQUIRED.                                            RAD_ALL.19827 
      IF (L_NET) THEN                                                              RAD_ALL.19828 
         DO I=0, N_LAYER                                                           RAD_ALL.19829 
            DO L=1, N_PROFILE                                                      RAD_ALL.19830 
               FLUX_TOTAL(L, I+1)=FLUX_TOTAL(L, 2*I+2)                             RAD_ALL.19831 
     &            -FLUX_TOTAL(L, 2*I-1)                                            RAD_ALL.19832 
            ENDDO                                                                  RAD_ALL.19833 
         ENDDO                                                                     RAD_ALL.19834 
      ENDIF                                                                        RAD_ALL.19835 
                                                                                   RAD_ALL.19836 
!                                                                                  RAD_ALL.19837 
!                                                                                  RAD_ALL.19838 
!                                                                                  RAD_ALL.19839 
      RETURN                                                                       RAD_ALL.19840 
      END  
