<div dir="ltr"><p class="MsoNormal">Dear Matt<o:p></o:p></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:black;
mso-no-proof:yes"><br></span></p><p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:black;
mso-no-proof:yes">The following</span><span style="mso-fareast-font-family:
"Times New Roman";mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;
color:black"> code seems to give the correct MOLDEN-FORMAT. Please note that: </span></p><p class="MsoNormal" style="text-indent: 0px; margin-bottom: 0.0001pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="color: black; text-indent: -0.25in;"> 1) I modified (irow_in+orbital ) in (irow_in+orbital – 1)</span></p><p class="MsoNormal" style="text-indent: 0px; margin-bottom: 0.0001pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="color: black; text-indent: -0.25in;"> 2) I tested </span>molden<span style="color: black; text-indent: -0.25in;"> formatted files containing no more than s,p,d functions.</span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:black"> </span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:black">DO orbital = 1, 15<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:black"> IF (orbmap(orbital) .NE. 0) THEN<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:black"> WRITE (iw, fmtstr1) irow_in+orbital - 1 , mo_coeff(orbmap(orbital))<o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:black"> END IF <o:p></o:p></span></p>
<p class="MsoNormal" style="margin-bottom: 0.0001pt; line-height: normal; background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:black">END DO<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">By adding the following clause:<o:p></o:p></p>
<pre style="background-image: initial; background-position: initial; background-size: initial; background-repeat: initial; background-attachment: initial; background-origin: initial; background-clip: initial;"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;
mso-ascii-theme-font:minor-latin;mso-hansi-theme-font:minor-latin;mso-bidi-theme-font:
minor-latin"> I</span>F (mo_coeff(orbmap(orbital)) .GT. 10.0**(-digits))</pre>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">One obtains an incomplete MODLEN formatted file since it misses some coefficients greater than <span style="mso-fareast-font-family:
"Times New Roman";mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;
color:black">10.0**(-digits). <o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:black"> </span></p>
<p class="MsoNormal"><span style="mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:black;
mso-no-proof:yes">Best</span><span style="mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:black"> Regards.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-font-family:"Times New Roman";
mso-bidi-font-family:Calibri;mso-bidi-theme-font:minor-latin;color:black">Luca </span><o:p></o:p></p><br>On Saturday, July 28, 2018 at 6:41:21 PM UTC+2, Matt W wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir="ltr">Hmmm, could you try recompiling after changing the lines around 323 - 330 to something like <div><br></div><div><pre style="color:rgb(0,0,0)"> DO orbital = 1, 15<font></font>
IF (orbmap(orbital) .NE. 0) THEN<font></font>
WRITE (iw, fmtstr1) irow_in+orbital, mo_coeff(orbmap(orbital))<font></font>
IF (mo_coeff(orbmap(orbital)) .GT. 10.0**(-digits)) THEN<font></font>
WRITE(6,*) "skipping this orbital"<font></font>
END IF<font></font>
END IF<font></font>
END DO</pre><div><br></div><div>i.e. take the original write statement out of the if clause. This should print all coefficients in molden format. </div><div><br></div><div>If that works then I can try and see why the if statement doesn't work as expected ...</div><div><br></div><div>Matt</div><div><br>On Saturday, July 28, 2018 at 5:05:04 PM UTC+1, Luca wrote:<blockquote class="gmail_quote" style="margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">Dear Matt</font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">Thank you for your answer. However, I still believe that the printed formats do not differ only for the ordering. Furthermore, modifying NDIGITS does not fix the issue. </font></font></p><p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">This means that the printed MOLDEN file cannot be used for quantitative post-processing.</font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">I performed tests on H atoms and the H2 molecule, and in both the cases, the MOLDEN-file does not contain the right orbitals. </font></font></p><p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">Below I will report the H case. The orbital printed in the MOLDEN FORMAT is not normalized, as you can easily check by printing the OVERLAP matrix. </font></font></p><p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">Please find below the different formats and the overlap (NDIGITS = 12) :</font></font></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">CP2K-FORMAT : Occupied orbital of H</font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit"> 1 1 H 1s 0.860523926375 </font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit"> 2 1 H 2s -0.147897200557 </font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit"> 3 1 H 2px -0.000000000000 </font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit"> 4 1 H 2py -0.000000000000 </font></font></p>
<div style="border-top-width:initial;border-right-width:initial;border-left-width:initial;border-style:none none solid;border-bottom-width:1pt;border-bottom-color:windowtext;padding:0in 0in 1pt">
<p class="MsoNormal" style="border-width:initial;border-style:none;padding:0in"><font style="vertical-align:inherit"><font style="vertical-align:inherit"> 5 1 H 2pz -0.000000000000 </font></font></p>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">MOLDEN-Format :Occupied orbital of H </font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">One = -0.25103226963873182</font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit"> Spin= Alpha</font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit"> Occup= 1.0000000000000000</font></font></p>
<div style="border-top-width:initial;border-right-width:initial;border-left-width:initial;border-style:none none solid;border-bottom-width:1pt;border-bottom-color:windowtext;padding:0in 0in 1pt">
<p class="MsoNormal" style="border-width:initial;border-style:none;padding:0in"><font style="vertical-align:inherit"><font style="vertical-align:inherit"> 2 8.605239264E-01</font></font></p>
</div>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">OVERLAP</font></font></p>
<p class="MsoNormal"> <font style="vertical-align:inherit"><font style="vertical-align:inherit"><wbr> 1s </font></font><font style="vertical-align:inherit"><font style="vertical-align:inherit"><wbr>2s </font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">1 1 H 1s 1.000000008914 -0.933553473764</font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">2 1 H 2s -0.933553473764 1.000000029566</font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">------------------------------</font></font><font style="vertical-align:inherit"><font style="vertical-align:inherit"><wbr>------------------------------</font></font><font style="vertical-align:inherit"><font style="vertical-align:inherit"><wbr>------------------------------</font></font><font style="vertical-align:inherit"><font style="vertical-align:inherit"><wbr>------------------------------</font></font><font style="vertical-align:inherit"><font style="vertical-align:inherit"><wbr>-----------------</font></font></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">The right MOLDEN FORMAT should be (I tested it):</font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit"> 1 0.860523926375 </font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit"> 2 -0.147897200557 </font></font></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">Best Regards.</font></font></p>
<p class="MsoNormal"><font style="vertical-align:inherit"><font style="vertical-align:inherit">Luca </font></font></p></div></blockquote></div></div></div></blockquote></div>