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

carra_obsoul_prod.ksh: Parse FI, IS, NO and SE data

parent 9b1a67eb
......@@ -28,8 +28,8 @@ print "\t Output data is stored in directory \t $odir"
# Specify Times of Initial Conditions
#-----------------------------------------------------------------------
years=2018 ; mons=01 ; days=01 ; hours=00 ; dhour=03
yeare=2018 ; mone=01 ; daye=02 ; houre=21
years=2019 ; mons=11 ; days=01 ; hours=03 ; dhour=03
yeare=2019 ; mone=11 ; daye=01 ; houre=03
print "\n\t years = $years \t mons = $mons \t days = $days \t hours = $hours \t dhour = $dhour"
print "\t yeare = $yeare \t mone = $mone \t daye = $daye \t houre = $houre"
......@@ -125,14 +125,29 @@ until (( date > EDATE )) ; do
# Loop over dataset dataset
########################################################################
for dataset in 'SE' ; do
case $dataset in
SE) dfile="$ddir/inputs/SE/${YYYY_W}/cerra_Sweden_${YYYY_W}${MM_W}.txt"
dfile="$ddir/../carra_vobs_2018_2019/carra_vobs_code/new_scripts/inputs/input_to_fix_obsfiles_scripts/SE/${YYYY_W}/cerra_Sweden_${YYYY_W}${MM_W}.txt"
land=$dataset
subset=None ;;
*) exit ;;
for dataset in FI IS NO NO_CLIM SE ; do
land=$(echo $dataset | awk -F_ '{print $1}')
subset=$(echo $dataset | awk -F_ '{print $2}')
if [ -z "$subset" ]; then
subset=None
fi
case $land in
FI) dfile="$ddir/inputs/FI/${YYYY_W}/synopCARRA_FMI_${YYYY_W}${MM_W}.txt" ;;
IS) dfile="$ddir/inputs/IS/${YYYY_W}/cerra_iceland_${YYYY_W}_${MM_W}.txt" ;;
SE) dfile="$ddir/inputs/SE/${YYYY_W}/cerra_Sweden_${YYYY_W}${MM_W}.txt" ;;
NO)
case $subset in
None) dfile="$ddir/inputs/NO/${YYYY_W}/carra_Norway_synop_${YYYY_W}${MM_W}.txt" ;;
CLIM) dfile="$ddir/inputs/NO/${YYYY_W}/carra_Norway_SA_RR24_${YYYY_W}${MM_W}.txt" ;;
*)
echo "Subset '$subset' not recognised for land '$land'"
exit 1;;
esac
;;
*)
echo "Dataset '$dataset': Land '$land' not recognised"
exit 1 ;;
esac
if [[ -f $dfile && -s $dfile ]] ; then
......@@ -143,12 +158,6 @@ until (( date > EDATE )) ; do
cat obsoul.txt >> $ofile
/bin/rm obsoul.txt
# if (( $dataset == 1 ));then
# /bin/mv obsoul.txt obsoul_Asiaq_${date_w}.txt
# elif (( $dataset == 2 ));then
# /bin/mv obsoul.txt obsoul_synop_${date_w}.txt
# fi
else
print "\n\t dfile = $dfile \t Does not exist"
......
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