<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Dear Lorenzo, 
</p>
    <p>Thank you very much for your reply. Indeed, increasing the tolerance (in my case, to about 7.d-4) fixes this issue. I changed the code such that the tolerance can be given as an input parameter, see here: <a href="https://github.com/greschd/wannier90/tree/irdist_ws_tol">https://github.com/greschd/wannier90/tree/irdist_ws_tol</a></p>
    <p>First of all, do you think this is useful / necessary in general? If yes, are there other places in ws_distance.F90 where the tolerance should be changed accordingly? From glancing over the code I would guess maybe <tt>eps = 10 * irdist_ws_tol</tt> would make sense. Of course we could also let the user set <tt>eps </tt>and use <tt>irdist_ws_tol = eps / 10</tt> . Please let me know what you think about this.</p>
    <p>Best regards,</p>
    <p>Dominik
</p>
    <p>P.S.: I uploaded my input files here: <a href="http://z2pack.ethz.ch/54dcaf52-9c86-4cd6-b5dc-1fe2714ca45d/input.tar.bz2">http://z2pack.ethz.ch/54dcaf52-9c86-4cd6-b5dc-1fe2714ca45d/input.tar.bz2</a> However, the files are very large (500MB compressed, about 1.2 GB uncompressed), so they might not be worth downloading. Also, I'm not especially interested in getting this particular example to run, I was just playing around with parameters to see how they affect the result.
</p>
    <br>
    <div class="moz-cite-prefix">On 15.02.2017 13:32, Lorenzo Paulatto
      wrote:<br>
    </div>
    <blockquote cite="mid:1770694.DC6128LFjS@naquite" type="cite">
      <meta name="qrichtext" content="1">
      <style type="text/css">
p, li { white-space: pre-wrap; }
</style>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On Tuesday, February 14, 2017 9:51:50 PM CET Dominik Gresch wrote:</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> Dear Wannier90 community,</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> While running Wannier90 with the 'use_ws_distance = .TRUE.' flag, I</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> encounter the error 'wrong irdist_ws'. Does anyone know the nature of</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> this error?</p>
      <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">This error should never happen, although if the position of the centres of the WFs are very noisy it may pop up. It is difficult to tell without having the slightest detail about your calculation. </p>
      <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Could you please provide us the files necessary to reproduce you calculation (ie. all the file seedname.*, except the UNK files).</p>
      <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">As a quick workaround, you can go in the file src/ws_distance.F90 and around line 156 change this check:</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">   </span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">IF</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">(</span><span style=" font-family:'monospace'; color:#18b2b2; background-color:#ffffff;">ANY</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">(</span><span style=" font-family:'monospace'; color:#18b2b2; background-color:#ffffff;">ABS</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">(</span><span style=" font-family:'monospace'; color:#18b2b2; background-color:#ffffff;">DBLE</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">(irdist_ws)</span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">-</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">irdist_real)</span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">></span><span style=" font-family:'monospace'; color:#b21818; background-color:#ffffff;">1.d-6</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">)) </span><span style=" font-family:'monospace'; color:#b218b2; background-color:#ffffff;">&</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;"> </span><span style=" font-family:'monospace';">
        </span><span style=" font-family:'monospace'; color:#18b2b2; background-color:#ffffff;">call</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;"> io_error(</span><span style=" font-family:'monospace'; color:#b21818; background-color:#ffffff;">'wrong irdist_ws'</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">)</span><span style=" font-family:'monospace';">

</span>allowing for a larger tolerance, something like 1.d-4 or 1.d-3. If then the code runs to the end, it is just a problem of numerical noise/minimisation not being tight enough.</p>
      <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">If this does not help, we definitely need to reproduce the calculation in order to be able to help.</p>
      <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> Important things to note:</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">>      - The error seems to appear also for 'use_ws_distance = .FALSE.',</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> but in that case the output files are still written</p>
      <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Yes, there is a place where the subroutine causing the error is called even when that option is false. This occurence arrives later in the code, hence I can see how the output files are written in this case. To avoid this problem, you can change src/plot.F90 around line 80, from</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">if</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;"> ( write_hr</span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">.or.</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">write_rmn</span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">.or.</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">write_tb ) </span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">then</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;"> </span><span style=" font-family:'monospace';">
         </span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">if</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;"> (</span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">.not.</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">done_ws_distance) </span><span style=" font-family:'monospace'; color:#18b2b2; background-color:#ffffff;">call</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;"> ws_translate_dist(nrpts,irvec) </span><span style=" font-family:'monospace';">
         </span><span style=" font-family:'monospace'; color:#18b2b2; background-color:#ffffff;">call</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;"> ws_write_vec(nrpts,irvec) </span><span style=" font-family:'monospace';">
</span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">end if</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'monospace';">
</span>to</p>
      <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">if</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;"> ( (write_hr</span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">.or.</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">write_rmn</span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">.or.</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">write_tb) </span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">.and.</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;"> use_ws_distance) </span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">then</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;"> </span><span style=" font-family:'monospace';">
         </span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">if</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;"> (</span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">.not.</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;">done_ws_distance) </span><span style=" font-family:'monospace'; color:#18b2b2; background-color:#ffffff;">call</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;"> ws_translate_dist(nrpts,irvec) </span><span style=" font-family:'monospace';">
         </span><span style=" font-family:'monospace'; color:#18b2b2; background-color:#ffffff;">call</span><span style=" font-family:'monospace'; color:#000000; background-color:#ffffff;"> ws_write_vec(nrpts,irvec) </span><span style=" font-family:'monospace';">
</span><span style=" font-family:'monospace'; color:#af5f00; background-color:#ffffff;">end if</span><span style=" font-family:'monospace';">
</span></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">And, of course, recompile (I have not tested this, but it should work).</p>
      <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">>      - My input files were generated with VASP (meaning, for Wannier90</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> v.1), which could be the source of the problem</p>
      <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">I do not think this makes any difference.</p>
      <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
      <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">hth</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">-- </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Dr. Lorenzo Paulatto </p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">IdR @ IMPMC -- CNRS & Université Paris 6</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">phone: +33 (0)1 442 79822 / skype: paulatz</p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">www:   <a class="moz-txt-link-freetext" href="http://www-int.impmc.upmc.fr/~paulatto/">http://www-int.impmc.upmc.fr/~paulatto/</a></p>
      <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">mail:  23-24/423 Boîte courrier 115, 4 place Jussieu 75252 Paris Cédex 05</p>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Wannier mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Wannier@quantum-espresso.org">Wannier@quantum-espresso.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.qe-forge.org/cgi-bin/mailman/listinfo/wannier">http://mailman.qe-forge.org/cgi-bin/mailman/listinfo/wannier</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>