program climate
implicit none
!声明变量
real::lon,lon1
real::lat,lat1
real(kind=8)::dataa,dataa1
integer::status1=0
integer::i,j
!读取
OPEN(11,file='2013.txt',status='old')
OPEN(12,file='2014.txt',status='old')
OPEN(13,file='new2014.txt',status='replace')
do j =1,4189,1
READ(11,*,iostat=status1)lon,lat,dataa
if(status1/=0)exit
do i =1,4548,1
READ(12,*,iostat=status1)lon1,lat1,dataa1
if(lat/=lat1.OR.lon/=lon1) cycle
write(*,*)lon1,lat1,dataa1
write(13,*)lon1,lat1,dataa1
if(status1/=0)exit
end do
end do
CLOSE(11)
CLOSE(12)
CLOSE(13)
end program climate
climate.png (3.12 KB, 下载次数: 251)
program climate
implicit none
!声明变量
real::lon,lon1
real::lat,lat1
real(kind=8)::dataa,dataa1
integer::status1=0
integer::i,j
!读取
OPEN(11,file='2013.txt',status='old')
OPEN(12,file='2014.txt',status='old')
OPEN(13,file='new2014.txt',status='replace')
do j =1,4189,1
READ(11,*,iostat=status1)lon,lat,dataa
if(status1/=0)exit
do i =1,4548,1
READ(12,*,iostat=status1)lon1,lat1,dataa1
if(status1/=0)exit !************************
if(abs(lat-lat1)+abs(lon-lon1)>1.0e-6) cycle !************************
write(*,*)lon1,lat1,dataa1
write(13,*)lon1,lat1,dataa1
end do
rewind(12) !************************
end do
CLOSE(11)
CLOSE(12)
CLOSE(13)
end program climate
li913 发表于 2020-5-27 22:13
[mw_shl_code=fortran,true]program climate
implicit none
欢迎光临 Fortran Coder (http://bbs.fcode.cn/) | Powered by Discuz! X3.2 |