There is job.sh script in a lot of official VASP examples, for example: Graphite MBD binding energy. it is used to help submit job on supercomputer
But in the script, it usually uses vaspcmd, which I am not sure what it is, I checked the vasp wiki and vasp help document, there is not explanation about it.
My question is:
What is vaspcmd?

# To run VASP this script calls $vasp_std
# (or posibly $vasp_gam and/or $vasp_ncl).
# These variables can be defined by sourcing vaspcmd
. vaspcmd 2> /dev/null

# When vaspcmd is not available and $vasp_std,
# $vasp_gam, and/or $vasp_ncl are not set as environment
# variables, you can specify them here
[ -z "`echo $vasp_std`" ] && vasp_std="mpirun -np 8 /path-to-your-vasp/vasp_std"
[ -z "`echo $vasp_gam`" ] && vasp_gam="mpirun -np 8 /path-to-your-vasp/vasp_gam"
[ -z "`echo $vasp_ncl`" ] && vasp_ncl="mpirun -np 8 /path-to-your-vasp/vasp_ncl"

# The real work starts here

# Here the work starts
rm results.dat


for i in graphene graphite
  cd $drct/$i

cd $drct

# obtain total energy for graphite 
en2=$(grep "free  ene" graphite/OUTCAR |tail -1|awk '{print $5}') 

# obtain total energy for graphene
en1=$(grep "free  ene" graphene/OUTCAR |tail -1|awk '{print $5}')

# compute interlayer binding energy (eV/atom)
deltaE=$(echo print $en2/4 - $en1/2 |python)

echo "Binding energy (eV/atom): " $deltaE >results.dat

  • $\begingroup$ I don't use VASP, so someone else will probably be able to answer this better, but it seems like vaspcmd is a variable that some scripts define that just stores the path/settings for the VASP executable. As far as I can tell, this is not a part of VASP and is something you would have to define/fill-in yourself similar to /path-to-your-vasp/vasp_std in the example code. $\endgroup$
    – Tyberius
    Jan 6 at 17:56
  • 1
    $\begingroup$ It's a file containing environment variable definitions and (potentially) shell functions. I don't know much about VASP, but you can tell that must be what it is because it is included with the "source" command -- although this script uses its alternative "." which makes it extra confusing if you haven't seen it before. It must define the variables vasp_std, vasp_gam and vasp_ncl at least, because (a) the comment says so; and (b) the rest of the script uses them! You could easily write your own, but it might be worth looking in the VASP source tree to see if there's a sample provided. $\endgroup$ Jan 6 at 22:54

1 Answer 1

# To run VASP this script calls $vasp_std
# (or posibly $vasp_gam and/or $vasp_ncl).
# These variables can be defined by sourcing vaspcmd
. vaspcmd 2> /dev/null

As mentioned in the comments, the answer is actually in your question. vaspcmd is just any script you provide that defines the $vasp_std, $vasp_gam and $vasp_ncl variables which give the full path to the executables. You must write this script, it is not provided since it depends on the installation location.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.