2 #-------------------------------------------------------------------------
3 #Script for running the (E-grid to C-grid) convertor program
5 # Author : Sujata Pattanayak, CAS, IIT Delhi, India
6 # Date : 15 August 2008
8 #Note: INITIAL_DATE, FINAL_DATE, CYCLE_PERIOD should be given.
9 #Define your SRC_DIR, WRF_NMM_RC_DIR, RUN_DIR, ARW_RC_DIR
10 #--------------------------------------------------------------------------
12 export INITIAL_DATE
=2007111200
13 export FINAL_DATE
=2007111212
14 export CYCLE_PERIOD
=12
16 export DATE
=${INITIAL_DATE}
19 export SRC_DIR
=/users
/xinzhang
/work
/code
/trunk
/phoenix_g95_opt
/sujata
/convertor
20 export DAT_DIR
=/users
/xinzhang
/work
/code
/trunk
/phoenix_g95_opt
/sujata
21 export REGION
=india_27km_nmm
22 export EXPT
=run_india_27km_nmm
23 export WRF_NMM_RC_DIR
=/users
/xinzhang
/work
/code
/trunk
/phoenix_g95_opt
/sujata
/nmm
/rc
24 export WRF_NMM_RC_DIR
=${WRF_NMM_RC_DIR:-$DAT_DIR/$REGION/$EXPT/rc}
25 export BUILD_DIR
=/users
/xinzhang
/work
/code
/trunk
/phoenix_g95_opt
/sujata
/wrfvar-nmm_branches_V3.0_Release
/build
27 export ARW_RC_DIR
=$DAT_DIR/arw
/rc
28 export ARW_RC_DIR
=${ARW_RC_DIR:-$DAT_DIR/$REGION/rc}
29 export RUN_DIR
=${RUN_DIR:-$DAT_DIR/$REGION}
31 while [[ $DATE -le $FINAL_DATE ]] ; do
33 echo "==========================="
34 echo " Doing job for " $DATE
35 echo "==========================="
37 mkdir
-p ${ARW_RC_DIR}/${DATE}
39 export YEAR
=$
(echo ${DATE} | cut
-c1-4)
40 export MONTH
=$
(echo ${DATE} | cut
-c5-6)
41 export DAY
=$
(echo ${DATE} | cut
-c7-8)
42 export HOUR
=$
(echo ${DATE} | cut
-c9-10)
44 export SIM_START_DATE
=${YEAR}-${MONTH}-${DAY}_${HOUR}:00:00
45 export START_DATE
=${SIM_START_DATE}
46 export FCST_TIME
=${YEAR}-${MONTH}-${DAY}_${HOUR}:00:00
48 echo "SIM_START_DATE =" ${SIM_START_DATE}
49 echo "START_DATE=" ${SIM_START_DATE}
50 echo "FCST_TIME =" ${FCST_TIME}
52 echo "Doing job for File :" ${WRF_NMM_RC_DIR}/${DATE}/wrfinput_d01
56 mkdir
-p ${RUN_DIR}; cd ${RUN_DIR}
57 ln -sf ${WRF_NMM_RC_DIR}/$DATE/wrfinput_d01 .
58 ${SRC_DIR}/convert_e2c.exe ${FCST_TIME} ${START_DATE} ${SIM_START_DATE}
60 mv wrfoutput_d01
$ARW_RC_DIR/${DATE}/wrfinput_d01
62 export NEXT_DATE
=$
($BUILD_DIR/da_advance_time.exe
${DATE} ${CYCLE_PERIOD} 2>/dev
/null
)
63 export DATE
=$NEXT_DATE