C (c) CROWN COPYRIGHT 1995, METEOROLOGICAL OFFICE, All Rights Reserved.            RAD_ALL.11272 
C                                                                                  RAD_ALL.11273 
C Use, duplication or disclosure of this code is subject to the                    RAD_ALL.11274 
C restrictions as set forth in the contract.                                       RAD_ALL.11275 
C                                                                                  RAD_ALL.11276 
C                Meteorological Office                                             RAD_ALL.11277 
C                London Road                                                       RAD_ALL.11278 
C                BRACKNELL                                                         RAD_ALL.11279 
C                Berkshire UK                                                      RAD_ALL.11280 
C                RG12 2SZ                                                          RAD_ALL.11281 
C                                                                                  RAD_ALL.11282 
C If no contract has been raised with this copy of the code, the use,              RAD_ALL.11283 
C duplication or disclosure of it is strictly prohibited.  Permission              RAD_ALL.11284 
C to do so must first be obtained in writing from the Head of Numerical            RAD_ALL.11285 
C Modelling at the above address.                                                  RAD_ALL.11286 
C ******************************COPYRIGHT******************************            RAD_ALL.11287 
C                                                                                  RAD_ALL.11288 
!+ Subroutine to set the coefficients of the endekadiagonal matrix.                RAD_ALL.11289 
!                                                                                  RAD_ALL.11290 
! Method:                                                                          RAD_ALL.11291 
!       Straightforward.                                                           RAD_ALL.11292 
!                                                                                  RAD_ALL.11293 
! Current Owner of Code: J. M. Edwards                                             RAD_ALL.11294 
!                                                                                  RAD_ALL.11295 
! History:                                                                         RAD_ALL.11296 
!       Version         Date                    Comment                            RAD_ALL.11297 
!       4.0             27-07-95                Original Code                      RAD_ALL.11298 
!                                               (J. M. Edwards)                    RAD_ALL.11299 
!                                                                                  RAD_ALL.11300 
! Description of Code:                                                             RAD_ALL.11301 
!   FORTRAN 77  with extensions listed in documentation.                           RAD_ALL.11302 
!                                                                                  RAD_ALL.11303 
!- ---------------------------------------------------------------------           RAD_ALL.11304 
      SUBROUTINE MIX_MATRIX_ELEM(N_PROFILE, N_LAYER, N_CLOUD_TOP                   RAD_ALL.11305 
     &   , T_FREE, R_FREE, S_DOWN_FREE, S_UP_FREE                                  RAD_ALL.11306 
     &   , T_CLOUD, R_CLOUD, S_DOWN_CLOUD, S_UP_CLOUD                              RAD_ALL.11307 
     &   , G_M, G_P, B_M, B_P                                                      RAD_ALL.11308 
     &   , FLUX_INC_DOWN                                                           RAD_ALL.11309 
     &   , SOURCE_GROUND, ALBEDO_SURFACE_DIFF, ALBEDO_SURFACE_DIR                  RAD_ALL.11310 
     &   , FLUX_DIRECT_GROUND                                                      RAD_ALL.11311 
     &   , A, B                                                                    RAD_ALL.11312 
     &   , NPD_PROFILE, NPD_LAYER                                                  RAD_ALL.11313 
     &   )                                                                         RAD_ALL.11314 
!                                                                                  RAD_ALL.11315 
!                                                                                  RAD_ALL.11316 
!                                                                                  RAD_ALL.11317 
      IMPLICIT NONE                                                                RAD_ALL.11318 
!                                                                                  RAD_ALL.11319 
!                                                                                  RAD_ALL.11320 
!     SIZES OF DUMMY ARRAYS.                                                       RAD_ALL.11321 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.11322 
     &     NPD_PROFILE                                                             RAD_ALL.11323 
!             MAXIMUM NUMBER OF PROFILES                                           RAD_ALL.11324 
     &   , NPD_LAYER                                                               RAD_ALL.11325 
!             MAXIMUM NUMBER OF LAYERS                                             RAD_ALL.11326 
!                                                                                  RAD_ALL.11327 
!                                                                                  RAD_ALL.11328 
!     DUMMY ARGUMENTS.                                                             RAD_ALL.11329 
      INTEGER   !, INTENT(IN)                                                      RAD_ALL.11330 
     &     N_PROFILE                                                               RAD_ALL.11331 
     &   , N_LAYER                                                                 RAD_ALL.11332 
     &   , N_CLOUD_TOP                                                             RAD_ALL.11333 
      REAL      !, INTENT(IN)                                                      RAD_ALL.11334 
     &     T_FREE(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.11335 
     &   , R_FREE(NPD_PROFILE, NPD_LAYER)                                          RAD_ALL.11336 
     &   , S_DOWN_FREE(NPD_PROFILE, NPD_LAYER)                                     RAD_ALL.11337 
     &   , S_UP_FREE(NPD_PROFILE, NPD_LAYER)                                       RAD_ALL.11338 
     &   , T_CLOUD(NPD_PROFILE, NPD_LAYER)                                         RAD_ALL.11339 
     &   , R_CLOUD(NPD_PROFILE, NPD_LAYER)                                         RAD_ALL.11340 
     &   , S_DOWN_CLOUD(NPD_PROFILE, NPD_LAYER)                                    RAD_ALL.11341 
     &   , S_UP_CLOUD(NPD_PROFILE, NPD_LAYER)                                      RAD_ALL.11342 
      REAL      !, INTENT(IN)                                                      RAD_ALL.11343 
     &     B_M(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.11344 
     &   , B_P(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.11345 
     &   , G_M(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.11346 
     &   , G_P(NPD_PROFILE, 0: NPD_LAYER)                                          RAD_ALL.11347 
      REAL      !, INTENT(IN)                                                      RAD_ALL.11348 
     &     FLUX_INC_DOWN(NPD_PROFILE)                                              RAD_ALL.11349 
     &   , SOURCE_GROUND(NPD_PROFILE)                                              RAD_ALL.11350 
     &   , ALBEDO_SURFACE_DIFF(NPD_PROFILE)                                        RAD_ALL.11351 
     &   , ALBEDO_SURFACE_DIR(NPD_PROFILE)                                         RAD_ALL.11352 
     &   , FLUX_DIRECT_GROUND(NPD_PROFILE)                                         RAD_ALL.11353 
      REAL      !, INTENT(OUT)                                                     RAD_ALL.11354 
     &     A(NPD_PROFILE, 11, 4*NPD_LAYER+4)                                       RAD_ALL.11355 
     &   , B(NPD_PROFILE, 4*NPD_LAYER+4)                                           RAD_ALL.11356 
!                                                                                  RAD_ALL.11357 
!     LOCAL VARIABLES.                                                             RAD_ALL.11358 
      INTEGER                                                                      RAD_ALL.11359 
     &     I                                                                       RAD_ALL.11360 
     &   , L                                                                       RAD_ALL.11361 
      REAL                                                                         RAD_ALL.11362 
     &     TP(NPD_PROFILE, NPD_LAYER)                                              RAD_ALL.11363 
     &   , TM(NPD_PROFILE, NPD_LAYER)                                              RAD_ALL.11364 
     &   , RP(NPD_PROFILE, NPD_LAYER)                                              RAD_ALL.11365 
     &   , RM(NPD_PROFILE, NPD_LAYER)                                              RAD_ALL.11366 
!                                                                                  RAD_ALL.11367 
!                                                                                  RAD_ALL.11368 
!                                                                                  RAD_ALL.11369 
!     PRECALCULATE THE MEAN SUMMED AND DIFFERENCED TRANSMISSIVITIES                RAD_ALL.11370 
!     AND REFLECTION COEFFICIENTS FOR EFFICIENCY.                                  RAD_ALL.11371 
      DO I=N_CLOUD_TOP, N_LAYER                                                    RAD_ALL.11372 
         DO L=1, N_PROFILE                                                         RAD_ALL.11373 
            TP(L, I)=0.5E+00*(T_FREE(L, I)+T_CLOUD(L, I))                          RAD_ALL.11374 
            TM(L, I)=0.5E+00*(T_FREE(L, I)-T_CLOUD(L, I))                          RAD_ALL.11375 
            RP(L, I)=0.5E+00*(R_FREE(L, I)+R_CLOUD(L, I))                          RAD_ALL.11376 
            RM(L, I)=0.5E+00*(R_FREE(L, I)-R_CLOUD(L, I))                          RAD_ALL.11377 
         ENDDO                                                                     RAD_ALL.11378 
      ENDDO                                                                        RAD_ALL.11379 
!                                                                                  RAD_ALL.11380 
!     CONDITIONS ON THE DOWNWARD FLUX ENTERING THE TOP LAYER:                      RAD_ALL.11381 
      DO L=1, N_PROFILE                                                            RAD_ALL.11382 
!        INCIDENT DIFFERENCE FLUX:                                                 RAD_ALL.11383 
         A(L, 11, 3)=0.0E+00                                                       RAD_ALL.11384 
         A(L, 10, 3)=0.0E+00                                                       RAD_ALL.11385 
         A(L, 9, 3)=0.0E+00                                                        RAD_ALL.11386 
         A(L, 8, 3)=0.0E+00                                                        RAD_ALL.11387 
         A(L, 7, 3)=0.0E+00                                                        RAD_ALL.11388 
         A(L, 6, 3)=1.0E+00                                                        RAD_ALL.11389 
         A(L, 5, 3)=0.0E+00                                                        RAD_ALL.11390 
         A(L, 4, 3)=0.0E+00                                                        RAD_ALL.11391 
         A(L, 3, 3)=0.0E+00                                                        RAD_ALL.11392 
         A(L, 2, 3)=0.0E+00                                                        RAD_ALL.11393 
         A(L, 1, 3)=0.0E+00                                                        RAD_ALL.11394 
         B(L, 3)=FLUX_INC_DOWN(L)                                                  RAD_ALL.11395 
!        INCIDENT SUMMED FLUX:                                                     RAD_ALL.11396 
         A(L, 11, 4)=0.0E+00                                                       RAD_ALL.11397 
         A(L, 10, 4)=0.0E+00                                                       RAD_ALL.11398 
         A(L, 9, 4)=0.0E+00                                                        RAD_ALL.11399 
         A(L, 8, 4)=0.0E+00                                                        RAD_ALL.11400 
         A(L, 7, 4)=0.0E+00                                                        RAD_ALL.11401 
         A(L, 6, 4)=1.0E+00                                                        RAD_ALL.11402 
         A(L, 5, 4)=0.0E+00                                                        RAD_ALL.11403 
         A(L, 4, 4)=0.0E+00                                                        RAD_ALL.11404 
         A(L, 3, 4)=0.0E+00                                                        RAD_ALL.11405 
         A(L, 2, 4)=0.0E+00                                                        RAD_ALL.11406 
         A(L, 1, 4)=0.0E+00                                                        RAD_ALL.11407 
         B(L, 4)=FLUX_INC_DOWN(L)                                                  RAD_ALL.11408 
      ENDDO                                                                        RAD_ALL.11409 
!                                                                                  RAD_ALL.11410 
!     ASSIGN SETS OF EQUATIONS FOR EACH LAYER:                                     RAD_ALL.11411 
      DO I=1, N_CLOUD_TOP-1                                                        RAD_ALL.11412 
         DO L=1, N_PROFILE                                                         RAD_ALL.11413 
!                                                                                  RAD_ALL.11414 
!           DIFFERENCE IN FLUXES JUST BELOW THE TOP OF THE LAYER:                  RAD_ALL.11415 
            A(L, 11, 4*I-3)=0.0E+00                                                RAD_ALL.11416 
            A(L, 10, 4*I-3)=0.0E+00                                                RAD_ALL.11417 
            A(L, 9, 4*I-3)=0.0E+00                                                 RAD_ALL.11418 
            A(L, 8, 4*I-3)=0.0E+00                                                 RAD_ALL.11419 
            A(L, 7, 4*I-3)=0.0E+00                                                 RAD_ALL.11420 
            A(L, 6, 4*I-3)=-1.0E+00                                                RAD_ALL.11421 
            A(L, 5, 4*I-3)=1.0E+00                                                 RAD_ALL.11422 
            A(L, 4, 4*I-3)=0.0E+00                                                 RAD_ALL.11423 
            A(L, 3, 4*I-3)=0.0E+00                                                 RAD_ALL.11424 
            A(L, 2, 4*I-3)=0.0E+00                                                 RAD_ALL.11425 
            A(L, 1, 4*I-3)=0.0E+00                                                 RAD_ALL.11426 
            B(L, 4*I-3)=0.0E+00                                                    RAD_ALL.11427 
!                                                                                  RAD_ALL.11428 
!           SUMMED FLUX AT THE TOP OF THE LAYER:                                   RAD_ALL.11429 
            A(L, 11, 4*I-2)=0.0E+00                                                RAD_ALL.11430 
            A(L, 10, 4*I-2)=0.0E+00                                                RAD_ALL.11431 
            A(L, 9, 4*I-2)=0.0E+00                                                 RAD_ALL.11432 
            A(L, 8, 4*I-2)=0.0E+00                                                 RAD_ALL.11433 
            A(L, 7, 4*I-2)=0.0E+00                                                 RAD_ALL.11434 
            A(L, 6, 4*I-2)=-1.0E+00                                                RAD_ALL.11435 
            A(L, 5, 4*I-2)=0.0E+00                                                 RAD_ALL.11436 
            A(L, 4, 4*I-2)=R_FREE(L, I)                                            RAD_ALL.11437 
            A(L, 3, 4*I-2)=0.0E+00                                                 RAD_ALL.11438 
            A(L, 2, 4*I-2)=T_FREE(L, I)                                            RAD_ALL.11439 
            A(L, 1, 4*I-2)=0.0E+00                                                 RAD_ALL.11440 
            B(L, 4*I-2)=-S_UP_FREE(L, I)                                           RAD_ALL.11441 
!                                                                                  RAD_ALL.11442 
!           DIFFERENCE FLUX JUST ABOVE THE BASE OF THE LAYER:                      RAD_ALL.11443 
            A(L, 11, 4*I+3)=0.0E+00                                                RAD_ALL.11444 
            A(L, 10, 4*I+3)=0.0E+00                                                RAD_ALL.11445 
            A(L, 9, 4*I+3)=0.0E+00                                                 RAD_ALL.11446 
            A(L, 8, 4*I+3)=0.0E+00                                                 RAD_ALL.11447 
            A(L, 7, 4*I+3)=0.0E+00                                                 RAD_ALL.11448 
            A(L, 6, 4*I+3)=-1.0E+00                                                RAD_ALL.11449 
            A(L, 5, 4*I+3)=1.0E+00                                                 RAD_ALL.11450 
            A(L, 4, 4*I+3)=0.0E+00                                                 RAD_ALL.11451 
            A(L, 3, 4*I+3)=0.0E+00                                                 RAD_ALL.11452 
            A(L, 2, 4*I+3)=0.0E+00                                                 RAD_ALL.11453 
            A(L, 1, 4*I+3)=0.0E+00                                                 RAD_ALL.11454 
            B(L, 4*I+3)=0.0E+00                                                    RAD_ALL.11455 
!                                                                                  RAD_ALL.11456 
!           SUMMED FLUXES AT THE BASE OF THE LAYER:                                RAD_ALL.11457 
            A(L, 11, 4*I+4)=0.0E+00                                                RAD_ALL.11458 
            A(L, 10, 4*I+4)=T_FREE(L, I)                                           RAD_ALL.11459 
            A(L, 9, 4*I+4)=0.0E+00                                                 RAD_ALL.11460 
            A(L, 8, 4*I+4)=R_FREE(L, I)                                            RAD_ALL.11461 
            A(L, 7, 4*I+4)=0.0E+00                                                 RAD_ALL.11462 
            A(L, 6, 4*I+4)=-1.0E+00                                                RAD_ALL.11463 
            A(L, 5, 4*I+4)=0.0E+00                                                 RAD_ALL.11464 
            A(L, 4, 4*I+4)=0.0E+00                                                 RAD_ALL.11465 
            A(L, 3, 4*I+4)=0.0E+00                                                 RAD_ALL.11466 
            A(L, 2, 4*I+4)=0.0E+00                                                 RAD_ALL.11467 
            A(L, 1, 4*I+4)=0.0E+00                                                 RAD_ALL.11468 
            B(L, 4*I+4)=-S_DOWN_FREE(L, I)                                         RAD_ALL.11469 
         ENDDO                                                                     RAD_ALL.11470 
      ENDDO                                                                        RAD_ALL.11471 
      DO I=N_CLOUD_TOP, N_LAYER                                                    RAD_ALL.11472 
         DO L=1, N_PROFILE                                                         RAD_ALL.11473 
!                                                                                  RAD_ALL.11474 
!           DIFFERENCE IN FLUXES JUST BELOW THE TOP OF THE LAYER:                  RAD_ALL.11475 
            A(L, 11, 4*I-3)=0.0E+00                                                RAD_ALL.11476 
            A(L, 10, 4*I-3)=0.0E+00                                                RAD_ALL.11477 
            A(L, 9, 4*I-3)=0.0E+00                                                 RAD_ALL.11478 
            A(L, 8, 4*I-3)=0.0E+00                                                 RAD_ALL.11479 
            A(L, 7, 4*I-3)=0.0E+00                                                 RAD_ALL.11480 
            A(L, 6, 4*I-3)=-1.0E+00                                                RAD_ALL.11481 
            A(L, 5, 4*I-3)=0.0E+00                                                 RAD_ALL.11482 
            A(L, 4, 4*I-3)=0.5E+00*G_M(L, I-1)*RP(L, I)                            RAD_ALL.11483 
            A(L, 3, 4*I-3)=RM(L, I)+0.5E+00*G_P(L, I-1)*RP(L, I)                   RAD_ALL.11484 
            A(L, 2, 4*I-3)=0.5E+00*B_M(L, I)*TP(L, I)                              RAD_ALL.11485 
            A(L, 1, 4*I-3)=TM(L, I)+0.5E+00*B_P(L, I)*TP(L, I)                     RAD_ALL.11486 
            B(L, 4*I-3)=-S_UP_FREE(L, I)+S_UP_CLOUD(L, I)                          RAD_ALL.11487 
!                                                                                  RAD_ALL.11488 
!           SUMMED FLUX AT THE TOP OF THE LAYER:                                   RAD_ALL.11489 
            A(L, 11, 4*I-2)=0.0E+00                                                RAD_ALL.11490 
            A(L, 10, 4*I-2)=0.0E+00                                                RAD_ALL.11491 
            A(L, 9, 4*I-2)=0.0E+00                                                 RAD_ALL.11492 
            A(L, 8, 4*I-2)=0.0E+00                                                 RAD_ALL.11493 
            A(L, 7, 4*I-2)=0.0E+00                                                 RAD_ALL.11494 
            A(L, 6, 4*I-2)=-1.0E+00                                                RAD_ALL.11495 
            A(L, 5, 4*I-2)=0.5E+00*G_M(L, I-1)*RM(L, I)                            RAD_ALL.11496 
            A(L, 4, 4*I-2)=RP(L, I)+0.5E+00*G_P(L, I-1)*RM(L, I)                   RAD_ALL.11497 
            A(L, 3, 4*I-2)=0.5E+00*B_M(L, I)*TM(L, I)                              RAD_ALL.11498 
            A(L, 2, 4*I-2)=TP(L, I)+0.5E+00*B_P(L, I)*TM(L, I)                     RAD_ALL.11499 
            A(L, 1, 4*I-2)=0.0E+00                                                 RAD_ALL.11500 
            B(L, 4*I-2)=-S_UP_FREE(L, I)-S_UP_CLOUD(L, I)                          RAD_ALL.11501 
!                                                                                  RAD_ALL.11502 
!           DIFFERENCE FLUX JUST ABOVE THE BASE OF THE LAYER:                      RAD_ALL.11503 
            A(L, 11, 4*I+3)=0.0E+00                                                RAD_ALL.11504 
            A(L, 10, 4*I+3)=0.5E+00*G_M(L, I-1)*TP(L, I)                           RAD_ALL.11505 
            A(L, 9, 4*I+3)=TM(L, I)+0.5E+00*G_P(L, I-1)*TP(L, I)                   RAD_ALL.11506 
            A(L, 8, 4*I+3)=0.5E+00*B_M(L, I)*RP(L, I)                              RAD_ALL.11507 
            A(L, 7, 4*I+3)=RM(L, I)+0.5E+00*B_P(L, I)*RP(L, I)                     RAD_ALL.11508 
            A(L, 6, 4*I+3)=-1.0E+00                                                RAD_ALL.11509 
            A(L, 5, 4*I+3)=0.0E+00                                                 RAD_ALL.11510 
            A(L, 4, 4*I+3)=0.0E+00                                                 RAD_ALL.11511 
            A(L, 3, 4*I+3)=0.0E+00                                                 RAD_ALL.11512 
            A(L, 2, 4*I+3)=0.0E+00                                                 RAD_ALL.11513 
            A(L, 1, 4*I+3)=0.0E+00                                                 RAD_ALL.11514 
            B(L, 4*I+3)=-S_DOWN_FREE(L, I)+S_DOWN_CLOUD(L, I)                      RAD_ALL.11515 
!                                                                                  RAD_ALL.11516 
!           SUMMED FLUXES AT THE BASE OF THE LAYER:                                RAD_ALL.11517 
            A(L, 11, 4*I+4)=0.5E+00*G_M(L, I-1)*TM(L, I)                           RAD_ALL.11518 
            A(L, 10, 4*I+4)=TP(L, I)+0.5E+00*G_P(L, I-1)*TM(L, I)                  RAD_ALL.11519 
            A(L, 9, 4*I+4)=0.5E+00*B_M(L, I)*RM(L, I)                              RAD_ALL.11520 
            A(L, 8, 4*I+4)=RP(L, I)+0.5E+00*B_P(L, I)*RM(L, I)                     RAD_ALL.11521 
            A(L, 7, 4*I+4)=0.0E+00                                                 RAD_ALL.11522 
            A(L, 6, 4*I+4)=-1.0E+00                                                RAD_ALL.11523 
            A(L, 5, 4*I+4)=0.0E+00                                                 RAD_ALL.11524 
            A(L, 4, 4*I+4)=0.0E+00                                                 RAD_ALL.11525 
            A(L, 3, 4*I+4)=0.0E+00                                                 RAD_ALL.11526 
            A(L, 2, 4*I+4)=0.0E+00                                                 RAD_ALL.11527 
            A(L, 1, 4*I+4)=0.0E+00                                                 RAD_ALL.11528 
            B(L, 4*I+4)=-S_DOWN_FREE(L, I)-S_DOWN_CLOUD(L, I)                      RAD_ALL.11529 
!                                                                                  RAD_ALL.11530 
         ENDDO                                                                     RAD_ALL.11531 
      ENDDO                                                                        RAD_ALL.11532 
!                                                                                  RAD_ALL.11533 
!     CONDITIONS AT THE SURFACE:                                                   RAD_ALL.11534 
      DO L=1, N_PROFILE                                                            RAD_ALL.11535 
!                                                                                  RAD_ALL.11536 
         A(L, 11, 4*N_LAYER+1)=0.0E+00                                             RAD_ALL.11537 
         A(L, 10, 4*N_LAYER+1)=0.0E+00                                             RAD_ALL.11538 
         A(L, 9, 4*N_LAYER+1)=0.0E+00                                              RAD_ALL.11539 
         A(L, 8, 4*N_LAYER+1)=0.0E+00                                              RAD_ALL.11540 
         A(L, 7, 4*N_LAYER+1)=0.0E+00                                              RAD_ALL.11541 
         A(L, 6, 4*N_LAYER+1)=1.0E+00                                              RAD_ALL.11542 
         A(L, 5, 4*N_LAYER+1)=-1.0E+00                                             RAD_ALL.11543 
         A(L, 4, 4*N_LAYER+1)=0.0E+00                                              RAD_ALL.11544 
         A(L, 3, 4*N_LAYER+1)=0.0E+00                                              RAD_ALL.11545 
         A(L, 2, 4*N_LAYER+1)=0.0E+00                                              RAD_ALL.11546 
         A(L, 1, 4*N_LAYER+1)=0.0E+00                                              RAD_ALL.11547 
         B(L, 4*N_LAYER+1)=0.0E+00                                                 RAD_ALL.11548 
!                                                                                  RAD_ALL.11549 
         A(L, 11, 4*N_LAYER+2)=0.0E+00                                             RAD_ALL.11550 
         A(L, 10, 4*N_LAYER+2)=0.0E+00                                             RAD_ALL.11551 
         A(L, 9, 4*N_LAYER+2)=0.0E+00                                              RAD_ALL.11552 
         A(L, 8, 4*N_LAYER+2)=0.0E+00                                              RAD_ALL.11553 
         A(L, 7, 4*N_LAYER+2)=0.0E+00                                              RAD_ALL.11554 
         A(L, 6, 4*N_LAYER+2)=1.0E+00                                              RAD_ALL.11555 
         A(L, 5, 4*N_LAYER+2)=0.0E+00                                              RAD_ALL.11556 
         A(L, 4, 4*N_LAYER+2)=-ALBEDO_SURFACE_DIFF(L)                              RAD_ALL.11557 
         A(L, 3, 4*N_LAYER+2)=0.0E+00                                              RAD_ALL.11558 
         A(L, 2, 4*N_LAYER+2)=0.0E+00                                              RAD_ALL.11559 
         A(L, 1, 4*N_LAYER+2)=0.0E+00                                              RAD_ALL.11560 
         B(L, 4*N_LAYER+2)=SOURCE_GROUND(L)                                        RAD_ALL.11561 
     &      +(ALBEDO_SURFACE_DIR(L)-ALBEDO_SURFACE_DIFF(L))                        RAD_ALL.11562 
     &      *FLUX_DIRECT_GROUND(L)                                                 RAD_ALL.11563 
      ENDDO                                                                        RAD_ALL.11564 
!                                                                                  RAD_ALL.11565 
!                                                                                  RAD_ALL.11566 
!                                                                                  RAD_ALL.11567 
      RETURN                                                                       RAD_ALL.11568 
      END  
