##### get ECMWF/NCEP ensemble mean tracks data  #####################

yymm=201509
export daylist="01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30"
#export daylist="01"
export cyclist="00 12"

DATA=/ptmpp1/Jiayi.Peng/2NAE

if [ ! -d ${DATA} ]; then
  mkdir -p ${DATA}
fi
#######################################################
for nday in $daylist; do
for ncyc in $cyclist; do

TRACK_OUT=/ensemble/save/Jiayi.Peng/track/2nae.${yymm}${nday}${ncyc}
if [ ! -d ${TRACK_OUT} ]; then
  mkdir -p ${TRACK_OUT}
fi

cp /ensemble/save/Jiayi.Peng/track/ens.${yymm}${nday}${ncyc}/trak.ap* ${DATA}
cp /ensemble/save/Jiayi.Peng/track/eens.${yymm}${nday}${ncyc}/trak.e[np]* ${DATA}

./ens_trak_ave.sh ${yymm}${nday} ${ncyc} nae2 ${DATA}

mv ${DATA}/trak.2nae.* ${TRACK_OUT}
mv ${DATA}/2nae.trkprob.* ${TRACK_OUT}
rm -f ${DATA}/*

done
done

###--------------------------------------------------------------------
yymm=201510
export daylist="01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31"
export cyclist="00 12"

DATA=/ptmpp1/Jiayi.Peng/2NAE

if [ ! -d ${DATA} ]; then
  mkdir -p ${DATA}
fi
#######################################################
for nday in $daylist; do
for ncyc in $cyclist; do

TRACK_OUT=/ensemble/save/Jiayi.Peng/track/2nae.${yymm}${nday}${ncyc}
if [ ! -d ${TRACK_OUT} ]; then
  mkdir -p ${TRACK_OUT}
fi

cp /ensemble/save/Jiayi.Peng/track/ens.${yymm}${nday}${ncyc}/trak.ap* ${DATA}
cp /ensemble/save/Jiayi.Peng/track/eens.${yymm}${nday}${ncyc}/trak.e[np]* ${DATA}

./ens_trak_ave.sh ${yymm}${nday} ${ncyc} nae2 ${DATA}

mv ${DATA}/trak.2nae.* ${TRACK_OUT}
mv ${DATA}/2nae.trkprob.* ${TRACK_OUT}
rm -f ${DATA}/*

done
done

###--------------------------------------------------------------------
yymm=201511
export daylist="01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30"
export cyclist="00 12"

DATA=/ptmpp1/Jiayi.Peng/2NAE

if [ ! -d ${DATA} ]; then
  mkdir -p ${DATA}
fi
#######################################################
for nday in $daylist; do
for ncyc in $cyclist; do

TRACK_OUT=/ensemble/save/Jiayi.Peng/track/2nae.${yymm}${nday}${ncyc}
if [ ! -d ${TRACK_OUT} ]; then
  mkdir -p ${TRACK_OUT}
fi

cp /ensemble/save/Jiayi.Peng/track/ens.${yymm}${nday}${ncyc}/trak.ap* ${DATA}
cp /ensemble/save/Jiayi.Peng/track/eens.${yymm}${nday}${ncyc}/trak.e[np]* ${DATA}

./ens_trak_ave.sh ${yymm}${nday} ${ncyc} nae2 ${DATA}

mv ${DATA}/trak.2nae.* ${TRACK_OUT}
mv ${DATA}/2nae.trkprob.* ${TRACK_OUT}
rm -f ${DATA}/*

done
done
