anchor.diff:         ! --------------------------
          DO ixtrack = 1, nx
   
  +          
             IF (amfdiag(ixtrack,itime) .LT. 0) CYCLE
   
  +          ! -----------------------------------------
  +          ! Find out which TOMS profile we should use
  +          ! in function of latitude and ozone column.
  +          ! -----------------------------------------        
  +          IF ( ABS(lat(ixtrack,itime)) .GT. 60.0 ) THEN
  +             toms_idx = MINLOC(ABS(hxxx-omi_ozone_amount(ixtrack,itime)/du)) + 0
  +          ELSE IF ( ABS(lat(ixtrack,itime)) .GT. 30.0 .AND. ABS(lat(ixtrack,itime)) .LE. 60.0 ) THEN
  +             toms_idx = MINLOC(ABS(mxxx-omi_ozone_amount(ixtrack,itime)/du)) + 17
  +          ELSE IF ( ABS(lat(ixtrack,itime)) .LE. 30.0 ) THEN
  +             toms_idx = MINLOC(ABS(lxxx-omi_ozone_amount(ixtrack,itime)/du)) + 11
  +          ENDIF
  +          
             ! ----------------------------------------------
             ! If this point is reached then scattw should be
             ! different from r8_missval and it needs to be
  
positive.code:     RETURN
    END SUBROUTINE amf_diagnostic
  
    SUBROUTINE compute_scatt ( nt, nx, albedo, sza, vza, l2ctp, l2cfr, terrain_height, cli_heights, amfdiag, &
                               scattw)
  
      USE OMSAO_lininterpolation_module
      USE OMSAO_variables_module, ONLY: verb_thresh_lev
  
      IMPLICIT NONE
  
  
negative.code:     REAL    (KIND=r8) :: temp, tempsquare, grad
      REAL    (KIND=r8) :: ozo_abs, Intensity, Jacobian, Oz_xs, Intensity_cld, Jacobian_cld
      REAL    (KIND=r8) :: crf, nwavs!, Icr, Icl ,cloud_scattw, clear_scattw
      REAL    (KIND=r8), DIMENSION(clp_dim(1), sza_dim(1), vza_dim(1), alt_lay_dim(1)) :: scattwe, scattwe_cld
      REAL    (KIND=r8), DIMENSION(clp_dim(1), sza_dim(1), vza_dim(1))          :: Inte_clear, Inte_cloud
      REAL    (KIND=r8), DIMENSION(alt_lay_dim(1)) :: re_alt
      REAL    (KIND=r8), DIMENSION(clp_dim(1)) :: re_pre
      REAL    (KIND=r8), DIMENSION(sza_dim(1)) :: re_sza
      REAL    (KIND=r8), DIMENSION(vza_dim(1)) :: re_vza
      REAL    (KIND=r8)                     :: local_alb, local_sza, local_vza, local_thg, local_cld, local_cfr
      REAL    (KIND=r8), DIMENSION(1)       :: ezlocal_sza, ezlocal_vza
      REAL    (KIND=r8), DIMENSION(1,1,1)   :: cloud_scattw, clear_scattw
      REAL    (KIND=r8), DIMENSION(1,1)     :: Icr, Icl
      REAL    (KIND=r8), DIMENSION(alt_lay_dim(1)) :: local_chg
      REAL    (KIND=r8), PARAMETER :: d2r = 3.141592653589793d0/180.0  !! JED fix
      REAL    (KIND=r8), PARAMETER :: du  = 2.69e16 ! molecules/cm^2
      INTEGER (KIND=i4) :: toms_idx
      REAL    (KIND=r8), DIMENSION(10), PARAMETER :: hxxx = (/125,175,225,275,325,375,425,475,523,575/)
      REAL    (KIND=r8), DIMENSION(10), PARAMETER :: mxxx = (/125,175,225,275,325,375,425,475,523,575/)
      REAL    (KIND=r8), DIMENSION(6),  PARAMETER :: lxxx = (/225,275,325,375,425,475/)
  
      ! -----------------------------------
      ! Find look up table wavelength index
      ! No interpolation, closest available
  