From 0a85d85598e9c5bf2cfe416674922b1489c4f46a Mon Sep 17 00:00:00 2001
From: Antoine Hoffmann <antoine.hoffmann@epfl.ch>
Date: Tue, 12 Mar 2024 14:29:23 +0100
Subject: [PATCH] remove LAPACK requirement when on marconi

---
 Makefile             | 5 ++---
 src/numerics_mod.F90 | 8 +++++++-
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/Makefile b/Makefile
index 97f4071d..dee47de3 100644
--- a/Makefile
+++ b/Makefile
@@ -48,15 +48,14 @@ marconi: compile
 
 # For compiling on marconi in single prec.
 marconi_sp: F90 = mpiifort
-marconi_sp: F90FLAGS = -O3 -xHOST
-marconi_sp: F90FLAGS = -DSINGLE_PRECISION -O3 -xHOST
+marconi_sp: F90FLAGS = -DNOLAPACK -DSINGLE_PRECISION -O3 -xHOST
 marconi_sp: EXEC = $(BINDIR)/gyacomo23_sp
 marconi_sp: dirs src/srcinfo.h
 marconi_sp: compile
 
 # For compiling on marconi in single prec.
 marconi_dbg: F90 = mpiifort
-marconi_dbg: F90FLAGS = -DSINGLE_PRECISION -g -traceback -ftrapuv -warn all -debug all
+marconi_dbg: F90FLAGS = -DNOLAPACK -DSINGLE_PRECISION -g -traceback -ftrapuv -warn all -debug all
 marconi_dbg: EXEC = $(BINDIR)/gyacomo23_dbg
 marconi_dbg: dirs src/srcinfo.h
 marconi_dbg: compile
diff --git a/src/numerics_mod.F90 b/src/numerics_mod.F90
index 357f092c..ebab9baa 100644
--- a/src/numerics_mod.F90
+++ b/src/numerics_mod.F90
@@ -107,6 +107,9 @@ SUBROUTINE evaluate_kernels
       ENDDO
     ENDDO
   CASE ('pade')
+#ifdef NOLAPACK
+    error stop "ERROR STOP: Pade kernels cannot be used when LAPACK is not included (marconi?)"
+#else
     ! Kernels based on the ORDER_NUM / ORDER_DEN Pade approximation of the kernels
     WRITE (*,*) 'Kernel approximation uses ', ORDER_NUM ,'/', ORDER_DEN, ' Pade approximation'
     DO ia  = 1,local_na
@@ -128,6 +131,7 @@ SUBROUTINE evaluate_kernels
         ENDDO
       ENDDO
     ENDDO
+#endif
   CASE DEFAULT
     DO ia  = 1,local_na
       DO eo  = 1,nzgrid
@@ -395,7 +399,8 @@ REAL(xp) FUNCTION taylor_kernel_n(order, n, y)
 	taylor_kernel_n = sum_variable
 END FUNCTION taylor_kernel_n
 
-
+#ifdef NOLAPACK
+#else
 REAL(xp) FUNCTION pade_kernel_n(n, y, N_NUM, N_DEN)
 	IMPLICIT NONE
 	INTEGER, INTENT(IN) :: n, N_NUM, N_DEN
@@ -488,6 +493,7 @@ SUBROUTINE find_pade_coefficients(pade_num_coeffs, pade_denom_coeffs, n, N_NUM,
 	END DO
 
 END SUBROUTINE find_pade_coefficients
+#endif
 !******************************************************************************!
 
 
-- 
GitLab