gmerge.c gmerge will merge N files (or pipes) containing grib-2 files. The intended use is to allow wgrib2 to mult-task on N processors. example script converts a file to jpeg packing on 4 cpus (if available) ------------------------------------------------------------------------------------ #!/bin/sh set -x f=$1 rm /tmp/p1 rm /tmp/p2 rm /tmp/p3 rm /tmp/p4 mkfifo /tmp/p1 mkfifo /tmp/p2 mkfifo /tmp/p3 mkfifo /tmp/p4 wgrib2 -flush $f -set_grib_type jpeg -grib_out /tmp/p1 -for_n 1::4 >/dev/null & wgrib2 -flush $f -set_grib_type jpeg -grib_out /tmp/p2 -for_n 2::4 >/dev/null & wgrib2 -flush $f -set_grib_type jpeg -grib_out /tmp/p3 -for_n 3::4 >/dev/null & wgrib2 -flush $f -set_grib_type jpeg -grib_out /tmp/p4 -for_n 4::4 >/dev/null & gmerge $f.g2 /tmp/p1 /tmp/p2 /tmp/p3 /tmp/p4 ------------------------------------------------------------------------------------ Comments: I used pipes rather than files in order to run the merging and creation at the same time and to avoid using disks. jpeg2000 process is CPU bound and the script runs much faster on a 32-cpu node.