; ; 10/07 btf: ; ; Read netcdf file output by tgcmproc_f90 flnm_cdf_xyut. ; These files contain vars dimensioned (nsloc,nslev,time), ; i.e., time at selected locations and selected levels (zp or ht). ; They can also contain height-independent fof2 and hmf2. ; ; This procedure reads a series of these files and makes ; line plots ut vs field. This might be hourly for a full ; year. ; ; For example, these nc files are produced by tgcmproc_f90 ; (e.g., 30 days per file for a full year) for Michael Mendillo ; and Joey, see ~foster/usr/mendillo, and /toshi/ftp/pub/foster/mendillo. ; pro xyut dir = "/toshi/ftp/pub/foster/mendillo/timegcm1.2_sy2c" fileroot = "timegcm1.2_sy2c_d" path_spec = dir+"/"+fileroot+"*.nc" ; files = file_search(path_spec) if (files[0] eq "") then begin print,'>>> Found no files in path spec ',path_spec return endif nfiles = n_elements(files) print,'path_spec=',path_spec,' nfiles=',nfiles ntimes = 0 itime0 = 0 for ifile=0,nfiles-1 do begin ncid = ncdf_open(files[ifile],/nowrite) print,'Opened file ',files[ifile] finfo = ncdf_inquire(ncid) ndims = finfo.ndims for idim=0,ndims-1 do begin ncdf_diminq,ncid,idim,dimname,dimsize if (dimname eq 'time') then begin ntime = dimsize ntimes = ntimes+ntime endif if (dimname eq 'nslev') then nslev=dimsize if (dimname eq 'nsloc') then nsloc=dimsize endfor ncdf_close,ncid endfor print,'nslev=',nslev,' nsloc=',nsloc print,'Total ntimes=',ntimes end