program mergetopo c c Program by John Boursy, November 1982. c c This program is designed to merge the individual files containing c the compressed data for the topographic data base into a single c file. These files are still sequential. c parameter (maxwds=1800) ! max # of words per record dimension ibuff(maxwds) integer out/13/ integer pout/6/ character*10 file c c ****************************************************************** c c The following statement is the first executable statement. c c ****************************************************************** c call ptime(0,pout) c write (pout,801) 801 format ('0Welcome to Mergetopo') i=0 maxwd=0 c open (unit=out,status='new',form='unformatted',recl=1805, 2 recordtype='variable',iostat=iostat,err=3000) c do 100 loop=18,84,1 intopo=loop write (file,810) intopo 810 format ('for0'i2.2,'.dat') open (unit=intopo,status='old',iostat=iostat,err=90, 2 access='sequential',file=file,organization='sequential', 3 recordtype='variable',form='unformatted') write (pout,803) file,intopo 803 format (' File ',a10,'; Unit',i3,' is open') c rewind intopo 10 continue read (intopo,iostat=iostat,err=4000,end=95) key,idesc, 2 ibias,iword,(ibuff(loop2),loop2=1,iword,1) if (iword.gt.maxwd) maxwd=iword i=i+1 write (out,iostat=iostat,err=5000) key,idesc,ibias,iword, 2 (ibuff(loop2),loop2=1,iword,1) go to 10 c 90 continue write (pout,802) file,intopo,iostat 802 format (' *** Status in failing to open file ',a10,'; unit',i3, 2 ' is',i4) go to 100 c 95 continue close (intopo) 100 continue write (pout,811) i,maxwd 811 format (i10,' records written to output file',/, 2 i10,' is maximum number of words in any single record') c call ptime(1,pout) c stop c 3000 continue c We are here if we have failed to open the output file. write (pout,804) out,iostat 804 format ('0*** Failure to open output unit',i3,'; status is',i4) stop c 4000 continue c We are here if we have an error in reading the input file. write (pout,805) intopo,iostat 805 format ('0*** Failure in reading input unit',i3,'; status is',i4) if (iostat.eq.67) write (pout,807) iword 807 format (i12,' words') stop c 5000 continue c We are here if we have an error in writing the output file. write (pout,806) out,iostat 806 format ('0*** Failure in writing output unit',i3,'; status is',i4) stop end