Subversion Repositories pvinversion.ecmwf

Rev

Rev 3 | Details | Compare with Previous | Last modification | View Log | RSS feed

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