#!/bin/csh -f
# merrill.olm.net:$MDOCS/demp/nickel_to_cl4.csh 4/22/96
# convert NICKEL format to RLInt CL4 format
# $1 = input NICKEL file
#	header line: x0,y0,scale,xmin,xmax,ymin,ymax
# $2 = input population file (four geocodes and population)
#	format: 4 geocodes,pop
# $3 = input POINTS file
#	header line: x0,y0,scale,xmin,xmax,ymin,ymax
#	format: x,y,type,series,seq
# $4 = output CL4 file
# example:
#	rlogin merrill.olm.net -l merrill
#	cd $MDOCS
#	cl4_test.csh

#rm fort.* # debug only
echo 41 >fort.1 # one-line level indicator

cat $1 >fort.2 # input nickel file

cat $2 >>fort.3 # input population file

cat $3 >fort.8 # input points file
perl -e 'print "-999999 -999999 -999999 -999999 -999999\n"; ' >>fort.3
perl -e 'print "\cZ\n"; ' >>fort.8

nickel_to_cl4.exe # production only
#dbx nickel_to_cl4.exe # debug only

cat fort.4 fort.7 fort.16 >$4 # completed CL4 file
rm fort.* # production only