Fix_obsfiles_DK.ksh 715 Bytes
Newer Older
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
#!/bin/ksh
#
set -x

cd /scratch/ms/se/smo/carra/conv

DTG1=$1
DTG2=$2

DTG=$DTG1
TXTPATH=/scratch/ms/se/smo/carra/conv/DK/

while (( $DTG<=$DTG2 ))
do

  ((BB = ${DTG} / 100))
  ((YY = $BB / 10000))
  ((MM = ( $BB - $YY*10000) / 100))

  IY=$YY
  IM=`perl -e "printf('%2.2i', '$MM')"`

  FILE_OUT=$TXTPATH"obs_"$DTG".txt"

  INFILE1="/scratch/ms/se/smo/carra/conv/DK/GCNET/"$IY"/gcnet_"$IY$IM".txt"
  INFILE2="/scratch/ms/se/smo/carra/conv/DK/Geus/"$IY"/geus_"$IY$IM".txt"
  INFILE3="/scratch/ms/se/smo/carra/conv/DK/Asiaq/"$IY"/Asiaq_"$IY$IM".txt"

  grep $DTG $INFILE1 > $FILE_OUT
  grep $DTG $INFILE2 >> $FILE_OUT
  grep $DTG $INFILE3 >> $FILE_OUT

  DTG=$(/home/ms/se/smo/bin/mandtg.x $DTG + 01) 

done

exit