forked from pencil-code/pencil-code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcvsci_run
executable file
·161 lines (152 loc) · 4 KB
/
cvsci_run
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/bin/csh
#$Id$
#
# This script adds a new run to the repository
# and checks in all *.in files as well as material
# from the data and src directories.
#
# if this procedure is called with an argument,
# then first go into this directory and continue from there
#
# When invoked as tar_run, a corresponding tarball is created
# as <working directory>.tar in the parent directory.
# Tested for only one argument.
#
if ( $#argv >= 1 ) then
set dirlist=($argv)
else
set dirlist=$cwd
endif
if ( $0:t == 'tar_run' ) then
set cvsci=0
set add_cmd="tar -f $cwd.tar --ignore-failed-read --append"
set add_data_opt=(--transform 's,^,data/,')
set add_cmd_bin="$add_cmd"
tar cf $cwd.tar run.in
tar --delete --file=$cwd.tar run.in
else
set cvsci=1
set add_cmd="cvs add"
set add_cmd_bin="$add_cmd -kb"
set add_data_opt=""
endif
foreach pdir ($dirlist)
cd $pdir
#
# set directory
#
set CWD=$cwd
set dir=$cwd:t
#
# go one up and add our run directory to cvs
#
if ( $cvsci ) then
cd ..
$add_cmd $dir
cd $dir
endif
#
# add directories and files to cvs
# also get a copy of their time stamps before checking in
#
ls -l *.in *.dat *.pro src/*.local src/*.txt > .log
$add_cmd *.in alpha_in.dat k.dat k_double.dat kvect.dat higgsless.dat a_vs_eta.dat power_profile.dat parameters.pro testfield_info.dat chemistry*.dat chem.inp tran.dat air.dat stratification.dat nnu2.dat chiral_list*.dat Iv*.dat correl*.dat particles_initial.dat particles_initial_header.pro .log >& /dev/null
#
if (-e data) then
if ( $0:t == 'cvsci_run' ) then
$add_cmd data
endif
cd data
$add_cmd $add_data_opt index.pro legend.dat params.log *.nml cvsid.dat varname.dat runtime.dat pc_constants.pro jobid.dat svnid.dat pdim.dat pt_positions.dat tstalk.dat particles_stalker_header.dat >& /dev/null
if ( -e dim.dat ) then
$add_cmd $add_data_opt dim.dat
endif
if ( -e time_series.dat ) then
$add_cmd $add_data_opt time_series.dat
endif
if ( -e time_series.h5 ) then
$add_cmd_bin $add_data_opt time_series.h5
endif
if ( -e grid.h5 ) then
$add_cmd_bin $add_data_opt grid.h5
endif
else
echo "no data directory found"
endif
#
# add alpeta.sav, if it exists
#
if ( -e alpeta.sav ) then
$add_cmd $add_data_opt alpeta.sav
endif
#
# add power spectra, if they exist
# (for the time being, test existence only on a few such files)
#
ls | egrep 'power.*\.dat' >/dev/null
if ( ! $status ) then
$add_cmd $add_data_opt *power*.dat
endif
#
# add Saffman invariants, if they exist
# (for the time being, test existence only on a few such files)
#
ls | egrep 'Iv.*\.dat' >/dev/null
if ( ! $status ) then
$add_cmd $add_data_opt Iv*.dat
endif
#
# add structure functions, if they exist
# (for the time being, test existence only on a few such files)
#
ls | egrep 'sf.*\.dat' >/dev/null
if ( ! $status ) then
$add_cmd $add_data_opt sf*.dat
endif
#
# add testfield_info.dat file if it exists
#
if ( -e testfield_info.dat ) then
$add_cmd $add_data_opt testfield_info.dat
endif
#
# add info about directory history
#
if (-e new_from.dir) then
$add_cmd $add_data_opt new_from.dir
endif
#
if (-e new_to.dir) then
$add_cmd $add_data_opt new_to.dir
endif
#
if (-e remeshed_from.dir) then
$add_cmd $add_data_opt remeshed_from.dir
endif
#
# check in everything
# need to take full path name, because we are still in data,
# which may only be a link.
#
cd $CWD
if ( $cvsci ) then
cvs ci -l -m "added new run: `uname -n -s`" . data
#
# add src stuff only if it is not a link
# Do this at the very end, in case this step fails.
#
test -h src
if ( $status ) then
$add_cmd src
cd src
$add_cmd *.local *.txt .build-history .moduleinfo
cd ..
if ( $0:t == 'cvsci_run' ) then
cvs ci -m "added new run: `uname -n -s`" src
endif
endif
else
$add_cmd -h src/*.local src/*.txt src/.build-history >& /dev/null
endif
cd ..
end