c Plouff, 12-88 character*8 dent,stamint,stamaxt,staming,stamaxg character*65 jfile logical exists print 200 200 format (' Program to print range of geographic coordinates in a', 1 ' plouff-format file.') print 201 201 format (' TYPE the name of your file:') read 565, jfile 565 format (a65) inquire (file=jfile,exist=exists) if (.not. exists) then print 300 300 format (' That file does not exist. Try once more.') print 201 read 565, jfile inquire (file=jfile,exist=exists) if (.not. exists) then print 301 301 format (' **STOP. That file does not exist.') stop end if end if c Okay to write on top of previous run; can repeat. open (15,file='GEOGRANGE.PNT',form='formatted',status='unknown') write (15,200) write (15,202) jfile 202 format (1x,a65) open (10,file=jfile,form='formatted',status='old',blank='zero') n=0 c Read first station outside loop, to save 2 if's inside read (10,101,err=77) dent,ltd,ltm,lnd,lnm 101 format (bz,a8,1x,i2,i4,1x,i3,i4) n=1 c Coordinates in units of 0.01 minute lt=6000*ltd+ltm ln=6000*lnd+lnm minlt=lt minln=ln maxlt=lt maxln=ln stamaxt=dent stamint=dent stamaxg=dent staming=dent 3 read (10,101,err=77,end=9) dent,ltd,ltm,lnd,lnm n=n+1 lt=6000*ltd+ltm if (lt .gt. maxlt) then maxlt=lt stamaxt=dent go to 4 end if if (lt .lt. minlt) then minlt=lt stamint=dent end if 4 ln=6000*lnd+lnm if (ln .gt. maxln) then maxln=ln stamaxg=dent go to 3 end if if (ln .lt. minln) then minln=ln staming=dent end if go to 3 77 np=n+1 print 600, np write (15,600) np 600 format (' ***STOP. Format error on line',i5,' in file.') go to 99 9 minltd=minlt/6000 tmin=0.01*(minlt-6000*minltd) minlnd=minln/6000 gmin=0.01*(minln-6000*minlnd) maxltd=maxlt/6000 tmax=0.01*(maxlt-6000*maxltd) maxlnd=maxln/6000 gmax=0.01*(maxln-6000*maxlnd) print 204, n,minltd,tmin,stamint,maxltd,tmax,stamaxt,minlnd, 1 gmin,staming,maxlnd,gmax,stamaxg write (15,204) n,minltd,tmin,stamint,maxltd,tmax,stamaxt,minlnd, 1 gmin,staming,maxlnd,gmax,stamaxg 204 format (' Total stations in file is',i7,/,' Minimum latitude ', 1 'is',i4,'D',f6.2,'M at station ',a8,/,' Maximum latitude is', 2 i4,'D',f6.2,'M at station ',a8,/,' Minimum longitude is',i4,'D', 3 f6.2,'M at station ',a8,/,' Maximum longitude is',i4,'D',f6.2, 4 'M at station ',a8) print 209 209 format (' Print file GEOGRANGE.PNT for a record of these ', 1 'results.') 99 close(10) close(15) stop end