anchor.diff:      double precision, save, dimension(:,:,:), allocatable :: int_i, int_sq ! nk x npix x nrot.  int_sq == int_i**2
       double precision, save, dimension(:,:,:), allocatable :: old_int, old_int_sq
       double precision, save, dimension(:), allocatable :: int_sum, int_sq_sum  ! nk long sums of int and int_sq arrays for calculating V(k)
  -    real, save, allocatable, dimension(:) :: j0, A1                                               
  +    double precision, save, allocatable, dimension(:) :: j0, A1                                               
       type(model), save, dimension(:), pointer, public :: mrot  ! array of rotated models
       type(model), save, public :: rot_atom  ! used for rotating a single atom, overwritten every time
       type(index_list), save, dimension(:), pointer :: old_index
  
positive.code:                 psum_int(1:nk) = psum_int(1:nk) + int_i(1:nk, j, i)
                  psum_int_sq(1:nk) = psum_int_sq(1:nk) + int_sq(1:nk, j, i)
              enddo
  #ifdef DEBUG
              write(*,*) "Finished intensity calls on model", i
  #endif
  
negative.code:         double precision, dimension(nk), intent(inout) :: int_i
          real, dimension(:,:), pointer :: scatfact_e
          integer, intent(out) :: istat
          double precision, dimension(:,:,:), allocatable :: gr_i
          double precision, dimension(:), allocatable ::x1, y1, rr_a
          double precision, dimension(:,:), allocatable :: sum1
          double precision :: x2, y2, rr, t1, t2, const1, const2, const3, pp, r_max
          integer, pointer, dimension(:) :: pix_atoms, znum_r
          integer :: i,j,ii,jj,kk
          integer :: bin_max, size_pix_atoms
          double precision, allocatable, dimension(:) :: rr_x, rr_y
          double precision :: sqrt1_2_res
          double precision :: k_1
          real :: scatfact_e_ii
          double precision :: trash
  
          sqrt1_2_res = sqrt(0.5) * res
          r_max = 2*res ! small pixel inscribed in airy circle
  