program convert_lat_lon
implicit none
integer :: stat,lata,lona,latb,lonb
character :: station*6
real*8 :: lat,latc,lon,lonc
open (11,file="dbar.txt")
open (22,file="dbar_out.txt")
stat=0
do while (stat==0)
read (11,100,iostat=stat) station,lata,latb,latc,lona,lonb,lonc
100 format (a6,7x,i3,1x,i2,2x,f3.1,3x,i2,1x,i2,2x,f3.1)
if (stat/=0) exit
lat=(lata+(latb/60)+(latc/3600.0000))
lon=(lona+(lonb/60)+(lonc/3600.0000))
write (22,"(a6,3x,f12.8,3x,f11.8)") station,lat,lon
end do
end program
31.28 KB, 下载次数: 2
vvt 发表于 2014-9-8 18:37
100 format (a6,7x,i3,1x,i2,2x,f3.1,3x,i2,1x,i2,2x,f3.1)
修改为
100 format (a6,7x,i3,2x,i2,2x,f4.1,6x ...
C0A980 121.01138889 25.01138889
C0A990 121.01563889 25.00841667
C0A9A0 121.00138889 25.01305556
C0A9B0 121.00588889 25.00091667
C0A9C0 121.01222222 25.00277778
C0A9E0 121.01166667 25.00888889
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |