el1='Ag'
el2='Cl'
name='agcl_b1'

mkdir $WORK_DIR/$name

cat > $WORK_DIR/$name/$name.d <<EOF
$el1
$el2
 &control
    calculation = 'scf'
    prefix='$name',
    pseudo_dir = '$PSEUDO_DIR',
    outdir='$TMP_DIR'
 /
 &system
    ibrav=  2, 
    celldm(1) =$agcl_b1, 
    nat=  2, 
    ntyp= 2,
    noncolin=$ncol,
    lspinorb=$lso,
    ecutwfc =$ecutwfc,
    ecutrho =$ecutrho
 /
 &electrons
    conv_thr =  1.0d-10
 /
ATOMIC_SPECIES
$el1  0.0    $pseudo_ag
$el2  0.0    $pseudo_cl
ATOMIC_POSITIONS
$el1  0.0000000   0.00000000   0.0
$el2  0.500000    0.5000000   0.5
K_POINTS AUTOMATIC
$nki $nki $nki $ish $ish $ish
EOF

