el1='Ag'
el2='O'
name='ago_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) =$ago_b1, 
    nat=  2, 
    ntyp= 2,
    noncolin=$ncol,
    lspinorb=$lso,
    occupations='smearing',
    smearing='$smearing_type',
    degauss=$degauss
    ecutwfc =$ecutwfc,
    ecutrho =$ecutrho
 /
 &electrons
    conv_thr =  1.0d-10
 /
ATOMIC_SPECIES
$el1  0.0    $pseudo_ag
$el2  0.0    $pseudo_o
ATOMIC_POSITIONS
$el1  0.0000000   0.00000000   0.0
$el2  0.500000    0.5000000   0.5
K_POINTS AUTOMATIC
$nk $nk $nk $ish $ish $ish
EOF

