anchor.diff:            ! 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), 1) + 0
  +             toms_idx = MINLOC(ABS(hxxx-omi_ozone_amount(ixtrack,itime)/du/amfgeo(ixtrack,itime)), 1) + 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), 1) + 17
  +             toms_idx = MINLOC(ABS(mxxx-omi_ozone_amount(ixtrack,itime)/du/amfgeo(ixtrack,itime)), 1) + 17
             ELSE IF ( ABS(lat(ixtrack,itime)) .LE. 30.0 ) THEN
  -             toms_idx = MINLOC(ABS(lxxx-omi_ozone_amount(ixtrack,itime)/du), 1) + 11
  +             toms_idx = MINLOC(ABS(lxxx-omi_ozone_amount(ixtrack,itime)/du)/amfgeo(ixtrack,itime), 1) + 11
             ENDIF
  +          print*, toms_idx
             ! ----------------------------------------------
             ! Work out relative azimuth angle for this pixel
             ! ----------------------------------------------
  
positive.code:     RETURN
    END SUBROUTINE amf_diagnostic
  
    SUBROUTINE compute_scatt ( nt, nx, albedo, lat, sza, vza, saa, vaa, l2ctp, l2cfr, terrain_height, amfdiag, &
                               scattw)
  
      USE OMSAO_lininterpolation_module
      USE OMSAO_variables_module, ONLY: verb_thresh_lev
  
negative.code:        ! Compute Scattering weights in the look up table grid but
         ! with the correct albedo. amfdiag is used to skip pixel
         ! ---------------------------------------------------------
         CALL compute_scatt ( nt, nx, albedo, lat, sza, vza, saa, vaa, l2ctp, l2cfr, terrain_height, amfgeo, amfdiag, &
              scattw)
  
         stop
  