anchor.diff:         ! ----------------------------
          ! Deallocate Vlidort variables
          ! ----------------------------
  -       CALL vlidort_allocate ("d", INT(toz_dim(1)),INT(clp_dim(1)),INT(alb_dim(1)), &
  +       CALL vlidort_allocate ("d", INT(toz_dim(1)),INT(srf_dim(1)),INT(clp_dim(1)),INT(alb_dim(1)), &
               INT(sza_dim(1)),INT(vza_dim(1)),INT(wav_dim(1)), &
  -            INT(alt_lay_dim(1)),INT(alt_lev_dim(1)),errstat)
  +            INT(alt_lay_dim(2)),INT(alt_lev_dim(2)),errstat)
   
          ! -----------------------------------------------------------------
          ! Work out the AMF using the scattering weights and the climatology
  
positive.code:     ! ------------------
      ! Modified variables
      ! ------------------
      REAL    (KIND=r8), DIMENSION (1:nx,0:nt-1,alt_lay_dim(1)), INTENT (INOUT) :: scattw
  
      ! ---------------
      ! Local variables
      ! ---------------
      INTEGER (KIND=i4) :: itime, ixtrack, ispre, isozo, isalt, iswav, issza, isvza, status, one, &
           isza, ivza, icld
      INTEGER (KIND=i4), DIMENSION(1) :: iwavs, iwavf, index_thg, index_cld
      REAL    (KIND=r8) :: temp, tempsquare, grad, raa, tmp_saa, tmp_vaa
      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(vza_dim(1), sza_dim(1)) :: Inte_clear
      REAL    (KIND=r8), DIMENSION(clp_dim(1), vza_dim(1), sza_dim(1)) ::  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), DIMENSION(1)          :: local_alb, local_sza, local_vza, local_raa, &
           local_thg, local_cld, local_cfr
      REAL    (KIND=r8), DIMENSION(1,1,1)   :: cloud_scattw, clear_scattw, Icl
      REAL    (KIND=r8), DIMENSION(1,1)     :: Icr
      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
  
negative.code:     ! -----------------------
      CALL h5dget_space_f(alb_did,dspace,hdferr)
      CALL h5sget_simple_extent_dims_f (dspace, alb_dim, alb_maxdim, hdferr)
      CALL h5dget_space_f(srf_did,dspace,hdferr)
      CALL h5sget_simple_extent_dims_f (dspace, srf_dim, srf_maxdim, hdferr)
      CALL h5dget_space_f(clp_did,dspace,hdferr)
      CALL h5sget_simple_extent_dims_f (dspace, clp_dim, clp_maxdim, hdferr)
      CALL h5dget_space_f(sza_did,dspace,hdferr)
  