[Fortran] 纯文本查看 复制代码
PROGRAM MAIN
IMPLICIT NONE
INTEGER::STATUS REAL::RANGENORTH,RANGEWEST,RANGESOUTH,RANGEEAST
REAL::LAT,LON,VALUE
OPEN(UNIT=1201501,FILE="gsmap_mvk_v52221_20070101_daily_p12Z-11Z_01_AsiaEE.csv")
OPEN(UNIT=1201502,FILE="RANGE.TXT")
OPEN(UNIT=2201501,FILE="20070101.TXT")
READ(1201501,*)
READ(1201502,*)RANGENORTH,RANGEWEST,RANGESOUTH,RANGEEAST
DO
READ(1201501,*,IOSTAT=STATUS)LAT,LON,VALUE
IF(STATUS/=0)EXIT
IF(LAT<=RANGENORTH.AND.LAT>=RANGESOUTH.AND.LON>=RANGEWEST.AND.LON<=RANGEEAST)THEN
WRITE(2201501,'(3F10.2)')LON,LAT,VALUE
END IF
END DO
END PROGRAM MAIN