라벨이 Bash Shell인 게시물 표시

Caution for Variable Designation in Bash Shell

Do not space in front and behind of = e.g. energy = 33.0 (X) previousenergy = $energy (X) energy=33.0   (O) previousenergy=$energy (O) Thanks, JF

Submit File for Iterative Calculation in Density Functional Theory (VASP) using Bash Shell

이미지
Many times we run into the situation which we should calculate iterative. In this case, this bash shell script can be used very helpfully. Here is example script. This script is that we can calculate iteratively changing the value of ISIF in INCAR file. sed "s/ISIF=${prei}/ISIF=${i}/" INCAR > temp means that find the lines with ISIF=value of prei (initial value is defined 1) and change it to ISIF=value of i ( i is changed from 1 to 7 ). So, this bash shell makes it possible to simulate with various kinds of relax conditions. $mpi_cmd -np $num_proc -hostfile $PBS_NODEFILE $lmp_cmd > vasp.log 2>&1 This command is excution command. (This is different according to your cluster environment) if [ "${prei}" -eq 7 ]; then mkdir calculatenum_${i} cp * calculatenum_${i} else prei=${i} cp CONTCAR POSCAR fi Here are the if loop that determines wheter calculated files save or not. Last calculation will be saved. The others is not sa