pro read_nchead, infile, hd, platform, instrument, experiment ;==================================================== ; Check arguments ;==================================================== if n_elements(infile) eq 0 then begin print, 'Provide input file name' progexit endif dummy = findfile(infile, count=count) if (count eq 0) then begin print,'Input file: '+infile+' cannot be found' progexit endif ;make return header array hd = fltarr(6) ;open the netcdf file ncid = ncdf_open(infile) ;get the number of data records vid = ncdf_dimid( ncid, 'record') ncdf_diminq, ncid, vid, dn, ds hd[0] = ds ;get the site name ncdf_attget,ncid,/global,'site_name',val platform = string( val ) ;get the instrument name ncdf_attget,ncid,/global,'instrument_name',val instrument = string( val ) ;get the experiment name ncdf_attget,ncid,/global,'experiment_name',val experiment = string( val ) ;close the netcdf file ncdf_close, ncid ;======================================== return end