PRO read_rico_sondes ; reads in the name soundings, puts them in an idlsave file fdir='C:\Documents and Settings\krasmussen\My Documents\RICO Project\RICO Raw Data' dates=strarr(400) & lat=fltarr(400) p=fltarr(400,8000) & t=p & rh=p & z=p surfp=fltarr(400) header1=strarr(8) latstr=' ' header2=strarr(26) sonde_string='' usefiles=findfile(fdir+'*.ptu') usefiles=usefiles(sort(usefiles)) FOR i=0,n_elements(usefiles)-1 DO begin openr,6,usefiles[i] ;dates[i]=strmid(usefiles[i],27,8) ;w/ work computer files dates[i]=strmid(usefiles[i],27,8) ;leg2 sondes print,dates[i] readf,6,header1 readf,6,latstr lat[i]=float(strmid(latstr,16,5)) readf,6,header2 j=0 WHILE not(eof(6)) DO begin readf,6,sonde_string temp=float(strmid(sonde_string,29,6)) on_ioerror,next_line press=float(strmid(sonde_string,9,7)) alt=float(strmid(sonde_string,20,5)) rrh=float(strmid(sonde_string,39,3)) p[i,j]=press & t[i,j]=temp & rh[i,j]=rrh z[i,j]=alt if j eq 0 then surfp[i]=press j=j+1 if j gt 7999 then goto,nextfile4 next_line: ENDWHILE nextfile4: close,6 ENDFOR close,6 nsonde=n_elements(usefiles) print,'number of soundings: ',nsonde p=p[0:nsonde-1,*] & z=z[0:nsonde-1,*] t=t[0:nsonde-1,*] & rh=rh[0:nsonde-1,*] surfp=surfp[0:nsonde-1] SAVE,filename='/Users/pz/rico/rico_sonde_leg2.idlsave', $ p,z,t,rh,dates,nsonde,surfp print,'dun' END