Commit ba919427 authored by Paulo V C Medeiros's avatar Paulo V C Medeiros
Browse files

Add new scripts from Esbjorn

Found at /scratch/ms/se/smo/carra/conv/
parent 4bfc1cf0
#!/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
#!/bin/ksh
#
set -x
cd /scratch/ms/se/smo/carra/conv
DTG1=$1
DTG2=$2
DTG=$DTG1
TXTPATH=/scratch/ms/se/smo/carra/conv/FI/
while (( $DTG<=$DTG2 ))
do
FILE_OUT=$TXTPATH"obs_"$DTG".txt"
((BB = ${DTG} / 100))
((YY = $BB / 10000))
((MM = ( $BB - $YY*10000) / 100))
IY=$YY
IM=`perl -e "printf('%2.2i', '$MM')"`
INFILE1="/scratch/ms/se/smo/carra/conv/FI/"$IY"/synopCARRA_FMI_"$IY$IM".txt"
grep $DTG $INFILE1 > $FILE_OUT
DTG=$(/home/ms/se/smo/bin/mandtg.x $DTG + 01)
done
exit
#!/bin/ksh
#
set -x
cd /scratch/ms/se/smo/carra/conv
DTG1=$1
DTG2=$2
DTG=$DTG1
TXTPATH=/scratch/ms/se/smo/carra/conv/IC/
while (( $DTG<=$DTG2 ))
do
FILE_OUT=$TXTPATH"obs_"$DTG".txt"
((BB = ${DTG} / 100))
((YY = $BB / 10000))
((MM = ( $BB - $YY*10000) / 100))
IY=$YY
IM=`perl -e "printf('%2.2i', '$MM')"`
INFILE1="/scratch/ms/se/smo/carra/conv/IC/"$IY"/carra_iceland_"$IY"_"$IM".txt"
grep $DTG $INFILE1 > $FILE_OUT
DTG=$(/home/ms/se/smo/bin/mandtg.x $DTG + 01)
done
exit
#!/bin/ksh
#
set -x
cd /scratch/ms/se/smo/carra/conv
DTG1=$1
DTG2=$2
DTG=$DTG1
TXTPATH=/scratch/ms/se/smo/carra/conv/NO/
while (( $DTG<=$DTG2 ))
do
FILE_OUT=$TXTPATH"carra_Norway_synop_"$DTG".txt"
((BB = ${DTG} / 100))
((YY = $BB / 10000))
((MM = ( $BB - $YY*10000) / 100))
IY=$YY
IM=`perl -e "printf('%2.2i', '$MM')"`
INFILE1="/scratch/ms/se/smo/carra/conv/NO/"$IY"/carra_Norway_synop_"$IY$IM".txt"
grep $DTG $INFILE1 > $FILE_OUT
DTG=$(/home/ms/se/smo/bin/mandtg.x $DTG + 01)
done
exit
#!/bin/ksh
#
set -x
cd /scratch/ms/se/smo/carra/conv
DTG1=$1
DTG2=$2
DTG=$DTG1
TXTPATH=/scratch/ms/se/smo/carra/conv/NO/
while (( $DTG<=$DTG2 ))
do
FILE_OUT=$TXTPATH"carra_Norway_SA_RR24_"$DTG".txt"
((BB = ${DTG} / 100))
((YY = $BB / 10000))
((MM = ( $BB - $YY*10000) / 100))
IY=$YY
IM=`perl -e "printf('%2.2i', '$MM')"`
INFILE1="/scratch/ms/se/smo/carra/conv/NO/"$IY"/carra_Norway_SA_RR24_"$IY$IM".txt"
grep $DTG $INFILE1 > $FILE_OUT
DTG=$(/home/ms/se/smo/bin/mandtg.x $DTG + 24)
done
exit
#!/bin/ksh
#
set -x
cd /scratch/ms/se/smo/carra/conv
DTG1=$1
DTG2=$2
DTG=$DTG1
TXTPATH=/scratch/ms/se/smo/carra/conv/SE/
while (( $DTG<=$DTG2 ))
do
FILE_OUT=$TXTPATH"obs_"$DTG".txt"
((BB = ${DTG} / 100))
((YY = $BB / 10000))
((MM = ( $BB - $YY*10000) / 100))
IY=$YY
IM=`perl -e "printf('%2.2i', '$MM')"`
INFILE1="/scratch/ms/se/smo/carra/conv/SE/"$IY"/carra_Sweden_"$IY$IM".txt"
grep $DTG $INFILE1 > $FILE_OUT
DTG=$(/home/ms/se/smo/bin/mandtg.x $DTG + 01)
done
exit
#!/bin/bash
#SBATCH --job-name=vobs
#SBATCH --workdir=/scratch/ms/se/smo/carra/conv
#SBATCH --qos=normal
#SBATCH --time=05:30:00
#
set -x
cd /scratch/ms/se/smo/carra/conv
YYYY=$1
for MM in 01 02 03 04 05 06 07 08 09 10 11 12; do
IMM=`perl -e "printf('%2.2i', '$MM')"`
D1=01
case $MM in
02) ND=28
if [ $YYYY = 1984 -o $YYYY = 1988 -o $YYYY = 1992 -o $YYYY = 1980 \
-o $YYYY = 1976 -o $YYYY = 1972 -o $YYYY = 1968 -o $YYYY = 1964 \
-o $YYYY = 1960 -o $YYYY = 1956 -o $YYYY = 1996 -o $YYYY = 2000 \
-o $YYYY = 2004 -o $YYYY = 2008 -o $YYYY = 2012 -o $YYYY = 2016 ]
then
ND=29
fi;;
04) ND=30;;
06) ND=30;;
09) ND=30;;
11) ND=30;;
*) ND=31;;
esac
DTG1=$YYYY$MM$D1"00"
DTG2=$YYYY$MM$ND"23"
DTGNO1=$YYYY$MM$D1"06"
DTGNO2=$YYYY$MM$ND"06"
DTG=$DTG1
export INPATH=/scratch/ms/se/smo/carra/conv/
./Fix_obsfiles_DK.ksh $DTG1 $DTG2
DTGF=$(/home/ms/se/smo/bin/mandtg.x $DTG1 + -24)
((BB = ${DTGF} / 100))
((YYF = $BB / 10000))
((MMF = ( $BB - $YYF*10000) / 100))
IMF=`perl -e "printf('%2.2i', '$MMF')"`
cd $INPATH/FI/$YYYY
gunzip "synopCARRA_FMI_"$YYYY$MM".txt.gz"
cd $INPATH
./Fix_obsfiles_FI.ksh $DTG1 $DTG2
cd $INPATH/FI/$YYYY
gzip "synopCARRA_FMI_"$YYYY$MM".txt"
cd $INPATH/FI/$YYF
gunzip "synopCARRA_FMI_"$YYF$IMF".txt.gz"
grep $DTG1 "synopCARRA_FMI_"$YYF$IMF".txt" > "../obs_"$DTG1".txt"
gzip "synopCARRA_FMI_"$YYF$IMF".txt"
cd $INPATH
./Fix_obsfiles_IC.ksh $DTG1 $DTG2
./Fix_obsfiles_NO1.ksh $DTG1 $DTG2
./Fix_obsfiles_NO2.ksh $DTGNO1 $DTGNO2
./Fix_obsfiles_SE.ksh $DTG1 $DTG2
while (( $DTG<=$DTG2 ))
do
((BB = ${DTG} / 100))
((YY = $BB / 10000))
((MM = ( $BB - $YY*10000) / 100))
((DD = ( $BB - $YY*10000 - $MM*100) ))
((HH = (${DTG} - $BB*100) ))
((IYY = $YY-2000))
IY=`perl -e "printf('%2.2i', '$IYY')"`
IM=`perl -e "printf('%2.2i', '$MM')"`
ID=`perl -e "printf('%2.2i', '$DD')"`
IH=`perl -e "printf('%2.2i', '$HH')"`
/bin/rm vobs.txt
VOBSFILE=vobs/vobs$DTG
./carra2vobs.x $DTG
if [[ -f vobs.txt && -s vobs.txt ]];then
cat vobs.txt >> $VOBSFILE
/bin/rm vobs.txt
fi
DTG=$(/home/ms/se/smo/bin/mandtg.x $DTG + 01)
done
cd $INPATH/vobs
TAR_FILE="vobs_"$YYYY$IMM".tar"
tar cvf $TAR_FILE vobs*
gzip $TAR_FILE
GZIP_FILE="vobs_"$YYYY$IMM".tar.gz"
ecp $GZIP_FILE ec:/smo/harmonie/CARRA/vobs/$YYYY/
echmod 755 ec:/smo/harmonie/CARRA/vobs/$YYYY/*
echgrp hirald ec:/smo/harmonie/CARRA/vobs/$YYYY/*
/bin/rm $GZIP_FILE vobs*
cd $INPATH
/bin/rm $INPATH/DK/obs_*.txt
/bin/rm $INPATH/FI/obs_*.txt
/bin/rm $INPATH/IC/obs_*.txt
/bin/rm $INPATH/NO/carra_Norway*.txt
/bin/rm $INPATH/SE/obs_*.txt
done
exit
Files copied from
/scratch/ms/se/smo/carra/conv/
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment