-
Notifications
You must be signed in to change notification settings - Fork 0
/
go_gemc_docs
executable file
·179 lines (139 loc) · 8.56 KB
/
go_gemc_docs
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
161
162
163
164
165
#!/bin/csh
set passwd = $2
if($1 == "help" || $1 == "doxy" || $1 == "databases" || $1 == "banks") then
goto $1
endif
# GEMC help
help:
gemc -help-html
scp gemc_help.html ftp:/u/group/clas/www/gemc/html/gemc
rm gemc_help.html
if($1 == "help") exit
# GEMC Tables
databases:
rm -rf mysqlq ; mkdir mysqlq
cd mysqlq
set gemc_db = (cnd_devel ctof_devel dc12_devel ec_devel ft_devel htcc_devel micromegas_devel ftof_devel pcal_devel rich_devel svt_devel)
echo "<html>" > main.html
echo "<br><br>" >> main.html
echo " Active Databases: " >> main.html
echo "<br><br>" >> main.html
foreach db ($gemc_db)
echo "<a href=$db.html target=_blank> $db </a><br> " >> main.html
end
echo "<br><br>" >> main.html
echo "</html>" >> main.html
foreach db ($gemc_db)
set par_tables = `mysql -h clasdb -u mauree -p$passwd $db -e "show tables" | grep "__parameters"`
set geo_tables = `mysql -h clasdb -u mauree -p$passwd $db -e "show tables" | grep "__geometry"`
set ele_table = 'materials__elements'
set mat_tables = `mysql -h clasdb -u mauree -p$passwd $db -e "show tables" | grep "__materials"`
set opt_tables = `mysql -h clasdb -u mauree -p$passwd $db -e "show tables" | grep "__opt_properties"`
echo "<html>" > $db".html"
echo "<br><br>" >> $db".html"
echo " Parameters tables in $db : " >> $db".html"
echo "<br><br>" >> $db".html"
foreach pars ($par_tables)
echo "<a href=$pars.html target=_blank> $pars </a><br> " >> $db".html"
end
echo "<br><br>" >> $db".html"
echo " Geometry tables in $db : " >> $db".html"
echo "<br><br>" >> $db".html"
foreach geo ($geo_tables)
echo "<a href=$geo.html target=_blank> $geo </a><br> " >> $db".html"
end
echo "<br><br>" >> $db".html"
echo " Materials tables in $db : " >> $db".html"
echo "<br><br>" >> $db".html"
foreach mats ($mat_tables)
echo "<a href=$mats.html target=_blank> $mats </a><br> " >> $db".html"
end
echo "<br><br>" >> $db".html"
echo "</html>" >> $db".html"
# Parameters:
foreach pars ($par_tables)
echo "<html>" > $pars".html"
echo "<br><br>" >> $pars".html"
echo "<pre>" >> $pars".html"
echo " $db Parameters: " >> $pars".html"
echo "<br><br>" >> $pars".html"
mysql --html -h clasdb -u mauree -p$passwd $db -e "select * from $pars" >> $pars".html"
echo "</pre>" >> $pars".html"
echo "<br><br>" >> $pars".html"
echo "</html>" >> $pars".html"
end
# Geometry:
foreach geo ($geo_tables)
echo "<html>" > $geo".html"
echo "<br><br>" >> $geo".html"
echo "<pre>" >> $geo".html"
echo " $db Parameters: " >> $geo".html"
echo "<br><br>" >> $geo".html"
mysql --html -h clasdb -u mauree -p$passwd $db -e "select * from $geo" >> $geo".html"
echo "</pre>" >> $geo".html"
echo "<br><br>" >> $geo".html"
echo "</html>" >> $geo".html"
end
# Materials:
foreach mat ($mat_tables)
echo "<html>" > $mat".html"
echo "<br><br>" >> $mat".html"
echo "<pre>" >> $mat".html"
echo " $db Materials: " >> $mat".html"
echo "<br><br>" >> $mat".html"
mysql --html -h clasdb -u mauree -p$passwd $db -e "select * from $mat" >> $mat".html"
echo "</pre>" >> $mat".html"
echo "<br><br>" >> $mat".html"
echo "</html>" >> $mat".html"
end
# Optical Properties:
foreach opt ($opt_tables)
echo "<html>" > $opt".html"
echo "<br><br>" >> $opt".html"
echo "<pre>" >> $opt".html"
echo " $db Optical Properties: " >> $opt".html"
echo "<br><br>" >> $opt".html"
mysql --html -h clasdb -u mauree -p$passwd $db -e "select * from $opt" >> $opt".html"
echo "</pre>" >> $opt".html"
echo "<br><br>" >> $opt".html"
echo "</html>" >> $opt".html"
end
end
# Elements:
echo "<html>" > $ele_table".html"
echo "<br><br>" >> $ele_table".html"
echo "<pre>" >> $ele_table".html"
echo " Elements in clas12_geometry:" >> $ele_table".html"
echo "<br><br>" >> $ele_table".html"
mysql --html -h clasdb -u mauree -p$passwd clas12_geometry -e "select * from $ele_table" >> $ele_table".html"
echo "</pre>" >> $ele_table".html"
echo "<br><br>" >> $ele_table".html"
echo "</html>" >> $ele_table".html"
cd ..
scp -r mysqlq ftp:/u/group/clas/www/gemc/html/work
rm -rf mysqlq
if($1 == "databases") exit
# GEMC banks
banks:
rm -rf mysqlq_banks ; mkdir mysqlq_banks
cd mysqlq_banks
set gemc_banks = (`mysql -h clasdb -u clasuser clas12_banks -e "show tables" | grep -v Tables_in_clas12_banks`)
foreach b ($gemc_banks)
echo "<html>" > $b".html"
echo "<br><br>" >> $b".html"
echo "<pre>" >> $b".html"
echo " Bank $b : " >> $b".html"
echo "<br><br>" >> $b".html"
echo " Type : 0 = integer , 1 = double " >> $b".html"
echo "<br>" >> $b".html"
echo " Activated : 0 = not in the output , 1 = in the output " >> $b".html"
echo "<br><br>" >> $b".html"
mysql --html -h clasdb -u clasuser clas12_banks -e "select * from $b" >> $b".html"
echo "</pre>" >> $b".html"
echo "<br><br>" >> $b".html"
echo "</html>" >> $b".html"
end
cd ..
scp -r mysqlq_banks ftp:/u/group/clas/www/gemc/html/work
rm -rf mysqlq_banks
if($1 == "banks") exit