Skip to content
Snippets Groups Projects
Commit d472006a authored by Michael Langguth's avatar Michael Langguth
Browse files

Add final merging step to get_era5_forecasts.sh.

parent e4345740
No related branches found
No related tags found
No related merge requests found
Pipeline #105857 failed
...@@ -50,18 +50,21 @@ for hh in ${hh_list[@]}; do ...@@ -50,18 +50,21 @@ for hh in ${hh_list[@]}; do
ncrename -O -d time,fcst_hour -v time,fcst_hour ${outfile} ${outfile} ncrename -O -d time,fcst_hour -v time,fcst_hour ${outfile} ${outfile}
ncap2 -O -s 'fcst_hour=int(fcst_hour)' ${outfile} ${outfile} ncap2 -O -s 'fcst_hour=int(fcst_hour)' ${outfile} ${outfile}
# add ground truth data and persistence forecast from trained model # add ground truth data and persistence forecast from trained model
patt=${indir_ref}/vfp_date_${date1}${hh0}_sample_ind*.nc patt=${indir_ref}/vfp_date_${date1}${hh0}_sample_ind*.nc
if ls $patt 1>/dev/null 2<&1; then if ls $patt 1>/dev/null 2<&1; then
file_src=`ls $patt` file_src=`ls $patt`
ncks -d fcst_hour,5,11 -v 2t_ref,2t_persistence_fcst -A ${file_src} ${outfile} ncks -d fcst_hour,5,11 -v 2t_ref,2t_persistence_fcst -A ${file_src} ${outfile}
else else
echo "Could not find reference data for ${date2}..." echo "Could not find reference data for ${date2}..."
mv ${outfile} "${oufile/.nc/_ref_miss.nc}" mv ${outfile} "${oufile/.nc/_ref_miss.nc}"
fi fi
date1="$(date -u --date="$date1 tomorrow" '+%Y%m%d')" date1="$(date -u --date="$date1 tomorrow" '+%Y%m%d')"
date2="$(date -u --date="$date2 tomorrow" '+%Y-%m-%d %H:%M:00')" date2="$(date -u --date="$date2 tomorrow" '+%Y-%m-%d %H:%M:00')"
done done
done done
# finally merge all data into a single file
cdo -v mergetime ${outdir}/*_allfc.nc ${outdir}/${yr}_era5_short_range_fcst
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment