ABACUS/scripts/catalogue/c_fixed_N_prog_plots.sh

92 行
1.9 KiB
Bash
実行ファイル

#! /bin/zsh
# We use zsh here to support floats (not supported in bash)
# This script produces the .dsfs files and figures for the `c_fixed_N_prog` runs
# which achieved the required sumrule saturation.
if [[ $# -ne 5 ]]; then
echo "Arguments needed: whichDSF, kBT, target_sumrule, nkmax (max momentum in units of kF/4), width."
exit 1
fi
if [[ $1 != 'd' && $1 != 'g' && $1 != 'o' ]]; then
echo "Only the d, g and o scanning options are implemented."
exit 1
fi
if [[ $2 -lt 0 ]]; then
echo "Temperature kBT must be > 0."
exit 1
fi
if [[ $3 -lt 0 || $3 -gt 1 ]]; then
echo "Requirement: 0 < target_sumrule < 1."
exit 1
fi
if [[ $4 -lt 0 ]]; then
echo "nkmax must be > 0."
exit 1
fi
if [[ $5 -lt 0 ]]; then
echo "width must be > 0."
exit 1
fi
whichDSF=$1
kBT=$2
target_sumrule=$3
nkmax=$4
width=$5
correlator='rho-rho'
if [[ $whichDSF == 'o' ]]; then
correlator='psidag-psi'
elif [[ $whichDSF == 'g' ]]; then
correlator='psi-psidag'
fi
clist=(0.015625 0.03125 0.0625 0.125 0.25 0.5 1 2 4 8 16 32 64 128 256 512 1024)
basedir="$(pwd)"
for c in $clist
do
echo 'Starting plotting of DSFs for c =' $c
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_fixed_N_prog/c_'$c'/k_0_to_'${(l:2::0:)nkmax}'kFo4/sr_'$target_sumrule'/store/data'
cd $dir
for datadir in *
do
cd $datadir
N=${datadir#"N_"}
mkdir -p ../../plots/N_$N
cd ../../plots/N_$N
# Move all K_, Omega_ and .dsfs files here
mv ../../data/N_$N/K_* .
mv ../../data/N_$N/Omega_* .
mv ../../data/N_$N/*dsfs .
# Find the K and Omega file
for file in *
do
if [[ $file = Omega* ]]; then
omegafile=$file
elif [[ $file = K_* ]]; then
kfile=$file
fi
done
# For each .dsfs file, plot
for file in *_w_$width.dsfs
do
echo 'Found file ' $file
# invoke the python script
plot_dsf_k_range.py $kfile $omegafile $file
done
cd ../../data
done
cd $basedir
echo ' Successfully computed DSFs for c =' $c
done