;******************************************************************** ; ; idl_scan ; ; IDL routine to quickly scan all files, plot same quantity for each. ; ; Bill Ridgway, Applied Research Corporation & ; NASA Goddard Laboratory for Atmospheres ; Email: ridgway@climate.gsfc.nasa.gov ; Phone: (301) 286-9138 ; ;******************************************************************** ; ; First get list of files for plotting spawn,'ls -1 ../idl_data',dataname nfiles = n_elements(dataname) choose: choice = 2 print, ' ' print, ' Select type of plot to be done :' print, ' ' print, ' 1) Cooling Rate Vertical Profile ' print, ' 2) Atmospheric Flux Divergence Spectrum ' print, ' ' ; read, choice if choice lt 1 or choice gt 2 then goto, choose ; Send plot to X window and define its size set_plot, 'X' if choice eq 1 then window, xsize=640, ysize=800 if choice eq 2 then window, xsize=800, ysize=400 for j=0,nfiles-1 do begin print, ' Processing File : ',dataname(j) openr, 1, '../idl_data/' + dataname(j) ; read initial header, including control parameters nlyrs=0 & nlvls=0 & nbnds=0 & tsfc=0. & ptrp=0. readu, 1, nlyrs, nlvls, nbnds, psfc, tsfc, ptrp wnl=0. & wnu=0. & fus=0. & fds=0. & fur=0. & fdr=0. & fut=0. readu, 1, wnl, wnu, fus, fds, fur, fdr, fut ; read layer data data1 = fltarr(6,nlyrs) readu, 1, data1 plyr = data1(0,*) tlyr = data1(1,*) air = data1(2,*) h2o = data1(3,*) o3 = data1(4,*) htrt = data1(5,*) cool = -data1(5,*) ; read level data data2 = fltarr(5,nlvls) readu, 1, data2 plvl = data2(0,*) tlvl = data2(1,*) flxu = data2(2,*) flxd = data2(3,*) flxn = data2(4,*) ; read spectral band data band1 = fltarr(nbnds) band2 = fltarr(nbnds) fusfc = fltarr(nbnds) fdsfc = fltarr(nbnds) futrp = fltarr(nbnds) fdtrp = fltarr(nbnds) futoa = fltarr(nbnds) fup = fltarr(nbnds,nlvls) fdn = fltarr(nbnds,nlvls) fnt = fltarr(nbnds,nlvls) htr = fltarr(nbnds,nlyrs) data3 = fltarr(nlvls) data4 = fltarr(nlyrs) for i=0,nbnds-1 do begin readu, 1, bnd1, bnd2, fus, fds, fur, fdr, fut band1(i) = bnd1 band2(i) = bnd2 fusfc(i) = fus fdsfc(i) = fds futrp(i) = fur fdtrp(i) = fdr futoa(i) = fut readu, 1, data3 fup(i,*) = data3 readu, 1, data3 fdn(i,*) = data3 readu, 1, data3 fnt(i,*) = data3 readu, 1, data4 htr(i,*) = data4 endfor close,1 ; set up color table (b,w,r,g,b) r = [0,1,1,0,0] g = [0,1,0,1,0.6] b = [0,1,0,0,1] tvlct, r*255, g*255, b*255 !p.color = 1 ; simple plot of cooling rate profile ------------------- if choice eq 1 then begin plot, cool, plvl, $ charsize = 1.3, $ title = 'FILE = ' + dataname(j), $ xtitle = 'Cooling Rate (K)', $ ytitle = 'Pressure (mb)', $ xrange = [-2,10], $ xtickv = [-2,0,2,4,6,8,10], $ xticks = 6, $ xminor = 4, $ yrange = [1013,0], $ ytickv = [1000,800,600,400,200,0], $ yticks = 5, $ yminor = 4 endif ; simple plot of spectral flux divergence ---------------- if choice eq 2 then begin v = 0.5 * ( band1(*) + band2(*) ) dfv = fnt(*,0) - fnt(*,nlvls-1) plot, v, dfv, $ charsize = 1.3, $ title = 'FILE = ' + dataname(j), $ xtitle = 'Wavenumber (cm-1)', $ ytitle = 'Atmosphere Net Flux Divergence (W/m**2/cm-1)', $ xrange = [0,3000], $ xtickv = [0,1000,2000,3000], $ xticks = 3, $ xminor = 4, $ yrange = [-1,5], $ ytickv = [-1,0,1,2,3,4,5], $ yticks = 6, $ yminor = 4 endif wait, 2 endfor pltend: end