Generating formatted .rho file from Siesta

Asked by Vidushi Sharma on 2017-07-08

Hello,

I am trying to figure out how to generate a formatted (ASCII) .rho file as output from Siesta (running in parallel mode). So far, I have changed the flag "fform" in ~/siesta_install_directory/Utils/Plrho/iorho.f from "unformatted" to "formatted" and recompiled Siesta. Also, I ran "sh ./build_all.sh" in the ~/siesta_install_directory/Utils/ directory prior to recompiling Siesta.

My impression was that merely by toggling the 'fform' flag in the abovementioned file, Siesta would produce the appropriate formatted .rho file. However, my output .rho file is not readable.

My eventual goal is to use this .rho file to plot charge densities, using either my own code or some suitable implementation in Matlab. So for this purpose, the output file has to be ASCII readable.

Does the fortran program have to be run manually? Also, there is a line in the comments in the iorho.f file which suggests that this program reads only files written in serial mode. Does this refer to the serial vs parallel mode of Siesta or something else?

I appreciate any inputs about this!

Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
Siesta Edit question
Assignee:
No assignee Edit question
Last query:
2017-07-08
Last reply:
2017-07-21
Nick Papior (nickpapior) said : #1

There already exists tools to generate the necessary files for plotting charge densities.

In the Util/Grid folder there is a command grid2cube which may transfer a .* file to the corresponding cube file.
A cube file can be read and plotted using many visualizers, molden, vmd, xcrysden, etc.
And it is in ASCII format, so you may easily read it subsequently to perform your own plotting in e.g. matlab or python.

Alberto Garcia (albertog) said : #2

Note also the availability (in the same Util/Grid directory) of converters from .rho and other grid files to a netcdf format. I believe that Matlab can read netcdf files directly.

Can you help with this problem?

Provide an answer of your own, or ask Vidushi Sharma for more information if necessary.

To post a message you must log in.