I was just giving the GYRE runtime efficiency a quick thought, and would like to share a very raw idea.
Let's focus on the user-supplied
Code: Select all
The most efficient way to scan for all roots of the S(omega) determinant within the pre-defined frequency scan range, say from f_a to f_b, is to compute at least N trial frequencies, f_i between f_a and f_b. So, if the n_freq in the inlist would be less than N (the total number of roots in this frequency range), some modes will be missed/skipped, in either the linear or inverse scheme. If one specifies n_freq > N, then exactly N discrete set of modes will be found, and the life is happy. However, if a user specifies n_freq >> N, nothing new is going to be resolved, and that is an immense loss of resources (and computation time). So, why not get rid of n_freq, if possible?
I "speculate" you can very simply optimise it.
if one solves S(omega) twice, one for the lower frequency and one for the upper frequency, and subtract their corresponding radial order (n = |n_p| + |n_g|), then one can expect the range of radial orders between the two modes closest to f_a and f_b. Consequently, the difference between the two radial orders of the two-end modes "could" gives an accurate estimate of the expected number of roots of S(omega), hence, N. Thus, n_freq can be internally estimated, and set, instead of externally defined.
For the sake of conservation, n_freq can be set by e.g. 10% larger than N.
I "imagine" this would straightforwardly work for pure p- and/or g-modes. This may get a bit nasty for mixed modes, and specially when rotation is included (since higher-order g-modes get too packed with decreasing frequency), but a straightforward scheme may also be found.
Very raw idea, but just liked to share it with you. For some practical reason that I'm unaware of, it may even not work.
Let me know please what you think.