program move_direction implicit none integer::num,i,j,h,imn,imx,jmn,jmx,syear,eyear,iyear,smonth,emonth,imonth,ice1,jce1,xst,xen,yst,yen,month1,n,nto,nto2,nmx,nt,nnt,out,nout,nto3,it,itmax,tt integer::xst2,xen2,yst2,yen2,xst3,xen3,yst3,yen3,time,time2,time4,itime,t,tmx,tmn,ntmx,nntmx,trid,trid2,xst1,xen1,yst1,yen1,iit integer::day1,hour1,hmx,hmn,hhmn,hhmx,hmx2,ob,nob,nfs,undef parameter(imx=105,jmx=65,hmx=37,syear=1979,eyear=2016,smonth=3,emonth=5,hmn=1,jmn=1,imn=1,tmn=1,hhmn=1,hhmx=40,hmx2=27,itmax=17,nntmx=200000) real::jlat,jlon,pi,es,ssp,slpup,slplow,lon2,lat2,minslp,hoge real,dimension(nntmx)::ber,dlat,dlon,lon1,lat1 integer,dimension(nntmx)::trid3,time3 real,dimension(imx,jmx,hmx)::u,v,tmp,hgt,dtdx,dtdy,fmag,rh,zeta,vvel,qx,qy,ug,vg,pv,vor real,dimension(jmx)::co,lat real,dimension(imx,jmx,hmx2)::spfh real,dimension(imx,jmx,hhmx)::reh,rehu,rehv,ru,rv,uz,vz real,dimension(-20:20,-20:20,hmx,itmax)::cou,cov,covor,cotmp,cou2,cov2,covor2,cotmp2,cou3,cov3,covor3,cotmp3,covvel,covvel2,covvel3,cohgt,cohgt2,cohgt3,coqx,coqy,coqx2,coqy2,coqx3,coqy3,coug,covg,coug2,covg2,coug3,covg3,copv,copv2,copv3 real,dimension(-20:20,-20:20,hhmx,itmax)::coreh,coreh2,coreh3,corehu,corehu2,corehu3,corehv,corehv2,corehv3,coru,corv,coru2,corv2,coru3,corv3,couz,covz,couz2,covz2,couz3,covz3,vmag,vmag2,vmag3,angle,angle2,angle3 real,dimension(-20:20,-20:20,hmx2,itmax)::cosp,cosp2,cosp3 real,dimension(-20:20,-20:20,itmax)::cowarm,cocold,cosreh,cosreh2,cosreh3,cocape,cocape2,cocape3,cosuz,cosvz,cosuz2,cosvz2,cosuz3,cosvz3,coshearu,coshearv,& comshear,coshearu2,coshearv2,comshear2,coshearu3,coshearv3,comshear3,cocu,cocv,cocu2,cocv2,cocu3,cocv3 real,dimension(-20:20,itmax)::sco3,sco4,sco5 real,dimension(imx,jmx)::cape,cold,warm,sreh,ehi,mdvdz,mlapse,psurf,slp,tmp2m,dep,u10m,v10m,rh2m,sp2m,pt2m,cu,cv,suz,svz,shear_u,shear_v,mshear real::p(hmx)=(/1000., 975., 950., 925., 900., 875., 850., 825., 800., 775., 750., 700., & 650., 600., 550., 500., 450., 400., 350., 300., 250., 225., 200., 175., 150., 125., 100., & 70., 50., 30., 20., 10.,7., 5., 3., 2., 1./) real::mdlon,mdlat,bermax character::mmonth*2,year*4,SEA*3,region*3,CAT*2 logical::fast SEA='MAM' region='USA' CAT='AO' do i=1,3 if(i.eq.1) then SEA='MAM' elseif(i.eq.2) then SEA='SON' else SEA='DJF' endif do iyear=syear,eyear write(year,'(i4)') iyear open(26,file='./EC_TRACK/'//year//''//SEA//''//CAT//'_track_EC_'//region//'_20W',status='old',form='formatted') open(27,file='./EC_TRACK/'//year//''//SEA//''//CAT//'_movement_EC_'//region//'_20W',status='unknown',form='formatted') num=0 do n=1,nntmx read(26,*,end=130) lon1(n),lat1(n),time3(n),trid3(n),ber(n) write(6,*) lon1(n),lat1(n),time3(n),trid3(n),ber(n) num=num+1 enddo 130 continue do n=1,num if(lon1(n).eq.0) then write(27,*) 0,0,0,0,0 elseif(n.ge.2.and.lon1(n-1).eq.0) then dlat(n)=lat1(n+1)-lat1(n) dlon(n)=lon1(n+1)-lon1(n) write(27,*) dlon(n),dlat(n),time3(n),trid3(n),ber(n) !calculate move direction !do n = num !enddo ! !calculate moving speed elseif(n.ge.2.and.lon1(n+1).eq.0) then dlat(n)=lat1(n)-lat1(n-1) dlon(n)=lon1(n)-lon1(n-1) write(27,*) dlon(n),dlat(n),time3(n),trid3(n),ber(n) !calculate moving speed else dlat(n)=lat1(n+1)-lat1(n-1) dlon(n)=lon1(n+1)-lon1(n-1) write(27,*) dlon(n),dlat(n),time3(n),trid3(n),ber(n) !calculate moving speed endif enddo enddo !year loop enddo !SEA loop endprogram move_direction