head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	2011.01.07.17.21.30;	author strandwg;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@#!/bin/csh -f
#
# Calculate annave
#
if ("$#argv" == 0) then
  echo "Usage: annave file"
  exit 1
else if ("$#argv" == 1) then
  set file = $argv[1]
else
  echo "Usage: annave file"
  exit 1
endif
#
set nt = `ncdump -h $file | egrep "LIM" | cut -d"(" -f2 | cut -d" " -f1`
set of = AA.${file}
#
set t0 =  1
set t1 = 12
set ct =  1
#
while ( $t0 < $nt )
  if ($ct <= 9)   set ts = "00$ct"
  if ($ct >= 10)  set ts = "0$ct"
  if ($ct >= 100) set ts = "$ct"
  ncra -O -F -d time,$t0,$t1 ${file} ${ts}.${file}
  @@ ct = $ct +  1
  @@ t0 = $t1 +  1
  @@ t1 = $t0 + 11
end
#
ncrcat -O ???.${file} $of
if ($status == 0) then
  rm -f ???.${file}
  echo $of" completed"
endif
#
exit
@
