From 7acb95144a0cdf0c9bc815856a92109ddaf85590 Mon Sep 17 00:00:00 2001 From: Joaquim Luis Date: Tue, 28 Mar 2023 23:16:31 +0100 Subject: [PATCH] First attempt to fix #7255. Result looks reasonable but it's not correct --- src/gmt_fft.c | 2 +- src/potential/gravfft.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gmt_fft.c b/src/gmt_fft.c index 0f6ab81c737..618ed355282 100644 --- a/src/gmt_fft.c +++ b/src/gmt_fft.c @@ -1659,7 +1659,7 @@ int GMT_FFT_2D (void *V_API, gmt_grdfloat *data, unsigned int n_columns, unsigne int status, use; struct GMTAPI_CTRL *API = gmtfft_get_api_ptr (V_API); struct GMT_CTRL *GMT = API->GMT; - assert (mode & GMT_FFT_COMPLEX); /* GMT_FFT_REAL not implemented yet */ + assert ((mode & GMT_FFT_COMPLEX) || (mode & GMT_FFT_NO_DEMUX)); /* GMT_FFT_REAL not implemented yet */ use = gmtfft_2d_selection (GMT, n_columns, n_rows); GMT_Report (GMT->parent, GMT_MSG_INFORMATION, "2-D FFT using %s\n", GMT_fft_algo[use]); diff --git a/src/potential/gravfft.c b/src/potential/gravfft.c index 8fb50602ad9..c529e5aa48f 100644 --- a/src/potential/gravfft.c +++ b/src/potential/gravfft.c @@ -690,7 +690,8 @@ EXTERN_MSC int GMT_gravfft (void *V_API, int mode, void *args) { gravfft_do_isostasy (GMT, Grid[0], Ctrl, K); GMT_Report (API, GMT_MSG_INFORMATION, "Inverse FFT...\n"); - if (GMT_FFT (API, Grid[0], GMT_FFT_INV, GMT_FFT_COMPLEX, K)) + //if (GMT_FFT (API, Grid[0], GMT_FFT_INV, GMT_FFT_COMPLEX, K)) + if (GMT_FFT (API, Grid[0], GMT_FFT_INV, Ctrl->T.moho ? GMT_FFT_NO_DEMUX : GMT_FFT_COMPLEX, K)) Return (GMT_RUNTIME_ERROR); if (!doubleAlmostEqual (scale_out, 1.0))