COSMO Debug Mode

178 views
Skip to first unread message

Dinis Abranches

unread,
Mar 4, 2022, 1:42:33 PM3/4/22
to NWChem Forum
Dear all,

Is there a way to request the debug printing mode of COSMO mentioned in hnd_cosmo_lib.F from an input file? Also, some of the example files mention a "cosmo_energies" print keyword (ex. /QA/tests/cosmo_cl/cosmo_cl.nw) but I could not find any documentation regarding it. Are there any other COSMO-related printing keywords not mentioned in the documentation?

I'm interested in this because I would like NWChem to provide the area (accounting for  YK switching) of each segment printed in the cosmo.xyz output file. Maybe there is an easy way to do this?

Thank you all for your help!

Best,
Dinis

Edoardo Aprà

unread,
Mar 4, 2022, 2:55:05 PM3/4/22
to NWChem Forum
Currently, it's not possible to enable the debug print statements you alluded to from the input file. We will try to modify the source code to enable this option.

Dinis Abranches

unread,
Mar 4, 2022, 11:28:27 PM3/4/22
to NWChem Forum
Thanks for the reply! What about COSMO-related printing keywords? Is there anything else besides "cosmo_energies"?

Edoardo Aprà

unread,
Mar 6, 2022, 4:16:16 PM3/6/22
to NWChem Forum

Dinis Abranches

unread,
Mar 8, 2022, 3:17:36 PM3/8/22
to NWChem Forum
The new debug printing modes are very helpful, thank you! Just a couple of questions:

1) What is the exact meaning of dbl_mb(k_efcs+ief-1) being printed in line 823 of hnd_cosmo_lib.F?
2) Is there a way to print the area of each segment after switching for the YK model? Perhaps by saving the values xyzff(iseg,iat)*dsurf*ratm_real**2 and 
xyzff(iseg,iat)*
wleb(iseg)*ratm_real**2 (lines 769 and 775 of  hnd_cosmo_lib.F) and printing them later?

Daniel Mejia Rodriguez

unread,
Mar 10, 2022, 1:53:18 PM3/10/22
to NWChem Forum
1) dbl_mb(k_efcs) store the diagonals of the A0 matrix elements (Equation (67) of https://pubs.acs.org/doi/10.1021/jp992097l)
2) Saving the full 2D array would result in many contributions being 0 (the ones discarded by the YK switching function), I think it will suffice to save the values only for the points that survive, right?

Best,
Daniel

Dinis Abranches

unread,
Mar 10, 2022, 2:32:09 PM3/10/22
to NWChem Forum
Thanks Dr. Rodriguez! Yes, saving the full 2D array is unnecessary, but it is better than not having the areas printed out at all. Just by looking at the code, one approach would be to print this value instead of the diagonals of the A0 matrix... That is, you would save xyzff(iseg,iat)*dsurf*ratm_real**2 (line 769) and xyzff(iseg,iat)*wleb(iseg)*ratm_real**2 (line 775) and then would print it in line 823, instead of printing  dbl_mb(k_efcs). This would be quite helpful to me to generate sigma profiles with the YK model, but perhaps it is too specific to be of general use to the community and does not warrant a code change? Another approach, perhaps more ideal, would be to have the area of each surviving segment being printed in the cosmo.xyz outtput file (alongside the x,y,z coordinates and Bq charge), but the code changes necessary might not be worth it.

Best,
Dinis

Daniel Mejia Rodriguez

unread,
Mar 10, 2022, 2:44:00 PM3/10/22
to NWChem Forum
Dinis, 
The PR https://github.com/nwchemgit/nwchem/pull/550 does enable printing the areas associated to the surviving surface charges. 

Edo, correct if I am wrong, but this printing will be triggered with

cosmo
 print cosmo_mol_surface
end

without printing the diagonal of A0.

Edoardo Aprà

unread,
Mar 10, 2022, 5:34:52 PM3/10/22
to NWChem Forum
Yes, those input lines are the correct ones.
The code changes are now available from the master branch.

Dinis Abranches

unread,
Mar 10, 2022, 11:36:27 PM3/10/22
to NWChem Forum
Thank you both very much! This new printing option is precisely what I was looking for.

Have you compared the COSMO results obtained using the current master branch against a previous version, say 6.8? Was this perhaps included in one of the pre-merge tests? For the exact same input file, the current master branch outputs point charges that are roughly an order of magnitude larger than those outputted by version 6.8. Could this be due to the printing changes made to hnd_cosmo_lib.F?

Dinis Abranches

unread,
Mar 11, 2022, 8:37:50 PM3/11/22
to NWChem Forum
There is, indeed, a (large) difference between the COSMO results obtained using the current master branch and the stable release 7.0.2. Note the files attached for a very simple scf energy calculation of water. OLD_cosmo.xyz are the results obtained using the stable release 7.0.2 while NEW_cosmo_xyz are the results obtained using the current master branch. Both files are obtained using input.nw. This is not some random variation; the results are precisely the same for multiple runs using the same version of nwchem. Furthermore, if the line do_cosmo_yk true in the input is replaced by do_cosmo_ks true, there are no differences anymore between both versions of nwchem, as seen in the files ks_OLD_cosmo.xyz and  ks_NEW_cosmo.xyz. Any thoughts?

Thanks for all your help so far!
ks_OLD_cosmo.xyz
NEW_cosmo.xyz
OLD_cosmo.xyz
input.nw
ks_NEW_cosmo.xyz

Daniel Mejia Rodriguez

unread,
Mar 11, 2022, 8:55:26 PM3/11/22
to nwchem...@googlegroups.com
Dinis,
There was a change in the definition of the Gaussian exponents in the YK approach around November. The exponents in prior NWChem versions were too small, and now are set to 4.5, as recommended in https://doi.org/10.1063/1.3359469 for discretizations based on regular polyhedra.



This change did not affect the KS approach.

Best,
Daniel 

--
You received this message because you are subscribed to a topic in the Google Groups "NWChem Forum" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/nwchem-forum/JqFOdrxiws0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to nwchem-forum...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nwchem-forum/92ed469c-13b8-48b3-9407-747104641070n%40googlegroups.com.

Dinis Abranches

unread,
Mar 13, 2022, 8:27:09 PM3/13/22
to NWChem Forum
Understood, that makes sense. Thank you!

Do you think it would be possible to extend the print cosmo_mol_surface keyword for the KS approach as well? Right now, if the keywords  print cosmo_mol_surface and do_cosmo_ks true are jointly used, the areas are printed as zeros. Perhaps simply adding an if(oprint_molsurf) statement to line 769 of hnd_cosmo_lib.F suffices?

Dinis Abranches

unread,
Mar 23, 2022, 4:26:46 PM3/23/22
to NWChem Forum
Dear all,

Any updates regarding  print cosmo_mol_surface keyword for the KS approach? I think the "Print KS segment surface" commit failed a few tests and didn't get through...
Thanks for your help!

Edoardo Aprà

unread,
Mar 23, 2022, 4:28:17 PM3/23/22
to NWChem Forum

Dinis Abranches

unread,
Mar 23, 2022, 10:47:15 PM3/23/22
to NWChem Forum
I might be mistaken, but I think that commit didn't pass some checks and was not implemented... In other words, if I clone the master branch I still get the previous version of hnd_cosmo_lib.F without that commit and, thus, without printing capabilities for KS. Is it safe to fork, force the commit and clone?

Edoardo Aprà

unread,
Mar 23, 2022, 10:50:35 PM3/23/22
to NWChem Forum
Could you send the output of

cd $NWCHEM_TOP
git pull
cd src/solvation
git log .
Reply all
Reply to author
Forward
0 new messages