Subversion Repositories pvinversion.ecmwf

Rev

Rev 4 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4 Rev 6
-
 
1
#!/bin/csh
-
 
2
 
1
# ----- Load modules --------------------------
3
# ----- Load modules --------------------------
2
 
4
 
3
module load netcdf/4.2.1-pgf90
5
module load netcdf/4.2.1-pgf90
4
module list 
6
module list 
5
 
7
 
6
# ---- set some directories and other stuff ---
8
# ---- set some directories and other stuff ---
7
 
9
 
8
set mode = $1
10
set mode = $1
9
set svnpath=https://svn.iac.ethz.ch/pub/pvinversion.ecmwf/
11
set svnpath=https://svn.iac.ethz.ch/pub/pvinversion.ecmwf/
10
set bdir = ${PWD}
12
set bdir = ${PWD}
11
 
13
 
12
# ----- Set libraries and includes ------------
14
# ----- Set libraries and includes ------------
13
 
15
 
14
set libs   = "-L ${bdir}/lib"
16
set libs   = "-L ${bdir}/lib"
15
set libs   = "${libs} -lcdfio" 
17
set libs   = "${libs} -lcdfio" 
16
set libs   = "${libs} -lcdfplus" 
18
set libs   = "${libs} -lcdfplus" 
17
set libs   = "${libs} -lipo"
19
set libs   = "${libs} -lipo"
18
set libs   = "${libs} -lgm2em"
20
set libs   = "${libs} -lgm2em"
19
 
21
 
20
set ncdf_incs  = `nc-config --fflags`
22
set ncdf_incs  = `nc-config --fflags`
21
set ncdf_libs  = `nc-config --flibs`
23
set ncdf_libs  = `nc-config --flibs`
22
 
24
 
23
# ----- Create a new SVN tag ------------------
25
# ----- Create a new SVN tag ------------------
24
tag:
26
tag:
25
 
27
 
26
if ( "${mode}" == "tag" ) then
28
if ( "${mode}" == "tag" ) then
27
   svn info
29
   svn info
28
   if ( "${#argv}" != 2 ) then
30
   if ( "${#argv}" != 2 ) then
29
     echo "Usage: install.csh tag id <id=tag number>"
31
     echo "Usage: install.csh tag id <id=tag number>"
30
   else
32
   else
31
     set tagnr = $2
33
     set tagnr = $2
32
   endif
34
   endif
33
   svn copy ${svnpath}/trunk ${svnpath}/tags/${tagnr} -m "Release ${tagnr}"
35
   svn copy ${svnpath}/trunk ${svnpath}/tags/${tagnr} -m "Release ${tagnr}"
34
   exit 0
36
   exit 0
35
endif
37
endif
36
 
38
 
37
 
39
 
38
if ( "${mode}" != "clean" ) goto compile
40
if ( "${mode}" != "clean" ) goto compile
39
# ----- Make clean ----------------------------
41
# ----- Make clean ----------------------------
40
clean:
42
clean:
41
 
43
 
42
if ( "${mode}" != "clean" ) goto compile
44
if ( "${mode}" != "clean" ) goto compile
43
 
45
 
44
cd ${bdir}/lib
46
cd ${bdir}/lib
45
foreach lib (  libcdfio libcdfplus libipo libgm2em ) 
47
foreach lib (  libcdfio libcdfplus libipo libgm2em ) 
46
 \rm -f ${lib}.o
48
 \rm -f ${lib}.o
47
end
49
end
48
 
50
 
49
cd ${bdir}/diag/
51
cd ${bdir}/diag/
50
foreach tool (  calc_qgpv check_boundcon difference hydrostatic qvec_analysis ) 
52
foreach tool (  calc_qgpv check_boundcon difference hydrostatic qvec_analysis ) 
51
 \rm -f ${tool}.o
53
 \rm -f ${tool}.o
52
 \rm -f ${tool}
54
 \rm -f ${tool}
53
end
55
end
54
 
56
 
55
cd ${bdir}/post/
57
cd ${bdir}/post/
56
foreach tool ( add2p rotate_lalo )  
58
foreach tool ( add2p rotate_lalo )  
57
 \rm -f ${tool}.o
59
 \rm -f ${tool}.o
58
 \rm -f ${tool}
60
 \rm -f ${tool}
59
end
61
end
60
 
62
 
61
cd ${bdir}/prep/
63
cd ${bdir}/prep/
62
foreach tool ( coastline cutnetcdf def_anomaly p2z ref_profile rotate_grid z2s ) 
64
foreach tool ( coastline cutnetcdf def_anomaly p2z ref_profile rotate_grid z2s ) 
63
 \rm -f ${tool}.o
65
 \rm -f ${tool}.o
64
 \rm -f ${tool}
66
 \rm -f ${tool}
65
end
67
end
66
 
68
 
67
cd ${bdir}/pvin/
69
cd ${bdir}/pvin/
68
foreach tool ( inv_cart prep_iteration pv_to_qgpv z2s ) 
70
foreach tool ( inv_cart prep_iteration pv_to_qgpv z2s ) 
69
 \rm -f ${tool}.o
71
 \rm -f ${tool}.o
70
 \rm -f ${tool}
72
 \rm -f ${tool}
71
end
73
end
72
 
74
 
73
cd ${bdir}/spec/
75
cd ${bdir}/spec/
74
foreach tool ( modify_anomaly ) 
76
foreach tool ( modify_anomaly ) 
75
  \rm -f ${tool}.o
77
  \rm -f ${tool}.o
76
  \rm -f ${tool}
78
  \rm -f ${tool}
77
end
79
end
78
 
80
 
79
# ----- Compile -------------------------------
81
# ----- Compile -------------------------------
80
compile:
82
compile:
81
 
83
 
82
if ( "${mode}" != "compile" ) goto done
84
if ( "${mode}" != "compile" ) goto done
83
 
85
 
84
cd ${bdir}/lib
86
cd ${bdir}/lib
85
 
87
 
86
foreach lib (  libcdfio libcdfplus libipo libgm2em ) 
88
foreach lib (  libcdfio libcdfplus libipo libgm2em ) 
87
 
89
 
88
\rm -f ${lib}.o
90
\rm -f ${lib}.o
89
 
91
 
90
echo "pgf90 -c ${lib}.f ${ncdf_incs}"  
92
echo "pgf90 -c ${lib}.f ${ncdf_incs}"  
91
      pgf90 -c ${lib}.f ${ncdf_incs}   
93
      pgf90 -c ${lib}.f ${ncdf_incs}   
92
 
94
 
93
end
95
end
94
 
96
 
95
cd ${bdir}/diag/
97
cd ${bdir}/diag/
96
 
98
 
97
foreach tool (  calc_qgpv check_boundcon difference hydrostatic qvec_analysis ) 
99
foreach tool (  calc_qgpv check_boundcon difference hydrostatic qvec_analysis ) 
98
 
100
 
99
\rm -f ${tool}.o
101
\rm -f ${tool}.o
100
\rm -f ${tool}
102
\rm -f ${tool}
101
 
103
 
102
echo "pgf90 -c ${tool}.f ${ncdf_incs}"  
104
echo "pgf90 -c ${tool}.f ${ncdf_incs}"  
103
      pgf90 -c ${tool}.f ${ncdf_incs}   
105
      pgf90 -c ${tool}.f ${ncdf_incs}   
104
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"        
106
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"        
105
      pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
107
      pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
106
 
108
 
107
if ( ! -f ${tool} ) then
109
if ( ! -f ${tool} ) then
108
  echo "ERROR: compilation of <tool> failed... exit"
110
  echo "ERROR: compilation of <tool> failed... exit"
109
  exit 1
111
  exit 1
110
endif
112
endif
111
 
113
 
112
end
114
end
113
 
115
 
114
cd ${bdir}/post/
116
cd ${bdir}/post/
115
 
117
 
116
foreach tool ( add2p rotate_lalo )  
118
foreach tool ( add2p rotate_lalo )  
117
 
119
 
118
\rm -f ${tool}.o
120
\rm -f ${tool}.o
119
\rm -f ${tool}
121
\rm -f ${tool}
120
 
122
 
121
echo "pgf90 -c ${tool}.f ${ncdf_incs}"  
123
echo "pgf90 -c ${tool}.f ${ncdf_incs}"  
122
      pgf90 -c ${tool}.f ${ncdf_incs}   
124
      pgf90 -c ${tool}.f ${ncdf_incs}   
123
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"        
125
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"        
124
      pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
126
      pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
125
 
127
 
126
if ( ! -f ${tool} ) then
128
if ( ! -f ${tool} ) then
127
  echo "ERROR: compilation of <tool> failed... exit"
129
  echo "ERROR: compilation of <tool> failed... exit"
128
  exit 1
130
  exit 1
129
endif
131
endif
130
 
132
 
131
end
133
end
132
 
134
 
133
cd ${bdir}/prep/
135
cd ${bdir}/prep/
134
 
136
 
135
foreach tool ( coastline cutnetcdf def_anomaly p2z ref_profile rotate_grid z2s ) 
137
foreach tool ( coastline cutnetcdf def_anomaly p2z ref_profile rotate_grid z2s ) 
136
 
138
 
137
\rm -f ${tool}.o
139
\rm -f ${tool}.o
138
\rm -f ${tool}
140
\rm -f ${tool}
139
 
141
 
140
echo "pgf90 -c ${tool}.f ${ncdf_incs}"  
142
echo "pgf90 -c ${tool}.f ${ncdf_incs}"  
141
      pgf90 -c ${tool}.f ${ncdf_incs}   
143
      pgf90 -c ${tool}.f ${ncdf_incs}   
142
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"        
144
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"        
143
      pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
145
      pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
144
 
146
 
145
if ( ! -f ${tool} ) then
147
if ( ! -f ${tool} ) then
146
  echo "ERROR: compilation of <tool> failed... exit"
148
  echo "ERROR: compilation of <tool> failed... exit"
147
  exit 1
149
  exit 1
148
endif
150
endif
149
 
151
 
150
end
152
end
151
 
153
 
152
cd ${bdir}/pvin/
154
cd ${bdir}/pvin/
153
 
155
 
154
foreach tool ( inv_cart prep_iteration pv_to_qgpv z2s ) 
156
foreach tool ( inv_cart prep_iteration pv_to_qgpv z2s ) 
155
 
157
 
156
\rm -f ${tool}.o
158
\rm -f ${tool}.o
157
\rm -f ${tool}
159
\rm -f ${tool}
158
 
160
 
159
echo "pgf90 -c ${tool}.f ${ncdf_incs}"  
161
echo "pgf90 -c ${tool}.f ${ncdf_incs}"  
160
      pgf90 -c ${tool}.f ${ncdf_incs}   
162
      pgf90 -c ${tool}.f ${ncdf_incs}   
161
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"        
163
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"        
162
      pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
164
      pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
163
 
165
 
164
if ( ! -f ${tool} ) then
166
if ( ! -f ${tool} ) then
165
  echo "ERROR: compilation of <tool> failed... exit"
167
  echo "ERROR: compilation of <tool> failed... exit"
166
  exit 1
168
  exit 1
167
endif
169
endif
168
 
170
 
169
end
171
end
170
 
172
 
171
cd ${bdir}/spec/
173
cd ${bdir}/spec/
172
 
174
 
173
foreach tool ( modify_anomaly ) 
175
foreach tool ( modify_anomaly ) 
174
 
176
 
175
\rm -f ${tool}.o
177
\rm -f ${tool}.o
176
\rm -f ${tool}
178
\rm -f ${tool}
177
 
179
 
178
echo "pgf90 -c ${tool}.f ${ncdf_incs}"  
180
echo "pgf90 -c ${tool}.f ${ncdf_incs}"  
179
      pgf90 -c ${tool}.f ${ncdf_incs}   
181
      pgf90 -c ${tool}.f ${ncdf_incs}   
180
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"        
182
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"        
181
      pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
183
      pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
182
 
184
 
183
if ( ! -f ${tool} ) then
185
if ( ! -f ${tool} ) then
184
  echo "ERROR: compilation of <tool> failed... exit"
186
  echo "ERROR: compilation of <tool> failed... exit"
185
  exit 1
187
  exit 1
186
endif
188
endif
187
 
189
 
188
end
190
end
189
 
191
 
190
# ----- Done ----------------------------------
192
# ----- Done ----------------------------------
191
done:
193
done:
192
 
194
 
193
exit 0
195
exit 0