anchor.diff:        Real (8), Intent (In) :: rfir (ngrtot, nf)
         Type (plot3d_type), Intent (In) :: plotdef
   ! local variables
  -      Integer :: np, ip, ip1, ip2, ip3, i,ifunction, fnum = 50
  -      Real (8) :: v1 (3), v2 (3), v3 (3)
  +      Integer :: np, ip, ip1, ip2, ip3, i, ifunction, fnum = 50
  +      Real (8) :: v1 (3), v2 (3), v3 (3),tmpv(3)
         Real (8) :: t1, t2, t3
         Character (512) :: buffer, buffer1
  -      character (20)::buffer20
  +      Character (20) :: buffer20
         Type (xmlf_t), Save :: xf
   ! allocatable arrays
         Real (8), Allocatable :: vpl (:, :)
         Real (8), Allocatable :: fp (:, :)
         buffer = fname // "3D.OUT"
         Open (fnum, File=trim(buffer), Action='WRITE', Form='FORMATTED')
  -
  +!
   !
         If ((nf .Lt. 1) .Or. (nf .Gt. 4)) Then
            Write (*,*)
  
positive.code:         & fp(:, i))
        End Do
  !write xml
     Call xml_OpenFile (fname//"3d.xml", xf, replace=.True., &
       & pretty_print=.True.)
        Call xml_NewElement (xf, "plot3d")
        Call xml_NewElement (xf, "title")
  
negative.code:      & plotdef%box%origin%coord
        v3 (:) = plotdef%box%pointarray(3)%point%coord - &
       & plotdef%box%origin%coord
  
        ip = 0
        Do ip3 = 0, plotdef%box%grid(3) - 1
           t3 = dble (ip3) / dble (plotdef%box%grid(3))
           Do ip2 = 0, plotdef%box%grid(2) - 1
              t2 = dble (ip2) / dble (plotdef%box%grid(2))
              Do ip1 = 0, plotdef%box%grid(1) - 1
                 t1 = dble (ip1) / dble (plotdef%box%grid(1))
                 ip = ip + 1
                 vpl (:, ip) = t1 * v1 (:) + t2 * v2 (:) + t3 * v3 (:) + &
                & plotdef%box%origin%coord
  