#!/bin/sh -e

EXPLIST='warmArcticSIC1 warmArcticSICSIT1 warmTP1' 
EXPCONT=control

for EXP in $EXPLIST
do
	for FILE in `ls *.nc`
	do
		if [ `echo $FILE | cut -d_ -f2` == $EXP ]
		then 
			FILEDIFF=`echo $FILE | sed "s/$EXP/${EXP}-${EXPCONT}/"`
			FILECONT=`echo $FILE | sed "s/$EXP/${EXPCONT}/"`
			if [ ! -e $FILEDIFF ]
			then
				ncdiff -O $FILE $FILECONT $FILEDIFF
			fi
		fi
	done
done 

