geodynamics / Rayleigh

Rayleigh: Pseudo-spectral MHD
GNU General Public License v3.0
59 stars 49 forks source link

Bug Fix: Diagnostics and Second Radial Derivatives when Using Finite-Difference Mode #566

Closed feathern closed 2 weeks ago

feathern commented 1 month ago

This fixes a bug related to finite-difference mode. When diagnostic output quantities are requested that require a second radial derivative, that derivative is calculated at output time. The subroutine that handles the derivative calculations at output time was lacking any logic that would call the appropriate finite-difference derivative routine. Instead, a Chebyshev derivative routine was called, which caused a crash because the Chebyshev grid object had not been initialized. This PR fixes this bug by adding appropriate finite-difference logic to Diagnostics_Second_Derivatives.F90.

feathern commented 1 month ago

I forgot to update the dependencies file originally. I just did, and now the tests pass.

tukss commented 3 weeks ago

@rpvin Maybe that fixes your crashes?