From 767a58be424b956884ce5d3199ce3f894be0ea4b Mon Sep 17 00:00:00 2001 From: Joachim Meyer Date: Tue, 14 Jun 2022 08:55:33 -0600 Subject: [PATCH] Scripts - HRRR - Use tmp file for merging DSWRF The GRIB driver implementation in GDAL does not like streamed input from stdin. Hence the switch to a temporary file. https://github.com/OSGeo/gdal/issues/5912 --- scripts/HRRR/dswrf_for_ERW.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/HRRR/dswrf_for_ERW.sh b/scripts/HRRR/dswrf_for_ERW.sh index ef55fec6..1e69a9b3 100755 --- a/scripts/HRRR/dswrf_for_ERW.sh +++ b/scripts/HRRR/dswrf_for_ERW.sh @@ -22,12 +22,18 @@ combine_day() { echo $DAY pushd $DAY > /dev/null - cat ${HRRR_PATTERN} | wgrib2 - -match "DSWRF:surface" -grib - | \ + TMP_FILE="${DAY}_f06.grib2" + + cat ${HRRR_PATTERN} | wgrib2 - -match "DSWRF:surface" -grib $TMP_FILE + dswrf_for_day --topo "${TOPO_FILE}" \ + --hrrr_in ${TMP_FILE} \ --nc_out "${NC_OUT_PREFIX}_${DAY}.hrrr.dswrf.nc" + rm $TMP_FILE popd > /dev/null } export -f combine_day parallel --jobs ${OMP_NUM_THREADS} combine_day ::: ${2} +