anchor.diff:                     ! If we are below the level of the land, no need to
                      ! work out those scattering weights.
                      ! --------------------------------------------------
  -                   IF ( local_chg(isalt) .LE. local_thg ) THEN
  +                   IF ( local_chg(isalt) .LE. local_thg(1) ) THEN
                         clear_scattw(one,one,one) = linInterpol (           &
                              vl_nsza, vl_nvza, vl_nalt,                     &
                               re_sza,  re_vza,  re_alt,                     &
                              scattwe(index_thg(1),:,:,:),                   &
  -                           local_sza, local_vza, local_chg(isalt),        &
  +                           local_sza(1), local_vza(1), local_chg(isalt),        &
                              status=status)
                      END IF
   
  
positive.code:                             ! ----------------------------------------------------
                              ! Intensities for the calculation of the cloudy pixels
                              ! ----------------------------------------------------
                              Inte_clear(ispre, vl_nsza+1-issza, vl_nvza+1-isvza) = Intensity
                              Inte_cloud(ispre, vl_nsza+1-issza, vl_nvza+1-isvza) = Intensity_cld
  
                              IF (Jacobian .NE. 0.0_r8 .AND. Intensity .NE. 0.0_r8 &
                                   .AND. ozo_abs .NE. 0.0_r8) THEN
  
negative.code:                    ! must be GT than 0.0. Only interpolate for values
                     ! above the cloud top.
                     ! --------------------------------------------------
                     IF ( local_chg(isalt) .LE. local_cld(1) .AND. local_cfr(1) .GT. 0.0 ) THEN
                        cloud_scattw(one,one,one) =  linInterpol (              &
                             vl_nsza, vl_nvza, vl_nalt,                         &
                             re_sza,  re_vza,  re_alt,                          &
                             scattwe_cld(index_cld(1),:,:,:),                   &
                             local_sza(1), local_vza(1), local_chg(isalt),            &
                             status=status)
                     END IF
                     
  