ECMWF pressure-level RH is a combination of ice and water just like the GFS, so
[WPS.git] / compile
blob213de130d84ec112ba7a6b5e425d2bf6d529da93
1 #!/bin/csh -f
3 if ( ! -e configure.wps ) then
4 echo "Do 'configure' first"
5 exit ( 1 )
6 endif
8 if ( ( ! $?NETCDF ) && ( -d netcdf_links ) ) then
9 setenv NETCDF `pwd`/netcdf_links
10 setenv temp_netcdf 1
11 else
12 setenv temp_netcdf 0
13 endif
15 set DEV_TOP = `pwd`
16 set first_char = `grep ^WRF_DIR configure.wps | awk '{print $3}' | cut -c -1`
18 if ( "$first_char" == "/" ) then
19 set WRF_DIR_PRE =
20 else
21 set WRF_DIR_PRE = ${DEV_TOP}/
22 endif
24 if ( ${#argv} == 0 ) then
25 set names = ( geogrid ungrib metgrid g1print g2print plotfmt rd_intermediate plotgrids mod_levs avg_tsfc calc_ecmwf_p )
26 set NAMES = ( GEOGRID UNGRIB METGRID GRIBUTIL GRIBUTIL UTIL UTIL UTIL UTIL UTIL UTIL )
27 else if ( $1 == wps ) then
28 set names = ( geogrid ungrib metgrid )
29 set NAMES = ( GEOGRID UNGRIB METGRID )
30 else if ( $1 == util ) then
31 set names = ( g1print g2print plotfmt rd_intermediate plotgrids mod_levs avg_tsfc calc_ecmwf_p )
32 set NAMES = ( GRIBUTIL GRIBUTIL UTIL UTIL UTIL UTIL UTIL UTIL )
33 else if ( $1 == geogrid ) then
34 set names = ( geogrid )
35 set NAMES = ( GEOGRID )
36 else if ( $1 == ungrib ) then
37 set names = ( ungrib )
38 set NAMES = ( UNGRIB )
39 else if ( $1 == metgrid ) then
40 set names = ( metgrid )
41 set NAMES = ( METGRID )
42 else if ( $1 == g1print ) then
43 set names = ( g1print )
44 set NAMES = ( GRIBUTIL )
45 else if ( $1 == g2print ) then
46 set names = ( g2print )
47 set NAMES = ( GRIBUTIL )
48 else if ( $1 == plotfmt ) then
49 set names = ( plotfmt )
50 set NAMES = ( UTIL )
51 else if ( $1 == rd_intermediate ) then
52 set names = ( rd_intermediate )
53 set NAMES = ( UTIL )
54 else if ( $1 == plotgrids ) then
55 set names = ( plotgrids )
56 set NAMES = ( UTIL )
57 else if ( $1 == mod_levs ) then
58 set names = ( mod_levs )
59 set NAMES = ( UTIL )
60 else if ( $1 == avg_tsfc ) then
61 set names = ( avg_tsfc )
62 set NAMES = ( UTIL )
63 else if ( $1 == calc_ecmwf_p ) then
64 set names = ( calc_ecmwf_p )
65 set NAMES = ( UTIL )
66 else
67 echo "*****"
68 echo " "
69 echo "Unrecognized compile target $1."
70 echo " "
71 echo "Usage: compile [target]"
72 echo "where target is one of"
73 echo " wps"
74 echo " util"
75 echo " geogrid"
76 echo " ungrib"
77 echo " metgrid"
78 echo " g1print"
79 echo " g2print"
80 echo " plotfmt"
81 echo " rd_intermediate"
82 echo " plotgrids"
83 echo " mod_levs"
84 echo " avg_tsfc"
85 echo " calc_ecmwf_p"
86 echo " "
87 echo " or just run compile with no target to build everything."
88 echo " "
89 echo "*****"
90 exit(1)
91 endif
93 echo " "
94 if ( ${#argv} == 0 ) then
95 echo "**** Compiling WPS and all utilities ****"
96 else
97 echo "**** Compiling $1 ****"
98 endif
99 echo " "
101 set count = 1
102 foreach f ( $names )
103 if ("$NAMES[$count]" == "UTIL") then
104 ( cd util ; make -i -r WRF_DIR_PRE="${WRF_DIR_PRE}" DEV_TOP="${DEV_TOP}" TARGET="${f}.exe" CPP_TARGET="$NAMES[$count]" all )
105 else if ("$NAMES[$count]" == "GRIBUTIL") then
106 ( cd ungrib ; make -i -r WRF_DIR_PRE="${WRF_DIR_PRE}" DEV_TOP="${DEV_TOP}" TARGET="${f}.exe" CPP_TARGET="$NAMES[$count]" all )
107 if ( -e ungrib/src/${f}.exe ) then
108 ( cd util ; ln -sf ../ungrib/src/${f}.exe . )
109 endif
110 else
111 ( cd $f ; make -i -r WRF_DIR_PRE="${WRF_DIR_PRE}" DEV_TOP="${DEV_TOP}" TARGET="${f}.exe" CPP_TARGET="$NAMES[$count]" all )
112 if ( -e ${f}/src/${f}.exe ) then
113 ln -sf ${f}/src/${f}.exe .
114 endif
115 endif
116 @ count ++
119 if ( $temp_netcdf == 1 ) then
120 unsetenv NETCDF
121 endif
123 exit(0)