; pro hdrtab ; ; Make table of header info from a series of timegcm volumes. ; To make file this pro reads: ; 1. Run rdtgcm on cray to print header summaries, and redirect ; to header files, e.g., RGR95.TSCIR01.hdrs, and rcp to vishnu. ; 2. fgrep "Model time" *.hdrs > mtime.hdr ; fgrep f107d *.hdrs > f107d.hdr ; fgrep f107a *.hdrs > f107a.hdr ; fgrep hp *.hdrs > hp.hdr ; fgrep cp *.hdrs > cp.hdr ; fgrep by *.hdrs > by.hdr ; 3. This pro reads mtime.hdr, f107d.hdr, etc. ; mxhist = 150 vols = strarr(mxhist) mtime = intarr(3,mxhist) f107d = fltarr(mxhist) f107a = fltarr(mxhist) hp = fltarr(mxhist) cp = fltarr(mxhist) by = fltarr(mxhist) on_ioerror,badio ; ; Read vol names and mtimes: ; flnm = 'mtime.hdr' openr,lu,flnm,/get_lun irec = 0 vol = ' ' md=0 & mh=0 & mm=0 while not eof(lu) do begin readf,lu,vol,md,mh,mm,format="(a13,30x,i3,1x,i2,1x,i2)" vols(irec) = vol mtime(0,irec)=md & mtime(1,irec)=mh & mtime(2,irec)=mm ; print,'irec=',irec,' vols(irec) = ',vols(irec),' mtime=',mtime(*,irec) irec = irec+1 end print,'EOF on file ',flnm,' at irec=',irec free_lun,lu ; ; Read f107d: ; flnm = 'f107d.hdr' openr,lu,flnm,/get_lun irec = 0 f107 = 0. while not eof(lu) do begin readf,lu,f107,format="(27x,f9.2)" f107d(irec) = f107 ; print,'irec=',irec,' f107d=',f107d(irec) irec = irec+1 end print,'EOF on file ',flnm,' at irec=',irec free_lun,lu ; ; Read f107a: ; flnm = 'f107a.hdr' openr,lu,flnm,/get_lun irec = 0 f107 = 0. while not eof(lu) do begin readf,lu,f107,format="(27x,f9.2)" f107a(irec) = f107 ; print,'irec=',irec,' f107a=',f107a(irec) irec = irec+1 end print,'EOF on file ',flnm,' at irec=',irec free_lun,lu ; ; Read hp: ; flnm = 'hp.hdr' openr,lu,flnm,/get_lun irec = 0 hp0 = 0. while not eof(lu) do begin readf,lu,hp0,format="(24x,f9.2)" hp(irec) = hp0 ; print,'irec=',irec,' hp(irec)=',hp(irec) irec = irec+1 end print,'EOF on file ',flnm,' at irec=',irec free_lun,lu ; ; Read cp: ; flnm = 'cp.hdr' openr,lu,flnm,/get_lun irec = 0 cp0 = 0. while not eof(lu) do begin readf,lu,cp0,format="(24x,f9.2)" cp(irec) = cp0 ; print,'irec=',irec,' cp(irec)=',cp(irec) irec = irec+1 end print,'EOF on file ',flnm,' at irec=',irec free_lun,lu ; ; Read by: ; flnm = 'by.hdr' openr,lu,flnm,/get_lun irec = 0 by0 = 0. while not eof(lu) do begin readf,lu,by0,format="(27x,f9.2)" by(irec) = by0 ; print,'irec=',irec,' by(irec)=',by(irec) irec = irec+1 end print,'EOF on file ',flnm,' at irec=',irec free_lun,lu ; ; Build table: ; ntab = irec flnm = 'hdrtab.dat' openw,lu,flnm,/get_lun printf,lu,' ' printf,lu,'VOLUME HISTORY F107D F107A HP CP BY' printf,lu,format="(72('-'))" for i=0,ntab-1 do begin printf,lu,format="(a13,2x,i3,':',i2,':',i2,5f9.2)",$ vols(i),mtime(*,i),f107d(i),f107a(i),hp(i),cp(i),by(i) endfor close,lu free_lun,lu ; return badio: print,'I/O error' return end