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:     ! ---------------
      INTEGER (KIND=i4),                                INTENT (IN) :: nt, nx
      INTEGER (KIND=i2), DIMENSION (1:nx,0:nt-1),       INTENT (IN) :: amfdiag
      REAL    (KIND=r4), DIMENSION (1:nx,0:nt-1),       INTENT (IN) :: sza, vza, terrain_height
      REAL    (KIND=r8), DIMENSION (1:nx,0:nt-1),       INTENT (IN) :: albedo, l2ctp, l2cfr
      REAL    (KIND=r8), DIMENSION (1:nx,0:nt-1,CmETA), INTENT (IN) :: cli_heights
      ! ------------------
      ! Modified variables
      ! ------------------
      REAL    (KIND=r8), DIMENSION (1:nx,0:nt-1,CmETA), INTENT (INOUT) :: scattw
  
      ! ---------------
      ! Local variables
  
negative.code:        ! Out-of-Bound SZA, VZA (but not missing!)
         ! ----------------------------------------
         WHERE ( &
              ( sza(spix:epix,it) < MINVAL(lut_sza) ) .OR. &
              ( sza(spix:epix,it) > MAXVAL(lut_sza) ) .OR. &
              ( vza(spix:epix,it) < MINVAL(lut_vza) ) .OR. &
              ( vza(spix:epix,it) > MAXVAL(lut_vza) )      )
            amfdiag(spix:epix,it) = omi_oobview_amf
         END WHERE
  
  