#!/bin/ksh
# Execute: concatenate_onehour.ksh 20130803 20130804 BOIA_RS 00
date_ini=$1
date_fim=$2
station=$3
hour_fcst=$4

dir_func=/scratchin/grupos/oceano/rosio.camayo/validation/functions
dir_data=/scratchout/grupos/oceano/rosio.camayo/validation/validate_pesq/d-input/d-mod_vs_obs/
file_out=$dir_data/all/mod_obs_${station}_${date_ini}_${date_fim}_${hour_fcst}

date_atual=$date_ini

rm -f $file_out

while [[ $date_atual -le $date_fim ]] ; do

cat $dir_data/${station}/${date_atual}00/mod_obs_${station}_${date_atual}00_${hour_fcst} >> $file_out

date_atual=$(${dir_func}/faz_data ${date_atual}00 24 | cut -b 1-8)

done
