Skip to content

Commit

Permalink
Scripts - HRRR - Use tmp file for merging DSWRF
Browse files Browse the repository at this point in the history
The GRIB driver implementation in GDAL does not like streamed input
from stdin. Hence the switch to a temporary file.

OSGeo/gdal#5912
  • Loading branch information
jomey committed Jun 14, 2022
1 parent 09aff02 commit 767a58b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/HRRR/dswrf_for_ERW.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}

0 comments on commit 767a58b

Please sign in to comment.