#!/bin/csh -f

set region = $1
set caseN = $2
set year0 = $3
set year1 = $4
set wrkdir = $5
set outfile = $6

set yr0 = `printf "%04d" $year0`
set yr1 = `printf "%04d" $year1`

set newfile = ${wrkdir}/${region}_hor_mean_${caseN}.${yr0}-${yr1}.nc
ncrcat ${wrkdir}/${region}_hor_mean_${caseN}.pop.h.????.nc ${newfile}

rm -f ${wrkdir}/${region}_hor_mean_${caseN}.pop.h.????.nc

printf "Finished" > $outfile

