#! /bin/csh -f

# Determine if this is a leap year or not.
# Also, determine if last year was a leap year or not.
#
@ yr = 1987
while ($yr <= 1995)
rm -rf list_??? grmean.out namlpre.data
##setenv S /work/03447/akmishra/RCM-CLD2/libs/etc
##setenv O /scratch/03447/akmishra/RSM_ROMS/CPL-CLD/$yr
##setenv D /scratch/03447/akmishra/RSM_ROMS/CPL-CLD/$yr

setenv S /Net/elninost4/amishra/RSM/libs/etc
setenv D /Net/water/amishra/RSM_ROMS/MONSOON10km/RCM-CLD2/STAMPEDE/O/$yr/Daily
setenv O /Net/water/amishra/RSM_ROMS/MONSOON10km/RCM-CLD2/STAMPEDE/O/mon


@ loop = 1
while ($loop <= 12)
setenv mon `echo $loop | awk '{printf("%02d", $1)}'`
echo 'Making monthly mean using daily mean file for the month ' $mon >> synopsis_$yr

ncra ${D}/ocean_avg.$yr$mon[0123]?.nc ${O}/ocean_avg.$yr$mon.nc


   @ loop = $loop + 1
end
@ yr = $yr + 1
end
exit

