pro read_haloe_sizedist_netcdf,filen,date,time,lat,lon,mode,ztrop,zctop,z,p,t,con,rad,wid,sulf ;----------------------------------------------------------------------------- ; Routine reads HALOE aerosol size distribution data from a netcdf file. ; ; Input: ; filen......complete path + name of the HALOE file ; ; Output: ; date.......julian date as yyyyddd ; time.......time as decimal hours past midnight ; lat........latitude ; lon........longitude, deg. E ; mode.......8 = sunset, 10 = sunrise ; ztrop......tropopause height, km ; zctop......cloud top height, 0 if no cloud, km ; z..........altitude, km, common grid for all records and parameters below ; all variables below are fltarr(# altitude, # records) ; p..........pressure, mb ; t..........temperature, K, " ; con........aerosol concentration, #/cm3, for the lognormal size distribution ; rad........median radius, microns, " ; wid........width, unitless, " ; sulf.......aerosol composition, wt. % H2SO4 ; ; Example use of data: ; to plot the first profile of median radius type: plot,rad(*,0),z ; ; Source: Mark Hervig ;----------------------------------------------------------------------------------- ;- IDL ncdf_vardef decided to not allow variable names w/spaces, ; the variables below are for a work-around in case the vars are ; named with an underscore instead of a space. tropstr = 'tropopause altitude' ctopstr = 'cloud top altitude' mradstr = 'median radius' ;- open the file id = ncdf_open(filen) glob = ncdf_inquire(id) ;- echo information about the data print,'data dimensions:' for i=0,glob.ndims-1 do begin ncdf_diminq,id,i,name,size print,' ', name, size endfor print, 'Variable information' for i=0,glob.nvars-1 do begin info = ncdf_varinq(id, i) varname = info.name print,varname k = strpos(varname,'tropopause') & if (k ge 0) then tropstr = varname k = strpos(varname,'cloud' ) & if (k ge 0) then ctopstr = varname k = strpos(varname,'radius' ) & if (k ge 0) then mradstr = varname for j=0,info.natts-1 do begin attname = ncdf_attname(id,i,j) ncdf_attget,id,i,attname,attvalue print,' ',attname, ' = ', string(attvalue) endfor endfor ;- read the data ncdf_varget,id,'date', date, offset=[0,0] ncdf_varget,id,'time', time, offset=[0,0] ncdf_varget,id,'latitude', lat, offset=[0,0] ncdf_varget,id,'longitude', lon, offset=[0,0] ncdf_varget,id,'mode', mode, offset=[0,0] ncdf_varget,id,tropstr, ztrop, offset=[0,0] ncdf_varget,id,ctopstr, zctop, offset=[0,0] ncdf_varget,id,'altitude', z ncdf_varget,id,'pressure', p, offset=[0,0] ncdf_varget,id,'temperature', t, offset=[0,0] ncdf_varget,id,'concentration', con, offset=[0,0] ncdf_varget,id, mradstr, rad, offset=[0,0] ncdf_varget,id,'width', wid, offset=[0,0] ncdf_varget,id,'composition', sulf, offset=[0,0] ;- close the file ncdf_close,id ;- toss out the missing records, just in case k = where(date gt 0) date = date(k) time = time(k) lat = lat(k) lon = lon(k) mode = mode(k) ztrop =ztrop(k) zctop =zctop(k) p = p(*,k) t = t(*,k) con = con(*,k) rad = rad(*,k) wid = wid(*,k) sulf = sulf(*,k) ;- done return end