131 Zeilen
3.3 KiB
Bash
Ausführbare Datei
131 Zeilen
3.3 KiB
Bash
Ausführbare Datei
#! /bin/zsh
|
|
|
|
# For given N (L), this
|
|
# computes the required DSF (up to required sumrule)
|
|
# over a range of values of c_int.
|
|
|
|
# The data can then be used to produce animated graphs (with c_int evolving),
|
|
# see the `c_scan_N_fixed_dsfs[_plot]` scripts.
|
|
|
|
if [[ $# -ne 7 ]]; then
|
|
echo "Arguments needed: whichDSF, kBT, target_sumrule, N, nkmax (max momentum in units of kF/4), Max_Secs (per c), refine."
|
|
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 "N must be > 0."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ $5 -lt 0 ]]; then
|
|
echo "nkmax must be > 0."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ $6 -lt 0 ]]; then
|
|
echo "Max_Secs must be > 0."
|
|
exit 1
|
|
fi
|
|
|
|
if [[ $7 != 0 && $7 != 1 ]]; then
|
|
echo "refine must be 0 (false) or 1 (true)."
|
|
exit 1
|
|
fi
|
|
|
|
timestart=$(date +%s)
|
|
|
|
whichDSF=$1
|
|
kBT=$2
|
|
target_sumrule=$3
|
|
N=$4
|
|
nkmax=$5
|
|
Max_Secs=$6
|
|
refine=$7
|
|
|
|
correlator='rho-rho'
|
|
if [[ $whichDSF == 'o' ]]; then
|
|
correlator='psidag-psi'
|
|
elif [[ $whichDSF == 'g' ]]; then
|
|
correlator='psi-psidag'
|
|
fi
|
|
|
|
mkdir -p logs
|
|
logfile='logs/c_scan_N_fixed_'$whichDSF'_kBT_'$kBT'_sr_'$target_sumrule'_N_'$N'_nkmax_'$nkmax'_'$(date '+%Y-%m-%d-%Hh%M')'.log'
|
|
touch $logfile
|
|
|
|
iKmax=$(($nkmax * $N/8))
|
|
|
|
|
|
# List of interactions: fractional powers of 2
|
|
clist_raw=()
|
|
for nc in {-160..160}
|
|
do
|
|
clist_raw=($clist_raw $(( 4 * 2**($nc/16.) )))
|
|
done
|
|
# Now cast the integer values to true integers
|
|
zmodload zsh/mathfunc
|
|
clist=()
|
|
for c in $clist_raw
|
|
do
|
|
if [[ $((floor($c))) == $((ceil($c))) ]]; then
|
|
clist=($clist $((int($c))))
|
|
else
|
|
clist=($clist $c)
|
|
fi
|
|
done
|
|
|
|
basedir="$(pwd)"
|
|
|
|
# Safety barrier:
|
|
# if directory exists, don't do anything and request directory deletion before proceeding
|
|
dircheck='Lieb-Liniger/'$correlator'/T_'$kBT'/c_scan_N_fixed/k_0_to_'${(l:2::0:)nkmax}'kFo4/sr_'$target_sumrule'/store/data/N_'$N
|
|
if [[ -d $dircheck ]]; then
|
|
echo 'A c scan with these parameters already exists. Aborting.'
|
|
echo 'If you really want to run this command, please first delete directory:\n'$dircheck
|
|
exit 1
|
|
fi
|
|
|
|
|
|
for c in $clist
|
|
do
|
|
echo '** Starting run for c =' $c', N = '$N | tee -a $logfile
|
|
dir='Lieb-Liniger/'$correlator'/T_'$kBT'/c_scan_N_fixed/k_0_to_'${(l:2::0:)nkmax}'kFo4/sr_'$target_sumrule'/store/data/N_'$N'/c_'$c
|
|
mkdir -p $dir
|
|
cd $dir
|
|
clock1=$(date +%s)
|
|
LiebLin_DSF $whichDSF $c $N $N 0 $iKmax $kBT $Max_Secs $target_sumrule $refine
|
|
clock2=$(date +%s)
|
|
dt=$(($clock2 - $clock1))
|
|
dt_hrs=$(($dt/3600))
|
|
dt_min=$((($dt - 3600*$dt_hrs)/60))
|
|
dt_sec=$(($dt - 3600*$dt_hrs - 60*$dt_min))
|
|
cd $basedir
|
|
echo '++ Successfully computed DSFs for c =' $c', N = '$N'.' | tee -a $logfile
|
|
echo 'Time required: '$dt_hrs'h '$dt_min'm '$dt_sec's.\n' | tee -a $logfile
|
|
done
|
|
|
|
echo '\n++ Successfully completed c_scan_N_fixed_data for N = '$N' on '$(date '+%Y-%m-%d-%Hh%M')'.\n' | tee -a $logfile
|
|
|
|
timestop=$(date +%s)
|
|
|
|
duration=$(($timestop - $timestart))
|
|
hours=$(($duration/3600))
|
|
minutes=$((($duration - 3600*$hours)/60))
|
|
seconds=$(($duration - 3600*$hours - 60*$minutes)) # don't bother printing
|
|
echo 'Total time required: '$hours'h '$minutes'm.\n' | tee -a $logfile
|