Thanks, that's exactly what I wanted. The code had a little mistake with some
extra " symbols though. I have corrected it and this is the code that works
very nicely:
(define (sum-h5 fname step-func)
(let ((first-step? true))
(lambda (to-do)
(if first-step?
(begin ; just copy the output file to fname
(set! first-step? false)
((convert-h5 true
(string-append "h5math -e \"0.02*d1\" " fname "")
step-func) to-do))
; otherwise, add the output file to fname
((convert-h5 true
(string-append "h5math -e \"d1 + 0.02*d2\" " fname " "
fname "")
step-func) to-do)))))
Then you can call it e.g.:
(run-until T1 (after-time T2 (at-every T3 (sum-h5 "dpwr-sum.h5" output-dpwr))))
Thanks,
Floren
_______________________________________________
meep-discuss mailing list
[email protected]
http://ab-initio.mit.edu/cgi-bin/mailman/listinfo/meep-discuss