Dear Guido, These are very useful two pieces of information for me. and since i have the luxury of two options now, i guess i will save modifying the sumpdos for some other time. I tried the bash scripting because it's safer, I modified it a lil bit to sum over all columns, and yes ! it worked. you really helped ... thank you!
On Fri, Sep 16, 2011 at 10:32 AM, <pw_forum-request at pwscf.org> wrote: > Send Pw_forum mailing list submissions to > pw_forum at pwscf.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://www.democritos.it/mailman/listinfo/pw_forum > or, via email, send a message with subject or body 'help' to > pw_forum-request at pwscf.org > > You can reach the person managing the list at > pw_forum-owner at pwscf.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Pw_forum digest..." > > Today's Topics: > > 1. Re: modifying sumpdos.f90 (Guido Fratesi) > > > ---------- Forwarded message ---------- > From: Guido Fratesi <fratesi at mater.unimib.it> > To: PWSCF Forum <pw_forum at pwscf.org> > Date: Fri, 16 Sep 2011 08:56:11 +0200 (CEST) > Subject: Re: [Pw_forum] modifying sumpdos.f90 > Dear Maaly, > > as a first and simple modification, you could change what is read from the > file. The key line is the READ statement below, which puts the contents of > column1 into egrid, of column2 into pdos(up) and column3 into pdos(dw) (if > nspin==2) (from file sumpdos.f90). > > DO ie = 1, ngrid > READ(10, *, IOSTAT=ios ) egrid(ie), pdos(ie, 1:nspin, ifile) > IF (ios/=0) & > CALL errore("sumpdos", "reading first line in > "//trim(file(ifile)), ie ) > ENDDO > > > Learning Fortran would be of help by sure. Still, you might find more > convenient to use some scripting to perform some simple yet very specific > operations as the one you mention here. As an example, let me write below a > bash script I recently used to sum the p_z-PDOS. > > ========================= > > #!/bin/bash > > n=0 > prefix=YOUR_PREFIX > > # loop over files to be summed > for file in $prefix.pdos_atm*\(p\) ; do > n=$((n+1)) > echo "including file: " $file > > # get pz PDOS from file $file (spin-unpolarized: get 3rd column) > awk '(NR>1) {print $3}' $file > pz_$n > > done > > # get energies (1st column) > awk '(NR>1) {print $1}' *.pdos_tot > en > > # paste PDOS energies, sum, write results > paste en pz_* | awk '{tot=0; for (i=2;i<=NF;i++) {tot=tot+$i}; print $1, > tot}' > $prefix.pdos_pz > > # delete temporary files > rm pz_* en > > ========================= > > > On Wed, 14 Sep 2011, maaly wrote: > > Dear all, >> >> >> I need to modify sumpdos.f90 to sum one of the pdos(up) and pdos(dwn) >> columns for selected atoms instead of summing ldos(up) and ldos(dwn) >> and i'm not that familiar with fortran, so it will be very great if any >> one >> can tell me how. >> >> >> >> >> >> Best regards, >> >> Maaly Ghariballah >> Graduate student >> Alneelain university,sudan >> >> > -- > Guido Fratesi > > Dipartimento di Scienza dei Materiali > Universita` degli Studi di Milano-Bicocca > via Cozzi 53, 20125 Milano, Italy > > Phone: +39 02 6448 5183 > email: fratesi at mater.unimib.it > > > _______________________________________________ > Pw_forum mailing list > Pw_forum at pwscf.org > http://www.democritos.it/mailman/listinfo/pw_forum > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.democritos.it/pipermail/pw_forum/attachments/20110917/4ea43c89/attachment.htm
