anchor.diff:            DO ialt = 1, alt_lay_dim(2)
                DO isza = 1, sza_dim(1)
                   DO ivza = 1, vza_dim(1)
  +                   ! ---------
  +                   ! Clear sky
  +                   ! ---------
                      DO isrf = 1, srf_dim(1)
                         ! ------------------------------
                         ! Albedo loop only for clear sky
  
positive.code:           ! --------------------------------
            ! Finally interpolate to local_pre
            ! work out from local_srf(1) and
            ! GEOS5 Ap and Bp
            ! --------------------------------
            CALL ezspline_1d_interpolation (INT(alt_lay_dim(2),KIND=i4), lay_pre_1D(1:alt_lay_dim(2)), &
                 sw_clear_1D(1:alt_lay_dim(2)), &
                 ngeos5-1_i4, local_lay_pre(1:ngeos5-1), &
                 sw_clear(1:ngeos5-1), status)
            DO ialt = 1, ngeos5-1
               IF ( local_lay_pre(ialt) .GT. local_cld(1) ) THEN
                  sw_cloud(ialt) = 0.0_r8
               ELSE
                  sw_cloud(ialt) = &
                       linInterpol(INT(alt_lay_dim(2),KIND=i4), lay_pre_1D(1:alt_lay_dim(2)), &
                       sw_cloud_1D(1:alt_lay_dim(2)), &
                       local_lay_pre(ialt), status=status)
               END IF
            END DO
  
  
negative.code:                            linInterpol(INT(alb_dim(1),KIND=i4), re_alb, &
                             sw_clear_5D(srf_dim(1)+1-isrf,ialt,1:alb_dim(1),vza_dim(1)+1-ivza,sza_dim(1)+1-isza), &
                             local_alb(1), status=status)
                     END DO
                     ! --------------------------------------
                     ! Cloud sky
                     ! --------------------------------------
                     DO icld = 1, clp_dim(1)
                        sw_cloud_4D(ialt,clp_dim(1)+1-icld,vza_dim(1)+1-ivza,sza_dim(1)+1-isza) = &
                             REAL( lut_dI0_cld(toms_idx,ialt,icld,ivza,isza), KIND=r8 ) + &
                             REAL( lut_dI1_cld(toms_idx,ialt,icld,ivza,isza), KIND=r8 ) * cos( local_raa(1) ) + &
                             REAL( lut_dI2_cld(toms_idx,ialt,icld,ivza,isza), KIND=r8 ) * cos(2.0_r8 * local_raa(1) )
                     END DO
                     ! -------------------------------------
                     ! Interpolate to local surface pressure
                     ! If cloud pressure is greater than
                     ! surface pressure then cloud SW are to
                     ! be cero.
                     ! -------------------------------------
                  CALL ezspline_1d_interpolation (INT(srf_dim(1),KIND=i4), re_srf, &
                       sw_clear_4D(1:srf_dim(1),ialt,vza_dim(1)+1-ivza,sza_dim(1)+1-isza), &
                       one, local_srf(1), &
                       sw_clear_3D(ialt,vza_dim(1)+1-ivza,sza_dim(1)+1-isza), status)
                  CALL ezspline_1d_interpolation (INT(clp_dim(1),KIND=i4), re_cld, &
                       sw_cloud_4D(ialt,1:clp_dim(1),vza_dim(1)+1-ivza,sza_dim(1)+1-isza), &
                       one, local_cld(1), &
                       sw_cloud_3D(ialt,vza_dim(1)+1-ivza,sza_dim(1)+1-isza), status)
                  END DO ! End VZA loop
                  ! ------------------------
                  ! Interpolate to local VZA
  