program icesat_ave cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc c c I C E S A T _ A V E c c Averages and tresholds 40 Hz ICESat data (geoid assumed removed) c Input: c c ifile c ofile c trsh c c (c) Rene Forsberg, DNSC/Denmark, yyc apr 2006 c cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc implicit double precision(a-h,o-z) character*72 ifile,ofile c write(*,*) 'input: ifile' write(*,*) ' ofile' write(*,*) ' trsh' read(*,'(a)') ifile read(*,'(a)') ofile read(*,*) trsh open(10,file=ifile,status='old') open(20,file=ofile,status='unknown') c iave = 0 sumlat = 0 sumlon = 0 sumt = 0 sumh = 0 hmin = 9999 nout = 0 c 10 read(10,*,end=20) iday,rlat,rlon,t,h c if (abs(h).gt.trsh) goto 10 if (nout.eq.0.and.iave.eq.0) then idayp = iday tp = t endif c iave = iave+1 sumlat = sumlat+rlat sumlon = sumlon+rlon sumt = sumt+t sumh = sumh+h if (h.lt.hmin) hmin = h c if (iday.ne.idayp.or.abs(t-tp).gt.1.d0.or.iave.ge.40) then if (iave.ge.1) then write(20,15) . iday,sumlat/iave,sumlon/iave,sumt/iave,sumh/iave,hmin,iave 15 format(i5,2f11.5,f11.2,2f9.3,i4) nout = nout+1 endif iave = 0 sumlat = 0 sumlon = 0 sumt = 0 sumh = 0 hmin = 9999 tp = t idayp = iday endif goto 10 c 20 if (iave.ge.1) then write(20,15) . iday,sumlat/iave,sumlon/iave,sumt/iave,sumh/iave,hmin,iave nout = nout+1 endif write(*,*) 'no of output records: ',nout end