Commit ba05105d authored by flexpart's avatar flexpart
Browse files

add preprocessing routines flex_extract_ecgate_V6.0

parent 6b2046dd
DAY1 20131107
DAY2 20131108
DTIME 3
M_TYPE AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC
M_TIME 00 00 00 00 00 00 06 00 00 00 00 00 12 12 12 12 12 12 18 12 12 12 12 12
M_STEP 00 01 02 03 04 05 00 07 08 09 10 11 00 01 02 03 04 05 00 07 08 09 10 11
M_CLASS OD
M_STREAM OPER
M_NUMBER OFF
M_EXPVER 1
M_GRID 1000
M_LEFT -179000
M_LOWER -90000
M_UPPER 90000
M_RIGHT 180000
M_LEVEL 137
M_RESOL 159
M_GAUSS 1
M_ACCURACY 24
M_OMEGA 0
M_OMEGADIFF 0
M_ETA 0
M_ETADIFF 0
M_DPDETA 1
M_SMOOTH 0
M_FORMAT GRIB1
M_ADDPAR /27/28/173/186/187/188/235/139/39
PREFIX EN
GATEWAY xxx.xxx.xxx.xxx
DESTINATION xxx@xxx
ECSTORAGE 1
ECTRANS 0
ECFSDIR ectmp:/${USER}/econdemand/
MAILOPS ${USER}
MAILFAIL ${USER}
EXEDIR .
SOURCECODE ${WSHOME}/flex_extract_ecgate_Vv.v
EOF
DAY1 20131107
DAY2 20131108
DTIME 3
M_TYPE CV CV CV CV CV CV CV CV CV CV CV CV CV CV CV CV CV CV CV CV CV CV CV CV
M_TIME 00 00 00 00 00 00 00 00 00 00 00 00 12 12 12 12 12 12 12 12 12 12 12 12
M_STEP 00 01 02 03 04 05 06 07 08 09 10 11 00 01 02 03 04 05 06 07 08 09 10 11
M_CLASS OD
M_STREAM ENFO
M_NUMBER 1
M_EXPVER 1
M_GRID 1000
M_LEFT -179000
M_LOWER -90000
M_UPPER 90000
M_RIGHT 180000
M_LEVEL 62
M_RESOL 159
M_GAUSS 1
M_ACCURACY 24
M_OMEGA 0
M_OMEGADIFF 0
M_ETA 0
M_ETADIFF 0
M_DPDETA 1
M_SMOOTH 0
M_FORMAT GRIB1
M_ADDPAR /27/28/173/186/187/188/235/139/39
PREFIX EG
GATEWAY srvx7.img.univie.ac.at
DESTINATION leo@genericSftp
ECSTORAGE 1
ECTRANS 0
ECFSDIR ectmp:/${USER}/econdemand/
MAILOPS ${USER}
MAILFAIL ${USER}
EXEDIR .
SOURCECODE ${WSHOME}/flex_extract_ecgate_V6.0
EOF
DAY1 20121107
DAY2 20121108
DTIME 3
M_TYPE AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC
M_TIME 00 00 00 00 00 00 06 00 00 00 00 00 12 12 12 12 12 12 18 12 12 12 12 12
M_STEP 00 01 02 03 04 05 00 07 08 09 10 11 00 01 02 03 04 05 00 07 08 09 10 11
M_CLASS EI
M_STREAM OPER
M_NUMBER OFF
M_EXPVER 1
M_GRID 1000
M_LEFT -179000
M_LOWER -90000
M_UPPER 90000
M_RIGHT 180000
M_LEVEL 60
M_RESOL 159
M_GAUSS 1
M_ACCURACY 24
M_OMEGA 0
M_OMEGADIFF 0
M_ETA 0
M_ETADIFF 0
M_DPDETA 1
M_SMOOTH 0
M_FORMAT GRIB1
M_ADDPAR /27/28/173/186/187/188/235/139/39
PREFIX EI
GATEWAY srvx7.img.univie.ac.at
DESTINATION leo@genericSftp
ECSTORAGE 1
ECTRANS 0
ECFSDIR ectmp:/${USER}/econdemand/
MAILOPS ${USER}
MAILFAIL ${USER}
EXEDIR .
SOURCECODE ${WSHOME}/flex_extract_ecgate_V6.0
EOF
DAY1 20131107
DAY2 20131108
DTIME 3
M_TYPE AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC
M_TIME 00 00 00 00 00 00 06 00 00 00 00 00 12 12 12 12 12 12 18 12 12 12 12 12
M_STEP 00 01 02 03 04 05 00 07 08 09 10 11 00 01 02 03 04 05 00 07 08 09 10 11
M_CLASS OD
M_STREAM OPER
M_NUMBER OFF
M_EXPVER 1
M_GRID 1000
M_LEFT -179000
M_LOWER -90000
M_UPPER 90000
M_RIGHT 180000
M_LEVEL 137
M_RESOL 159
M_GAUSS 0
M_ACCURACY 24
M_OMEGA 0
M_OMEGADIFF 0
M_ETA 1
M_ETADIFF 0
M_DPDETA 1
M_SMOOTH 0
M_FORMAT GRIB1
M_ADDPAR /27/28/173/186/187/188/235/139/39
PREFIX EE
GATEWAY srvx7.img.univie.ac.at
DESTINATION leo@genericSftp
ECSTORAGE 1
ECTRANS 0
ECFSDIR ectmp:/${USER}/econdemand/
MAILOPS ${USER}
MAILFAIL ${USER}
EXEDIR .
SOURCECODE ${WSHOME}/flex_extract_ecgate_V6.0
EOF
DAY1 20131107
DAY2 20131108
DTIME 3
M_TYPE AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC
M_TIME 00 00 00 00 00 00 06 00 00 00 00 00 12 12 12 12 12 12 18 12 12 12 12 12
M_STEP 00 01 02 03 04 05 00 07 08 09 10 11 00 01 02 03 04 05 00 07 08 09 10 11
M_CLASS OD
M_STREAM OPER
M_NUMBER OFF
M_EXPVER 1
M_GRID 1000
M_LEFT -179000
M_LOWER -90000
M_UPPER 90000
M_RIGHT 180000
M_LEVEL 137
M_RESOL 159
M_GAUSS 1
M_ACCURACY 24
M_OMEGA 0
M_OMEGADIFF 0
M_ETA 0
M_ETADIFF 0
M_DPDETA 1
M_SMOOTH 0
M_FORMAT GRIB1
M_ADDPAR /27/28/173/186/187/188/235/139/39
PREFIX EG
GATEWAY srvx7.img.univie.ac.at
DESTINATION leo@genericSftp
ECSTORAGE 1
ECTRANS 0
ECFSDIR ectmp:/${USER}/econdemand/
MAILOPS ${USER}
MAILFAIL ${USER}
EXEDIR .
SOURCECODE ${WSHOME}/flex_extract_ecgate_V6.0
EOF
DAY1 20131107
DAY2 20131108
DTIME 3
M_TYPE AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC
M_TIME 00 00 00 00 00 00 06 00 00 00 00 00 12 12 12 12 12 12 18 12 12 12 12 12
M_STEP 00 01 02 03 04 05 00 07 08 09 10 11 00 01 02 03 04 05 00 07 08 09 10 11
M_CLASS OD
M_STREAM OPER
M_NUMBER OFF
M_EXPVER 1
M_GRID 200
M_LEFT 113000
M_LOWER 00000
M_UPPER 30000
M_RIGHT 190000
M_LEVEL 137
M_RESOL 799
M_GAUSS 0
M_ACCURACY 24
M_OMEGA 0
M_OMEGADIFF 0
M_ETA 1
M_ETADIFF 0
M_DPDETA 1
M_SMOOTH 0
M_FORMAT GRIB1
M_ADDPAR /27/28/173/186/187/188/235/139/39
PREFIX EH
GATEWAY srvx7.img.univie.ac.at
DESTINATION leo@genericSftp
ECSTORAGE 1
ECTRANS 0
ECFSDIR ectmp:/${USER}/econdemand/
MAILOPS ${USER}
MAILFAIL ${USER}
EXEDIR .
SOURCECODE ${WSHOME}/flex_extract_ecgate_V6.0
EOF
DAY1 20131107
DAY2 20131108
DTIME 3
M_TYPE AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC
M_TIME 00 00 00 00 00 00 06 00 00 00 00 00 12 12 12 12 12 12 18 12 12 12 12 12
M_STEP 00 01 02 03 04 05 00 07 08 09 10 11 00 01 02 03 04 05 00 07 08 09 10 11
M_CLASS OD
M_STREAM OPER
M_NUMBER OFF
M_EXPVER 1
M_GRID 200
M_LEFT -10000
M_LOWER 30000
M_UPPER 60000
M_RIGHT 30000
M_LEVEL 137
M_RESOL 799
M_GAUSS 0
M_ACCURACY 24
M_OMEGA 0
M_OMEGADIFF 0
M_ETA 1
M_ETADIFF 0
M_DPDETA 1
M_SMOOTH 0
M_FORMAT GRIB1
M_ADDPAR /27/28/173/186/187/188/235/139/39
PREFIX EH
GATEWAY srvx7.img.univie.ac.at
DESTINATION leo@genericSftp
ECSTORAGE 1
ECTRANS 0
ECFSDIR ectmp:/${USER}/econdemand/
MAILOPS ${USER}
MAILFAIL ${USER}
EXEDIR .
SOURCECODE ${WSHOME}/flex_extract_ecgate_V6.0
EOF
M_TYPE AN FC FC FC FC FC FC FC FC FC FC FC AN FC FC FC FC FC FC FC FC FC FC FC FC
M_TIME 00 00 00 00 00 00 00 00 00 00 00 00 12 12 12 12 12 12 12 12 12 12 12 12 12
M_STEP 00 01 02 03 04 05 06 07 08 09 10 11 00 01 02 03 04 05 06 07 08 09 10 11 12
DTIME 1
PREFIX EN
M_CLASS OD
M_STREAM OPER
M_NUMBER OFF
M_GRID 1000
M_RESOL 255
M_SMOOTH 0
M_GAUSS 0
M_ETA 1
M_ETAPAR 77
M_DPDETA 1
M_LEVEL 137
M_LEVELIST 1/to/137
M_ADDPAR /27/28/173/186/187/188/235/139/39
M_FORMAT GRIB1
GATEWAY xxx.xxx.xxx.xxx
DESTINATION xxx@xxx
ECSTORAGE 1
ECTRANS 1
ECFSDIR ectmp:/xxx/ecops
MAILOPS xxx
MAILFAIL xxx
EXEDIR .
SOURCECODE /home/ms/ggg/xxx/flex_extract_ecgate_Vv.v
M_TYPE AN FC FC FC FC FC FC FC FC FC FC FC AN FC FC FC FC FC FC FC FC FC FC FC FC
M_TIME 00 00 00 00 00 00 00 00 00 00 00 00 12 12 12 12 12 12 12 12 12 12 12 12 12
M_STEP 00 01 02 03 04 05 06 07 08 09 10 11 00 01 02 03 04 05 06 07 08 09 10 11 12
DTIME 1
PREFIX EN
M_CLASS OD
M_STREAM OPER
M_NUMBER OFF
M_GRID 1000
M_RESOL 255
M_SMOOTH 0
M_GAUSS 0
M_ETA 1
M_ETAPAR 77
M_DPDETA 1
M_LEVEL 137
M_LEVELIST 1/to/137
M_ADDPAR /27/28/173/186/187/188/235/139/39
M_FORMAT GRIB1
GATEWAY srvx7.img.univie.ac.at
DESTINATION leo@genericSftp
ECSTORAGE 1
ECTRANS 1
ECFSDIR ectmp:/lh0/ecops
MAILOPS lh0
MAILFAIL lh0
EXEDIR .
SOURCECODE /home/ms/spatlh00/lh0/flex_extract_ecgate_V6.0
M_TYPE AN FC FC FC FC FC FC FC FC FC FC FC AN FC FC FC FC FC FC FC FC FC FC FC FC
M_TIME 00 00 00 00 00 00 06 00 00 09 00 00 09 12 12 12 12 12 18 12 12 21 12 12 21
M_STEP 00 01 02 03 04 05 00 07 08 00 10 11 03 01 02 03 04 05 00 07 08 00 10 11 03
DTIME 3
PREFIX EN
M_CLASS OD
M_STREAM OPER
M_NUMBER OFF
M_GRID 1000
M_RESOL 255
M_SMOOTH 179
M_GAUSS 1
M_ETA 0
M_ETAPAR 77
M_DPDETA 1
M_LEVEL 137
M_LEVELIST 1/to/137
M_ADDPAR /27/28/173/186/187/188/235/139/39
M_FORMAT GRIB1
GATEWAY srvx7.img.univie.ac.at
DESTINATION leo@genericSftp
ECSTORAGE 1
ECTRANS 1
ECFSDIR ectmp:/lh0/ecops
MAILOPS lh0
MAILFAIL lh0
EXEDIR .
SOURCECODE /home/ms/spatlh00/lh0/flex_extract_ecgate_V6.0
# no changes below
NRW=0
#ksh scripts for date manipulation
juldate2()
{
let jc=$1
if (( ${#jc} < 8 ))
then
print "illegal date!"
exit 1
fi
let y=`echo $jc | cut -c1-4`
let m1=`echo $jc | cut -c5`
let m2=`echo $jc | cut -c6`
m=$m1$m2
let d1=`echo $jc | cut -c7`
let d2=`echo $jc | cut -c8`
d=$d1$d2
let jd=367*y-7*(y+(m+9)/12)/4+275*m/9+d+1721014
let jd=jd+15-3*((y+(m-9)/7)/100+1)/4
print $jd
}
civildate2()
{
let jd=$1
if (( jd < 1721060 ))
then
print "Julian date not in AD."
exit 1
fi
let k=jd+68569
let n=4*k/146097
let k=k-\(146097*n+3\)/4
let y=4000*(k+1)/1461001
let k=k-1461*y/4+31
let m=80*k/2447
let d=k-\(2447*m\)/80
let k=m/11
let m=m+2-12*k
let y=100*(n-49)+y+k
[ $m -le 9 ] && m=0$m
[ $d -le 9 ] && d=0$d
print $y$m$d
}
date2m1()
{
let ymd=$1
let j1=`juldate2 $ymd`
let j0=j1-1
civildate2 $j0
}
date2p1()
{
let ymd=$1
let j1=`juldate2 $ymd`
let j0=j1+1
civildate2 $j0
}
date2m14()
{
let ymd=$1
let j1=`juldate2 $ymd`
let j0=j1-14
civildate2 $j0
}
marsinst()
{
MTYPE="${1}"
MDAY="${2}"
MTIME="${3}"
MSTEP="${4}"
MPAR="${5}"
MFN=$6
MLTY=$7
MGRID="${8}"
MLEV="${9}"
#if [[ ${MPAR} == 'LNSP' ]] ; then
# MLEV=1
#else
# if [[ ${MLTY} == 'SFC' ]] ; then
# MLEV=OFF
# else
# MLEV=${M_LEVELIST}
# fi
#fi
RED=0
#if [[ ${MTYPE} != 'AN' ]] ; then
MPAR2=`echo ${MPAR} | sed s,160/,,`
MPAR2=`echo ${MPAR2} | sed s,27/,,`
MPAR2=`echo ${MPAR2} | sed s,28/,,`
MPAR2=`echo ${MPAR2} | sed s,173/,,`
if [[ ${MPAR2} != ${MPAR} ]] ; then
MPAR=${MPAR2}
RED=1
fi
#fi
MAREA=${M_AREA}
if [[ ${10} == 'GAUSSIAN=REDUCED,' ]] ; then
MAREA=G
fi
if [[ -f ${MFN} ]] ; then
rm ${MFN}
fi
cat <<EOF >> marsjob
RETRIEVE,
TYPE=${MTYPE},
CLASS=${M_CLASS},NUMBER=${M_NUMBER},
EXPVER=${M_EXPVER},STREAM=${M_STREAM},
PARAM=${MPAR},
RESOL=${M_RESOL},
AREA=${MAREA},
GRID=${MGRID},
LEVTYPE=${MLTY},
LEVELIST=${MLEV},
ACCURACY=${M_ACCURACY},
DATE=${MDAY},
TIME=${MTIME},
STEP=${MSTEP},${10}
TARGET="${MFN}"
EOF
if [[ ! -f 'OROLSM' && $RED -eq 1 ]] ; then
cat <<EOF >> marsjob
RETRIEVE,TYPE=AN,TIME=0,STEP=0,CLASS=OD,
PARAM=160/27/28/173,
TARGET="OROLSM"
EOF
fi
}
marsflux()
{
MTYPE="${1}"
MSTEP="${2}"
#if [[ ! -f "surf_${M_STEP}_ub" ]] ; then
cat <<EOF >>mars_flux
RETRIEVE,
TYPE=${MTYPE},
CLASS=${M_CLASS},NUMBER=${M_NUMBER},
EXPVER=${M_EXPVER},STREAM=${M_STREAM},
PARAM=LSP/CP/SSHF/EWSS/NSSS/SSR,
AREA=${M_AREA},
GRID=${D_GRID},
LEVTYPE=SFC,
LEVELIST=OFF,
ACCURACY=${M_ACCURACY}, REPRES=GG,
DATE=${DAY1M1}/TO/${DAY2P1},
TIME=00/12,
AC=N,
STEP=${MSTEP},
TARGET="surf_${MSTEP}_ub"
EOF
if [[ $MSJ_BASETIME == 00 ]] ; then
DAY2P2=`date2p1 ${DAY2P1}`
cat <<EOF >>mars_flux
RETRIEVE,
DATE=${DAY2P2},
TIME=00,
TARGET="surf_${MSTEP}_ub"
EOF
fi
#fi
}
myerror()
{
echo $1
echo $2
echo $3
echo ABORT!
for MUSER in $MAILFAIL
do
mailx -s ERROR:${JOBNAME} ${MUSER} <${LOG_FILE}
done
exit 1
}
#
# MAIN SCRIPT CONTINUES HERE
#
#read CONTROL file, process specifications
while read NAME PARA
do
if [[ $NAME == 'M_TYPE' || $NAME == 'M_TIME' || $NAME == 'M_STEP' ]] ; then
eval "set -A $NAME $PARA"
else
eval "export $NAME='$PARA'"
fi
echo `echo $NAME`=$PARA
done <${CONTROLFILE}
#defaults
[ -z "$M_EXPVER" ] && M_EXPVER=1
[ -z "$M_CLASS" ] && M_CLASS=OD
[ -z "$M_STREAM" ] && M_STREAM=OPER
[ -z "$M_NUMBER" ] && M_NUMBER=OFF
[ -z "$M_TYPE" ] && set -A M_TYPE AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC AN FC FC FC FC FC
[ -z "$M_TIME" ] && set -A M_TIME 00 00 00 00 00 00 06 00 00 00 00 00 12 12 12 12 12 12 18 12 12 12 12 12
[ -z "$M_STEP" ] && set -A M_STEP 00 01 02 03 04 05 00 07 08 09 10 11 00 01 02 03 04 05 00 07 08 09 10 11
[ -z "$DTIME" ] && DTIME=6
[ -z "$M_GRID" ] && M_GRID=1000
[ -z "$M_LOWER" ] && M_LOWER=-90000
[ -z "$M_LEFT" ] && M_LEFT=-179000
[ -z "$M_UPPER" ] && M_UPPER=90000
[ -z "$M_RIGHT" ] && M_RIGHT=180000
[ -z "$M_LEVEL" ] && M_LEVEL=91
[ -z "$M_LEVELIST" ] && M_LEVELIST=1/TO/$M_LEVEL
[ -z "$M_ADDPAR" ] && M_ADDPAR=''
[ -z "$M_RESOL" ] && M_RESOL=799
[ -z "$M_GAUSS" ] && M_GAUSS=0
[ -z "$M_SMOOTH" ] && M_SMOOTH=0
[ -z "$M_OMEGA" ] && M_OMEGA=0
[ -z "$M_OMEGADIFF" ] && M_OMEGADIFF=0
[ -z "$M_ETA" ] && M_ETA=0
[ -z "$M_ETADIFF" ] && M_ETADIFF=0
[ -z "$M_ETAPAR" ] && M_ETAPAR=77
[ -z "$M_DPDETA" ] && M_DPDETA=1
[ -z "$M_ACCURACY" ] && M_ACCURACY=24
[ -z "$EXEDIR" ] && EXEDIR=.
[ -z "$SOURCECODE" ] && SOURCECODE=ecgate:flex_extract_ecgate
[ -z "$GATEWAY" ] && GATEWAY=''
[ -z "$DESTINATION" ] && DESTINATION=''
[ -z "$PREFIX" ] && PREFIX=EN
[ -z "$COMPRESSION" ] && COMPRESSION=grid_simple
[ -z "$ECTRANS" ] && ECTRANS=0
[ -z "$ECSTORAGE" ] && ECSTORAGE=1
[ -z "$ECFSDIR" ] && ECFSDIR=ectmp:
[ -z "$MAILOPS" ] && MAILOPS=${USER}
[ -z "$MAILFAIL" ] && MAILFAIL=${USER}
export MARS_MULTITARGET_STRICT_FORMAT=1
if [ $M_GAUSS -eq 1 ] ; then
export SCRATCHDIR=${SCRATCH}/ctbto_run_ecgate-${DTIME}hrs-G_V${VERSION}
mkdir $SCRATCHDIR >/dev/null
else
export SCRATCHDIR=${SCRATCH}/ctbto_run_ecgate-${DTIME}hrs-L_V${VERSION}
mkdir $SCRATCHDIR >/dev/null