CLOSE,11 OPENR,11,'mom_file_list.dat' nfiles=700 file_array=STRARR(nfiles) ifile=0 filename=' ' WHILE(NOT EOF(11)) DO BEGIN READF,11,filename file_array(ifile)=filename ifile=ifile+1 ENDWHILE file_array=file_array(0:ifile-1) nfiles=ifile CLOSE,11 lab = ' ' ionlabel=' ' date = ' ' strttime = ' ' stptime = ' ' xx = 0.0 yy = 0.0 zz = 0.0 re = 0.0 lsh = 0.0 mlt = 0.0 mlat = 0.0 invlat = 0.0 dec = 0.0 rac = 0.0 maz = 0.0 mel = 0.0 sp = 0.0 d1 = 0.0 v1 = 0.0 v2 = 0.0 v3 = 0.0 vg1 = 0.0 vg2 = 0.0 vg3 = 0.0 t1 = 0.0 t2 = 0.0 t3 = 0.0 mss = 0 tst = 0 pst = 0 amu = 0 moq = 0 mnth = 0 day = 0 year = 0 hh1 = 0 mm1 = 0 ss1 = 0 hh2 = 0 mm2 = 0 ss2 = 0 close,1 openw,1,'H+_polarwind_vd.dat' close,4 openw,4,'He+_polarwind_vd.dat' close,16 openw,16,'O+_polarwind_vd.dat' for ii=0,nfiles-1 do begin close,11 openr,11,file_array(ii) print,'opened: ',file_array(ii) ncnt=0 icnt=0 skipthis=' ' ionlab=' ' FOR jj=0,2 DO BEGIN READF,11,skipthis ENDFOR READF,11,ionlab ion=0 IF ionlab EQ 'Stops(H+)' THEN ion=1 IF ionlab EQ 'Stops(He+)' THEN ion=4 IF ionlab EQ 'Stops(O+)' THEN ion=16 FOR jj=0,21 DO BEGIN READF,11,skipthis ENDFOR WHILE(NOT EOF(11)) DO BEGIN READF,11,format="(a16,6(i2,1x),a3,3(i2,1x))", $ skipthis,mnth,day,year,hh1,mm1,ss1,skipthis,hh2,mm2,ss2 READF,11,skipthis READF,11,skipthis READF,11,format="(a4,f7.4)",skipthis,re READF,11,format="(a7,f8.3)",skipthis,lsh READF,11,format="(a4,f5.1)",skipthis,mlt READF,11,format="(a5,f8.3)",skipthis,mlat READF,11,format="(a7,f8.3)",skipthis,ilat READF,11,skipthis READF,11,skipthis READF,11,skipthis READF,11,skipthis READF,11,format="(a8,f8.2)",skipthis,sp READF,11,skipthis READF,11,skipthis IF skipthis NE ' ' THEN READF,11,skipthis READF,11,format="(a4,e9.2)",skipthis,den READF,11,format="(a7,e9.2)",skipthis,tpara READF,11,format="(a7,e9.2)",skipthis,tperp READF,11,format="(a6,e9.2)",skipthis,vx READF,11,format="(a6,e9.2)",skipthis,vy READF,11,format="(a6,e9.2)",skipthis,vz READF,11,skipthis READF,11,skipthis READF,11,skipthis IF (NOT EOF(11)) THEN READF,11,skipthis IF (NOT EOF(11)) THEN READF,11,skipthis icode=2 IF (tperp GT tpara*1.75) THEN icode=1 IF (den LT 0.75) THEN icode=0 IF ABS(den) LT 1.e20 THEN printf,ion, $ format="(3(3i2.2,1x),2(1x,i2),1x,f8.3,6(1x,E14.6),5(1x,f10.4))", $ mnth,day,year,hh1,mm1,ss1,hh2,mm2,ss2,$ ion, icode,$ sp, den, vx, vy, vz, tpara, tperp, $ re, lsh, mlt, mlat, ilat endwhile close,11 endfor close,1 close,14 close,16 end