anchor.diff:              end do
           end do
   
  -
           deallocate(aux)
           deallocate(aux2)
  -
  -    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  -
       end subroutine andes_density_table3
   
   
       !--------------------------------------------------------------------------
       ! Andes density function
       !--------------------------------------------------------------------------
  -
  -
       real (kind=8) function dens_andes(x, dens_table) result(densf)
           real (kind=8), dimension(1:2), intent(in) :: x
           real (kind=8), dimension(nlat_alt*nlon_alt,3), intent(in) :: dens_table
  
positive.code: 
          do i = l3, nlat_alt-l3
              do j = l3, nlon_alt-l3
  
                  if(aux(i,j) == 500._r8/6320._r8)then
  
                      temp =  0._r8
                      do m = 0,l-1
                          do n = 0,l-1
                              temp = temp + aux(i-(l-1)/2+m, j-(l-1)/2+n)
                          end do
                      end do
                      !        temp = temp - aux(i,j)
                      !       aux2(i,j) = temp/(l**2-1)
                      aux2(i,j) = temp/l**2
  
                  end if
  
              end do
          end do
  
          !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  
  
          k = 1
          do i = 1, nlat_alt
              do j = 1, nlon_alt
  
negative.code:         real (kind=8), dimension(nlat_alt*nlon_alt,3), intent(in) :: dens_table
          real (kind=8) :: lat, lon,latc, lonc, coslat
          real (kind=8) :: epsilons, gammas, sx, maxdist, dists, a, b
  
          latc=-20.0*pi/180._r8
          lonc=-60.0*pi/180._r8
  