#!/bin/csh -f

set region = $1
set infile = $2
set obsfile = $3
set wrkdir = $4
set outfile = $5

ncks -A -v time_bound $infile $obsfile
ncdiff $infile $obsfile hor_mean_diff.nc
ncrename -v TEMP,TEMP_DIFF -v SALT,SALT_DIFF hor_mean_diff.nc
ncks -A -v TEMP_DIFF,SALT_DIFF hor_mean_diff.nc $infile
mv $infile $outfile

