;----------------------------------------------------------------------------- ; ; Gather run time statistics from TROPoe log files. ; ; 2026-jan-23 Original version. By Dave Allured. ; 2026-jan-24 Fix handling for early log files with no time steps. ; ; Go to the log file directory. Then run this script with no arguments. ; ;----------------------------------------------------------------------------- begin files = systemfunc ("ls -1 mlog_tropoe*") nfiles = dimsizes (files) print ("nfiles = " + sprinti ("%3i", nfiles) \ + " Ntimes Min Mean Max Server") do i = 0, nfiles-1 lines := systemfunc ("grep 'compute Jacobian' " + files(i)) server = systemfunc ("grep Server " + files(i) + " | cut -f2 -d=") server = where (ismissing (server(:)), "--", server(:)) server = str_strip (str_get_field (server, 1, ".")) ;; print (files(i) + " nlines = " + dimsizes (lines)) ;; print (lines(0:2)) time_str := str_get_field (lines(:), 3, " ") ;; print (time_str(0:2)) if (ismissing (lines(0))) then ntimes = 0 tmin = " " tavg = " " tmax = " " else times := tofloat (time_str(:)) ntimes = dimsizes (times) tmin = sprintf ("%8.1f", min (times)) tavg = sprintf ("%8.1f", avg (times)) tmax = sprintf ("%8.1f", max (times)) end if ;; print ("ntimes = " + ntimes) print (files(i) + sprinti ("%7i", ntimes) + tmin + tavg + tmax \ + " " + server) end do end