svn trunk commit r4543
[wrffire.git] / wrfv2_fire / test / em_real / run_2w2i.csh
blob3faabea1b1fcb6dfd738e108ceb858a1223d9c83
1 #!/bin/csh
3 # Run the WRF 2-way using 2 input files.
5 # This shell assumes that you have already built the WRF code and that the
6 # real.exe, ndown.exe, and wrf.exe files exist. It assumes that the input
7 # data for the Jan00 case is in a "normal" location. This code is executed
8 # from the ./WRFV2/test/em_real directory.
10 ##################################################################################
12 # Make the namelist: 1 h, 2 domains, output every hour, and use the Noah LSM
14 echo 1.1
15 sed -e '/^ run_hours/s/12/1/' \
16 -e '/^ history_interval/s/180/60/' \
17 -e '/^ sf_surface_physics/s/1/2/' \
18 -e '/^ sf_surface_physics/s/1/2/' \
19 -e '/^ num_soil_layers/s/5/4/' \
20 -e '/^ max_dom/s/1/2/' \
21 -e '/^ input_from_file/s/false/true/' \
22 namelist.input.jan00 >! namelist.input
24 # Get the coarse and fine grid input data from the SI
26 echo 1.2
27 if ( ( `uname` == AIX ) && ( `hostname | cut -c 1-2` == bs ) ) then
28 ln -sf /mmm/users/gill/WRF-data-EM/jan00/wrf_real* .
29 else if ( ( `uname` == OSF1 ) && ( `hostname | cut -c 1-6` == joshua ) ) then
30 ln -sf /users/gill/WRF-data-EM/jan00/wrf_real* .
31 else if ( ( `uname` == Linux ) && ( `hostname` == bay-mmm ) ) then
32 ln -sf /users/gill/WRF-data-EM/jan00/wrf_real* .
33 endif
35 # Run real data preprocessor real.exe
37 echo 1.3
38 if ( ( `uname` == AIX ) && ( `hostname | cut -c 1-2` == bs ) ) then
39 setenv MP_PROCS 1
40 setenv MP_RMPOOL 1
41 real.exe
42 else if ( ( `uname` == OSF1 ) && ( `hostname | cut -c 1-6` == joshua ) ) then
43 cat >! machfile << EOF
44 `hostname`
45 `hostname`
46 `hostname`
47 `hostname`
48 EOF
49 mpirun -np 1 -machinefile ./machfile real.exe
50 else if ( ( `uname` == Linux ) && ( `hostname` == bay-mmm ) ) then
51 cat >! machfile << EOF
52 `hostname`
53 `hostname`
54 `hostname`
55 `hostname`
56 EOF
57 mpirun -np 1 -machinefile ./machfile real.exe
58 endif
60 # Well, did the coarse grid ic/bc work?
62 echo 1.4
63 set ic_size = `ls -ls wrfinput_d01 | awk ' { print $6 } '`
64 set bc_times = `ncdump -h wrfbdy_d01 | grep "Time = UNLIMITED" | cut -d"(" -f2 | cut -dc -f1`
65 if ( ( $ic_size > 10000 ) && ( $bc_times == 4 ) ) then
66 rm rsl*
67 else
68 echo coarse grid ic bc wrong size
69 exit ( 2 )
70 endif
72 # Run coarse+fine grid wrf
74 echo 1.5
75 if ( ( `uname` == AIX ) && ( `hostname | cut -c 1-2` == bs ) ) then
76 setenv MP_PROCS 1
77 wrf.exe
78 else if ( ( `uname` == OSF1 ) && ( `hostname | cut -c 1-6` == joshua ) ) then
79 mpirun -np 2 -machinefile ./machfile wrf.exe
80 else if ( ( `uname` == Linux ) && ( `hostname` == bay-mmm ) ) then
81 mpirun -np 2 -machinefile ./machfile wrf.exe
82 endif
84 # Well, did the coarse+fine grid wrf work?
86 echo 1.6
87 set c_times = `ncdump -h wrfout_d01_2000-01-24_12:00:00 | grep "Time = UNLIMITED" | cut -d"(" -f2 | cut -dc -f1`
88 set f_times = `ncdump -h wrfout_d02_2000-01-24_12:00:00 | grep "Time = UNLIMITED" | cut -d"(" -f2 | cut -dc -f1`
89 if ( ( $c_times == 2 ) && ( $f_times == 2 ) ) then
90 echo 2w2i worked
91 rm rsl*
92 else
93 echo coarse grid wrf output wrong size
94 exit ( 3 )
95 endif