#!/bin/sh
#QSUB2 queue qM
#QSUB2 core 24
#QSUB2 mpi 1
#QSUB2 smp 24
#QSUB2 wtime 24:00:00
#PBS -N BGG.cell+6.TA1
#PBS -m be
#PBS -M terumasa.tadano@gmail.com

cd ${PBS_O_WORKDIR}
. /etc/profile.d/modules.sh
module load mpt/2.14 intel/17.0.4.196 gnu/4.8.3

mode='TA1'

cat << EOF > input_${mode}.txt
&general
PREFIX = cell+6_${mode}
MODE = RTA
NKD = 3
KD = Ba Ga Ge
MASS = 137.327 69.723 72.64

FCSXML = ../BGG_FPMD800K_random2_lasso1.xml

ISMEAR = -1
TMIN = 0; TMAX = 1000; DT = 10
/

&cell
21.942
  1.0 0.0 0.0
  0.0 1.0 0.0
  0.0 0.0 1.0
/

&kpoint
2
20 20 20
/

&analysis
 KS_INPUT = ../target_files/target_harm_${mode}.dat
/
EOF
mpijob ~/src/alamode/anphon/anphon input_${mode}.txt > harm_${mode}.log


#for temp in 0 10 20 30 40 50 60 70 80 90 100 200 300
for temp in 300 200 100 50
do
cat << EOF > input_${mode}.txt
&general
PREFIX = ISC+6_${mode}_${temp}K
MODE = RTA
NKD = 3
KD = Ba Ga Ge
MASS = 137.327 69.723 72.64

FCSXML = ../BGG_FPMD800K_random2_lasso1.xml
FC2XML = ../BGG_SCPH+6_offdiag_${temp}K.xml

ISMEAR = -1
TMIN = 0; TMAX = 1000; DT = 10
/

&cell
21.942
  1.0 0.0 0.0
  0.0 1.0 0.0
  0.0 0.0 1.0
/

&kpoint
2
20 20 20
/

&analysis
 KS_INPUT = ../target_files/target_SCP${temp}K_${mode}.dat
/
EOF
mpijob ~/src/alamode/anphon/anphon input_${mode}.txt > ISC_${mode}_${temp}.log
done

