From cc6a643a18d3fa4e926091bc2d094364645b1441 Mon Sep 17 00:00:00 2001 From: Nick Featherstone Date: Wed, 26 Jun 2024 10:13:29 -0600 Subject: [PATCH 1/4] Added finite-difference-aware logic to Diagnostics_Second_Derivatives.F90 --- .../Diagnostics_Second_Derivatives.F90 | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/src/Diagnostics/Diagnostics_Second_Derivatives.F90 b/src/Diagnostics/Diagnostics_Second_Derivatives.F90 index 62fa70b9..72f9519f 100644 --- a/src/Diagnostics/Diagnostics_Second_Derivatives.F90 +++ b/src/Diagnostics/Diagnostics_Second_Derivatives.F90 @@ -27,6 +27,7 @@ Module Diagnostics_Second_Derivatives Use Diagnostics_Base Use Structures Use Spectral_Derivatives + Use Finite_Difference, Only : d_by_dx3d3 Implicit None @@ -378,8 +379,12 @@ Subroutine Compute_Second_Derivatives(inbuffer) !Move to p1b configuration Call d2buffer%reform() Call d2buffer%construct('p1a') - Call gridcp%To_Spectral(d2buffer%p1b,d2buffer%p1a) - Call gridcp%dealias_buffer(d2buffer%p1a) + If (chebyshev) Then + Call gridcp%To_Spectral(d2buffer%p1b,d2buffer%p1a) + Call gridcp%dealias_buffer(d2buffer%p1a) + Else + d2buffer%p1a = d2buffer%p1b + Endif d2buffer%p1b = 0.0 d2buffer%config='p1a' @@ -387,11 +392,18 @@ Subroutine Compute_Second_Derivatives(inbuffer) !//////////////////////////////////////////////////////////// ! Steps 5-6: Load d2_by_dr2 and d2_by_drdt into the buffer - Do i = 1, nddfields*2 - j = i+nddfields*2 - Call gridcp%d_by_dr_cp(i,j,d2buffer%p1a,1) - Enddo - Call gridcp%From_Spectral(d2buffer%p1a,d2buffer%p1b) + If (chebyshev) Then + Do i = 1, nddfields*2 + j = i+nddfields*2 + Call gridcp%d_by_dr_cp(i,j,d2buffer%p1a,1) + Enddo + Call gridcp%From_Spectral(d2buffer%p1a,d2buffer%p1b) + Else + Do i = 1, nddfields*2 + j = i+nddfields*2 + Call d_by_dx3d3(i,j,d2buffer%p1a,1) + Enddo + Endif d2buffer%p1a=d2buffer%p1b Call d2buffer%deconstruct('p1b') From b0728b702b633892318644e6af5039ea939ce2eb Mon Sep 17 00:00:00 2001 From: Nick Featherstone Date: Wed, 26 Jun 2024 10:31:44 -0600 Subject: [PATCH 2/4] updated dependencies --- src/Makefile.fdeps | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makefile.fdeps b/src/Makefile.fdeps index 0b7dbf82..6530efb2 100644 --- a/src/Makefile.fdeps +++ b/src/Makefile.fdeps @@ -25,7 +25,7 @@ Diagnostics_Mean_Correction.o : Diagnostics_Mean_Correction.F90 indices.F Diagno Diagnostics_Miscellaneous.o : Diagnostics_Miscellaneous.F90 indices.F Diagnostics_Base.o Diagnostics_Poynting_Flux.o : Diagnostics_Poynting_Flux.F90 indices.F Diagnostics_Base.o Diagnostics_Scalars.o : Diagnostics_Scalars.F90 indices.F Controls.o Diagnostics_Base.o -Diagnostics_Second_Derivatives.o : Diagnostics_Second_Derivatives.F90 indices.F Spectral_Derivatives.o Structures.o Diagnostics_Base.o +Diagnostics_Second_Derivatives.o : Diagnostics_Second_Derivatives.F90 indices.F Finite_Difference.o Spectral_Derivatives.o Structures.o Diagnostics_Base.o Diagnostics_Thermal_Energies.o : Diagnostics_Thermal_Energies.F90 indices.F Diagnostics_ADotGradB.o Diagnostics_Base.o Diagnostics_Thermal_Equation.o : Diagnostics_Thermal_Equation.F90 indices.F Diagnostics_ADotGradB.o Diagnostics_Base.o Diagnostics_Thermodynamic_Gradients.o : Diagnostics_Thermodynamic_Gradients.F90 indices.F Diagnostics_Base.o From e46716a7e3a8dc87c4eedeee02a73c06e0dbf4b3 Mon Sep 17 00:00:00 2001 From: Nick Featherstone Date: Wed, 26 Jun 2024 10:58:53 -0600 Subject: [PATCH 3/4] Updated changelog. --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 53d7baa9..84589725 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Fixed +- Fixed a bug that was causing Rayleigh to crash during output if finite-difference mode was active and second-order derivatives in radius were required for output. \[Nick Featherstone; 6-26-2024; [#566](https://github.com/geodynamics/Rayleigh/pull/566) \] + - Rayleigh no longer attempts to update the record count and close a diagnostics file (e.g., G_Avgs) that failed to open correctly. \[Nick Featherstone; 6-18-2024; [#510](https://github.com/geodynamics/Rayleigh/pull/510) , [#523](https://github.com/geodynamics/Rayleigh/pull/523) \] - Fixed a bug that was causing documentation build to become progressively slower for subsequent builds due to recursive inclusion of the doc\build directory \[Philipp Edelmann; 6-17-2024; [#527](https://github.com/geodynamics/Rayleigh/pull/527)\] From 300c043c544f0a038f4cebbc7c66976b8a2aa93f Mon Sep 17 00:00:00 2001 From: Nick Featherstone Date: Wed, 26 Jun 2024 11:00:03 -0600 Subject: [PATCH 4/4] Moved changelog addition to end of fixes (was at beginning). --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 84589725..1628adee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,8 +38,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm ### Fixed -- Fixed a bug that was causing Rayleigh to crash during output if finite-difference mode was active and second-order derivatives in radius were required for output. \[Nick Featherstone; 6-26-2024; [#566](https://github.com/geodynamics/Rayleigh/pull/566) \] - - Rayleigh no longer attempts to update the record count and close a diagnostics file (e.g., G_Avgs) that failed to open correctly. \[Nick Featherstone; 6-18-2024; [#510](https://github.com/geodynamics/Rayleigh/pull/510) , [#523](https://github.com/geodynamics/Rayleigh/pull/523) \] - Fixed a bug that was causing documentation build to become progressively slower for subsequent builds due to recursive inclusion of the doc\build directory \[Philipp Edelmann; 6-17-2024; [#527](https://github.com/geodynamics/Rayleigh/pull/527)\] @@ -52,6 +50,8 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Running the configure command now requires the correct combination of library locations to be specified; \[Brandon Lazard; 6-21-2024] [#535](https://github.com/geodynamics/Rayleigh/pull/535) +- Fixed a bug that was causing Rayleigh to crash during output if finite-difference mode was active and second-order derivatives in radius were required for output. \[Nick Featherstone; 6-26-2024; [#566](https://github.com/geodynamics/Rayleigh/pull/566) \] + ## [1.2.0] - 5-29-2024