Subversion Repositories pvinversion.ecmwf

Rev

Rev 3 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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