pro read_ncemi, infile, dn, d ;==================================================== ; 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 ;open the netcdf file ncid = ncdf_open(infile) ;if variable name not entered ;write out the variable id and name ;THEN have the user choose if n_elements(dn) eq 0 then begin get_ncdf_varnum, ncid, vid, cb_title endif else begin ;ELSE get the data variable requested vid = ncdf_varid( ncid, dn) cb_title = dn endelse ;read in the data from the netcdf file ncdf_varget, ncid, vid, v v = transpose(val) ;sum over the record dimension (first) ;get the dimensions ;do the average sum = total( v, 1 ) d = sum / (size( v ))(1) ;close the netcdf file ncdf_close, ncid ;======================================== return end