3 #BSUB -P 64000400 # proj account to charge
4 #BSUB -R "span[ptile=2]" # how many tasks per node (up to 8)
5 #BSUB -n 1 # number of total tasks
6 #BSUB -o WPS.out # output filename (%J to add job id)
7 #BSUB -e WPS.err # error filename
8 #BSUB -J WPS.test # job name
10 #BSUB -W 3:00 # wallclock time
12 ######## CHANGE THIS DIRECTORY #######
13 if ( `uname` == AIX
) then
14 if ( -d /ptmp
/gill
/WPS_reg
) then
17 echo "/ptmp/gill/WPS_reg does not exist - stopping"
21 ######## CHANGE THIS DIRECTORY #######
26 if ( ( ! -d WPS
) ||
( ! -d WRFV2
) ) then
30 echo "This test is run from a directory where"
31 echo "both WPS and WRFV2 exist"
40 set PLOTS_ONLY
= FALSE
46 if ( $PLOTS_ONLY == FALSE
) then
48 if ( `uname` == Linux
) then
49 echo 1. starting WRFV2 build pgf90
- takes about
7 minutes
50 else if ( `uname` == AIX
) then
51 echo "1. starting WRFV2 build - takes 20 (bs) to 35 (bv) minutes"
52 else if ( `uname` == Darwin
) then
53 echo "1. starting WRFV2 build g95 - takes 30 minutes"
55 echo 1. starting WRFV2 build
57 echo " start: " `date`
58 pushd WRFV2
>& /dev
/null
60 # We at least want to be able to do nesting.
62 if ( `uname` == Linux
) then
63 echo 2 | .
/configure
>& /dev
/null
64 else if ( `uname` == AIX
) then
65 .
/configure
<< EOF >& /dev/null
69 else if ( `uname` == Darwin
) then
70 .
/configure
<< EOF >& /dev/null
75 echo need info on this
`uname` arch
79 .
/compile em_real
>&! build.log
80 if ( ( -e main
/wrf.exe
) && \
81 ( -e main
/real.exe
) ) then
82 echo " WRFV2 build OK"
86 echo "WRFV2 build failed"
87 echo "Look at $TOP_DIR/WRFV2/build.log"
98 echo 2. starting WPS build
- takes about
1 minute
99 echo " start: " `date`
100 pushd WPS
>& /dev
/null
101 echo 2 | .
/configure
>& /dev
/null
102 .
/compile wps
>&! build.log
103 if ( ( -e geogrid.exe
) && \
104 ( -e metgrid.exe
) && \
105 ( -e ungrib.exe
) ) then
110 echo "WPS build failed"
111 echo "Look at $TOP_DIR/WPS/build.log"
124 echo 3. starting WPS tests
125 echo " start: " `date`
126 pushd WPS
>& /dev
/null
129 # Loop over all of the tests
131 if ( ${#argv} == 0 ) then
132 set all_tests
= ( `ls -1 test_suite` )
134 set all_tests
= ( $
* )
136 foreach test_num
( $all_tests )
138 # Set the env from the helpful env file
140 source test_suite
/${test_num}/the_env
142 # Copy in the WPS namelist.
144 cp test_suite
/${test_num}/namelist.wps .
146 # Tell folks what we are doing.
149 echo " Test #${tcount}"
150 echo " share: " $share
151 echo " geogrid: " $geogrid
152 echo " ungrib: " $ungrib
153 echo " metgrid: " $metgrid
155 # Set the path to the static geog data in the namelist.
157 if ( -d /bouleau
/users
/duda
/GEOG
) then
159 else if ( -d /standalone
/users
/gill
/DATA
/GEOG
) then
160 echo ' geog_data_path = "/standalone/users/gill/DATA/GEOG"' >! foodir
161 else if ( -d /data
3/mp
/wrfhelp
/WPS_GEOG
) then
162 echo ' geog_data_path = "/data3/mp/wrfhelp/WPS_GEOG"' >! foodir
163 else if ( -d /mmm
/users
/wrfhelp
/WPS_GEOG
) then
164 echo ' geog_data_path = "/mmm/users/wrfhelp/WPS_GEOG"' >! foodir
168 echo "Could not find the static data for geogrid"
173 sed -e '/geog_data_path/d' namelist.wps
>! .foo
174 sed -e '/stand_lon/r foodir' .foo
>! namelist.wps
176 # Clean up the ol temp file we made.
180 if ( $PLOTS_ONLY == FALSE
) then
181 # Echo what is happening for each program, also there is
182 # start/ending couplet so that approx timings are possible.
184 echo " geogrid.exe share=${share} geogrid=$geogrid"
185 echo " start: " `date`
186 geogrid.exe
>&! geogrid.print.share
=${share}.geogrid
=$geogrid
187 grep -i success geogrid.print.share
=${share}.geogrid
=$geogrid >& /dev
/null
192 echo "Failed to run geogrid.exe"
200 # Now we slide over to the ungrib and metgrid programs. We need to get the
201 # location of the met data. This is not a nml var, but an argument
204 if ( -d /standalone
/users
/gill
/DATA
/WPS_regression_data
) then
205 set datadir
= /standalone
/users
/gill
/DATA
/WPS_regression_data
206 else if ( -d /stink
/gill
/Regression_Tests
/WPS_regression_data
) then
207 set datadir
= /stink
/gill
/Regression_Tests
/WPS_regression_data
208 else if ( -d /data3a
/mp
/gill
/DATA
/WPS_regression_data
) then
209 set datadir
= /data3a
/mp
/gill
/DATA
/WPS_regression_data
210 else if ( -d /mmm
/users
/gill
/DATA
/WPS_regression_data
) then
211 set datadir
= /mmm
/users
/gill
/DATA
/WPS_regression_data
215 echo "Could not find the met data for ungrib.exe"
221 # List of all of the input data (met) files. The g1/g2 means Grib Edition
222 # 1 vs Edition 2. Each has the associated Vtable, where the difference
223 # between dir and the Vtable name is the extra "_g1" or "_g2".
225 set source = ( `ls -1 $datadir/$test_num/DATA` )
227 # Loop of the data sources, one run each of ungrib and one of metgrid.
229 foreach data_source
( $source )
231 # The sources are just directories in the TEST_001, etc dirs. Also
232 # in there is a namelist file. That is not a valid source of data,
233 # so we skip it an move on.
235 if ( ( $data_source == namelist.input
) ||
( $data_source == rip_test.
in ) ) then
236 goto skipped_namelist_as_a_directory
239 # The incremented counter, to keep track of which data source
240 # we are running, and so that we are using the right Vtable.
242 set Vtable
= `echo $data_source | cut -d "_" -f1`
243 cp ungrib
/Variable_Tables
/Vtable.
$Vtable Vtable
244 .
/link_grib.csh
$datadir/$test_num/DATA
/$data_source/*
246 if ( $PLOTS_ONLY == FALSE
) then
248 # Run ungrib, the grib decoder.
250 echo " ungrib.exe share=${share} ungrib=$ungrib source=$data_source"
251 echo " start: " `date`
252 ungrib.exe
>&! ungrib.print.share
=${share}.ungrib
=${ungrib}.
source=$data_source
253 grep -i success ungrib.print.share
=${share}.ungrib
=$ungrib.
source=$data_source >& /dev
/null
254 # grep -i Bandimere ungrib.print.share=${share}.ungrib=$ungrib.source=$data_source >& /dev/null
259 echo "Failed to run ungrib.exe"
266 # Now with the geogrid and ungrib progs done, we can move to metgrid.
268 echo " metgrid.exe share=${share} metgrid=${metgrid} source=$data_source"
269 echo " start: " `date`
270 metgrid.exe
>&! metgrid.print.share
=${share}.metgrid
=${metgrid}.
source=$data_source
271 grep -i success metgrid.print.share
=${share}.metgrid
=${metgrid}.
source=$data_source >& /dev
/null
276 echo "Failed to run metgrid.exe"
285 if ( ! -d TEMPORARY_STORAGE
) then
286 mkdir TEMPORARY_STORAGE
288 if ( -d TEMPORARY_STORAGE
/${test_num}.
source=${data_source} ) then
289 rm -rf TEMPORARY_STORAGE
/${test_num}.
source=${data_source}
291 mkdir TEMPORARY_STORAGE
/${test_num}.
source=${data_source}
292 mv FILE
* TEMPORARY_STORAGE
/${test_num}.
source=${data_source}
293 mv met_
* TEMPORARY_STORAGE
/${test_num}.
source=${data_source}
295 # ## Run the real/wrf combo on this data generated. ##
297 # Get to the WRF dir, just up and over a bit.
299 pushd ..
/WRFV
2/test
/em_real
>& /dev
/null
301 # We need the data we just made from metgrid to be the input for real.
303 ln -sf ..
/..
/..
/WPS
/TEMPORARY_STORAGE
/${test_num}.
source=${data_source}/met_
* .
305 # Manufacture the namelist. A template is in the data dir, just edit the
306 # number of metgrid levels.
308 cp $datadir/$test_num/namelist.input namelist.input.template
309 set NUM_METGRID_LEVELS
= `ncdump -h met_em.d02.* | grep -i num_metgrid_levels | grep = | awk '{print $3}'`
310 m4 -DNUM_METGRID_LEVELS=${NUM_METGRID_LEVELS} namelist.input.template
>! namelist.input
314 echo " real.exe share=${share} metgrid=${metgrid} source=$data_source"
315 echo " start: " `date`
316 real.exe
>&! real.print.share
=${share}.metgrid
=${metgrid}.
source=$data_source
317 grep -i success real.print.share
=${share}.metgrid
=${metgrid}.
source=$data_source >& /dev
/null
322 echo "Failed to run real.exe"
331 echo " wrf.exe share=${share} metgrid=${metgrid} source=$data_source"
332 echo " start: " `date`
333 wrf.exe
>&! wrf.print.share
=${share}.metgrid
=${metgrid}.
source=$data_source
334 grep -i success wrf.print.share
=${share}.metgrid
=${metgrid}.
source=$data_source >& /dev
/null
339 echo "Failed to run wrf.exe"
346 # Save the model IC, BC and forecast data.
348 if ( ! -d TEMPORARY_STORAGE
) then
349 mkdir TEMPORARY_STORAGE
351 if ( -d TEMPORARY_STORAGE
/${test_num}.
source=${data_source} ) then
352 rm -rf TEMPORARY_STORAGE
/${test_num}.
source=${data_source}
354 mkdir TEMPORARY_STORAGE
/${test_num}.
source=${data_source}
355 mv wrfi
* wrfb
* wrfo
* namelist.input TEMPORARY_STORAGE
/${test_num}.
source=${data_source}
358 # Get back out to the WPS dir.
366 pushd ..
/WRFV
2/test
/em_real
>& /dev
/null
368 # Handle the plots with RIP.
370 echo " ripdp_wrfarw and rip share=${share} metgrid=${metgrid} source=$data_source"
371 echo " start: " `date`
375 rm -rf RIP
/${test_num}_
${data_source}* >& /dev
/null
376 ripdp_wrfarw RIP
/${test_num}_
${data_source} \
378 TEMPORARY_STORAGE
/${test_num}.
source=${data_source}/wrfo
* >&! \
379 ripdp_wrfarw.print.share
=${share}.metgrid
=${metgrid}.
source=$data_source
380 grep -i vladimir ripdp_wrfarw.print.share
=${share}.metgrid
=${metgrid}.
source=$data_source >& /dev
/null
385 echo "Failed to run ripdp_wrfarw"
393 cp ${datadir}/${test_num}/rip_test.
in test.
in
394 rip RIP
/${test_num}_
${data_source} test.
in >&! \
395 rip.print.share
=${share}.metgrid
=${metgrid}.
source=$data_source
396 grep -i vladimir rip.print.share
=${share}.metgrid
=${metgrid}.
source=$data_source >& /dev
/null
401 echo "Failed to run rip"
407 # Split plots into CGM pieces.
409 if ( -e med.info
) then
416 echo "read test.cgm" >> med.info
417 while ( $count < $NUM_FRAMES )
419 if ( $count < 10 ) then
424 echo "${index} , ${index} w plot${index}.cgm" >> med.info
426 echo "quit" >> med.info
428 # Run med to split frames.
430 med
-f med.info
>& /dev
/null
432 # Convert to a more traditional form, we like gif right now.
435 while ( $count < $NUM_FRAMES )
437 if ( $count < 10 ) then
442 ctrans
-d sun plot
${index}.cgm
> plot
${index}.ras
443 convert plot
${index}.ras ${test_num}_${data_source}_${index}.gif
444 convert
${test_num}_${data_source}_${index}.gif
-resize 10% \
445 ${test_num}_${data_source}_${index}_small.gif
448 mv test.cgm plot
*.cgm plot
*.ras
*.gif \
449 TEMPORARY_STORAGE
/${test_num}.
source=${data_source}
452 # Build singleton web pages for each image
455 while ( $count < $NUM_FRAMES )
457 if ( $count < 10 ) then
462 cat >&! TEMPORARY_STORAGE
/${test_num}.source=${data_source}/plot_${index}.html
<< EOF
465 <img src="${test_num}_${data_source}_${index}.gif">
473 # Put the pre-built web page on top of the WRF fcst plots.
475 if ( ! -e ..
/WRFV
2/test
/em_real
/TEMPORARY_STORAGE
/wps_reg.html
) then
476 cp util
/wps_reg.html ..
/WRFV
2/test
/em_real
/TEMPORARY_STORAGE
481 skipped_namelist_as_a_directory
:
485 # Save the static data for this location.
487 if ( $PLOTS_ONLY == FALSE
) then
488 if ( -d TEMPORARY_STORAGE
/${test_num}.location
) then
489 rm -rf TEMPORARY_STORAGE
/${test_num}.location
491 mkdir TEMPORARY_STORAGE
/${test_num}.location
492 mv geo_
* TEMPORARY_STORAGE
/${test_num}.location