wrf svn trunk commit r4103
[wrffire.git] / wrfv2_fire / var / build / setup.csh
blobe79b15a84032f3919a4567bf13f335067ee5dab9
1 if (! $?MACHINE) then
2    setenv MACHINE `uname -n`
3 endif
5 if (! $?EXT_DIR) then
6    setenv EXT_DIR ~wrfhelp/external
7 endif
9 if (! -d $EXT_DIR) then
10    echo "Cannot find EXT_DIR=$EXT_DIR"
11 endif
13 # Search for queuing systems.
14 # Don't use which, as it always returns 0 on BSD
15 bjobs -V >& /dev/null
16 if ($status == 0) then
17    setenv SUBMIT LSF
18 else
19    llq >& /dev/null
20    if ($status == 0) then
21       setenv SUBMIT LoadLeveller
22    else
23       which qsub >& /dev/null
24       # could be SGE of course, so might need better way to check
25       if ($? == 0) then
26          setenv SUBMIT PBS
27       else
28          setenv SUBMIT none
29       endif
30    endif
31 endif
33 if (! $?PROCESSOR) then
34    # Unix people can't even report processor class properly
35    # across different machines or between ksh/bash on Linux
36    # They all need their heads banged together
37    # This kludge should give powerpc/i686/i386(for intel Mac)
38    if ( `uname` == "AIX" ) then
39       # Thanks Aix for reporting a hex string with -m, when
40       # all I wanted was powerpc
41       setenv PROCESSOR `uname -p`
42    else
43       # Thanks Linux for either reporting nothing with -n,
44       # or different values for ksh and bash, FFS
45       setenv PROCESSOR `uname -m`
46       if ("$PROCESSOR" == "Power Macintosh") then
47          setenv PROCESSOR powerpc
48       endif
49    endif
50 endif 
52 if ( `uname` == "AIX" ) then
53    # Brain dead Aix /bin/csh cannot handle arguments to 
54    # sourced scripts, so force use of ibm
55    setenv COMPILER ibm
56 else
57    if ("$1" != "") then
58       setenv COMPILER $1
59    else
60       setenv COMPILER gnu
61    endif
62 endif
64 if ($COMPILER == g95) then
65    setenv COMPILER gnu
66 endif
68 if ($COMPILER == xlf) then
69    setenv COMPILER ibm
70 endif
72 if ($COMPILER == gnu) then
73    setenv G95_ENDIAN BIG
74 endif
76 if ($COMPILER == cray) then
77    setenv PROCESSOR x1
78 endif
81 # List options in order of increasing preference
83 if (-d ${EXT_DIR}/netcdf/netcdf-3.6.1/${COMPILER}_${PROCESSOR}) then
84    setenv NETCDF ${EXT_DIR}/netcdf/netcdf-3.6.1/${COMPILER}_${PROCESSOR}
85 endif
86 if (-d ${EXT_DIR}/rttov/rttov87/${COMPILER}_${PROCESSOR}) then
87    setenv RTTOV ${EXT_DIR}/rttov/rttov87/${COMPILER}_${PROCESSOR}
88 endif
89 #if (-d ${EXT_DIR}/crtm/CRTM_02-29-08/${COMPILER}_${PROCESSOR}) then
90 #   setenv CRTM ${EXT_DIR}/crtm/CRTM_02-29-08/${COMPILER}_${PROCESSOR}
91 #endif
92 if (-d ${EXT_DIR}/crtm/CRTM_02_03_09_REL_1_2/${COMPILER}_${PROCESSOR}) then
93    setenv CRTM ${EXT_DIR}/crtm/CRTM_02_03_09_REL_1_2/${COMPILER}_${PROCESSOR}
94 endif
95 if (-d ${EXT_DIR}/mpi/mpich-1.2.7p1/${COMPILER}_${PROCESSOR}) then
96    setenv MPIHOME ${EXT_DIR}/mpi/mpich-1.2.7p1/${COMPILER}_${PROCESSOR}
97 endif
98 if (-d ${EXT_DIR}/mpi/mpich2-1.0.6p1/${COMPILER}_${PROCESSOR}) then
99    setenv MPIHOME ${EXT_DIR}/mpi/mpich2-1.0.6p1/${COMPILER}_${PROCESSOR}
100 endif
101 #if (-d ${EXT_DIR}/blas/blas/${COMPILER}_${PROCESSOR}) then
102 #   setenv BLAS ${EXT_DIR}/blas/blas/${COMPILER}_${PROCESSOR}
103 #endif
104 #if (-d ${EXT_DIR}/lapack/lapack-3.1.1/${COMPILER}_${PROCESSOR}) then
105 #   setenv LAPACK ${EXT_DIR}/lapack/lapack-3.1.1/${COMPILER}_${PROCESSOR}
106 #endif
107 #if (-d ${EXT_DIR}/fftpack/fftpack5/${COMPILER}_${PROCESSOR}) then
108 #   setenv FFTPACK ${EXT_DIR}/fftpack/fftpack5/${COMPILER}_${PROCESSOR}
109 #endif
110 if (-d ${EXT_DIR}/bufr/bufr_ncep_nco/${COMPILER}_${PROCESSOR}) then
111    setenv BUFR ${EXT_DIR}/bufr/bufr_ncep_nco/${COMPILER}_${PROCESSOR}
112 endif
113 if (-d ${EXT_DIR}/zlib/zlib-1.2.3/${COMPILER}_${PROCESSOR}) then
114    setenv ZLIB ${EXT_DIR}/zlib/zlib-1.2.3/${COMPILER}_${PROCESSOR}
115 endif
116 if (-d ${EXT_DIR}/jpeg/jpeg-6b/${COMPILER}_${PROCESSOR}) then
117    setenv JPEG ${EXT_DIR}/jpeg/jpeg-6b/${COMPILER}_${PROCESSOR}
118 endif
119 if (-d ${EXT_DIR}/hdf/hdf4.2r1/${COMPILER}_${PROCESSOR}) then
120    setenv HDF4 ${EXT_DIR}/hdf/hdf4.2r1/${COMPILER}_${PROCESSOR}
121 endif
122 if (-d ${EXT_DIR}/hdf/hdf5-1.6.5/${COMPILER}_${PROCESSOR}) then
123    setenv HDF5 ${EXT_DIR}/hdf/hdf5-1.6.5/${COMPILER}_${PROCESSOR}
124 endif
125 if (-d ${EXT_DIR}/hdf/HDF-EOS2.14v1.00/${COMPILER}_${PROCESSOR}) then
126    setenv HDFEOS ${EXT_DIR}/hdf/HDF-EOS2.14v1.00/${COMPILER}_${PROCESSOR}
127 endif
128 if (-d ${EXT_DIR}/jasper/jasper-1.900.1/${COMPILER}_${PROCESSOR}) then
129    setenv JASPER ${EXT_DIR}/jasper/jasper-1.900.1/${COMPILER}_${PROCESSOR}
130 endif
131 if (-d ${EXT_DIR}/netcdf/pnetcdf-1.0.1/${COMPILER}_${PROCESSOR}) then
132    setenv PNETCDF ${EXT_DIR}/netcdf/pnetcdf-1.0.1/${COMPILER}_${PROCESSOR}
133 endif
134 #if (-d ${EXT_DIR}/madis/${COMPILER}_${PROCESSOR}) then
135 #   setenv MADIS ${EXT_DIR}/madis/${COMPILER}_${PROCESSOR}
136 #endif
138 if (-d /usr/lpp/ppe.poe) then
139    setenv MPIHOME /usr/lpp/ppe.poe
140 endif
142 setenv LINUX_MPIHOME $MPIHOME
143 setenv PATH $MPIHOME/bin:$PATH
146 echo
147 if ($?PROCESSOR) then
148    echo "PROCESSOR       " $PROCESSOR
149 endif
150 if ($?COMPILER) then
151    echo "COMPILER        " $COMPILER       
152 endif
153 if ($?MPIHOME) then
154    echo "MPIHOME         " $MPIHOME
155 endif
156 if ($?RTTOV) then
157    echo "RTTOV           " $RTTOV
158 endif
159 if ($?CRTM) then
160    echo "CRTM            " $CRTM
161 endif
162 if ($?NETCDF) then
163    echo "NETCDF          " $NETCDF
164 endif
165 #if ($?BLAS) then
166 #   echo "BLAS            " $BLAS
167 #endif
168 #if ($?LAPACK) then
169 #   echo "LAPACK          " $LAPACK
170 #endif
171 #if ($?FFTPACK) then
172 #   echo "FFTPACK         " $FFTPACK
173 #endif
174 #if ($?BUFR) then
175 #   echo "BUFR            " $BUFR
176 #endif
177 if ($?ZLIB) then
178    echo "ZLIB            " $ZLIB
179 endif
180 if ($?JPEG) then
181    echo "JPEG            " $JPEG
182 endif
183 if ($?HDF4) then
184    echo "HDF4            " $HDF4
185 endif
186 if ($?HDF5) then
187    echo "HDF5            " $HDF5
188 endif
189 if ($?HDFEOS) then
190    echo "HDFEOS          " $HDFEOS
191 endif
192 if ($?JASPER) then
193    echo "JASPER          " $JASPER
194 endif
195 if ($?PNETCDF) then
196    echo "PNETCDF         " $PNETCDF
197 endif
198 #if ($?MADIS) then
199 #   echo "MADIS           " $MADIS
200 #endif
201 if ($?SUBMIT) then
202    echo "SUBMIT          " $SUBMIT
203 endif
204 if ($?SUBMIT_OPTIONS1) then
205    echo "SUBMIT_OPTIONS1  $SUBMIT_OPTIONS1"
206 endif
207 if ($?SUBMIT_OPTIONS2) then
208    echo "SUBMIT_OPTIONS2  $SUBMIT_OPTIONS2"
209 endif
210 if ($?SUBMIT_OPTIONS3) then
211    echo "SUBMIT_OPTIONS3  $SUBMIT_OPTIONS3"
212 endif
213 if ($?SUBMIT_OPTIONS4) then
214    echo "SUBMIT_OPTIONS4  $SUBMIT_OPTIONS4"
215 endif
216 if ($?SUBMIT_OPTIONS5) then
217    echo "SUBMIT_OPTIONS5  $SUBMIT_OPTIONS5"
218 endif
219 if ($?SUBMIT_OPTIONS6) then
220    echo "SUBMIT_OPTIONS6  $SUBMIT_OPTIONS6"
221 endif
222 if ($?SUBMIT_OPTIONS7) then
223    echo "SUBMIT_OPTIONS7  $SUBMIT_OPTIONS7"
224 endif
225 if ($?SUBMIT_OPTIONS8) then
226    echo "SUBMIT_OPTIONS8  $SUBMIT_OPTIONS8"
227 endif
228 if ($?SUBMIT_OPTIONS9) then
229    echo "SUBMIT_OPTIONS9  $SUBMIT_OPTIONS9"
230 endif
231 if ($?SUBMIT_OPTIONS10) then
232    echo "SUBMIT_OPTIONS10 $SUBMIT_OPTIONS10"
233 endif
234 if ($?SUBMIT_WAIT_FLAG) then
235    echo "SUBMIT_WAIT_FLAG $SUBMIT_WAIT_FLAG"
236 endif
238 if ($COMPILER == cray) then
239    # Cray use COMPILER for their own purposes, so reset
240    unsetenv COMPILER
241 endif