From 42627b85e3786e526a4c2c75e81ec4bd80890a42 Mon Sep 17 00:00:00 2001 From: daniau Date: Fri, 3 Oct 2008 13:56:24 +0000 Subject: [PATCH] git-svn-id: https://lxsd.femto-st.fr/svn/fvn@48 b657c933-2333-4658-acf2-d3c7c2708721 --- fvn_linear/fvn_linear.f90 | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/fvn_linear/fvn_linear.f90 b/fvn_linear/fvn_linear.f90 index 8d4b7aa..2e8bc79 100644 --- a/fvn_linear/fvn_linear.f90 +++ b/fvn_linear/fvn_linear.f90 @@ -213,29 +213,37 @@ end function ! ! .i. ! +! It seems that there's a problem with automatic arrays with gfortran +! in some circumstances. To allow compilation with gfortran we use here a temporary array +! for the call. Without that there's a warning at compile time and a segmentation fault +! during execution. This is odd as we double memory use. function fvn_op_s_matinv(a) implicit none real(4),dimension(:,:),intent(in) :: a - real(4),dimension(size(a,1),size(a,1)) :: fvn_op_s_matinv - call fvn_s_matinv(size(a,1),a,fvn_op_s_matinv,fvn_status) + real(4),dimension(size(a,1),size(a,1)) :: fvn_op_s_matinv,tmp_array + call fvn_s_matinv(size(a,1),a,tmp_array,fvn_status) + fvn_op_s_matinv=tmp_array end function function fvn_op_d_matinv(a) implicit none real(8),dimension(:,:),intent(in) :: a - real(8),dimension(size(a,1),size(a,1)) :: fvn_op_d_matinv - call fvn_d_matinv(size(a,1),a,fvn_op_d_matinv,fvn_status) + real(8),dimension(size(a,1),size(a,1)) :: fvn_op_d_matinv,tmp_array + call fvn_d_matinv(size(a,1),a,tmp_array,fvn_status) + fvn_op_d_matinv=tmp_array end function function fvn_op_c_matinv(a) implicit none complex(4),dimension(:,:),intent(in) :: a - complex(4),dimension(size(a,1),size(a,1)) :: fvn_op_c_matinv - call fvn_c_matinv(size(a,1),a,fvn_op_c_matinv,fvn_status) + complex(4),dimension(size(a,1),size(a,1)) :: fvn_op_c_matinv,tmp_array + call fvn_c_matinv(size(a,1),a,tmp_array,fvn_status) + fvn_op_c_matinv=tmp_array end function function fvn_op_z_matinv(a) implicit none complex(8),dimension(:,:),intent(in) :: a - complex(8),dimension(size(a,1),size(a,1)) :: fvn_op_z_matinv - call fvn_z_matinv(size(a,1),a,fvn_op_z_matinv,fvn_status) + complex(8),dimension(size(a,1),size(a,1)) :: fvn_op_z_matinv,tmp_array + call fvn_z_matinv(size(a,1),a,tmp_array,fvn_status) + fvn_op_z_matinv=tmp_array end function ! -- 2.16.4