Subversion Repositories pvinversion.ecmwf

Rev

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

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