pro read_nc_psfdata,filename,rec,idim,jdim,kdim,type,tplevs,temp ; 9/7/07 Read in psf, am, bm, and pt for calculation of 3D plevs. cdfid=ncdf_open(filename) ; read in type (of psf data) speciesid=ncdf_varid(cdfid,type) speciesida=ncdf_varid(cdfid,'am') speciesidb=ncdf_varid(cdfid,'bm') speciesidp=ncdf_varid(cdfid,'pt') if type eq 'psf' then speciesidt=ncdf_varid(cdfid,'kel') if type eq 'psf_freq1' then speciesidt=ncdf_varid(cdfid,'kel_freq1') if type eq 'psf_overpass' then speciesidt=ncdf_varid(cdfid,'kel_overpass') ; Define the dimensions of the array (lon x lat). psf is 'spec'. spec=fltarr(idim,jdim) spec_am=fltarr(kdim) & spec_bm=spec_am spec_pt=fltarr(1) temp=fltarr(idim,jdim,kdim) ; If there is only 1 time record, then use count=[ni,nj]. Last element of ; offset and count is time record. ; ncdf_varget,cdfid,speciesid,spec,count=[idim,jdim,1],offset=[0,0,rec-1] ncdf_varget,cdfid,speciesida,spec_am ncdf_varget,cdfid,speciesidb,spec_bm ncdf_varget,cdfid,speciesidp,spec_pt ; temporarily disable this ;ncdf_varget,cdfid,speciesidt,temp,count=[idim,jdim,kdim,1],offset=[0,0,0,rec-1] ncdf_close,cdfid tplevs=fltarr(idim,jdim,kdim) ; spec_pt appears to be an array now but probably was a scalar if n_elements(spec_pt) gt 1 then spec_pt=spec_pt(0) for k=0,kdim-1 do tplevs(*,*,k)=spec_am(k)*spec_pt+spec_bm(k)*spec end