source: flexpart.git/preprocessing/flex_extract_ecgate_V6.0/ecmwf_idc_ops_multi_header_template @ ba05105

FPv9.3.1FPv9.3.1b_testingFPv9.3.2devfp9.3.1-20161214-nc4grib2nc4_repairrelease-10univie
Last change on this file since ba05105 was ba05105, checked in by flexpart <>, 4 years ago

add preprocessing routines flex_extract_ecgate_V6.0

  • Property mode set to 100644
File size: 1.8 KB
Line 
1#!/bin/ksh
2
3#SBATCH --workdir=/scratch/ms/ggg/xxx
4#SBATCH --qos=normal
5#SBATCH --job-name=flex_ecmwf_oper
6#SBATCH --output=ms_sms_output_Vv.v/CTBTO_ops.out
7#SBATCH --error=ms_sms_output_Vv.v/CTBTO_ops.out
8#SBATCH --mail-type=ALL
9#SBATCH --time=12:00:00
10
11
12set -x
13
14alias ecp='set noglob; $ECFS_SYS_PATH/ecp.p'
15
16export OMP_NUM_HREADS=1
17
18
19
20###########################
21
22# ADD BEGIN AND END HERE  #
23
24###########################
25
26   MSJ_START=2013110700
27   MSJ_END=2013110812
28
29
30###########################
31
32# NO CHANGES BELOW        #
33
34###########################
35
36VERSION=v.v
37JOBNAME=ecmwf_idc_ops_ecgate_V${VERSION}
38CONTROLFILE=${HOME}/flex_extract_ecgate_V${VERSION}/CONTROL_OPS_V${VERSION}
39
40WDAY=$(date +%A)
41[ ! -d $SCRATCH/ms_sms_output_V${VERSION} ] && mkdir $SCRATCH/ms_sms_output_V${VERSION}
42
43LOG_FILE=$SCRATCH/ms_sms_output_V${VERSION}/${JOBNAME}_${WDAY}
44exec 1>${LOG_FILE}
45
46[ -z "$WSHOME" ] && export WSHOME=$HOME
47
48   DAY1=$(($MSJ_START/100))
49   DAY2=$(($MSJ_END/100))
50   TDIFF=$(( (`date +%s -d $DAY2` - `date +%s -d $DAY1` )/86400 ))
51   if [[ $TDIFF -lt 0 || $TDIFF -gt 31 ]] ; then
52     echo invalid difference $TDIFF between dates $1, $2
53     echo difference must be positive and smaller than 32
54     exit
55   fi
56
57
58       MSJ=$MSJ_START
59       MSJ_YEAR=$(( ($MSJ/1000000)))
60       while [ $MSJ -le $MSJ_END ]
61       do
62
63       MSJ_MONTH=$(( ($MSJ%1000000)/10000))
64       MSJ_DAY=$(( ($MSJ%10000)/100))
65       MSJ_BASETIME=$(($MSJ%100))
66
67       if [ $MSJ_MONTH -lt 10 ] ; then
68          MSJ_MONTH='0'$MSJ_MONTH
69       fi
70       if [ $MSJ_DAY -lt 10 ] ; then
71          MSJ_DAY='0'$MSJ_DAY
72       fi
73       if [ $MSJ_BASETIME -lt 10 ] ; then
74          MSJ_BASETIME='0'$MSJ_BASETIME
75       fi
76
77       MSJ=$MSJ_YEAR$MSJ_MONTH$MSJ_DAY$MSJ_BASETIME
78
79       echo 'MSJ_ENVIRONMENT:' $MSJ
80
81       DATEREF=${MSJ_YEAR}${MSJ_MONTH}${MSJ_DAY}
82
83
Note: See TracBrowser for help on using the repository browser.
hosted by ZAMG