#!/bin/sh
set -e

#                  meanvar             gjb., rl, sk - oct 11/00 - rewrite for new timavg
#   ---------------------------------- calculate time average of x and 
#                                      temporal variance x"x".
#
#   Usage: meanvar x  tx txp2 [xp]
#          Input file:
#            x    ($1) = gridded (multi-level) data. 
#          Output files:
#            tx   ($2) = time average of x,
#            txp2 ($3) = time average of (x-tx)**2,
#            xp   ($4) = (optional) deviations from the time mean (x-tx).
#
#   This script is obsolete. 'timavg' should be used instead.

      if [ $# -eq 3 ]; then
ccc	timavg $1 $2 _ $3
      elif [ $# -eq 4 ]; then
ccc	timavg $1 $2 $4 $3
      else
	echo "meanvar: invalid number of arguments."; 
	exit -1; 
      fi
#   ................................................................... meanvar
