Subversion Repositories pvinversion.ecmwf

Rev

Rev 3 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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