3 |
michaesp |
1 |
# ----- Load modules --------------------------
|
|
|
2 |
|
|
|
3 |
module load netcdf/4.2.1-pgf90
|
|
|
4 |
module list
|
|
|
5 |
|
|
|
6 |
# ----- Set libraries and includes ------------
|
|
|
7 |
|
|
|
8 |
set libs = "-L ${DYN_TOOLS}/lib"
|
|
|
9 |
set libs = "${libs} -lcdfio"
|
|
|
10 |
set libs = "${libs} -lcdfplus"
|
|
|
11 |
set libs = "${libs} -lipo"
|
|
|
12 |
set libs = "${libs} -lgm2em"
|
|
|
13 |
|
|
|
14 |
set ncdf_incs = `nc-config --fflags`
|
|
|
15 |
set ncdf_libs = `nc-config --flibs`
|
|
|
16 |
|
|
|
17 |
# ----- Compile --------------------- ----------
|
|
|
18 |
|
|
|
19 |
cd ${DYN_TOOLS}/inversion/diag/
|
|
|
20 |
|
|
|
21 |
foreach tool ( calc_qgpv check_boundcon difference hydrostatic qvec_analysis )
|
|
|
22 |
|
|
|
23 |
\rm -f ${tool}.o
|
|
|
24 |
\rm -f ${tool}
|
|
|
25 |
|
|
|
26 |
echo "pgf90 -c ${tool}.f ${ncdf_incs}"
|
|
|
27 |
pgf90 -c ${tool}.f ${ncdf_incs}
|
|
|
28 |
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"
|
|
|
29 |
pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
|
|
|
30 |
|
|
|
31 |
if ( ! -f ${tool} ) then
|
|
|
32 |
echo "ERROR: compilation of <tool> failed... exit"
|
|
|
33 |
exit 1
|
|
|
34 |
endif
|
|
|
35 |
|
|
|
36 |
end
|
|
|
37 |
|
|
|
38 |
cd ${DYN_TOOLS}/inversion/post/
|
|
|
39 |
|
|
|
40 |
foreach tool ( add2p rotate_lalo )
|
|
|
41 |
|
|
|
42 |
\rm -f ${tool}.o
|
|
|
43 |
\rm -f ${tool}
|
|
|
44 |
|
|
|
45 |
echo "pgf90 -c ${tool}.f ${ncdf_incs}"
|
|
|
46 |
pgf90 -c ${tool}.f ${ncdf_incs}
|
|
|
47 |
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"
|
|
|
48 |
pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
|
|
|
49 |
|
|
|
50 |
if ( ! -f ${tool} ) then
|
|
|
51 |
echo "ERROR: compilation of <tool> failed... exit"
|
|
|
52 |
exit 1
|
|
|
53 |
endif
|
|
|
54 |
|
|
|
55 |
end
|
|
|
56 |
|
|
|
57 |
cd ${DYN_TOOLS}/inversion/prep/
|
|
|
58 |
|
|
|
59 |
foreach tool ( coastline cutnetcdf def_anomaly p2z ref_profile rotate_grid z2s )
|
|
|
60 |
|
|
|
61 |
\rm -f ${tool}.o
|
|
|
62 |
\rm -f ${tool}
|
|
|
63 |
|
|
|
64 |
echo "pgf90 -c ${tool}.f ${ncdf_incs}"
|
|
|
65 |
pgf90 -c ${tool}.f ${ncdf_incs}
|
|
|
66 |
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"
|
|
|
67 |
pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
|
|
|
68 |
|
|
|
69 |
if ( ! -f ${tool} ) then
|
|
|
70 |
echo "ERROR: compilation of <tool> failed... exit"
|
|
|
71 |
exit 1
|
|
|
72 |
endif
|
|
|
73 |
|
|
|
74 |
end
|
|
|
75 |
|
|
|
76 |
|
|
|
77 |
cd ${DYN_TOOLS}/inversion/pvin/
|
|
|
78 |
|
|
|
79 |
foreach tool ( inv_cart prep_iteration pv_to_qgpv z2s )
|
|
|
80 |
|
|
|
81 |
\rm -f ${tool}.o
|
|
|
82 |
\rm -f ${tool}
|
|
|
83 |
|
|
|
84 |
echo "pgf90 -c ${tool}.f ${ncdf_incs}"
|
|
|
85 |
pgf90 -c ${tool}.f ${ncdf_incs}
|
|
|
86 |
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"
|
|
|
87 |
pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
|
|
|
88 |
|
|
|
89 |
if ( ! -f ${tool} ) then
|
|
|
90 |
echo "ERROR: compilation of <tool> failed... exit"
|
|
|
91 |
exit 1
|
|
|
92 |
endif
|
|
|
93 |
|
|
|
94 |
end
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
cd ${DYN_TOOLS}/inversion/spec/
|
|
|
98 |
|
|
|
99 |
foreach tool ( modify_anomaly )
|
|
|
100 |
|
|
|
101 |
\rm -f ${tool}.o
|
|
|
102 |
\rm -f ${tool}
|
|
|
103 |
|
|
|
104 |
echo "pgf90 -c ${tool}.f ${ncdf_incs}"
|
|
|
105 |
pgf90 -c ${tool}.f ${ncdf_incs}
|
|
|
106 |
echo "pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}"
|
|
|
107 |
pgf90 -o ${tool} ${tool}.o ${libs} ${ncdf_libs}
|
|
|
108 |
|
|
|
109 |
if ( ! -f ${tool} ) then
|
|
|
110 |
echo "ERROR: compilation of <tool> failed... exit"
|
|
|
111 |
exit 1
|
|
|
112 |
endif
|
|
|
113 |
|
|
|
114 |
end
|
|
|
115 |
|
|
|
116 |
|
|
|
117 |
# ----- Set <bin> --------------------------------
|
|
|
118 |
|
|
|
119 |
ln -svf ${DYN_TOOLS}/inversion/inversion.sh ${DYN_TOOLS}/bin/inversion
|
|
|
120 |
|
|
|
121 |
chmod og+rx ${DYN_TOOLS}/bin/inversion
|
|
|
122 |
|
|
|
123 |
exit 0
|