-
Notifications
You must be signed in to change notification settings - Fork 18
/
wps_wrf_pipeline.sh
66 lines (56 loc) · 1.37 KB
/
wps_wrf_pipeline.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Set up Constants
date
OUT_DIR=`pwd`/output/
MODEL_NAME=BCMM
SAMPLE_DIR=`pwd`/sample/$MODEL_NAME/
WPS_DIR=/home/lzhenn/WRFv43-preprocess/WPS-4.3/
WRF_DIR=/home/lzhenn/WRFv43-preprocess/WRF-4.3//run
WPS_FLAG=1
REAL_FLAG=1
WRF_FLAG=1
NTASKS=32
#-----------------WPS---------------------
if [ $WPS_FLAG == 1 ]; then
LOGFILE=wps.log
echo ">>>>WRF-WPS"
cd $WPS_DIR
# Clean WPS data
#rm -f geo_em*
echo ">>>>WRF-WPS:Clean Pre-existed Files..."
rm -f met_em.*
rm -f GFS:*
rm -f ERA*
rm -f CMIP*
rm -f SST:*
rm -f $MODEL_NAME*
cp $SAMPLE_DIR/namelist.wps ./
ln -sf $OUT_DIR/$MODEL_NAME* ./
echo ">>>>WRF-WPS:geogrid..."
#./geogrid.exe
echo ">>>>WRF-WPS:Working on WPS->Metgrid..."
mpirun -np 8 ./metgrid.exe >& $LOGFILE
fi
date
#-----------------REAL---------------------
if [ $REAL_FLAG == 1 ]; then
echo ">>>>WRF-REAL:Clean Pre-existed Files..."
cd $WRF_DIR
cp ${SAMPLE_DIR}/namelist.input $WRF_DIR
rm -f met_em.d0*
rm -f wrfinput_d0*
rm -f wrflowinp_d0*
rm -f wrfbdy_d0*
rm -f wrffda*
echo ">>>>WRF-REAL: Run real.exe..."
ln -sf $WPS_DIR/met_em.d0* ./
mpirun -np 16 ./real.exe
fi
date
#-----------------WRF---------------------
if [ $WRF_FLAG == 1 ]; then
echo ">>>>WRF-WRF: Run wrf.exe..."
cd $WRF_DIR
mpirun -np $NTASKS ./wrf.exe
fi
echo ">>>>ALL DONE!!!"
date