Browse Source

Add script to build Lieb-Liniger catalogue

master
Jean-Sébastien 2 years ago
parent
commit
6e9d25338a
1 changed files with 65 additions and 0 deletions
  1. 65
    0
      scripts/build_LiebLin_catalogue_k_fixed.sh

+ 65
- 0
scripts/build_LiebLin_catalogue_k_fixed.sh View File

@@ -0,0 +1,65 @@
1
+#! /bin/zsh
2
+
3
+# We use zsh here to support floats (not supported in bash)
4
+
5
+# This script produces a whole stack of subdirectories,
6
+# for a range of values of c centered on 4 with 8 up/down factors of 2,
7
+# and momenta in multiples of kF/4 from 1 to 16.
8
+
9
+# For each combination c/k, the LiebLin_Catalogue_Fixed_c_k_Nscaling
10
+# executable is invoked.
11
+
12
+
13
+if [[ $# -ne 4 ]]; then 
14
+	echo "Arguments needed: whichDSF, kBT, target_sumrule, nr_minutes (for each c, k combination)." 
15
+	exit 1
16
+fi
17
+
18
+if [[ $1 != 'd' && $1 != 'g' && $1 != 'o' ]]; then
19
+	echo "Only the d, g and o scanning options are implemented."
20
+	exit 1
21
+fi
22
+
23
+if [[ $2 -lt 0 ]]; then
24
+	echo "Temperature kBT must be > 0."
25
+	exit 1
26
+fi
27
+
28
+if [[ $3 -lt 0 || $3 -gt 1 ]]; then
29
+	echo "Requirement: 0 < target_sumrule < 1."
30
+	exit 1
31
+fi
32
+
33
+if [[ $4 -lt 1 ]]; then
34
+	echo "Please give a positive nr_minutes."
35
+	exit 1
36
+fi
37
+
38
+zmodload zsh/datetime
39
+
40
+whichDSF=$1
41
+kBT=$2
42
+target_sumrule=$3
43
+
44
+logfile='run-'$(strftime '%Y-%m-%d-%Hh%m')'.log'
45
+touch $logfile
46
+
47
+clist=(1024 512 256 128 64 32 16 8 4 2 1 0.5 0.25 0.125 0.0625 0.03125 0.015625)
48
+
49
+basedir="$(pwd)"
50
+
51
+
52
+for c in $clist
53
+do
54
+	for nk in {1..16} 
55
+	do
56
+		echo 'Starting run for c =' $c', kfact = '$nk | tee -a $logfile
57
+		dir='c_'$c'/kBT_'$kBT'/k_fixed/k_'${(l:2::0:)nk}'kFo4/sr_'$target_sumrule
58
+		echo $dir
59
+		mkdir -p $dir
60
+		cd $dir
61
+		LiebLin_Catalogue_Fixed_c_k_Nscaling $whichDSF $c $nk $kBT $target_sumrule 0 1 | tee -a $basedir/$logfile
62
+		cd $basedir
63
+		echo ' Successfully completed run for c =' $c', kfact = '$nk'\n' | tee -a $logfile
64
+	done
65
+done

Loading…
Cancel
Save