[Pw_forum] about CP.x ,example23

Axel Kohlmeyer axel.kohlmeyer at theochem.ruhr-uni-bochum.de
Fri Apr 8 09:11:55 CEST 2005


On Fri, 8 Apr 2005, xywu wrote:

 
XW> Dear all,

dear xiyong,

XW> What's the means of following code in example23. I did not find the 
XW> words such as EFIELD in INPUT_CP.
XW> Please give me some advice.

the section of the script from the cat up to the EOF
will create a file named WANNIER with the content
that is bracketed by those lines. this is a so called
heredoc, which should be explained in any book about
(advanced?) programming of shell scripts.

the file is obviously required for the later job and
if you look at the code in CPV/wannier.f90 you'll
see that the existence of a file named WANNIER in the
working directory of a CP job will set the internal flag
'wann_calc' to .true. and then read the contents of those
files. the left part are the values read in, the right
part are the names of the corresponding variables. this
is obviously to keep track of them, since the input is
read line by line, everything on a line that does not
match the list of variables to a fortran read statement
will be ignored, so the right part of the input is not
needed. the meaning of the individual variables you can
figure out by reading through the comments in the source,
e.g.

module efcalc
! switch:       whether to switch on the field adiabatically
! efield:       whether to do dynamics in the presence of an external EF
! efx0, efy0, efz0: initial magnitude of the E Field in x, y and z dir
! efx1, efy1, efz1: final magnitude of the E Field in x, y and z dir
! sw_len:       the # of steps over which field should be switched on

if you then look back into the Doc directory (like i did after
i wrote the text above), you'll probably see a file named
README.WANNIER which should explain the contents use of that 
file in more detail.

i hope that will answer you question, and will also give
you a hint on how to help yourself in the future.

let me also use the opportunity to remind all 'mere users' 
of the espresso package, that extending the documentation is
_your_ chance to contribute to the software. many times it
is the user of a code who knows _much_ better how to explain 
the use of some functionality to some other user, than the 
programmer himself or herself. getting support via the mailing
list is a nice thing, but having that know-how in writing in
the manual, would be even nicer. it does not take a programmer
to do that and, in fact, it will give those guys more time
to do programming, so everybody will benefit from it.

with best regards,
	axel.

XW> 
XW> Thank you in advance!
XW> 
XW> 
XW> # calculation with an electric field
XW> cat > WANNIER << EOF
XW>   .true. .true.                         EFIELD SWITCH
XW>   100                                   SW_LEN
XW>   0.d0 0.d0 0.0d0                       EFX0 EFY0 EFZ0
XW>   0.d0 0.d0 0.5d-2                      EFX1 EFY1 EFZ1
XW>   .false.                               WFSD
XW>   0.1 0.3 10 10                         WFDT MAXWFDT NIT NSD
XW>   1500. 5. .3 10                        Q DT FRIC NSTEPS
XW>   1.d-9                                 TOLW
XW>   .true.                                ADAPT
XW>   3 1 40                                CALWF NWF WFFORT
XW>   21                                    IPLOT
XW>   .false.                               WRITEV
XW> EOF
XW> 
XW> 

-- 

=======================================================================
Dr. Axel Kohlmeyer   e-mail: axel.kohlmeyer at theochem.ruhr-uni-bochum.de
Lehrstuhl fuer Theoretische Chemie          Phone: ++49 (0)234/32-26673
Ruhr-Universitaet Bochum - NC 03/53         Fax:   ++49 (0)234/32-14045
D-44780 Bochum  http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/
=======================================================================
If you make something idiot-proof, the universe creates a better idiot.




More information about the users mailing list