	# This script reads the zone operation file "$1"
	# and writes it as zone $2 onto the blackboard
	# Last changes: 20/6/91
nz=$2
{
while(true)
do
        read line
        [ X"$line" = X ]  &&  exit
        echo $line | awk -F, '{ print $1 $2 $3 $4 $5 $6 $7 }'
done
} <$1 | {
read line
echo "u_cpt	z_name	kb_set	$nz	$line"
read nc line
echo $nz $nc $line | awk '{	print "u_cpt	u_control_type_n	user_set	"$1"	"$2
 			print "u_cpt	upper_control_limit	user_set	"$1"	"$3
			print "u_cpt	lower_control_limit	user_set	"$1"	"$4
		      }'
if test X${nc} != X0
then
	read line
	echo $nz $line | awk '{ print "u_cpt	lower_infiltration	user_set	"$1"	"$2
				print "u_cpt	lower_zone_coupled	user_set	"$1"	"$3
				print "u_cpt	lower_couple_index_d1	user_set	"$1"	"$4
				print "u_cpt	lower_couple_index_d2	user_set	"$1"	"$5
			     }' 
	read line
	echo $nz $line | awk '{ print "u_cpt	upper_infiltration	user_set	"$1"	"$2
				print "u_cpt	upper_zone_coupled	user_set	"$1"	"$3
				print "u_cpt	upper_couple_index_d1	user_set	"$1"	"$4
				print "u_cpt	upper_couple_index_d2	user_set	"$1"	"$5
			     }' 
fi
read na
echo "u_cpt	num_a	user_set	$nz	weekday	$na"
if test X${na} != X0
then
	index_i=0
	while index_i=` expr ${index_i} + 1 ` || true  &&  [ $index_i -le ${na} ] 
	do
	  read line
	  echo $nz $index_i $line | awk '{ print "u_cpt	u_start	user_set	"$1"	weekday	"$2"	"$3
					   print "u_cpt	u_end	user_set	"$1"	weekday	"$2"	"$4
					   print "u_cpt	infiltration	user_set	"$1"	weekday	"$2"	"$5
				 	   print "u_cpt	zone_coupled	user_set	"$1"	weekday	"$2"	"$6
					   print "u_cpt	couple_index_d1	user_set	"$1"	weekday	"$2"	"$7
					   print "u_cpt	couple_index_d2	user_set	"$1"	weekday	"$2"	"$8
					 }' 
	done
	
fi
read na
echo "u_cpt	num_a	user_set	$nz	saturday	$na"
if test X${na} != X0
then
	index_i=0
	while index_i=` expr ${index_i} + 1 ` || true  &&  [ $index_i -le ${na} ] 
	do
	  read line
	  echo $nz $index_i $line | awk '{ print "u_cpt	u_start	user_set	"$1"	saturday	"$2"	"$3
					   print "u_cpt	u_end	user_set	"$1"	saturday	"$2"	"$4
					   print "u_cpt	infiltration	user_set	"$1"	saturday	"$2"	"$5
					   print "u_cpt	zone_coupled	user_set	"$1"	saturday	"$2"	"$6
					   print "u_cpt	couple_index_d1	user_set	"$1"	saturday	"$2"	"$7
					   print "u_cpt	couple_index_d2	user_set	"$1"	saturday	"$2"	"$8
					 }' 
	done
	
fi
read na
echo "u_cpt	num_a	user_set	$nz	sunday	$na"
if test X${na} != X0
then
	index_i=0
	while index_i=` expr ${index_i} + 1 ` || true  &&  [ $index_i -le ${na} ] 
	do
	  read line
	  echo $nz $index_i $line | awk '{ print "u_cpt	u_start	user_set	"$1"	sunday	"$2"	"$3
					   print "u_cpt	u_end	user_set	"$1"	sunday	"$2"	"$4
					   print "u_cpt	infiltration	user_set	"$1"	sunday	"$2"	"$5
					   print "u_cpt	zone_coupled	user_set	"$1"	sunday	"$2"	"$6
					   print "u_cpt	couple_index_d1	user_set	"$1"	sunday	"$2"	"$7
					   print "u_cpt	couple_index_d2	user_set	"$1"	sunday	"$2"	"$8
					 }' 
	done
	
fi
read na
echo "u_cpt	num_c	user_set	$nz	weekday	$na"
if test X${na} != X0
then
	index_i=0
	while index_i=` expr ${index_i} + 1 ` || true  &&  [ $index_i -le ${na} ] 
	do
	  read line
	  echo $nz $index_i $line | awk '{ print "u_cpt	c_gain_type	user_set	"$1"	weekday	"$2"	"$3
					   print "u_cpt	c_start	user_set	"$1"	weekday	"$2"	"$4
					   print "u_cpt	c_end	user_set	"$1"	day	"$2"	"$5
					   print "u_cpt	c_sensible	user_set	"$1"	weekday	"$2"	"$6
					   print "u_cpt	c_latent	user_set	"$1"	weekday	"$2"	"$7
					   print "u_cpt	c_radiant	user_set	"$1"	weekday	"$2"	"$8
					   print "u_cpt	c_convective	user_set	"$1"	weekday	"$2"	"$9
					  }' 
	done
	
fi
read na
echo "u_cpt	num_c	user_set	$nz	saturday	$na"
if test X${na} != X0
then
	index_i=0
	while index_i=` expr ${index_i} + 1 ` || true  &&  [ $index_i -le ${na} ] 
	do
	  read line
	  echo $nz $index_i $line | awk '{ print "u_cpt	c_gain_type	user_set	"$1"	saturday	"$2"	"$3
					   print "u_cpt	c_start	user_set	"$1"	saturday	"$2"	"$4
					   print "u_cpt	c_end	user_set	"$1"	saturday	"$2"	"$5
					   print "u_cpt	c_sensible	user_set	"$1"	saturday	"$2"	"$6
					   print "u_cpt	c_latent	user_set	"$1"	saturday	"$2"	"$7
					   print "u_cpt	c_radiant	user_set	"$1"	saturday	"$2"	"$8
					   print "u_cpt	c_convective	user_set	"$1"	saturday	"$2"	"$9
					 }' 
	done
	
fi
read na
echo "u_cpt	num_c	user_set	$nz	sunday	$na"
if test X${na} != X0
then
	index_i=0
	while index_i=` expr ${index_i} + 1 ` || true  &&  [ $index_i -le ${na} ] 
	do
	  read line
	  echo $nz $index_i $line | awk '{ print "u_cpt	c_gain_type	user_set	"$1"	sunday	"$2"	"$3
					   print "u_cpt	c_start	user_set	"$1"	sunday	"$2"	"$4
					   print "u_cpt	c_end	user_set	"$1"	sunday	"$2"	"$5
					   print "u_cpt	c_sensible	user_set	"$1"	sunday	"$2"	"$6
					   print "u_cpt	c_latent	user_set	"$1"	sunday	"$2"	"$7
					   print "u_cpt	c_radiant	user_set	"$1"	sunday	"$2"	"$8
					   print "u_cpt	c_convective	user_set	"$1"	sunday	"$2"	"$9
					 }' 
	done
	
fi
}
