program detect_TC_track Implicit none Character*4:: cyr="2013" Integer,parameter:: nfile=60 Character*50:: cfile Character*100:: idir Real,parameter:: min_lon=100.0, max_lon=180, min_lat=0, max_lat=40 Real:: tmp, lon, lat, wind Real,dimension(100,1000):: tc_lon, tc_lat, tc_wind Integer,dimension(100,1000):: tc_day, tc_mon, tc_year,tc_hour Integer,dimension(100):: nstep Real,parameter:: rmis=-99.0 Integer:: day, mon, hour Real, parameter:: wind_threshold=10.8 Integer:: flag, itmp, tc_tmp, ntc_tmp Integer,dimension(100):: TC_flag Integer,dimension(100):: TC_nstep Integer:: istep, ntc tc_year=2013 tc_lon=rmis tc_lat=rmis tc_wind=rmis idir="/work/users/hapt/for_First/TC_track/" itmp=0 flag=0 TC_flag=0 tc_tmp=0 TC_nstep=0 ntc=0 !Open(3,file=trim(cyr)//"_TCs.txt",status="unknown") Open(1,file="TC_"//trim(cyr)//".list",status="unknown") tc_tmp=0 Do while (.TRUE.) Read(1,*,end=10) cfile Open(2,file=trim(idir)//trim(cfile),status="unknown") tc_tmp=tc_tmp+1 !write(*,*) trim(idir)//trim(cfile) Read(2,*) Read(2,*) Read(2,*) TC_nstep(tc_tmp)=0 itmp=0 Do while (.TRUE.) Read(2,*,end=11) tmp, lat, lon, mon, day, hour, wind wind=wind*0.514 itmp=itmp+1 tc_lon(tc_tmp,itmp)=lon tc_lat(tc_tmp,itmp)=lat tc_wind(tc_tmp,itmp)=wind tc_day(tc_tmp,itmp)=day tc_mon(tc_tmp,itmp)=mon tc_hour(tc_tmp,itmp)=hour If (wind.ge.wind_threshold) then If (min_lon.le.lon.and.lon.le.max_lon) then If (min_lat.le.lat.and.lat.le.max_lat) then If (TC_flag(tc_tmp).eq.0) then TC_flag(tc_tmp)=1 ntc=ntc+1 End if End if End if End if End do 11 Close(2) TC_nstep(tc_tmp)=itmp Write(*,*) tc_tmp, trim(idir)//trim(cfile) End do 10 Close(1) Open(4,file=trim(cyr)//"_TCs.txt",status="unknown") Write(4,*) "TC#; ", ntc itmp=0 Do tc_tmp=1,ntc If (TC_flag(tc_tmp).eq.1) then itmp=itmp+1 Write(4,*) " ---------------------------------- " Write(4,*) "TC#;", itmp Write(4,*) "Num_Obs:", TC_nstep(tc_tmp) Do istep=1,TC_nstep(tc_tmp) Write(4,"2(I2,3x),I4,2x,I4,2x,3(F8.1,2x)") tc_day(tc_tmp,istep),tc_mon(tc_tmp,istep),tc_year(tc_tmp,istep),tc_hour(tc_tmp,istep), tc_lon(tc_tmp,istep), tc_lat(tc_tmp,istep), tc_wind(tc_tmp,istep) End do End if End do Close(4) End