The -alarm N option terminates wgrib2 after N seconds (real time).
For example, you may want to use -alarm to kill a
wgrib2 job that running too long on a web server (grib_filter).
The code for -alarm is SVr4, BSD, POSIX-1-2001 and IEEE Std 1003.1-2001
compatible. The code also supported by the Cygwin system for Windows systems. The
-alarm will need to be disabled in the makefile for non-compatible systems.
(Change DISABLE_ALARM=0 to DISABLE_ALARM=1 in the makefile.)
The current version of -alarm simply terminates
the process. This heavy-handed action may not be an ideal action for programs that
directly call the wgrib2 subroutine. For these situations, the alarm
should be set up by the main program so that a more appropriate action can
The -alarm option is a
replacement for -limit which limits
the number of (sub)messages that are processed. Jobs on
web servers may hang because of problems with the network
connections which will never trigger the
N is an integer from 0..65536 (ISO C standard)
N = 0 will remove any pending alarm
The -alarm option is a setup/init option. So
the alarm is activated in the setup phase, cannot altered in the data
processing phase and is not removed the finalize phase.
See also: -quit,