c-----Program to produce a utm for a given lat, lon pair c Modified from utm2lat, to take input from the command line with getarg common /consts/ PI, FOURTHPI, deg2rad, rad2deg common /ellipses/ ellipsnum(24), ellipsname(24), ell_eqrad(24), ell_eccsq(24) integer ellipsnum character*20 ellipsname real*8 ell_eqrad real*8 ell_eccsq real*8 PI real*8 FOURTHPI real*8 deg2rad real*8 rad2deg real*8 Lat real*8 Long real*8 UTMNorthing real*8 UTMEasting real*8 topo integer RefEllipsoid character UTMZone integer ZoneNumber character*80 cZoneNumber call constants c c 24 is WGS-84. c RefEllipsoid = 24 c c get values from command line c narg = iargc() if(narg.lt.2) then write(*,'(a)')' ' write(*,'(a)') & 'Usage: utm2geo ZoneNumber Zone < file.NEz > file.llz' write(*,'(a)') & ' ZoneNumber - eg 11 for SoCal' write(*,'(a)') & ' Zone - eg S for SoCal' write(*,'(a)') & ' sdtin: Northing(m) Easting(m) topo' write(*,'(a)') & ' sdtout: Lat [-90,90], Long [-180,180], topo' write(*,'(a)') write(*,'(a)') stop else call getarg(1,cZoneNumber) call getarg(2,UTMZone) read(cZoneNumber,*)ZoneNumber endif c c process all the data c 10 read(*,*,end=999)UTMEasting,UTMNorthing,topo call utmtoll(RefEllipsoid, UTMNorthing, UTMEasting, UTMZone, & Lat, Long, ZoneNumber) write(*,101)Long,Lat,topo 101 format(2f12.7,f9.2) go to 10 999 stop end